/* ============================================================
   GrowDev — project workspace demo
   Tokens → shell → components → views → responsive
   ============================================================ */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --ok: #16a34a;
  --ok-soft: #ecfdf5;
  --ok-border: #a7f3d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --purple-border: #ddd6fe;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 14px -4px rgba(15, 23, 42, .10), 0 2px 6px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 18px 48px -16px rgba(15, 23, 42, .22), 0 6px 18px -8px rgba(15, 23, 42, .10);
  --ring: 0 0 0 3px rgba(37, 99, 235, .18);

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --sidebar-w: 264px;
  --topbar-h: 66px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --surface: #111a2c;
  --surface-2: #0f172a;
  --surface-3: #18243c;
  --border: #1f2b45;
  --border-strong: #2c3b5a;
  --ink: #e8eefb;
  --ink-2: #d3dced;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-ink: #ffffff;
  --accent-soft: #152647;
  --accent-border: #1e3a6e;
  --ok: #34d399;
  --ok-soft: #0d2a24;
  --ok-border: #14532d;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --warn-border: #4d3a12;
  --danger: #f87171;
  --danger-soft: #2a1315;
  --danger-border: #5b1f22;
  --purple: #a78bfa;
  --purple-soft: #1d1838;
  --purple-border: #3b2f68;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-md: 0 6px 18px -6px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
  --ring: 0 0 0 3px rgba(59, 130, 246, .28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 300;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: width .22s var(--ease), transform .26s var(--ease);
}
.side-head {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; border-radius: var(--r-sm); }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, #3b82f6, #2563eb 60%, #1d4ed8);
  color: #fff;
  box-shadow: 0 3px 10px -2px rgba(37, 99, 235, .55);
}
.brand-mark .ic { width: 18px; height: 18px; stroke-width: 2.1; fill: rgba(255,255,255,.16); }
.brand-name { font-weight: 800; letter-spacing: .14em; font-size: 14px; white-space: nowrap; }
.sidebar .side-close { display: none; }

.side-nav { padding: 18px 12px; overflow-y: auto; flex: 1; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint); padding: 4px 10px 8px; white-space: nowrap;
}
.nav-label:not(:first-child) { margin-top: 20px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
  margin-bottom: 2px;
}
.nav-item .ic { width: 18px; height: 18px; color: var(--muted); transition: color .15s; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item:hover .ic { color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active .ic { color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item span:first-of-type { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count {
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--muted); border-radius: 99px; padding: 1px 7px; min-width: 22px; text-align: center;
}
.nav-item.active .nav-count { background: var(--surface); border-color: var(--accent-border); color: var(--accent); }

.side-foot {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex; align-items: center; gap: 6px;
}
.user-card {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
  background: transparent; border: 0; border-radius: var(--r-sm);
  padding: 6px; text-align: left;
}
.user-card:hover { background: var(--surface-3); }
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 99px;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 600; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.user-mail { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapse-btn { width: 24px; height: 30px; color: var(--muted); }

/* collapsed */
.sidebar.collapsed { width: 78px; }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-meta { display: none; }
.sidebar.collapsed .side-head { padding: 0 22px; justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.sidebar.collapsed .nav-item.active::before { left: -16px; }
.sidebar.collapsed .side-foot { flex-direction: column; }
.sidebar.collapsed .user-card { justify-content: center; }
.sidebar.collapsed .collapse-btn .ic { transform: rotate(180deg); }
.sidebar.collapsed .brand { flex: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  flex: none;
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .menu-btn { display: none; }
.page-id { min-width: 0; }
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.topbar-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s, transform .12s;
  position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.solid { background: var(--accent); color: #fff; border-color: var(--accent); }
.icon-btn.solid:hover { background: var(--accent-hover); color: #fff; }
.has-dot .dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 99px;
  background: var(--danger); border: 2px solid var(--bg);
}
[data-theme="dark"] .theme-light-ic { display: none; }
[data-theme="light"] .theme-dark-ic { display: none; }

.global-search {
  position: relative;
  width: 320px;
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 10px;
  height: 38px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.global-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.search-ic { color: var(--faint); width: 16px; height: 16px; }
.global-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: 13px; padding: 0 8px;
}
.global-search input::placeholder { color: var(--faint); }
.global-search kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--faint);
  border: 1px solid var(--border); border-bottom-width: 2px;
  background: var(--surface); border-radius: 5px; padding: 1px 5px; line-height: 1.4;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 60; max-height: 380px; overflow-y: auto;
}
.search-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--faint); padding: 10px 12px 4px;
}
.search-result {
  width: 100%; border: 0; background: transparent; text-align: left;
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  font-size: 13px; color: var(--ink);
}
.search-result:hover, .search-result:focus-visible { background: var(--surface-3); outline: none; }
.search-result .ic { width: 16px; height: 16px; color: var(--muted); }
.search-result small { display: block; color: var(--muted); font-size: 11px; }
.search-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

.avatar-btn { background: none; border: 0; padding: 0; }
button.avatar { border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }

/* popovers */
.pop-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 300px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
.quick-menu { width: 210px; padding: 6px; }
.quick-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; padding: 9px 10px; border-radius: var(--r-xs);
  font-size: 13px; text-align: left; color: var(--ink-2);
}
.quick-menu button:hover { background: var(--surface-3); }
.quick-menu .ic { width: 16px; height: 16px; color: var(--muted); }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-pop { width: 330px; }
.notif-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif-ic {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
}
.notif-ic .ic { width: 15px; height: 15px; }
.notif-item p { font-size: 12.5px; }
.notif-item span { font-size: 11px; color: var(--muted); }

/* ---------- generic ---------- */
.content { padding: 26px 28px 56px; flex: 1; width: 100%; max-width: 1420px; margin: 0 auto; overflow-x: hidden; }
.view { animation: viewIn .26s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.view-title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.view-sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid transparent; font-size: 13px; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}
.btn .ic { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(37,99,235,.25), inset 0 1px 0 rgba(255,255,255,.14); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 2px; color: var(--accent);
  font-size: 12.5px; font-weight: 600; border-radius: 4px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn .ic { width: 14px; height: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 650; letter-spacing: -.005em; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .ic { width: 12px; height: 12px; }
.badge-active { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.badge-planning { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge-completed { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.badge-success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.badge-muted { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.badge-blocked { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 11.5px; font-weight: 650; color: var(--ink-2); letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; height: 38px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
[data-theme="dark"] .field input, [data-theme="dark"] .field select { background: var(--surface-2); }
.field textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 74px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field-error { font-size: 11.5px; color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-icon {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); height: 38px; padding: 0 10px;
  transition: border-color .15s, box-shadow .15s;
}
[data-theme="dark"] .input-icon { background: var(--surface-2); }
.input-icon:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.input-icon .ic { width: 15px; height: 15px; color: var(--faint); }
.input-icon input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.muted-sm { font-size: 12px; color: var(--muted); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 17px 18px 15px; box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s, transform .18s;
  min-width: 0;
}
.stat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .105em; font-weight: 700; color: var(--muted); }
.stat-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; border: 1px solid; }
.stat-ic .ic { width: 16px; height: 16px; }
.stat-ic.blue { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.stat-ic.green { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.stat-ic.amber { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.stat-ic.violet { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-border); }
.stat-num { font-family: var(--font-mono); font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.04em; margin-top: 12px; }
.stat-foot { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.stat-foot a { color: var(--accent); font-weight: 600; }
.stat-foot a:hover { text-decoration: underline; }
.stat-foot .ic { width: 13px; height: 13px; color: var(--ok); }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.dash-side { display: grid; gap: 18px; min-width: 0; }
.dash-tasks { margin-top: 0; }
.dash-insight { min-width: 0; }

.recent-list { padding: 4px 0; }
.recent-item {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 18px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: var(--surface-2); }
.recent-main { min-width: 0; }
.recent-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recent-title { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-desc { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; max-width: 340px; }
.bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #3b82f6, #2563eb); transition: width .4s var(--ease); }
.bar.is-done > span { background: linear-gradient(90deg, #34d399, #16a34a); }
.recent-pct { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); width: 30px; text-align: right; }
.recent-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }
.recent-meta { font-size: 11px; color: var(--faint); white-space: nowrap; }
.recent-open {
  font-size: 11.5px; font-weight: 600; color: var(--accent);
  background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 3px;
}
.recent-open .ic { width: 13px; height: 13px; }
.recent-open:hover { text-decoration: underline; }

.deadline-list { padding: 6px 0; }
.deadline-item { display: flex; gap: 12px; padding: 11px 18px; align-items: center; }
.deadline-date {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1.05;
}
.deadline-date b { font-family: var(--font-mono); font-size: 14px; }
.deadline-date span { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.deadline-item.soon .deadline-date { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.deadline-body { min-width: 0; }
.deadline-body p { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-body span { font-size: 11px; color: var(--muted); }
.deadline-tag { margin-left: auto; font-size: 10.5px; font-weight: 650; color: var(--warn); white-space: nowrap; }

.doc-mini-list { padding: 4px 0; }
.doc-mini { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border: 0; background: transparent; width: 100%; text-align: left; }
.doc-mini:hover { background: var(--surface-2); }
.doc-ic { width: 30px; height: 30px; flex: none; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.doc-ic .ic { width: 14px; height: 14px; }
.doc-mini-body { min-width: 0; flex: 1; }
.doc-mini-body p { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-mini-body span { font-size: 10.5px; color: var(--faint); }

.mini-task-list { padding: 2px 0 6px; }
.mini-task { display: flex; align-items: center; gap: 11px; padding: 10px 20px; }
.mini-task:hover { background: var(--surface-2); }
.mini-check {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  border: 1.5px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: transparent; padding: 0;
  transition: background .15s, border-color .15s, color .1s;
}
.mini-check .ic { width: 12px; height: 12px; stroke-width: 2.6; }
.mini-check:hover { border-color: var(--accent); }
.mini-check.checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.mini-task-body { flex: 1; min-width: 0; }
.mini-task-title { font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-task.completed .mini-task-title { text-decoration: line-through; color: var(--faint); }
.mini-task-meta { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.mini-task .due-pill { font-size: 10px; color: var(--muted); font-family: var(--font-mono); white-space: nowrap; }

.spark-wrap { padding: 16px 20px 18px; }
.spark-bars { display: flex; align-items: flex-end; gap: 8px; height: 74px; }
.spark-bars > span {
  flex: 1; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  min-height: 6px; opacity: .92;
  transition: opacity .15s, transform .15s;
}
.spark-bars > span:hover { opacity: 1; transform: scaleY(1.03); }
.spark-bars > span.peak { background: linear-gradient(180deg, #93c5fd, #3b82f6); }
.spark-caption { margin-top: 10px; font-size: 11.5px; color: var(--muted); }

/* ---------- projects ---------- */
.toolbar { display: flex; align-items: flex-end; gap: 14px; padding: 16px 18px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .field { width: 178px; }
.toolbar .field.grow { width: auto; flex: 1 1 220px; }
.toolbar .btn { margin-bottom: 0; }
.view-toggle { display: flex; gap: 2px; padding: 3px; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm); margin-left: auto; }
.view-toggle .icon-btn { width: 30px; height: 30px; }
.view-toggle .icon-btn.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-xs); border-color: var(--border); }
.result-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 12px; font-size: 12px; color: var(--muted); }
#filterHint { color: var(--accent); font-weight: 600; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-grid.list-mode { grid-template-columns: 1fr; gap: 10px; }

.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 17px 18px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  animation: viewIn .25s var(--ease) both;
}
.project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-id { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; }
.project-name { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.project-desc { font-size: 12px; color: var(--muted); line-height: 1.55; min-height: 37px; }
.project-progress { margin-top: 2px; }
.project-progress-top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
.project-progress-top b { font-family: var(--font-mono); font-weight: 500; }
.project-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--border); }
.project-team { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.project-team .ic { width: 13px; height: 13px; }
.project-foot-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.mini-avatars { display: flex; }
.mini-avatars span {
  width: 22px; height: 22px; border-radius: 99px; margin-left: -6px;
  border: 2px solid var(--surface); background: var(--accent-soft); color: var(--accent);
  font-size: 9px; font-weight: 700; display: grid; place-items: center;
}
.mini-avatars span:first-child { margin-left: 0; }
.mini-avatars span:nth-child(2) { background: var(--purple-soft); color: var(--purple); }
.mini-avatars span:nth-child(3) { background: var(--ok-soft); color: var(--ok); }

/* list mode */
.project-grid.list-mode .project-card { flex-direction: row; align-items: center; gap: 18px; padding: 13px 16px; }
.project-grid.list-mode .project-card-top { flex-direction: row-reverse; gap: 10px; flex: none; }
.project-grid.list-mode .project-name { min-width: 220px; }
.project-grid.list-mode .project-desc { min-height: 0; flex: 1; }
.project-grid.list-mode .project-progress { width: 150px; flex: none; margin: 0; }
.project-grid.list-mode .project-card-foot { border: 0; padding: 0; margin: 0; flex: none; width: auto; }
.project-grid.list-mode .project-team { display: none; }
.project-grid.list-mode .project-foot-actions { margin: 0; }

/* ---------- board ---------- */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.board-title-wrap { display: flex; align-items: center; gap: 12px; }
.board-title-wrap .view-title { font-size: 21px; }
.board-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-compact {
  height: 34px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--r-sm); padding: 0 26px 0 10px; font-size: 12.5px; color: var(--ink-2);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.board-sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 18px 46px; }

.board-scroll { overflow-x: auto; padding-bottom: 14px; margin: 0 -4px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; min-width: 1050px; padding: 0 4px; }
.column {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  display: flex; flex-direction: column; min-height: 480px;
  transition: background .15s, border-color .15s;
}
[data-theme="dark"] .column { background: #0d1728; }
.column.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 13px 14px 10px; }
.col-dot { width: 7px; height: 7px; border-radius: 99px; flex: none; }
.col-name { font-size: 11px; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; color: var(--ink-2); }
.col-count {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 99px; min-width: 21px; text-align: center; padding: 1px 6px;
}
.col-list { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 10px; flex: 1; }
.col-empty {
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  padding: 26px 10px; text-align: center; font-size: 11.5px; color: var(--faint);
}
.task-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 11px 12px; box-shadow: var(--shadow-xs); cursor: grab;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  position: relative;
}
.task-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card:active { cursor: grabbing; }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.task-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-card-top { display: flex; align-items: center; gap: 6px; }
.task-id { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.prio {
  font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 99px; border: 1px solid; margin-left: auto;
}
.prio-high { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.prio-medium { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.prio-low { color: var(--muted); background: var(--surface-3); border-color: var(--border); }
.task-grip { color: var(--faint); width: 14px; height: 14px; }
.task-card-title { font-size: 12.5px; font-weight: 550; line-height: 1.4; }
.task-card-foot { display: flex; align-items: center; gap: 7px; }
.card-avatar {
  width: 20px; height: 20px; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
  font-size: 8.5px; font-weight: 700; display: grid; place-items: center; border: 1px solid var(--accent-border);
}
.card-meta { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; color: var(--muted); margin-left: auto; }
.card-meta .ic { width: 11px; height: 11px; }
.card-meta + .card-meta { margin-left: 4px; }
.task-card.overdue .card-meta.due { color: var(--danger); font-weight: 600; }

/* ---------- tasks table ---------- */
.task-panel { overflow: hidden; }
.task-tabs { display: flex; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.task-tab {
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 99px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.task-tab:hover { background: var(--surface-3); color: var(--ink); }
.task-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.task-tab .tab-count { font-family: var(--font-mono); font-size: 10px; opacity: .8; }
.task-table-wrap { overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.task-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 700; padding: 10px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.task-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 12.5px; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr { transition: background .12s; }
.task-table tbody tr:hover { background: var(--surface-2); }
.table-task { display: flex; align-items: center; gap: 9px; min-width: 220px; }
.table-task .task-id { flex: none; }
.table-task button { border: 0; background: transparent; padding: 0; text-align: left; font-size: 12.5px; font-weight: 550; color: var(--ink); }
.table-task button:hover { color: var(--accent); text-decoration: underline; }
.status-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 650;
  padding: 3px 8px; border-radius: 99px; border: 1px solid; white-space: nowrap;
}
.status-dot { width: 5px; height: 5px; border-radius: 99px; background: currentColor; }
.s-todo { color: var(--muted); background: var(--surface-3); border-color: var(--border); }
.s-progress { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.s-review { color: var(--purple); background: var(--purple-soft); border-color: var(--purple-border); }
.s-blocked { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-border); }
.s-done { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-border); }
.timer-cell { display: flex; align-items: center; gap: 6px; }
.timer-val { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); min-width: 58px; }
.timer-btn {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); display: grid; place-items: center; color: var(--muted);
}
.timer-btn:hover { border-color: var(--accent); color: var(--accent); }
.timer-btn .ic { width: 12px; height: 12px; }
.timer-btn.running { background: var(--accent); border-color: var(--accent); color: #fff; }
.due-cell { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.due-cell.late { color: var(--danger); font-weight: 600; }
.row-open {
  font-size: 11.5px; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 2px 4px;
}
.row-open:hover { text-decoration: underline; }

.empty-state { padding: 52px 20px; text-align: center; }
.empty-ic {
  width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3);
  border: 1px solid var(--border); color: var(--muted);
  display: grid; place-items: center; margin: 0 auto 12px;
}
.empty-ic .ic { width: 20px; height: 20px; }
.empty-state h3 { font-size: 14px; font-weight: 650; }
.empty-state p { font-size: 12.5px; color: var(--muted); margin: 4px 0 16px; }

/* ---------- teams ---------- */
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.team-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.team-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.team-emblem {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid; font-family: var(--font-mono); font-weight: 600; font-size: 15px;
}
.team-emblem.blue { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.team-emblem.violet { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-border); }
.team-emblem.green { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-border); }
.team-name { font-size: 15px; font-weight: 650; }
.team-desc { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 36px; line-height: 1.5; }
.team-members { display: flex; align-items: center; gap: 8px; margin: 16px 0 12px; }
.team-members .mini-avatars span { width: 28px; height: 28px; font-size: 10px; border-width: 2px; }
.member-more { font-size: 11px; color: var(--muted); margin-left: 2px; }
.team-stats { display: flex; gap: 18px; padding-top: 13px; border-top: 1px solid var(--border); }
.team-stat b { display: block; font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.team-stat span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.team-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.team-foot .btn { flex: 1; }
.member-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.member-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.member-row .avatar { width: 22px; height: 22px; font-size: 9px; border-width: 1px; }

/* ---------- docs ---------- */
.doc-table-card { overflow: hidden; }
.doc-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.doc-toolbar .input-icon { max-width: 340px; }
.doc-list { padding: 0; }
.doc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px 110px auto;
  align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: var(--surface-2); }
.doc-row-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.doc-row-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.doc-row-meta { font-size: 11.5px; color: var(--muted); }
.doc-row-meta b { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; margin-bottom: 1px; }
.doc-preview { overflow-y: auto; max-height: 62vh; }
.doc-preview h3 { font-size: 14px; font-weight: 700; margin: 20px 0 8px; }
.doc-preview h3:first-child { margin-top: 0; }
.doc-preview p { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin-bottom: 10px; }
.doc-preview ul { margin: 0 0 12px 18px; list-style: disc; }
.doc-preview li { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin-bottom: 4px; }
.doc-preview .doc-callout {
  border: 1px solid var(--accent-border); background: var(--accent-soft);
  border-radius: var(--r-md); padding: 12px 14px; margin: 14px 0;
  font-size: 12.5px; color: var(--ink-2);
}
.doc-meta-strip { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.doc-meta-strip span { font-size: 11px; color: var(--muted); }
.doc-meta-strip b { color: var(--ink); font-weight: 600; }

/* ---------- modals ---------- */
.modal-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 15, 30, .5); backdrop-filter: blur(3px); animation: fadeIn .18s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: modalIn .22s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-sm { max-width: 430px; }
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-head-actions { display: flex; align-items: center; gap: 6px; }
.modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 15px 22px; border-top: 1px solid var(--border); margin: 4px -22px -20px; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.modal-body .modal-foot { margin-top: 6px; }
.doc-modal-id h2 { margin-top: 3px; }
.doc-preview { display: block; }

/* ---------- drawer ---------- */
.drawer-layer { position: fixed; inset: 0; z-index: 110; }
.drawer-layer .modal-backdrop { position: absolute; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: drawerIn .26s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(28px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; font-weight: 700; line-height: 1.35; margin-top: 3px; }
.drawer-body { padding: 20px 22px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.drawer-desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); padding: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.panel-head h3 .ic { width: 14px; height: 14px; color: var(--muted); }
.live-dot { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--ok); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.timer-display { font-family: var(--font-mono); font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.timer-actions { display: flex; gap: 6px; }
.panel-hint { font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.comment { display: flex; gap: 9px; }
.comment .avatar { width: 26px; height: 26px; font-size: 10px; border-width: 1px; }
.comment-body { min-width: 0; flex: 1; }
.comment-meta { display: flex; align-items: baseline; gap: 6px; }
.comment-meta b { font-size: 11.5px; font-weight: 650; }
.comment-meta span { font-size: 10px; color: var(--faint); }
.comment p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin-top: 2px; }
.comment-empty { font-size: 12px; color: var(--muted); padding: 6px 0; }
.comment-form { display: flex; gap: 7px; }
.comment-form input {
  flex: 1; min-width: 0; height: 34px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); padding: 0 10px; font-size: 12.5px;
}
.comment-form input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.comment-form .icon-btn { width: 34px; height: 34px; }
.comment-form .icon-btn .ic { width: 15px; height: 15px; }

/* ---------- toasts ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 11px 13px;
  animation: toastIn .24s var(--ease);
}
.toast.out { animation: toastOut .2s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
.toast-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; }
.toast-ic .ic { width: 13px; height: 13px; }
.toast.success { border-left-color: var(--ok); }
.toast.info { border-left-color: var(--accent); }
.toast.info .toast-ic { background: var(--accent-soft); color: var(--accent); }
.toast-text { font-size: 12.5px; line-height: 1.45; }
.toast-text b { display: block; font-weight: 650; margin-bottom: 1px; }
.toast-text span { color: var(--muted); }

/* ---------- backdrop / responsive ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 39; background: rgba(8, 15, 30, .48);
  backdrop-filter: blur(2px);
}

@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .global-search { width: 230px; }
  .topbar-sub { max-width: 220px; }
}

@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { grid-template-columns: 1fr 1fr; }
  .doc-row { grid-template-columns: minmax(0, 1fr) 120px 100px auto; }
  .doc-row .doc-row-meta:nth-of-type(2) { display: none; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    width: 276px !important;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.collapsed { width: 276px !important; }
  .sidebar.collapsed .brand-name, .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-item span, .sidebar.collapsed .user-meta { display: block; }
  .sidebar.collapsed .side-head { padding: 0 16px; justify-content: flex-start; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 10px; }
  .sidebar.collapsed .side-foot { flex-direction: row; }
  .sidebar.collapsed .user-card { justify-content: flex-start; }
  .sidebar.collapsed .nav-item .nav-count { display: inline-block; }
  .sidebar.open { transform: none; }
  .sidebar .side-close { display: inline-grid; }
  .collapse-btn { display: none; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 18px 48px; }
  .global-search { width: 200px; }
  .project-grid.list-mode .project-card { flex-direction: column; align-items: stretch; }
  .project-grid.list-mode .project-name { min-width: 0; }
  .project-grid.list-mode .project-progress { width: 100%; }
  .project-grid.list-mode .project-card-foot { display: flex; }
  .project-grid.list-mode .project-team { display: inline-flex; }
  .doc-row { grid-template-columns: minmax(0, 1fr) 110px auto; }
  .doc-row .doc-row-meta:nth-of-type(1) { display: none; }
  .board-sub { margin-left: 0; }
  .team-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar-sub { display: none; }
  .topbar-title { font-size: 15px; }
  .global-search { width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .global-search input { width: 0; opacity: 0; padding: 0; pointer-events: none; }
  .global-search kbd { display: none; }
  .global-search .search-ic { width: 18px; height: 18px; }
  .global-search:focus-within { position: absolute; left: 14px; right: 14px; top: 14px; width: auto; z-index: 70; background: var(--surface); border-color: var(--accent); padding: 0 10px; justify-content: flex-start; box-shadow: var(--shadow-md); }
  .global-search:focus-within input { width: auto; flex: 1; opacity: 1; padding: 0 8px; pointer-events: auto; }
  .global-search:focus-within .search-ic { width: 16px; height: 16px; }
  .view-head { align-items: flex-start; }
  .view-title { font-size: 21px; }
  .stats { gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-num { font-size: 26px; }
  .stat-label { font-size: 9.5px; }
  .stat-ic { width: 30px; height: 30px; }
  .dash-side { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .project-grid.list-mode .project-card { padding: 13px; }
  .toolbar { padding: 14px; }
  .toolbar .field, .toolbar .field.grow { width: 100%; flex: 1 1 100%; }
  .view-toggle { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .modal-layer { padding: 12px; align-items: end; }
  .modal { max-height: calc(100vh - 24px); border-radius: var(--r-lg); }
  .modal-foot { padding: 14px 18px; margin: 4px -18px -20px; }
  .modal-body { padding: 18px; }
  .modal-head { padding: 18px; }
  .drawer { width: 100%; border-left: 0; }
  .drawer-grid { grid-template-columns: 1fr; }
  .doc-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .doc-row .doc-row-meta { display: none; }
  .doc-row > .btn { grid-column: 1 / -1; justify-self: start; }
  .doc-toolbar { padding: 12px; }
  .board-title-wrap { width: 100%; }
  .board-actions { width: 100%; }
  .board-actions .select-compact { flex: 1; min-width: 0; }
  .board-actions .btn { flex: 1; }
  .board { grid-template-columns: repeat(5, minmax(248px, 78vw)); min-width: 0; }
  .toast-stack { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .popover { width: min(320px, calc(100vw - 32px)); }
  .notif-pop { right: -50px; }
  .recent-item { padding: 13px 14px; gap: 8px; grid-template-columns: 1fr; }
  .recent-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .card-head { padding: 15px 16px; }
}

@media (max-width: 860px) {
  .task-table { min-width: 0; }
  .task-table th:nth-child(2), .task-table td:nth-child(2) { display: none; }
  .table-task { min-width: 0; }
}
@media (max-width: 700px) {
  .task-table th:nth-child(4), .task-table td:nth-child(4),
  .task-table th:nth-child(5), .task-table td:nth-child(5),
  .task-table th:nth-child(7), .task-table td:nth-child(7) { display: none; }
}
@media (max-width: 700px) {
  .task-table th, .task-table td { padding: 9px 8px; }
  .table-task .task-id { display: none; }
  .timer-val { min-width: 0; font-size: 10.5px; }
  .task-table .status-pill { font-size: 9.5px; padding: 2px 6px; }
  .task-table .table-task button { font-size: 11.5px; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
