/* Rastreio — painel. Tema claro e escuro (segue o sistema; o botão do topo força um dos dois). */
:root {
  color-scheme: light;
  --page: #f6f6f3; --surface: #fcfcfb; --raised: #ffffff; --sunken: #f0efec;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --line: rgba(11, 11, 11, .10); --line-strong: rgba(11, 11, 11, .16); --grid: #e1e0d9; --axis: #c3c2b7;
  --accent: #2a78d6; --accent-ink: #1c5cab; --accent-wash: rgba(42, 120, 214, .10); --on-accent: #fff;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a;
  --seq-1: #86b6ef; --seq-2: #5598e7; --seq-3: #2a78d6; --seq-4: #184f95;
  --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --warn-ink: #7a5200; --bad: #d03b3b; --bad-ink: #b02a2a;
  --good-wash: rgba(12, 163, 12, .12); --warn-wash: rgba(250, 178, 25, .18); --bad-wash: rgba(208, 59, 59, .10);
  --shadow: 0 1px 2px rgba(11, 11, 11, .04), 0 8px 24px -12px rgba(11, 11, 11, .10);
  --r: 14px; --r-sm: 9px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --raised: #222220; --sunken: #141413;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --line: rgba(255, 255, 255, .10); --line-strong: rgba(255, 255, 255, .18); --grid: #2c2c2a; --axis: #383835;
    --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: rgba(57, 135, 229, .16); --on-accent: #fff;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #86b6ef;
    --good-ink: #0ca30c; --warn-ink: #fab219; --bad-ink: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --raised: #222220; --sunken: #141413;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --line: rgba(255, 255, 255, .10); --line-strong: rgba(255, 255, 255, .18); --grid: #2c2c2a; --axis: #383835;
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: rgba(57, 135, 229, .16); --on-accent: #fff;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #86b6ef;
  --good-ink: #0ca30c; --warn-ink: #fab219; --bad-ink: #e66767;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -14px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ───── Estrutura ───── */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav:hover { background: var(--sunken); color: var(--ink); }
.nav.on { background: var(--accent-wash); color: var(--accent-ink); }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.who { min-width: 0; flex: 1; }
.who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { color: var(--muted); font-size: 12px; }

.main { min-width: 0; padding: 22px 28px 56px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 20px; }
.top h1 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-right: auto; flex: 1 1 240px; min-width: 0; }
.top h1 small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); background: var(--warn-wash); color: var(--warn-ink); margin-bottom: 16px; font-weight: 500; }
.banner.info { background: var(--accent-wash); color: var(--accent-ink); }

/* ───── Controles ───── */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--raised); cursor: pointer; font-weight: 550; white-space: nowrap; }
.btn:hover { background: var(--sunken); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { color: var(--bad-ink); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { opacity: .5; cursor: default; }
.field, select.field { height: 34px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--raised); min-width: 0; }
textarea.field { height: auto; padding: 9px 11px; resize: vertical; width: 100%; }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.seg { display: inline-flex; background: var(--sunken); border-radius: var(--r-sm); padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; height: 28px; padding: 0 11px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--raised); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.dates { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dates input { width: 138px; }
label.lbl { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.form { display: grid; gap: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }

/* ───── Cartões e indicadores ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px 18px 0; }
.card-h h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin-right: auto; }
.card-h h2 small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; letter-spacing: 0; margin-top: 1px; }
.card-b { padding: 14px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(146px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi.hero { background: linear-gradient(160deg, var(--accent-wash), transparent 70%), var(--surface); }
.kpi-l { color: var(--ink-2); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi-v { font-size: 23px; font-weight: 650; letter-spacing: -.025em; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; min-height: 18px; }
.kpi-s .delta { white-space: nowrap; }
.delta { font-weight: 600; }
.delta.up { color: var(--good-ink); } .delta.down { color: var(--bad-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.dot.s1 { background: var(--series-1); } .dot.s2 { background: var(--series-2); } .dot.s3 { background: var(--series-3); }
.dot.on { background: var(--good); } .dot.off { background: var(--axis); } .dot.bad { background: var(--bad); }

/* ───── Tabelas ───── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 18px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 18px; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl th[data-sort] { cursor: pointer; user-select: none; }
.tbl th[data-sort]:hover { color: var(--ink); }
.tbl th.sorted { color: var(--ink); }
.tbl td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--sunken); }
.tbl tfoot td { font-weight: 650; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--sunken); }
.tbl .name { max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 9px; }
.tbl .name span.t { overflow: hidden; text-overflow: ellipsis; }
.tbl .sub { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.tbl .bar-cell { min-width: 150px; }
.meter { display: block; width: 100%; height: 6px; margin-top: 5px; }
.meter rect.bg { fill: var(--sunken); } .meter rect.fg { fill: var(--series-1); }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--ink-2); }
.tag.good { background: var(--good-wash); color: var(--good-ink); } .tag.bad { background: var(--bad-wash); color: var(--bad-ink); } .tag.warn { background: var(--warn-wash); color: var(--warn-ink); }
.tag.blue { background: var(--accent-wash); color: var(--accent-ink); }
.pos { color: var(--good-ink); font-weight: 600; } .neg { color: var(--bad-ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--accent-wash); color: var(--accent-ink); font-size: 12.5px; font-weight: 550; max-width: 340px; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; cursor: pointer; color: inherit; width: 20px; height: 20px; border-radius: 50%; font-size: 15px; line-height: 1; }
.chip button:hover { background: var(--accent-wash); }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 18px; color: var(--muted); border-top: 1px solid var(--line); }

/* ───── Gráficos ───── */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.s1 { stroke: var(--series-1); } .chart .ln.s2 { stroke: var(--series-2); } .chart .ln.s3 { stroke: var(--series-3); }
.chart .ar.s1 { fill: var(--series-1); opacity: .10; } .chart .ar.s3 { fill: var(--series-3); opacity: .10; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.chart .pt.s1 { fill: var(--series-1); } .chart .pt.s2 { fill: var(--series-2); } .chart .pt.s3 { fill: var(--series-3); }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.chart .end-l { font-size: 11.5px; font-weight: 600; fill: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-2); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
#tip { position: fixed; z-index: 50; pointer-events: none; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 9px 11px; font-size: 12.5px; min-width: 150px; }
#tip b { display: block; margin-bottom: 5px; }
#tip div { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
#tip div i { margin-left: auto; padding-left: 14px; font-style: normal; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Funil */
.funnel { display: grid; gap: 2px; }
.f-step { display: grid; grid-template-columns: 150px minmax(0, 1fr) 132px; gap: 14px; align-items: center; padding: 7px 0; }
.f-step .f-l { color: var(--ink-2); font-weight: 550; }
.f-step .f-l small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.f-step svg { display: block; width: 100%; height: 30px; }
.f-step rect { rx: 4px; }
.f-step .f-v { text-align: right; font-weight: 650; font-size: 16px; }
.f-step .f-v small { display: block; white-space: nowrap; font-weight: 500; font-size: 12px; color: var(--muted); }
.f-0 { fill: var(--seq-1); } .f-1 { fill: var(--seq-2); } .f-2 { fill: var(--seq-3); } .f-3 { fill: var(--seq-4); }
.f-bg { fill: var(--sunken); }

/* ───── Instalação ───── */
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; font-weight: 700; background: var(--sunken); color: var(--muted); }
.check.ok .ic { background: var(--good-wash); color: var(--good-ink); }
.check b { display: block; } .check span { color: var(--muted); font-size: 13px; }
pre.code { margin: 0; padding: 12px 14px; background: var(--sunken); border-radius: var(--r-sm); border: 1px solid var(--line); font: 12px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.copy-box { display: grid; gap: 8px; }
.hint { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.tabs button { margin-bottom: 0; }
.tabs button { border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ───── Entrada ───── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: 100%; max-width: 384px; padding: 28px; }
.login h1 { font-size: 20px; letter-spacing: -.02em; margin: 16px 0 4px; }
.login p { color: var(--ink-2); margin-bottom: 18px; }
.secret { font: 600 15px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .08em; word-break: break-all; padding: 10px 12px; background: var(--sunken); border-radius: var(--r-sm); }
.err { color: var(--bad-ink); font-weight: 550; min-height: 20px; }

#toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--page); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-weight: 500; }
.toast.bad { background: var(--bad); color: #fff; }
.skel { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--sunken), var(--surface), var(--sunken)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.menu-btn { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; transform: translateX(-102%); transition: transform .18s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px 16px 48px; }
  .g-2 { grid-template-columns: 1fr; }
  .f-step { grid-template-columns: 96px minmax(0, 1fr) 84px; gap: 8px; }
  .top h1 { font-size: 19px; }
}

/* ───── Gráficos: série de comparação, linha de referência, minigráfico e barras ───── */
.chart .ln.sp { stroke: var(--muted); } .chart .ln.dash { stroke-dasharray: 4 5; stroke-width: 1.6; }
.chart .pt.sp { fill: var(--muted); } .dot.sp { background: var(--muted); }
.chart .ar.s2 { fill: var(--series-2); opacity: .10; }
.chart .ref-l { stroke: var(--axis); stroke-width: 1; stroke-dasharray: 2 4; } .chart .ref-t { fill: var(--muted); font-size: 11px; }
.spark { display: block; width: 100%; height: 26px; margin-top: 8px; }
.spark polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark .s1 { stroke: var(--series-1); } .spark .s2 { stroke: var(--series-2); } .spark .s3 { stroke: var(--series-3); }
.hbars { display: grid; gap: 14px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.hbar b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar i { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar i small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.hbar svg { grid-column: 1 / -1; display: block; width: 100%; height: 10px; }
.hbar rect.bg { fill: var(--sunken); } .hbar rect.fg { fill: var(--series-2); } .hbar.s1 rect.fg { fill: var(--series-1); }
.g-eq { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: stretch; }

/* ───── Criativos ───── */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.cr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.cr-img { position: relative; aspect-ratio: 4 / 5; background: var(--sunken); display: grid; place-items: center; color: var(--muted); font-size: 12.5px; overflow: hidden; }
.cr-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cr-img .tag { position: absolute; left: 10px; top: 10px; background: var(--raised); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.cr-img .tag.good { color: var(--good-ink); } .cr-img .tag.bad { color: var(--bad-ink); } .cr-img .tag.warn { color: var(--warn-ink); } .cr-img .tag.blue { color: var(--accent-ink); }
.cr-img .st { position: absolute; right: 10px; top: 10px; }
.cr-b { padding: 12px 14px 14px; display: grid; gap: 10px; }
.cr-b h3 { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-b h3 + span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; margin-top: 1px; }
.cr-m { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; }
.cr-m div { min-width: 0; } .cr-m small { display: block; color: var(--muted); font-size: 11.5px; } .cr-m b { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-m svg { display: block; width: 100%; height: 4px; margin-top: 4px; } .cr-m rect.bg { fill: var(--sunken); } .cr-m rect.fg { fill: var(--series-1); }

/* ───── Relatórios e análises ───── */
.rep { max-width: 860px; line-height: 1.6; }
.rep h3 { font-size: 14.5px; font-weight: 650; margin: 16px 0 6px; } .rep h3:first-child { margin-top: 0; }
.rep p { margin: 0 0 8px; color: var(--ink-2); } .rep ul { margin: 0 0 10px; padding-left: 20px; color: var(--ink-2); } .rep li { margin-bottom: 4px; }
.rep-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rep-list button:hover, .rep-list button.on { background: var(--sunken); }
.rep-list b { display: block; font-weight: 600; } .rep-list span { color: var(--muted); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rep { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
label.sw { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
label.sw input { width: 18px; height: 18px; accent-color: var(--accent); }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); } .steps li { margin-bottom: 4px; }
@media (max-width: 900px) { .g-eq, .g-rep { grid-template-columns: 1fr; } .cr-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; } .side { padding-top: max(18px, env(safe-area-inset-top)); } .main { padding-top: max(16px, env(safe-area-inset-top)); } }
.cr-b, .cr-b > *, .cr-b .row > * { min-width: 0; }
.cr-b .row { flex-wrap: nowrap; } .cr-b .row .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-m b { display: block; overflow: hidden; text-overflow: ellipsis; }

/* ───── Tema Dash MM Digital: roxo, escuro por padrão (o botão do rodapé troca para claro) ───── */
:root {
  --accent: #6250d6; --accent-ink: #4a3aa7; --accent-wash: rgba(98, 80, 214, .10);
  --series-1: #6250d6; --series-2: #e87ba4; --series-3: #008300;
  --seq-1: #c4bdf7; --seq-2: #9085e9; --seq-3: #6250d6; --seq-4: #3a2c8c; --glow: rgba(98, 80, 214, .07);
}
:root[data-theme="dark"] { color-scheme: dark;
  --page: #0b0a11; --surface: #15141d; --raised: #1e1c2a; --sunken: #100f18;
  --ink: #f2f0fa; --ink-2: #c5c2d6; --muted: #8a879c;
  --line: rgba(190, 180, 255, .11); --line-strong: rgba(190, 180, 255, .2); --grid: #262433; --axis: #3a3750;
  --accent: #7c6cf0; --accent-ink: #c4bdf7; --accent-wash: rgba(144, 133, 233, .17); --on-accent: #fff;
  --series-1: #9085e9; --series-2: #d55181; --series-3: #0ca30c;
  --seq-1: #4a3aa7; --seq-2: #6250d6; --seq-3: #9085e9; --seq-4: #c4bdf7;
  --good-ink: #2fc02f; --warn-ink: #fab219; --bad-ink: #ee7b7b;
  --glow: rgba(124, 108, 240, .13);
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 32px -16px rgba(0, 0, 0, .8); }
.card, .kpi, .cr { background: linear-gradient(145deg, transparent 55%, var(--glow)), var(--surface); }
.kpi.hero { background: linear-gradient(150deg, var(--accent-wash), transparent 70%), var(--surface); }
.kpi-l { text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; }
.card-h h2 { letter-spacing: 0; }
.kpi-v.pos { color: var(--good-ink); } .kpi-v.neg { color: var(--bad-ink); }
.meter rect.fg, .cr-m rect.fg { fill: var(--series-1); } .hbar rect.fg { fill: var(--series-1); }
.hbar:nth-child(2) rect.fg { opacity: .85; } .hbar:nth-child(3) rect.fg { opacity: .7; } .hbar:nth-child(4) rect.fg { opacity: .58; } .hbar:nth-child(n+5) rect.fg { opacity: .46; }

/* Funil em fluxo */
.flow svg { display: block; width: 100%; }
.flow .band { fill: url(#flow-g); } .flow .g1 { stop-color: var(--series-1); } .flow .g2 { stop-color: var(--series-2); }
.flow .sep { stroke: var(--line-strong); stroke-width: 1; }
.flow .t-l { fill: var(--ink-2); font-size: 13px; font-weight: 600; } .flow .t-p { fill: #fff; font-size: 16px; font-weight: 700; } .flow .t-v { fill: var(--ink); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.flow .t-p.out { fill: var(--ink); }
/* Rosca */
.donut { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 20px; align-items: center; }
.donut svg { display: block; width: 100%; }
.donut .arc { fill: none; stroke-width: 15; } .donut .c-t { fill: var(--muted); font-size: 6.5px; text-transform: uppercase; letter-spacing: .06em; } .donut .c-v { fill: var(--ink); font-size: 11px; font-weight: 700; }
.donut .a0 { stroke: var(--seq-4); } .donut .a1 { stroke: var(--seq-3); } .donut .a2 { stroke: var(--seq-2); } .donut .a3 { stroke: var(--seq-1); } .donut .a4 { stroke: var(--series-2); } .donut .a5 { stroke: var(--axis); }
.donut .dot.a0 { background: var(--seq-4); } .donut .dot.a1 { background: var(--seq-3); } .donut .dot.a2 { background: var(--seq-2); } .donut .dot.a3 { background: var(--seq-1); } .donut .dot.a4 { background: var(--series-2); } .donut .dot.a5 { background: var(--axis); }
.donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; min-width: 0; }
.donut li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.donut li b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .donut li i { font-style: normal; font-variant-numeric: tabular-nums; font-weight: 650; } .donut li i small { color: var(--muted); font-weight: 500; margin-left: 6px; }
/* Barras por hora */
.chart .bar.s1 { fill: var(--series-1); } .chart .bar.s2 { fill: var(--series-2); } .chart .bar.s3 { fill: var(--series-3); }
.chart .bar-hit { fill: transparent; } .chart .bar-hit:hover { fill: var(--accent-wash); }
.g-half { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
@media (max-width: 900px) { .g-half { grid-template-columns: 1fr; } .donut { grid-template-columns: 1fr; } .donut svg { max-width: 200px; margin: 0 auto; } }

.kpis { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.donut { grid-template-columns: minmax(120px, 170px) minmax(0, 1fr); }
.donut .c-t { font-size: 5.5px; } .donut .c-v { font-size: 8.5px; }
.donut li b small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
