/* =========================================================================
   Road Compliance Copilot — Design System
   Premium industrial aesthetic for highway construction professionals
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
  /* surfaces & ink */
  --bg-page: #FAFAF7;
  --bg-surface: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-sidebar: #0B0C0E;
  --bg-sidebar-2: #15171A;
  --bg-context: #FBFAF6;
  --bg-subtle: #F4F2EC;
  --bg-stripe: #F8F6F0;

  --ink-1: #0F1115;
  --ink-2: #2A2F37;
  --ink-3: #5A6371;
  --ink-4: #9AA3B0;
  --ink-5: #C4C8CE;
  --ink-inv: #F5F4EF;
  --ink-inv-mute: #9CA3AF;

  /* borders */
  --border: #E7E3DA;
  --border-strong: #D2CCC0;
  --border-soft: #EFEBE2;
  --border-dark: #1F2227;

  /* brand */
  --brand: #1F3A5F;
  --brand-2: #2A4F7E;
  --brand-3: #4A6FA0;
  --brand-soft: #E8EEF5;

  --accent: #C8501C;
  --accent-2: #A04015;
  --accent-soft: #FBEEE5;
  --accent-glow: rgba(200, 80, 28, 0.16);

  /* status */
  --success: #166534;
  --success-soft: #DCFCE7;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #991B1B;
  --danger-soft: #FEE2E2;
  --info: #1E40AF;
  --info-soft: #DBEAFE;

  /* divisions (8 codified colors) */
  --div-100: #475569;
  --div-100-soft: #F1F5F9;
  --div-200: #92400E;
  --div-200-soft: #FEF3C7;
  --div-300: #78716C;
  --div-300-soft: #F5F4EF;
  --div-400: #1E293B;
  --div-400-soft: #E2E8F0;
  --div-500: #6B7280;
  --div-500-soft: #F3F4F6;
  --div-600: #EA580C;
  --div-600-soft: #FFEDD5;
  --div-700: #1E3A8A;
  --div-700-soft: #DBEAFE;
  --div-800: #4D7C0F;
  --div-800-soft: #ECFCCB;

  /* typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Inter Tight', 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --sp-10: 64px;
  --sp-11: 80px;

  /* radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* shadows (layered, subtle) */
  --shadow-xs: 0 1px 1px rgba(15, 17, 21, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.05), 0 1px 1px rgba(15, 17, 21, 0.03);
  --shadow: 0 4px 12px rgba(15, 17, 21, 0.06), 0 1px 3px rgba(15, 17, 21, 0.04);
  --shadow-md: 0 12px 28px rgba(15, 17, 21, 0.08), 0 2px 6px rgba(15, 17, 21, 0.04);
  --shadow-lg: 0 24px 56px rgba(15, 17, 21, 0.10), 0 4px 12px rgba(15, 17, 21, 0.06);

  /* sizing */
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 56px;
  --context-w: 320px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t: 200ms;
  --t-slow: 320ms;
}

/* -------------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--accent-glow); color: var(--ink-1); }

/* scrollbar */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: padding-box; border: 2px solid transparent; }

/* -------------------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-1);
  line-height: 1.18;
}
h1 { font-size: 32px; letter-spacing: -0.03em; }
h2 { font-size: 24px; }
h3 { font-size: 18px; letter-spacing: -0.015em; }
h4 { font-size: 15px; letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }

/* -------------------------------------------------------------------------
   4. App shell
   ------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  overflow: hidden;
}

.app.has-context {
  grid-template-columns: var(--sidebar-w) 1fr var(--context-w);
}

/* sidebar */
.sidebar {
  grid-row: 1 / 3;
  grid-column: 1;
  background: var(--bg-sidebar);
  color: var(--ink-inv);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-dark);
  overflow: hidden;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--border-dark);
}
.sidebar-brand .mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-inv);
  font-size: 13px;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.1);
}
.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 15px;
}
.sidebar-brand .sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-inv-mute);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.nav-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5E6470;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px var(--sp-3);
  border-radius: var(--r-sm);
  color: #C7CBD3;
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  position: relative;
}
.nav-item:hover { background: var(--bg-sidebar-2); color: var(--ink-inv); }
.nav-item.active {
  background: var(--bg-sidebar-2);
  color: var(--ink-inv);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 8px; bottom: 8px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-item .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ink-inv-mute);
  background: var(--bg-sidebar-2);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-weight: 500;
}
.nav-item.active .count { background: #22262C; color: var(--ink-inv); }

.sidebar-foot {
  border-top: 1px solid var(--border-dark);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.user-chip { display: flex; align-items: center; gap: var(--sp-3); flex: 1; min-width: 0; }
.avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #C8501C 0%, #8B3811 100%);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: white;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.user-name { font-size: 13px; color: var(--ink-inv); font-weight: 500; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--ink-inv-mute); }

/* topbar */
.topbar {
  grid-row: 1;
  grid-column: 2 / -1;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  gap: var(--sp-5);
  position: relative;
  z-index: 10;
}

.project-switcher {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px var(--sp-3) 6px var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
  border: 1px solid transparent;
}
.project-switcher:hover { background: var(--bg-subtle); }
.project-switcher .pill {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.project-switcher .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.project-switcher .meta {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.divider-v { width: 1px; height: 24px; background: var(--border); }

.topbar-search {
  flex: 1;
  max-width: 540px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0 var(--sp-4) 0 36px;
  font-size: 13.5px;
  color: var(--ink-1);
  transition: all var(--t-fast) var(--ease);
}
.topbar-search input::placeholder { color: var(--ink-4); }
.topbar-search input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.topbar-search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-4);
  pointer-events: none;
}
.topbar-search .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--r-xs);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* Local / Online mode pill */
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  user-select: none;
}
.mode-pill:hover { border-color: var(--ink-2); background: var(--bg-surface); }
.mode-pill .mode-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  box-shadow: 0 0 0 2px rgba(154, 163, 176, 0.2);
  flex-shrink: 0;
}
.mode-pill .mode-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-soft);
  animation: hsai-pulse 2s ease-in-out infinite;
}
@keyframes hsai-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--success-soft); }
  50%      { box-shadow: 0 0 0 4px rgba(22, 101, 52, 0.15); }
}

/* EN / ES language pill */
.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: var(--r-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.lang-pill:hover { border-color: var(--ink-2); background: var(--bg-surface); }
.lang-pill .lang-current { color: var(--ink-1); }
.lang-pill .lang-other { color: var(--ink-4); }
.lang-pill .lang-other::before { content: '·'; margin-right: 4px; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  position: relative;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--ink-1); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  box-sizing: content-box;
}

/* workspace */
.workspace {
  grid-row: 2;
  grid-column: 2;
  overflow-y: auto;
  background: var(--bg-page);
  position: relative;
}
.workspace-inner {
  padding: var(--sp-7) var(--sp-7) var(--sp-10);
  max-width: 1480px;
  margin: 0 auto;
}

/* context panel */
.context-panel {
  grid-row: 2;
  grid-column: 3;
  background: var(--bg-context);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

/* -------------------------------------------------------------------------
   5. Page header
   ------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  margin-bottom: var(--sp-7);
  border-bottom: 1px solid var(--border);
}
.page-head .titles { display: flex; flex-direction: column; gap: var(--sp-2); }
.page-head .breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.page-head h1 { font-size: 30px; }
.page-head .lede { color: var(--ink-3); font-size: 14.5px; max-width: 640px; }
.page-head .actions { display: flex; gap: var(--sp-2); }

/* -------------------------------------------------------------------------
   6. Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  height: 36px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn .icon { width: 14px; height: 14px; }
.btn-primary {
  background: var(--ink-1);
  color: var(--ink-inv);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 2px rgba(15,17,21,0.12);
}
.btn-primary:hover { background: #1a1d22; transform: translateY(-0.5px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 12px rgba(15,17,21,0.14); }
.btn-primary:active { transform: translateY(0); }

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 1px 2px rgba(200,80,28,0.24);
}
.btn-accent:hover { background: var(--accent-2); transform: translateY(-0.5px); }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-subtle); border-color: var(--border-strong); }

.btn-soft { background: var(--bg-subtle); color: var(--ink-1); border-color: transparent; }
.btn-soft:hover { background: #ECE9DF; }

.btn-sm { height: 30px; padding: 0 var(--sp-3); font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { height: 44px; padding: 0 var(--sp-5); font-size: 14.5px; }

.btn-icon { width: 36px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 30px; }

/* -------------------------------------------------------------------------
   7. Cards
   ------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card.interactive { cursor: pointer; }
.card.interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.card-pad { padding: var(--sp-5); }
.card-pad-lg { padding: var(--sp-6); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-soft);
}
.card-head h4 { font-size: 14px; letter-spacing: -0.01em; }
.card-head .eyebrow { margin-bottom: 2px; }
.card-body { padding: var(--sp-5); }

/* -------------------------------------------------------------------------
   8. Badges & chips
   ------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  color: var(--ink-2);
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.badge.neutral { background: var(--bg-subtle); color: var(--ink-2); }

.badge-plain { background: transparent; padding: 0; }
.badge-plain::before { display: none; }

/* division pill */
.div-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
}
.div-pill .swatch {
  width: 8px; height: 8px;
  border-radius: 2px;
}
.div-pill[data-div="100"] .swatch { background: var(--div-100); }
.div-pill[data-div="200"] .swatch { background: var(--div-200); }
.div-pill[data-div="300"] .swatch { background: var(--div-300); }
.div-pill[data-div="400"] .swatch { background: var(--div-400); }
.div-pill[data-div="500"] .swatch { background: var(--div-500); }
.div-pill[data-div="600"] .swatch { background: var(--div-600); }
.div-pill[data-div="700"] .swatch { background: var(--div-700); }
.div-pill[data-div="800"] .swatch { background: var(--div-800); }

/* -------------------------------------------------------------------------
   9. Grids
   ------------------------------------------------------------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-5); }

@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* -------------------------------------------------------------------------
   10. Stats / metrics
   ------------------------------------------------------------------------- */
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  position: relative;
  overflow: hidden;
}
.stat .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink-1);
  line-height: 1;
  font-feature-settings: 'tnum' 1;
}
.stat .trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-mono);
}
.stat .trend.up { color: var(--success); }
.stat .trend.down { color: var(--danger); }
.stat .sub { font-size: 12px; color: var(--ink-3); }

.stat.accent { background: linear-gradient(135deg, #FBEEE5 0%, #F8E3D2 100%); border-color: transparent; }
.stat.accent .value { color: var(--accent-2); }

/* -------------------------------------------------------------------------
   11. Lists
   ------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--border-soft); }
.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}
.list-item .meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-item .meta .t { font-size: 13.5px; font-weight: 500; color: var(--ink-1); }
.list-item .meta .s { font-size: 12px; color: var(--ink-3); }

/* alerts list */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-left: 2px solid var(--border);
  background: var(--bg-surface);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: var(--sp-2);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  cursor: pointer;
}
.alert-item:hover { background: var(--bg-subtle); }
.alert-item.danger { border-left-color: var(--danger); }
.alert-item.warn { border-left-color: var(--warn); }
.alert-item.info { border-left-color: var(--info); }
.alert-item .marker {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.alert-item.danger .marker { background: var(--danger-soft); color: var(--danger); }
.alert-item.warn .marker { background: var(--warn-soft); color: var(--warn); }
.alert-item.info .marker { background: var(--info-soft); color: var(--info); }
.alert-item .body { flex: 1; min-width: 0; }
.alert-item .title { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--ink-1); }
.alert-item .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* -------------------------------------------------------------------------
   12. Tables
   ------------------------------------------------------------------------- */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
  padding: 12px var(--sp-4);
  background: var(--bg-stripe);
  border-bottom: 1px solid var(--border);
}
.tbl tbody td {
  padding: var(--sp-3) var(--sp-4);
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--bg-stripe); }
.tbl .t-strong { font-weight: 500; color: var(--ink-1); }
.tbl .t-muted { color: var(--ink-3); font-size: 12.5px; }
.tbl .t-mono { font-family: var(--font-mono); }

/* -------------------------------------------------------------------------
   13. Quick actions grid (Dashboard)
   ------------------------------------------------------------------------- */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 1200px) { .qa-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .qa-grid { grid-template-columns: repeat(2, 1fr); } }

.qa-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t) var(--ease);
  position: relative;
  min-height: 110px;
}
.qa-tile:hover {
  border-color: var(--ink-1);
  background: #FCFBF7;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.qa-tile .qa-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: all var(--t) var(--ease);
}
.qa-tile:hover .qa-icon { background: var(--ink-1); color: var(--ink-inv); }
.qa-tile .qa-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink-1);
  font-family: var(--font-display);
}
.qa-tile .qa-sub {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.4;
}
.qa-tile .arrow {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  color: var(--ink-4);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--t) var(--ease);
}
.qa-tile:hover .arrow { opacity: 1; transform: translateX(0); }

/* -------------------------------------------------------------------------
   14. Hero search (Dashboard)
   ------------------------------------------------------------------------- */
.hero-search {
  background: linear-gradient(180deg, #FFFFFF 0%, #FBFAF6 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  position: relative;
  overflow: hidden;
}
.hero-search::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 60% at 0% 0%, rgba(200,80,28,0.04) 0%, transparent 60%),
    radial-gradient(50% 60% at 100% 100%, rgba(31,58,95,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.hero-search-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.hero-search-row .input-wrap { flex: 1; position: relative; }
.hero-search input.big {
  width: 100%;
  height: 52px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 var(--sp-5) 0 52px;
  font-size: 15px;
  font-weight: 450;
  color: var(--ink-1);
  transition: all var(--t-fast) var(--ease);
  box-shadow: var(--shadow-xs);
}
.hero-search input.big:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.hero-search input.big::placeholder { color: var(--ink-4); }
.hero-search .big-icon {
  position: absolute;
  left: var(--sp-5);
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
}

.hero-search-meta {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}
.suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.suggest-chip:hover { border-color: var(--ink-1); background: var(--bg-stripe); }
.suggest-chip .icon { color: var(--ink-3); width: 12px; height: 12px; }

/* -------------------------------------------------------------------------
   15. Section header (in-page)
   ------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  gap: var(--sp-4);
}
.section-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.section-head .link {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.section-head .link:hover { color: var(--ink-1); }

/* -------------------------------------------------------------------------
   16. Agent cards
   ------------------------------------------------------------------------- */
.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: all var(--t) var(--ease);
  display: flex;
  flex-direction: column;
}
.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.agent-card .top {
  padding: var(--sp-5);
  background: var(--bg-stripe);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.agent-card .stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.agent-card[data-div="100"] .stripe { background: var(--div-100); }
.agent-card[data-div="200"] .stripe { background: var(--div-200); }
.agent-card[data-div="300"] .stripe { background: var(--div-300); }
.agent-card[data-div="400"] .stripe { background: var(--div-400); }
.agent-card[data-div="500"] .stripe { background: var(--div-500); }
.agent-card[data-div="600"] .stripe { background: var(--div-600); }
.agent-card[data-div="700"] .stripe { background: var(--div-700); }
.agent-card[data-div="800"] .stripe { background: var(--div-800); }

.agent-card .num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink-1);
  line-height: 1;
  font-feature-settings: 'tnum' 1;
}
.agent-card .num-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 6px;
  font-weight: 500;
}
.agent-card .title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: var(--sp-2);
}
.agent-card .body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); flex: 1; }
.agent-card .use-for { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.agent-card .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.agent-card .action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-stripe);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  border: 1px solid transparent;
}
.agent-card .action-row:hover {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--ink-1);
}
.agent-card .action-row .arrow { color: var(--ink-4); transition: transform var(--t-fast) var(--ease); }
.agent-card .action-row:hover .arrow { color: var(--ink-1); transform: translateX(2px); }

/* -------------------------------------------------------------------------
   17. Chat (Ask AI)
   ------------------------------------------------------------------------- */
.chat-shell {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - var(--topbar-h));
}
.chat-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-page);
}
.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-7) var(--sp-7) var(--sp-5);
}
.chat-stream-inner { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-6); }

.msg { display: flex; gap: var(--sp-4); }
.msg .av {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
}
.msg.user .av { background: var(--bg-subtle); color: var(--ink-1); }
.msg.ai .av { background: var(--ink-1); color: var(--ink-inv); }
.msg .content { flex: 1; min-width: 0; padding-top: 6px; }
.msg .who { font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: var(--sp-2); }
.msg .who .time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); margin-left: var(--sp-2); font-weight: 400; }
.msg .text { font-size: 14.5px; line-height: 1.6; color: var(--ink-1); }

/* ai answer block */
.answer {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: var(--sp-3);
}
.answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-stripe);
  border-bottom: 1px solid var(--border-soft);
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.answer-head .lhs { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.answer-body { padding: var(--sp-5); }
.answer-section + .answer-section { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--border-soft); }
.answer-section h5 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: var(--sp-2);
}
.answer-section p { font-size: 14px; line-height: 1.65; }
.answer-section ul { display: flex; flex-direction: column; gap: 6px; padding-left: var(--sp-5); list-style: none; }
.answer-section ul li {
  position: relative;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
.answer-section ul li::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 9px;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 1px;
}

.cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.cite:hover { background: #DCE5F0; }

.answer-actions {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-stripe);
  border-top: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

/* chat composer */
.composer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
}
.composer-inner { max-width: 880px; margin: 0 auto; }
.composer-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.composer-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.composer-row textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 14.5px;
  background: transparent;
  min-height: 28px;
  max-height: 200px;
  padding: 4px;
  line-height: 1.5;
}
.composer-row textarea::placeholder { color: var(--ink-4); }
.composer-tools { display: flex; gap: 2px; }
.composer-hint {
  margin-top: var(--sp-3);
  font-size: 11.5px;
  color: var(--ink-4);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.composer-hint .kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-subtle);
  padding: 2px 5px;
  border-radius: var(--r-xs);
}

/* agents-used panel */
.consult-panel { display: flex; flex-direction: column; gap: var(--sp-3); }
.consult-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  position: relative;
}
.consult-card .stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.consult-card[data-div="100"] .stripe { background: var(--div-100); }
.consult-card[data-div="200"] .stripe { background: var(--div-200); }
.consult-card[data-div="300"] .stripe { background: var(--div-300); }
.consult-card[data-div="400"] .stripe { background: var(--div-400); }
.consult-card[data-div="500"] .stripe { background: var(--div-500); }
.consult-card[data-div="600"] .stripe { background: var(--div-600); }
.consult-card[data-div="700"] .stripe { background: var(--div-700); }
.consult-card[data-div="800"] .stripe { background: var(--div-800); }
.consult-card .row1 { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.consult-card .name { font-size: 13px; font-weight: 600; }
.consult-card .role {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
}
.consult-card .status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.consult-card .status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.consult-card.processing .status::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* -------------------------------------------------------------------------
   18. Wizard / stepper
   ------------------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-7);
}
.step {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-3);
  border-radius: var(--r-full);
  font-size: 12.5px;
  color: var(--ink-3);
  border: 1px solid transparent;
}
.step .num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.step.active { background: var(--ink-1); color: var(--ink-inv); }
.step.active .num { background: var(--accent); color: white; }
.step.done { color: var(--success); }
.step.done .num { background: var(--success-soft); color: var(--success); }
.step-sep { width: 16px; height: 1px; background: var(--border-strong); }

/* -------------------------------------------------------------------------
   19. Forms
   ------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field input[type="text"],
.field input[type="number"],
.field input[type="date"],
.field input[type="email"],
.field select,
.field textarea {
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 var(--sp-3);
  font-size: 13.5px;
  color: var(--ink-1);
  transition: all var(--t-fast) var(--ease);
}
.field textarea {
  height: auto;
  min-height: 100px;
  padding: var(--sp-3);
  resize: vertical;
  font: inherit;
  line-height: 1.5;
  font-size: 13.5px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }

.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.radio-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.radio-tile:hover { border-color: var(--border-strong); background: var(--bg-stripe); }
.radio-tile.selected {
  border-color: var(--ink-1);
  background: var(--bg-stripe);
  box-shadow: 0 0 0 2px rgba(15,17,21,0.08);
}
.radio-tile .t { font-size: 13.5px; font-weight: 600; color: var(--ink-1); }
.radio-tile .s { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.radio-tile .ico { color: var(--ink-3); margin-bottom: 4px; }

/* -------------------------------------------------------------------------
   20. Tabs
   ------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
}
.tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink-1); }
.tab.active { color: var(--ink-1); border-bottom-color: var(--accent); }
.tab .count {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-subtle);
  color: var(--ink-3);
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.tab.active .count { background: var(--accent-soft); color: var(--accent-2); }

/* -------------------------------------------------------------------------
   21. Misc
   ------------------------------------------------------------------------- */
.divider { height: 1px; background: var(--border); margin: var(--sp-6) 0; }

.empty-state {
  padding: var(--sp-9) var(--sp-6);
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-stripe);
}
.empty-state h4 { margin-bottom: var(--sp-2); }
.empty-state p { color: var(--ink-3); font-size: 13.5px; margin-bottom: var(--sp-4); }

.context-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.context-section .h {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* loading dots */
.dots span {
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ink-3);
  margin: 0 1px;
  animation: dots 1.4s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dots {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   UI/UX polish: skeletons, command palette items, search hover,
   bell pulse, nav badges, soft hover states.
   ============================================================ */

/* Skeleton loader */
.skel {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--bg-stripe) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Topbar search — make it actually look interactive */
.topbar-search {
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.topbar-search:hover,
.topbar-search:focus-visible {
  background: var(--bg-surface);
  border-color: var(--ink-3);
  outline: none;
}
.topbar-search input {
  cursor: pointer;
  pointer-events: none;
}

/* Bell button + pulsing unread dot */
.icon-btn[data-bell] { position: relative; }
.icon-btn[data-bell] .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-surface);
  animation: bell-pulse 2s ease-in-out infinite;
}
@keyframes bell-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* Nav badges — make them more legible and tied to count weight */
.sidebar .nav-item .count {
  background: var(--accent);
  color: var(--ink-inv);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.sidebar .nav-item.active .count {
  background: var(--ink-inv);
  color: var(--ink-1);
}

/* Command-palette item hover */
.cmd-item:hover { background: var(--bg-stripe) !important; }
.cmd-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Make pinable shortcut hint chip look like a key */
.kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-stripe);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  user-select: none;
}

/* Topbar action links should look like buttons */
.topbar-actions a.btn,
.topbar-actions a.icon-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Empty-state polish — center, dimmed, with bigger hit area for CTA */
.empty-state {
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  background: var(--bg-stripe);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
}
.empty-state .emoji { font-size: 36px; opacity: 0.35; margin-bottom: var(--sp-3); display: block; }
.empty-state h4 { margin-bottom: var(--sp-2); font-size: 16px; }
.empty-state p { max-width: 480px; margin: 0 auto var(--sp-4); color: var(--ink-3); font-size: 13px; line-height: 1.6; }

/* responsive helpers */
@media (max-width: 1100px) {
  .app.has-context { grid-template-columns: var(--sidebar-w) 1fr; }
  .context-panel { display: none; }
}
@media (max-width: 820px) {
  .app, .app.has-context { grid-template-columns: 1fr; grid-template-rows: var(--topbar-h) 1fr; }
  .sidebar { display: none; }
  .workspace-inner { padding: var(--sp-5); }
  .topbar-search { display: none; }
  .topbar-actions .btn span:not([class]) { display: none; }
}
