/* ═══════════════════════════════════════════════════════════════════════════
   DFM Sales Tracker — design system

   One accent (indigo), semantic colour kept separate from it, and neutrals with
   a slight blue bias so greys read as chosen rather than inherited. Every colour
   is a token defined in :root; the dark theme only redefines tokens, so no
   component ever hard-codes a colour that works in one theme and not the other.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Surfaces */
  --ground: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --sunk: #eef1f7;
  --line: #e0e5ef;
  --line-strong: #cdd4e2;

  /* Text */
  --ink: #131824;
  --ink-2: #3a4459;
  --muted: #667085;
  --faint: #98a1b3;

  /* Accent */
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-hover: #4338ca;
  --accent-soft: #eceafe;
  --accent-line: #c9c2fb;

  /* Semantic — deliberately not the accent hue */
  --good: #0f7a4d;
  --good-soft: #e2f5ec;
  --warn: #a35a08;
  --warn-soft: #fdf0dd;
  --crit: #b42318;
  --crit-soft: #fde9e7;
  --info: #0b6bb5;
  --info-soft: #e3f0fb;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px -4px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .22);

  /* Shape + type */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --sidebar-w: 244px;
  --topbar-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0c0f16;
    --surface: #141924;
    --surface-2: #171d29;
    --sunk: #1b2230;
    --line: #262e3d;
    --line-strong: #36405280;

    --ink: #e7ebf3;
    --ink-2: #c2cadb;
    --muted: #8d97ab;
    --faint: #6b7488;

    --accent: #8b83f7;
    --accent-ink: #10121c;
    --accent-hover: #a49dfa;
    --accent-soft: #211f3d;
    --accent-line: #3b3568;

    --good: #4ec38a;
    --good-soft: #14291f;
    --warn: #e0a44a;
    --warn-soft: #2a2114;
    --crit: #f08279;
    --crit-soft: #2d1916;
    --info: #63b0ec;
    --info-soft: #12222f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px -4px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .7);
  }
}

:root[data-theme="dark"] {
  --ground: #0c0f16;
  --surface: #141924;
  --surface-2: #171d29;
  --sunk: #1b2230;
  --line: #262e3d;
  --line-strong: #364052;

  --ink: #e7ebf3;
  --ink-2: #c2cadb;
  --muted: #8d97ab;
  --faint: #6b7488;

  --accent: #8b83f7;
  --accent-ink: #10121c;
  --accent-hover: #a49dfa;
  --accent-soft: #211f3d;
  --accent-line: #3b3568;

  --good: #4ec38a;
  --good-soft: #14291f;
  --warn: #e0a44a;
  --warn-soft: #2a2114;
  --crit: #f08279;
  --crit-soft: #2d1916;
  --info: #63b0ec;
  --info-soft: #12222f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px -4px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .7);
}

/* ── Reset ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Typography ────────────────────────────────────────────────────────── */

.h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.h3 { font-size: 14.5px; font-weight: 600; margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Layout primitives ─────────────────────────────────────────────────── */

.stack-xs { display: flex; flex-direction: column; gap: 4px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack    { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ── App shell ─────────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 0; }
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--accent), var(--accent-hover));
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: -.03em;
}
.brand-name { font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--faint); font-family: var(--font-mono); letter-spacing: .06em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); padding: 14px 10px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--sunk); text-decoration: none; color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-count {
  margin-left: auto; font-size: 11.5px; font-family: var(--font-mono);
  background: var(--sunk); color: var(--muted);
  padding: 1px 6px; border-radius: 20px;
}
.nav-item[aria-current="page"] .nav-count { background: var(--surface); color: var(--accent); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

.who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); background: var(--sunk); }
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.who-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.who-role { font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .04em; }

/* ── Main column ───────────────────────────────────────────────────────── */

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

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .h1 { font-size: 18px; }

.content { padding: 26px; display: flex; flex-direction: column; gap: 24px; max-width: 1280px; width: 100%; }

.menu-toggle { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(8, 11, 18, .45); z-index: 50;
  }
  .menu-toggle { display: inline-flex; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-body { padding: 18px; }

/* KPI tiles — used only where the figures ARE the point of the section. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 17px; display: flex; flex-direction: column; gap: 5px;
}
.kpi-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi.is-primary { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); border-color: var(--accent-line); }
.kpi.is-primary .kpi-value { color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--sunk); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--sunk); color: var(--ink); }

.btn-danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 35%, var(--line)); }
.btn-danger:hover { background: var(--crit-soft); }

.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Chips / pills ─────────────────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.pill-sched  { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.pill-review { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.pill-live   { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 22%, transparent); }
.pill-ended  { background: var(--sunk); color: var(--muted); border-color: var(--line); }
.pill-paused { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 22%, transparent); }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ── Tables ────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--sunk); position: sticky; top: 0; z-index: 1;
  white-space: nowrap;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data a { color: var(--ink); font-weight: 600; }
table.data a:hover { color: var(--accent); }

.rank {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--sunk); color: var(--muted); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rank-1 { background: var(--accent); color: var(--accent-ink); }
.rank-2, .rank-3 { background: var(--accent-soft); color: var(--accent); }

/* ── Forms ─────────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: 14px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.input-money { position: relative; }
.input-money .input { padding-left: 26px; }
.input-money::before {
  content: "$"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none; z-index: 1;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check-text { font-size: 13.5px; }
.check-text small { display: block; color: var(--muted); font-size: 12px; }

fieldset { border: none; padding: 0; margin: 0; }
legend { padding: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 4px; }

/* ── Alerts + flash ────────────────────────────────────────────────────── */

.alert {
  padding: 11px 14px; border-radius: var(--r); font-size: 13.5px;
  border: 1px solid transparent; display: flex; gap: 9px; align-items: flex-start;
}
.alert-ok   { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-crit { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert strong { font-weight: 700; }

.flash-stack { position: fixed; top: 14px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.flash-stack .alert { box-shadow: var(--shadow-lg); background-color: var(--surface); }
.flash-stack .alert-ok   { border-color: var(--good); }
.flash-stack .alert-crit { border-color: var(--crit); }

/* ── Empty state ───────────────────────────────────────────────────────── */

.empty { text-align: center; padding: 46px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--sunk); display: grid; place-items: center; color: var(--faint); }
.empty h3 { margin: 0; font-size: 15px; font-weight: 600; }
.empty p { margin: 0; color: var(--muted); max-width: 44ch; font-size: 13.5px; }

/* ── Pipeline board ────────────────────────────────────────────────────── */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 140px; }
.col-head { padding: 11px 13px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--sunk); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 2; }
.col-title { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.col-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); background: var(--surface); padding: 1px 6px; border-radius: 20px; }
.col-total { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.col.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px; }

.deal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 7px;
  cursor: grab; box-shadow: var(--shadow-sm);
  transition: box-shadow .12s ease, border-color .12s ease;
}
.deal-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.deal-card.dragging { opacity: .45; cursor: grabbing; }
.deal-card .name { font-weight: 700; font-size: 13.5px; letter-spacing: -.01em; color: var(--ink); }
.deal-card .name:hover { color: var(--accent); text-decoration: none; }
.deal-card .meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.deal-card .value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.deal-card .bar { display: block; height: 3px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.deal-card .bar span { display: block; height: 100%; background: var(--accent); }
.due-flag { color: var(--crit); font-weight: 600; }

/* ── Timeline ──────────────────────────────────────────────────────────── */

.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 12.5px; top: 24px; bottom: 0; width: 1px; background: var(--line);
}
.tl-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sunk); color: var(--muted); font-size: 10px; font-weight: 700;
  border: 1px solid var(--line); z-index: 1;
}
.tl-dot.k-CALL { background: var(--info-soft); color: var(--info); }
.tl-dot.k-EMAIL { background: var(--accent-soft); color: var(--accent); }
.tl-dot.k-MEETING { background: var(--warn-soft); color: var(--warn); }
.tl-dot.k-STAGE { background: var(--good-soft); color: var(--good); }
.tl-body { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-kind { font-size: 12.5px; font-weight: 700; }
.tl-when { font-size: 11.5px; color: var(--faint); }
.tl-note { font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }

/* ── Breakdown list (commission maths) ─────────────────────────────────── */

.breakdown { display: flex; flex-direction: column; }
.bd-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.bd-row:last-child { border-bottom: none; }
.bd-label { font-size: 13px; color: var(--muted); }
.bd-label b { color: var(--ink-2); font-weight: 600; }
.bd-value { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.bd-row.total { border-top: 2px solid var(--line-strong); border-bottom: none; margin-top: 6px; padding-top: 12px; }
.bd-row.total .bd-label { color: var(--ink); font-weight: 700; font-size: 13.5px; }
.bd-row.total .bd-value { color: var(--accent); font-size: 19px; }

/* ── Stage funnel bars ─────────────────────────────────────────────────── */

.funnel { display: flex; flex-direction: column; gap: 9px; }
.fn-row { display: grid; grid-template-columns: 128px 1fr 74px; gap: 12px; align-items: center; font-size: 12.5px; }
.fn-track { display: block; height: 22px; background: var(--sunk); border-radius: var(--r-sm); overflow: hidden; }
.fn-fill { display: block; height: 100%; background: var(--accent); opacity: .82; border-radius: var(--r-sm); min-width: 2px; }
.fn-fill.tone-live { background: var(--good); }
.fn-fill.tone-ended { background: var(--faint); }
.fn-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }

/* ── Tabs / segmented control ──────────────────────────────────────────── */

.segment { display: inline-flex; background: var(--sunk); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.segment a {
  padding: 5px 12px; border-radius: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.segment a:hover { color: var(--ink); text-decoration: none; }
.segment a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ── Auth pages ────────────────────────────────────────────────────────── */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: linear-gradient(165deg, var(--accent) 0%, var(--accent-hover) 55%, #221d5e 100%);
  color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
}
.auth-side .brand-name, .auth-side .brand-sub { color: #fff; }
.auth-side .brand-mark { background: rgba(255, 255, 255, .16); color: #fff; }
.auth-quote { font-size: 21px; font-weight: 600; line-height: 1.42; letter-spacing: -.015em; max-width: 22ch; }
.auth-points { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; opacity: .92; }
.auth-points div { display: flex; gap: 9px; align-items: center; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* ── Misc ──────────────────────────────────────────────────────────────── */

.divider { height: 1px; background: var(--line); border: none; margin: 0; }

.preview-banner {
  background: var(--warn-soft); color: var(--warn);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  padding: 7px 26px; font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.preview-banner a { color: inherit; text-decoration: underline; }

.meter { display: block; height: 6px; background: var(--sunk); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; align-items: baseline; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

.tag-input { display: flex; flex-wrap: wrap; gap: 6px; }

@media print {
  .sidebar, .topbar, .btn, .flash-stack { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .card { break-inside: avoid; }
}
