/* ============================================================
   OfficeClaw Dashboard — Design System CSS
   Asana/Paperclip theme · Version 2.0
   ============================================================ */

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Tokens: Light Theme (default) ──────────────────────── */
:root {
  /* Surfaces */
  --c-bg:           #ffffff;
  --c-surface:      #f6f7f8;
  --c-surface-2:    #eceef0;
  --c-border:       #e6e8eb;
  --c-border-strong: #d4d8dd;

  /* Ink (text) */
  --c-ink:   #151b26;
  --c-ink-2: #6f7782;
  --c-ink-3: #9ca6b2;
  --c-ink-4: #c8ced6;

  /* Brand */
  --c-accent:       #796eff;
  --c-accent-hover: #6b5fff;
  --c-accent-bg:    rgba(121,110,255,.08);

  /* Semantic statuses */
  --c-status-done:     #14a37f;
  --c-status-active:   #4573d2;
  --c-status-pending:  #f0b429;
  --c-status-blocked:  #e85050;
  --c-status-deferred: #b48a3f;
  --c-status-dropped:  #9ca6b2;
  --c-status-new:      #6f7782;
  --c-status-triaged:  #6c5ce7;

  /* Status backgrounds */
  --c-status-done-bg:     rgba(20,163,127,.10);
  --c-status-active-bg:   rgba(69,115,210,.10);
  --c-status-pending-bg:  rgba(240,180,41,.12);
  --c-status-blocked-bg:  rgba(232,80,80,.10);
  --c-status-deferred-bg: rgba(180,138,63,.12);
  --c-status-dropped-bg:  rgba(156,166,178,.12);
  --c-status-new-bg:      rgba(111,119,130,.10);
  --c-status-triaged-bg:  rgba(108,92,231,.10);

  /* Priority */
  --c-priority-p0: #e85050;
  --c-priority-p1: #f0b429;
  --c-priority-p2: #6f7782;
  --c-priority-p3: #9ca6b2;

  /* Contour brand */
  --c-contour-main:       #4573d2;
  --c-contour-strik:      #f0b429;
  --c-contour-panda:      #f06292;
  --c-contour-shape:      #14a37f;
  --c-contour-researcher: #6c5ce7;
  --c-contour-personal:   #796eff;

  --c-contour-main-bg:       rgba(69,115,210,.10);
  --c-contour-strik-bg:      rgba(240,180,41,.12);
  --c-contour-panda-bg:      rgba(240,98,146,.10);
  --c-contour-shape-bg:      rgba(20,163,127,.10);
  --c-contour-researcher-bg: rgba(108,92,231,.10);
  --c-contour-personal-bg:   rgba(121,110,255,.10);

  /* Legacy aliases (kept for backward compat) */
  --ink:        var(--c-ink);
  --ink-2:      var(--c-ink-2);
  --ink-3:      var(--c-ink-3);
  --ink-4:      var(--c-ink-4);
  --paper:      var(--c-bg);
  --paper-2:    var(--c-surface);
  --paper-3:    var(--c-surface-2);
  --board:      var(--c-surface-2);
  --border:     var(--c-border);
  --border-2:   var(--c-border-strong);
  --green:      var(--c-status-done);
  --green-bg:   var(--c-status-done-bg);
  --amber:      var(--c-status-pending);
  --amber-bg:   var(--c-status-pending-bg);
  --red:        var(--c-status-blocked);
  --red-bg:     var(--c-status-blocked-bg);
  --blue:       var(--c-status-active);
  --blue-bg:    var(--c-status-active-bg);
  --purple:     var(--c-status-triaged);
  --purple-bg:  var(--c-status-triaged-bg);
  --teal:       var(--c-status-done);
  --teal-bg:    var(--c-status-done-bg);
  --orange:     var(--c-status-deferred);
  --orange-bg:  var(--c-status-deferred-bg);

  /* Contour legacy aliases */
  --c-personal:      var(--c-contour-personal);
  --c-personal-bg:   var(--c-contour-personal-bg);
  --c-strik:         var(--c-contour-strik);
  --c-strik-bg:      var(--c-contour-strik-bg);
  --c-panda:         var(--c-contour-panda);
  --c-panda-bg:      var(--c-contour-panda-bg);
  --c-shape:         var(--c-contour-shape);
  --c-shape-bg:      var(--c-contour-shape-bg);
  --c-researcher:    var(--c-contour-researcher);
  --c-researcher-bg: var(--c-contour-researcher-bg);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, monospace;
  --fz-xs:   11px;
  --fz-sm:   12px;
  --fz-base: 14px;
  --fz-md:   16px;
  --fz-lg:   18px;
  --fz-xl:   22px;
  --fz-2xl:  28px;
  --lh-tight: 1.2;
  --lh-base:  1.5;

  /* Spacing (4px scale) */
  --sp-0:  0;
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Radii */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-pill: 999px;

  /* Shadows */
  --sh-sm:     0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  --sh-md:     0 2px 8px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --sh-lg:     0 8px 24px rgba(0,0,0,.10), 0 16px 48px rgba(0,0,0,.08);
  --sh-drawer: -4px 0 24px rgba(0,0,0,.08);

  /* Legacy shadow aliases */
  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.12);

  /* Transitions */
  --t-fast: 100ms cubic-bezier(.4,0,.2,1);
  --t-base: 180ms cubic-bezier(.4,0,.2,1);
  --t-slow: 280ms cubic-bezier(.4,0,.2,1);

  /* Layout */
  --sidebar-w:           220px;
  --sidebar-collapsed-w: 56px;
  --drawer-w:            420px;
  --topbar-h:            56px;
}

/* ── Dark Theme ──────────────────────────────────────────── */
[data-theme="dark"] {
  --c-bg:           #0c0e10;
  --c-surface:      #15181c;
  --c-surface-2:    #1c2026;
  --c-border:       #262b32;
  --c-border-strong: #353c46;
  --c-ink:   #f0f3f7;
  --c-ink-2: #a8b2bc;
  --c-ink-3: #6b7480;
  --c-ink-4: #4a525c;
  --c-accent:       #8b80ff;
  --c-accent-hover: #9a90ff;
  --c-accent-bg:    rgba(139,128,255,.12);

  --c-status-done:    #1ab883;
  --c-status-active:  #5e88dd;
  --c-status-pending: #f5be3f;
  --c-status-blocked: #ff6b6b;

  --c-status-done-bg:     rgba(26,184,131,.12);
  --c-status-active-bg:   rgba(94,136,221,.12);
  --c-status-pending-bg:  rgba(245,190,63,.14);
  --c-status-blocked-bg:  rgba(255,107,107,.12);

  --sh-sm:     0 1px 3px rgba(0,0,0,.4);
  --sh-md:     0 4px 16px rgba(0,0,0,.5);
  --sh-lg:     0 8px 32px rgba(0,0,0,.6);
  --sh-drawer: -4px 0 24px rgba(0,0,0,.5);
  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.7);

  /* Re-alias legacy ink/paper tokens for dark */
  --ink:    var(--c-ink);
  --ink-2:  var(--c-ink-2);
  --ink-3:  var(--c-ink-3);
  --ink-4:  var(--c-ink-4);
  --paper:  var(--c-bg);
  --paper-2: var(--c-surface);
  --paper-3: var(--c-surface-2);
  --board:   var(--c-surface-2);
  --border:  var(--c-border);
  --border-2: var(--c-border-strong);
  --green:  var(--c-status-done);
  --green-bg: var(--c-status-done-bg);
  --amber:  var(--c-status-pending);
  --amber-bg: var(--c-status-pending-bg);
  --red:    var(--c-status-blocked);
  --red-bg: var(--c-status-blocked-bg);
  --blue:   var(--c-status-active);
  --blue-bg: var(--c-status-active-bg);
  --purple: var(--c-status-triaged);
  --purple-bg: var(--c-status-triaged-bg);
  --teal:   var(--c-status-done);
  --teal-bg: var(--c-status-done-bg);
  --orange: var(--c-status-deferred);
  --orange-bg: var(--c-status-deferred-bg);
}

/* ── Large desktop override ──────────────────────────────── */
@media (min-width: 1440px) {
  :root { --drawer-w: 480px; }
}

/* ── Density modes ────────────────────────────────────────── */
body.density-compact {
  --fz-base: 13px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 20px;
}
body.density-spacious {
  --fz-base: 15px;
  --sp-4: 20px;
  --sp-5: 24px;
  --sp-6: 32px;
}

/* ── Base ───────────────────────────────────────────────── */
html, body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-sans);
  font-size: var(--fz-base);
  line-height: var(--lh-base);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Accessibility ──────────────────────────────────────── */
.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;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ── Utility ───────────────────────────────────────────── */
.font-mono  { font-family: var(--font-mono); }
.text-xs    { font-size: var(--fz-xs); }
.text-sm    { font-size: var(--fz-sm); }
.text-faint { color: var(--c-ink-4); }
.w-full     { width: 100%; }

/* ── App Shell ──────────────────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--c-bg);
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  z-index: 200;
}
.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.topbar-search .input-search {
  width: 100%;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  /* mobile: hidden by default */
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  overflow: hidden;
  transition: width var(--t-base);
  z-index: 100;
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-section { display: none; }

.sidebar-section {
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  cursor: pointer;
  border-radius: 0;
  transition: background var(--t-fast), color var(--t-fast);
  font-size: var(--fz-base);
  color: var(--c-ink-2);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}
.sidebar-item:hover {
  background: var(--c-surface-2);
  color: var(--c-ink);
}
.sidebar-item.active {
  background: var(--c-accent-bg);
  color: var(--c-accent);
  font-weight: 500;
}
.sidebar-item.active .sidebar-icon { color: var(--c-accent); }

.sidebar-icon {
  font-size: var(--fz-md);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--c-ink-3);
  transition: color var(--t-fast);
}
.sidebar-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-badge {
  background: var(--c-status-pending-bg);
  color: var(--c-status-pending);
  font-size: var(--fz-xs);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}

/* ── Main content area ──────────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-bg);
  padding-top: var(--topbar-h);
  transition: margin-left var(--t-base);
}

.main-with-drawer .task-list { margin-right: var(--drawer-w); }

/* ── Page Header ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  flex-shrink: 0;
  min-height: 72px;
  gap: var(--sp-4);
}
.page-title {
  font-size: var(--fz-xl);
  font-weight: 600;
  color: var(--c-ink);
  line-height: var(--lh-tight);
}
.page-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: inherit;
  font-size: var(--fz-sm);
  font-weight: 500;
  padding: 7px var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast),
    box-shadow var(--t-fast);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  user-select: none;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.btn-sm {
  padding: 5px var(--sp-2);
  font-size: var(--fz-xs);
}

.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.btn-primary:hover:not(:disabled) {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  box-shadow: 0 1px 4px rgba(121,110,255,.4);
}

.btn-secondary {
  background: var(--c-surface);
  color: var(--c-ink);
  border-color: var(--c-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--c-surface-2);
  border-color: var(--c-border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--c-ink-2);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--c-surface);
  color: var(--c-ink);
}

.btn-danger {
  background: var(--c-status-blocked);
  color: #fff;
  border-color: var(--c-status-blocked);
}
.btn-danger:hover:not(:disabled) {
  background: #d43a3a;
  border-color: #d43a3a;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.btn-icon.btn-sm { width: 26px; height: 26px; }

/* ── Form Elements ──────────────────────────────────────── */
.input,
.input-search,
.textarea,
.select {
  appearance: none;
  font-family: inherit;
  font-size: var(--fz-sm);
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 7px var(--sp-3);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
  line-height: var(--lh-base);
}
.input:focus,
.input-search:focus,
.textarea:focus,
.select:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-bg);
}
.input::placeholder,
.input-search::placeholder,
.textarea::placeholder {
  color: var(--c-ink-3);
}

.input-search {
  padding-left: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca6b2' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

.textarea { resize: vertical; min-height: 80px; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%239ca6b2' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--fz-xs);
  color: var(--c-ink-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  padding: 1px 5px;
  min-width: 20px;
  user-select: none;
}

/* ── Task List ──────────────────────────────────────────── */
.task-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.task-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  min-height: 44px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
  background: var(--c-bg);
}
.task-row:hover {
  background: var(--c-surface);
}
.task-row.selected {
  background: var(--c-accent-bg);
  border-left: 2px solid var(--c-accent);
}
.task-row:hover .task-row-actions { opacity: 1; }

.task-row-status {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background var(--t-base), color var(--t-base);
}

.task-row-id {
  font-family: var(--font-mono);
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  flex-shrink: 0;
  width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-title {
  flex: 1;
  font-size: var(--fz-sm);
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.task-row-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.task-row-arrow {
  color: var(--c-ink-3);
  font-size: var(--fz-md);
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.task-row:hover .task-row-arrow { color: var(--c-accent); }

.task-row-parent-link {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  text-decoration: none;
  flex-shrink: 0;
}
.task-row-parent-link:hover { color: var(--c-accent); text-decoration: underline; }

.task-row-attachments {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  flex-shrink: 0;
}

/* ── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fz-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  line-height: 1.4;
}

/* Status badges — data-status attribute */
.badge-status { /* base */ }

.badge-status[data-status="done"]     { background: var(--c-status-done-bg);     color: var(--c-status-done); }
.badge-status[data-status="active"]   { background: var(--c-status-active-bg);   color: var(--c-status-active); }
.badge-status[data-status="pending"]  { background: var(--c-status-pending-bg);  color: var(--c-status-pending); }
.badge-status[data-status="blocked"]  { background: var(--c-status-blocked-bg);  color: var(--c-status-blocked); }
.badge-status[data-status="deferred"] { background: var(--c-status-deferred-bg); color: var(--c-status-deferred); }
.badge-status[data-status="dropped"]  { background: var(--c-status-dropped-bg);  color: var(--c-status-dropped); }
.badge-status[data-status="new"]      { background: var(--c-status-new-bg);      color: var(--c-status-new); }
.badge-status[data-status="triaged"]  { background: var(--c-status-triaged-bg);  color: var(--c-status-triaged); }

/* Priority badges */
.badge-priority { /* base */ }
.badge-priority[data-priority="P0"] { background: rgba(232,80,80,.12);   color: var(--c-priority-p0); font-weight: 700; }
.badge-priority[data-priority="P1"] { background: rgba(240,180,41,.12);  color: var(--c-priority-p1); }
.badge-priority[data-priority="P2"] { background: rgba(111,119,130,.10); color: var(--c-priority-p2); }
.badge-priority[data-priority="P3"] { background: rgba(156,166,178,.10); color: var(--c-priority-p3); }

/* Contour badges */
.badge-contour { /* base */ }
.badge-contour[data-contour="main"]       { background: var(--c-contour-main-bg);       color: var(--c-contour-main); }
.badge-contour[data-contour="strik"]      { background: var(--c-contour-strik-bg);      color: var(--c-contour-strik); }
.badge-contour[data-contour="panda"]      { background: var(--c-contour-panda-bg);      color: var(--c-contour-panda); }
.badge-contour[data-contour="shape"]      { background: var(--c-contour-shape-bg);      color: var(--c-contour-shape); }
.badge-contour[data-contour="researcher"] { background: var(--c-contour-researcher-bg); color: var(--c-contour-researcher); }
.badge-contour[data-contour="personal"]   { background: var(--c-contour-personal-bg);   color: var(--c-contour-personal); }

/* Intake required — keep pulse from original concept */
.badge-intake-required {
  background: rgba(232,80,80,.12);
  color: var(--c-status-blocked);
  animation: intakeReqPulse 2s ease-in-out infinite;
}

/* Badge dot (just circle) */
.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Legacy badge class support */
.badge-new         { background: var(--c-status-new-bg);      color: var(--c-status-new); }
.badge-triaged     { background: var(--c-status-triaged-bg);  color: var(--c-status-triaged); }
.badge-in_progress { background: var(--c-status-active-bg);   color: var(--c-status-active); }
.badge-done        { background: var(--c-status-done-bg);     color: var(--c-status-done); }
.badge-blocked     { background: var(--c-status-blocked-bg);  color: var(--c-status-blocked); }
.badge-deferred    { background: var(--c-status-deferred-bg); color: var(--c-status-deferred); }
.badge-dropped     { background: var(--c-status-dropped-bg);  color: var(--c-status-dropped); }
.badge-pending     { background: var(--c-status-pending-bg);  color: var(--c-status-pending); }
.badge-p0 { background: rgba(232,80,80,.12);   color: var(--c-priority-p0); font-weight: 700; }
.badge-p1 { background: rgba(240,180,41,.12);  color: var(--c-priority-p1); }
.badge-p2 { background: rgba(111,119,130,.10); color: var(--c-priority-p2); }
.badge-p3 { background: rgba(156,166,178,.10); color: var(--c-priority-p3); }
.badge-p4 { background: rgba(156,166,178,.10); color: var(--c-priority-p3); }
.badge-personal   { background: var(--c-contour-personal-bg);   color: var(--c-contour-personal); }
.badge-strik      { background: var(--c-contour-strik-bg);      color: var(--c-contour-strik); }
.badge-panda      { background: var(--c-contour-panda-bg);      color: var(--c-contour-panda); }
.badge-shape      { background: var(--c-contour-shape-bg);      color: var(--c-contour-shape); }
.badge-researcher { background: var(--c-contour-researcher-bg); color: var(--c-contour-researcher); }

/* ── Drawer ─────────────────────────────────────────────── */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 299;
}
.drawer-overlay.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  background: var(--c-bg);
  border-left: 1px solid var(--c-border);
  box-shadow: var(--sh-drawer);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  z-index: 300;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  z-index: 1;
  flex-shrink: 0;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.drawer-section { display: flex; flex-direction: column; gap: var(--sp-2); }
.drawer-section h3 {
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-ink-3);
}
.drawer-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  flex-shrink: 0;
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: minmax(100px, max-content) 1fr;
  gap: var(--sp-2) var(--sp-4);
  align-items: start;
}
.drawer-meta-grid dt {
  font-size: var(--fz-xs);
  font-weight: 500;
  color: var(--c-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 2px;
}
.drawer-meta-grid dd {
  font-size: var(--fz-sm);
  color: var(--c-ink);
}

/* ── Timeline ───────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: var(--sp-3);
  position: relative;
}
.timeline-item:not(:last-child) .timeline-line {
  display: block;
}

.timeline-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-ink-4);
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.timeline-dot.created  { background: var(--c-status-new); }
.timeline-dot.started  { background: var(--c-status-active); }
.timeline-dot.paused   { background: var(--c-status-pending); }
.timeline-dot.done     { background: var(--c-status-done); }
.timeline-dot.error    { background: var(--c-status-blocked); }

.timeline-line {
  display: none;
  position: absolute;
  left: 4px;
  top: 15px;
  bottom: -12px;
  width: 2px;
  background: var(--c-border);
}

.timeline-label {
  font-size: var(--fz-sm);
  color: var(--c-ink);
  line-height: var(--lh-base);
}
.timeline-ts {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* ── Project Cards ──────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-4);
}
.project-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
  box-shadow: var(--sh-sm);
}
.project-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-1px);
}
.project-card-color {
  width: 5px;
  flex-shrink: 0;
  align-self: stretch;
  border-radius: var(--r-xs) 0 0 var(--r-xs);
}
.project-card-title {
  font-size: var(--fz-base);
  font-weight: 600;
  color: var(--c-ink);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
}
.project-card-meta {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  padding: 0 var(--sp-4) var(--sp-4);
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ── Skeleton Loader ────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-surface) 25%,
    var(--c-surface-2) 50%,
    var(--c-surface) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs);
}

.skeleton-row {
  height: 44px;
  border-radius: 0;
  margin-bottom: 1px;
}
.skeleton-card {
  height: 120px;
  border-radius: var(--r-lg);
}
.skeleton-bar {
  height: 14px;
  border-radius: var(--r-xs);
}
.skeleton-circle {
  border-radius: 50%;
}

/* ── Progress bar ───────────────────────────────────────── */
.progress {
  width: 100%;
  height: 6px;
  background: var(--c-surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: var(--r-pill);
  transition: width var(--t-slow);
}
.progress-fill.indeterminate {
  width: 40%;
  animation: progressSlide 1.4s ease-in-out infinite;
}
.progress-label {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  margin-top: var(--sp-1);
}

@keyframes progressSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Toast ──────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  pointer-events: none;
  min-width: 280px;
  max-width: 480px;
}
.toast {
  background: var(--c-ink);
  color: var(--c-bg);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fz-sm);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
  animation: slideInUp 200ms cubic-bezier(.4,0,.2,1);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
}
.toast.toast-success { background: var(--c-status-done); }
.toast.toast-error   { background: var(--c-status-blocked); }
.toast.toast-info    { background: var(--c-status-active); }

.toast-msg  { flex: 1; }
.toast-undo {
  font-size: var(--fz-xs);
  font-weight: 600;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
.toast-undo:hover { color: #fff; }
.toast-close {
  cursor: pointer;
  opacity: 0.7;
  font-size: var(--fz-base);
  line-height: 1;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }

/* ── Command Palette ────────────────────────────────────── */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: fadeIn 100ms ease-out;
}
.cmd-box {
  width: 100%;
  max-width: 580px;
  background: var(--c-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: slideInUp 150ms cubic-bezier(.4,0,.2,1);
}
.cmd-input {
  width: 100%;
  font-family: inherit;
  font-size: var(--fz-md);
  color: var(--c-ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-4) var(--sp-5);
  outline: none;
}
.cmd-input::placeholder { color: var(--c-ink-3); }
.cmd-results {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--sp-2) 0;
}
.cmd-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-5);
  cursor: pointer;
  transition: background var(--t-fast);
}
.cmd-row:hover, .cmd-row.active {
  background: var(--c-accent-bg);
}
.cmd-row.active { background: var(--c-accent-bg); }
.cmd-row-icon {
  width: 28px;
  height: 28px;
  background: var(--c-surface-2);
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fz-sm);
  flex-shrink: 0;
}
.cmd-row-id {
  font-family: var(--font-mono);
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  flex-shrink: 0;
  width: 60px;
}
.cmd-row-title {
  flex: 1;
  font-size: var(--fz-sm);
  color: var(--c-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmd-row-meta {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  flex-shrink: 0;
}
.cmd-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-2) var(--sp-5);
  border-top: 1px solid var(--c-border);
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
}
.cmd-footer .kbd { margin-right: 4px; }

/* ── Status Pulse ───────────────────────────────────────── */
.status-pulse {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
}
.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-status-done);
  flex-shrink: 0;
}
.status-pulse-ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--c-status-done);
  top: 50%;
  left: 0;
  transform: translate(-4px, -50%);
  animation: pulse 2s ease-out infinite;
}

/* ── Card (legacy) ──────────────────────────────────────── */
.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--sh-sm);
}
.card.card-sm { padding: var(--sp-4); }

/* ── Stat Tile ──────────────────────────────────────────── */
.stat-tile {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
  box-shadow: var(--sh-sm);
}
.stat-tile-value {
  font-size: var(--fz-2xl);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--c-ink);
}
.stat-tile-label {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  margin-top: var(--sp-1);
}
.stat-tile-trend { font-size: var(--fz-xs); margin-top: var(--sp-1); }

/* ── Modal (legacy) ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  animation: fadeIn 120ms ease-out;
}
.modal {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleUp 150ms ease-out;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.modal-footer {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--c-border);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Filter bar (legacy) ────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
}
.filter-input {
  appearance: none;
  font-family: inherit;
  font-size: var(--fz-sm);
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 7px var(--sp-3);
  outline: none;
  width: 200px;
  transition: border-color var(--t-fast), width var(--t-fast), box-shadow var(--t-fast);
}
.filter-input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-bg);
  width: 280px;
}
.filter-select {
  appearance: none;
  font-family: inherit;
  font-size: var(--fz-sm);
  color: var(--c-ink-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 7px var(--sp-3);
  padding-right: 24px;
  outline: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%239ca6b2' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--t-fast);
}
.filter-select:focus { border-color: var(--c-accent); }

/* ── Form elements (legacy aliases) ────────────────────── */
.form-group { margin-bottom: var(--sp-3); }
.form-label {
  display: block;
  font-size: var(--fz-xs);
  font-weight: 600;
  color: var(--c-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-1);
}
.form-input,
.form-select,
.form-textarea {
  appearance: none;
  width: 100%;
  font-family: inherit;
  font-size: var(--fz-sm);
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 7px var(--sp-3);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-bg);
}
.form-textarea { resize: vertical; line-height: var(--lh-base); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%239ca6b2' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

/* ── Mobile navigation ──────────────────────────────────── */
.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
  cursor: pointer;
  transition: color var(--t-fast);
  background: none;
  border: none;
  padding: 0;
}
.mobile-nav-btn.active { color: var(--c-accent); }
.mobile-nav-btn:hover  { color: var(--c-ink-2); }

/* ── FAB ────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: calc(56px + var(--sp-4));
  right: var(--sp-4);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--sh-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fz-xl);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  z-index: 140;
}
.fab:hover {
  background: var(--c-accent-hover);
  box-shadow: var(--sh-lg);
  transform: scale(1.05);
}

/* ── Bottom Sheet ───────────────────────────────────────── */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--c-bg);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--t-slow);
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--c-border-strong);
  border-radius: var(--r-pill);
  margin: var(--sp-3) auto var(--sp-2);
  flex-shrink: 0;
}

/* ── Sidebar Logo ───────────────────────────────────────── */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
  height: var(--topbar-h);
}
.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fz-sm);
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-weight: 600;
  font-size: var(--fz-md);
  white-space: nowrap;
  color: var(--c-ink);
}

/* Sidebar nav wrapper */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) 0;
}
.sidebar-footer {
  border-top: 1px solid var(--c-border);
  padding: var(--sp-2) 0;
  flex-shrink: 0;
}

/* ── Nav legacy aliases ─────────────────────────────────── */
.nav-section-label { /* alias to sidebar-section */
  font-size: var(--fz-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-3);
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  font-size: var(--fz-base);
  color: var(--c-ink-2);
  white-space: nowrap;
  text-decoration: none;
}
.nav-item:hover { background: var(--c-surface-2); color: var(--c-ink); }
.nav-item.active {
  background: var(--c-accent-bg);
  color: var(--c-accent);
  font-weight: 500;
}
.nav-icon  { font-size: var(--fz-md); width: 24px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  background: var(--c-status-pending-bg);
  color: var(--c-status-pending);
  font-size: var(--fz-xs);
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}

/* ── Main content (legacy) ──────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-bg);
}

/* ── Toast legacy ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast-success { border-left: 3px solid var(--c-status-done); }
.toast-error   { border-left: 3px solid var(--c-status-blocked); }
.toast-warning { border-left: 3px solid var(--c-status-pending); }

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%   { opacity: 1; transform: translate(-4px,-50%) scale(1); }
  100% { opacity: 0; transform: translate(-4px,-50%) scale(2.5); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes intakeReqPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,80,80,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(232,80,80,.0); }
}

/* ── Responsive: Tablet (768px+) ────────────────────────── */
@media (min-width: 768px) {
  .sidebar {
    display: flex;
    width: var(--sidebar-collapsed-w);
  }
  .sidebar.expanded { width: var(--sidebar-w); }
  .mobile-nav { display: none; }
  .fab { bottom: var(--sp-5); }

  .drawer {
    width: 80vw;
    max-width: 480px;
    /* slide from right, not full-screen */
    top: var(--topbar-h);
  }

  .main {
    margin-left: var(--sidebar-collapsed-w);
  }
  .main.sidebar-expanded { margin-left: var(--sidebar-w); }
}

/* ── Responsive: Desktop (1024px+) ──────────────────────── */
@media (min-width: 1024px) {
  .sidebar {
    width: var(--sidebar-w);
  }
  .sidebar.collapsed { width: var(--sidebar-collapsed-w); }

  .drawer {
    width: var(--drawer-w);
    top: var(--topbar-h);
  }
  .drawer-overlay { display: none !important; }

  .main { margin-left: var(--sidebar-w); }
  .main.sidebar-collapsed { margin-left: var(--sidebar-collapsed-w); }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
