/* zero-taskboard - одна тёмная тема */
:root {
  --bg: #0d0d10;
  --bg-2: #141419;
  --bg-3: #1b1b22;
  --border: rgba(156, 163, 175, 0.16);
  --border-strong: rgba(156, 163, 175, 0.30);
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.spacer { flex: 1; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 700; letter-spacing: 0.4px; font-size: 15px; }
.view-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-switch button {
  background: transparent; color: var(--text-dim); border: 0;
  padding: 5px 12px; cursor: pointer; font-size: 13px;
}
.view-switch button.active { background: var(--bg-3); color: var(--text); }
.topbar-filters { display: flex; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-badge {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}

/* ---------- controls ---------- */
.btn {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--border-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.12); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); border-color: transparent; }

select, input[type="text"], input[type="password"], input[type="number"], textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; font-family: inherit;
  outline: none; width: 100%;
}
select:focus, input:focus, textarea:focus { border-color: var(--accent); }
.topbar select { width: auto; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-dim); }
.check-label { flex-direction: row; align-items: center; gap: 8px; }
.check-label input { width: auto; }

/* ---------- board ---------- */
.main { padding: 18px; }
.board {
  display: flex; gap: 14px; align-items: flex-start;
  overflow-x: auto; padding-bottom: 20px;
}
.col {
  background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 270px; width: 270px; flex-shrink: 0;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 120px);
}
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.col-count {
  background: var(--bg-3); border-radius: 10px;
  padding: 1px 8px; font-size: 11px; color: var(--text-dim);
}
.col-body {
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; min-height: 40px; flex: 1;
}

/* ---------- card ---------- */
.card {
  background: var(--bg-3);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; cursor: grab;
  display: flex; flex-direction: column; gap: 7px;
}
.card:hover { border-color: var(--border-strong); }
.card.sortable-ghost { opacity: 0.35; }
.card.sortable-drag { cursor: grabbing; }
.card-title { font-size: 13px; line-height: 1.35; word-break: break-word; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text-dim);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge-stage { border-color: transparent; color: #fff; opacity: 0.85; }
.prio-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.prio-high { background: var(--danger); }
.prio-low { background: var(--text-dim); opacity: 0.5; }
.avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; margin-left: auto; flex-shrink: 0;
}
.avatar.empty { background: transparent; border: 1px dashed var(--border-strong); color: transparent; }

/* ---------- stages view ---------- */
.stages { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.stage-block {
  background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.stage-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-weight: 600; cursor: pointer;
}
.stage-head:hover { color: var(--accent-hover); }
.stage-progress { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.stage-tasks { padding: 6px 0; }
.stage-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px; cursor: pointer; font-size: 13px;
}
.stage-row:hover { background: var(--bg-3); }
.stage-row .st-badge {
  font-size: 11px; padding: 1px 8px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border); color: var(--text-dim); min-width: 78px; text-align: center;
}
.st-backlog { }
.st-in_progress { border-color: var(--accent); color: var(--accent-hover); }
.st-review { border-color: #eab308; color: #eab308; }
.st-done { border-color: var(--ok); color: var(--ok); }
.stage-row .row-title { flex: 1; word-break: break-word; }
.stage-row.done .row-title { text-decoration: line-through; color: var(--text-dim); }
.stage-empty { padding: 10px 14px; color: var(--text-dim); font-size: 12px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px;
}
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  width: 520px; max-width: 100%;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.modal-sm { width: 380px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 15px;
}
.modal-row { display: flex; gap: 12px; }
.modal-row label { flex: 1; }
.modal-foot { display: flex; align-items: center; gap: 8px; }

/* ---------- activity panel ---------- */
.activity-panel {
  position: fixed; top: 0; right: -360px; bottom: 0; width: 350px; z-index: 90;
  background: var(--bg-2);
  border-left: 1px solid var(--border-strong);
  transition: right 0.2s ease;
  display: flex; flex-direction: column;
}
.activity-panel.open { right: 0; }
.activity-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.activity-list { overflow-y: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 10px; }
.activity-item { font-size: 12px; line-height: 1.5; }
.activity-item .who { color: var(--accent-hover); font-weight: 600; }
.activity-item .when { color: var(--text-dim); font-size: 11px; }

/* ---------- login ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; width: 320px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-brand { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.login-err {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid var(--danger); border-radius: 8px;
  color: var(--danger); padding: 8px 10px; font-size: 12px;
}
