:root {
  color-scheme: light;
  --surface-0: #f6f6f4;
  --surface-1: #fcfcfb;
  --line: #e1e0dc;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --series-1: #2a78d6;
  --accent: #1f5f4a;
  --status-critical: #b3261e;
  --status-warning: #8a5a00;
  --band-hot: #b3261e;
  --band-warm: #8a5a00;
  --band-nurture: #2a5f9e;
  --band-disq: #52514e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #121212;
    --surface-1: #1a1a19;
    --line: #34332f;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --series-1: #3987e5;
    --accent: #6fcfa8;
    --status-critical: #ff8a80;
    --status-warning: #f0c05a;
    --band-hot: #ff8a80;
    --band-warm: #f0c05a;
    --band-nurture: #8fb8ff;
    --band-disq: #c3c2b7;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #121212; --surface-1: #1a1a19; --line: #34332f; --text-primary: #fff; --text-secondary: #c3c2b7;
  --series-1: #3987e5; --accent: #6fcfa8; --status-critical: #ff8a80; --status-warning: #f0c05a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-0); color: var(--text-primary); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--series-1); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fbar { display: block; height: 14px; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 0; }
header.bar { height: auto; border-radius: 0; background: var(--surface-1); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; }
header.bar .brand { margin-right: 8px; }
header.bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.bar nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--text-secondary); }
header.bar nav a[aria-current="page"] { background: var(--surface-0); color: var(--text-primary); font-weight: 600; }
.client-switch { margin-left: auto; display: flex; gap: 6px; }
.page { padding: 16px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 16px; margin: 24px 0 8px; }
.note, .freshness { color: var(--text-secondary); margin: 4px 0 12px; }
.banner { background: var(--surface-1); border: 1px solid var(--status-warning); border-left-width: 4px; padding: 8px 12px; border-radius: 6px; }
.warn-inline, .warn-text { color: var(--status-warning); }
button, select, input { font: inherit; color: inherit; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer; min-height: 34px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button { color: #0b0b0b; } }
button.ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--line); }
button.danger { background: var(--status-critical); }
select, input { background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 34px; max-width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.filters label { display: flex; flex-direction: column; gap: 2px; color: var(--text-secondary); font-size: 12px; }
.filters label.inline { flex-direction: row; align-items: center; gap: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 8px; }
.tile { background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile.alert { border-color: var(--status-critical); }
.tile.alert .tile-value { color: var(--status-critical); }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; color: var(--text-secondary); font-size: 13px; }
.tile-value { font-size: 26px; font-weight: 650; color: var(--text-primary); text-decoration: none; font-variant-numeric: tabular-nums; }
a.tile-value:hover { text-decoration: underline; }
.tile-value.small { font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.tile-sub { color: var(--text-secondary); font-size: 12px; }
.info { position: relative; }
.info summary { list-style: none; cursor: pointer; color: var(--text-secondary); min-width: 24px; text-align: center; }
.info summary::-webkit-details-marker { display: none; }
.info[open] p, .info[open] ul { position: absolute; right: 0; z-index: 3; width: min(300px, 80vw); background: var(--surface-1); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 4px 0 0; color: var(--text-primary); font-size: 12px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.12); }
table { width: 100%; border-collapse: collapse; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 600; padding: 8px 0; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--text-secondary); font-weight: 500; font-size: 12px; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
.bar-col { width: 40%; min-width: 80px; vertical-align: middle; }
.funnel tbody th { font-weight: 500; }
.two { display: grid; gap: 16px; }
@media (min-width: 1000px) { .two { grid-template-columns: 1fr 1fr; } }
.scroll { overflow-x: auto; }
.sub { color: var(--text-secondary); font-size: 12px; font-weight: 400; }
.wrap-text { max-width: 420px; word-break: break-word; }
.band { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1.5px solid currentColor; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.band-hot { color: var(--band-hot); }
.band-warm { color: var(--band-warm); }
.band-nurture { color: var(--band-nurture); }
.band-disqualified { color: var(--band-disq); }
.actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--surface-1); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.actions label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-secondary); }
.inline-form { display: inline; margin-left: 6px; }
.inline-form button { padding: 2px 8px; min-height: 26px; font-size: 12px; }
.timeline { padding-left: 18px; }
.login { max-width: 360px; margin: 10vh auto; display: flex; flex-direction: column; gap: 10px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.login label { display: flex; flex-direction: column; gap: 4px; }
.error-text { color: var(--status-critical); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
