/* HiLLARY profile `service`: service sites only (factory admin, target-hub, consoles, ERP). Products, bots, reports and
   decks stay on the base kit. Import after tokens.css and shadcn-theme.css and set <html data-profile="service">.
   Theme: OS preference, or pin it with data-theme="light|dark" (or .light/.dark) on <html>.
   Font: Manrope variable (`@fontsource-variable/manrope`, family «Manrope Variable»). Decision: Anton 2026-11-22.
   Palette v2 «graphite» (Anton 2026-11-22: the warm brown dark theme is out): cool neutral greys on the Radix slate
   scale, depth from lighter surfaces and 1px borders instead of shadows, brand teal accent, coral only in charts. */

:root[data-profile="service"],
:root[data-profile="service"]:is([data-theme="light"], .light) {
  color-scheme: light;
  /* Manrope has no Ukrainian apostrophe ʼ (U+02BC): the browser takes it from the next font that has it */
  --hl-font-ui: "Manrope Variable", Manrope, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Roboto, "Noto Sans", "DejaVu Sans", Arial, sans-serif;
  --hl-radius-sm: 6px;
  --hl-radius-md: 8px;
  --hl-radius-lg: 12px;

  --hl-bg: #f4f5f7;
  --hl-surface: #ffffff;
  --hl-surface-2: #f0f0f3;
  --hl-text: #1c2024;
  --hl-muted: #60646c;
  --hl-border: #e0e1e6;
  --hl-border-strong: #b9bbc6;
  --hl-primary: #1c2024;
  --hl-on-primary: #ffffff;
  --hl-accent: #194b48;
  --hl-on-accent: #ffffff;
  --hl-accent-ink: #194b48;
  --hl-nav: #1c2024;
  --hl-on-nav: #ffffff;

  --hl-success: #17704a;
  --hl-on-success: #ffffff;
  --hl-success-ink: #17704a;
  --hl-success-soft: #e6f6eb;
  --hl-warning: #9a5b00;
  --hl-on-warning: #ffffff;
  --hl-warning-ink: #9a5b00;
  --hl-warning-soft: #fdf1cf;
  --hl-danger: #c62a2f;
  --hl-on-danger: #ffffff;
  --hl-danger-ink: #c62a2f;
  --hl-danger-soft: #feebec;
  --hl-info: #0a5fa8;
  --hl-on-info: #ffffff;
  --hl-info-ink: #0a5fa8;
  --hl-info-soft: #e6f4fe;
  --hl-neutral-soft: #f0f0f3;
  --hl-neutral-ink: #60646c;
  --hl-row-hover: #f6f6f8;
  --hl-row-active: #eeeef1;
  /* charts: coral = the current period / the key series, slate = comparison, teal and amber next; at most 4 in one chart */
  --hl-chart-1: #d3411c;
  --hl-chart-2: #60646c;
  --hl-chart-3: #0f7f6e;
  --hl-chart-4: #a86400;
  --hl-chart-5: #6e56cf;
  --hl-chart-6: #0d74ce;
  --hl-chart-other: #b9bbc6;

  /* service layer: page, the bar and the dock (the only translucent elements), panels, depth */
  --sv-page: #f4f5f7;
  --sv-rail: rgb(255 255 255 / 86%);
  --sv-rim: #e0e1e6;
  --sv-gloss: transparent;
  --sv-edge-shade: transparent;
  --sv-panel: #ffffff;
  --sv-raised: #f6f6f8;
  --sv-inner: #f0f0f3;
  --sv-shadow: 0 1px 2px rgb(16 24 40 / 5%);
  --sv-blur: 12px;
  --sv-pick: #e8e8ec;
  --sv-pick-ink: #1c2024;
}

@media (prefers-color-scheme: dark) {
  :root[data-profile="service"]:not([data-theme="light"]):not(.light) {
    color-scheme: dark;
    --hl-bg: #111113;
    --hl-surface: #18191b;
    --hl-surface-2: #212225;
    --hl-text: #edeef0;
    --hl-muted: #b0b4ba;
    --hl-border: #2e3135;
    --hl-border-strong: #5a6169;
    --hl-primary: #edeef0;
    --hl-on-primary: #111113;
    --hl-accent: #5fc9b5;
    --hl-on-accent: #0b1a17;
    --hl-accent-ink: #5fc9b5;
    --hl-nav: #edeef0;
    --hl-on-nav: #111113;
    --hl-success: #3dd68c;
    --hl-on-success: #0e1512;
    --hl-success-ink: #3dd68c;
    --hl-success-soft: #132d21;
    --hl-warning: #ffca16;
    --hl-on-warning: #16120c;
    --hl-warning-ink: #ffca16;
    --hl-warning-soft: #302008;
    --hl-danger: #ff9592;
    --hl-on-danger: #191111;
    --hl-danger-ink: #ff9592;
    --hl-danger-soft: #3b1219;
    --hl-info: #70b8ff;
    --hl-on-info: #0d1520;
    --hl-info-ink: #70b8ff;
    --hl-info-soft: #0d2847;
    --hl-neutral-soft: #272a2d;
    --hl-neutral-ink: #b0b4ba;
    --hl-row-hover: #1d1e21;
    --hl-row-active: #232528;
    --hl-chart-1: #ff9177;
    --hl-chart-2: #b0b4ba;
    --hl-chart-3: #4cc9b0;
    --hl-chart-4: #f1be58;
    --hl-chart-5: #a594f9;
    --hl-chart-6: #70b8ff;
    --hl-chart-other: #5a6169;
    --sv-page: #111113;
    --sv-rail: rgb(24 25 27 / 86%);
    --sv-rim: #26282b;
    --sv-gloss: transparent;
    --sv-edge-shade: transparent;
    --sv-panel: #18191b;
    --sv-raised: #212225;
    --sv-inner: #1d1e21;
    --sv-shadow: 0 1px 2px rgb(0 0 0 / 35%);
    --sv-pick: #2e3135;
    --sv-pick-ink: #edeef0;
  }
}

:root[data-profile="service"]:is([data-theme="dark"], .dark) {
  color-scheme: dark;
  --hl-bg: #111113;
  --hl-surface: #18191b;
  --hl-surface-2: #212225;
  --hl-text: #edeef0;
  --hl-muted: #b0b4ba;
  --hl-border: #2e3135;
  --hl-border-strong: #5a6169;
  --hl-primary: #edeef0;
  --hl-on-primary: #111113;
  --hl-accent: #5fc9b5;
  --hl-on-accent: #0b1a17;
  --hl-accent-ink: #5fc9b5;
  --hl-nav: #edeef0;
  --hl-on-nav: #111113;
  --hl-success: #3dd68c;
  --hl-on-success: #0e1512;
  --hl-success-ink: #3dd68c;
  --hl-success-soft: #132d21;
  --hl-warning: #ffca16;
  --hl-on-warning: #16120c;
  --hl-warning-ink: #ffca16;
  --hl-warning-soft: #302008;
  --hl-danger: #ff9592;
  --hl-on-danger: #191111;
  --hl-danger-ink: #ff9592;
  --hl-danger-soft: #3b1219;
  --hl-info: #70b8ff;
  --hl-on-info: #0d1520;
  --hl-info-ink: #70b8ff;
  --hl-info-soft: #0d2847;
  --hl-neutral-soft: #272a2d;
  --hl-neutral-ink: #b0b4ba;
  --hl-row-hover: #1d1e21;
  --hl-row-active: #232528;
  --hl-chart-1: #ff9177;
  --hl-chart-2: #b0b4ba;
  --hl-chart-3: #4cc9b0;
  --hl-chart-4: #f1be58;
  --hl-chart-5: #a594f9;
  --hl-chart-6: #70b8ff;
  --hl-chart-other: #5a6169;
  --sv-page: #111113;
  --sv-rail: rgb(24 25 27 / 86%);
  --sv-rim: #26282b;
  --sv-gloss: transparent;
  --sv-edge-shade: transparent;
  --sv-panel: #18191b;
  --sv-raised: #212225;
  --sv-inner: #1d1e21;
  --sv-shadow: 0 1px 2px rgb(0 0 0 / 35%);
  --sv-pick: #2e3135;
  --sv-pick-ink: #edeef0;
}

/* base */
:root[data-profile="service"] body {
  background: var(--sv-page);
  color: var(--hl-text);
  font-family: var(--hl-font-ui);
  font-variant-numeric: tabular-nums;
}

/* the bar and the dock: translucent so content scrolls under them (R-10: these two only) */
.sv-bar,
.sv-dock {
  border: 1px solid var(--sv-rim);
  background: var(--sv-rail);
  box-shadow: var(--sv-shadow);
  backdrop-filter: blur(var(--sv-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--sv-blur)) saturate(1.2);
}
.sv-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 52px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--hl-radius-lg);
}
.sv-dock {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--hl-radius-lg);
}
.sv-dock a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0 14px;
  border-radius: var(--hl-radius-md);
  color: var(--hl-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}
.sv-dock a:hover { background: var(--sv-raised); color: var(--hl-text); }
.sv-dock a[aria-current="page"] { background: var(--sv-pick); color: var(--sv-pick-ink); }

/* panels and tiles: flat surfaces, a 1px border carries the edge */
.sv-panel {
  border: 1px solid var(--sv-rim);
  border-radius: var(--hl-radius-lg);
  background: var(--sv-panel);
  box-shadow: var(--sv-shadow);
  padding: 16px;
  min-inline-size: 0;
}
.sv-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-block-end: 12px; }
.sv-panel-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.sv-panel-head p { margin: 2px 0 0; color: var(--hl-muted); font-size: 12px; }
.sv-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-block-size: 96px;
  padding: 14px 16px;
  border: 1px solid var(--sv-rim);
  border-radius: var(--hl-radius-lg);
  background: var(--sv-panel);
  box-shadow: var(--sv-shadow);
  min-inline-size: 0;
}
.sv-metric-label { color: var(--hl-muted); font-size: 12px; font-weight: 600; }
.sv-metric-value {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sv-metric-foot { display: flex; align-items: center; gap: 6px; color: var(--hl-muted); font-size: 12px; }

/* sparkline in a tile: an inline <svg class="sv-spark"> with one <path>; no axes, the tile names the period */
.sv-spark { display: block; inline-size: 100%; block-size: 32px; margin-block-start: auto; overflow: visible; }
.sv-spark path { fill: none; stroke: var(--sv-spark, var(--hl-chart-1)); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sv-spark path + path { stroke: var(--hl-chart-2); stroke-dasharray: 3 3; opacity: 0.7; }

/* ranked breakdown: label, bar, value (spend by account, orders by source); set --v: 0..1 on each row */
.sv-bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sv-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.sv-bars li > :last-child { font-weight: 600; text-align: end; }
.sv-bars li::after {
  content: "";
  grid-column: 1 / -1;
  block-size: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--sv-bar, var(--hl-chart-1)) calc(var(--v, 0) * 100%), var(--sv-inner) 0);
}

/* meter: plan vs fact, capacity; <div class="sv-meter" style="--v:.64"><span></span></div> plus a text value next to it */
.sv-meter { block-size: 8px; border-radius: 4px; background: var(--sv-inner); overflow: hidden; }
.sv-meter > span { display: block; block-size: 100%; inline-size: calc(var(--v, 0) * 100%); background: var(--sv-bar, var(--hl-accent)); border-radius: inherit; }
.sv-meter[data-tone="warn"] > span { background: var(--hl-warning); }
.sv-meter[data-tone="bad"] > span { background: var(--hl-danger); }

/* chart legend: a swatch and a word for every series */
.sv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--hl-muted); font-size: 12px; }
.sv-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sv-legend li::before { content: ""; inline-size: 10px; block-size: 3px; border-radius: 2px; background: var(--sv-swatch, var(--hl-chart-1)); }

/* dashboard grid: 12 columns on a desktop, one column on a phone */
.sv-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.sv-grid > * { grid-column: span 12; min-inline-size: 0; }
@media (min-width: 761px) {
  .sv-grid > .sv-span-3 { grid-column: span 3; }
  .sv-grid > .sv-span-4 { grid-column: span 4; }
  .sv-grid > .sv-span-5 { grid-column: span 5; }
  .sv-grid > .sv-span-6 { grid-column: span 6; }
  .sv-grid > .sv-span-7 { grid-column: span 7; }
  .sv-grid > .sv-span-8 { grid-column: span 8; }
}
@media (max-width: 760px) {
  .sv-grid > .sv-span-3 { grid-column: span 6; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .sv-grid > .sv-span-3 { grid-column: span 6; }
  .sv-grid > :is(.sv-span-4, .sv-span-5, .sv-span-7, .sv-span-8) { grid-column: span 12; }
}

/* status pill: dot + word, the colour is never the only signal */
.sv-pill {
  --sv-pill: var(--hl-neutral-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--hl-radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--sv-pill);
  /* on the panel colour: on --sv-inner the danger and warning words fall under 4.5:1 (hillary-erp, 2026-11-22) */
  background: color-mix(in srgb, var(--sv-pill) 12%, var(--sv-panel));
  white-space: nowrap;
}
.sv-pill::before {
  content: "";
  inline-size: 6px;
  block-size: 6px;
  border-radius: 50%;
  background: currentColor;
}
.sv-pill[data-tone="ok"] { --sv-pill: var(--hl-success-ink); }
.sv-pill[data-tone="warn"] { --sv-pill: var(--hl-warning-ink); }
.sv-pill[data-tone="bad"] { --sv-pill: var(--hl-danger-ink); }
.sv-pill[data-tone="info"] { --sv-pill: var(--hl-info-ink); }

/* dashboard: view head with a period switch, a delta next to a number, lanes of work */
.sv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-block-end: 16px;
}
.sv-head h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.sv-head p { margin: 4px 0 0; color: var(--hl-muted); font-size: 13px; }
.sv-seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--sv-rim);
  border-radius: var(--hl-radius-md);
  background: var(--sv-inner);
}
.sv-seg button {
  min-block-size: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--hl-radius-sm);
  background: transparent;
  color: var(--hl-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sv-seg button[aria-pressed="true"] { background: var(--sv-panel); color: var(--hl-text); box-shadow: var(--sv-shadow), 0 0 0 1px var(--sv-rim); }
.sv-seg button[aria-pressed="false"]:hover { color: var(--hl-text); }
.sv-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: var(--hl-radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--hl-success-ink);
  background: color-mix(in srgb, var(--hl-success-ink) 12%, transparent);
}
.sv-delta[data-tone="bad"] { color: var(--hl-danger-ink); background: color-mix(in srgb, var(--hl-danger-ink) 12%, transparent); }
/* Growth that is neither good nor bad (spend, volume): target-hub 2026-11-22. */
.sv-delta[data-tone="neutral"] { color: var(--hl-neutral-ink); background: color-mix(in srgb, var(--hl-neutral-ink) 12%, transparent); }
.sv-lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.sv-lane { min-inline-size: 0; padding: 8px; border: 1px solid var(--sv-rim); border-radius: var(--hl-radius-lg); background: var(--sv-inner); }
.sv-lane > h3 { display: flex; justify-content: space-between; margin: 2px 4px 8px; font-size: 12px; font-weight: 700; color: var(--hl-muted); }
.sv-item { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--sv-rim); border-radius: var(--hl-radius-md); background: var(--sv-panel); font-size: 13px; }
.sv-item + .sv-item { margin-block-start: 6px; }
.sv-item small { color: var(--hl-muted); }

/* dense table: dividers, not zebra; numbers right-aligned in .num cells */
.sv-table { inline-size: 100%; border-collapse: collapse; font-size: 13px; }
.sv-table th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hl-border);
  text-align: start;
  font-size: 12px;
  font-weight: 600;
  color: var(--hl-muted);
  background: var(--sv-panel);
}
.sv-table td { padding: 9px 10px; border-bottom: 1px solid var(--sv-rim); vertical-align: top; }
.sv-table tbody tr:last-child td { border-bottom: 0; }
.sv-table tbody tr:hover td { background: var(--hl-row-hover); }
.sv-table :is(th, td).num { text-align: end; white-space: nowrap; }
/* a wide table scrolls inside its panel, never the page sideways */
.sv-table-wrap { overflow-x: auto; margin-inline: -4px; padding-inline: 4px; }

/* phone: blur on the bar makes it the containing block of a fixed dock nested in it, so the dock would sit on the bar
   instead of the bottom of the screen (hillary-direct, 2026-11-22); the bar is solid there */
@media (max-width: 760px) {
  .sv-bar { background: var(--sv-panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
  .sv-bar,
  .sv-dock { background: var(--sv-panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sv-dock a { transition: none; }
}
@media (forced-colors: active) {
  .sv-panel, .sv-metric, .sv-dock, .sv-bar { border: 1px solid CanvasText; }
  .sv-dock a[aria-current="page"] { border: 2px solid Highlight; }
  .sv-meter > span, .sv-bars li::after { forced-color-adjust: none; }
}
