/* =========================================================
   Analytics Arena — Design System
   ========================================================= */

/* ---------- Tokens: Light theme (default) ---------- */
:root {
  /* Brand */
  --primary: #0B5FFF;
  --primary-hover: #0A52DB;
  --primary-active: #083FB3;
  --primary-subtle: #E8EFFF;
  --primary-subtle-2: #D6E2FF;
  --on-primary: #FFFFFF;

  /* Neutrals — surfaces */
  --bg: #FFFFFF;
  --bg-subtle: #F7F8FA;
  --bg-muted: #EFF1F4;
  --bg-inset: #F2F4F7;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;

  /* Borders */
  --border: #E4E7EC;
  --border-strong: #D0D5DD;
  --border-focus: #0B5FFF;

  /* Text */
  --text: #0B1220;
  --text-muted: #5B6573;
  --text-subtle: #8A93A1;
  --text-on-muted: #404956;
  --text-inverse: #FFFFFF;

  /* Semantic */
  --success: #0E9F6E;
  --success-subtle: #E3F7EE;
  --warning: #D97706;
  --warning-subtle: #FEF3E2;
  --danger: #DC2626;
  --danger-subtle: #FDECEC;
  --info: #0EA5E9;
  --info-subtle: #E2F5FE;

  /* Data viz palette — restrained, analytical */
  --series-1: #0B5FFF;
  --series-2: #14B8A6;
  --series-3: #8B5CF6;
  --series-4: #F59E0B;
  --series-5: #EC4899;
  --series-6: #10B981;
  --series-7: #6366F1;
  --series-8: #EF4444;
  --chart-grid: #ECEEF2;
  --chart-axis: #8A93A1;

  /* Type */
  --font-heading: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Commit Mono", "SF Mono", Menlo, Consolas, monospace;

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

  /* Radii (Soft 6-8px personality) */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-pill: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, 0.12), 0 4px 8px -4px rgba(16, 24, 40, 0.06);
  --shadow-xl: 0 24px 48px -12px rgba(16, 24, 40, 0.16);
  --shadow-focus: 0 0 0 4px rgba(11, 95, 255, 0.18);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 260ms;
}

/* ---------- Tokens: Dark theme (default) ---------- */
[data-theme="dark"] {
  --primary: #3B7BFF;
  --primary-hover: #5C92FF;
  --primary-active: #7BA8FF;
  --primary-subtle: #112042;
  --primary-subtle-2: #1A2E5C;
  --on-primary: #FFFFFF;

  --bg: #0A0E1A;
  --bg-subtle: #0F1424;
  --bg-muted: #141A2E;
  --bg-inset: #0D1322;
  --surface: #0F1424;
  --surface-raised: #141A2E;

  --border: #1E2540;
  --border-strong: #2A3354;
  --border-focus: #3B7BFF;

  --text: #E7ECF5;
  --text-muted: #98A2B8;
  --text-subtle: #6B7593;
  --text-on-muted: #C1C7D6;
  --text-inverse: #0A0E1A;

  --success: #34D399;
  --success-subtle: #0C2A22;
  --warning: #FBBF24;
  --warning-subtle: #2B1F08;
  --danger: #F87171;
  --danger-subtle: #2B1212;
  --info: #38BDF8;
  --info-subtle: #07273A;

  --series-1: #4F8BFF;
  --series-2: #2DD4BF;
  --series-3: #A78BFA;
  --series-4: #FBBF24;
  --series-5: #F472B6;
  --series-6: #34D399;
  --series-7: #818CF8;
  --series-8: #F87171;
  --chart-grid: #1E2540;
  --chart-axis: #6B7593;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.55), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
  --shadow-focus: 0 0 0 4px rgba(59, 123, 255, 0.28);
}

/* ---------- Tokens: Dark theme — flavor variants ---------- */
[data-theme="dark"][data-dark-flavor="true-black"] {
  --bg: #000000;
  --bg-subtle: #0A0A0A;
  --bg-muted: #141414;
  --bg-inset: #050505;
  --surface: #0A0A0A;
  --surface-raised: #141414;
  --border: #1F1F1F;
  --border-strong: #2D2D2D;
  --chart-grid: #1A1A1A;
  --chart-axis: #707070;
}
[data-theme="dark"][data-dark-flavor="true-black"] .topbar { background: rgba(0,0,0,0.78); }

[data-theme="dark"][data-dark-flavor="charcoal"] {
  --bg: #141414;
  --bg-subtle: #1A1A1A;
  --bg-muted: #222222;
  --bg-inset: #0F0F0F;
  --surface: #1A1A1A;
  --surface-raised: #222222;
  --border: #2A2A2A;
  --border-strong: #3A3A3A;
  --chart-grid: #262626;
  --chart-axis: #707070;
}
[data-theme="dark"][data-dark-flavor="charcoal"] .topbar { background: rgba(20,20,20,0.78); }

[data-theme="dark"][data-dark-flavor="warm"] {
  --bg: #14110E;
  --bg-subtle: #1A1714;
  --bg-muted: #221F1B;
  --bg-inset: #0F0D0A;
  --surface: #1A1714;
  --surface-raised: #221F1B;
  --border: #2C2822;
  --border-strong: #3A352E;
  --chart-grid: #28241F;
  --chart-axis: #7A7368;
  --text-muted: #A39B8E;
  --text-subtle: #786F62;
}
[data-theme="dark"][data-dark-flavor="warm"] .topbar { background: rgba(20,17,14,0.78); }

[data-theme="dark"][data-dark-flavor="midnight"] {
  --bg: #050D24;
  --bg-subtle: #0A1330;
  --bg-muted: #11193D;
  --bg-inset: #03081A;
  --surface: #0A1330;
  --surface-raised: #11193D;
  --border: #1B2750;
  --border-strong: #2A3766;
  --chart-grid: #16204A;
  --chart-axis: #6E7BA0;
}
[data-theme="dark"][data-dark-flavor="midnight"] .topbar { background: rgba(5,13,36,0.82); }

[data-theme="dark"][data-dark-flavor="slate"] {
  --bg: #0F1115;
  --bg-subtle: #14171D;
  --bg-muted: #1B1F27;
  --bg-inset: #0A0C10;
  --surface: #14171D;
  --surface-raised: #1B1F27;
  --border: #232832;
  --border-strong: #313845;
  --chart-grid: #1F242E;
  --chart-axis: #6E7585;
}
[data-theme="dark"][data-dark-flavor="slate"] .topbar { background: rgba(15,17,21,0.78); }

[data-theme="dark"][data-dark-flavor="forest"] {
  --bg: #0A1410;
  --bg-subtle: #0F1A14;
  --bg-muted: #16221C;
  --bg-inset: #050D0A;
  --surface: #0F1A14;
  --surface-raised: #16221C;
  --border: #1F2D24;
  --border-strong: #2E4035;
  --chart-grid: #1A2820;
  --chart-axis: #6D8478;
}
[data-theme="dark"][data-dark-flavor="forest"] .topbar { background: rgba(10,20,16,0.82); }

[data-theme="dark"][data-dark-flavor="plum"] {
  --bg: #100A18;
  --bg-subtle: #170F22;
  --bg-muted: #20162E;
  --bg-inset: #0A0612;
  --surface: #170F22;
  --surface-raised: #20162E;
  --border: #2D2138;
  --border-strong: #3D2E4A;
  --chart-grid: #261B33;
  --chart-axis: #7E6E8E;
}
[data-theme="dark"][data-dark-flavor="plum"] .topbar { background: rgba(16,10,24,0.82); }

[data-theme="dark"][data-dark-flavor="coffee"] {
  --bg: #1A130D;
  --bg-subtle: #221A12;
  --bg-muted: #2B2218;
  --bg-inset: #120D08;
  --surface: #221A12;
  --surface-raised: #2B2218;
  --border: #382C20;
  --border-strong: #483A2C;
  --chart-grid: #32281D;
  --chart-axis: #8A7B68;
  --text-muted: #B0A293;
  --text-subtle: #85786A;
}
[data-theme="dark"][data-dark-flavor="coffee"] .topbar { background: rgba(26,19,13,0.82); }

[data-theme="dark"][data-dark-flavor="nord"] {
  --bg: #1F252F;
  --bg-subtle: #252C38;
  --bg-muted: #2E3644;
  --bg-inset: #1A1F28;
  --surface: #252C38;
  --surface-raised: #2E3644;
  --border: #38424F;
  --border-strong: #4A5563;
  --chart-grid: #313A48;
  --chart-axis: #8A93A5;
  --text: #ECEFF4;
  --text-muted: #B5BCC8;
  --text-subtle: #8590A0;
}
[data-theme="dark"][data-dark-flavor="nord"] .topbar { background: rgba(31,37,47,0.82); }

[data-theme="dark"][data-dark-flavor="obsidian"] {
  --bg: #08080C;
  --bg-subtle: #0E0E14;
  --bg-muted: #16161F;
  --bg-inset: #050508;
  --surface: #0E0E14;
  --surface-raised: #16161F;
  --border: #1F1F2E;
  --border-strong: #2C2C42;
  --chart-grid: #161624;
  --chart-axis: #6E6E85;
}
[data-theme="dark"][data-dark-flavor="obsidian"] .topbar { background: rgba(8,8,12,0.82); }


* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
::selection { background: var(--primary-subtle-2); color: var(--text); }
[data-theme="dark"] ::selection { background: var(--primary-subtle-2); }

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--text);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: 1.15;
}
.display-1 { font-size: 64px; line-height: 1.05; letter-spacing: -0.02em; }
h1 { font-size: 44px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 19px; font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.005em; }
h5 { font-size: 15px; font-family: var(--font-sans); font-weight: 600; letter-spacing: 0; }

p { margin: 0 0 var(--space-3); color: var(--text-muted); }
p.lead { font-size: 18px; line-height: 1.55; color: var(--text-on-muted); max-width: 64ch; }

a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }

code, kbd, samp, .mono, .num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "zero";
  font-variant-numeric: tabular-nums;
}
.num { letter-spacing: -0.01em; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }

hr.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-12) 0;
}

/* ---------- Layout: Topbar + Sidebar + Content ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .topbar { background: rgba(10, 14, 26, 0.78); }
.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 60px;
  padding: 0 var(--space-6);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-lockup {
  height: 22px;
  width: auto;
  display: block;
}
.brand-lockup.dark-only { display: none; }
[data-theme="dark"] .brand-lockup.light-only { display: none; }
[data-theme="dark"] .brand-lockup.dark-only { display: block; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  background: var(--primary);
  display: grid; place-items: center;
  color: var(--on-primary);
  position: relative;
  overflow: hidden;
}
.brand-mark svg { display: block; }
.brand-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  padding: 2px 6px;
  background: var(--bg-muted);
  border-radius: var(--r-sm);
  margin-left: 4px;
}

.topbar-nav {
  display: flex; gap: 2px; flex: 1;
  margin-left: var(--space-6);
}
.topbar-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--r-md);
}
.topbar-nav a:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.topbar-nav a.active { color: var(--text); background: var(--bg-muted); }

.topbar-search {
  position: relative;
  width: 240px;
}
.topbar-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 32px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--dur) var(--ease);
}
.topbar-search input::placeholder { color: var(--text-subtle); }
.topbar-search input:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--shadow-focus); background: var(--surface); }
.topbar-search .ti {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-subtle);
}
.topbar-search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; padding: 2px 5px; border-radius: 3px;
  background: var(--surface); color: var(--text-subtle);
  border: 1px solid var(--border);
}

.theme-toggle {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }

.layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 0;
  max-width: 1480px;
  margin: 0 auto;
}
.sidenav {
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: var(--space-8) var(--space-4) var(--space-8) var(--space-6);
  border-right: 1px solid var(--border);
}
.sidenav-group { margin-bottom: var(--space-5); }
.sidenav-group-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-subtle);
  padding: 0 8px;
  margin-bottom: 6px;
}
.sidenav a {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 400;
  transition: all var(--dur-fast) var(--ease);
}
.sidenav a:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.sidenav a.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 500;
}
[data-theme="dark"] .sidenav a.active { color: var(--primary-active); }

.content {
  padding: var(--space-12) var(--space-10);
  min-width: 0;
  max-width: 1100px;
}

/* ---------- Section ---------- */
.section { margin-bottom: var(--space-16); scroll-margin-top: 80px; }
.section-head { margin-bottom: var(--space-8); max-width: 64ch; }
.section-head .eyebrow { display: block; margin-bottom: 8px; }
.section-head h2 { margin-bottom: 6px; }
.section-head p { font-size: 16px; color: var(--text-muted); max-width: 60ch; }

.subsection { margin: var(--space-10) 0 var(--space-6); }
.subsection h3 { font-family: var(--font-sans); font-weight: 600; font-size: 18px; letter-spacing: -0.005em; margin-bottom: 4px; }
.subsection .sub-desc { color: var(--text-muted); font-size: 14px; max-width: 60ch; }

/* ---------- Specimen / example card ---------- */
.specimen {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.specimen-body {
  padding: var(--space-6);
  background:
    linear-gradient(var(--bg-inset), var(--bg-inset)),
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(0,0,0,0.012) 8px 9px);
}
.specimen-body.plain { background: var(--bg-subtle); }
.specimen-body.surface { background: var(--surface); }
.specimen-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
  color: var(--text-subtle);
}
.specimen-foot code {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 2px 6px;
  border-radius: var(--r-xs);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--bg);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ti { width: 16px; height: 16px; }

.btn-primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--on-primary);
  --btn-bd: var(--primary);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, var(--shadow-xs);
}
.btn-primary:hover { --btn-bg: var(--primary-hover); --btn-bd: var(--primary-hover); }
.btn-primary:active { --btn-bg: var(--primary-active); --btn-bd: var(--primary-active); }

.btn-secondary {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-subtle); }

.btn-tertiary {
  --btn-bg: transparent;
  --btn-fg: var(--text-muted);
  --btn-bd: transparent;
}
.btn-tertiary:hover { background: var(--bg-muted); --btn-fg: var(--text); }

.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: white;
  --btn-bd: var(--danger);
}
.btn-danger:hover { filter: brightness(0.95); }

.btn-success {
  --btn-bg: var(--success);
  --btn-fg: white;
  --btn-bd: var(--success);
}

.btn-ghost-primary {
  --btn-bg: var(--primary-subtle);
  --btn-fg: var(--primary);
  --btn-bd: transparent;
}
.btn-ghost-primary:hover { --btn-bg: var(--primary-subtle-2); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-icon { padding: 0; width: 36px; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { display: flex; width: 100%; }

.btn-group {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.btn-group .btn {
  height: 32px; border-radius: 0; border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
}
.btn-group .btn:last-child { border-right: 0; }
.btn-group .btn.active { background: var(--bg-muted); color: var(--text); font-weight: 500; }

/* Spinner inside button */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0.9;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.label .req { color: var(--danger); }
.help { font-size: 12px; color: var(--text-subtle); }
.help.error { color: var(--danger); }
.help.success { color: var(--success); }

.input, .select, .textarea {
  height: 36px;
  width: 100%;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: all var(--dur) var(--ease);
  appearance: none;
}
.input::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-muted);
  color: var(--text-subtle);
  cursor: not-allowed;
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid {
  border-color: var(--danger);
}
.input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16); }
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; line-height: 1.5; }

.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A93A1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.input-affix { position: relative; }
.input-affix .input { padding-left: 32px; }
.input-affix .input.right { padding-left: 12px; padding-right: 32px; }
.input-affix .affix {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: 10px; color: var(--text-subtle);
  font-size: 13px;
  font-family: var(--font-mono);
  pointer-events: none;
}
.input-affix .affix.right { left: auto; right: 10px; }

/* Checkbox & Radio */
.check, .radio {
  display: inline-flex; align-items: flex-start; gap: 8px;
  cursor: pointer; user-select: none;
  font-size: 13.5px; color: var(--text);
}
.check input, .radio input {
  appearance: none;
  width: 16px; height: 16px;
  margin: 2px 0 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
  flex-shrink: 0;
}
.check input { border-radius: 4px; }
.radio input { border-radius: 50%; }
.check input:hover, .radio input:hover { border-color: var(--text-subtle); }
.check input:focus-visible, .radio input:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.check input:checked, .radio input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px;
}
.radio input:checked::after {
  content: ""; position: absolute; inset: 4px;
  border-radius: 50%; background: white;
}

/* Switch */
.switch {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  font-size: 13.5px;
}
.switch input { display: none; }
.switch .track {
  width: 32px; height: 18px;
  background: var(--border-strong);
  border-radius: var(--r-pill);
  position: relative;
  transition: background var(--dur) var(--ease);
}
.switch .track::after {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: var(--shadow-focus); }

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-muted);
  border-radius: var(--r-md);
}
.segmented button {
  height: 28px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  font-family: var(--font-sans);
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ---------- Badges & Chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: var(--r-sm);
  background: var(--bg-muted);
  color: var(--text-on-muted);
  border: 1px solid transparent;
  letter-spacing: 0;
  line-height: 1;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger  { background: var(--danger-subtle); color: var(--danger); }
.badge-info    { background: var(--info-subtle); color: var(--info); }
.badge-outline { background: transparent; border-color: var(--border-strong); color: var(--text-muted); }
.badge-num { font-family: var(--font-mono); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 10px 0 12px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}
.chip .close {
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent;
  border: 0; color: var(--text-subtle);
  cursor: pointer;
}
.chip .close:hover { background: var(--bg-muted); color: var(--text); }

/* Delta indicator */
.delta {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--text-subtle); }

/* ---------- Tables ---------- */
.table-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.table-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.table-card-head h5 { margin: 0; font-size: 14px; }
.table-card-head .actions { display: flex; gap: 8px; align-items: center; }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.table th, .table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th .sort {
  display: inline-flex; vertical-align: middle; margin-left: 4px;
  color: var(--text-subtle); opacity: 0.6;
}
.table th.sorted .sort { color: var(--primary); opacity: 1; }
.table td { color: var(--text); }
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--bg-subtle); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.table-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 12.5px;
  color: var(--text-muted);
}

/* avatar */
.avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.avatar-lg { width: 32px; height: 32px; font-size: 12px; }
.avatar-row { display: inline-flex; }
.avatar-row .avatar:not(:first-child) { margin-left: -8px; }

/* ---------- KPI cards ---------- */
.kpi {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  transition: all var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.kpi:hover { border-color: var(--border-strong); }
.kpi-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between;
}
.kpi-label .ti { color: var(--text-subtle); }
.kpi-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 2px;
}
.kpi-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--text-subtle);
  margin-top: 2px;
}
.kpi-spark { margin-top: 8px; height: 36px; }

/* ---------- Progress ---------- */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-pill);
  transition: width var(--dur-slow) var(--ease);
}
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.progress-lg { height: 10px; }
.progress-stacked { display: flex; }
.progress-stacked > div { height: 100%; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
}
.tabs button {
  border: 0; background: transparent;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  font-family: var(--font-sans);
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: -1px;
  transition: color var(--dur) var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  color: var(--text);
  border-bottom: 2px solid var(--primary);
}
.tabs button .count {
  display: inline-block;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-muted);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  line-height: 1.4;
}
.tabs button.active .count { background: var(--primary-subtle); color: var(--primary); }

/* Pill tabs */
.tabs-pill { border: 0; gap: 4px; }
.tabs-pill button { border-radius: var(--r-md); padding: 6px 12px; }
.tabs-pill button.active { background: var(--primary-subtle); color: var(--primary); border-bottom: 0; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-subtle);
  font-family: var(--font-sans);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb .sep { color: var(--text-subtle); opacity: 0.6; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ---------- Pagination ---------- */
.pagination {
  display: inline-flex; gap: 2px; align-items: center;
}
.pagination button {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.pagination button:hover { background: var(--bg-muted); color: var(--text); }
.pagination button.active {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  font-weight: 500;
}
.pagination button:disabled { color: var(--text-subtle); opacity: 0.4; cursor: not-allowed; }
.pagination .ellipsis { color: var(--text-subtle); padding: 0 4px; font-family: var(--font-mono); }

/* ---------- Sidebar (product) ---------- */
.app-side {
  width: 240px;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 4px;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.app-side .brand {
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-size: 17px;
}
.app-side a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  transition: all var(--dur-fast) var(--ease);
}
.app-side a:hover { background: var(--bg-muted); color: var(--text); text-decoration: none; }
.app-side a.active { background: var(--primary); color: var(--on-primary); }
.app-side a.active .ti { color: var(--on-primary); }
.app-side a .ti { color: var(--text-subtle); width: 16px; height: 16px; }
.app-side .ns-section {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-subtle); padding: 12px 10px 4px;
}

/* ---------- Alerts / Banners ---------- */
.alert {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-start;
  font-size: 13.5px;
}
.alert .ti { flex-shrink: 0; margin-top: 2px; }
.alert-info { background: var(--info-subtle); border-color: transparent; color: var(--text); }
.alert-info .ti { color: var(--info); }
.alert-success { background: var(--success-subtle); border-color: transparent; }
.alert-success .ti { color: var(--success); }
.alert-warning { background: var(--warning-subtle); border-color: transparent; }
.alert-warning .ti { color: var(--warning); }
.alert-danger { background: var(--danger-subtle); border-color: transparent; }
.alert-danger .ti { color: var(--danger); }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-body { color: var(--text-on-muted); }
.alert-actions { margin-top: 8px; display: flex; gap: 8px; }
.alert .close-btn {
  margin-left: auto;
  background: transparent;
  border: 0; color: var(--text-subtle);
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: grid; place-items: center;
}
.alert .close-btn:hover { background: rgba(0,0,0,0.05); color: var(--text); }

/* Toast */
.toast {
  display: flex; gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 360px;
  font-size: 13.5px;
  align-items: flex-start;
}
.toast .ti { flex-shrink: 0; margin-top: 2px; }
.toast .toast-title { font-weight: 600; margin-bottom: 2px; }
.toast .toast-body { color: var(--text-muted); font-size: 13px; }
.toast-success .ti { color: var(--success); }
.toast-danger .ti { color: var(--danger); }
.toast-info .ti { color: var(--info); }
.toast-warning .ti { color: var(--warning); }

/* ---------- Modal ---------- */
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 480px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
}
.modal-head h4 { margin: 0; font-size: 16px; }
.modal-body { padding: 4px 18px 16px; color: var(--text-muted); font-size: 13.5px; }
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--bg-subtle);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.modal-stage {
  background: linear-gradient(180deg, var(--bg-inset), var(--bg-muted));
  border-radius: var(--r-lg);
  padding: 36px 20px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
}

/* Drawer */
.drawer {
  background: var(--surface);
  width: 380px;
  height: 360px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
}
.drawer-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-body { padding: 16px 18px; flex: 1; overflow-y: auto; font-size: 13.5px; color: var(--text-muted); }
.drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* Tooltip */
.tooltip {
  display: inline-block;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  position: relative;
  font-family: var(--font-sans);
  font-weight: 500;
}
.tooltip::after {
  content: ""; position: absolute;
  width: 8px; height: 8px;
  background: var(--text);
  bottom: -3px; left: 50%; transform: translateX(-50%) rotate(45deg);
}
.tooltip-up::after { top: -3px; bottom: auto; }

/* Popover */
.popover {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 280px;
  padding: 14px;
  font-size: 13px;
}
.popover h5 { font-size: 13px; margin-bottom: 4px; }

/* Dropdown menu */
.menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  min-width: 200px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-sans);
}
.menu-item:hover { background: var(--bg-muted); }
.menu-item.danger { color: var(--danger); }
.menu-item .ti { color: var(--text-subtle); width: 14px; height: 14px; }
.menu-item.danger .ti { color: var(--danger); }
.menu-item .kbd {
  margin-left: auto; font-size: 10.5px;
  color: var(--text-subtle); font-family: var(--font-mono);
}
.menu-item .check {
  margin-left: auto; color: var(--primary);
  width: 14px; height: 14px;
}
.menu-divider { height: 1px; background: var(--border); margin: 4px -4px; }
.menu-section {
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-subtle);
  padding: 8px 10px 4px;
  font-weight: 600;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 36px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-subtle);
}
.empty-icon {
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  margin: 0 auto 12px;
  color: var(--text-subtle);
  box-shadow: var(--shadow-xs);
}
.empty h4 { font-size: 15px; margin-bottom: 4px; }
.empty p { max-width: 36ch; margin: 0 auto 14px; font-size: 13px; }

/* Skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-muted) 0%, var(--bg-inset) 50%, var(--bg-muted) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Color swatches ---------- */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}
.swatch-chip { height: 64px; }
.swatch-meta {
  padding: 8px 10px;
  font-size: 11.5px;
  display: flex; flex-direction: column; gap: 1px;
}
.swatch-meta .name { font-weight: 500; color: var(--text); }
.swatch-meta .val { font-family: var(--font-mono); color: var(--text-subtle); font-size: 10.5px; }

.scale-row {
  display: grid; grid-template-columns: repeat(10, 1fr);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.scale-row > div {
  height: 56px;
  position: relative;
  font-size: 10px;
  font-family: var(--font-mono);
  color: rgba(255,255,255,0.85);
  padding: 8px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.scale-row > div.light { color: rgba(0,0,0,0.65); }

/* ---------- Typography specimen ---------- */
.type-row {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.type-row:last-child { border-bottom: 0; }
.type-meta { font-size: 11.5px; }
.type-meta .name { font-weight: 500; color: var(--text); display: block; margin-bottom: 2px; }
.type-meta .val { font-family: var(--font-mono); color: var(--text-subtle); font-size: 10.5px; }
.type-sample { color: var(--text); }
.type-info { font-size: 11.5px; font-family: var(--font-mono); color: var(--text-subtle); text-align: right; }

/* ---------- Spacing visual ---------- */
.space-row {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 0;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.space-row .bar {
  height: 12px;
  background: var(--primary);
  border-radius: 2px;
}
.space-row .label { width: 90px; }
.space-row .val { color: var(--text-subtle); }

/* Radii row */
.radii-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.radii-tile {
  height: 88px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; font-family: var(--font-mono); color: var(--text-muted);
  gap: 4px;
}

/* Elevation tiles */
.elev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.elev-tile {
  height: 100px;
  background: var(--surface);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; font-family: var(--font-mono); color: var(--text-muted);
  gap: 4px;
  border: 1px solid var(--border);
}

/* Data format table */
.format-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 13.5px;
}
.format-table th, .format-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.format-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  font-size: 12px;
}
.format-table td.example { font-family: var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.format-table td.spec { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.format-table tr:last-child td { border-bottom: 0; }

/* Sample dashboard */
.dash {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg);
  display: grid;
  grid-template-columns: 220px 1fr;
  box-shadow: var(--shadow-md);
  min-height: 720px;
}
.dash .app-side { border-radius: 0; width: 100%; }
.dash-main { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; background: var(--bg); }
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.dash-head h2 { font-size: 24px; margin: 0; }
.dash-head .meta { font-size: 12.5px; color: var(--text-subtle); margin-top: 2px; font-family: var(--font-mono); }
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.dash-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.dash-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dash-card-body { padding: 14px 16px; }
.dash-card-head h5 { margin: 0; font-size: 13.5px; }
.dash-card-head .meta { font-size: 11.5px; color: var(--text-subtle); font-family: var(--font-mono); }

/* Tiny icon */
.ti {
  width: 16px; height: 16px;
  stroke-width: 1.75;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Code block */
pre.code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--r-md);
  overflow-x: auto;
  color: var(--text);
  line-height: 1.55;
}

.hero {
  padding: var(--space-16) 0 var(--space-12);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-12);
}
.hero h1 { font-size: 56px; margin-bottom: 12px; }
.hero p.lead { font-size: 19px; }
.hero-meta {
  margin-top: 24px;
  display: flex; gap: 24px; align-items: center;
  font-size: 12.5px; color: var(--text-subtle);
  font-family: var(--font-mono);
}
.hero-meta strong { color: var(--text); font-weight: 500; }

/* Utility */
.row-gap-3 { row-gap: 12px; }
.row-gap-4 { row-gap: 16px; }
.flex-row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Chart container */
.chart-wrap { padding: 4px 4px 0; }

/* Print + small screen — keep horizontal scroll for the dashboard */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { display: none; }
  .content { padding: var(--space-8) var(--space-5); }
}
