/* ==========================================================================
   ROL Command Center — styles
   Two themes on one set of tokens:
     studio   (default) Liz Wendy Beauty Studio: pearl neutrals, dusty rose, champagne gold
     terminal           dark executive: midnight black, frosted glass, neon emerald + cyan
   Fonts (Fraunces + Figtree) load from Google Fonts. If they can't load, the
   system fallbacks in --font-display / --font-ui take over.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@300..900&family=Fraunces:wght@300..700&display=swap");

/* ───────── tokens ───────── */
:root {
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-panel: 22px;
  --r-kpi: 16px;
  --r-inner: 12px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme="studio"] {
  color-scheme: light;
  --bg: #F2EDEB;
  --glow-a: rgba(181, 101, 122, .16);
  --glow-b: rgba(168, 132, 63, .11);
  --panel: #FBF8F7;
  --panel-inset: #F4EEEC;
  --line: rgba(42, 33, 39, .10);
  --line-strong: rgba(42, 33, 39, .20);
  --ink: #2A2127;
  --ink-2: #5B4E55;
  --ink-3: #6E6068;
  --accent: #B5657A;
  --accent-ink: #96475D;
  --accent-soft: rgba(181, 101, 122, .14);
  --gold: #A8843F;
  --gold-ink: #7E6127;
  --gold-soft: rgba(168, 132, 63, .18);
  --gain: #2F7F66;
  --gain-ink: #256B55;
  --gain-soft: rgba(47, 127, 102, .13);
  --loss: #B8434F;
  --loss-ink: #A3363F;
  --loss-soft: rgba(184, 67, 79, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 16px 36px -26px rgba(74, 42, 58, .45);
  --topbar-bg: rgba(242, 237, 235, .85);
  --skel-a: rgba(42, 33, 39, .06);
  --skel-b: rgba(42, 33, 39, .12);
  --focus: #96475D;
  --hero-wash: linear-gradient(135deg, rgba(47, 127, 102, .11), rgba(168, 132, 63, .09));
  --glass: none;
  --sticky-bg: #FBF8F7;
}

:root[data-theme="terminal"] {
  color-scheme: dark;
  --bg: #0A0B0D;
  --glow-a: rgba(16, 245, 164, .10);
  --glow-b: rgba(34, 211, 238, .10);
  --panel: rgba(255, 255, 255, .045);
  --panel-inset: rgba(255, 255, 255, .035);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --ink: #EEF1F4;
  --ink-2: #B0B7C1;
  --ink-3: #8A93A0;
  --accent: #22D3EE;
  --accent-ink: #67E3F5;
  --accent-soft: rgba(34, 211, 238, .14);
  --gold: #F5C56B;
  --gold-ink: #F8D48F;
  --gold-soft: rgba(245, 197, 107, .16);
  --gain: #10F5A4;
  --gain-ink: #10F5A4;
  --gain-soft: rgba(16, 245, 164, .12);
  --loss: #FF5C7A;
  --loss-ink: #FF8299;
  --loss-soft: rgba(255, 92, 122, .13);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 56px -34px rgba(0, 0, 0, .95);
  --topbar-bg: rgba(10, 11, 13, .74);
  --skel-a: rgba(255, 255, 255, .05);
  --skel-b: rgba(255, 255, 255, .11);
  --focus: #67E3F5;
  --hero-wash: linear-gradient(135deg, rgba(16, 245, 164, .10), rgba(34, 211, 238, .06));
  --glass: blur(18px) saturate(140%);
  --sticky-bg: #131417;
}

/* ───────── base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 88% -8%, var(--glow-a), transparent 70%),
    radial-gradient(760px 480px at -4% 4%, var(--glow-b), transparent 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
ul, ol { list-style: none; margin: 0; padding: 0; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 999px;
}
.skip-link:focus { top: 10px; }

.icon { flex: none; }

/* ───────── buttons & controls ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-primary[disabled] { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); height: 36px; padding: 0 16px; }
.btn-ghost:hover { background: var(--accent-soft); }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--accent-soft); }
.text-btn { background: none; border: 0; padding: 8px 6px; color: var(--ink-2); font-weight: 500; }
.text-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.select {
  height: 36px; padding: 0 34px 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background-color: transparent; color: var(--ink);
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  font-weight: 500; font-size: 14px;
}
.select option { color: #2A2127; background: #fff; }
.select-tenant { font-family: var(--font-display); font-size: 16px; font-weight: 500; height: 40px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  border: 1px solid var(--line-strong);
}
.seg-btn {
  height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg-sm .seg-btn { height: 28px; padding: 0 12px; font-size: 13px; }

/* ───────── sign in ───────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); display: grid; gap: 10px; padding: 36px 32px 32px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.login-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: -.01em; margin-top: 6px; }
.login-sub { color: var(--ink-2); margin-bottom: 10px; max-width: 34ch; }
.login-card label { font-weight: 600; font-size: 13px; }
.login-card input {
  height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--panel-inset); font-size: 16px;
}
.form-error { color: var(--loss-ink); font-size: 14px; }
.login-card .btn { margin-top: 8px; height: 46px; }

.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 18px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--gold));
}
:root[data-theme="terminal"] .brand-mark { color: #0A0B0D; background: linear-gradient(140deg, var(--gain), var(--accent)); }
.brand-mark-lg { width: 46px; height: 46px; border-radius: 14px; font-size: 26px; }

/* ───────── top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px clamp(16px, 3vw, 40px);
  background: var(--topbar-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 19px; letter-spacing: -.005em; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live[data-state="live"] .live-dot { background: var(--gain); box-shadow: 0 0 0 0 var(--gain); animation: pulse 2.4s ease-out infinite; }
.live[data-state="error"] { color: var(--loss-ink); }
.live[data-state="error"] .live-dot { background: var(--loss); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gain) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* ───────── layout ───────── */
.dash {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px;
  padding: 24px clamp(16px, 3vw, 40px) 56px; max-width: 1800px; margin: 0 auto;
}
.dash:focus { outline: none; }
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1.28fr 1fr; gap: 20px; }
.churn { grid-column: span 7; }
.capacity { grid-column: span 5; }
.clients { grid-column: span 8; }
.feed-panel { grid-column: span 4; }

/* ───────── card states (loading / error / ready) ───────── */
.card-skel, .card-err { display: none; }
[data-state="loading"] > .card-body, [data-state="error"] > .card-body { display: none; }
[data-state="loading"] > .card-skel { display: grid; }
[data-state="error"] > .card-err { display: flex; }

.card-skel { gap: 14px; padding: 4px 0; align-content: start; }
.skel {
  height: 14px; border-radius: 8px;
  background: linear-gradient(90deg, var(--skel-a), var(--skel-b), var(--skel-a)); background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skel-big { height: 38px; width: 62%; }
.skel:nth-child(2) { width: 84%; }
.skel:nth-child(3) { width: 58%; }
.skel:nth-child(4) { width: 92%; }
.skel:nth-child(5) { width: 70%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }

.card-err { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 0; }
.err-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--loss-ink); }
.err-msg { color: var(--ink-2); font-size: 14px; max-width: 46ch; margin-bottom: 8px; }

/* ───────── KPI cards ───────── */
.kpi {
  position: relative; overflow: hidden; min-height: 196px; padding: 20px 22px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-kpi);
  box-shadow: var(--shadow); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.kpi .card-body { display: grid; gap: 8px; position: relative; }
[data-state="loading"].kpi .card-skel { padding-top: 6px; }
.kpi-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.kpi-head h2 { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.kpi-period { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.kpi-value {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(34px, 3.1vw, 46px);
  letter-spacing: -.02em; min-height: 1.1em; margin-top: 4px;
}
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.kpi-note { color: var(--ink-2); }
.kpi-extra { font-size: 13px; color: var(--ink-2); }
.kpi-extra:empty { display: none; }
.spark { display: block; width: 100%; height: 38px; margin-top: 8px; overflow: visible; }
.spark-line { stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--accent-soft); stroke: none; }

.kpi-hero { border-color: color-mix(in srgb, var(--gain) 32%, var(--line)); }
.kpi-hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-wash); pointer-events: none; }
.kpi-hero .kpi-head h2 { color: var(--gain-ink); }
.kpi-hero .kpi-value { font-size: clamp(40px, 3.9vw, 58px); color: var(--gain-ink); }
.kpi-hero .spark-line { stroke: var(--gain); }
.kpi-hero .spark-area { fill: var(--gain-soft); }
:root[data-theme="terminal"] .kpi-hero { box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--gain) 22%, transparent), 0 0 44px -14px color-mix(in srgb, var(--gain) 45%, transparent); }
:root[data-theme="terminal"] .kpi-hero .odo { text-shadow: 0 0 24px color-mix(in srgb, var(--gain) 55%, transparent); }
:root[data-theme="terminal"] .spark-line { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--accent) 80%, transparent)); }
:root[data-theme="terminal"] .kpi-hero .spark-line { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--gain) 80%, transparent)); }

.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.delta.up { color: var(--gain-ink); }
.delta.down { color: var(--loss-ink); }
.delta.flat, .delta.none { color: var(--ink-3); font-weight: 500; }

/* ───────── kinetic number ticker ───────── */
.odo {
  display: inline-flex; align-items: flex-end; line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum";
}
.odo .d { display: inline-block; height: 1.1em; width: 1ch; overflow: hidden; }
.odo .reel {
  display: flex; flex-direction: column;
  transform: translateY(calc(var(--p, 0) * -1.1em));
  transition: transform 1.2s var(--ease-out);
}
.odo .n { display: block; height: 1.1em; line-height: 1.1em; text-align: center; }
.odo .sep { display: inline-block; height: 1.1em; line-height: 1.1em; }
.odo .minor { font-size: .5em; margin-bottom: .13em; opacity: .8; }
.odo .d.minor { width: .9ch; }
.odo-plain { font-family: var(--font-display); color: var(--ink-3); }

/* ───────── panels ───────── */
.panel {
  position: relative; padding: 24px 26px 26px; min-width: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
  box-shadow: var(--shadow); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 23px; letter-spacing: -.01em; }
.panel-sub { color: var(--ink-2); font-size: 14px; margin-top: 2px; max-width: 52ch; }
.panel-foot { margin-top: 16px; font-size: 13px; color: var(--ink-3); max-width: 60ch; }

/* ───────── Churn Deflector ───────── */
.churn-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--r-inner); background: var(--panel-inset); border: 1px solid var(--line); }
.stat-label { font-size: 13px; font-weight: 600; }
.stat-gain .stat-label { color: var(--gain-ink); }
.stat-loss .stat-label { color: var(--loss-ink); }
.stat-value { font-family: var(--font-display); font-weight: 500; font-size: 32px; letter-spacing: -.015em; line-height: 1.15; }
.stat-gain .stat-value { color: var(--gain-ink); }
.stat-loss .stat-value { color: var(--loss-ink); }
.stat-note { font-size: 13px; color: var(--ink-2); }

.flow { display: flex; height: 16px; gap: 3px; margin-top: 22px; border-radius: 999px; overflow: hidden; }
.flow .seg-gain { background: var(--gain); }
.flow .seg-loss { background: var(--loss); }
.flow .seg-idle { background: var(--line-strong); }
.flow .seg-empty { flex: 1; background: var(--skel-a); }
.flow > span { min-width: 6px; }

.legend { display: grid; gap: 8px; margin-top: 14px; font-size: 14px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .count { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch-gain { background: var(--gain); }
.swatch-loss { background: var(--loss); }
.swatch-idle { background: var(--line-strong); }
.legend-total { padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line); font-weight: 600; }

.churn-trend h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.bars-chart { width: 100%; height: auto; display: block; overflow: visible; }
.bars-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.bars-chart .axis-label { fill: var(--ink-3); font-size: 12px; font-family: var(--font-ui); }
.bars-chart .bar-gain { fill: var(--gain); opacity: .5; }
.bars-chart .bar-loss { fill: var(--loss); opacity: .45; }
.bars-chart .is-current .bar-gain, .bars-chart .is-current .bar-loss { opacity: 1; }
.bars-chart .is-current .axis-label { fill: var(--ink); font-weight: 700; }
.legend-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.legend-inline .swatch { width: 10px; height: 10px; border-radius: 3px; }
.legend-inline .swatch + * { margin-right: 10px; }

.howto { margin-top: 22px; font-size: 13.5px; color: var(--ink-2); }
.howto summary { cursor: pointer; font-weight: 600; color: var(--ink); width: fit-content; }
.howto p { margin-top: 8px; max-width: 78ch; }

/* ───────── Artist capacity ───────── */
.artists { display: grid; gap: 18px; }
.artist { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 6px 18px; align-items: center; padding: 16px 18px; border-radius: var(--r-inner); background: var(--panel-inset); border: 1px solid var(--line); }
.artist-name { font-family: var(--font-display); font-size: 19px; font-weight: 500; }
.artist-pct { font-family: var(--font-display); font-size: 26px; font-weight: 500; text-align: right; letter-spacing: -.01em; }
.artist-pct.is-full { color: var(--gold-ink); }
.meter { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--skel-a); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); width: 0; transition: width 1.1s var(--ease-out); }
.meter.is-full > span { background: var(--gold); }
.artist-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13.5px; color: var(--ink-2); }
.artist-meta b { color: var(--ink); font-weight: 600; }
.artist-strip { grid-column: 2; justify-self: end; width: 100px; height: 28px; }
.artist-strip .col rect { fill: var(--accent); opacity: .35; }
.artist-strip .col.is-current rect { opacity: 1; }
.artist-flag { font-size: 12.5px; font-weight: 600; color: var(--gold-ink); background: var(--gold-soft); padding: 1px 9px; border-radius: 999px; }

/* ───────── Clients table ───────── */
.search { position: relative; width: min(320px, 100%); }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 40px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel-inset); font-size: 14.5px;
}
.search input::placeholder { color: var(--ink-3); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: grid; pointer-events: none; }

.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 12px 10px;
  border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.table th.num, .table td.num { text-align: right; }
.th-btn { background: none; border: 0; padding: 0; font-weight: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.th-btn:hover { color: var(--ink); }
.th-btn .icon { opacity: 0; }
th[aria-sort="ascending"] .th-btn, th[aria-sort="descending"] .th-btn { color: var(--ink); }
th[aria-sort="ascending"] .icon, th[aria-sort="descending"] .icon { opacity: 1; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--panel-inset); }
.client-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.client-sub { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; }
.tag-returning { background: var(--gain-soft); color: var(--gain-ink); }
.tag-new { background: var(--accent-soft); color: var(--accent-ink); }
.tag-upcoming { background: var(--gold-soft); color: var(--gold-ink); }
.contact { display: flex; align-items: flex-start; gap: 8px; }
.contact-lines { display: grid; gap: 1px; font-size: 14px; }
.contact-lines .email { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.reveal { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--ink-2); }
.reveal:hover { background: var(--accent-soft); color: var(--ink); }
.ltv { font-family: var(--font-display); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; }
.table td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.table-count { font-size: 13.5px; color: var(--ink-2); }
.empty { padding: 28px 8px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); margin-bottom: 2px; }

/* ───────── Activity feed ───────── */
.feed-panel .card-body { max-height: 720px; overflow-y: auto; margin: 0 -10px; padding: 0 10px; scrollbar-width: thin; }
.feed-day { position: sticky; top: 0; z-index: 1; padding: 6px 0; font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--sticky-bg); }
.feed-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.feed-item.is-new { animation: arrive 2.6s var(--ease-out); }
@keyframes arrive { from { background: var(--accent-soft); } to { background: transparent; } }
.feed-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-inset); color: var(--ink-2); border: 1px solid var(--line); }
.feed-icon.t-created { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.feed-icon.t-rescheduled { color: var(--gain-ink); background: var(--gain-soft); border-color: transparent; }
.feed-icon.t-cancelled { color: var(--loss-ink); background: var(--loss-soft); border-color: transparent; }
.feed-text { font-size: 14.5px; }
.feed-text b { font-weight: 650; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.feed-badge { font-weight: 650; }
.feed-badge.gain { color: var(--gain-ink); }
.feed-badge.loss { color: var(--loss-ink); }
.feed-time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; padding-top: 2px; }

/* ───────── responsive ───────── */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .churn, .capacity, .clients, .feed-panel { grid-column: 1 / -1; }
  .feed-panel .card-body { max-height: 520px; }
}
@media (max-width: 760px) {
  .topbar { gap: 12px; }
  .tenant { order: 3; }
  .seg { order: 4; }
  .topbar-end { order: 2; margin-left: auto; }
  .brand-name { display: none; }
  .churn-grid { grid-template-columns: 1fr; gap: 24px; }
  .kpis { grid-template-columns: 1fr; }
  .panel { padding: 20px 18px 22px; }
  .stat-value { font-size: 28px; }
}
@media (max-width: 480px) {
  .live-text { display: none; }
  .stat-pair { grid-template-columns: 1fr; }
}

/* ───────── motion preferences ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ───────── Upcoming-pipeline KPI cards (blue) ───────── */
:root[data-theme="studio"]   { --pipeline: #1F5FA8; }
:root[data-theme="terminal"] { --pipeline: #5BA8FF; }

.kpi.is-pipeline .kpi-val { color: var(--pipeline); }
.kpi.is-pipeline .delta.none { color: var(--pipeline); font-weight: 600; }
:root[data-theme="terminal"] .kpi.is-pipeline .odo { text-shadow: 0 0 24px color-mix(in srgb, var(--pipeline) 45%, transparent); }

.kpi.is-pipeline .kpi-head { flex-wrap: nowrap; overflow: hidden; }
.kpi.is-pipeline .kpi-label { white-space: nowrap; }
.kpi.is-pipeline .kpi-period { 
    font-size: 12px; 
    min-width: 0; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

/* ───────── Revenue & Risk Outlook: upcoming (blue) ───────── */
.text-pipeline-blue { color: var(--pipeline, #1F5FA8); }
.stat-pipeline { grid-column: 1 / -1; }
.stat-pipeline .stat-label { color: var(--pipeline, #1F5FA8); }
.bar-upcoming { fill: var(--pipeline, #1F5FA8); opacity: .5; }
.is-current .bar-upcoming { opacity: 1; }
.swatch-upcoming { background: var(--pipeline, #1F5FA8); }

/* ───────── Artist capacity: list container ───────── */
.artist-list { display: grid; gap: 18px; }

/* ───────── Clients: lifecycle filter pills ───────── */
.table-filters { margin: -3px -3px 11px; padding: 3px; overflow-x: auto; }
.table-filters .seg { max-width: none; }
.table-filters .seg-btn { white-space: nowrap; }
.seg-count { margin-left: 4px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.seg-count:empty { display: none; }
.seg-btn[aria-pressed="true"] .seg-count { color: inherit; }
@media (max-width: 480px) {
  .table-filters .seg-btn { padding: 0 8px; }
  .table-filters .seg-count { margin-left: 3px; }
}

/* Scrollable Client Directory */
.client-directory-wrapper {
  max-height: 600px;
  overflow-y: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.client-directory-wrapper::-webkit-scrollbar {
  width: 6px;
}
.client-directory-wrapper::-webkit-scrollbar-track {
  background: var(--card2); 
}
.client-directory-wrapper::-webkit-scrollbar-thumb {
  background: var(--gold-dim); 
  border-radius: 4px;
}
.client-directory-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--gold); 
}

.client-directory-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card2); 
}

/* --- TABS & TRENDING MODULE --- */
.cc-tab-nav {
  grid-column: 1 / -1;
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line, #2d3748);
  padding-bottom: 0.5rem;
  width: 100%;
}

.cc-tab-btn {
  background: none;
  border: none;
  color: var(--ink-2, #a0aec0);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
}

.cc-tab-btn.active {
  color: var(--ink, #fff);
}

.cc-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent, #3182ce);
}

.cc-tab-view {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
}

.cc-tab-view[hidden] {
  display: none !important;
}

/* Trending Module Styles */
#trending-module {
  grid-column: 1 / -1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.cc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cc-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cc-title-group h3 {
  margin: 0;
  font-size: 1.1rem;
  font-family: var(--font-display);
  font-weight: 500;
}

.cc-badge {
  background: var(--gold-soft);
  color: var(--gold-ink);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.cc-filter-pills .pill {
  background: var(--panel-inset);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.cc-filter-pills .pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.cc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.cc-table th {
  padding: 8px 12px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
}

.cc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

/* Velocity Colors */
.velocity-up { color: var(--gain-ink); font-weight: 600; }
.velocity-down { color: var(--loss-ink); font-weight: 600; }
.velocity-flat { color: var(--ink-3); }

/* Status Badges */
.tag-surge { background: var(--gain-soft); color: var(--gain-ink); padding: 2px 6px; border-radius: 3px; font-size: 0.7rem; font-weight: 600; }
.tag-steady { background: var(--panel-inset); color: var(--ink-2); padding: 2px 6px; border-radius: 3px; font-size: 0.7rem; font-weight: 600; }
.tag-loss { background: var(--loss-soft); color: var(--loss-ink); padding: 2px 6px; border-radius: 3px; font-size: 0.7rem; font-weight: 600; }

/* Category Tag */
.badge-cat {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: var(--panel-inset);
  color: var(--ink-2);
  border: 1px solid var(--line);
}

/* 10-Row Scrollable Container */
.trending-table-container {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  scrollbar-width: thin;
}

/* Sticky Header on Scroll */
.trending-table-container thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--sticky-bg);
}

/* ───────── Trending Visual Analytics (Phase 1) ───────── */
.trending-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.trending-hero-card {
  padding: 14px 16px;
  border-radius: var(--r-inner);
  background: var(--panel-inset);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.th-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}

.th-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-metrics {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.th-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
}

.th-val.text-gain { color: var(--gain-ink); }
.th-sub { font-size: 12.5px; color: var(--ink-2); }

/* Category Proportional Strip */
.category-strip-card {
  padding: 16px 18px;
  border-radius: var(--r-inner);
  background: var(--panel-inset);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.category-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cs-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.cs-total { font-size: 13px; font-weight: 600; color: var(--ink-2); }

.category-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--skel-a);
  gap: 2px;
}

.cat-seg {
  height: 100%;
  transition: width 0.6s var(--ease-out);
}

/* Category Legend */
.category-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 12px;
  font-size: 12.5px;
}

.cat-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.cat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-legend-item b {
  color: var(--ink);
  font-weight: 600;
}

/* Palette assignment for the 6 core Business Units */
.cat-bg-nails { background-color: var(--accent); }
.cat-bg-pmu { background-color: var(--gold); }
.cat-bg-facials { background-color: var(--gain); }
.cat-bg-waxing { background-color: #e07a5f; }
.cat-bg-makeup { background-color: #9d4edd; }
.cat-bg-lashext { background-color: var(--pipeline, #1f5fa8); }
.cat-bg-other { background-color: var(--ink-3); }

@media (max-width: 860px) {
  .trending-hero-grid {
    grid-template-columns: 1fr;
  }
}

.client-latest {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-due {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag-risk {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Client Retention Dossier (Slide-Out Drawer) ── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.drawer-backdrop.is-open {
  opacity: 1;
}

.client-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: var(--bg-card, #111418);
  border-left: 1px solid var(--border-subtle, #252b36);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
}
.client-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle, #252b36);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.drawer-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3, #7b8594);
  display: block;
  margin-bottom: 0.2rem;
}
.drawer-client-name {
  font-size: 1.25rem;
  margin: 0 0 0.4rem 0;
  color: var(--ink-1, #f0f3f6);
}
.drawer-client-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--ink-3, #7b8594);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
}
.drawer-close-btn:hover { color: var(--ink-1, #f0f3f6); }

.drawer-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dossier-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle, #252b36);
  border-radius: 8px;
  padding: 1rem;
}
.dossier-card-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3, #7b8594);
  margin: 0 0 0.75rem 0;
}
.cadence-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.cadence-stat:last-child { margin-bottom: 0; }
.cadence-label { font-size: 0.85rem; color: var(--ink-2, #a2acba); }

.dossier-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.dossier-mini-label {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-3, #7b8594);
  margin-bottom: 0.2rem;
}
.dossier-value {
  font-size: 1.05rem;
  color: var(--ink-1, #f0f3f6);
}

.affinity-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-hover, #1d222b);
  margin-bottom: 0.6rem;
}
.affinity-legend {
  font-size: 0.78rem;
  color: var(--ink-2, #a2acba);
}

.dossier-action-row {
  display: flex;
  gap: 0.75rem;
}
.copy-confirm {
  font-size: 0.75rem;
  color: var(--gain-ink, #25c974);
  margin-top: 0.4rem;
}

.drawer-notes-field {
  width: 100%;
  background: var(--bg-hover, #161a22);
  border: 1px solid var(--border-subtle, #252b36);
  border-radius: 6px;
  padding: 0.6rem;
  color: var(--ink-1, #f0f3f6);
  font-size: 0.85rem;
  resize: vertical;
  box-sizing: border-box;
}
.notes-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}
.note-status {
  font-size: 0.75rem;
  color: var(--ink-3, #7b8594);
}

/* Row interaction indicator */
#card-clients tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
#card-clients tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

/* --- Churn Drilldown Drawer --- */
.churn-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.churn-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.drawer-backdrop.is-active {
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: #121418;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-panel.is-active {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.drawer-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}
.drawer-sub {
  font-size: 0.85rem;
  color: #8c93a0;
  margin-top: 0.25rem;
}
.drawer-close-btn {
  background: transparent;
  border: none;
  color: #8c93a0;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}
.drawer-close-btn:hover {
  color: #fff;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.drawer-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 1rem;
}
.drawer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.drawer-client {
  font-weight: 600;
  color: #f1f3f5;
  font-size: 0.95rem;
}
.drawer-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.drawer-badge.loss {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
}
.drawer-badge.gain {
  background: rgba(51, 209, 122, 0.15);
  color: #33d17a;
}

.drawer-meta-line {
  font-size: 0.85rem;
  color: #8c93a0;
  margin-bottom: 0.25rem;
}
.drawer-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.drawer-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: background 0.15s ease;
}
.drawer-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Make Month-by-Month bars visibly clickable */
.bars-chart g {
  cursor: pointer;
}
.bars-chart g:hover .axis-label {
  fill: var(--ink);
  font-weight: 700;
}

/* ───────── Sales Sheet Dedicated Print Mode ───────── */
@media print {
  @page {
    size: letter portrait;
    margin: 0.35in;
  }
  body.printing-sales-sheet > *:not(#sales-print-sheet) {
    display: none !important;
  }
  body.printing-sales-sheet #sales-print-sheet {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #sales-print-sheet .sps-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }
  #sales-print-sheet h1 {
    font-size: 15px;
    margin: 0 0 2px 0;
    color: #0f172a;
  }
  #sales-print-sheet .sps-meta {
    font-size: 10px;
    color: #475569;
  }

  /* Top KPI Summary Bar */
  #sales-print-sheet .sps-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }
  #sales-print-sheet .sps-kpi-box {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  #sales-print-sheet .sps-kpi-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.03em;
  }
  #sales-print-sheet .sps-kpi-val {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
  }
  #sales-print-sheet .sps-kpi-sub {
    font-size: 8.5px;
    color: #64748b;
  }
  #sales-print-sheet .sps-gain {
    color: #15803d !important;
  }

  /* Artist Breakdown Bar */
  #sales-print-sheet .sps-artist-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
  }
  #sales-print-sheet .sps-artist-pill {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 9.5px;
    color: #1e293b;
  }

  /* Table & Page Break Protection */
  #sales-print-sheet table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 9px !important;
    margin-bottom: 12px !important;
  }
  #sales-print-sheet thead {
    display: table-header-group;
  }
  #sales-print-sheet tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #sales-print-sheet th,
  #sales-print-sheet td {
    border: 1px solid #cbd5e1 !important;
    padding: 4px 5px !important;
    text-align: left;
    vertical-align: top;
    color: #0f172a !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  #sales-print-sheet th {
    background: #f1f5f9 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 8.5px !important;
  }

  /* Daily Sub-Header Banner */
  #sales-print-sheet tr.sps-day-row td {
    background: #e2e8f0 !important;
    padding: 4px 6px !important;
    border-top: 1.5px solid #94a3b8 !important;
  }
  #sales-print-sheet .sps-day-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9.5px;
    font-weight: 700;
    color: #0f172a;
  }

  #sales-print-sheet .sps-time {
    white-space: nowrap;
    font-weight: 600;
  }
  #sales-print-sheet .sps-subtext {
    color: #475569;
    font-size: 8.5px;
  }
  #sales-print-sheet .sps-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 700;
  }
  #sales-print-sheet .sps-badge-ok {
    background: #dcfce7;
    color: #166534;
  }
  #sales-print-sheet .sps-badge-manual {
    background: #fef3c7;
    color: #92400e;
  }
  #sales-print-sheet .sps-badge-loss {
    background: #fee2e2;
    color: #991b1b;
  }

  #sales-print-sheet td.num,
  #sales-print-sheet th.num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
  #sales-print-sheet .sps-cancelled {
    color: #b91c1c !important;
    font-weight: 700;
  }
  #sales-print-sheet .sps-unpriced {
    color: #b45309 !important;
    font-style: italic;
    font-weight: 400;
  }
  #sales-print-sheet .sps-summary {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    border-top: 2px solid #0f172a;
    padding-top: 8px;
    font-size: 11px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ───────── Accounting & Tax Theme Contrast Fix ───────── */
:root[data-theme="studio"] #tab-accounting {
  --acc-bg: #FBF8F7;
  --acc-fg: #2A2127;
  --acc-muted: #5B4E55;
  --acc-line: rgba(42, 33, 39, 0.14);
  --acc-gold: #9A742E;
  --acc-gold-soft: rgba(168, 132, 63, 0.14);
}
:root[data-theme="studio"] #tab-accounting .acc-kpi-card {
  background: #FFFFFF;
  border-color: rgba(42, 33, 39, 0.14);
}
:root[data-theme="studio"] #tab-accounting .acc-kpi-val {
  color: #2A2127;
}
:root[data-theme="studio"] #tab-accounting thead th {
  background: #F4EEEC;
  color: #2A2127;
}
:root[data-theme="studio"] #tab-accounting .acc-table-wrap {
  background: #FFFFFF;
}
