/* ─────────────────────────────────────────────────────────────────────────
   INVENTORY MINDER — SHADCN SHELL  (v4 visual port · light theme)
   Companion to SHADCN_PORT.md. Token set + primitive definitions for the
   Shadcn-aesthetic repaint. Class names are inherited from the brutalist
   shell so template HTML doesn't restructure — only the visual definition
   changes. Light only for the first cut; the token system anticipates dark.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  /* ── Core palette (HSL triplets; consume as hsl(var(--x))) ───────────── */
  --background:            0 0% 100%;
  --foreground:            222 47% 11%;

  --canvas:                210 40% 97%;    /* page surface behind cards   */
  --card:                  0 0% 100%;
  --card-foreground:       222 47% 11%;

  --muted:                 210 40% 96.1%;
  --muted-foreground:      215 16% 47%;

  --border:                214 32% 91%;
  --input:                 214 32% 91%;

  --primary:               221 83% 53%;   /* Session Goods blue accent    */
  --primary-foreground:    0 0% 98%;

  --secondary:             210 40% 96.1%;
  --secondary-foreground:  222 47% 11%;

  --accent:                210 40% 96.1%;
  --accent-foreground:     222 47% 11%;

  /* ── Semantic tones ──────────────────────────────────────────────────── */
  --destructive:           0 72% 51%;
  --destructive-foreground:0 0% 98%;
  --success:               142 43% 36%;
  --success-foreground:    0 0% 98%;
  --warning:               33 90% 45%;
  --warning-foreground:    0 0% 100%;
  --info:                  214 72% 47%;
  --info-foreground:       0 0% 98%;

  --ring:                  221 83% 53%;

  /* ── Sidebar (kept dark per port brief) ──────────────────────────────── */
  --sidebar:               240 6% 10%;
  --sidebar-foreground:    240 5% 84%;
  --sidebar-muted:         240 5% 56%;
  --sidebar-border:        240 4% 18%;
  --sidebar-accent:        240 4% 16%;
  --sidebar-accent-fg:     0 0% 98%;
  --sidebar-ring:          240 5% 40%;

  /* ── Radius, shadows, type ───────────────────────────────────────────── */
  --radius: 0.5rem;
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 4px);

  --shadow-sm: 0 1px 2px 0 rgb(16 16 20 / 0.05);
  --shadow:    0 1px 3px 0 rgb(16 16 20 / 0.09), 0 1px 2px -1px rgb(16 16 20 / 0.09);
  --shadow-md: 0 4px 8px -2px rgb(16 16 20 / 0.10), 0 2px 4px -2px rgb(16 16 20 / 0.06);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;   /* swapped to Archivo via [data-display="archivo"] */
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ── Emphasis scale (the fidelity exploration) ───────────────────────── */
  --display-hero: 44px;
  --display-stat: 40px;
  --display-vital: 30px;
  --hero-weight: 700;
}

/* Emphasis = Quiet · Balanced · Expressive (driven by Tweaks) */
[data-emphasis="quiet"] {
  --display-hero: 34px; --display-stat: 30px; --display-vital: 26px; --hero-weight: 650;
}
[data-emphasis="expressive"] {
  --display-hero: 60px; --display-stat: 56px; --display-vital: 38px; --hero-weight: 760;
}

[data-display="archivo"] { --font-display: 'Archivo', 'Inter', sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: hsl(var(--canvas));
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
::selection { background: hsl(var(--primary) / 0.14); }

/* ─── Layout ────────────────────────────────────────────────────────── */
.complex {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
  align-items: start;
}

/* ─── SIDEBAR (.bunker) — Shadcn Sidebar, dark variant ──────────────── */
.bunker {
  position: sticky;
  top: 0;
  height: 100vh;
  background: hsl(var(--sidebar));
  color: hsl(var(--sidebar-foreground));
  display: flex;
  flex-direction: column;
  border-right: 1px solid hsl(var(--sidebar-border));
}
.bunker-cap {
  padding: 18px 18px 16px;
  border-bottom: 1px solid hsl(var(--sidebar-border));
}
.brand-stamp {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand-stamp::before {
  content: 'IM';
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: hsl(0 0% 100%);
  color: hsl(var(--sidebar));
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-stamp .bt {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: hsl(0 0% 100%);
}
.brand-stamp small {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: hsl(var(--sidebar-muted));
  margin-top: 3px;
  text-transform: none;
}
.bunker-nav {
  flex: 1;
  padding: 14px 12px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bunker-nav::-webkit-scrollbar { width: 8px; }
.bunker-nav::-webkit-scrollbar-thumb { background: hsl(var(--sidebar-border)); border-radius: 8px; }
.bunker-nav > div { padding: 10px 0; }
.bunker-nav > div + div { border-top: 1px solid hsl(var(--sidebar-border)); }
.bunker-nav > div:first-child { padding-top: 2px; }
.section-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--sidebar-muted) / 0.85);
  padding: 0 10px 8px;
}
.bunker-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 20px;
  margin-bottom: 1px;
  color: hsl(var(--sidebar-foreground));
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 450;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  text-transform: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.bunker-link:hover { background: hsl(var(--sidebar-accent)); color: #fff; }
.bunker-link .roman {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: hsl(var(--sidebar-muted));
  text-align: center;
}
.bunker-link .ct {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: hsl(var(--sidebar-muted));
  background: hsl(var(--sidebar-accent));
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0;
}
.bunker-link.active {
  background: hsl(var(--sidebar-accent));
  color: #fff;
  font-weight: 550;
}
.bunker-link.active .roman { color: hsl(var(--primary-foreground)); }
.bunker-link.active .ct { background: hsl(0 0% 100% / 0.12); color: #fff; }

.bunker-foot {
  padding: 12px;
  border-top: 1px solid hsl(var(--sidebar-border));
  display: flex;
  align-items: center;
  gap: 8px;
}
.bunker-signout {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  color: hsl(var(--sidebar-muted));
  border: 1px solid hsl(var(--sidebar-border));
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.bunker-signout:hover { background: hsl(var(--sidebar-accent)); color: #fff; }
.resident {
  flex: 1;
  min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  border-radius: var(--radius-md);
  transition: background 0.12s ease;
}
.resident:hover { background: hsl(var(--sidebar-accent)); }
.resident-mark {
  width: 32px; height: 32px;
  background: hsl(var(--sidebar-accent));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  border-radius: var(--radius-md);
}
.resident-name {
  font-family: var(--font-sans);
  text-transform: none;
  font-weight: 550;
  font-size: 13px;
  color: #fff;
}
.resident-role {
  font-family: var(--font-sans);
  font-size: 11px;
  color: hsl(var(--sidebar-muted));
  letter-spacing: 0;
}

/* ─── MAIN (.grounds) ──────────────────────────────────────────────── */
.grounds {
  padding: 22px 28px 72px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  background: hsl(var(--canvas));
}

/* ─── Breadcrumb strip / topbar ────────────────────────────────────── */
.strip {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.strip .sep { color: hsl(var(--border)); }
.strip strong { color: hsl(var(--foreground)); font-weight: 550; }
.strip-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  padding: 0 10px;
  height: 36px;
  width: 300px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  font-size: 13px;
}
.search input {
  border: none; outline: none; background: transparent;
  font: inherit; color: hsl(var(--foreground)); flex: 1; min-width: 0;
}
.search input::placeholder { color: hsl(var(--muted-foreground)); }
.search kbd {
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 1px 6px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
}

/* ─── CARD (.slab) ─────────────────────────────────────────────────── */
.slab {
  position: relative;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* ─── TITLE SLAB (Card · 2-col) ────────────────────────────────────── */
.title-slab {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  overflow: hidden;
  padding: 0;
}
.title-slab .title-body { padding: 28px 30px 26px; min-width: 0; }
.title-slab .marker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  margin-bottom: 16px;
}
.title-slab .marker .num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}
h1.tag.sku {
  font-family: var(--font-mono);
  font-size: var(--display-hero);
  line-height: 1.0;
  letter-spacing: -0.03em;
  text-transform: none;
  color: hsl(var(--foreground));
  margin: 0 0 14px;
  font-weight: 600;
  white-space: nowrap;
}
h1.tag.sku .pre { color: hsl(var(--muted-foreground)); font-weight: 500; }

.product-title-row {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  text-transform: none;
  margin-bottom: 16px;
}
.product-attrs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }

.blurb {
  font-family: var(--font-sans);
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  max-width: 540px;
  font-weight: 400;
  line-height: 1.55;
  text-wrap: pretty;
}
.meta-stamps {
  display: flex; gap: 28px; flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.stamp {
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  display: flex; flex-direction: column; gap: 3px;
}
.stamp b {
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-weight: 550;
  font-size: 13px;
  letter-spacing: 0;
}

/* Right-hand vitals window — a muted inset panel */
.title-window {
  background: hsl(var(--muted) / 0.55);
  color: hsl(var(--foreground));
  padding: 24px 26px 26px;
  border-left: 1px solid hsl(var(--border));
}
.title-window .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  margin-bottom: 14px;
}
.vitals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 0;
}
.vital-cell {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 13px 14px 12px;
}
.vital-cell .vital-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.vital-cell .vital-value {
  font-family: var(--font-display);
  font-weight: var(--hero-weight);
  font-size: var(--display-vital);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.vital-cell .vital-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}
.vital-cell.alert {
  border-color: hsl(var(--destructive) / 0.4);
  background: hsl(var(--destructive) / 0.06);
}
.vital-cell.alert .vital-value { color: hsl(var(--destructive)); }
.vital-cell.alert .vital-label,
.vital-cell.alert .vital-sub { color: hsl(var(--destructive) / 0.85); }

.threat-sub {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.5;
}
.threat-sub strong { color: hsl(var(--foreground)); font-weight: 600; }

/* Hero readout (a big single figure inside the title window) */
.threat-readout {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: var(--hero-weight);
  font-size: var(--display-hero);
  line-height: 1;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}
.threat-readout.crit { color: hsl(var(--destructive)); }
.threat-readout .label-inline {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: hsl(var(--muted-foreground));
}
.stamps-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* ─── STATS SLAB (grid of stat cards) ──────────────────────────────── */
.stats-slab {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}
/* Industry-KPI row: single GMROII tile centered against the 4-col grid. */
.kpi-slab { grid-template-columns: 1fr; }

/* Aging-buckets dashboard tile: 4 cohort cells with their own visual
   weight ramp so the operator's eye lands on the older buckets. */
.aging-slab { padding: 18px 20px 20px; }
.aging-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.aging-head h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em; color: hsl(var(--foreground)); margin: 0;
}
.aging-head .sub {
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground));
}
.aging-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.aging-cell {
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.aging-cell.tone-warning { background: hsl(var(--warning) / 0.08); border-color: hsl(var(--warning) / 0.3); }
.aging-cell.tone-rust { background: hsl(var(--destructive) / 0.08); border-color: hsl(var(--destructive) / 0.3); }
.aging-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: hsl(var(--muted-foreground)); letter-spacing: 0.04em;
  text-transform: uppercase;
}
.aging-value {
  font-family: var(--font-display); font-weight: 600; font-size: 22px;
  color: hsl(var(--foreground)); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.aging-sub {
  font-family: var(--font-mono); font-size: 10.5px;
  color: hsl(var(--muted-foreground));
}
.aging-bar {
  margin-top: 6px; height: 4px; background: hsl(var(--muted));
  border-radius: 2px; overflow: hidden;
}
.aging-bar i {
  display: block; height: 100%; background: hsl(var(--foreground) / 0.5);
  border-radius: 2px;
}
.aging-cell.tone-warning .aging-bar i { background: hsl(var(--warning)); }
.aging-cell.tone-rust .aging-bar i { background: hsl(var(--destructive)); }

/* Stock-Out Risk · revenue-at-risk strip — header banner above the
   data table summarising the per-day $-loss from current stockouts. */
.rar-strip {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 8px;
  padding: 12px 18px;
  background: hsl(var(--destructive) / 0.06);
  border: 1px solid hsl(var(--destructive) / 0.25);
  border-radius: var(--radius-md);
}
.rar-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground));
  white-space: nowrap;
}
.rar-readout {
  font-family: var(--font-sans); font-size: 14px;
  color: hsl(var(--foreground));
}
.rar-readout strong {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  color: hsl(var(--destructive));
}
.rar-readout .sep { color: hsl(var(--muted-foreground)); margin: 0 4px; }
.rar-readout .rar-meta { color: hsl(var(--muted-foreground)); margin-left: 4px; }
.stat-block {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
  position: relative;
  min-height: 0;
  display: flex; flex-direction: column; gap: 5px;
  overflow: hidden;
}
.stat-block::before { /* tone accent: left border */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: hsl(var(--primary));
}
.stat-block.tone-rust::before,
.stat-block.tone-critical::before { background: hsl(var(--destructive)); }
.stat-block.tone-warning::before  { background: hsl(var(--warning)); }
.stat-block.tone-ok::before       { background: hsl(var(--success)); }
.stat-block.tone-neutral::before  { background: hsl(var(--muted-foreground)); }
.stat-block.tone-info::before     { background: hsl(var(--info)); }

.stat-block .stat-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  display: flex; align-items: center; gap: 7px;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: var(--hero-weight);
  font-size: var(--display-stat);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: hsl(var(--foreground));
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.stat-block.tone-rust .stat-value,
.stat-block.tone-critical .stat-value { color: hsl(var(--destructive)); }
.stat-block.tone-warning .stat-value  { color: hsl(var(--warning)); }
.stat-block.tone-ok .stat-value       { color: hsl(var(--success)); }
.stat-block.tone-info .stat-value     { color: hsl(var(--info)); }

.stat-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  line-height: 1.4;
}
.stat-bar {
  height: 6px;
  background: hsl(var(--muted));
  border-radius: 999px;
  margin-top: 14px;
  overflow: hidden;
}
.stat-bar > i { display: block; height: 100%; background: hsl(var(--primary)); border-radius: 999px; }
.stat-block.tone-rust .stat-bar > i,
.stat-block.tone-critical .stat-bar > i { background: hsl(var(--destructive)); }
.stat-block.tone-warning .stat-bar > i  { background: hsl(var(--warning)); }
.stat-block.tone-ok .stat-bar > i       { background: hsl(var(--success)); }
.stat-block.tone-info .stat-bar > i     { background: hsl(var(--info)); }

/* ─── Section header (shared) ──────────────────────────────────────── */

/* ─── VELOCITY CHART ───────────────────────────────────────────────── */
.velocity-slab { overflow: hidden; padding: 0; }
.velocity-head {
  display: flex; align-items: baseline; gap: 12px;
  padding: 18px 22px 14px;
}
.velocity-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin: 0;
  color: hsl(var(--foreground));
}
.velocity-head .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.velocity-head .legend {
  margin-left: auto; display: flex; gap: 14px; align-items: center;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.velocity-head .legend > span { display: inline-flex; gap: 6px; align-items: center; }
.velocity-head .legend i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; }
.velocity-chart {
  position: relative;
  margin: 0 22px;
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  height: 320px;
  overflow: hidden;
}
.velocity-chart svg { display: block; width: 100%; height: 100%; }

/* SVG element classes — restyled to neutrals + accent, data unchanged */
.v-grid { stroke: hsl(var(--border)); stroke-width: 1; }
.v-axis { fill: hsl(var(--muted-foreground)); font-family: var(--font-mono); }
.v-bar-peak    { fill: hsl(var(--foreground) / 0.55); }
.v-bar-decline { fill: hsl(var(--muted-foreground) / 0.85); }
.v-bar-recent  { fill: hsl(var(--muted-foreground) / 0.55); }
.v-bar-forecast{ fill: hsl(var(--primary)); }
.v-ci-95 { fill: hsl(var(--primary) / 0.10); }
.v-ci-80 { fill: hsl(var(--primary) / 0.18); }
.v-forecast-line { stroke: hsl(var(--primary)); stroke-width: 2; fill: none; }
.v-today-line { stroke: hsl(var(--foreground)); stroke-width: 1.5; }
.v-today-chip { fill: hsl(var(--foreground)); }
.v-today-text { fill: hsl(var(--background)); font-family: var(--font-mono); font-weight: 600; }
.v-avg-line { stroke: hsl(var(--primary)); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: 0.6; }
.v-annot { fill: hsl(var(--muted-foreground)); font-family: var(--font-mono); font-weight: 500; }
.v-annot-accent { fill: hsl(var(--primary)); font-family: var(--font-mono); font-weight: 600; }

.velocity-axis-x {
  display: grid;
  grid-template-columns: 18% 18% 18% 32.5% 13.5%;
  padding: 8px 22px 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.velocity-axis-x > span:last-child { text-align: right; }

/* ─── PANEL PAIR (two cards in a grid) ─────────────────────────────── */
.panel-pair {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px 18px;
}
.panel h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  text-transform: none;
  margin: 0 0 12px;
  color: hsl(var(--foreground));
  padding-bottom: 10px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex; align-items: baseline; gap: 8px;
}
.panel h3 small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: hsl(var(--muted-foreground));
  text-transform: none;
}

/* Key-value description list */
.kv-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 13px;
}
.kv-table td { padding: 9px 0; border-bottom: 1px solid hsl(var(--border)); vertical-align: top; }
.kv-table td:first-child {
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  text-transform: none;
  font-size: 12.5px;
  width: 38%;
}
.kv-table td:last-child { color: hsl(var(--foreground)); font-weight: 450; text-align: right; }
.kv-table tr:last-child td { border-bottom: none; }
.kv-table .v-mono { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Forecast table — Shadcn Table */
.forecast-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.forecast-table thead th {
  text-align: left;
  padding: 8px 10px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  border-bottom: 1px solid hsl(var(--border));
}
.forecast-table thead th.num { text-align: right; }
.forecast-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}
.forecast-table tbody tr:last-child td { border-bottom: none; }
.forecast-table tbody td.num { text-align: right; }
.forecast-table tbody td .v { color: hsl(var(--foreground)); font-weight: 500; }
.forecast-table tbody tr:hover td { background: hsl(var(--muted) / 0.5); }
.forecast-table .ci-range { color: hsl(var(--muted-foreground)); }
.forecast-table .day-label {
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  margin-right: 4px;
}

/* ─── EDIT FORM (Form fields) ──────────────────────────────────────── */
.edit-slab { padding: 0; }
.edit-head {
  display: flex; align-items: baseline; gap: 12px;
  padding: 18px 22px 16px;
  border-bottom: 1px solid hsl(var(--border));
}
.edit-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin: 0;
  color: hsl(var(--foreground));
  white-space: nowrap;
}
.edit-head .sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.edit-head .actions { margin-left: auto; display: flex; gap: 8px; }
.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 22px;
  padding: 20px 22px 24px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--foreground));
  font-weight: 500;
}
.field label .req { color: hsl(var(--destructive)); margin-left: 1px; }
.field .control { display: flex; gap: 8px; }
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  padding: 0 11px;
  height: 36px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: hsl(var(--foreground));
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input.mono, .field .control.mono input { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32);
}
.field input::placeholder, .field textarea::placeholder { color: hsl(var(--muted-foreground)); }
.field textarea {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  min-height: 78px;
  height: auto;
  padding: 9px 11px;
  resize: vertical;
}
.field .help {
  font-family: var(--font-sans);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  line-height: 1.45;
}
.field .help b { color: hsl(var(--foreground)); font-weight: 550; }
.field .help a { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; }
.field-row { display: flex; gap: 8px; }
.field-row .control { flex: 1; }

/* ─── LINKED REPORTS (compact card grid) ───────────────────────────── */

/* ─── BUTTONS ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  height: 36px;
  padding: 0 14px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}
.btn:hover { background: hsl(var(--muted)); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }
.btn.dark, .btn.primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.btn.dark:hover, .btn.primary:hover { background: hsl(var(--primary) / 0.9); }
.btn.moss {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.btn.moss:hover { background: hsl(var(--primary) / 0.9); }
.btn.rust, .btn.destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}
.btn.rust:hover, .btn.destructive:hover { background: hsl(var(--destructive) / 0.9); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: hsl(var(--muted)); }
.btn.xs, .btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }

/* ─── BADGES (.tag family) ─────────────────────────────────────────── */
.tag, .tag-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.45;
}
.tag .pip, .tag-status .pip { width: 6px; height: 6px; flex-shrink: 0; border-radius: 999px; }
/* solid tone variants */
.tag-crit  { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.tag-crit  .pip { background: currentColor; }
.tag-warn { background: hsl(var(--warning)); color: hsl(var(--warning-foreground)); }
.tag-warn  .pip { background: currentColor; }
.tag-ok, .tag-bucket-a { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.tag-ok .pip, .tag-bucket-a .pip { background: currentColor; }
.tag-none, .tag-bucket-c {
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--border));
}
.tag-none .pip, .tag-bucket-c .pip { background: hsl(var(--muted-foreground)); }
.tag-dead { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }
.tag-dead .pip { background: currentColor; }
.tag-never { background: hsl(var(--secondary)); color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }
.tag-never .pip { background: currentColor; }
.tag-bucket-b { background: hsl(var(--warning)); color: hsl(var(--warning-foreground)); }
.tag-bucket-b .pip { background: currentColor; }

/* Status block (outline badge w/ dot, used in title) */
.status-block {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 999px;
  background: hsl(var(--success) / 0.12);
  color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.3);
}
.status-block .pip { width: 6px; height: 6px; background: currentColor; border-radius: 999px; }

/* Attribute pill — outline badge */
.attr-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 450;
  font-size: 12.5px;
  letter-spacing: 0;
  color: hsl(var(--muted-foreground));
  text-transform: none;
}
.attr-pill a { color: hsl(var(--primary)); text-decoration: none; font-weight: 500; }
.attr-pill a:hover { text-decoration: underline; text-underline-offset: 2px; }
.attr-pill b { font-family: var(--font-mono); font-size: 12px; color: hsl(var(--foreground)); font-weight: 500; letter-spacing: 0; }

/* ─── TABS (filter-bar remap; for system completeness) ─────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 2px;
  background: transparent;
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 8px;
}
.filt {
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  white-space: nowrap;
}
.filt:hover { color: hsl(var(--foreground)); }
.filt.active { color: hsl(var(--foreground)); border-bottom-color: hsl(var(--primary)); }
.filt .ct { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.filt .pip { width: 7px; height: 7px; display: inline-block; border-radius: 999px; }
.pip-crit, .pip-rust { background: hsl(var(--destructive)); }
.pip-warn, .pip-amber { background: hsl(var(--warning)); }
.pip-ok, .pip-moss { background: hsl(var(--success)); }
.pip-none { background: hsl(var(--muted-foreground)); }
.pip-info { background: hsl(var(--info)); }
.pip-ink { background: hsl(var(--foreground)); }

/* ─── Progress / gauge ─────────────────────────────────────────────── */
.gauge { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.gauge-track { flex: 1; height: 8px; background: hsl(var(--muted)); border-radius: 999px; position: relative; overflow: hidden; }
.gauge-fill { height: 100%; background: hsl(var(--primary)); border-radius: 999px; }
.gauge-fill.crit { background: hsl(var(--destructive)); }
.gauge-fill.warn { background: hsl(var(--warning)); }
.gauge-fill.ok   { background: hsl(var(--success)); }
.gauge-fill.info { background: hsl(var(--info)); }
.gauge-val { font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: hsl(var(--foreground)); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }
.gauge-val.dim { color: hsl(var(--muted-foreground)); }

/* ── Cycle Counts: cover-gauge severity, trigger, count-context, reconcile note ── */
.gauge-val .ud { font-size: 0.62em; color: hsl(var(--muted-foreground)); font-weight: 500; margin-left: 1px; }
.gauge-val.urgent { color: hsl(var(--destructive)); }
.gauge-val.near { color: hsl(var(--warning)); }
.cover-cell { display: flex; flex-direction: column; gap: 4px; }
.cover-cap { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0; color: hsl(var(--muted-foreground)); padding-left: 2px; }
.cover-cap b { color: hsl(var(--foreground)); font-weight: 600; }
.trig { font-family: var(--font-mono); font-size: 12.5px; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.trig small { color: hsl(var(--muted-foreground)); font-size: 10px; display: block; margin-top: 1px; font-weight: 400; }
.ctx { display: flex; flex-direction: column; gap: 3px; }
.ctx-flag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 11.5px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.ctx-flag .pip { width: 6px; height: 6px; border-radius: 999px; background: hsl(var(--muted-foreground)); flex: none; }
.ctx-flag.recount { color: hsl(var(--info)); }
.ctx-flag.recount .pip { background: hsl(var(--info)); }
.ctx-detail { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); }
.ctx-detail b { color: hsl(var(--foreground)); font-weight: 600; }
.ctx-detail.first { color: hsl(var(--muted-foreground) / 0.75); }
.ledger td.act { text-align: right; }
.reconcile-note {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px;
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--muted-foreground)); line-height: 1.45;
}
.reconcile-note svg { flex: none; color: hsl(var(--muted-foreground)); }
.reconcile-note b { color: hsl(var(--foreground)); font-weight: 600; }
.empty-state .es-mark {
  width: 46px; height: 46px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 999px;
  background: hsl(var(--success) / 0.12); color: hsl(var(--success));
}
.empty-state .es-title {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  color: hsl(var(--foreground)); margin-bottom: 6px; letter-spacing: -0.01em;
}
.empty-state .es-sub {
  max-width: 380px; margin: 0 auto; line-height: 1.5;
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--muted-foreground));
}

/* ─── Soft callout (replaces inline brutalist note boxes) ──────────── */
.callout {
  margin-top: 14px;
  padding: 10px 12px;
  background: hsl(var(--muted) / 0.6);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════
   REPORTS / LEDGER cluster — Card + CardHeader + Table + filter Tabs
   ════════════════════════════════════════════════════════════════════ */

/* Data slab = Card wrapping a table */
.data-slab { overflow: hidden; padding: 0; }

/* Data cap = Card header (light, not the brutalist dark strip) */
.data-cap {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}
.data-cap .data-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: hsl(var(--foreground));
}
.data-cap .data-sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}
.data-cap .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Ledger = Shadcn Table */
.ledger {
  width: 100%;
  border-collapse: collapse;
  background: hsl(var(--card));
  font-family: var(--font-sans);
  font-size: 13px;
}
.ledger thead th {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}
.ledger thead th.num { text-align: right; }
.ledger thead th.sortable { cursor: pointer; }
.ledger thead th.sortable::after {
  content: '↓';
  margin-left: 5px;
  color: hsl(var(--muted-foreground) / 0.6);
  font-weight: 400;
}
.ledger thead th.sortable.active::after { color: hsl(var(--primary)); }
.ledger tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid hsl(var(--border));
  background: transparent;
  vertical-align: middle;
  font-family: var(--font-sans);
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}
.ledger tbody tr:hover td { background: hsl(var(--muted) / 0.5); }
.ledger tbody tr:last-child td { border-bottom: none; }
.ledger td.num { text-align: right; }
.ledger td.mono, .ledger td .mono { font-family: var(--font-mono); }
.ledger td .v { color: hsl(var(--foreground)); font-weight: 500; }
.ledger td .dim { color: hsl(var(--muted-foreground) / 0.6); }

/* SKU identity cell — avatar square + title + code */
.sku-block {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 12px;
}
.sku-chip {
  width: 36px; height: 36px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
}
/* soft category tints (low-chroma, badge-style) */
.sku-chip-A { background: hsl(35 90% 92%);  color: hsl(28 75% 33%); }
.sku-chip-B { background: hsl(142 48% 91%); color: hsl(142 55% 26%); }
.sku-chip-C { background: hsl(214 90% 93%); color: hsl(214 70% 38%); }
.sku-chip-D { background: hsl(25 90% 92%);  color: hsl(25 75% 36%); }
.sku-chip-E { background: hsl(262 78% 94%); color: hsl(262 52% 48%); }
.sku-chip-F { background: hsl(350 88% 94%); color: hsl(350 62% 44%); }
.sku-chip-G { background: hsl(176 52% 90%); color: hsl(178 62% 26%); }
.sku-chip-H { background: hsl(215 25% 92%); color: hsl(215 22% 38%); }
.sku-title {
  font-family: var(--font-sans);
  font-weight: 550;
  font-size: 13.5px;
  color: hsl(var(--foreground));
  text-transform: none;
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.sku-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  margin-top: 1px;
}

/* Gauge threshold marker (LEAD tick) */
.gauge-marker {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: hsl(var(--foreground));
  border-radius: 999px;
}
.gauge-marker[data-label]::after {
  content: attr(data-label);
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* Card footer (pagination strip) */
.data-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: hsl(var(--card));
  border-top: 1px solid hsl(var(--border));
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.data-foot strong { color: hsl(var(--foreground)); font-weight: 550; }
.filter-bar-right { margin-left: auto; display: flex; gap: 8px; }

/* ── Suggested Reorder: inventory ramp, vendor PO cards, qty/model chips ── */
.ramp { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.ramp-track {
  flex: 1;
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 999px;
  position: relative;
  display: flex;
  overflow: hidden;
}
.ramp-have { background: hsl(var(--success)); height: 100%; }
.ramp-have.lean { background: hsl(var(--destructive)); }
.ramp-need {
  height: 100%;
  background: repeating-linear-gradient(135deg,
    hsl(var(--warning)) 0 5px,
    hsl(var(--warning) / 0.55) 5px 10px);
}
.ramp-target { position: absolute; top: 0; bottom: 0; width: 2px; background: hsl(var(--foreground)); }
.ramp-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: hsl(var(--destructive));
  min-width: 54px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.ramp-val.zero { color: hsl(var(--muted-foreground)); }

.po-slab { padding: 18px 20px 20px; }
.po-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.po-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin: 0;
  color: hsl(var(--foreground));
}
.po-head .po-sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.po-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.po-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 12px 13px 13px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.po-card:hover { background: hsl(var(--muted) / 0.5); border-color: hsl(var(--ring) / 0.5); box-shadow: var(--shadow-sm); }
.po-card.featured { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.po-card.featured:hover { background: hsl(var(--primary) / 0.92); }
.po-card .vendor {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  text-transform: none;
  letter-spacing: -0.005em;
  line-height: 1.2;
  color: hsl(var(--foreground));
  min-height: 32px;
  padding-right: 42px;
}
.po-card.featured .vendor { color: hsl(var(--primary-foreground)); }
.po-card .amount {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
}
.po-card.featured .amount { color: hsl(var(--primary-foreground)); }
.po-card .meta {
  display: flex; gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border));
  padding-top: 8px;
  margin-top: auto;
}
.po-card.featured .meta { color: hsl(0 0% 100% / 0.65); border-top-color: hsl(0 0% 100% / 0.18); }
.po-card .meta b { color: hsl(var(--foreground)); font-weight: 600; }
.po-card.featured .meta b { color: #fff; }
.po-card .lead-tag {
  position: absolute;
  top: 10px; right: 10px;
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0;
  padding: 1px 7px;
}
.po-card .lead-tag.amber { background: hsl(var(--warning) / 0.14); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.3); }
.po-card.featured .lead-tag { background: hsl(0 0% 100% / 0.14); color: #fff; border-color: transparent; }

.sug-qty {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sug-qty.zero { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 15px; }
.model-chip {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 2px 8px;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
}
.model-chip.cold { background: hsl(var(--info) / 0.12); color: hsl(var(--info)); border-color: hsl(var(--info) / 0.3); }
.row-skipped td { opacity: 0.55; }
.row-skipped td .sku-title { color: hsl(var(--muted-foreground)); }

/* ── OTB enforcement: header strip + over-budget row tint ── */
.row-over-budget td {
  background: hsl(var(--destructive) / 0.06);
  box-shadow: inset 3px 0 0 0 hsl(var(--destructive) / 0.4);
}
.otb-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  margin: 0 0 8px;
  background: hsl(var(--primary) / 0.05);
  border: 1px solid hsl(var(--primary) / 0.18);
  border-radius: var(--radius-md);
}
/* "Ordered by margin" note under the OTB strip when a budget is
   enforced — explains why the list isn't in pure urgency order. */
.otb-priority-note {
  margin: -2px 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: hsl(var(--primary));
}
.otb-strip .otb-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: hsl(var(--foreground));
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.otb-strip .otb-mode {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border-radius: 3px;
}
.otb-strip .otb-meter { flex: 1; min-width: 120px; }
.otb-strip .otb-meter-track {
  height: 8px;
  background: hsl(var(--muted));
  border-radius: 4px;
  overflow: hidden;
}
.otb-strip .otb-meter-fill {
  height: 100%;
  background: hsl(var(--primary));
  border-radius: 4px;
  transition: width 0.2s ease;
}
.otb-strip .otb-readout {
  font-family: var(--font-mono);
  font-size: 12px;
  color: hsl(var(--foreground));
  white-space: nowrap;
}
.otb-strip .otb-readout .sep { color: hsl(var(--muted-foreground)); margin: 0 4px; }
.otb-strip .otb-readout .committed,
.otb-strip .otb-readout .budget,
.otb-strip .otb-readout .available { font-weight: 600; }
.otb-strip .otb-readout .available.exhausted { color: hsl(var(--destructive)); }

/* ── ABC Analysis: Pareto chart + cumulative bars ── */
.pareto-slab { padding: 18px 20px 20px; }
.pareto-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.pareto-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin: 0;
  color: hsl(var(--foreground));
}
.pareto-head .sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.pareto-head .legend {
  margin-left: auto; display: flex; gap: 14px; align-items: center;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.pareto-head .legend > span { display: inline-flex; gap: 6px; align-items: center; }
.pareto-head .legend i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; }
.pareto-chart {
  position: relative;
  height: 280px;
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  /* overflow visible so hover tooltips (`.p-bar .blabel`) on the
     tallest bucket-A bars aren't clipped at the chart's top edge. */
}
.pareto-chart .zone-a, .pareto-chart .zone-b, .pareto-chart .zone-c {
  position: absolute; top: 0; bottom: 0;
  box-shadow: inset -1px 0 0 hsl(var(--border));
  pointer-events: none;
}
.pareto-chart .zone-a { left: 0%;    width: 42.1%; background: hsl(var(--success) / 0.08); }
.pareto-chart .zone-b { left: 42.1%; width: 31.6%; background: hsl(var(--warning) / 0.08); }
.pareto-chart .zone-c { left: 73.7%; width: 26.3%; background: hsl(var(--muted-foreground) / 0.06); }
.pareto-chart .zone-label {
  position: absolute; top: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
  text-transform: none;
}
.pareto-chart .zone-label small {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 2px;
  color: hsl(var(--muted-foreground) / 0.8);
}
.pareto-bars {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 240px;
  display: grid;
  grid-template-columns: repeat(19, 1fr);
  align-items: end;
  padding: 0 4px;
  gap: 3px;
}
.p-bar { background: hsl(var(--muted-foreground)); border-radius: 3px 3px 0 0; position: relative; }
.p-bar.bucket-a { background: hsl(var(--success)); }
.p-bar.bucket-b { background: hsl(var(--warning)); }
.p-bar.bucket-c { background: hsl(var(--muted-foreground) / 0.7); }
.p-bar:hover { filter: brightness(1.1); }
.p-bar .blabel {
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.p-bar:hover .blabel { opacity: 1; }
.p-bar .blabel b { color: hsl(var(--background)); font-weight: 600; }
.cumbar { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.cumbar-track { flex: 1; height: 8px; background: hsl(var(--muted)); border-radius: 999px; position: relative; overflow: hidden; }
.cumbar-fill { height: 100%; background: hsl(var(--success)); border-radius: 999px; }
.cumbar-fill.b { background: hsl(var(--warning)); }
.cumbar-fill.c { background: hsl(var(--muted-foreground) / 0.7); }
.cumbar-80 { position: absolute; top: 0; bottom: 0; left: 80%; width: 2px; background: hsl(var(--foreground)); }
.cumbar-val { font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: hsl(var(--foreground)); min-width: 50px; text-align: right; font-variant-numeric: tabular-nums; }
.pct-share { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.pct-share.dim { color: hsl(var(--muted-foreground)); font-weight: 500; }

/* ── DSI: depth-sounding chart + banded position bar ── */
.depth-slab { padding: 18px 20px 28px; }
.depth-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.depth-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
  margin: 0;
  color: hsl(var(--foreground));
}
.depth-head .sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.depth-head .legend {
  margin-left: auto; display: flex; gap: 14px; align-items: center;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  color: hsl(var(--muted-foreground));
}
.depth-head .legend > span { display: inline-flex; gap: 6px; align-items: center; }
.depth-head .legend i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; }

/* ── Depth-sounding accordion ──────────────────────────────────────────
   Collapsed by default: only lean SKUs (rows above the lean cutoff)
   show, so the chart stops burying the ledger. Toggle reveals all. */
.depth-head { align-items: center; }
.depth-head-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.depth-toggle {
  margin-left: auto; align-self: center; flex: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 5px 10px; cursor: pointer;
}
.depth-toggle:hover { background: hsl(var(--muted)); }
.depth-toggle .chev { transition: transform 0.18s ease; }
.depth-slab:not(.collapsed) .depth-toggle .chev { transform: rotate(180deg); }
/* collapsed ⇒ lean rows only; expanded ⇒ every active SKU */
.depth-slab.collapsed .depth-row--extra { display: none; }
/* state-swapped labels + subline */
.depth-slab.collapsed .depth-toggle-close,
.depth-slab:not(.collapsed) .depth-toggle-open,
.depth-slab.collapsed .depth-sub-expanded,
.depth-slab:not(.collapsed) .depth-sub-collapsed { display: none; }
.depth-empty-lean {
  padding: 12px 4px; font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--muted-foreground));
}
.depth-slab:not(.collapsed) .depth-empty-lean { display: none; }
/* Horizontal log-scale depth chart: one .depth-row per SKU
   (grid = label | 1fr track | value). Guides + axis ticks mirror the
   track column bounds so a given days-value lands at the same x in every row. */
.depth-frame { position: relative; --depth-label-w: 220px; --depth-val-w: 90px; --depth-gap: 14px; }
.depth-axis-x { position: relative; height: 22px; margin-bottom: 6px; }
.depth-axis-x-inner,
.depth-guides {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--depth-label-w) + var(--depth-gap));
  right: calc(var(--depth-val-w) + var(--depth-gap));
}
.depth-axis-x .x-tick,
.depth-axis-x .x-threshold {
  position: absolute; top: 0; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0;
  color: hsl(var(--muted-foreground)); white-space: nowrap; text-transform: none;
}
.depth-axis-x .x-threshold {
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 2px 7px; border-radius: 999px; font-weight: 500; letter-spacing: 0;
  display: inline-flex; gap: 5px; align-items: baseline; z-index: 2;
}
.depth-axis-x .x-threshold.lean { background: hsl(var(--destructive)); color: #fff; }
.depth-axis-x .x-threshold.over { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.depth-axis-x .x-threshold.median { background: hsl(var(--muted-foreground)); color: hsl(var(--background)); }
.depth-axis-x .x-threshold .d { opacity: 0.7; font-size: 9px; }
.depth-rows {
  position: relative;
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 4px 0;
}
.depth-guides { pointer-events: none; }
.depth-guide { position: absolute; top: 0; bottom: 0; width: 0; }
.depth-guide.decade { border-left: 1px dashed hsl(var(--border)); }
.depth-guide.threshold.lean { border-left: 2px solid hsl(var(--destructive) / 0.6); z-index: 2; }
.depth-guide.threshold.over { border-left: 2px solid hsl(var(--foreground) / 0.5); z-index: 2; }
.depth-guide.median { border-left: 1px dotted hsl(var(--muted-foreground)); z-index: 1; }
.depth-row {
  display: grid;
  grid-template-columns: var(--depth-label-w) 1fr var(--depth-val-w);
  gap: var(--depth-gap);
  align-items: center;
  padding: 4px 0;
  text-decoration: none;
  position: relative;
}
.depth-row:hover { background: hsl(var(--muted) / 0.6); }
.depth-row + .depth-row { border-top: 1px solid hsl(var(--border)); }
.depth-label {
  font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground));
  line-height: 1.2; padding-left: 14px; display: flex; flex-direction: column; gap: 1px; overflow: hidden;
}
.depth-label .title {
  font-family: var(--font-sans); font-weight: 550; font-size: 12.5px; color: hsl(var(--foreground));
  text-transform: none; letter-spacing: -0.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.depth-label .code { font-size: 10px; color: hsl(var(--muted-foreground)); letter-spacing: 0; }
.depth-track { height: 10px; background: hsl(var(--muted)); border-radius: 999px; position: relative; overflow: hidden; }
.depth-seg { height: 100%; background: hsl(var(--success)); border-radius: 999px; transition: filter 0.12s ease; }
.depth-seg.band-lean { background: hsl(var(--destructive)); }
.depth-seg.band-ok   { background: hsl(var(--success)); }
.depth-seg.band-over { background: hsl(var(--muted-foreground) / 0.75); }
.depth-row:hover .depth-seg { filter: brightness(1.08); }
.depth-val {
  font-family: var(--font-display); font-weight: 600; font-size: 15px; color: hsl(var(--foreground));
  text-align: right; padding-right: 14px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.depth-val.band-lean { color: hsl(var(--destructive)); }
.depth-val.band-ok   { color: hsl(var(--success)); }
.depth-val.band-over { color: hsl(var(--muted-foreground)); }
.depth-val .unit { font-family: var(--font-mono); font-size: 10px; color: hsl(var(--muted-foreground)); font-weight: 500; margin-left: 2px; }

.dsi-bar { display: flex; align-items: center; gap: 10px; min-width: 280px; }
.dsi-bar-track {
  flex: 1; height: 8px; border-radius: 999px; position: relative;
  background: linear-gradient(to right,
    hsl(var(--destructive)) 0 12%,
    hsl(var(--success)) 12% 48%,
    hsl(var(--muted-foreground) / 0.6) 48% 100%);
}
.dsi-bar-marker { position: absolute; top: -3px; bottom: -3px; width: 3px; background: hsl(var(--foreground)); box-shadow: 0 0 0 2px hsl(var(--card)); transform: translateX(-50%); border-radius: 999px; }
.dsi-bar-val { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.dsi-bar-val.lean { color: hsl(var(--destructive)); }
.dsi-bar-val.ok { color: hsl(var(--success)); }
.dsi-bar-val.over { color: hsl(var(--muted-foreground)); }
.vel { font-family: var(--font-sans); font-weight: 500; font-size: 13px; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.vel small { font-family: var(--font-mono); font-size: 9px; color: hsl(var(--muted-foreground)); letter-spacing: 0; font-weight: 400; margin-left: 2px; }

/* ── Outperformers: beat bar, beat headline, % chip, empty state ── */
.beat-bar { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.beat-track {
  flex: 1; height: 10px; background: hsl(var(--muted));
  border-radius: 999px; position: relative; overflow: hidden; display: flex;
}
.beat-fc {
  height: 100%; background: hsl(var(--muted-foreground) / 0.45);
  border-radius: 999px 0 0 999px;
}
.beat-over {
  height: 100%; background: hsl(var(--success));
  border-radius: 0 999px 999px 0;
  box-shadow: -1px 0 0 hsl(var(--card));
}
.beat-mult {
  font-family: var(--font-display); font-weight: 650; font-size: 13.5px;
  color: hsl(var(--success)); min-width: 46px; text-align: right;
  letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.beat-head {
  font-family: var(--font-display); font-weight: 650; font-size: 17px;
  color: hsl(var(--success)); letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.beat-head small {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: hsl(var(--muted-foreground)); margin-left: 2px; letter-spacing: 0;
}
.beat-units {
  font-family: var(--font-sans); font-weight: 550; font-size: 13px;
  color: hsl(var(--success)); font-variant-numeric: tabular-nums;
}
.pct-up {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-sans); font-weight: 550; font-size: 12.5px;
  color: hsl(var(--success)); font-variant-numeric: tabular-nums;
}
.pct-up svg { width: 11px; height: 11px; }
.eval-soft { font-family: var(--font-mono); font-size: 12px; color: hsl(var(--muted-foreground)); }
.eval-soft .early {
  display: inline-block; margin-left: 5px; font-size: 9px; font-weight: 500;
  color: hsl(var(--info)); background: hsl(var(--info) / 0.12);
  border: 1px solid hsl(var(--info) / 0.28); border-radius: 999px;
  padding: 0 6px; letter-spacing: 0.01em; vertical-align: 1px;
}
/* Title-window green readout (the count of SKUs beating forecast). */
.beat-readout span:first-child { color: hsl(var(--success)); }
/* Friendly empty state — rendered server-side when nothing clears the cutoff. */
.empty-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 24px 72px; gap: 8px;
}
.empty-state .em-mark {
  width: 56px; height: 56px; border-radius: 999px;
  display: grid; place-items: center; margin-bottom: 8px;
  background: hsl(var(--success) / 0.12); color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.28);
}
.empty-state h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  letter-spacing: -0.01em; color: hsl(var(--foreground)); margin: 0;
}
.empty-state p {
  font-family: var(--font-sans); font-size: 13.5px; color: hsl(var(--muted-foreground));
  max-width: 420px; line-height: 1.55; margin: 0; text-wrap: pretty;
}
.empty-state .em-foot {
  margin-top: 8px; font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground));
}

/* ── Slow-Moving: brick histogram, offender cards, age pills, actions ── */
.histo-slab { padding: 18px 20px 22px; }
.histo-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.histo-head h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.01em; text-transform: none; margin: 0; color: hsl(var(--foreground));
}
.histo-head .sub { font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: hsl(var(--muted-foreground)); }
.histo-head .legend {
  margin-left: auto; display: flex; gap: 14px; align-items: center;
  font-family: var(--font-sans); font-size: 11.5px; letter-spacing: 0; text-transform: none; color: hsl(var(--muted-foreground));
}
.histo-head .legend > span { display: inline-flex; gap: 6px; align-items: center; }
.histo-head .legend i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; }
.histo { position: relative; padding-left: 56px; }
.histo-y-axis { position: absolute; left: 0; top: 0; width: 50px; height: 340px; border-right: 1px solid hsl(var(--border)); }
.histo-y-axis span { position: absolute; right: 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0; color: hsl(var(--muted-foreground)); transform: translateY(-50%); white-space: nowrap; }
.histo-y-axis .tick { position: absolute; right: 0; width: 6px; height: 1px; background: hsl(var(--border)); }
.histo-cols {
  display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: 1fr; gap: 6px; height: 340px; position: relative;
  background: hsl(var(--muted) / 0.4); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  /* `grid-template-rows: 1fr` pins every column to the row's actual
     height (the 340px container) instead of growing to fit content.
     Combined with the column-reverse stacking, bricks land at the
     chart's $0 line and grow upward toward $axis_max without
     escaping the frame. */
}
.histo-zone {
  position: absolute; top: 0; bottom: 0;
  pointer-events: none; z-index: 0;
}
.histo-zone-ok      { left: 0%;     width: 16.67%; background: hsl(var(--success) / 0.06); }
.histo-zone-stale   { left: 16.67%; width: 8.33%;  background: hsl(var(--warning) / 0.07); }
.histo-zone-dead    { left: 25%;    width: 25%;    background: hsl(var(--destructive) / 0.08); }
.histo-zone-salvage { left: 50%;    width: 50%;    background: hsl(0 45% 35% / 0.10); box-shadow: inset 2px 0 0 hsl(0 45% 35% / 0.3); }

/* Vertical threshold overlays (e.g. "30D STALE", "60D DEAD") drawn across
   the chart with a pill label at the top. */
.histo-cols .threshold {
  position: absolute; top: 0; bottom: 0;
  width: 0; border-left: 1.5px dashed hsl(var(--foreground) / 0.3);
  pointer-events: none; z-index: 2;
}
.histo-cols .threshold .lbl {
  position: absolute; top: -8px; left: 0;
  transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.06em; color: hsl(var(--background));
  background: hsl(var(--foreground)); padding: 2px 8px;
  border-radius: var(--radius-sm); white-space: nowrap;
}
.histo-col { position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-start; align-items: stretch; z-index: 1; padding: 0 1px; }
/* Raise the column above zone tints + threshold dashes when any brick
   inside is hovered, so the tooltip (extending left/right past the
   column's own width) doesn't get clipped by the threshold line
   sitting at a higher z-index. */
.histo-col:has(.brick:hover) { z-index: 10; }
.histo-col .col-total {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-4px);
  font-family: var(--font-display); font-weight: 600; font-size: 10.5px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; white-space: nowrap;
  background: hsl(var(--card)); padding: 0 2px; font-variant-numeric: tabular-nums;
}
.histo-col .col-total.featured { color: hsl(var(--background)); background: hsl(var(--foreground)); padding: 2px 6px; border-radius: var(--radius-sm); font-weight: 600; }
.histo-col .col-foot { position: absolute; top: 100%; left: 0; right: 0; padding-top: 6px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0; text-align: center; color: hsl(var(--muted-foreground)); line-height: 1.4; }
.histo-col .col-foot b { color: hsl(var(--foreground)); font-family: var(--font-display); font-weight: 600; font-size: 10px; letter-spacing: 0; display: block; }
.brick { flex-shrink: 0; margin-top: 1px; border-radius: 2px; position: relative; cursor: pointer; transition: filter 0.08s ease; }
.brick:first-child { margin-top: 0; }
.brick.tone-ok      { background: hsl(var(--success)); }
.brick.tone-stale   { background: hsl(var(--warning)); }
.brick.tone-dead    { background: hsl(var(--destructive)); }
.brick.tone-salvage { background: hsl(0 48% 36%); }
.brick:hover { filter: brightness(1.12); z-index: 5; }
.brick.big { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 600; font-size: 9.5px; letter-spacing: 0; color: hsl(0 0% 100% / 0.92); }
.brick.big.tone-stale { color: hsl(var(--warning-foreground) / 0.85); }
.brick .tip {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: hsl(var(--foreground)); color: hsl(var(--background));
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0;
  padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap; pointer-events: none; opacity: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}
.brick .tip b { color: hsl(var(--background)); font-family: var(--font-display); font-weight: 600; }
.brick:hover .tip { opacity: 1; }
.histo-cols .threshold { position: absolute; top: 0; bottom: 28px; width: 0; border-left: 1.5px dashed hsl(var(--foreground) / 0.5); pointer-events: none; z-index: 3; }
.histo-cols .threshold .lbl {
  position: absolute; top: 6px; left: 4px;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: 0;
  padding: 1px 6px; border-radius: 999px; white-space: nowrap;
}
.histo-foot-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: 24px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }

.offenders-slab { padding: 18px 20px 18px; }
.offenders-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.offenders-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-transform: none; margin: 0; color: hsl(var(--foreground)); }
.offenders-head .sub { font-family: var(--font-sans); font-size: 12.5px; letter-spacing: 0; text-transform: none; color: hsl(var(--muted-foreground)); }
.offenders-head .actions { margin-left: auto; display: flex; gap: 8px; }
.offenders-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.offender {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; position: relative;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.offender:hover { background: hsl(var(--muted) / 0.5); border-color: hsl(var(--ring) / 0.5); box-shadow: var(--shadow-sm); }
.offender .rk { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0; color: hsl(var(--muted-foreground)); }
.offender .nm { font-family: var(--font-sans); font-weight: 550; font-size: 12.5px; letter-spacing: -0.005em; text-transform: none; color: hsl(var(--foreground)); line-height: 1.2; min-height: 30px; padding-right: 40px; }
.offender .sku-code { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0; color: hsl(var(--muted-foreground)); }
.offender .v { font-family: var(--font-display); font-weight: 650; font-size: 20px; line-height: 1; letter-spacing: -0.02em; color: hsl(var(--destructive)); margin-top: auto; font-variant-numeric: tabular-nums; }
.offender .meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0; color: hsl(var(--muted-foreground)); padding-top: 6px; border-top: 1px solid hsl(var(--border)); }
.offender .meta b { color: hsl(var(--foreground)); font-weight: 600; }
.offender .age-tag {
  position: absolute; top: 10px; right: 10px;
  background: hsl(0 48% 36%); color: #fff;
  font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: 0;
  padding: 1px 7px; border-radius: 999px;
}
.offender .age-tag.dead { background: hsl(var(--destructive)); }
.offender .age-tag.stale { background: hsl(var(--warning)); }
.age-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.age-pill::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 999px; }
.age-pill.dead::before { background: hsl(var(--destructive)); }
.age-pill.salvage::before { background: hsl(0 48% 36%); }
.age-pill.stale::before { background: hsl(var(--warning)); }
.age-pill.ok::before { background: hsl(var(--success)); }
.money { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--destructive)); font-variant-numeric: tabular-nums; }
.money.tight { font-size: 13px; }
.money.stale { color: hsl(var(--warning)); }
.money.dim { color: hsl(var(--muted-foreground)); font-weight: 500; }
.action-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none;
  padding: 3px 9px; background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border)); border-radius: 999px; cursor: pointer;
}
.action-chip:hover { background: hsl(var(--muted)); }
.action-chip.bundle { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.action-chip.markdown { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }
.action-chip.donate { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: hsl(var(--foreground)); }

/* ── Shared page helpers (so individual pages need no inline <style>) ── */
.report-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--display-stat);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
  margin: 0 0 16px;
}
.stat-value .unit { font-size: 0.5em; letter-spacing: 0; font-weight: 600; color: hsl(var(--muted-foreground)); }
.vital-value .unit { font-size: 0.62em; opacity: 0.7; }

/* Catalog sub-nav (quick-section-bar) */
.quick-section-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quick-section {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.quick-section:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.quick-section.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.quick-section .ct { font-family: var(--font-mono); font-size: 11px; opacity: 0.85; }

/* SKU thumbnail (image with chip fallback, same footprint as .sku-chip) */
.sku-thumb {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}
.sku-inline {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: hsl(var(--muted));
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  color: hsl(var(--foreground));
}

/* Status badge family used on catalog pages (.tag-bundle) */
.tag-bundle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid transparent;
}
.tag-bundle .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.tag-bundle.active { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.tag-bundle.draft { background: hsl(var(--secondary)); color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }
.tag-bundle.archived { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }
.tag-bundle.bundle { background: hsl(var(--info) / 0.12); color: hsl(var(--info)); border-color: hsl(var(--info) / 0.3); }

/* disabled button (e.g. SKU detail prev/next at list ends) */
.btn.disabled, .btn:disabled { opacity: 0.5; pointer-events: none; }

/* Empty-state panel */

/* ── Dashboard: tactical tiles, action foot, health strip ── */
.tactical-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tactical-tile {
  position: relative;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: inherit;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.tactical-tile:hover { border-color: hsl(var(--ring) / 0.5); box-shadow: var(--shadow-md); }
.tactical-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: hsl(var(--primary)); }
.tactical-tile.tone-critical::before { background: hsl(var(--destructive)); }
.tactical-tile.tone-warning::before  { background: hsl(var(--warning)); }
.tactical-tile.tone-ok::before        { background: hsl(var(--success)); }
.tactical-tile.tone-info::before      { background: hsl(var(--info)); }
.tactical-tile.tone-neutral::before   { background: hsl(var(--muted-foreground)); }
.tt-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.tt-head .roman { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); }
.tt-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
.tt-headline { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.tt-count { font-family: var(--font-display); font-weight: 650; font-size: 30px; letter-spacing: -0.03em; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.tactical-tile.tone-critical .tt-count { color: hsl(var(--destructive)); }
.tactical-tile.tone-warning .tt-count  { color: hsl(var(--warning)); }
.tactical-tile.tone-ok .tt-count        { color: hsl(var(--success)); }
.tactical-tile.tone-info .tt-count      { color: hsl(var(--info)); }
.tt-label { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); }
.tt-sub { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.45; }
.action-foot {
  padding: 12px 20px; border-top: 1px solid hsl(var(--border));
  font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground));
}
.action-foot a { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; }
.health-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: hsl(var(--border)); }
.health-cell { padding: 14px 16px; background: hsl(var(--card)); position: relative; }
.health-cell::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: hsl(var(--success)); }
.health-cell.stale::before { background: hsl(var(--warning)); }
.health-cell.failed::before { background: hsl(var(--destructive)); }
.hc-label { font-family: var(--font-sans); font-weight: 550; font-size: 13px; color: hsl(var(--foreground)); }
.hc-time { font-family: var(--font-mono); font-size: 12px; color: hsl(var(--foreground)); margin-top: 2px; }
.hc-status { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.health-cell.stale .hc-status { color: hsl(var(--warning)); }
.health-cell.failed .hc-status { color: hsl(var(--destructive)); }

/* ── Vendors: spend-concentration chart, vendor cells ── */
.conc-slab { padding: 18px 20px 18px; }
.conc-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.conc-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; margin: 0; color: hsl(var(--foreground)); }
.conc-head .sub { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.conc-head .legend { margin-left: auto; display: flex; gap: 14px; align-items: center; font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.conc-head .legend > span { display: inline-flex; gap: 6px; align-items: center; }
.conc-head .legend i { width: 11px; height: 11px; display: inline-block; border-radius: 3px; }
.conc-list { display: flex; flex-direction: column; gap: 6px; }
.conc-row { display: grid; grid-template-columns: 200px 1fr 120px 64px; gap: 14px; align-items: center; padding: 4px 0; }
.conc-vendor { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.conc-vendor:hover { color: hsl(var(--primary)); }
.conc-vendor .rk { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.conc-bar { position: relative; height: 10px; background: hsl(var(--muted)); border-radius: 999px; }
.conc-seg { height: 100%; background: hsl(var(--success)); border-radius: 999px; }
.pareto-line { position: absolute; top: -3px; bottom: -3px; width: 2px; background: hsl(var(--foreground)); }
.conc-money { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); text-align: right; font-variant-numeric: tabular-nums; }
.conc-money .share { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); margin-left: 6px; font-weight: 400; }
.conc-sku { font-family: var(--font-mono); font-size: 13px; color: hsl(var(--foreground)); text-align: right; }
.conc-sku .label { font-family: var(--font-sans); font-size: 10px; color: hsl(var(--muted-foreground)); margin-left: 3px; }
.pareto-annot { margin-top: 14px; padding: 10px 12px; background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md); display: flex; align-items: center; gap: 10px; font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); }
.pareto-annot b { color: hsl(var(--foreground)); font-weight: 600; }
.pareto-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; background: hsl(var(--foreground)); color: hsl(var(--background)); padding: 2px 7px; border-radius: 999px; }
.vendor-link { text-decoration: none; color: inherit; }
.vendor-cell { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 12px; }
.vendor-initials { width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 13px; background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.vendor-name { font-family: var(--font-sans); font-weight: 550; font-size: 13.5px; color: hsl(var(--foreground)); }
.vendor-meta { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.contact-cell { display: flex; flex-direction: column; gap: 1px; font-family: var(--font-sans); font-size: 12.5px; }
.contact-cell .email, .contact-cell .phone { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.lead-cell .quoted { font-family: var(--font-mono); font-size: 13px; color: hsl(var(--foreground)); }

/* ── Purchasing Horizon: stacked weekly chart + week drill-down + per-SKU walk ── */
.horizon-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid hsl(var(--border)); }
.hp { padding: 12px 14px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md); text-decoration: none; color: inherit; display: block; }
.hp:hover { background: hsl(var(--muted)); }
.hp .hp-num { font-family: var(--font-display); font-weight: 650; font-size: 26px; color: hsl(var(--foreground)); letter-spacing: -0.02em; line-height: 1; }
.hp .hp-num small { font-family: var(--font-mono); font-weight: 500; font-size: 12px; color: hsl(var(--muted-foreground)); margin-left: 2px; }
.hp .hp-sub { font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 6px; }
.hp.active { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.hp.active .hp-num, .hp.active .hp-sub, .hp.active .hp-num small { color: hsl(var(--primary-foreground)); }

.chart-slab { padding: 0; overflow: visible; }  /* visible so bar hover tooltips can escape the card (this class is Purchasing-Horizon-only); card corners stay rounded via its own border-radius */
.chart-cap { padding: 16px 20px; display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid hsl(var(--border)); }
.chart-cap h2 { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; margin: 0; color: hsl(var(--foreground)); }
.chart-cap .sub { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.vendor-legend { display: flex; flex-wrap: wrap; padding: 12px 20px; align-items: center; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); }
.vendor-legend .lbl { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-right: 16px; }
.ven-key { display: inline-flex; align-items: center; gap: 7px; margin-right: 18px; font-family: var(--font-sans); font-weight: 500; font-size: 12.5px; color: hsl(var(--foreground)); }
.ven-key .sw { width: 11px; height: 11px; border-radius: 3px; }
.ven-key .amt { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); margin-left: 4px; }
.sw.v-foundry, .bar-seg.v-foundry, .dd-ven .sw.v-foundry { background: hsl(142 50% 38%); }
.sw.v-sand, .bar-seg.v-sand, .dd-ven .sw.v-sand { background: hsl(215 65% 52%); }
.sw.v-birch, .bar-seg.v-birch, .dd-ven .sw.v-birch { background: hsl(35 72% 50%); }
.sw.v-hemp, .bar-seg.v-hemp, .dd-ven .sw.v-hemp { background: hsl(262 50% 58%); }
.sw.v-linen, .bar-seg.v-linen, .dd-ven .sw.v-linen { background: hsl(0 65% 58%); }
.sw.v-other, .bar-seg.v-other, .dd-ven .sw.v-other { background: hsl(var(--muted-foreground)); }
.chart-wrap { position: relative; padding: 28px 28px 8px; }
.chart-grid { position: relative; height: 300px; margin-left: 52px; border-bottom: 1px solid hsl(var(--border)); }
.gridline { position: absolute; left: 0; right: 0; height: 1px; background: hsl(var(--border) / 0.7); }
.gridline .ax { position: absolute; right: 100%; transform: translateY(-50%); padding-right: 10px; font-family: var(--font-mono); font-size: 10px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.median-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed hsl(var(--foreground) / 0.45); }
.median-line .lbl { position: absolute; right: 8px; top: -9px; background: hsl(var(--foreground)); color: hsl(var(--background)); padding: 1px 7px; border-radius: 999px; font-family: var(--font-mono); font-size: 9.5px; }
.otb-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid hsl(var(--destructive) / 0.75); pointer-events: none; z-index: 4; }
.otb-line .lbl { position: absolute; left: 8px; top: -10px; background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); padding: 1px 7px; border-radius: 999px; font-family: var(--font-mono); font-weight: 600; font-size: 9.5px; letter-spacing: 0.04em; }
.bar-col.over-otb .bar-segs { box-shadow: 0 0 0 1.5px hsl(var(--destructive) / 0.6); }
.bar-col.over-otb .top-val { color: hsl(var(--destructive)); font-weight: 700; }
.bars-row { position: absolute; inset: 0; display: grid; gap: 8px; align-items: end; padding: 0 4px; }
.bar-col { position: relative; height: 100%; display: flex; flex-direction: column-reverse; cursor: pointer; min-width: 0; text-decoration: none; color: inherit; }
.bar-col:hover { filter: brightness(1.06); }  /* on .bar-col, not .bar-segs — see note in the active block below (keeps the tooltip above the event stripe) */
.bar-col.empty { background: repeating-linear-gradient(135deg, hsl(var(--muted) / 0.7) 0 5px, transparent 5px 10px); border-radius: 4px; }
.bar-segs { width: 100%; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: visible; transition: filter 0.1s ease; }
.bar-seg { width: 100%; position: relative; }
.bar-seg + .bar-seg { border-top: 1px solid hsl(var(--card) / 0.55); }
.bar-seg:last-child { border-radius: 4px 4px 0 0; }
.bar-seg .tip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(-6px); background: hsl(var(--foreground)); color: hsl(var(--background)); font-family: var(--font-mono); font-size: 10px; padding: 4px 8px; border-radius: var(--radius-sm); white-space: nowrap; pointer-events: none; opacity: 0; z-index: 100; box-shadow: var(--shadow-md); }
.bar-seg .tip b { color: hsl(var(--background)); font-family: var(--font-display); font-weight: 600; }
.bar-seg:hover .tip { opacity: 1; }
.bar-col .top-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; font-family: var(--font-mono); font-weight: 600; font-size: 12px; color: hsl(var(--foreground)); white-space: nowrap; }
.bar-col.busiest .top-val { color: hsl(var(--destructive)); }
.bar-col.empty .top-val { color: hsl(var(--muted-foreground)); font-weight: 500; }
.bar-col.selected .bar-segs { box-shadow: 0 0 0 2px hsl(var(--foreground)); }
.bar-col .top-val small { display: block; font-family: var(--font-mono); font-size: 8.5px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.x-axis { position: relative; margin-left: 52px; padding: 12px 4px 0; display: grid; gap: 8px; }
.x-tick { text-align: center; font-family: var(--font-mono); font-size: 10px; color: hsl(var(--muted-foreground)); line-height: 1.3; }
.x-tick b { color: hsl(var(--foreground)); font-weight: 600; display: block; font-size: 11px; margin-bottom: 1px; }
.x-tick.this-week { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: 2px 0; border-radius: var(--radius-sm); }
.x-tick.this-week b { color: hsl(var(--primary-foreground)); }
.drilldown { display: grid; grid-template-columns: 280px 1fr; border-top: 1px solid hsl(var(--border)); }
.dd-summary { padding: 22px 24px; background: hsl(var(--sidebar)); color: hsl(var(--sidebar-foreground)); }
.dd-summary .dd-lbl { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0; color: hsl(var(--sidebar-muted)); text-transform: none; }
.dd-summary .dd-week { font-family: var(--font-display); font-weight: 600; font-size: 24px; color: #fff; margin: 6px 0 4px; line-height: 1.05; }
.dd-summary .dd-total { font-family: var(--font-display); font-weight: 650; font-size: 34px; color: #fff; letter-spacing: -0.02em; margin: 16px 0 4px; line-height: 1; }
.dd-summary .dd-meta { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--sidebar-muted)); line-height: 1.6; }
.dd-summary .dd-meta b { color: #fff; font-weight: 600; }
.dd-summary .dd-action { margin-top: 18px; display: flex; width: 100%; }
.dd-vendor-list { padding: 20px 24px; background: hsl(var(--card)); }
.dd-vendor-list h3 { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); margin: 0 0 12px; }
.dd-ven { display: grid; grid-template-columns: 14px 1fr auto auto auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid hsl(var(--border)); }
.dd-ven:last-child { border-bottom: none; }
.dd-ven .sw { width: 12px; height: 12px; border-radius: 3px; }
.dd-ven .name { font-family: var(--font-sans); font-weight: 550; font-size: 13.5px; color: hsl(var(--foreground)); }
.dd-ven .skus { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.dd-ven .amt { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: hsl(var(--foreground)); text-align: right; }
.dd-ven .share { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.dd-ven .action { font-family: var(--font-sans); font-size: 11.5px; font-weight: 500; color: hsl(var(--primary)); text-decoration: none; padding: 5px 11px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-md); white-space: nowrap; }
.dd-ven .action:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.dd-empty { padding: 18px 0; font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); }
.place-by { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--destructive)); }
.place-by.future { color: hsl(var(--warning)); }
.place-by.ok { color: hsl(var(--success)); }
.place-by.outside { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 11px; }
.place-by small { display: block; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; color: hsl(var(--muted-foreground)); margin-top: 1px; text-transform: none; }
.line-sku-cell { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; }
.line-sku-cell .sku-chip, .line-sku-cell .sku-thumb { width: 34px; height: 34px; }
.line-sku-title { font-family: var(--font-sans); font-weight: 550; font-size: 13px; color: hsl(var(--foreground)); line-height: 1.15; }
.line-sku-code { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); margin-top: 2px; }

/* ── Schema / description block (Bundles, Printful title-windows) ── */
.desc-block { font-family: var(--font-sans); font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.55; }
.desc-block strong { color: hsl(var(--foreground)); font-weight: 600; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid hsl(var(--border)); }
.field-block .label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0; text-transform: none;
  color: hsl(var(--muted-foreground)); margin-bottom: 3px;
}
.field-block .value { font-family: var(--font-sans); font-size: 13px; color: hsl(var(--foreground)); }
.field-block .value .mono { font-family: var(--font-mono); font-size: 12px; color: hsl(var(--muted-foreground)); }

/* ── Auth pages (centered card, no sidebar) ── */
.auth-body { min-height: 100vh; margin: 0; background: hsl(var(--canvas)); display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-brand .mark { width: 34px; height: 34px; display: grid; place-items: center; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-radius: var(--radius-md); font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.auth-brand .bt { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: hsl(var(--foreground)); line-height: 1.1; }
.auth-brand .bt small { display: block; font-family: var(--font-sans); font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground)); }
.auth-panel { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.mode-tabs { display: inline-flex; gap: 2px; background: hsl(var(--muted)); border-radius: var(--radius-md); padding: 3px; }
.mode-tab { flex: 1; padding: 7px 14px; text-align: center; font-family: var(--font-sans); font-weight: 500; font-size: 13px; color: hsl(var(--muted-foreground)); text-decoration: none; border-radius: calc(var(--radius-md) - 2px); }
.mode-tab.active { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm); }
.mode-tab:not(.active):hover { color: hsl(var(--foreground)); }
.form-headline { font-family: var(--font-display); font-weight: 650; font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; color: hsl(var(--foreground)); margin: 0; }
.form-sub { font-family: var(--font-sans); font-size: 13px; color: hsl(var(--muted-foreground)); margin: -10px 0 0; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: grid; gap: 6px; }
.auth-field label { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); }
.auth-field input { background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: var(--radius-md); padding: 0 11px; height: 38px; font-family: var(--font-sans); font-size: 14px; color: hsl(var(--foreground)); outline: none; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.auth-field input::placeholder { color: hsl(var(--muted-foreground)); }
.auth-field input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32); }
.auth-field .error { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--destructive)); }
.btn-submit { margin-top: 4px; height: 40px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border: none; border-radius: var(--radius-md); font-family: var(--font-sans); font-weight: 500; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-submit:hover { background: hsl(var(--primary) / 0.9); }
.flashes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 12px; border-radius: var(--radius-md); font-family: var(--font-sans); font-size: 13px; border: 1px solid transparent; }
.flash-error { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }
.flash-info, .flash-success { background: hsl(var(--success) / 0.1); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }

/* ─── PO NEW · STEPPER (shared between Step 1 + Step 2) ──────────────── */
.po-stepper { display: flex; align-items: center; gap: 0; margin-top: 6px; }
.po-step { display: flex; align-items: flex-start; gap: 10px; flex: 0 0 auto; white-space: nowrap; }
.po-step .dot {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  border: 1.5px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  background: hsl(var(--background));
}
.po-step.active .dot { background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.po-step.done .dot { background: hsl(var(--success)); border-color: hsl(var(--success)); color: #fff; }
.po-step .st-text { display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.po-step .st-text b { font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: hsl(var(--foreground)); }
.po-step.upcoming .st-text b { color: hsl(var(--muted-foreground)); }
.po-step .st-text span { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.po-step-line { flex: 1 1 auto; min-width: 18px; height: 1.5px; background: hsl(var(--border)); margin: 0 12px; }

/* ─── PO NEW · STEP 1 vendor picker primitives ───────────────────────── */
.vendor-group-label {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin: 10px 0 0;
}
.vendor-group-label::after { content: ''; flex: 1; height: 1px; background: hsl(var(--border)); }
.vendor-group-label .ct { font-family: var(--font-mono); color: hsl(var(--muted-foreground)); }

.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(326px, 1fr)); gap: 14px; padding: 0 22px 22px; }
.vcard {
  position: relative;
  display: flex; flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease, transform .12s ease;
}
a.vcard:hover { border-color: hsl(var(--ring) / 0.55); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.vcard.featured { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
a.vcard.featured:hover { background: hsl(var(--primary) / 0.93); }
.vcard.muted { background: hsl(var(--muted) / 0.35); }
.vcard.disabled { background: hsl(var(--muted) / 0.3); border-style: dashed; cursor: not-allowed; box-shadow: none; }

.vc-lead {
  position: absolute; top: 16px; right: 16px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 999px; padding: 1px 8px;
}
.vcard.featured .vc-lead { background: hsl(0 0% 100% / 0.16); color: #fff; border-color: transparent; }
.vc-name {
  font-family: var(--font-sans); font-weight: 600; font-size: 16px;
  letter-spacing: -0.01em; color: hsl(var(--foreground));
  padding-right: 52px; line-height: 1.2;
}
.vcard.featured .vc-name { color: hsl(var(--primary-foreground)); }
.vc-sub { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.vcard.featured .vc-sub { color: hsl(0 0% 100% / 0.72); }

.vc-amount {
  font-family: var(--font-display); font-weight: 650; font-size: 30px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground)); margin-top: 14px; line-height: 1;
}
.vcard.featured .vc-amount { color: hsl(var(--primary-foreground)); }
.vc-amount .sm { font-size: 0.5em; font-weight: 600; color: hsl(var(--muted-foreground)); letter-spacing: 0; }
.vcard.featured .vc-amount .sm { color: hsl(0 0% 100% / 0.7); }
.vc-amount-label { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 5px; }
.vcard.featured .vc-amount-label { color: hsl(0 0% 100% / 0.72); }
.vc-amount.none { font-family: var(--font-sans); font-size: 15px; font-weight: 500; color: hsl(var(--muted-foreground)); margin-top: 17px; }

/* Suggested-products list on the vendor cards — the products needing
   ordering, sized under the suggested-spend line as its breakdown. */
.vc-skus { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.vc-sku {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--foreground));
}
.vc-sku .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-sku .q {
  flex-shrink: 0; font-family: var(--font-mono); font-size: 12px;
  color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums;
}
.vc-sku-more {
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground)); margin-top: 1px;
}
.vcard.featured .vc-sku { color: #fff; }
.vcard.featured .vc-sku .q { color: hsl(0 0% 100% / 0.7); }
.vcard.featured .vc-sku-more { color: hsl(0 0% 100% / 0.66); }

.vc-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid hsl(var(--border));
}
.vcard.featured .vc-meta { border-top-color: hsl(0 0% 100% / 0.18); }
.vc-kv { display: flex; flex-direction: column; gap: 1px; }
.vc-kv .k { font-family: var(--font-sans); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-foreground)); }
.vc-kv .v { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.vcard.featured .vc-kv .k { color: hsl(0 0% 100% / 0.66); }
.vcard.featured .vc-kv .v { color: #fff; }

.vc-cta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid hsl(var(--border));
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  color: hsl(var(--primary)); white-space: nowrap;
}
.vc-cta > span:first-child { white-space: nowrap; }
.vcard.featured .vc-cta { border-top-color: hsl(0 0% 100% / 0.18); color: #fff; }
.vc-cta .arr { transition: transform .12s ease; }
a.vcard:hover .vc-cta .arr { transform: translateX(3px); }
.vc-cta.disabled-cta { color: hsl(var(--muted-foreground)); font-weight: 500; justify-content: flex-start; }
.vc-cta.disabled-cta a { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* ─── PO NEW · STEP 2 staging form primitives ────────────────────────── */

/* Secondary action bar above the title slab (Cancel / Pick different vendor) */
.subbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 14px;
  font-family: var(--font-sans); font-size: 13px;
}
.subbar a { display: inline-flex; align-items: center; gap: 6px; color: hsl(var(--foreground)); text-decoration: none; font-weight: 500; }
.subbar a:hover { color: hsl(var(--primary)); }
.subbar .sep { color: hsl(var(--border)); }
.subbar .status { margin-left: auto; color: hsl(var(--muted-foreground)); }
.subbar .status strong { color: hsl(var(--foreground)); font-weight: 600; }

/* Stepper line "done" tint — used when Step 1 is checked off */
.po-step-line.done { background: hsl(var(--success)); }

/* Vendor recap strip (inside the first staging slab) */
.vendor-recap {
  display: flex; align-items: center; gap: 16px;
  margin: 22px 30px 0;
  padding: 16px 18px;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
}
.vr-mark {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 650; font-size: 16px; letter-spacing: 0.02em;
}
.vr-body { min-width: 0; flex: 1; }
.vr-name { font-family: var(--font-sans); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
.vr-meta { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.vr-meta b { color: hsl(var(--foreground)); font-weight: 550; }
.vr-links { display: flex; gap: 16px; flex-shrink: 0; }
.vr-links a { font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: hsl(var(--primary)); text-decoration: none; white-space: nowrap; }
.vr-links a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* PO header form (vendor PO #, expected arrival, notes) */
.po-form { margin: 18px 30px 28px; }
.po-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.po-form-grid .field.full { grid-column: 1 / -1; }

/* Filter-bar legend hint (right side of the .filter-bar above the table) */
.ts-legend {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 14px; white-space: nowrap;
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
}
.ts-legend .swatch { width: 11px; height: 14px; border-radius: 2px; background: hsl(var(--success) / 0.12); box-shadow: inset 2.5px 0 0 hsl(var(--success)); }

/* MOQ strip (alert-bar between filter chips and the table) */
.moq-strip {
  display: flex; align-items: center; gap: 14px;
  margin: 0 20px 4px;
  padding: 12px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--muted) / 0.4);
  font-family: var(--font-sans); font-size: 13px;
}
.moq-badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: var(--radius-sm);
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
}
.moq-body { color: hsl(var(--muted-foreground)); flex: 1; }
.moq-body b { color: hsl(var(--foreground)); font-weight: 600; font-variant-numeric: tabular-nums; }
.moq-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.moq-status .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.moq-status.below { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.3); }
.moq-status.exceeds { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.moq-badge.otb {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.otb-stage-strip { border-color: hsl(var(--primary) / 0.25); background: hsl(var(--primary) / 0.04); }
.moq-fine { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); white-space: nowrap; }

/* Stage table — extends .ledger with per-row editable cells */
table.stage-table { table-layout: auto; }
.stage-table th.col-chk, .stage-table td.col-chk { width: 56px; text-align: center; padding-left: 18px; padding-right: 8px; }
.stage-table input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid hsl(var(--border)); background: hsl(var(--background));
  cursor: pointer; position: relative; vertical-align: middle;
  transition: background .12s ease, border-color .12s ease;
}
.stage-table input[type="checkbox"]:checked { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.stage-table input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.stage-table input[type="checkbox"]:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.35); }

.lead-d { font-family: var(--font-mono); font-size: 12.5px; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.onhand-lean { color: hsl(var(--destructive)); font-weight: 600; }

.num-input {
  width: 76px; height: 32px;
  text-align: right; padding: 0 9px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
  transition: border-color .12s ease, box-shadow .12s ease;
}
.num-input:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32); }
.cost-input { width: 84px; }
.cost-wrap { display: inline-flex; align-items: center; gap: 0; position: relative; }

/* Suggested-qty highlight: green left-border ring on the cell (not a bg tint) */
td.qty-cell { position: relative; }
tr.recommended td.qty-cell .num-input {
  border-color: hsl(var(--success) / 0.5);
  box-shadow: inset 3px 0 0 hsl(var(--success)), 0 0 0 1px hsl(var(--success) / 0.18);
  background: hsl(var(--success) / 0.05);
}
tr.recommended td.qty-cell .num-input:focus { box-shadow: inset 3px 0 0 hsl(var(--success)), 0 0 0 3px hsl(var(--ring) / 0.32); }

.ext-val { font-family: var(--font-mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: hsl(var(--foreground)); }
.sug-cell { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.sug-cell.dim { color: hsl(var(--muted-foreground)); }

/* Unchecked row dim (keep checkbox column fully visible) */
tr.unchecked td:not(.col-chk) { opacity: 0.42; }
tr.unchecked td.col-chk { opacity: 1; }
.stage-table tbody tr { transition: opacity .12s ease, background .12s ease; }

/* Sticky create-bar at the bottom of the staging form */
.create-bar {
  position: sticky; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 2fr;
  gap: 0;
  margin-top: 14px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: 0 -2px 12px -4px hsl(220 40% 20% / 0.14), var(--shadow-md);
  overflow: hidden;
}
.cb-cell { padding: 16px 22px; border-right: 1px solid hsl(var(--border)); display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.cb-cell .cb-label { font-family: var(--font-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: hsl(var(--muted-foreground)); }
.cb-cell .cb-value { font-family: var(--font-display); font-weight: 650; font-size: 26px; letter-spacing: -0.02em; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; line-height: 1; }
.cb-cell .cb-value .sm { font-size: 0.55em; font-weight: 600; color: hsl(var(--muted-foreground)); letter-spacing: 0; }
.cb-cell .cb-sub { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.cb-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-right: none; padding: 14px 18px 14px 22px; }
.cb-cta .cb-meta { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.4; max-width: 200px; }
.cb-cta .btn { height: 44px; padding: 0 22px; font-size: 14px; }

/* ─── PO DETAIL · stage-track (lifecycle progress in title-window) ───── */
.stage-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.st-cell {
  padding: 10px 12px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  min-width: 0; overflow: hidden;
}
.st-cell .st-lbl, .st-cell .st-when, .st-cell .st-by { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.st-cell .st-lbl { font-family: var(--font-sans); font-size: 10.5px; color: hsl(var(--muted-foreground)); letter-spacing: 0; text-transform: uppercase; }
.st-cell .st-when { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); margin-top: 4px; letter-spacing: -0.005em; }
.st-cell .st-by { font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.st-cell.done { background: hsl(var(--success) / 0.1); border-color: hsl(var(--success) / 0.3); }
.st-cell.done .st-when { color: hsl(var(--success)); }
.st-cell.now  { background: hsl(var(--primary) / 0.1); border-color: hsl(var(--primary) / 0.35); }
.st-cell.now .st-when { color: hsl(var(--primary)); }
.st-cell.pending { opacity: 0.7; }
.st-cell.pending .st-when { color: hsl(var(--muted-foreground)); }

/* PO id stamp in title body */
.po-stamp {
  display: inline-flex; align-items: center; gap: 14px;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 14px;
}
.po-stamp .stamp-num { font-family: var(--font-display); font-weight: 650; font-size: 24px; letter-spacing: -0.02em; color: hsl(var(--foreground)); line-height: 1; }
.po-stamp .stamp-lbl { font-family: var(--font-sans); font-size: 10.5px; letter-spacing: 0; color: hsl(var(--muted-foreground)); text-transform: uppercase; margin-bottom: 2px; }
.po-stamp .vbar { width: 1px; align-self: stretch; background: hsl(var(--border)); }

.blurb-line { font-family: var(--font-sans); font-size: 13.5px; color: hsl(var(--muted-foreground)); line-height: 1.5; margin-top: 14px; }
.blurb-line b { color: hsl(var(--foreground)); font-weight: 600; }
.blurb-line i { color: hsl(var(--muted-foreground)); font-style: italic; }

/* Top action-bar above the title-slab — back link + PDF + actions */
.action-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 14px;
  margin-bottom: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}
.action-bar a { color: hsl(var(--foreground)); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.action-bar a:hover { color: hsl(var(--primary)); }
.action-bar .sep { color: hsl(var(--border)); }
.action-bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.action-bar .dim { color: hsl(var(--muted-foreground)); }

/* Three-column panel row (Vendor / Ship to / PO summary) */
.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 14px;
}
.panel-row .panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.panel-label {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.panel-label .badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  padding: 2px 8px; border-radius: var(--radius-sm);
}
.biz-name { font-family: var(--font-display); font-weight: 650; font-size: 18px; color: hsl(var(--foreground)); letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 4px; }
.biz-line { font-family: var(--font-sans); font-size: 13px; color: hsl(var(--foreground)); line-height: 1.6; }
.biz-line.dim { color: hsl(var(--muted-foreground)); }
.biz-line b { color: hsl(var(--foreground)); font-weight: 600; }

/* Key/value grid (PO summary panel) */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}
.kv { display: flex; flex-direction: column; gap: 4px; }
.kv .k { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.kv .v { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: hsl(var(--foreground)); letter-spacing: -0.005em; font-variant-numeric: tabular-nums; }
.kv .v .unit { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: hsl(var(--muted-foreground)); letter-spacing: 0; margin-left: 3px; }
.kv.tone-warn .v { color: hsl(var(--warning)); }
.kv.tone-ok .v { color: hsl(var(--success)); }

/* Line items table specifics (PO detail ledger) */
.line-sku-cell { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; }
.line-sku-thumb-img { width: 38px; height: 38px; object-fit: cover; display: block; border-radius: var(--radius-sm); }
.line-sku-title { font-family: var(--font-sans); font-weight: 550; font-size: 13.5px; color: hsl(var(--foreground)); line-height: 1.2; }
.line-sku-code { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); letter-spacing: 0; margin-top: 2px; }

/* Per-line receipt progress bar */
.line-recv { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.line-recv-track { flex: 1; height: 8px; background: hsl(var(--muted)); border-radius: 999px; position: relative; overflow: hidden; }
.line-recv-fill { height: 100%; background: hsl(var(--success)); border-radius: 999px; }
.line-recv-fill.partial { background: hsl(var(--warning)); }
.line-recv-fill.empty { background: transparent; }
.line-recv-val { font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--foreground)); min-width: 50px; font-variant-numeric: tabular-nums; }
.line-recv-val.zero { color: hsl(var(--muted-foreground)); }

.ledger.detail-ledger td .v { color: hsl(var(--foreground)); font-weight: 500; }
.ledger.detail-ledger td .v.money { font-family: var(--font-display); font-weight: 600; font-size: 14px; }

/* Receipts timeline */
.timeline { position: relative; padding: 4px 0 4px 24px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: hsl(var(--border)); }
.tl-evt { position: relative; padding: 8px 0 14px; border-bottom: 1px dashed hsl(var(--border)); }
.tl-evt:last-child { border-bottom: none; padding-bottom: 4px; }
.tl-evt::before { content: ''; position: absolute; left: -23px; top: 14px; width: 14px; height: 14px; border-radius: 999px; background: hsl(var(--success)); box-shadow: 0 0 0 3px hsl(var(--card)); }
.tl-evt.event-finalize::before { background: hsl(var(--success)); }
.tl-evt.event-draft::before    { background: hsl(var(--muted-foreground)); }
.tl-evt.event-cancel::before   { background: hsl(var(--destructive)); }
.tl-evt.event-receipt::before  { background: hsl(var(--success)); }
.tl-evt .tl-head { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-sans); font-weight: 600; font-size: 13.5px; color: hsl(var(--foreground)); letter-spacing: 0; }
.tl-evt .tl-when { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); letter-spacing: 0; text-transform: none; }
.tl-evt .tl-body { margin-top: 6px; font-family: var(--font-sans); font-size: 13px; color: hsl(var(--muted-foreground)); line-height: 1.5; }
.tl-evt .tl-body b { color: hsl(var(--foreground)); font-weight: 600; }

/* Actions rail (status-specific action panel) */
.actions-rail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.act-cell {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.act-cell h3 { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -0.005em; color: hsl(var(--foreground)); margin: 0 0 12px; }
.act-cell .hint { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); line-height: 1.5; margin-bottom: 14px; }
.act-cell .btn { width: 100%; justify-content: center; padding: 10px; }
.act-cell form { margin: 0; }

/* Form fields used inside .act-cell / draft edit grid */
.act-cell .field, .draft-edit-grid .field { display: grid; gap: 4px; margin-bottom: 12px; }
.act-cell .field label, .draft-edit-grid .field label { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.act-cell .field input, .act-cell .field select, .act-cell .field textarea,
.draft-edit-grid .field input, .draft-edit-grid .field select, .draft-edit-grid .field textarea {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--foreground));
  outline: none;
}
.act-cell .field input:focus, .draft-edit-grid .field input:focus,
.act-cell .field select:focus, .draft-edit-grid .field select:focus,
.act-cell .field textarea:focus, .draft-edit-grid .field textarea:focus {
  border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.draft-edit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ─── PO INDEX · lifecycle state-machine cards + row primitives ─────── */

/* Lifecycle diagram inside the title-window (state machine) */
.lifecycle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.lc-stage {
  padding: 12px 12px 14px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  min-width: 0; overflow: hidden;
}
.lc-stage .lc-step { font-family: var(--font-sans); font-size: 10.5px; letter-spacing: 0; color: hsl(var(--muted-foreground)); text-transform: uppercase; white-space: nowrap; }
.lc-stage .lc-label { font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -0.005em; color: hsl(var(--foreground)); margin: 6px 0 4px; line-height: 1; white-space: nowrap; }
.lc-stage .lc-cap { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.4; }
.lc-stage.is-draft     { border-color: hsl(var(--muted-foreground) / 0.3); }
.lc-stage.is-draft .lc-label { color: hsl(var(--muted-foreground)); }
.lc-stage.is-finalized { background: hsl(var(--success) / 0.08); border-color: hsl(var(--success) / 0.3); }
.lc-stage.is-finalized .lc-label { color: hsl(var(--success)); }
.lc-stage.is-received  { background: hsl(var(--success) / 0.12); border-color: hsl(var(--success) / 0.4); }
.lc-stage.is-received .lc-label { color: hsl(var(--success)); }
.lc-stage.is-cancelled { border-color: hsl(var(--destructive) / 0.3); }
.lc-stage.is-cancelled .lc-label { color: hsl(var(--destructive)); }

/* PO row cells */
.po-id-cell { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; }
.po-id-chip {
  width: 56px; height: 38px;
  display: grid; place-items: center;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: -0.005em;
  border-radius: var(--radius-md);
}
.po-id-chip.s-draft     { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.po-id-chip.s-finalized { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.po-id-chip.s-received  { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.po-id-chip.s-cancelled { background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }
.po-vendor-name { font-family: var(--font-sans); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); letter-spacing: -0.005em; line-height: 1.2; }
.po-vendor-meta { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); letter-spacing: 0; margin-top: 2px; }
.po-link { color: inherit; text-decoration: none; display: block; }
.po-link:hover .po-vendor-name { color: hsl(var(--primary)); }

/* Money cell — bold display number + currency stamp */
.money { font-family: var(--font-display); font-weight: 650; font-size: 15px; color: hsl(var(--foreground)); letter-spacing: -0.01em; line-height: 1; font-variant-numeric: tabular-nums; }
.money small { display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: hsl(var(--muted-foreground)); letter-spacing: 0; margin-left: 4px; vertical-align: 2px; }
.money.dim { color: hsl(var(--muted-foreground)); }

/* Lines count + pip strip */
.lines-cell { display: flex; align-items: center; gap: 8px; }
.lines-count { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.lines-pips { display: flex; gap: 2px; }
.lines-pips i { width: 4px; height: 12px; background: hsl(var(--success)); display: block; border-radius: 1px; }
.lines-pips i.x { background: hsl(var(--border)); }

/* Date column */
.date-stack { font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--foreground)); letter-spacing: 0; line-height: 1.2; font-variant-numeric: tabular-nums; }
.date-stack .date-lbl { display: block; font-family: var(--font-sans); font-size: 10.5px; letter-spacing: 0; color: hsl(var(--muted-foreground)); text-transform: uppercase; margin-bottom: 2px; }
.date-stack.future { color: hsl(var(--warning)); font-weight: 600; }
.date-stack.late { color: hsl(var(--destructive)); font-weight: 600; }

/* Status tag — wider variant for full lifecycle states */
.tag-po { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 999px; font-family: var(--font-sans); font-weight: 600; font-size: 11px; letter-spacing: 0; white-space: nowrap; border: 1px solid transparent; }
.tag-po .pip { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; background: currentColor; }
.tag-po.draft     { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.tag-po.finalized { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.tag-po.received  { background: hsl(var(--success) / 0.18); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.4); }
.tag-po.cancelled { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }

/* PO row receipt-progress bar */
.recv-bar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.recv-track { flex: 1; height: 8px; background: hsl(var(--muted)); border-radius: 999px; position: relative; overflow: hidden; }
.recv-fill { background: hsl(var(--success)); height: 100%; border-radius: 999px; }
.recv-fill.partial { background: hsl(var(--warning)); }
.recv-val { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--foreground)); letter-spacing: 0; min-width: 42px; font-variant-numeric: tabular-nums; }

.ledger.po-ledger { table-layout: fixed; }
.ledger.po-ledger td, .ledger.po-ledger th { overflow: hidden; }
.ledger.po-ledger td .v-num { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.ledger.po-ledger tr.is-draft .recv-bar, .ledger.po-ledger tr.is-cancelled .recv-bar { opacity: 0; }

/* Toolbar (search + selects) — kept simple for the PO index */

/* ─── ADMIN · JOBS page primitives ───────────────────────────────────── */

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.job-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px 20px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 14px 18px;
}
.job-card.is-success { box-shadow: inset 4px 0 0 hsl(var(--success)), var(--shadow-sm); }
.job-card.is-partial { box-shadow: inset 4px 0 0 hsl(var(--warning)), var(--shadow-sm); }
.job-card.is-running { box-shadow: inset 4px 0 0 hsl(var(--info)), var(--shadow-sm); }
.job-card.is-failed  { box-shadow: inset 4px 0 0 hsl(var(--destructive)), var(--shadow-sm); }
.job-card.is-none    { box-shadow: inset 4px 0 0 hsl(var(--muted-foreground) / 0.5), var(--shadow-sm); }

.job-card .job-marker {
  grid-column: 1; grid-row: 1;
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.job-card .job-tag-state { grid-column: 2; grid-row: 1; align-self: start; }

.job-card .job-name {
  grid-column: 1 / -1; grid-row: 2;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 22px;
  color: hsl(var(--foreground));
  letter-spacing: -0.02em;
  line-height: 1.1;
  word-break: break-word;
}
.job-card .job-name code {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  letter-spacing: 0;
  margin-left: 8px;
  vertical-align: 3px;
}

.job-card .job-blurb {
  grid-column: 1; grid-row: 3;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  line-height: 1.55;
  max-width: 420px;
}
.job-card .job-blurb b { color: hsl(var(--foreground)); font-weight: 600; }

.job-stats {
  grid-column: 2; grid-row: 3;
  display: grid; grid-template-rows: repeat(3, auto);
  gap: 8px;
  min-width: 200px;
}
.job-stat {
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.job-stat .k {
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.job-stat .v {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: hsl(var(--foreground));
  letter-spacing: -0.005em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.job-stat .v.dim { color: hsl(var(--muted-foreground)); font-weight: 500; }

/* Sparkline — run-duration strip */
.sparkline {
  grid-column: 1 / -1; grid-row: 4;
  margin-top: 4px;
  height: 36px;
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  display: flex; align-items: flex-end;
  gap: 2px;
  padding: 2px 4px;
  overflow: hidden;
}
.sparkline .sl-bar {
  flex: 1;
  background: hsl(var(--success));
  border-radius: 2px 2px 0 0;
  cursor: pointer;
  min-width: 4px;
}
.sparkline .sl-bar:hover { filter: brightness(1.1); }
.sparkline .sl-bar.partial { background: hsl(var(--warning)); }
.sparkline .sl-bar.failed  { background: hsl(var(--destructive)); }
.sparkline .sl-bar.running { background: hsl(var(--info)); }
.sparkline.empty {
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  align-items: center;
  justify-content: center;
}

.job-card .job-actions {
  grid-column: 1 / -1; grid-row: 5;
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.job-card .schedule-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
}
.job-card .schedule-pill {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.job-card .schedule-pill b { color: hsl(var(--background)); font-weight: 600; }
.job-card .btn-trigger, .job-card .btn-trigger-form { margin-left: auto; }
.job-card .btn-trigger { padding: 8px 14px; display: inline-flex; align-items: center; gap: 8px; }
.job-card .btn-trigger-form { display: inline; margin: 0; }

/* All-runs ledger table on the jobs page */
.runs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 13px;
}
.runs-table thead th {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}
.runs-table thead th.num { text-align: right; }
.runs-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
  color: hsl(var(--foreground));
}
.runs-table tbody tr:hover td { background: hsl(var(--muted) / 0.3); }
.runs-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Per-job color-coded tag inside the runs ledger */
.job-tag-job {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}
.job-tag-job .pip { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; background: currentColor; }
.job-tag-job.sync     { background: hsl(var(--info) / 0.12); color: hsl(var(--info)); border-color: hsl(var(--info) / 0.3); }
.job-tag-job.snapshot { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.job-tag-job.orders   { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); border-color: hsl(var(--border)); }
.job-tag-job.forecast { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.3); }

/* Log-excerpt cell — single-line mono with subtle border-left */
.log-excerpt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0;
  background: hsl(var(--muted) / 0.35);
  border-left: 2px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}
.log-excerpt b { color: hsl(var(--foreground)); font-weight: 600; }

/* Per-run duration bar */
.duration-bar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.duration-bar .db-track {
  flex: 1; height: 8px;
  background: hsl(var(--muted));
  border-radius: 999px;
  position: relative; overflow: hidden;
}
.duration-bar .db-fill { height: 100%; background: hsl(var(--success)); border-radius: 999px; }
.duration-bar .db-fill.warn { background: hsl(var(--warning)); }
.duration-bar .db-fill.long { background: hsl(var(--destructive)); }
.duration-bar .db-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--foreground));
  letter-spacing: 0;
  min-width: 50px;
  font-variant-numeric: tabular-nums;
}

/* Status pill (run row) */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0;
  border: 1px solid transparent;
}
.status-pill .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.status-pill.success { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.status-pill.partial { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.3); }
.status-pill.failed  { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }
.status-pill.running { background: hsl(var(--info) / 0.12); color: hsl(var(--info)); border-color: hsl(var(--info) / 0.3); }
.status-pill.none    { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }

/* ─── PURCHASING HORIZON page primitives ─────────────────────────────── */

/* Horizon picker — segmented control in the title-window */
.horizon-picker {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.hp {
  padding: 14px; background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none; color: inherit; display: block;
  transition: background .12s ease, border-color .12s ease;
}
.hp:hover { border-color: hsl(var(--ring) / 0.5); }
.hp .hp-num {
  font-family: var(--font-display); font-weight: 650; font-size: 30px;
  color: hsl(var(--foreground)); letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hp .hp-num small {
  font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; margin-left: 2px;
}
.hp .hp-sub {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0;
  text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-top: 8px;
}
.hp.active { background: hsl(var(--primary) / 0.1); border-color: hsl(var(--primary)); }
.hp.active .hp-num, .hp.active .hp-sub { color: hsl(var(--primary)); }

/* Vendor legend strip above the chart */
.vendor-legend {
  display: flex; flex-wrap: wrap; align-items: center;
  background: hsl(var(--muted) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
  padding: 12px 20px; gap: 6px 22px;
}
.vendor-legend .lbl {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0;
  text-transform: uppercase; color: hsl(var(--muted-foreground)); margin-right: 8px;
}
.ven-key {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 550; font-size: 12.5px;
  color: hsl(var(--foreground)); letter-spacing: 0;
}
.ven-key .sw { width: 14px; height: 14px; border-radius: var(--radius-sm); }
.ven-key .amt {
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground)); margin-left: 4px;
}

/* Vendor colour palette — semantic-ish; cycle through Shadcn tones */
.sw.v-foundry, .bar-seg.v-foundry { background: hsl(var(--success)); }
.sw.v-sand, .bar-seg.v-sand       { background: hsl(var(--destructive)); }
.sw.v-birch, .bar-seg.v-birch     { background: hsl(36 30% 45%); }
.sw.v-hemp, .bar-seg.v-hemp       { background: hsl(var(--success) / 0.7); }
.sw.v-linen, .bar-seg.v-linen     { background: hsl(var(--warning)); }
.sw.v-other, .bar-seg.v-other     { background: hsl(var(--muted-foreground)); }

/* Horizon chart slab + chrome */
.chart-slab { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: visible; }
.chart-cap {
  padding: 16px 22px;
  display: flex; align-items: baseline; gap: 14px;
  background: hsl(var(--muted) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
}
.chart-cap h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.01em; text-transform: none; margin: 0; color: hsl(var(--foreground));
}
.chart-cap .sub {
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; text-transform: none;
}
.chart-wrap { position: relative; padding: 24px 24px 8px; background: hsl(var(--card)); }

/* Y axis + gridlines */
.chart-grid {
  position: relative; height: 320px; margin-left: 56px;
  border-bottom: 1px solid hsl(var(--foreground));
  border-left: 1px solid hsl(var(--border));
}
.gridline { position: absolute; left: 0; right: 0; height: 1px; background: hsl(var(--border) / 0.6); }
.gridline .ax {
  position: absolute; right: 100%; transform: translateY(-50%); padding-right: 10px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: hsl(var(--muted-foreground)); white-space: nowrap;
}
.median-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed hsl(var(--foreground) / 0.5); pointer-events: none; z-index: 4; }
.median-line .lbl {
  position: absolute; right: 8px; top: -12px;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0; text-transform: uppercase;
}

/* Bars row */
.bars-row { position: absolute; inset: 0; display: grid; gap: 10px; align-items: end; padding: 0 4px; }
.bar-col {
  position: relative; height: 100%;
  display: flex; flex-direction: column-reverse;
  cursor: pointer; min-width: 0;
  text-decoration: none; color: inherit;
}
/* Hover: lift the whole column above its siblings (so the overflowing `.tip`
   paints over adjacent — esp. empty/hatched — columns) and brighten it. The
   brighten lives on `.bar-col`, NOT `.bar-segs`: a filter on `.bar-segs` makes
   it a stacking context that traps the `.tip` (z-index 100) inside the bar's
   box, so the tooltip could no longer paint over neighbouring columns. On
   `.bar-col` the tip stays on top. */
.bar-col:hover { z-index: 5; filter: brightness(1.08); }
.bar-col.empty { background: repeating-linear-gradient(135deg, hsl(var(--muted) / 0.4) 0 4px, transparent 4px 8px); }
.bar-segs {
  width: 100%; display: flex; flex-direction: column-reverse;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  /* visible (was hidden) so the `.bar-seg .tip` hover tooltips can escape the
     bar — overflow:hidden was clipping each tip to the bar's box (width-bound
     + cut off) and dropping the top segment's tip entirely (it sits above the
     stack). The border-radius is kept for the selected / over-otb box-shadow
     rings; the visual top corners are now rounded on the top segment itself. */
  overflow: visible;
  transition: filter 0.1s;
}
.bar-seg { width: 100%; }
.bar-seg:not(:first-child) { border-top: 1px solid hsl(var(--background) / 0.4); }
/* column-reverse → the last DOM segment is the visual top of the stack; round
   it here now that .bar-segs no longer clip-rounds the corners. */
.bar-seg:last-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.bar-col .top-val {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: hsl(var(--foreground)); white-space: nowrap; letter-spacing: -0.005em;
  font-variant-numeric: tabular-nums;
}
.bar-col.busiest .top-val { color: hsl(var(--destructive)); }
.bar-col.empty .top-val { color: hsl(var(--muted-foreground)); font-weight: 500; }
.bar-col.selected .bar-segs { box-shadow: 0 0 0 2px hsl(var(--foreground)); }
.bar-col .top-val small {
  display: block; font-family: var(--font-sans); font-size: 10px;
  font-weight: 500; color: hsl(var(--muted-foreground));
  letter-spacing: 0; margin-top: 1px; text-transform: uppercase;
}

/* X axis labels */
.x-axis { position: relative; margin-left: 56px; padding: 12px 4px 0; display: grid; gap: 10px; }
.x-tick {
  text-align: center;
  font-family: var(--font-mono); font-size: 10.5px;
  color: hsl(var(--muted-foreground)); line-height: 1.3;
}
.x-tick b { color: hsl(var(--foreground)); font-weight: 600; display: block; font-size: 11px; margin-bottom: 1px; }
.x-tick.this-week { background: hsl(var(--foreground)); color: hsl(var(--background)); border-radius: var(--radius-sm); padding: 2px 0; }
.x-tick.this-week b { color: hsl(var(--background)); }

/* Drill-down panel below chart */
.drilldown {
  display: grid; grid-template-columns: 280px 1fr; gap: 0;
  background: hsl(var(--muted) / 0.4);
  border-top: 1px solid hsl(var(--border));
}
.dd-summary {
  padding: 22px 26px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.dd-summary .dd-lbl {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: 0;
  text-transform: uppercase; color: hsl(var(--background) / 0.55);
}
.dd-summary .dd-week {
  font-family: var(--font-display); font-weight: 650; font-size: 24px;
  letter-spacing: -0.01em; color: hsl(var(--background));
  margin: 6px 0 4px; line-height: 1.1;
}
.dd-summary .dd-total {
  font-family: var(--font-display); font-weight: 650; font-size: 32px;
  color: hsl(var(--success)); letter-spacing: -0.02em;
  margin: 18px 0 4px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dd-summary .dd-meta {
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--background) / 0.65); line-height: 1.5;
}
.dd-summary .dd-meta b { color: hsl(var(--background)); font-weight: 600; }
.dd-summary .dd-action { margin-top: 16px; display: block; width: 100%; }

.dd-vendor-list { padding: 22px 26px; background: hsl(var(--card)); }
.dd-vendor-list h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: -0.005em; text-transform: none;
  color: hsl(var(--foreground)); margin: 0 0 14px;
}
.dd-ven {
  display: grid; grid-template-columns: 18px 1fr auto auto auto;
  gap: 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid hsl(var(--border));
}
.dd-ven:last-child { border-bottom: none; }
.dd-ven .sw { width: 14px; height: 14px; border-radius: var(--radius-sm); }
.dd-ven .name {
  font-family: var(--font-sans); font-weight: 600; font-size: 13.5px;
  color: hsl(var(--foreground)); letter-spacing: -0.005em;
}
.dd-ven .skus { font-family: var(--font-mono); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.dd-ven .amt {
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  color: hsl(var(--foreground)); font-variant-numeric: tabular-nums;
}
.dd-ven .action {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  color: hsl(var(--primary)); text-decoration: none;
  padding: 5px 10px; border: 1px solid hsl(var(--primary)); border-radius: var(--radius-sm);
  letter-spacing: 0;
}
.dd-ven .action:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.dd-empty {
  padding: 20px 0;
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--muted-foreground));
}

/* per-sku table — must-place-by emphasised */
.place-by {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: hsl(var(--destructive)); letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.place-by.future { color: hsl(var(--warning)); }
.place-by.ok { color: hsl(var(--success)); }
.place-by.outside { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 11.5px; }
.place-by small {
  display: block; font-family: var(--font-sans); font-size: 10.5px;
  font-weight: 500; color: hsl(var(--muted-foreground));
  letter-spacing: 0; margin-top: 1px; text-transform: uppercase;
}

/* ─── SNAPSHOTS · DRILLDOWN page primitives ──────────────────────────── */

/* Window picker — segmented inside title-window */
.window-picker {
  display: grid; gap: 8px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.wp {
  padding: 12px 8px; text-align: center;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  cursor: pointer; text-decoration: none; color: inherit; display: block;
  transition: background .12s ease, border-color .12s ease;
}
.wp:hover { border-color: hsl(var(--ring) / 0.5); }
.wp .wp-num {
  font-family: var(--font-display); font-weight: 650; font-size: 22px;
  color: hsl(var(--foreground)); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wp .wp-sub {
  font-family: var(--font-sans); font-size: 11px;
  letter-spacing: 0; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin-top: 4px;
}
.wp.active { background: hsl(var(--primary) / 0.1); border-color: hsl(var(--primary)); }
.wp.active .wp-num, .wp.active .wp-sub { color: hsl(var(--primary)); }

/* Source legend */
.src-legend {
  display: flex; align-items: center;
  background: hsl(var(--muted) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
  padding: 12px 22px; gap: 26px; flex-wrap: wrap;
}
.src-legend .lbl {
  font-family: var(--font-sans); font-size: 11px;
  letter-spacing: 0; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin-right: 8px;
}
.src-key {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 550; font-size: 12.5px;
  color: hsl(var(--foreground));
}
.src-key .swatch { width: 28px; height: 12px; border-radius: var(--radius-sm); }
.src-key .ct {
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground)); margin-left: 4px;
}

/* Source palette */
.s-dtc       { background: hsl(var(--success)); }
.s-wholesale { background: hsl(var(--warning)); }
.s-hub       { background: hsl(var(--info)); }

/* Time-series chart slab + chrome */
.ts-slab { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.ts-cap {
  padding: 16px 22px;
  background: hsl(var(--muted) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
  display: flex; align-items: baseline; gap: 14px;
}
.ts-cap h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 16px;
  letter-spacing: -0.01em; text-transform: none; margin: 0; color: hsl(var(--foreground));
}
.ts-cap .sub {
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; text-transform: none;
}
.ts-cap .right {
  margin-left: auto; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0; color: hsl(var(--muted-foreground));
}
.ts-cap .right b { color: hsl(var(--foreground)); font-weight: 600; }

.ts-wrap { padding: 24px 28px 8px; background: hsl(var(--card)); }

/* Chart grid layout */
.ts-stack {
  display: grid;
  grid-template-columns: 56px 1fr;
  grid-template-rows: 280px 14px 80px 24px;
  gap: 0;
}
.ts-axis-y, .ts-axis-y2 {
  position: relative;
  border-right: 1px solid hsl(var(--border));
}
.ts-axis-y { grid-column: 1; grid-row: 1; }
.ts-axis-y2 { grid-column: 1; grid-row: 3; }
.ts-axis-y .tick, .ts-axis-y2 .tick {
  position: absolute; right: 8px; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10.5px;
  color: hsl(var(--muted-foreground));
}

.ts-plot {
  grid-column: 2; grid-row: 1;
  position: relative;
  border-bottom: 1px solid hsl(var(--foreground));
}
.ts-plot .gridline { position: absolute; left: 0; right: 0; height: 1px; background: hsl(var(--border) / 0.6); }

.ts-cols { position: absolute; inset: 0; display: grid; gap: 1px; align-items: end; }
.ts-col {
  height: 100%;
  display: flex; flex-direction: column-reverse;
  position: relative;
}
.ts-col .seg-wrap { width: 100%; display: flex; flex-direction: column-reverse; }
.ts-col .seg { width: 100%; }
.ts-col .seg-avail { background: hsl(var(--success)); }
.ts-col .seg-resv  { background: hsl(var(--warning)); }
.ts-col.zero .seg-avail { background: hsl(var(--destructive)); }
.ts-col .diff-flag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid hsl(var(--foreground));
}
.ts-col:hover .seg-avail, .ts-col:hover .seg-resv { filter: brightness(1.15); }

/* Threshold marker */
.threshold-line { position: absolute; left: 0; right: 0; border-top: 2px dashed hsl(var(--destructive)); pointer-events: none; }
.threshold-line .lbl {
  position: absolute; left: 8px; top: -14px;
  background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground));
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0; text-transform: uppercase;
}

/* Today bar */
.today-line { position: absolute; top: -8px; bottom: -8px; width: 2px; background: hsl(var(--foreground)); z-index: 4; }
.today-line .lbl {
  position: absolute; top: -14px; left: 0; transform: translateX(-50%);
  background: hsl(var(--foreground)); color: hsl(var(--background));
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0;
  text-transform: uppercase; white-space: nowrap;
}

/* Orders strip */
.ts-gap { grid-column: 1 / 3; grid-row: 2; }
.ts-orders {
  grid-column: 2; grid-row: 3;
  position: relative;
  border-bottom: 1px solid hsl(var(--foreground));
}
.ts-orders .ts-cols { align-items: flex-end; }
.ts-orders .ts-col .seg-orders { background: hsl(var(--foreground)); }

/* X axis labels */
.ts-axis-x { grid-column: 2; grid-row: 4; display: grid; gap: 1px; padding-top: 10px; }
.ts-axis-x .x-lbl {
  font-family: var(--font-mono); font-size: 10.5px;
  color: hsl(var(--muted-foreground)); text-align: left;
}
.ts-axis-x .x-lbl b { color: hsl(var(--foreground)); font-weight: 600; }

.ts-orders-lbl {
  position: absolute; left: -42px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-sans); font-size: 10.5px; letter-spacing: 0;
  color: hsl(var(--muted-foreground)); text-transform: uppercase; line-height: 1.4;
}

/* Multi-source diff stripe per day */
.diff-stripe {
  position: absolute; top: 0; bottom: 0;
  background: hsl(var(--destructive) / 0.08);
  pointer-events: none;
  border-left: 1px solid hsl(var(--destructive) / 0.3);
  border-right: 1px solid hsl(var(--destructive) / 0.3);
}

/* Source comparison table */
.src-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-sans); font-size: 13px;
}
.src-table thead th {
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  font-family: var(--font-sans); font-weight: 600; font-size: 11px;
  letter-spacing: 0; text-transform: uppercase; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}
.src-table thead th.num { text-align: right; }
.src-table tbody td {
  padding: 10px 14px; border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle; color: hsl(var(--foreground));
}
.src-table tbody tr.diff td { background: hsl(var(--destructive) / 0.05); }
.src-table tbody tr:hover td { background: hsl(var(--muted) / 0.3); }
.src-table tbody tr.diff:hover td { background: hsl(var(--destructive) / 0.1); }
.src-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.src-cell {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 12.5px;
  color: hsl(var(--foreground)); letter-spacing: 0;
}
.src-cell .sw-mini { width: 12px; height: 12px; border-radius: var(--radius-sm); }

.delta {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}
.delta.up   { color: hsl(var(--success)); }
.delta.down { color: hsl(var(--destructive)); }
.delta.zero { color: hsl(var(--muted-foreground)); }

.flag-diff, .flag-recon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--font-sans); font-weight: 600; font-size: 10.5px;
  letter-spacing: 0; text-transform: uppercase;
}
.flag-diff { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); border: 1px solid hsl(var(--destructive) / 0.3); }
.flag-diff .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.flag-recon { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border: 1px solid hsl(var(--warning) / 0.3); }
.flag-recon .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* SKU header banner above the time-series chart */
.sku-banner {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 14px 22px;
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 18px; align-items: center;
}
.sku-banner .sb-thumb, .sku-banner .sb-thumb-img {
  width: 64px; height: 64px; border-radius: var(--radius-md);
}
.sku-banner .sb-thumb-img { object-fit: cover; display: block; }
.sku-banner .sb-thumb { background: hsl(var(--background) / 0.1); }
.sku-banner .sb-name {
  font-family: var(--font-display); font-weight: 650; font-size: 20px;
  letter-spacing: -0.01em;
}
.sku-banner .sb-code {
  font-family: var(--font-mono); font-size: 12px;
  color: hsl(var(--background) / 0.65); letter-spacing: 0; margin-top: 2px;
}
.sku-banner .sb-actions { display: flex; gap: 10px; }
.sku-banner .sb-actions a {
  color: hsl(var(--background) / 0.7); text-decoration: none;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  letter-spacing: 0; padding: 8px 14px;
  border: 1px solid hsl(var(--background) / 0.25); border-radius: var(--radius-md);
}
.sku-banner .sb-actions a:hover { color: hsl(var(--background)); border-color: hsl(var(--background) / 0.55); }

/* ─── SETTINGS page primitives ───────────────────────────────────────── */


/* 3-col knob grid */




/* Bool-knob control — checkbox styled to fit the knob row. */
.knob-toggle {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: hsl(var(--background));
  font-family: var(--font-mono); font-size: 13px;
  color: hsl(var(--foreground));
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.knob-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: hsl(var(--primary));
  cursor: pointer;
}


/* Bottom save bar */

/* ─── ACCOUNT page primitives ────────────────────────────────────────── */
.account-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 4px 4px; }
.account-avatar { width: 72px; height: 72px; font-size: 24px; letter-spacing: 0; }
.account-name {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  color: hsl(var(--foreground)); letter-spacing: -0.01em;
  text-align: center; line-height: 1.2;
}
.account-email {
  font-family: var(--font-mono); font-size: 11.5px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0;
  word-break: break-all; text-align: center;
}
.account-tags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }

/* Key/value readout strip used on account + similar admin pages */
.readout-block {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  min-height: 38px;
}
.readout-note {
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0;
  margin-left: auto; text-align: right;
}
.readout-value {
  font-family: var(--font-sans); font-weight: 550; font-size: 14px;
  color: hsl(var(--foreground)); letter-spacing: 0;
}
.readout-value.mono { font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; }
.readout-value.dim { color: hsl(var(--muted-foreground)); font-weight: 500; font-style: italic; }

/* ─── ADMIN · USERS page primitives ──────────────────────────────────── */
.audit-email, .cell-date {
  font-family: var(--font-mono); font-size: 11.5px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0;
}
.self-note {
  font-family: var(--font-sans); font-size: 11.5px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; font-style: italic;
}
.self-tag {
  display: inline-block;
  font-family: var(--font-sans); font-size: 10px; font-weight: 600;
  letter-spacing: 0;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  padding: 2px 7px; border-radius: 999px;
  margin-left: 8px; vertical-align: middle;
}

.tag-role {
  display: inline-flex; align-items: center;
  font-family: var(--font-sans); font-weight: 600; font-size: 11px;
  letter-spacing: 0; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
}
.tag-role.admin { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: hsl(var(--foreground)); }
.tag-role.user  { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

.tag-action {
  display: inline-block;
  font-family: var(--font-sans); font-weight: 600; font-size: 11px;
  letter-spacing: 0; text-transform: none;
  padding: 4px 10px; border-radius: var(--radius-md);
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  cursor: pointer;
}
.tag-action.approve, .tag-action.enable { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.tag-action.disable { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }
.tag-action.promote { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.tag-action.demote  { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.tag-action.reset_password { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.3); }

.user-actions-cell { vertical-align: middle; }
.user-actions { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.user-action-form { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.user-action-form.reset-pw {
  background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  padding: 3px 3px 3px 8px;
}
.user-action-form.reset-pw .btn.xs { border-left: 1px solid hsl(var(--border)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.pw-input {
  font-family: var(--font-mono); font-size: 12px;
  color: hsl(var(--foreground));
  background: transparent;
  border: none; outline: none;
  padding: 3px 4px; width: 130px;
  letter-spacing: 0;
}
.pw-input::placeholder { color: hsl(var(--muted-foreground)); font-size: 11px; letter-spacing: 0; }
.pw-input:focus { background: hsl(var(--background)); border-radius: var(--radius-sm); }

/* ─── BUNDLES page primitives ───────────────────────────────────────── */
.bundle-cell { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; }
.bundle-chip {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground));
  font-family: var(--font-display); font-weight: 650; font-size: 12px;
  letter-spacing: -0.005em; border-radius: var(--radius-md);
}
.bundle-chip.draft { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.bundle-chip.archived { background: hsl(var(--muted-foreground) / 0.2); color: hsl(var(--muted-foreground)); }
.bundle-chip.graveyard { background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }

.bundle-name {
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  color: hsl(var(--foreground)); letter-spacing: -0.005em;
  line-height: 1.2;
}
.bundle-code {
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground)); letter-spacing: 0; margin-top: 2px;
}
.bundle-link { color: inherit; text-decoration: none; display: block; }
.bundle-link:hover .bundle-name { color: hsl(var(--primary)); }

/* ─── SKU detail nav chevrons (prev/next row buttons) ────────────────── */
.sku-nav-chevrons { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* ─── VENDOR detail — sourced PO table + delete form ────────────────── */
.vendor-attrs { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }

.sourced-table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 12.5px; }
.sourced-table thead th {
  text-align: left;
  background: hsl(var(--muted) / 0.5); color: hsl(var(--muted-foreground));
  font-family: var(--font-sans); font-weight: 600; font-size: 11px;
  letter-spacing: 0; text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid hsl(var(--border));
}
.sourced-table thead th.num { text-align: right; }
.sourced-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
.sourced-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sourced-table tbody td .v { color: hsl(var(--foreground)); font-weight: 500; }
.sourced-table tbody td .sku-mini { display: flex; align-items: center; gap: 8px; }
.sourced-table tbody td .sku-mini .chip {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 650; font-size: 10px;
  color: hsl(var(--secondary-foreground)); background: hsl(var(--secondary));
  border-radius: var(--radius-sm);
}
.sourced-table tbody td .sku-mini .nm {
  font-family: var(--font-sans); font-weight: 600;
  color: hsl(var(--foreground)); letter-spacing: -0.005em;
  font-size: 12.5px; line-height: 1.2;
}
.sourced-table tbody td .sku-mini .nm small {
  display: block;
  font-family: var(--font-mono); font-size: 11px;
  color: hsl(var(--muted-foreground)); font-weight: 500;
  letter-spacing: 0; text-transform: none;
}
.sourced-foot {
  text-align: center; padding: 12px 8px;
  background: hsl(var(--muted) / 0.3);
  font-family: var(--font-sans); font-size: 12px;
  letter-spacing: 0; text-transform: none;
  color: hsl(var(--muted-foreground));
}
.sourced-foot a { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; }

.vendor-delete-form {
  margin: 14px 0 0;
  padding: 16px 18px;
  background: hsl(var(--destructive) / 0.06);
  border: 1px dashed hsl(var(--destructive) / 0.4);
  border-radius: var(--radius-md);
}
.vendor-delete-form .warn-text {
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--foreground)); line-height: 1.5;
}

/* ─── ABC report — A/C tag-bucket variants ──────────────────────────── */
.tag-bucket-a { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border: 1px solid hsl(var(--success) / 0.3); padding: 3px 10px; border-radius: 999px; font-family: var(--font-sans); font-weight: 600; font-size: 11px; letter-spacing: 0; }
.tag-bucket-a .pip { background: currentColor; }
.tag-bucket-c { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); border: 1px solid hsl(var(--border)); padding: 3px 10px; border-radius: 999px; font-family: var(--font-sans); font-weight: 600; font-size: 11px; letter-spacing: 0; }
.tag-bucket-c .pip { background: currentColor; }

/* ─── Filter-chip pip variants used across reports ──────────────────── */
.pip-amber { background: hsl(var(--warning)); }
.pip-moss  { background: hsl(var(--success)); }
.pip-rust  { background: hsl(var(--destructive)); }
.pip-slate { background: hsl(var(--muted-foreground)); }

/* ─── Legacy `.tag-status` shell (the bare class — tone modifiers like
   `.tag-crit / .tag-ok / .tag-warn / .tag-none / .tag-never` already
   in shell carry the tone backgrounds). Adds the base layout in case
   any template emits the bare `.tag-status` without a tone modifier. */
.tag-status {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--font-sans); font-weight: 600; font-size: 11px;
  letter-spacing: 0;
  border: 1px solid transparent;
}
.tag-status .pip { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; background: currentColor; }

/* ─── Ledger search input (used on a few list pages) ────────────────── */
.ledger-search {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius-md);
  color: hsl(var(--foreground));
  font-family: var(--font-sans); font-size: 13px;
  letter-spacing: 0;
  padding: 6px 10px;
  width: 220px;
  outline: none;
}
.ledger-search::placeholder { color: hsl(var(--muted-foreground)); letter-spacing: 0; text-transform: none; }
.ledger-search:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32); }


/* ──────────────────────────────────────────────────────────────────
   Marketing Calendar — FullCalendar v6 MIT mount + chrome
   (.mc-* surface — companion to MARKETING_CALENDAR_HANDOFF.md)

   STATUS SEMANTICS (load-bearing — handoff §"Behavior contract" #7):
     draft     → muted, dashed border, no fill        ("scratch")
     confirmed → brand-blue fill                      ("locked in")
     live      → success-green fill + soft glow       ("affecting forecast NOW")
     complete  → muted fill, strikethrough name       ("in the past")
   CATEGORY drives the swimlane row stripe + the Month-pill left-edge tick.
   ────────────────────────────────────────────────────────────────── */

/* ── Category accents (6 enum values; thin stripes / ticks / chip tints) ── */
:root {
  --mc-cat-sale:       262 70% 58%;   /* General Sale    — violet  */
  --mc-cat-launch:     199 85% 45%;   /* Product Launch  — sky     */
  --mc-cat-seasonal:   172 66% 40%;   /* Seasonal        — teal    */
  --mc-cat-email:       38 92% 50%;   /* Email           — amber   */
  --mc-cat-influencer: 322 68% 55%;   /* Influencer      — pink    */
  --mc-cat-colab:       92 55% 42%;   /* Colab           — olive   */

  /* Unified "today" marker (handoff open-Q5) — one primitive, both views */
  --mc-today: 222 47% 11%;            /* --foreground; a quiet ink line  */
}

/* ═══════════════════════════════════════════════════════════════════════
   TITLE SLAB  (reuses .slab.title-slab; .mc-title only relaxes the toolbar)
   ═══════════════════════════════════════════════════════════════════════ */
.title-slab.mc-title { grid-template-columns: 1.6fr 1fr; }
.title-slab.mc-title .title-window {
  display: flex; flex-direction: column;
  padding: 24px 26px;
}
.mc-window-legend { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.mc-legend-row {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
}
.mc-legend-row b { color: hsl(var(--foreground)); font-weight: 600; }
.mc-legend-swatch {
  width: 26px; height: 14px; flex: none; border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--border));
}
.mc-legend-swatch.status-draft     { background: repeating-linear-gradient(45deg, hsl(var(--muted)) 0 4px, hsl(var(--background)) 4px 8px); border: 1px dashed hsl(var(--muted-foreground) / 0.6); }
.mc-legend-swatch.status-confirmed { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.mc-legend-swatch.status-live      { background: hsl(var(--success)); border-color: hsl(var(--success)); box-shadow: 0 0 0 2px hsl(var(--success) / 0.18); }
.mc-legend-swatch.status-complete  { background: hsl(var(--muted)); border-color: hsl(var(--border)); }

/* ═══════════════════════════════════════════════════════════════════════
   TOOLBAR  (inside the title-window: view picker + "+ New event")
   ═══════════════════════════════════════════════════════════════════════ */
.mc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.mc-view-picker {
  display: inline-flex; align-items: center;
  padding: 3px; gap: 2px;
  background: hsl(var(--muted) / 0.7);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
}
.mc-view-picker button {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 550;
  color: hsl(var(--muted-foreground));
  padding: 5px 12px; border-radius: calc(var(--radius-md) - 2px);
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.mc-view-picker button:hover { color: hsl(var(--foreground)); }
.mc-view-picker button.active {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}
.mc-view-picker button:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }

#mc-new-event-btn { margin-left: auto; white-space: nowrap; }
#mc-new-event-btn svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════════════════════
   FILTER STRIP  (status group + category group, one row each)
   ═══════════════════════════════════════════════════════════════════════ */
.slab.mc-filters {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 18px;
}
.mc-filter-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mc-filter-label {
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  width: 74px; flex: none;
}
.mc-chip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.mc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  appearance: none; cursor: pointer;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  padding: 4px 11px; border-radius: 999px;
  line-height: 1.4;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.mc-chip:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mc-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }
.mc-chip .mc-chip-dot {
  width: 8px; height: 8px; flex: none; border-radius: 999px;
  background: hsl(var(--muted-foreground));
  box-shadow: inset 0 0 0 1px hsl(0 0% 0% / 0.06);
}
.mc-chip .mc-chip-ct {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: hsl(var(--muted-foreground)); margin-left: 1px;
}

/* Active chip — emphatic. "I am the active filter" must be obvious. */
.mc-chip.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.mc-chip.active .mc-chip-ct { color: hsl(var(--primary-foreground) / 0.8); }
.mc-chip.active .mc-chip-dot { box-shadow: inset 0 0 0 1px hsl(0 0% 100% / 0.4); }

/* Status-chip dots carry the status semantic colour */
.mc-chip[data-status="draft"]     .mc-chip-dot { background: hsl(var(--muted-foreground)); }
.mc-chip[data-status="confirmed"] .mc-chip-dot { background: hsl(var(--primary)); }
.mc-chip[data-status="live"]      .mc-chip-dot { background: hsl(var(--success)); }
.mc-chip[data-status="complete"]  .mc-chip-dot { background: hsl(var(--muted-foreground) / 0.55); }
/* When a status chip is active its dot inverts for contrast */
.mc-chip.active[data-status] .mc-chip-dot { background: hsl(var(--primary-foreground)); }

/* Category-chip dots carry the category accent */
.mc-chip[data-cat="sale"]       .mc-chip-dot { background: hsl(var(--mc-cat-sale)); }
.mc-chip[data-cat="launch"]     .mc-chip-dot { background: hsl(var(--mc-cat-launch)); }
.mc-chip[data-cat="seasonal"]   .mc-chip-dot { background: hsl(var(--mc-cat-seasonal)); }
.mc-chip[data-cat="email"]      .mc-chip-dot { background: hsl(var(--mc-cat-email)); }
.mc-chip[data-cat="influencer"] .mc-chip-dot { background: hsl(var(--mc-cat-influencer)); }
.mc-chip[data-cat="colab"]      .mc-chip-dot { background: hsl(var(--mc-cat-colab)); }

/* ═══════════════════════════════════════════════════════════════════════
   CALENDAR SLAB  (holds #marketing-calendar and #marketing-swimlane)
   ═══════════════════════════════════════════════════════════════════════ */
.slab.mc-calendar-slab { padding: 18px 20px 20px; }
.mc-swimlane[hidden], #marketing-calendar[hidden] { display: none !important; }

/* ── FullCalendar v6 token bridge — inherit Shadcn neutrals ──────────── */
#marketing-calendar {
  --fc-border-color:            hsl(var(--border));
  --fc-page-bg-color:           hsl(var(--card));
  --fc-neutral-bg-color:        hsl(var(--muted) / 0.4);
  --fc-today-bg-color:          hsl(var(--primary) / 0.05);
  --fc-event-border-color:      transparent;
  --fc-event-bg-color:          hsl(var(--primary));
  --fc-list-event-hover-bg-color: hsl(var(--muted) / 0.6);
  font-family: var(--font-sans);
}

/* Toolbar — month title + nav, restyled to the page rhythm */
#marketing-calendar .fc-toolbar.fc-header-toolbar { margin-bottom: 16px; }
#marketing-calendar .fc-toolbar-title {
  font-family: var(--font-display); font-weight: 650; font-size: 19px;
  letter-spacing: -0.01em; color: hsl(var(--foreground));
}
#marketing-calendar .fc-button {
  background: hsl(var(--background)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input)); box-shadow: var(--shadow-sm);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 550;
  text-transform: capitalize; padding: 5px 11px; height: 32px;
  border-radius: var(--radius-md); text-shadow: none;
}
#marketing-calendar .fc-button:not(:disabled):hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
#marketing-calendar .fc-button-primary:not(:disabled):active,
#marketing-calendar .fc-button-primary:not(:disabled).fc-button-active {
  background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
#marketing-calendar .fc-button:focus,
#marketing-calendar .fc-button:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }
#marketing-calendar .fc-button .fc-icon { font-size: 1.3em; vertical-align: -2px; }
#marketing-calendar .fc-today-button:disabled { opacity: 0.5; }

/* Month grid chrome */
#marketing-calendar .fc-theme-standard td,
#marketing-calendar .fc-theme-standard th { border-color: hsl(var(--border)); }
#marketing-calendar .fc-theme-standard .fc-scrollgrid { border-color: hsl(var(--border)); border-radius: var(--radius-md); overflow: hidden; }
#marketing-calendar .fc-col-header-cell {
  background: hsl(var(--muted) / 0.5); padding: 8px 0;
}
#marketing-calendar .fc-col-header-cell-cushion {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); padding: 4px 8px; text-decoration: none;
}
#marketing-calendar .fc-daygrid-day-number {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: hsl(var(--muted-foreground)); padding: 6px 8px; text-decoration: none;
}
#marketing-calendar .fc-day-other .fc-daygrid-day-number { color: hsl(var(--muted-foreground) / 0.45); }
#marketing-calendar .fc-day-today { background: hsl(var(--primary) / 0.05) !important; }
#marketing-calendar .fc-day-today .fc-daygrid-day-number {
  color: hsl(var(--primary)); font-weight: 700;
}

/* ── EVENT PILL (Month) — Badge stretched across days ───────────────── */
#marketing-calendar .fc-daygrid-event {
  margin: 1px 3px 2px; padding: 0;
  border: none; background: transparent;
}
#marketing-calendar .fc-event { border-radius: var(--radius-sm); }
.mc-pill {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 550;
  line-height: 1.3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  cursor: pointer;
}
/* category left-edge tick — colour comes from the event's category
   (--mc-cat), never an operator pick. The Month pill is far shorter than
   the swimlane bar, so it needs a wider band (9px) to read the category
   at a glance; the pill's left padding is widened to match so the band
   doesn't crowd the label. */
.mc-pill::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 9px;
  background: var(--mc-cat, hsl(var(--muted-foreground)));
}
/* title shrinks first (min-width:0) so the assignee name stays visible */
.mc-pill .mc-pill-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mc-pill .mc-pill-mult {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  opacity: 0.75; flex: none;
}

/* Assignee "at a glance" — the assigned person's name, shown on the
   event bar. Sizing differs per view; category colour stays the pill/bar
   accent, this is just the name. */
.mc-pill-who {
  flex: none;
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 500;
  opacity: 0.85; white-space: nowrap;
}
.mc-bar-who { font-family: var(--font-sans); font-weight: 600; }
.mc-assignee-chip {
  font-family: var(--font-sans); font-size: 11px; font-weight: 550;
  color: hsl(var(--muted-foreground)); white-space: nowrap;
}

/* status fills (shared by Month pill via .fc-event.status-*) */
.fc-event.status-draft .mc-pill,
.mc-pill.status-draft {
  background: hsl(var(--background)); color: hsl(var(--muted-foreground));
  box-shadow: inset 0 0 0 1px hsl(var(--border));
  border: 1px dashed hsl(var(--muted-foreground) / 0.55);
  padding-left: 13px;
}
.fc-event.status-confirmed .mc-pill,
.mc-pill.status-confirmed {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.fc-event.status-live .mc-pill,
.mc-pill.status-live {
  background: hsl(var(--success)); color: hsl(var(--success-foreground));
  box-shadow: 0 0 0 1px hsl(var(--success) / 0.4), 0 0 10px hsl(var(--success) / 0.45);
}
.fc-event.status-complete .mc-pill,
.mc-pill.status-complete {
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
}
.fc-event.status-complete .mc-pill .mc-pill-name,
.mc-pill.status-complete .mc-pill-name { text-decoration: line-through; text-decoration-thickness: 1px; }

#marketing-calendar .fc-event:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); border-radius: var(--radius-sm); }
#marketing-calendar .fc-event.fc-event-dragging { opacity: 0.9; box-shadow: var(--shadow-md); }

/* "+N more" link */
#marketing-calendar .fc-daygrid-more-link {
  font-family: var(--font-sans); font-size: 11px; font-weight: 550;
  color: hsl(var(--primary)); padding: 1px 6px;
}
#marketing-calendar .fc-popover {
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); background: hsl(var(--card));
}
#marketing-calendar .fc-popover-header { background: hsl(var(--muted) / 0.6); font-family: var(--font-sans); font-weight: 600; }

/* Quarter (90-day) grid — the generic 3-month dayGrid floors every week row
   at ~103px where dayGridMonth floors at 74px, so empty weeks sat too tall.
   Strip the oversized floor off the row / cell / events, then re-impose the
   Month view's measured 74px floor on the cell frame so an empty Quarter week
   is exactly as tall as an empty Month week (and busy weeks still grow past
   it). `.mc-quarter-grid` is toggled onto #marketing-calendar by setView();
   Month is untouched. */
#marketing-calendar.mc-quarter-grid .fc-daygrid-body tr,
#marketing-calendar.mc-quarter-grid .fc-daygrid-day,
#marketing-calendar.mc-quarter-grid .fc-daygrid-day-events {
  height: auto !important;
  min-height: 0 !important;
}
#marketing-calendar.mc-quarter-grid .fc-daygrid-day-frame {
  height: auto !important;
  min-height: 74px !important;
}

/* ── LIST VIEW — denser; date-range chip replaces the time cell ──────── */
#marketing-calendar .fc-list { border-color: hsl(var(--border)); border-radius: var(--radius-md); overflow: hidden; }
#marketing-calendar .fc-list-day-cushion {
  background: hsl(var(--muted) / 0.5);
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  color: hsl(var(--foreground));
}
#marketing-calendar .fc-list-day-cushion .fc-list-day-text,
#marketing-calendar .fc-list-day-cushion .fc-list-day-side-text { text-decoration: none; color: inherit; }
#marketing-calendar .fc-list-event { cursor: pointer; }
#marketing-calendar .fc-list-event:hover td { background: hsl(var(--muted) / 0.6); }
#marketing-calendar .fc-list-event td { border-color: hsl(var(--border)); padding: 10px 14px; vertical-align: middle; }
/* hide FC's native time + dot graphic — we render our own chips */
#marketing-calendar .fc-list-event-time { display: none; }
#marketing-calendar .fc-list-event-graphic { width: 0; padding: 0; }
#marketing-calendar .fc-list-event-title { width: 100%; }
.mc-list-row { display: flex; align-items: center; gap: 12px; }
.mc-list-cat-tick { width: 6px; height: 26px; flex: none; border-radius: 999px; background: var(--mc-cat, hsl(var(--muted-foreground))); }
.mc-list-name { font-family: var(--font-sans); font-size: 13.5px; font-weight: 550; color: hsl(var(--foreground)); }
.mc-list-name.is-complete { text-decoration: line-through; color: hsl(var(--muted-foreground)); }
.mc-list-cat { font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.mc-list-meta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mc-range-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border));
  padding: 3px 9px; border-radius: var(--radius-sm); white-space: nowrap;
}
.mc-mult-chip {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--border));
  padding: 3px 8px; border-radius: var(--radius-sm);
}

/* status badge reused in list + detail + swimlane tooltip */
.mc-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; letter-spacing: 0.01em; white-space: nowrap;
}
.mc-status .mc-status-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.mc-status.status-draft     { background: hsl(var(--background)); color: hsl(var(--muted-foreground)); border: 1px dashed hsl(var(--muted-foreground) / 0.55); }
.mc-status.status-confirmed { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.mc-status.status-live      { background: hsl(var(--success) / 0.14); color: hsl(var(--success)); box-shadow: 0 0 0 1px hsl(var(--success) / 0.2); }
.mc-status.status-complete  { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

/* ═══════════════════════════════════════════════════════════════════════
   SWIMLANE  (hand-rolled CSS Grid — the real planning view)
   ═══════════════════════════════════════════════════════════════════════ */
.mc-swimlane { display: block; }
.mc-swimlane[hidden] { display: none; }

.mc-swimlane-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.mc-swim-nav-group { display: inline-flex; gap: 4px; }
[data-mc-swim-range] {
  font-family: var(--font-display); font-weight: 650; font-size: 16px;
  letter-spacing: -0.01em; color: hsl(var(--foreground));
  margin-left: 2px;
}
.mc-swim-spring { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mc-swim-zoom-label { font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground)); }
[data-mc-swim-zoom-select] {
  appearance: none; font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  color: hsl(var(--foreground)); background: hsl(var(--background));
  border: 1px solid hsl(var(--input)); border-radius: var(--radius-md);
  padding: 6px 28px 6px 11px; height: 32px; cursor: pointer; box-shadow: var(--shadow-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
[data-mc-swim-zoom-select]:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }

/* The grid: label column + body column */
.mc-swim-grid {
  display: grid; grid-template-columns: 168px 1fr;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  overflow: hidden; background: hsl(var(--card));
  position: relative;
}
.mc-swim-corner {
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border)); border-right: 1px solid hsl(var(--border));
  padding: 8px 14px;
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--muted-foreground));
  display: flex; align-items: center;
}
/* header tick row spanning the body */
.mc-swim-header {
  position: relative; height: 37px;
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
  overflow: hidden;
}
.mc-swim-tick {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px solid hsl(var(--border));
  padding: 9px 0 0 7px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  color: hsl(var(--muted-foreground)); white-space: nowrap;
}
.mc-swim-tick.is-first { border-left: none; }

/* category rows */
.mc-swim-row-label {
  position: relative;
  border-right: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 14px 0 22px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 64px; background: hsl(var(--card));
  cursor: pointer; transition: background 0.12s ease;
  text-align: left; appearance: none; font: inherit; color: inherit; width: 100%;
}
.mc-swim-row-label::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: var(--mc-cat, hsl(var(--muted-foreground)));
}
.mc-swim-row-label:hover { background: hsl(var(--muted) / 0.45); }
.mc-swim-row-label:focus-visible { outline: none; box-shadow: inset 0 0 0 2px hsl(var(--ring) / 0.5); }
.mc-swim-row-label .mc-row-name {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: hsl(var(--foreground));
}
.mc-swim-row-label .mc-row-ct {
  font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground));
}
.mc-swim-row-label.dimmed { opacity: 0.4; }
.mc-swim-row-label .mc-row-filter-hint {
  font-family: var(--font-sans); font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: hsl(var(--primary)); opacity: 0; transition: opacity 0.12s ease;
}
.mc-swim-row-label:hover .mc-row-filter-hint { opacity: 1; }
.mc-swim-row-label.active-filter { background: hsl(var(--primary) / 0.06); }
.mc-swim-row-label.active-filter .mc-row-filter-hint { opacity: 1; color: hsl(var(--primary)); }

.mc-swim-row-body {
  position: relative; min-height: 64px;
  border-bottom: 1px solid hsl(var(--border));
  background-image: linear-gradient(hsl(var(--border) / 0.5) 0, hsl(var(--border) / 0.5) 0);
  overflow: hidden;
}
/* faint vertical gridlines mirroring header ticks (set via JS as inline bg) */
.mc-swim-row-body .mc-swim-gridline {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: hsl(var(--border) / 0.6);
}

/* ── SWIMLANE BAR — heavier sibling of the event pill ───────────────── */
.mc-swim-bar {
  position: absolute; top: 12px; height: 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  cursor: grab; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.12s ease, transform 0.06s ease;
  user-select: none;
}
.mc-swim-bar:active { cursor: grabbing; }
.mc-swim-bar:hover { box-shadow: var(--shadow-md); z-index: 5; }
.mc-swim-bar:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.45); z-index: 6; }
.mc-swim-bar .mc-bar-name {
  font-family: var(--font-sans); font-size: 12px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-swim-bar .mc-bar-meta {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; line-height: 1.2;
  white-space: nowrap; overflow: hidden;
}
/* left accent edge carries the category, fill carries the status. Width
   is sized to read at zoom-out (180/365 day windows) without dominating
   the bar's status fill — at 7px the category is unmissable. */
.mc-swim-bar::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 7px;
  background: var(--mc-cat, hsl(var(--muted-foreground)));
}
.mc-swim-bar { padding-left: 14px; }
.mc-swim-bar.is-narrow { padding-left: 9px; }
.mc-swim-bar.status-draft {
  background: hsl(var(--background)); color: hsl(var(--muted-foreground));
  border: 1px dashed hsl(var(--muted-foreground) / 0.55); box-shadow: none;
}
.mc-swim-bar.status-draft .mc-bar-name { color: hsl(var(--foreground)); }
.mc-swim-bar.status-confirmed {
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground) / 0.85);
}
.mc-swim-bar.status-confirmed .mc-bar-name { color: hsl(var(--primary-foreground)); }
.mc-swim-bar.status-live {
  background: hsl(var(--success)); color: hsl(var(--success-foreground) / 0.85);
  box-shadow: 0 0 0 1px hsl(var(--success) / 0.4), 0 0 12px hsl(var(--success) / 0.4);
}
.mc-swim-bar.status-live .mc-bar-name { color: hsl(var(--success-foreground)); }
.mc-swim-bar.status-complete {
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)); box-shadow: none;
}
.mc-swim-bar.status-complete .mc-bar-name { text-decoration: line-through; text-decoration-thickness: 1px; }
/* at zoom-out, single-day bars collapse to a dot-ish chip — keep readable */
.mc-swim-bar.is-narrow { padding: 4px 6px; }
.mc-swim-bar.is-narrow .mc-bar-meta { display: none; }
.mc-swim-bar.is-narrow .mc-bar-name { font-size: 11px; }

/* ── unified TODAY marker (open-Q5) — vertical line, both views ──────── */
.mc-swim-today {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 2px solid hsl(var(--mc-today));
  z-index: 7; pointer-events: none;
}
.mc-swim-today::before {
  content: 'TODAY'; position: absolute; top: -1px; left: 3px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
  color: hsl(var(--background)); background: hsl(var(--mc-today));
  padding: 2px 5px; border-radius: 0 0 var(--radius-sm) 0; white-space: nowrap;
}
/* Month: same primitive as a thin accent line down the today column */
#marketing-calendar .fc-day-today { box-shadow: inset 2px 0 0 0 hsl(var(--mc-today)); }

.mc-swim-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: hsl(var(--card) / 0.7); pointer-events: none; z-index: 8;
}
.mc-swim-empty .mc-empty-title { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); }
.mc-swim-empty .mc-empty-sub { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); }

.mc-swim-hint {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
}
.mc-swim-hint svg { width: 14px; height: 14px; flex: none; }
.mc-swim-hint .mc-readonly-note { margin-left: auto; color: hsl(var(--warning)); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════════
   SLIDE-OVER DETAIL PANEL
   ═══════════════════════════════════════════════════════════════════════ */
.mc-detail-shade {
  position: fixed; inset: 0; z-index: 80;
  background: hsl(222 47% 11% / 0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0.2s ease;
}
.mc-detail-shade.open { opacity: 1; visibility: visible; }
.mc-detail-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: 420px; max-width: 92vw;
  background: hsl(var(--card)); border-left: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md);
  transform: translateX(100%); transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column;
}
.mc-detail-panel.open { transform: translateX(0); }
.mc-detail-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); color: hsl(var(--muted-foreground)); cursor: pointer;
}
.mc-detail-close:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mc-detail-close:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }
.mc-detail-body { flex: 1; overflow-y: auto; }
.mc-detail-loading, .mc-detail-error {
  padding: 26px;
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--muted-foreground));
}
.mc-detail-error { color: hsl(var(--destructive)); }

.mc-detail-card { padding: 26px 26px 22px; }
.mc-detail-head { padding-right: 36px; margin-bottom: 22px; }
.mc-detail-category {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--muted-foreground));
  margin-bottom: 10px;
}
.mc-detail-category .mc-cat-dot { width: 9px; height: 9px; border-radius: 999px; background: var(--mc-cat, hsl(var(--muted-foreground))); }
.mc-detail-title {
  font-family: var(--font-display); font-weight: 650; font-size: 22px; line-height: 1.2;
  letter-spacing: -0.01em; color: hsl(var(--foreground)); margin: 0 0 12px;
}

.mc-detail-kv { display: grid; grid-template-columns: 96px 1fr; gap: 0; margin-top: 4px; }
.mc-detail-kv dt {
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
  padding: 11px 0; border-top: 1px solid hsl(var(--border));
}
.mc-detail-kv dd {
  margin: 0; padding: 11px 0; border-top: 1px solid hsl(var(--border));
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--foreground)); text-align: right;
}
.mc-detail-kv dd.mono { font-family: var(--font-mono); }
.mc-detail-kv .mc-scope-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px;
  background: hsl(var(--muted) / 0.7); border: 1px solid hsl(var(--border));
  padding: 2px 8px; border-radius: var(--radius-sm); color: hsl(var(--foreground));
}
.mc-detail-notes {
  margin-top: 16px; padding: 13px 14px;
  background: hsl(var(--muted) / 0.4); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.55; color: hsl(var(--foreground)); text-wrap: pretty;
}
.mc-detail-notes .mc-notes-label {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin-bottom: 6px;
}
.mc-detail-owner {
  margin-top: 16px; font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground));
}
.mc-detail-owner b { color: hsl(var(--foreground)); font-weight: 550; }

.mc-detail-actions {
  display: flex; gap: 8px; padding: 16px 26px; flex-wrap: wrap;
  border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.3);
}
/* min-width lets the row wrap to a second line rather than squishing
   labels when all four actions show (Confirm + Edit + Duplicate +
   Delete on a Draft event). */
.mc-detail-actions .btn { flex: 1 1 auto; min-width: 88px; white-space: nowrap; }
.mc-detail-actions .mc-delete { margin-left: auto; flex: 0 0 auto; }

/* Inline "Set status" control above the action row. */
.mc-detail-status-set {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-top: 1px solid hsl(var(--border));
}
.mc-detail-status-set-label {
  font-family: var(--font-sans); font-size: 12px; font-weight: 550;
  color: hsl(var(--muted-foreground)); white-space: nowrap;
}
.mc-status-select {
  flex: 1; padding: 7px 10px;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 13px; font-weight: 550;
  color: hsl(var(--foreground)); cursor: pointer;
}
.mc-status-select:focus {
  outline: none; border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   CREATE MODAL (native <dialog>)
   ═══════════════════════════════════════════════════════════════════════ */
dialog.mc-modal {
  width: 640px; max-width: 94vw;
  max-height: 90vh; padding: 0; border: none;
  background: hsl(var(--card)); color: hsl(var(--foreground));
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  /* Honour the native <dialog> default — only render when [open] is
     set (showModal()/show() add the attribute). Setting display
     unconditionally would leak the form onto the page at first paint. */
  overflow: hidden;
}
/* Only the [open] selector flips to flex; the bare dialog stays
   display:none per the browser default. */
dialog.mc-modal[open] { display: flex; flex-direction: column; }
dialog.mc-modal form { display: flex; flex-direction: column; overflow: hidden; min-height: 0; flex: 1; }
.mc-modal-body { flex: 1; overflow-y: auto; min-height: 0; }
dialog.mc-modal::backdrop { background: hsl(222 47% 11% / 0.45); }
.mc-modal-body { padding: 22px 24px 20px; }
.mc-modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.mc-modal-head h2 {
  font-family: var(--font-display); font-weight: 650; font-size: 18px; letter-spacing: -0.01em;
  margin: 0; color: hsl(var(--foreground));
}
.mc-modal-head p { margin: 3px 0 0; font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.mc-modal-close {
  margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: var(--radius-md);
  color: hsl(var(--muted-foreground)); cursor: pointer; flex: none;
}
.mc-modal-close:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.mc-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.mc-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mc-field.span-2 { grid-column: 1 / -1; }
.mc-field > span {
  font-family: var(--font-sans); font-size: 12px; font-weight: 550; color: hsl(var(--foreground));
}
.mc-field > span .req { color: hsl(var(--destructive)); margin-left: 1px; }
.mc-field input, .mc-field select, .mc-field textarea {
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); padding: 0 11px; height: 36px; width: 100%;
}
.mc-field textarea { height: auto; min-height: 64px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.mc-field select {
  appearance: none; cursor: pointer; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
.mc-field input:focus, .mc-field select:focus, .mc-field textarea:focus {
  outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.3);
}
.mc-field [data-mc-scope-hint] {
  font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground)); min-height: 14px;
}
.mc-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   CAMPAIGN-SHAPE EXTENSIONS (migration 0017 — assignee, channels,
   focus/goal, link cards, attachments)
   ═══════════════════════════════════════════════════════════════════════ */

/* Slide-over: assignee chip + sectioned prose blocks */
.mc-detail-head-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.mc-detail-assignee {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 550;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border));
  padding: 2px 8px 2px 7px; border-radius: 999px;
}
.mc-detail-assignee svg { opacity: 0.7; }

.mc-detail-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid hsl(var(--border));
}
.mc-detail-section-label {
  display: block;
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}
.mc-detail-prose {
  font-family: var(--font-sans); font-size: 13px; line-height: 1.55;
  color: hsl(var(--foreground)); white-space: pre-wrap; text-wrap: pretty;
}

/* Channel chips — used in both the slide-over and the detail KV grid */
.mc-channel-chips {
  display: inline-flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end;
}
.mc-channel-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--primary) / 0.1); border: 1px solid hsl(var(--primary) / 0.25);
  padding: 1px 8px; border-radius: 999px;
}

/* Link cards (Klaviyo / Assets / Article) */
.mc-detail-links {
  display: flex; flex-direction: column; gap: 6px;
}
.mc-link-card {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 550;
  color: hsl(var(--foreground));
  text-decoration: none;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  padding: 8px 12px; border-radius: var(--radius-md);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.mc-link-card svg { color: hsl(var(--muted-foreground)); flex: none; }
.mc-link-card:hover {
  background: hsl(var(--muted) / 0.4); border-color: hsl(var(--ring) / 0.5);
}
.mc-link-card:focus-visible {
  outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.35);
}

/* Attachments list + upload zone */
.mc-attachments {
  display: flex; flex-direction: column; gap: 6px;
}
.mc-attach-loading, .mc-attach-empty {
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
  margin: 0; padding: 6px 2px;
}
.mc-attach-empty { font-style: italic; }
.mc-attachment-row {
  display: flex; align-items: center; gap: 10px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  padding: 8px 10px; border-radius: var(--radius-md);
}
.mc-attachment-row svg { color: hsl(var(--muted-foreground)); flex: none; }
.mc-attachment-row .mc-attach-name {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 550;
  color: hsl(var(--foreground));
  text-decoration: none; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mc-attachment-row .mc-attach-name:hover { text-decoration: underline; }
.mc-attachment-row .mc-attach-size {
  font-family: var(--font-mono); font-size: 10.5px;
  color: hsl(var(--muted-foreground)); flex: none;
}
.mc-attachment-row .mc-attach-delete {
  background: transparent; border: none; cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 4px; border-radius: var(--radius-sm); display: grid; place-items: center;
}
.mc-attachment-row .mc-attach-delete:hover {
  background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive));
}
.mc-attach-upload {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 2px;
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.4);
  border: 1px dashed hsl(var(--border));
  padding: 14px; border-radius: var(--radius-md);
  cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease;
}
.mc-attach-upload:hover {
  background: hsl(var(--muted) / 0.6); border-color: hsl(var(--ring) / 0.5);
  color: hsl(var(--foreground));
}
.mc-attach-upload.is-uploading { opacity: 0.6; pointer-events: none; }
.mc-attach-upload input[type="file"] { display: none; }

/* Channel multi-select input (inside the create/edit modal) */
.mc-chan-input {
  display: flex; flex-direction: column; gap: 6px;
}
.mc-chan-selected {
  display: flex; flex-wrap: wrap; gap: 5px; min-height: 8px;
}
.mc-chan-selected .mc-chan-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--primary) / 0.1); border: 1px solid hsl(var(--primary) / 0.25);
  padding: 2px 4px 2px 9px; border-radius: 999px;
}
.mc-chan-selected .mc-chan-pill button {
  background: transparent; border: none; padding: 0;
  color: hsl(var(--muted-foreground)); cursor: pointer;
  width: 18px; height: 18px; border-radius: 999px;
  display: grid; place-items: center; line-height: 1; font-size: 14px;
}
.mc-chan-selected .mc-chan-pill button:hover {
  background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive));
}

/* ═══════════════════════════════════════════════════════════════════════
   STORAGE / SPACES DRY-RUN BANNER  (top of /marketing/calendar when the
   Spaces wrapper is in fallback mode — see storage/spaces.py::is_dry_run)
   ═══════════════════════════════════════════════════════════════════════ */
.mc-storage-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  background: hsl(var(--warning) / 0.12);
  border: 1px solid hsl(var(--warning) / 0.4);
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 13px; line-height: 1.5;
  color: hsl(var(--foreground));
}
.mc-storage-banner svg { color: hsl(var(--warning)); flex: none; margin-top: 2px; }
.mc-storage-banner strong { color: hsl(var(--warning)); font-weight: 650; }
.mc-storage-banner code {
  font-family: var(--font-mono); font-size: 11.5px;
  background: hsl(var(--muted) / 0.7); border: 1px solid hsl(var(--border));
  padding: 1px 5px; border-radius: var(--radius-sm);
}
.mc-storage-banner em { color: hsl(var(--muted-foreground)); font-style: normal; }

/* ═══════════════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════════════ */
.mc-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  z-index: 90; display: flex; align-items: center; gap: 9px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: hsl(var(--destructive-foreground));
  background: hsl(var(--destructive)); padding: 10px 16px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.mc-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.mc-toast.ok { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.mc-toast svg { width: 16px; height: 16px; flex: none; }


/* ═══════════════════════════════════════════════════════════════════════
   CATALOGS ADMIN  (.catalog-* surface) — Claude Design handoff (869841).
   Companion to CATALOGS_ADMIN_HANDOFF.md. The list/new/edit pages are
   otherwise built from existing /vendors + Settings classes; these are the
   genuinely-new primitives + tiny deltas.
   ═══════════════════════════════════════════════════════════════════════ */

/* NEW #1 — source-tag pill: a catalog IS a Shopify tag, so it reads as one. */
.catalog-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.7);
  border: 1px solid hsl(var(--border));
  padding: 2px 9px 2px 7px; border-radius: var(--radius-sm);
  letter-spacing: 0; line-height: 1.5; white-space: nowrap;
}
.catalog-tag svg { width: 11px; height: 11px; flex: none; color: hsl(var(--muted-foreground)); }
.catalog-tag.none { background: transparent; color: hsl(var(--muted-foreground) / 0.7); border-style: dashed; }

/* NEW #2 — exclude-from-reports state badge: the page's load-bearing semantic. */
.catalog-exclude-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; line-height: 1.45; white-space: nowrap;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}
.catalog-exclude-badge .pip { width: 6px; height: 6px; flex: none; border-radius: 999px; background: currentColor; }
.catalog-exclude-badge svg { width: 12px; height: 12px; flex: none; }
.catalog-exclude-badge.is-excluded {
  background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.3);
}

/* The exclude toggle reuses the .knob-toggle markup but renders as a sliding
   switch — SCOPED to .exclude-field so the Settings page's native-checkbox
   .knob-toggle (a different control entirely) is untouched. On = warning
   register, matching the badge. */
.exclude-field .knob-toggle {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 11px;
  padding: 0 0 0 46px; min-height: 24px; background: transparent;
  cursor: pointer; user-select: none;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: hsl(var(--foreground));
}
.exclude-field .knob-toggle input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.exclude-field .knob-toggle::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 38px; height: 22px; border-radius: 999px;
  background: hsl(var(--muted)); border: 1px solid hsl(var(--border));
  transition: background 0.15s ease, border-color 0.15s ease;
}
.exclude-field .knob-toggle::after {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 999px;
  background: hsl(var(--background)); box-shadow: var(--shadow-sm);
  transition: left 0.15s cubic-bezier(0.32, 0.72, 0, 1);
}
.exclude-field .knob-toggle:has(input:checked)::before { background: hsl(var(--warning)); border-color: hsl(var(--warning)); }
.exclude-field .knob-toggle:has(input:checked)::after { left: 19px; }
.exclude-field .knob-toggle:has(input:focus-visible)::before { box-shadow: 0 0 0 3px hsl(var(--ring) / 0.35); }

/* Required hint banner — system-managed catalogs notice. */
.catalog-hint {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 15px;
  background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5;
  color: hsl(var(--muted-foreground)); text-wrap: pretty;
}
.catalog-hint svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: hsl(var(--muted-foreground)); }
.catalog-hint b { color: hsl(var(--foreground)); font-weight: 600; }

/* List — deltas on the reused ledger. */
.catalog-name-cell { display: flex; flex-direction: column; gap: 2px; }
.catalog-name-cell .cn {
  font-family: var(--font-sans); font-weight: 550; font-size: 13.5px;
  letter-spacing: -0.005em; color: hsl(var(--foreground)); line-height: 1.25;
}
.catalog-link { text-decoration: none; color: inherit; display: block; }
.catalog-link:hover .catalog-name-cell .cn { color: hsl(var(--primary)); }
.catalog-name-cell .cs { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.catalog-name-cell .cs .pre { color: hsl(var(--muted-foreground) / 0.6); }
.catalog-members { display: flex; flex-direction: column; gap: 1px; align-items: flex-end; }
.catalog-members .cm-val { font-family: var(--font-mono); font-weight: 500; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.catalog-members .cm-val.zero { color: hsl(var(--muted-foreground)); }
.catalog-members .cm-sub { font-family: var(--font-sans); font-size: 10.5px; font-weight: 400; color: hsl(var(--warning)); white-space: nowrap; }
.catalog-go {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  color: hsl(var(--primary)); text-decoration: none; white-space: nowrap;
}
.catalog-go svg { width: 13px; height: 13px; }
.catalog-go:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Row-level delete on the directory — quick delete without opening Edit.
   Quiet trash icon that warms to the destructive register on hover. */
.catalog-row-actions { display: inline-flex; align-items: center; gap: 16px; justify-content: flex-end; }
.catalog-row-del-form { display: inline-flex; margin: 0; }
.catalog-row-delete {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: hsl(var(--muted-foreground)); cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.catalog-row-delete svg { width: 14px; height: 14px; }
.catalog-row-delete:hover {
  color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.08);
  border-color: hsl(var(--destructive) / 0.25);
}

/* Form — slug field affordance + delete zone. */
.slug-control { display: flex; align-items: stretch; }
.slug-control .slug-prefix {
  display: inline-flex; align-items: center; padding: 0 4px 0 11px;
  font-family: var(--font-mono); font-size: 12.5px; color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--input)); border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md); white-space: nowrap;
}
.slug-control input { border-radius: 0 var(--radius-md) var(--radius-md) 0 !important; font-family: var(--font-mono) !important; }
.slug-auto-note { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-sans); font-size: 11px; color: hsl(var(--primary)); }
.slug-auto-note svg { width: 12px; height: 12px; }
.exclude-field {
  grid-column: 1 / -1;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 15px 16px; background: hsl(var(--muted) / 0.4);
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
}
.exclude-field.on { background: hsl(var(--warning) / 0.07); border-color: hsl(var(--warning) / 0.3); }
.exclude-field .ef-copy { max-width: 460px; }
.exclude-field .ef-title { font-family: var(--font-sans); font-size: 13px; font-weight: 550; color: hsl(var(--foreground)); }
.exclude-field .ef-help { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.45; margin-top: 4px; }
.exclude-field .ef-help b { color: hsl(var(--foreground)); font-weight: 550; }
.catalog-delete-zone {
  display: flex; align-items: center; gap: 18px; padding: 16px 22px;
  border-top: 1px solid hsl(var(--border)); background: hsl(var(--destructive) / 0.03);
}
.catalog-delete-zone .warn-text { font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5; color: hsl(var(--muted-foreground)); text-wrap: pretty; flex: 1; }
.catalog-delete-zone .warn-text b { color: hsl(var(--foreground)); font-weight: 600; }
.catalog-delete-zone .btn.rust { flex: none; }

/* Validation error line (new — the shell has no .field .error yet). */
.field .error { font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: hsl(var(--destructive)); display: flex; align-items: center; gap: 5px; }
.field .error svg { width: 13px; height: 13px; flex: none; }
.field input.invalid { border-color: hsl(var(--destructive)); }
.field input.invalid:focus { box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.25); }

/* Empty first-run state. */
.catalog-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 28px 60px; gap: 8px; }
.catalog-empty .ce-icon {
  width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 8px;
  background: hsl(var(--muted) / 0.7); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg); color: hsl(var(--muted-foreground));
}
.catalog-empty .ce-icon svg { width: 24px; height: 24px; }
.catalog-empty h3 { font-family: var(--font-display); font-weight: 650; font-size: 18px; letter-spacing: -0.01em; color: hsl(var(--foreground)); margin: 0; }
.catalog-empty p { font-family: var(--font-sans); font-size: 13px; line-height: 1.55; color: hsl(var(--muted-foreground)); margin: 0; max-width: 440px; text-wrap: pretty; }
.catalog-empty p code { font-family: var(--font-mono); font-size: 12px; background: hsl(var(--muted) / 0.8); border: 1px solid hsl(var(--border)); padding: 1px 6px; border-radius: var(--radius-sm); color: hsl(var(--foreground)); }
.catalog-empty .btn { margin-top: 12px; }

/* ─── Vendor reliability composite ──────────────────────────────────
   A single 0–100 score blending on-time delivery, fill rate, and
   lead-time consistency. Bands map to the shell's semantic tones:
   green→success, amber→warning, rust→destructive. A "thin" badge
   (too few received POs to bank on) dashes its border; "none" (no PO
   history yet) is a muted em-dash placeholder. Lives on the Vendors
   ledger (one per row) and the vendor detail breakdown panel. */
.rel-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.6;
  white-space: nowrap;
}
.rel-badge .rel-score { font-variant-numeric: tabular-nums; }
.rel-badge .rel-thin-flag {
  font-size: 9px; font-weight: 600; opacity: 0.8;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.rel-badge.rel-green { background: hsl(var(--success) / 0.12); border-color: hsl(var(--success) / 0.4); color: hsl(var(--success)); }
.rel-badge.rel-amber { background: hsl(var(--warning) / 0.13); border-color: hsl(var(--warning) / 0.45); color: hsl(var(--warning)); }
.rel-badge.rel-rust  { background: hsl(var(--destructive) / 0.1); border-color: hsl(var(--destructive) / 0.4); color: hsl(var(--destructive)); }
.rel-badge.rel-none  { background: hsl(var(--muted)); border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); font-weight: 500; }
.rel-badge.is-thin { border-style: dashed; }

/* Detail-page breakdown: composite headline on the left, the three
   sub-scores as labelled mini-bars on the right. */
.rel-panel {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  padding: 15px 18px; margin-top: 2px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
}
.rel-panel-head { display: flex; flex-direction: column; gap: 5px; min-width: 104px; }
.rel-panel-head .rel-big {
  font-family: var(--font-display); font-weight: var(--hero-weight);
  font-size: 36px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.rel-panel-head .rel-big .rel-out { font-size: 16px; opacity: 0.5; font-weight: 500; }
.rel-panel-head .rel-big.rel-green { color: hsl(var(--success)); }
.rel-panel-head .rel-big.rel-amber { color: hsl(var(--warning)); }
.rel-panel-head .rel-big.rel-rust  { color: hsl(var(--destructive)); }
.rel-panel-head .rel-big.rel-none  { color: hsl(var(--muted-foreground)); }
.rel-panel-head .rel-caption { font-size: 11px; color: hsl(var(--muted-foreground)); }
.rel-bars { display: flex; flex-direction: column; gap: 9px; }
.rel-bar-row { display: grid; grid-template-columns: 104px 1fr 58px; gap: 12px; align-items: center; }
.rel-bar-row .rel-bar-label { font-size: 11px; color: hsl(var(--muted-foreground)); }
.rel-bar-row .rel-bar-track { height: 6px; background: hsl(var(--muted)); border-radius: 999px; overflow: hidden; }
.rel-bar-row .rel-bar-track > i { display: block; height: 100%; background: hsl(var(--foreground) / 0.5); border-radius: 999px; }
.rel-bar-row.b-green .rel-bar-track > i { background: hsl(var(--success)); }
.rel-bar-row.b-amber .rel-bar-track > i { background: hsl(var(--warning)); }
.rel-bar-row.b-rust  .rel-bar-track > i { background: hsl(var(--destructive)); }
.rel-bar-row .rel-bar-val { font-family: var(--font-mono); font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; color: hsl(var(--foreground)); }
.rel-bar-row .rel-bar-val.dim { color: hsl(var(--muted-foreground)); }

/* ─── On-order / backorder relief notes ─────────────────────────────
   Small mono sub-lines under the Available cell ("+120 on order") and
   the Days-to-Stock-Out gauge ("↺ back ~5d") on Stock-Out Risk, marking
   stock that's committed-but-not-yet-received. Green relief reads as
   "bad now, but help is inbound" against a CRITICAL row. */
.oo-note {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.01em; color: hsl(var(--muted-foreground));
  margin-top: 3px; white-space: nowrap;
}
.relief-note {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.01em; color: hsl(var(--success));
  margin-top: 4px; white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   SCENARIO / WHAT-IF (.scn-*) — spliced from the Claude Design handoff
   (hanoff_061326/project/scenarios.css). Base .otb-strip + .catalog-empty
   omitted — already defined above. Only the over-budget otb pieces, the
   scn-banner, and the new scn primitives are added here.
   ═══════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════
   INDEX — small deltas on the reused ledger
   ═══════════════════════════════════════════════════════════════════════ */
.scn-name-cell { display: flex; flex-direction: column; gap: 2px; }
.scn-name-cell .sn {
  font-family: var(--font-sans); font-weight: 550; font-size: 13.5px;
  letter-spacing: -0.005em; color: hsl(var(--foreground)); line-height: 1.25;
}
.scn-link:hover .scn-name-cell .sn { color: hsl(var(--primary)); }
.scn-link { text-decoration: none; color: inherit; display: block; }
.scn-name-cell .sd {
  font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px;
}

/* base-run badge: "latest" vs a pinned run number */
.scn-base-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  padding: 2px 9px; border-radius: 999px; line-height: 1.45; white-space: nowrap;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}
.scn-base-badge svg { width: 11px; height: 11px; flex: none; }
.scn-base-badge.latest {
  background: hsl(var(--info) / 0.12); color: hsl(var(--info)); border-color: hsl(var(--info) / 0.3);
}
.scn-base-badge.pinned {
  background: hsl(var(--muted) / 0.8); color: hsl(var(--foreground));
}

/* multiplier count chip */
.scn-mult-count {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  color: hsl(var(--foreground));
}
.scn-mult-count .none { color: hsl(var(--muted-foreground) / 0.7); font-style: normal; }
.scn-affected { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: hsl(var(--foreground)); }
.scn-affected.zero { color: hsl(var(--muted-foreground)); }

/* row action buttons (duplicate / delete) — quiet until row hover */
.scn-row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.scn-icon-act {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: hsl(var(--background)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm); color: hsl(var(--muted-foreground)); cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.scn-icon-act svg { width: 14px; height: 14px; }
.scn-icon-act:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.scn-icon-act.danger:hover { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.4); }

/* ═══════════════════════════════════════════════════════════════════════
   WORKBENCH — header slab name + base-run select + notes
   ═══════════════════════════════════════════════════════════════════════ */
.scn-name-edit {
  display: inline-flex; align-items: center; gap: 10px;
}
.scn-name-edit input {
  font-family: var(--font-display); font-weight: var(--hero-weight, 650);
  font-size: 30px; letter-spacing: -0.02em; color: hsl(var(--foreground));
  background: transparent; border: none; border-bottom: 2px solid transparent;
  padding: 0 2px 2px; margin: 0; width: auto; min-width: 320px;
}
.scn-name-edit input:hover { border-bottom-color: hsl(var(--border)); }
.scn-name-edit input:focus { outline: none; border-bottom-color: hsl(var(--primary)); }
.scn-name-edit .scn-pencil { color: hsl(var(--muted-foreground) / 0.6); }
.scn-name-edit:hover .scn-pencil { color: hsl(var(--muted-foreground)); }
.scn-name-edit .scn-pencil svg { width: 16px; height: 16px; }

/* base-run select sits in the title-window */
.scn-base-control { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.scn-base-options { display: flex; gap: 8px; }
.scn-base-opt {
  flex: 1; cursor: pointer; appearance: none; text-align: left;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); padding: 9px 12px;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.scn-base-opt:hover { background: hsl(var(--muted) / 0.5); }
.scn-base-opt.active {
  border-color: hsl(var(--primary)); background: hsl(var(--primary) / 0.06);
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.4) inset;
}
.scn-base-opt .bo-title {
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: hsl(var(--foreground));
  display: flex; align-items: center; gap: 6px;
}
.scn-base-opt .bo-title svg { width: 13px; height: 13px; color: hsl(var(--muted-foreground)); }
.scn-base-opt.active .bo-title svg { color: hsl(var(--primary)); }
.scn-base-opt .bo-sub { font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 3px; }
.scn-base-opt .bo-sub .mono { font-family: var(--font-mono); }

.scn-notes {
  margin-top: 12px;
  font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5;
  color: hsl(var(--muted-foreground)); width: 100%;
  background: hsl(var(--muted) / 0.4); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md); padding: 9px 12px; resize: vertical; min-height: 52px;
}
.scn-notes:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.25); }

/* ═══════════════════════════════════════════════════════════════════════
   NEW #1 — MULTIPLIER EDITOR  (reads like a compact spreadsheet)
   Columns: date range · scope picker · multiplier · (remove)
   ═══════════════════════════════════════════════════════════════════════ */
.scn-editor-cap {
  display: flex; align-items: flex-end; gap: 14px; margin-bottom: 4px;
}
.scn-editor-cap .ec-title { font-family: var(--font-display); font-weight: 650; font-size: 16px; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
.scn-editor-cap .ec-sub { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.scn-editor-cap .ec-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.scn-dirty-note {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: hsl(var(--warning));
}
.scn-dirty-note svg { width: 13px; height: 13px; }
.scn-dirty-note[hidden] { display: none; }

/* the grid table */
.scn-mult-table {
  display: grid;
  grid-template-columns:
    [start] minmax(220px, 1.1fr)   /* date range */
    [scope] minmax(260px, 1.4fr)   /* scope picker */
    [mult]  150px                  /* multiplier */
    [act]   44px;                  /* remove */
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  overflow: hidden; background: hsl(var(--card));
}
.scn-mult-thead { display: contents; }
.scn-mult-thead > div {
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
  padding: 9px 14px;
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--muted-foreground));
  display: flex; align-items: center;
}
.scn-mult-thead > div.num { justify-content: flex-start; }

.scn-mult-row { display: contents; }
.scn-mult-row > div {
  padding: 11px 14px; border-bottom: 1px solid hsl(var(--border));
  display: flex; align-items: center; gap: 8px; min-width: 0;
  background: hsl(var(--card)); transition: background 0.1s ease;
}
.scn-mult-row:last-of-type > div { border-bottom: none; }
.scn-mult-row:hover > div { background: hsl(var(--muted) / 0.25); }
.scn-mult-row.removing > div { background: hsl(var(--destructive) / 0.06); }

/* date-range cell: two date inputs with an arrow */
.scn-date-range { display: flex; align-items: center; gap: 7px; width: 100%; }
.scn-date-range input[type="date"] {
  font-family: var(--font-mono); font-size: 12px; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm); padding: 5px 8px; min-width: 0; flex: 1;
}
.scn-date-range input[type="date"]:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25); }
.scn-date-range .arrow { color: hsl(var(--muted-foreground)); flex: none; }
.scn-date-range .arrow svg { width: 13px; height: 13px; display: block; }
.scn-date-range input.invalid { border-color: hsl(var(--destructive)); }

/* scope cell: scope_kind select + scope_value input (mirrors marketing modal) */
.scn-scope { display: flex; align-items: center; gap: 7px; width: 100%; }
.scn-scope select, .scn-scope input {
  font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm); padding: 5px 9px; height: 30px; min-width: 0;
}
.scn-scope select {
  flex: 0 0 122px; appearance: none; cursor: pointer; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.scn-scope input { flex: 1; font-family: var(--font-mono); }
.scn-scope input:disabled {
  background: hsl(var(--muted) / 0.5); color: hsl(var(--muted-foreground)); cursor: not-allowed;
  font-family: var(--font-sans); font-style: italic;
}
.scn-scope select:focus, .scn-scope input:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25); }

/* multiplier cell: ×N.N input with a +/− % consequence read */
.scn-mult-input-wrap { display: flex; align-items: center; gap: 9px; width: 100%; }
.scn-mult-input-wrap .x {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: hsl(var(--muted-foreground)); flex: none;
}
.scn-mult-input-wrap input {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm); padding: 5px 8px; width: 58px; text-align: right;
}
.scn-mult-input-wrap input:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.25); }
.scn-mult-input-wrap input.invalid { border-color: hsl(var(--destructive)); }
.scn-mult-pct {
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.scn-mult-pct.up { color: hsl(var(--success)); }
.scn-mult-pct.down { color: hsl(var(--destructive)); }
.scn-mult-pct.flat { color: hsl(var(--muted-foreground)); }

/* remove button */
.scn-mult-remove {
  justify-content: center !important; padding: 0 !important;
}
.scn-mult-remove button {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground) / 0.6); cursor: pointer;
}
.scn-mult-remove button:hover { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.3); }
.scn-mult-remove button svg { width: 14px; height: 14px; }

/* add-multiplier affordance */
.scn-add-row {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 550; color: hsl(var(--primary));
  background: transparent; border: 1px dashed hsl(var(--primary) / 0.4);
  border-radius: var(--radius-md); padding: 9px 15px; cursor: pointer; width: 100%;
  justify-content: center; transition: background 0.12s ease, border-color 0.12s ease;
}
.scn-add-row:hover { background: hsl(var(--primary) / 0.05); border-color: hsl(var(--primary) / 0.7); }
.scn-add-row svg { width: 15px; height: 15px; }

/* no-multipliers note (the "valid, == baseline" case) */
.scn-no-mult {
  display: flex; align-items: center; gap: 9px; padding: 16px 18px;
  font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5; color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.4); border: 1px dashed hsl(var(--border)); border-radius: var(--radius-md);
}
.scn-no-mult svg { width: 16px; height: 16px; flex: none; color: hsl(var(--muted-foreground)); }
.scn-no-mult b { color: hsl(var(--foreground)); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   NEW #2 — DIFF CASH PANEL  (baseline vs scenario · 30/60/90 + Δ)
   Built from .stat-block tiles + .otb-strip language. Baseline reads muted;
   scenario reads toned; Δ is the loud element.
   ═══════════════════════════════════════════════════════════════════════ */
.scn-diff { display: flex; flex-direction: column; gap: 0; }

/* two-column header: BASELINE | SCENARIO */
.scn-diff-legend {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 12px;
}
.scn-diff-legend .dl {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground));
}
.scn-diff-legend .dl .swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.scn-diff-legend .dl.baseline .swatch { background: hsl(var(--muted-foreground) / 0.4); }
.scn-diff-legend .dl.scenario { color: hsl(var(--foreground)); }
.scn-diff-legend .dl.scenario .swatch { background: hsl(var(--primary)); }
.scn-diff-legend .dl .run { font-family: var(--font-mono); font-weight: 500; text-transform: none; letter-spacing: 0; color: hsl(var(--muted-foreground)); }

/* the 3 bucket rows (30/60/90) */
.scn-bucket {
  display: grid;
  grid-template-columns: 64px 1fr 1fr 168px;
  align-items: stretch; gap: 0;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  overflow: hidden; margin-bottom: 12px;
}
.scn-bucket-label {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 14px 16px; background: hsl(var(--muted) / 0.5);
  border-right: 1px solid hsl(var(--border));
}
.scn-bucket-label .bl-num { font-family: var(--font-display); font-weight: 650; font-size: 20px; letter-spacing: -0.02em; color: hsl(var(--foreground)); }
.scn-bucket-label .bl-num small { font-size: 0.55em; color: hsl(var(--muted-foreground)); font-weight: 600; }
.scn-bucket-label .bl-sub { font-family: var(--font-sans); font-size: 10px; color: hsl(var(--muted-foreground)); }

.scn-bucket-side {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 16px;
  border-right: 1px solid hsl(var(--border));
}
.scn-bucket-side .bs-lbl { font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.scn-bucket-side .bs-val { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.scn-bucket-side .bs-val .unit { font-size: 0.55em; color: hsl(var(--muted-foreground)); font-weight: 600; }
.scn-bucket-side .bs-meta { font-family: var(--font-sans); font-size: 10.5px; color: hsl(var(--muted-foreground)); }
/* baseline side — muted */
.scn-bucket-side.baseline .bs-val { color: hsl(var(--muted-foreground)); }
/* scenario side — toned, the meter under it */
.scn-bucket-side.scenario { background: hsl(var(--primary) / 0.04); }
.scn-bucket-side.scenario .bs-val { color: hsl(var(--foreground)); }

/* a tiny twin-meter under the scenario value showing baseline tick vs scenario fill */
.scn-mini-meter { position: relative; height: 5px; border-radius: 999px; background: hsl(var(--muted)); overflow: visible; margin-top: 3px; }
.scn-mini-meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: hsl(var(--primary)); }
.scn-mini-meter .base-tick { position: absolute; top: -2px; bottom: -2px; width: 2px; background: hsl(var(--foreground)); border-radius: 1px; }

/* Δ column — the loud element */
.scn-bucket-delta {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 12px 16px;
  background: hsl(var(--card));
}
.scn-bucket-delta .bd-lbl { font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.scn-bucket-delta .bd-val {
  font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 7px;
}
.scn-bucket-delta .bd-pct { font-size: 0.6em; font-weight: 600; font-family: var(--font-mono); }
.scn-bucket-delta.up .bd-val { color: hsl(var(--destructive)); }     /* more cash = the warning direction for spend */
.scn-bucket-delta.down .bd-val { color: hsl(var(--success)); }
.scn-bucket-delta.flat .bd-val { color: hsl(var(--muted-foreground)); }
.scn-bucket-delta .bd-arrow { width: 16px; height: 16px; }

/* over-budget treatment of the meter + strip */
.otb-strip.over { background: hsl(var(--destructive) / 0.05); border-color: hsl(var(--destructive) / 0.35); }
.otb-strip.over .otb-meter-fill { background: hsl(var(--destructive)); }
.otb-over-flag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: hsl(var(--destructive));
  background: hsl(var(--destructive) / 0.08); border: 1px solid hsl(var(--destructive) / 0.3);
  border-radius: var(--radius-md); padding: 9px 13px;
}
.otb-over-flag svg { width: 15px; height: 15px; flex: none; }
.otb-over-flag b { font-weight: 700; }

/* "view full horizon under this scenario" link row */
.scn-horizon-link {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.scn-horizon-link .hl-text { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.scn-horizon-link .btn { margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════════
   SCENARIO BANNER  (on the reused /purchasing-horizon page)
   ═══════════════════════════════════════════════════════════════════════ */
.scn-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; margin-bottom: 14px;
  background: hsl(var(--primary) / 0.08);
  border: 1px solid hsl(var(--primary) / 0.35);
  border-left-width: 3px;
  border-radius: var(--radius-md);
}
.scn-banner .sb-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  background: hsl(var(--primary) / 0.14); border-radius: var(--radius-md); color: hsl(var(--primary));
}
.scn-banner .sb-icon svg { width: 18px; height: 18px; }
.scn-banner .sb-copy { display: flex; flex-direction: column; gap: 1px; }
.scn-banner .sb-eyebrow {
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: hsl(var(--primary));
}
.scn-banner .sb-name { font-family: var(--font-sans); font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); }
.scn-banner .sb-name b { font-weight: 700; }
.scn-banner .sb-meta { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.scn-banner .sb-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* scope-value uses readonly (not disabled) for scope=all so the row still
   submits and the parallel multiplier arrays stay aligned. */
.scn-scope input[readonly] {
  background: hsl(var(--muted) / 0.5); color: hsl(var(--muted-foreground));
  cursor: not-allowed; font-family: var(--font-sans); font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════
   SETTINGS REDESIGN (.set-*) — spliced from the Claude Design handoff
   (hanoff_061326/project/settings.css). Retires the brutalist knob
   console; all-new .set-* namespace, no collisions with .knob-*.
   ═══════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════
   PAGE SUMMARY  (replaces the brutalist "Control readout" console)
   ═══════════════════════════════════════════════════════════════════════ */
.set-summary {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--muted-foreground));
}
.set-summary .set-summary-count {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 550; color: hsl(var(--foreground));
}
.set-summary .set-summary-dot {
  width: 7px; height: 7px; border-radius: 999px; background: hsl(var(--primary)); flex: none;
}
.set-summary .set-summary-count.clean .set-summary-dot { background: hsl(var(--success)); }
.set-summary .sep { color: hsl(var(--border)); }

/* nav anchors for the group jump-list in the title window */
.set-jump { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.set-jump a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground));
  text-decoration: none; padding: 5px 9px; border-radius: var(--radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
}
.set-jump a:hover { background: hsl(var(--muted) / 0.6); color: hsl(var(--foreground)); }
.set-jump a .jc {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: hsl(var(--primary)); background: hsl(var(--primary) / 0.1);
  padding: 1px 7px; border-radius: 999px; min-width: 18px; text-align: center;
}
.set-jump a .jc.zero { color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); }

/* ═══════════════════════════════════════════════════════════════════════
   GROUP CARD  (one per KNOB_GROUP — a .slab with a header + divided rows)
   ═══════════════════════════════════════════════════════════════════════ */
/* the page is one <form>, so the group cards don't get .grounds' flex
   gap (the form is the flex child, not the cards). Re-establish the same
   20px rhythm inside the form so the cards breathe like every other slab. */
#set-form { display: flex; flex-direction: column; gap: 20px; }
.set-group { padding: 0; overflow: hidden; scroll-margin-top: 18px; }
.set-group-head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; border-bottom: 1px solid hsl(var(--primary) / 0.16);
  /* faint Session Goods blue band — far more legible than the old muted/0.35
     near-white, and on the same accent as the "N modified" text + jump pills. */
  background: hsl(var(--primary) / 0.07);
}
.set-group-head .sg-title {
  font-family: var(--font-display); font-weight: 650; font-size: 16px;
  letter-spacing: -0.01em; color: hsl(var(--foreground));
}
.set-group-head .sg-sub {
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 1px;
}
.set-group-head > div:first-child { flex: 1; min-width: 0; }
.set-group-head .sg-meta { margin-left: auto; flex: none; display: flex; align-items: center; gap: 12px; }
.set-group-modcount {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 550; color: hsl(var(--primary));
  opacity: 0; transition: opacity 0.15s ease;
}
.set-group-modcount.show { opacity: 1; }
.set-group-modcount .pip { width: 6px; height: 6px; border-radius: 999px; background: hsl(var(--primary)); }

/* ═══════════════════════════════════════════════════════════════════════
   SETTING ROW  (the atom: label+help left · control+value right)
   ═══════════════════════════════════════════════════════════════════════ */
.set-row {
  display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid hsl(var(--border));
  transition: background 0.1s ease;
}
.set-row:last-child { border-bottom: none; }
.set-row:hover { background: hsl(var(--muted) / 0.22); }
.set-row.is-modified { background: hsl(var(--primary) / 0.025); }
.set-row.is-modified:hover { background: hsl(var(--primary) / 0.05); }

/* left column */
.set-row-main { min-width: 0; }
.set-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600;
  color: hsl(var(--foreground)); letter-spacing: -0.005em; line-height: 1.3;
}
.set-mod-dot {
  width: 7px; height: 7px; border-radius: 999px; background: hsl(var(--primary)); flex: none;
  opacity: 0; transition: opacity 0.12s ease;
}
.set-row.is-modified .set-mod-dot { opacity: 1; }
.set-mod-tag {
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em;
  color: hsl(var(--primary)); text-transform: uppercase;
  opacity: 0; transition: opacity 0.12s ease;
}
.set-row.is-modified .set-mod-tag { opacity: 1; }
.set-help {
  font-family: var(--font-sans); font-size: 12px; line-height: 1.5;
  color: hsl(var(--muted-foreground)); margin-top: 4px; max-width: 560px; text-wrap: pretty;
}
.set-key {
  font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground) / 0.65);
  margin-top: 6px; letter-spacing: 0;
}

/* right column — control sits here, value lives IN the control */
.set-row-control { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.set-control-line { display: flex; align-items: center; gap: 10px; width: 100%; justify-content: flex-end; }

/* the quiet modified meta under the control: "Default: x · reset" */
.set-default-line {
  display: flex; align-items: center; gap: 9px; min-height: 15px;
  font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground));
}
.set-default-line .set-default-hint { white-space: nowrap; }
.set-default-line .set-default-hint .mono { font-family: var(--font-mono); color: hsl(var(--foreground)); }
.set-reset {
  display: none; align-items: center; gap: 4px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 550; color: hsl(var(--primary));
  background: none; border: none; cursor: pointer; padding: 0;
}
.set-reset svg { width: 11px; height: 11px; }
.set-reset:hover { text-decoration: underline; text-underline-offset: 2px; }
.set-row.is-modified .set-reset { display: inline-flex; }
/* on unmodified rows the whole default-line is hidden to stay calm */
.set-row:not(.is-modified) .set-default-line { visibility: hidden; }

/* ═══════════════════════════════════════════════════════════════════════
   CONTROL — NUMBER (int/float) with optional unit affix
   ═══════════════════════════════════════════════════════════════════════ */
.set-num { display: inline-flex; align-items: stretch; max-width: 200px; }
.set-num input {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); padding: 0 11px; height: 36px; width: 100%;
  text-align: right; font-variant-numeric: tabular-nums; min-width: 80px;
}
.set-num input:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.28); }
.set-num input.invalid { border-color: hsl(var(--destructive)); }
.set-num.has-prefix input { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: none; text-align: left; }
.set-num.has-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.set-affix {
  display: inline-flex; align-items: center; padding: 0 10px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--input));
  white-space: nowrap;
}
.set-affix.prefix { border-right: none; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.set-affix.suffix { border-left: none; border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ═══════════════════════════════════════════════════════════════════════
   CONTROL — TEXT (string)
   ═══════════════════════════════════════════════════════════════════════ */
.set-text input {
  font-family: var(--font-sans); font-size: 13px; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); padding: 0 11px; height: 36px; width: 300px; max-width: 100%;
}
.set-text input:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.28); }
.set-text textarea {
  font-family: var(--font-sans); font-size: 13px; line-height: 1.5; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); padding: 8px 11px; width: 300px; max-width: 100%;
  min-height: 80px; resize: vertical;
}
.set-text textarea:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.28); }

/* ═══════════════════════════════════════════════════════════════════════
   CONTROL — SWITCH (true on/off bool; label = the row label, no mirroring)
   ═══════════════════════════════════════════════════════════════════════ */
.set-switch { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.set-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.set-switch .set-switch-state {
  font-family: var(--font-sans); font-size: 12px; font-weight: 550; color: hsl(var(--muted-foreground));
  min-width: 24px; text-align: right; order: -1;
}
.set-switch .track {
  position: relative; width: 42px; height: 24px; flex: none;
  background: hsl(var(--muted)); border: 1px solid hsl(var(--border));
  border-radius: 999px; transition: background 0.15s ease, border-color 0.15s ease;
}
.set-switch .track::after {
  content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; border-radius: 999px; background: hsl(var(--background));
  box-shadow: var(--shadow-sm); transition: left 0.16s cubic-bezier(0.32, 0.72, 0, 1);
}
.set-switch input:checked ~ .track { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.set-switch input:checked ~ .track::after { left: 21px; }
.set-switch input:checked ~ .set-switch-state { color: hsl(var(--primary)); }
.set-switch input:focus-visible ~ .track { box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }

/* ═══════════════════════════════════════════════════════════════════════
   CONTROL — SEGMENTED (two-way choice bool with true_label/false_label)
   The OTB period: Monthly | Weekly. Active segment highlighted.
   ═══════════════════════════════════════════════════════════════════════ */
.set-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: hsl(var(--muted) / 0.7); border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
}
.set-seg button {
  appearance: none; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 550; color: hsl(var(--muted-foreground));
  padding: 5px 16px; border-radius: calc(var(--radius-md) - 2px);
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease; white-space: nowrap;
}
.set-seg button:hover { color: hsl(var(--foreground)); }
.set-seg button.active {
  background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm);
}
.set-seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }

/* ═══════════════════════════════════════════════════════════════════════
   CONTROL — COLOR (hex string → swatch + hex input)
   ═══════════════════════════════════════════════════════════════════════ */
.set-color { display: inline-flex; align-items: stretch; gap: 0; }
.set-color .swatch-wrap {
  position: relative; width: 36px; height: 36px; flex: none;
  border: 1px solid hsl(var(--input)); border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md); overflow: hidden; cursor: pointer;
}
.set-color input[type="color"] {
  position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px);
  border: none; padding: 0; cursor: pointer; background: none;
}
.set-color input[type="text"] {
  font-family: var(--font-mono); font-size: 12.5px; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 0 11px; height: 36px; width: 110px;
}
.set-color input[type="text"]:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.28); }

/* ═══════════════════════════════════════════════════════════════════════
   CONTROL — CHIPS (comma-separated string → tag input)
   ═══════════════════════════════════════════════════════════════════════ */
.set-chips-wrap { width: 300px; max-width: 100%; }
.set-chips {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md); padding: 6px 8px; min-height: 36px;
}
.set-chips:focus-within { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.28); }
.set-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.8); border: 1px solid hsl(var(--border));
  padding: 2px 4px 2px 9px; border-radius: var(--radius-sm); line-height: 1.5;
}
.set-chip button {
  width: 16px; height: 16px; display: grid; place-items: center; flex: none;
  background: none; border: none; cursor: pointer; color: hsl(var(--muted-foreground)); border-radius: 3px;
}
.set-chip button:hover { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.set-chip button svg { width: 11px; height: 11px; }
.set-chips input {
  flex: 1; min-width: 80px; border: none; background: none; outline: none;
  font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--foreground)); height: 22px; padding: 0 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   STICKY UNSAVED INDICATOR  (subtle, bottom-right — jump to a dirty section)
   Not the save mechanism (that's per-section) — just a no-scroll reminder.
   ═══════════════════════════════════════════════════════════════════════ */
/* floating save/discard action bar — rides bottom-right, on top of the
   page as it scrolls; the page's only Save/Discard. Shown only when
   there are unsaved changes. */
.set-unsaved {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  display: none; align-items: center; gap: 12px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md); border-radius: var(--radius-lg); padding: 10px 12px 10px 18px;
}
.set-unsaved.show { display: inline-flex; }
.set-unsaved .su-text { font-family: var(--font-sans); font-size: 12.5px; font-weight: 550; color: hsl(var(--foreground)); white-space: nowrap; }
.set-unsaved .su-text b { color: hsl(var(--primary)); }
.set-unsaved .btn:disabled { opacity: 0.5; cursor: not-allowed; }


/* responsive: stack control under label on narrow */
@media (max-width: 880px) {
  .set-row { grid-template-columns: 1fr; gap: 12px; }
  .set-row-control { align-items: flex-start; }
  .set-control-line { justify-content: flex-start; }
}


/* ═══════════════════════════════════════════════════════════════════════
   FEEDBACK — admin triage list + lightbox + toast (v5, Claude Design
   handoff 2026-06-15). The FAB + submit-modal primitives (sections 1-2 of
   feedback.css) land with the widget; this is the /admin/feedback surface.
   ═══════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════
   3 · TOAST  (feedback widget — mirrors the .mc-toast / .set-toast pattern)
   ═══════════════════════════════════════════════════════════════════════ */
.fb-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  z-index: 120; display: flex; align-items: center; gap: 9px;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  border-radius: var(--radius-md); padding: 11px 16px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.fb-toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.fb-toast.ok { background: hsl(var(--success)); color: hsl(var(--success-foreground)); }
.fb-toast.err { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.fb-toast svg { width: 16px; height: 16px; flex: none; }

/* ═══════════════════════════════════════════════════════════════════════
   4 · LIGHTBOX  (admin thumbnail → full-size)
   ═══════════════════════════════════════════════════════════════════════ */
.fb-lightbox {
  position: fixed; inset: 0; z-index: 130;
  display: none; place-items: center;
  background: rgb(12 14 20 / 0.78); backdrop-filter: blur(3px);
  padding: 40px;
}
.fb-lightbox.show { display: grid; animation: fb-lb-in 0.16s ease; }
@keyframes fb-lb-in { from { opacity: 0; } to { opacity: 1; } }
.fb-lb-frame {
  max-width: min(1000px, 92vw); max-height: 86vh;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.fb-lb-img {
  max-width: 100%; max-height: 76vh;
  border-radius: var(--radius-md); border: 1px solid hsl(0 0% 100% / 0.16);
  box-shadow: 0 24px 60px -12px rgb(0 0 0 / 0.5); background: hsl(var(--card));
  object-fit: contain;
}
.fb-lb-cap {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 12px; color: hsl(0 0% 100% / 0.82);
}
.fb-lb-cap a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.fb-lb-close {
  position: fixed; top: 22px; right: 24px;
  width: 38px; height: 38px; display: grid; place-items: center;
  background: hsl(0 0% 100% / 0.12); color: #fff; border: 1px solid hsl(0 0% 100% / 0.2);
  border-radius: var(--radius-md); cursor: pointer;
}
.fb-lb-close:hover { background: hsl(0 0% 100% / 0.22); }
.fb-lb-close svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════════════════════════════════════
   5 · ADMIN LIST  (/admin/feedback) — roomy submission rows
   ═══════════════════════════════════════════════════════════════════════ */
.fb-admin { display: flex; flex-direction: column; }

/* category badge (shared admin + lightbox header) */
.fb-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 550;
  border: 1px solid transparent; white-space: nowrap;
}
.fb-tag .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.fb-tag.cat-bug    { background: hsl(var(--destructive) / 0.10); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.28); }
.fb-tag.cat-idea   { background: hsl(var(--primary) / 0.10);     color: hsl(var(--primary));     border-color: hsl(var(--primary) / 0.28); }
.fb-tag.cat-ux     { background: hsl(var(--warning) / 0.12);     color: hsl(var(--warning));     border-color: hsl(var(--warning) / 0.30); }
.fb-tag.cat-praise { background: hsl(var(--success) / 0.10);     color: hsl(var(--success));     border-color: hsl(var(--success) / 0.28); }
.fb-tag.cat-other  { background: hsl(var(--secondary));          color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }

/* status badge */
.fb-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-family: var(--font-sans); font-size: 11px; font-weight: 550;
  border: 1px solid transparent; white-space: nowrap;
}
.fb-status .pip { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.fb-status.st-new      { background: hsl(var(--info) / 0.12);  color: hsl(var(--info));  border-color: hsl(var(--info) / 0.30); }
.fb-status.st-reviewed { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.30); }
.fb-status.st-resolved { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.30); }

/* filter strip extension: a second row for category, with counts */
.fb-subfilter {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.35);
}
.fb-subfilter .fb-sf-label {
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 500;
  color: hsl(var(--muted-foreground)); margin-right: 2px;
}
.fb-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: 999px;
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  color: hsl(var(--muted-foreground)); cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.fb-chip .fb-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.fb-chip[data-cat="bug"]    .fb-dot { background: hsl(var(--destructive)); }
.fb-chip[data-cat="idea"]   .fb-dot { background: hsl(var(--primary)); }
.fb-chip[data-cat="ux"]     .fb-dot { background: hsl(var(--warning)); }
.fb-chip[data-cat="praise"] .fb-dot { background: hsl(var(--success)); }
.fb-chip[data-cat="other"]  .fb-dot { background: hsl(var(--muted-foreground)); }
.fb-chip .fb-ct { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); }
.fb-chip:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.fb-chip.on { background: hsl(var(--foreground)); border-color: hsl(var(--foreground)); color: hsl(var(--background)); }
.fb-chip.on .fb-ct { color: hsl(var(--background) / 0.75); }
.fb-chip.on .fb-dot { box-shadow: 0 0 0 2px hsl(var(--foreground)); }

/* submission row */
.fb-card {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 22px;
  padding: 20px 22px;
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.12s ease;
}
.fb-card:last-child { border-bottom: none; }
.fb-card:hover { background: hsl(var(--muted) / 0.35); }
.fb-card.is-resolved { background: hsl(var(--muted) / 0.30); }
.fb-card.is-resolved .fb-msg { color: hsl(var(--muted-foreground)); }
.fb-card.is-resolved .fb-card-main { opacity: 0.82; }
.fb-card.hide { display: none; }

.fb-card-main { min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.fb-card-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.fb-card-top .fb-id {
  font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground) / 0.8);
  margin-left: auto;
}

.fb-msg {
  font-family: var(--font-sans); font-size: 14px; line-height: 1.55;
  color: hsl(var(--foreground)); text-wrap: pretty; max-width: 64ch;
}

/* submitter + page-from meta line */
.fb-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.fb-who { display: flex; align-items: center; gap: 8px; }
.fb-avatar {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  display: grid; place-items: center;
  background: hsl(var(--secondary)); color: hsl(var(--foreground));
  font-family: var(--font-display); font-weight: 600; font-size: 10.5px;
}
.fb-who-name { font-family: var(--font-sans); font-size: 12.5px; font-weight: 550; color: hsl(var(--foreground)); }
.fb-who-time { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.fb-dotsep { width: 3px; height: 3px; border-radius: 999px; background: hsl(var(--border)); }
.fb-from {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground));
}
.fb-from svg { width: 12px; height: 12px; }
.fb-from a {
  font-family: var(--font-mono); font-size: 11px; color: hsl(var(--primary));
  text-decoration: none;
}
.fb-from a:hover { text-decoration: underline; text-underline-offset: 2px; }
.fb-from .fb-from-title { color: hsl(var(--foreground)); font-weight: 500; font-family: var(--font-sans); font-size: 11.5px; }

/* screenshot thumbnails (admin) */
.fb-shots { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-shot {
  position: relative; width: 64px; height: 64px;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer; background: hsl(var(--muted));
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}
.fb-shot:hover { border-color: hsl(var(--ring) / 0.6); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.fb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-shot .fb-shot-tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: var(--font-mono); font-size: 8.5px; color: hsl(var(--background));
  background: hsl(var(--foreground) / 0.62); padding: 1px 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-shot.more {
  display: grid; place-items: center; cursor: pointer;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
}

/* right rail — triage control */
.fb-triage { display: flex; flex-direction: column; gap: 10px; }
.fb-triage-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
}
.fb-seg {
  display: inline-flex; flex-direction: column; gap: 0;
  background: hsl(var(--muted) / 0.6); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md); padding: 3px; gap: 2px;
}
.fb-seg button {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border: none; background: transparent;
  border-radius: calc(var(--radius-md) - 2px);
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500;
  color: hsl(var(--muted-foreground)); cursor: pointer; text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.fb-seg button .pip { width: 7px; height: 7px; border-radius: 999px; background: currentColor; flex: none; }
.fb-seg button[data-st="new"]      { color: hsl(var(--info)); }
.fb-seg button[data-st="reviewed"] { color: hsl(var(--warning)); }
.fb-seg button[data-st="resolved"] { color: hsl(var(--success)); }
.fb-seg button:not(.on) { color: hsl(var(--muted-foreground)); }
.fb-seg button:not(.on) .pip { background: hsl(var(--muted-foreground) / 0.5); }
.fb-seg button:hover:not(.on) { background: hsl(var(--card)); color: hsl(var(--foreground)); }
.fb-seg button.on { background: hsl(var(--card)); box-shadow: var(--shadow-sm); font-weight: 600; }
.fb-seg button[data-st="new"].on      { color: hsl(var(--info)); }
.fb-seg button[data-st="reviewed"].on { color: hsl(var(--warning)); }
.fb-seg button[data-st="resolved"].on { color: hsl(var(--success)); }

.fb-triage-stamp {
  font-family: var(--font-sans); font-size: 11px; color: hsl(var(--muted-foreground));
  line-height: 1.45;
}
.fb-triage-stamp b { color: hsl(var(--foreground)); font-weight: 550; }
.fb-triage-stamp:empty { display: none; }

/* admin empty state (filtered to nothing) */
.fb-empty {
  display: none;
  padding: 56px 28px; text-align: center;
  font-family: var(--font-sans); color: hsl(var(--muted-foreground));
}
.fb-empty.show { display: block; }
.fb-empty .fb-empty-ic {
  width: 46px; height: 46px; margin: 0 auto 14px; display: grid; place-items: center;
  background: hsl(var(--muted)); border-radius: 999px; color: hsl(var(--muted-foreground));
}
.fb-empty .fb-empty-ic svg { width: 22px; height: 22px; }
.fb-empty .fb-empty-title { font-size: 14px; font-weight: 600; color: hsl(var(--foreground)); margin-bottom: 4px; }
.fb-empty .fb-empty-sub { font-size: 12.5px; }

/* narrow: collapse triage rail under the message */
@media (max-width: 980px) {
  .fb-card { grid-template-columns: 1fr; gap: 16px; }
  .fb-triage { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .fb-seg { flex-direction: row; }
}


/* ═══════════════════════════════════════════════════════════════════════
   FEEDBACK — floating button (FAB) + submit modal (v5 widget, sections 1-2
   of feedback.css). Mounted globally by feedback.js on every signed-in page.
   ═══════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════
   1 · FLOATING BUTTON (FAB) — global, every signed-in page
   ═══════════════════════════════════════════════════════════════════════ */
.fb-fab {
  position: fixed;
  right: 26px;
  bottom: var(--fb-fab-bottom, 26px);
  z-index: 70;                /* above the settings save-bar (z 60) */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px 0 14px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
  font-weight: 550;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(.22,.61,.36,1),
              box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.fb-fab:hover {
  background: hsl(var(--background));
  border-color: hsl(var(--ring) / 0.5);
  box-shadow: var(--shadow-md), 0 0 0 4px hsl(var(--ring) / 0.10);
  transform: translateY(-1px);
}
.fb-fab:active { transform: translateY(0); }
.fb-fab:focus-visible { outline: none; box-shadow: var(--shadow-md), 0 0 0 3px hsl(var(--ring) / 0.45); }
.fb-fab svg { width: 17px; height: 17px; flex: none; color: hsl(var(--primary)); }
.fb-fab .fb-fab-label { white-space: nowrap; }

/* Yield to the Settings page's unsaved save-bar: lift the FAB above it.
   The settings bar is fixed bottom:26 right:26; we stack the FAB over it.
   Driven by an inherited custom property so the single .fb-fab rule resolves
   the lifted position (robust against cascade/specificity surprises). */
body.fb-fab-lift { --fb-fab-bottom: 88px; }

/* When the modal is open, fade the FAB so it doesn't peek through */
body.fb-open .fb-fab { opacity: 0; pointer-events: none; transform: scale(0.94); }

/* ═══════════════════════════════════════════════════════════════════════
   2 · SUBMIT MODAL  (native <dialog>)
   ═══════════════════════════════════════════════════════════════════════ */
.fb-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: 0 24px 60px -12px rgb(16 16 20 / 0.30), 0 8px 24px -8px rgb(16 16 20 / 0.18);
  overflow: hidden;
}
.fb-modal::backdrop { background: rgb(16 18 27 / 0.42); backdrop-filter: blur(2px); }
.fb-modal[open] { animation: fb-modal-in 0.18s cubic-bezier(.22,.61,.36,1); }
@keyframes fb-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
.fb-form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }

/* ── header ── */
.fb-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid hsl(var(--border));
}
.fb-head .fb-htext { flex: 1; min-width: 0; }
.fb-title {
  font-family: var(--font-display);
  font-weight: 600; font-size: 17px;
  letter-spacing: -0.01em; color: hsl(var(--foreground));
}
.fb-subtitle {
  font-family: var(--font-sans); font-size: 12.5px;
  color: hsl(var(--muted-foreground)); margin-top: 3px; line-height: 1.45;
}
.fb-x {
  flex: none; width: 32px; height: 32px; margin: -4px -4px 0 0;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-md); color: hsl(var(--muted-foreground));
  cursor: pointer; transition: background 0.12s ease, color 0.12s ease;
}
.fb-x:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.fb-x svg { width: 16px; height: 16px; }

/* ── body (scrolls) ── */
.fb-body {
  padding: 18px 22px 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
}
.fb-field { display: flex; flex-direction: column; gap: 9px; }
.fb-label {
  font-family: var(--font-sans); font-size: 13px; font-weight: 550;
  color: hsl(var(--foreground)); display: flex; align-items: baseline; gap: 7px;
}
.fb-label .req { color: hsl(var(--destructive)); }
.fb-label .opt {
  font-family: var(--font-sans); font-weight: 450; font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}

/* ── category chips ── */
.fb-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-cat {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px 7px 11px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: 999px;
  font-family: var(--font-sans); font-weight: 500; font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.fb-cat .fb-dot { width: 8px; height: 8px; border-radius: 999px; background: hsl(var(--muted-foreground)); flex: none; }
.fb-cat:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.fb-cat:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32); }
/* per-category dot tones */
.fb-cat[data-cat="bug"]    .fb-dot { background: hsl(var(--destructive)); }
.fb-cat[data-cat="idea"]   .fb-dot { background: hsl(var(--primary)); }
.fb-cat[data-cat="ux"]     .fb-dot { background: hsl(var(--warning)); }
.fb-cat[data-cat="praise"] .fb-dot { background: hsl(var(--success)); }
.fb-cat[data-cat="other"]  .fb-dot { background: hsl(var(--muted-foreground)); }
/* selected state — tinted fill + ring keyed to the category tone */
.fb-cat.sel { color: hsl(var(--foreground)); font-weight: 550; }
.fb-cat[data-cat="bug"].sel    { background: hsl(var(--destructive) / 0.10); border-color: hsl(var(--destructive) / 0.45); color: hsl(var(--destructive)); }
.fb-cat[data-cat="idea"].sel   { background: hsl(var(--primary) / 0.10);     border-color: hsl(var(--primary) / 0.45);     color: hsl(var(--primary)); }
.fb-cat[data-cat="ux"].sel     { background: hsl(var(--warning) / 0.12);     border-color: hsl(var(--warning) / 0.45);     color: hsl(var(--warning)); }
.fb-cat[data-cat="praise"].sel { background: hsl(var(--success) / 0.10);     border-color: hsl(var(--success) / 0.45);     color: hsl(var(--success)); }
.fb-cat[data-cat="other"].sel  { background: hsl(var(--muted)); border-color: hsl(var(--muted-foreground) / 0.45); color: hsl(var(--foreground)); }
.fb-cat.sel .fb-dot { box-shadow: 0 0 0 3px hsl(var(--card)); }

/* ── message ── */
.fb-textarea {
  width: 100%;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  padding: 11px 12px;
  font-family: var(--font-sans); font-size: 13.5px; line-height: 1.55;
  color: hsl(var(--foreground));
  min-height: 104px; resize: vertical; outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.fb-textarea::placeholder { color: hsl(var(--muted-foreground)); }
.fb-textarea:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.32); }
.fb-counter {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground));
  margin-top: -2px;
}
.fb-counter .fb-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.fb-counter .fb-count.near { color: hsl(var(--warning)); }
.fb-counter .fb-count.over { color: hsl(var(--destructive)); }
.fb-field-err {
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--destructive));
  display: none;
}
.fb-field.invalid .fb-field-err { display: block; }
.fb-field.invalid .fb-textarea { border-color: hsl(var(--destructive)); }
.fb-field.invalid .fb-cats { box-shadow: 0 0 0 0; }

/* ── screenshots / upload ── */
.fb-drop {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: hsl(var(--muted) / 0.45);
  border: 1.5px dashed hsl(var(--border));
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.fb-drop:hover { background: hsl(var(--muted) / 0.7); border-color: hsl(var(--ring) / 0.5); }
.fb-drop.drag { background: hsl(var(--primary) / 0.07); border-color: hsl(var(--primary) / 0.6); border-style: solid; }
.fb-drop-ic {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md); color: hsl(var(--muted-foreground));
}
.fb-drop-ic svg { width: 18px; height: 18px; }
.fb-drop.drag .fb-drop-ic { color: hsl(var(--primary)); border-color: hsl(var(--primary) / 0.4); }
.fb-drop-text { min-width: 0; }
.fb-drop-text .fb-drop-main {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; color: hsl(var(--foreground));
}
.fb-drop-text .fb-drop-main b { color: hsl(var(--primary)); font-weight: 600; }
.fb-drop-text .fb-drop-sub {
  font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); margin-top: 2px;
}
.fb-drop-text .fb-drop-sub kbd {
  font-family: var(--font-mono); font-size: 10.5px; padding: 0 4px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
}

/* staged file thumbnails */
.fb-files { display: flex; flex-wrap: wrap; gap: 10px; }
.fb-files:empty { display: none; }
.fb-file {
  position: relative; width: 76px;
  display: flex; flex-direction: column; gap: 5px;
}
.fb-thumb {
  position: relative; width: 76px; height: 76px;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  overflow: hidden; background: hsl(var(--muted));
  display: grid; place-items: center;
}
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-thumb .fb-thumb-doc { color: hsl(var(--muted-foreground)); }
.fb-thumb .fb-thumb-doc svg { width: 24px; height: 24px; }
.fb-thumb .fb-ext {
  position: absolute; left: 5px; bottom: 5px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; text-transform: uppercase;
  background: hsl(var(--foreground) / 0.78); color: hsl(var(--background));
  padding: 1px 5px; border-radius: var(--radius-sm); letter-spacing: 0.03em;
}
.fb-file-x {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; display: grid; place-items: center;
  background: hsl(var(--foreground)); color: hsl(var(--background));
  border: 2px solid hsl(var(--card)); border-radius: 999px;
  cursor: pointer; opacity: 0; transform: scale(0.8);
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.fb-file:hover .fb-file-x, .fb-file-x:focus-visible { opacity: 1; transform: scale(1); }
.fb-file-x:hover { background: hsl(var(--destructive)); }
.fb-file-x svg { width: 11px; height: 11px; }
.fb-file-name {
  font-family: var(--font-sans); font-size: 10.5px; color: hsl(var(--muted-foreground));
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fb-file-size { font-family: var(--font-mono); font-size: 9.5px; color: hsl(var(--muted-foreground) / 0.8); }
.fb-file.err .fb-thumb { border-color: hsl(var(--destructive) / 0.5); }
.fb-file.err .fb-file-name { color: hsl(var(--destructive)); }

.fb-help {
  font-family: var(--font-sans); font-size: 11.5px; line-height: 1.5;
  color: hsl(var(--muted-foreground));
}
.fb-help b { color: hsl(var(--foreground)); font-weight: 550; }

/* ── read-only context line ── */
.fb-context {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground));
  line-height: 1.4;
}
.fb-context svg { width: 14px; height: 14px; flex: none; color: hsl(var(--muted-foreground)); }
.fb-context .fb-ctx-text { min-width: 0; }
.fb-context b { color: hsl(var(--foreground)); font-weight: 600; }
.fb-context .fb-ctx-path {
  font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground));
}

/* ── footer ── */
.fb-foot {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 14px 22px; border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.fb-foot .fb-foot-note {
  margin-right: auto; font-family: var(--font-sans); font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}


/* ═══════════════════════════════════════════════════════════════════════
   ROLES — /admin/roles surface (v5, Claude Design handoff). Accordion role
   ledger + grouped permission grid + create-role slide-over. Companion to
   the roles blueprint; tokens only, no new colors. (Folded in from the
   design project's roles.css — the app keeps one stylesheet.)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Role ledger (accordion list inside a .data-slab) ─────────────────── */
.roles-list { display: flex; flex-direction: column; }
.role-row { border-bottom: 1px solid hsl(var(--border)); }
.role-row:last-child { border-bottom: none; }

.role-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.role-head:hover { background: hsl(var(--muted) / 0.5); }
.role-row.open > .role-head { background: hsl(var(--muted) / 0.55); }

.role-id { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.role-name-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}
.role-slug {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 1px 7px;
  border-radius: var(--radius-sm);
}
.role-desc {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  max-width: 640px;
  text-wrap: pretty;
}

/* role badges (superuser / built-in / default) */
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.role-badge .pip { width: 5px; height: 5px; border-radius: 999px; background: currentColor; }
.role-badge.super { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); border-color: hsl(var(--primary) / 0.3); }
.role-badge.system { background: hsl(var(--secondary)); color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }
.role-badge.default { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }

/* right cluster: member + permission readouts, chevron */
.role-meta { display: flex; align-items: center; gap: 22px; }
.role-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.role-stat b {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.role-stat b.all { font-size: 13px; font-weight: 600; color: hsl(var(--primary)); }
.role-stat span {
  font-family: var(--font-sans);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}
.role-chevron {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  transition: transform 0.18s ease, background 0.12s ease, color 0.12s ease;
}
.role-head:hover .role-chevron { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.role-row.open .role-chevron { transform: rotate(180deg); }

/* ── Expanded edit body ───────────────────────────────────────────────── */
.role-edit { display: none; padding: 4px 20px 22px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.3); }
.role-row.open > .role-edit { display: block; }

.role-fields {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 16px 22px;
  padding: 20px 0 18px;
}
.role-fields .field.full { grid-column: 1 / -1; }

/* permission toolbar */
.perm-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0 12px;
  border-top: 1px solid hsl(var(--border));
}
.perm-bar .perm-bar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: hsl(var(--foreground));
}
.perm-bar .perm-bar-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}
.perm-bar .perm-bar-count b { color: hsl(var(--foreground)); font-weight: 600; }
.perm-bar .perm-bar-actions { margin-left: auto; display: flex; gap: 8px; }
.perm-link {
  appearance: none; background: none; border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--primary));
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.perm-link:hover { background: hsl(var(--primary) / 0.08); }
.perm-link:disabled { color: hsl(var(--muted-foreground)); cursor: default; background: none; opacity: 0.6; }

/* superuser locked note */
.super-note {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 16px;
  padding: 12px 14px;
  background: hsl(var(--primary) / 0.07);
  border: 1px solid hsl(var(--primary) / 0.25);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: hsl(var(--foreground));
  line-height: 1.5;
}
.super-note svg { flex: none; color: hsl(var(--primary)); }
.super-note b { font-weight: 600; }

/* ── Permission groups (container; layout via html[data-grid-layout]) ─── */
.perm-groups { display: flex; flex-direction: column; gap: 18px; }

.perm-group {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.perm-group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: hsl(var(--muted) / 0.4);
  border-bottom: 1px solid hsl(var(--border));
}
.pg-toggle {
  display: none;            /* shown only in collapsible mode */
  width: 24px; height: 24px;
  place-items: center;
  border: none; background: none; cursor: pointer;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-sm);
  transition: transform 0.18s ease;
}
.pg-toggle:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.pg-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  color: hsl(var(--foreground));
}
.pg-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  padding: 1px 7px;
  border-radius: 999px;
}
.pg-count b { color: hsl(var(--foreground)); font-weight: 600; }
.pg-all { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.pg-all > span.txt {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.pg-all:hover > span.txt { color: hsl(var(--foreground)); }
.perm-group.is-locked .pg-all,
.perm-group.is-locked .pg-toggle { display: none; }

.perm-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: hsl(var(--border));
}

/* one permission */
.perm {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 11px;
  align-items: start;
  padding: 12px 14px;
  background: hsl(var(--card));
  cursor: pointer;
  transition: background 0.1s ease;
}
.perm:hover { background: hsl(var(--muted) / 0.5); }
.perm:has(.perm-box:checked) { background: hsl(var(--primary) / 0.05); }
.perm.is-locked { cursor: default; }
.perm.is-locked:hover { background: hsl(var(--card)); }
.perm:has(.perm-box:disabled:checked) { background: hsl(var(--primary) / 0.05); }

.perm-box { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.perm-check {
  margin-top: 1px;
  width: 16px; height: 16px;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  display: grid; place-items: center;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.perm-check svg { width: 11px; height: 11px; opacity: 0; transition: opacity 0.1s ease; }
.perm-box:checked + .perm-check { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.perm-box:checked + .perm-check svg { opacity: 1; color: hsl(var(--primary-foreground)); }
.perm-box:disabled + .perm-check { opacity: 0.65; }
.perm-box:focus-visible + .perm-check { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / 0.4); }

.perm-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.perm-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.perm-label {
  font-family: var(--font-sans);
  font-weight: 550;
  font-size: 13px;
  letter-spacing: -0.005em;
  color: hsl(var(--foreground));
  line-height: 1.25;
}
.perm-key {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  padding: 0 5px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.perm-desc {
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.45;
  color: hsl(var(--muted-foreground));
  text-wrap: pretty;
}

/* select-all mini check (reuses perm-check footprint) */
.pg-all .perm-check { width: 15px; height: 15px; }
.pg-all-box { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pg-all-box:checked + .perm-check { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.pg-all-box:checked + .perm-check svg { opacity: 1; color: hsl(var(--primary-foreground)); }
.pg-all-box:indeterminate + .perm-check { background: hsl(var(--primary)); border-color: hsl(var(--primary)); }
.pg-all-box:indeterminate + .perm-check svg { opacity: 0; }
.pg-all-box:indeterminate + .perm-check::after {
  content: ''; width: 8px; height: 2px; border-radius: 1px; background: hsl(var(--primary-foreground));
}

/* edit footer */
.role-edit-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}
.role-edit-foot .right { margin-left: auto; display: flex; gap: 8px; }
.role-edit-foot .del-note {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  max-width: 320px;
  line-height: 1.4;
}

/* ── Layout variant: COLUMNS (categories side-by-side) ────────────────── */
html[data-grid-layout="columns"] .perm-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
html[data-grid-layout="columns"] .perm-list { grid-template-columns: minmax(0, 1fr); gap: 1px; }
html[data-grid-layout="columns"] .perm { padding: 11px 12px; gap: 9px; }
html[data-grid-layout="columns"] .perm-group-head { flex-wrap: wrap; gap: 8px 10px; padding: 11px 12px; }
html[data-grid-layout="columns"] .pg-all { margin-left: 0; flex-basis: 100%; }

/* ── Layout variant: COLLAPSIBLE (accordion category groups) ──────────── */
html[data-grid-layout="collapsible"] .pg-toggle { display: grid; }
html[data-grid-layout="collapsible"] .perm-group-head { cursor: default; }
html[data-grid-layout="collapsible"] .perm-group.collapsed .pg-toggle { transform: rotate(-90deg); }
html[data-grid-layout="collapsible"] .perm-group.collapsed .perm-list { display: none; }

/* ── Create-role slide-over ───────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: hsl(var(--foreground) / 0.4);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 8000;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 760px; max-width: 94vw;
  background: hsl(var(--card));
  border-left: 1px solid hsl(var(--border));
  box-shadow: -12px 0 40px -8px hsl(222 47% 11% / 0.22);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 8001;
  display: flex; flex-direction: column;
}
.sheet.show { transform: none; }
.sheet-head {
  flex: none;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 24px 18px;
  border-bottom: 1px solid hsl(var(--border));
}
.sheet-head .sheet-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin: 0;
}
.sheet-head .sheet-sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
  line-height: 1.45;
  max-width: 460px;
}
.sheet-x {
  margin-left: auto; flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.sheet-x:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px; }
.sheet-body .role-fields { padding: 0 0 18px; }
.sheet-foot {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.sheet-foot .sheet-foot-note {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}
.sheet-foot .right { margin-left: auto; display: flex; gap: 8px; }

/* ── Toast (action feedback) ──────────────────────────────────────────── */
.roles-toasts {
  position: fixed; bottom: 18px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 8500; pointer-events: none;
}
.roles-toast {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.roles-toast.show { opacity: 1; transform: none; }
.roles-toast .ic { display: grid; place-items: center; }
.roles-toast.ok .ic { color: hsl(142 60% 60%); }
.roles-toast.del .ic { color: hsl(0 75% 68%); }
.roles-toast b { font-weight: 600; }

/* empty-ish helper for create validation */
.field .field-err { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--destructive)); display: none; }
.field.invalid .field-err { display: block; }
.field.invalid input { border-color: hsl(var(--destructive)); }

/* ── Role badges (Users · Role column) — tag-bundle tints by role ─────── */
.tag-bundle.role-admin     { background: hsl(var(--primary) / 0.12);  color: hsl(var(--primary));          border-color: hsl(var(--primary) / 0.3); }
.tag-bundle.role-user      { background: hsl(var(--secondary));       color: hsl(var(--muted-foreground)); border-color: hsl(var(--border)); }
.tag-bundle.role-marketing { background: hsl(var(--warning) / 0.12);  color: hsl(var(--warning));          border-color: hsl(var(--warning) / 0.3); }
.tag-bundle.role-custom    { background: hsl(var(--info) / 0.12);     color: hsl(var(--info));             border-color: hsl(var(--info) / 0.3); }

/* ── Per-row role assignment (Users · Assign cell) ────────────────────── */
.role-assign { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-select {
  font-family: var(--font-sans); font-size: 12px; color: hsl(var(--foreground));
  background: hsl(var(--background)); border: 1px solid hsl(var(--input));
  border-radius: var(--radius-sm); padding: 4px 6px; max-width: 160px; cursor: pointer;
}
.role-select:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.3); }
.btn.set-role:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════
   Forecast Accuracy — backtest redesign (trust panel, tiers, ledger)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Trust panel — the four headline numbers ── */
.trust-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.trust-card { position: relative; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); padding: 18px 18px 16px; overflow: hidden; display: flex; flex-direction: column; }
.trust-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: hsl(var(--muted-foreground)); }
.trust-card.sev-green::before { background: hsl(var(--success)); }
.trust-card.sev-amber::before { background: hsl(var(--warning)); }
.trust-card.sev-red::before   { background: hsl(var(--destructive)); }
.trust-label { font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.trust-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; margin-left: auto; }
.trust-tag.green { background: hsl(var(--success) / 0.14); color: hsl(var(--success)); }
.trust-tag.amber { background: hsl(var(--warning) / 0.14); color: hsl(var(--warning)); }
.trust-tag.red   { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.trust-value { font-family: var(--font-display); font-weight: 650; font-size: 40px; line-height: 1; letter-spacing: -0.02em; color: hsl(var(--foreground)); font-variant-numeric: tabular-nums; }
.trust-card.sev-green .trust-value { color: hsl(var(--success)); }
.trust-card.sev-amber .trust-value { color: hsl(var(--warning)); }
.trust-card.sev-red .trust-value   { color: hsl(var(--destructive)); }
.trust-value .u { font-size: 0.5em; font-weight: 600; color: hsl(var(--muted-foreground)); margin-left: 2px; }
.trust-gloss { font-family: var(--font-sans); font-size: 12px; line-height: 1.45; color: hsl(var(--muted-foreground)); margin-top: 10px; }
.trust-gloss b { color: hsl(var(--foreground)); font-weight: 600; }
.h2h { display: flex; align-items: stretch; gap: 0; margin: 2px 0; }
.h2h .side { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.h2h .side + .side { padding-left: 14px; border-left: 1px solid hsl(var(--border)); margin-left: 14px; }
.h2h .sk-label { font-family: var(--font-sans); font-size: 10px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.h2h .sk-val { font-family: var(--font-display); font-weight: 650; font-size: 27px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.h2h .side.model .sk-val { color: hsl(var(--destructive)); }
.h2h .side.avg .sk-val   { color: hsl(var(--foreground)); }
.h2h .sk-sub { font-family: var(--font-mono); font-size: 9.5px; color: hsl(var(--muted-foreground)); }
.verdict { margin-top: 11px; font-family: var(--font-sans); font-size: 12px; line-height: 1.4; color: hsl(var(--destructive)); font-weight: 600; }
.verdict span { display: block; font-weight: 400; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.bias-dir { display: inline-flex; align-items: center; gap: 5px; }
.bias-dir .arrow { color: hsl(var(--warning)); font-size: 0.7em; }

/* ── Trend strip ── */
.trend-strip { display: flex; align-items: center; gap: 22px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); padding: 14px 20px; margin-bottom: 14px; }
.trend-meta { display: flex; flex-direction: column; gap: 3px; min-width: 210px; }
.trend-meta .t-label { font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.trend-meta .t-desc { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); line-height: 1.4; }
.trend-svg { flex: 1; height: 46px; }
.trend-read { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 130px; }
.trend-read .now { font-family: var(--font-display); font-weight: 650; font-size: 22px; color: hsl(var(--warning)); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.trend-read .delta { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--destructive)); }
.trend-read .delta.up::before { content: "▲ "; font-size: 0.85em; }

/* ── Volume-tier panel ── */
.tier-panel { display: grid; grid-template-columns: 200px repeat(3, 1fr); gap: 0; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 14px; }
.tier-lead { padding: 16px 18px; border-right: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); display: flex; flex-direction: column; justify-content: center; }
.tier-lead h3 { font-family: var(--font-display); font-weight: 600; font-size: 14px; margin: 0 0 5px; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
.tier-lead p { font-family: var(--font-sans); font-size: 11.5px; line-height: 1.45; color: hsl(var(--muted-foreground)); margin: 0; }
.tier-col { padding: 16px 18px; border-right: 1px solid hsl(var(--border)); }
.tier-col:last-child { border-right: none; }
.tier-name { font-family: var(--font-sans); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.tier-name .vu { font-family: var(--font-mono); font-size: 9.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: hsl(var(--muted-foreground)); margin-left: auto; }
.tier-metrics { display: flex; gap: 20px; }
.tier-metric .tm-label { font-family: var(--font-sans); font-size: 10px; font-weight: 500; color: hsl(var(--muted-foreground)); letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 3px; }
.tier-metric .tm-val { font-family: var(--font-display); font-weight: 650; font-size: 24px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tier-metric .tm-val .u { font-size: 0.5em; font-weight: 600; color: hsl(var(--muted-foreground)); margin-left: 1px; }
.tm-val.err-poor { color: hsl(var(--destructive)); }
.tm-val.err-mid  { color: hsl(var(--warning)); }
.tm-val.bias     { color: hsl(var(--warning)); }
.tm-val.bias-bad { color: hsl(var(--destructive)); }
.tier-note { font-family: var(--font-sans); font-size: 10.5px; color: hsl(var(--muted-foreground)); margin-top: 10px; font-style: italic; }

/* ── Distribution chip ── */
.dist-strip { display: flex; align-items: center; gap: 18px; padding: 13px 16px; border-bottom: 1px solid hsl(var(--border)); }
.dist-title { font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: hsl(var(--foreground)); white-space: nowrap; }
.dist-title small { display: block; font-weight: 400; color: hsl(var(--muted-foreground)); font-size: 11px; margin-top: 1px; }
.dist-bar { flex: 1; display: flex; height: 24px; border-radius: 6px; overflow: hidden; border: 1px solid hsl(var(--border)); }
.dist-seg { display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: #fff; min-width: 18px; }
.dist-seg.good { background: hsl(var(--success)); }
.dist-seg.ok   { background: hsl(var(--warning)); }
.dist-seg.poor { background: hsl(var(--destructive)); }
.dist-key { display: flex; gap: 16px; }
.dist-key span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.dist-key i { width: 9px; height: 9px; border-radius: 2px; }
.dist-key b { color: hsl(var(--foreground)); font-weight: 600; }

/* ── Ledger cells: error chip, tier pill, beats badge, band ── */
.mape-chip { font-family: var(--font-mono); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; display: inline-block; }
.mape-chip.good { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); }
.mape-chip.warn { background: hsl(var(--warning) / 0.14); color: hsl(var(--warning)); }
.mape-chip.bad  { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
.tier-pill { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.02em; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); text-transform: uppercase; display: inline-block; }
.tier-pill.high { background: hsl(var(--foreground) / 0.08); color: hsl(var(--foreground)); }
.beats { font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; }
.beats .pip { width: 6px; height: 6px; border-radius: 999px; }
.beats.yes { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); border-color: hsl(var(--success) / 0.3); }
.beats.yes .pip { background: hsl(var(--success)); }
.beats.no { background: hsl(var(--destructive) / 0.10); color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.25); }
.beats.no .pip { background: hsl(var(--destructive)); }
.band-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.band-track { flex: 1; height: 7px; background: hsl(var(--muted)); border-radius: 999px; position: relative; overflow: hidden; }
.band-claim { position: absolute; top: -3px; bottom: -3px; left: 80%; width: 2px; background: hsl(var(--foreground)); z-index: 2; }
.band-fill { height: 100%; border-radius: 999px; }
.band-fill.lo  { background: hsl(var(--destructive)); }
.band-fill.mid { background: hsl(var(--warning)); }
.band-fill.hi  { background: hsl(var(--success)); }
.band-val { font-family: var(--font-mono); font-size: 12px; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; color: hsl(var(--foreground)); }
.bias-cap { font-family: var(--font-mono); font-size: 9.5px; color: hsl(var(--muted-foreground)); display: block; margin-top: 2px; }

/* ── Notes + pending state ── */
.method-cap { font-family: var(--font-sans); font-size: 11.5px; color: hsl(var(--muted-foreground)); font-style: italic; margin-top: 10px; line-height: 1.45; }
.excluded-note { display: flex; align-items: center; gap: 9px; padding: 12px 18px; border-top: 1px solid hsl(var(--border)); font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); }
.excluded-note svg { flex: none; color: hsl(var(--muted-foreground)); }
.excluded-note b { color: hsl(var(--foreground)); font-weight: 600; }
.pending-banner { display: flex; align-items: center; gap: 12px; background: hsl(var(--warning) / 0.08); border: 1px solid hsl(var(--warning) / 0.35); border-radius: var(--radius-lg); padding: 13px 18px; margin-bottom: 14px; }
.pending-banner .pb-dot { width: 9px; height: 9px; border-radius: 999px; background: hsl(var(--warning)); flex: none; animation: pb-pulse 1.4s ease-in-out infinite; }
@keyframes pb-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.pending-banner .pb-text { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--foreground)); line-height: 1.45; }
.pending-banner .pb-text b { font-weight: 600; }
.pending-banner .pb-text span { color: hsl(var(--muted-foreground)); }
.pending-ledger { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 56px 28px; text-align: center; }
.pending-ledger .pl-spin { width: 26px; height: 26px; border-radius: 999px; border: 2.5px solid hsl(var(--border)); border-top-color: hsl(var(--warning)); animation: pl-spin 0.8s linear infinite; margin-bottom: 8px; }
@keyframes pl-spin { 100% { transform: rotate(360deg); } }
.pending-ledger h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0; color: hsl(var(--foreground)); letter-spacing: -0.01em; }
.pending-ledger p { font-family: var(--font-sans); font-size: 12.5px; color: hsl(var(--muted-foreground)); margin: 0; max-width: 440px; line-height: 1.5; }

/* ── PO add-line SKU picker (type-to-search combobox) ─────────────────────
   Rich dropdown under the add-line SKU field on the PO detail page. Popover
   styling follows the .sheet overlay (card bg, border, elevated shadow).
   Behaviour lives in po-line-picker.js. */
.po-sku-combo { position: relative; }
/* position:fixed (coords set by po-line-picker.js against the input's rect)
   so the dropdown escapes the .data-slab's overflow:hidden clipping. */
.po-sku-listbox {
  position: fixed;
  z-index: 1000;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-width: 460px;
  max-height: 320px;
  overflow-y: auto;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  box-shadow: 0 12px 32px -10px hsl(222 47% 11% / 0.28);
}
.po-sku-listbox[hidden] { display: none; }
.po-sku-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.po-sku-option.active { background: hsl(var(--muted)); }
.po-sku-thumb {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}
.po-sku-thumb--empty { display: inline-block; }
.po-sku-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.po-sku-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--foreground));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.po-sku-code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.po-sku-price {
  margin-left: auto;
  flex: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}
.po-sku-option mark {
  background: hsl(var(--warning) / 0.28);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.po-sku-empty {
  padding: 10px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════════════════
   COMPONENTS & MANUFACTURER POs  (migration 0031)
   Catalog ledger monogram, inline manufacturer filter, and the component
   sub-rows nested under product lines on a manufacturer PO. Everything
   else reuses existing primitives (slab/title-slab, stats-slab, ledger,
   tag/tag-ok/tag-warn/tag-none, catalog-tag, edit-grid, num-input).
   ═══════════════════════════════════════════════════════════════════════ */

/* Component ledger cell — monogram + name + meta (cloned from .vendor-cell) */
.component-cell { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 12px; }
.component-mark {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 12px;
  background: hsl(var(--secondary)); color: hsl(var(--foreground));
}
.component-mark.inactive { opacity: 0.5; }
.component-name { font-family: var(--font-sans); font-weight: 550; font-size: 13.5px; color: hsl(var(--foreground)); }
.component-meta { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); margin-top: 1px; }
.component-link { text-decoration: none; }
.component-link:hover .component-name { color: hsl(var(--primary)); }

/* Inline manufacturer filter, pinned to the right of a ledger filter-bar */
.filter-bar .ledger-filter-form { margin-left: auto; display: flex; align-items: center; }
.ledger-filter-select {
  font-family: var(--font-sans); font-size: 12.5px;
  padding: 5px 10px; border-radius: var(--radius-md);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--foreground));
}

/* Manufacturer PO — component lines nested under their product line. */
.ledger tr.comp-subrow > td { background: hsl(var(--muted) / 0.45); }
.comp-subrow .comp-lead { padding-left: 46px !important; position: relative; }
.comp-subrow .comp-lead .arrow { position: absolute; left: 24px; color: hsl(var(--muted-foreground)); }
.comp-subrow .comp-part { font-family: var(--font-mono); font-size: 10.5px; color: hsl(var(--muted-foreground)); }
.comp-subrow .comp-note {
  font-family: var(--font-mono); font-size: 10px; color: hsl(var(--muted-foreground));
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Bill-of-materials card on the SKU detail page (inline editor) */
.bom-cost-readout { text-align: right; line-height: 1; }
.bom-cost-val { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: hsl(var(--foreground)); }
.bom-cost-lbl { font-family: var(--font-sans); font-size: 12px; color: hsl(var(--muted-foreground)); margin-left: 4px; }
.bom-add-bar { border-top: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.4); }
.bom-add-form { display: flex; align-items: end; gap: 12px; padding: 14px 20px; flex-wrap: wrap; }
.bom-add-form .field { margin: 0; }

/* Component photo — edit-page field + ledger thumbnail */
.component-image-field { display: flex; gap: 16px; align-items: flex-start; }
.component-image-preview {
  width: 96px; height: 96px; flex: none; overflow: hidden;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius-md);
  background: hsl(var(--muted)); display: grid; place-items: center;
}
.component-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.component-image-empty {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.06em; color: hsl(var(--muted-foreground));
}
.component-image-inputs { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.component-image-remove {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: hsl(var(--muted-foreground));
}
.component-thumb {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  object-fit: cover; border: 1px solid hsl(var(--border)); background: hsl(var(--muted));
}

/* Inline component thumbnail inside PO component sub-rows / totals */
.comp-thumb {
  width: 24px; height: 24px; border-radius: 4px; object-fit: cover;
  vertical-align: middle; margin-right: 6px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted));
}
