/* Controle DTC — sistema visual.
   Quatro visuais ("skins") sobre a mesma estrutura: aurora (escuro, vidro e brilho), studio (claro, editorial),
   carbono (preto, denso, de mesa de operações) e brasa (preto e laranja). Tudo é feito de tokens: trocar o visual é trocar os tokens.
   As cores dos gráficos (--s1…--s4) de cada visual foram validadas (daltonismo e contraste) contra a superfície dele. */

@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("/fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("/fonts/grotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JBMono"; src: url("/fonts/mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

/* ============ visual 2 — STUDIO (claro) — também é a base ============ */
:root {
  color-scheme: light;
  --page: #f3f4f7; --page-art: none;
  --surface: #ffffff; --surface-2: #f5f6f9; --surface-3: #eceef3;
  --card-bg: var(--surface); --card-border: rgba(15, 23, 40, .08); --card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05); --card-blur: none;
  --side-bg: #ffffff; --side-border: rgba(15, 23, 40, .08); --side-ink: #0f1728; --side-muted: #64708a; --side-hover: rgba(15, 23, 40, .05);
  --side-active-bg: rgba(42, 120, 214, .10); --side-active-ink: #1c5cab; --side-margin: 0px; --side-radius: 0px; --side-shadow: none;
  --ink: #0f1728; --ink-2: #44506a; --muted: #717d96; --grid: #e9ecf1; --axis: #cbd1dc; --border: rgba(15, 23, 40, .09); --border-strong: rgba(15, 23, 40, .17);
  --accent: #2a78d6; --accent-ink: #1c5cab; --accent-wash: rgba(42, 120, 214, .10); --accent-contrast: #ffffff;
  --accent-grad: linear-gradient(135deg, #2a78d6, #4a3aa7); --glow: none;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --deemph: #c5cad3;
  --good: #0ca30c; --good-ink: #006300; --warn: #fab219; --warn-ink: #7a5200; --serious: #ec835a; --bad: #d03b3b; --bad-ink: #b02a2a;
  --good-wash: rgba(12, 163, 12, .10); --warn-wash: rgba(250, 178, 25, .18); --bad-wash: rgba(208, 59, 59, .09); --info-wash: rgba(42, 120, 214, .08);
  --radius: 14px; --radius-sm: 9px; --radius-xs: 7px; --pill: 999px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --font-num: var(--font); --label-case: none; --label-track: 0;
  --hero-bg: linear-gradient(135deg, #1f4f96 0%, #2a78d6 55%, #4a3aa7 120%); --hero-ink: #ffffff; --hero-muted: rgba(255, 255, 255, .78); --hero-line: #ffffff; --hero-chip: rgba(255, 255, 255, .16);
  --top-bg: color-mix(in srgb, var(--page) 86%, transparent);
  --row-hover: color-mix(in srgb, var(--accent) 6%, var(--surface)); --row-selected: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --top-h: 65px;
}

/* ============ visual 1 — AURORA (escuro, vidro) ============ */
:root[data-skin="aurora"] {
  color-scheme: dark;
  --page: #080c18;
  --page-art: radial-gradient(900px 520px at 12% -8%, rgba(124, 108, 240, .22), transparent 62%), radial-gradient(760px 480px at 96% 4%, rgba(34, 184, 207, .14), transparent 60%), radial-gradient(900px 600px at 60% 108%, rgba(57, 135, 229, .12), transparent 60%);
  --surface: #141a2e; --surface-2: #1a2138; --surface-3: #232b47;
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .02)) , #121829; --card-border: rgba(255, 255, 255, .085); --card-shadow: 0 12px 40px rgba(0, 0, 0, .32); --card-blur: none;
  --side-bg: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), #10162a; --side-border: rgba(255, 255, 255, .09); --side-ink: #eef1ff; --side-muted: #8d98b8; --side-hover: rgba(255, 255, 255, .06);
  --side-active-bg: linear-gradient(90deg, rgba(144, 133, 233, .32), rgba(57, 135, 229, .12)); --side-active-ink: #ffffff; --side-margin: 12px; --side-radius: 20px; --side-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --ink: #f3f5ff; --ink-2: #b7c0dc; --muted: #8791b1; --grid: #212a45; --axis: #303b5c; --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .17);
  --accent: #9085e9; --accent-ink: #c3bdf6; --accent-wash: rgba(144, 133, 233, .17); --accent-contrast: #ffffff;
  --accent-grad: linear-gradient(135deg, #7c6cf0 0%, #3987e5 62%, #22b8cf 115%); --glow: 0 8px 26px rgba(124, 108, 240, .38);
  --s1: #9085e9; --s2: #d95926; --s3: #199e70; --s4: #3987e5; --deemph: #4a5478;
  --good: #0ca30c; --good-ink: #5ad65a; --warn: #fab219; --warn-ink: #fac54f; --serious: #ec835a; --bad: #d03b3b; --bad-ink: #ff9090;
  --good-wash: rgba(12, 163, 12, .17); --warn-wash: rgba(250, 178, 25, .14); --bad-wash: rgba(208, 59, 59, .2); --info-wash: rgba(144, 133, 233, .13);
  --radius: 18px; --radius-sm: 11px; --radius-xs: 8px;
  --font: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hero-bg: radial-gradient(520px 260px at 88% 0%, rgba(34, 184, 207, .32), transparent 70%), radial-gradient(560px 320px at 0% 100%, rgba(124, 108, 240, .5), transparent 72%), linear-gradient(135deg, #1b1f45, #131a33);
  --hero-ink: #ffffff; --hero-muted: rgba(226, 230, 255, .74); --hero-line: #c9c3ff; --hero-chip: rgba(255, 255, 255, .11);
  --top-bg: color-mix(in srgb, #080c18 72%, transparent);
}

/* ============ visual 3 — CARBONO (preto, denso) ============ */
:root[data-skin="carbono"] {
  color-scheme: dark;
  --page: #090909;
  --page-art: linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
  --surface: #121212; --surface-2: #191919; --surface-3: #232323;
  --card-bg: var(--surface); --card-border: rgba(255, 255, 255, .1); --card-shadow: none;
  --side-bg: #0c0c0c; --side-border: rgba(255, 255, 255, .1); --side-ink: #f4f4ef; --side-muted: #8d8d86; --side-hover: rgba(255, 255, 255, .05);
  --side-active-bg: rgba(200, 240, 74, .1); --side-active-ink: #d6f57a; --side-margin: 0px; --side-radius: 0px; --side-shadow: none;
  --ink: #f4f4ef; --ink-2: #bebeb6; --muted: #8a8a83; --grid: #242424; --axis: #363636; --border: rgba(255, 255, 255, .1); --border-strong: rgba(255, 255, 255, .22);
  --accent: #c8f04a; --accent-ink: #d6f57a; --accent-wash: rgba(200, 240, 74, .11); --accent-contrast: #0c0c0c;
  --accent-grad: linear-gradient(135deg, #c8f04a, #c8f04a); --glow: none;
  --s1: #199e70; --s2: #c98500; --s3: #3987e5; --s4: #d55181; --deemph: #4e4e49;
  --good: #0ca30c; --good-ink: #58d658; --warn: #fab219; --warn-ink: #fac54f; --serious: #ec835a; --bad: #d03b3b; --bad-ink: #ff8a8a;
  --good-wash: rgba(12, 163, 12, .17); --warn-wash: rgba(250, 178, 25, .13); --bad-wash: rgba(208, 59, 59, .2); --info-wash: rgba(200, 240, 74, .08);
  --radius: 6px; --radius-sm: 4px; --radius-xs: 3px; --pill: 4px;
  --font: "Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --font-num: "JBMono", ui-monospace, Consolas, monospace; --label-case: uppercase; --label-track: .06em;
  --hero-bg: linear-gradient(180deg, #151515, #0f0f0f); --hero-ink: #f4f4ef; --hero-muted: #9a9a92; --hero-line: #c8f04a; --hero-chip: rgba(255, 255, 255, .07);
  --top-bg: color-mix(in srgb, #090909 82%, transparent);
}

/* ============ visual 4 — BRASA (preto e laranja) ============ */
:root[data-skin="brasa"] {
  color-scheme: dark;
  --page: #121213;
  --page-art: radial-gradient(900px 460px at 104% -12%, rgba(254, 71, 1, .13), transparent 62%), radial-gradient(760px 440px at -8% 110%, rgba(254, 71, 1, .055), transparent 60%);
  --surface: #1a1a1c; --surface-2: #222225; --surface-3: #2c2c30;
  --card-bg: linear-gradient(180deg, #1e1e20, #19191b); --card-border: rgba(255, 255, 255, .07); --card-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --side-bg: #0b0b0c; --side-border: rgba(255, 255, 255, .07); --side-ink: #f6f6f5; --side-muted: #9c9ca1; --side-hover: rgba(255, 255, 255, .055);
  --side-active-bg: linear-gradient(90deg, rgba(254, 71, 1, .36), rgba(254, 71, 1, .08) 78%, rgba(254, 71, 1, 0)); --side-active-ink: #ffffff;
  --ink: #f6f6f5; --ink-2: #c4c4c8; --muted: #8f8f95; --grid: #29292c; --axis: #3b3b40; --border: rgba(255, 255, 255, .085); --border-strong: rgba(255, 255, 255, .17);
  --accent: #ff5a1f; --accent-ink: #ff8f57; --accent-wash: rgba(255, 90, 31, .15); --accent-contrast: #160800;
  --accent-grad: linear-gradient(135deg, #ff7d33 0%, #fe4701 100%); --glow: 0 8px 24px rgba(254, 71, 1, .32);
  --s1: #d95926; --s2: #3987e5; --s3: #199e70; --s4: #9085e9; --deemph: #505056;
  --good: #0ca30c; --good-ink: #58d658; --warn: #fab219; --warn-ink: #fac54f; --serious: #ec835a; --bad: #d03b3b; --bad-ink: #ff8a8a;
  --good-wash: rgba(12, 163, 12, .17); --warn-wash: rgba(250, 178, 25, .13); --bad-wash: rgba(208, 59, 59, .2); --info-wash: rgba(255, 255, 255, .055);
  --radius: 12px; --radius-sm: 8px; --radius-xs: 6px;
  --label-case: uppercase; --label-track: .045em;
  --hero-bg: radial-gradient(640px 340px at 98% -12%, rgba(254, 71, 1, .52), transparent 68%), radial-gradient(520px 320px at 0% 124%, rgba(255, 125, 51, .17), transparent 70%), linear-gradient(135deg, #20140f 0%, #161617 62%);
  --hero-ink: #ffffff; --hero-muted: rgba(255, 240, 232, .72); --hero-line: #ff9a66; --hero-chip: rgba(255, 255, 255, .075);
  --top-bg: color-mix(in srgb, #121213 80%, transparent);
}

/* ============ base ============ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--page-art); pointer-events: none; }
:root[data-skin="carbono"] body::before { background-size: 44px 44px; }
a { color: var(--accent-ink); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 680; letter-spacing: -.015em; }
h2 { font-size: 15.5px; } h3 { font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--axis) transparent; }

/* ============ estrutura ============ */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px 14px; position: sticky; top: var(--side-margin); height: calc(100vh - 2 * var(--side-margin));
  margin: var(--side-margin) 0 var(--side-margin) var(--side-margin); border-radius: var(--side-radius); border: 1px solid var(--side-border); box-shadow: var(--side-shadow); overflow-y: auto; }
:root:not([data-skin="aurora"]) .side { border-width: 0 1px 0 0; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--side-ink); padding: 2px 8px 16px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-grad); display: grid; place-items: center; box-shadow: var(--glow); flex: none; color: var(--accent-contrast); }
:root[data-skin="carbono"] .brand .mark { border-radius: 4px; }
.brand b { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.brand small { display: block; font-size: 11px; color: var(--side-muted); font-weight: 500; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav .nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--side-muted); opacity: .8; padding: 14px 10px 5px; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--side-muted); font-weight: 560; position: relative; transition: background .12s, color .12s; }
#nav a:hover { color: var(--side-ink); background: var(--side-hover); text-decoration: none; }
#nav a[aria-current="page"] { color: var(--side-active-ink); background: var(--side-active-bg); }
:root[data-skin="carbono"] #nav a[aria-current="page"]::before, :root[data-skin="brasa"] #nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; background: var(--accent); }
:root[data-skin="brasa"] #nav a[aria-current="page"]::before { border-radius: 0 3px 3px 0; top: 4px; bottom: 4px; }
:root[data-skin="brasa"] #nav a[aria-current="page"] svg { color: var(--accent); }
:root[data-skin="aurora"] #nav a[aria-current="page"] { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
#nav a .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 750; display: inline-grid; place-items: center; }
#nav svg { flex: none; }
.side-foot { margin-top: auto; padding: 14px 8px 0; font-size: 12px; color: var(--side-muted); display: grid; gap: 6px; }
.side-foot .conn { display: flex; flex-wrap: wrap; gap: 6px; }
.side-foot .conn span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--pill); background: var(--side-hover); font-size: 11.5px; }
.side-foot .conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.side-foot .conn i.off { background: var(--warn); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 28px; position: sticky; top: 0; z-index: 30; background: var(--top-bg); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: var(--top-h); }
.top .titles { margin-right: auto; min-width: 0; }
.top h1 { font-size: 20px; letter-spacing: -.025em; }
.top .crumb { font-size: 12px; color: var(--muted); }
.top-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#view { padding: 22px 28px 70px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; outline: none; max-width: 1640px; width: 100%; }
#view.loading > * { opacity: .5; transition: opacity .15s; }
#view > * { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #view > * { animation: none; } }

/* ============ controles ============ */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 580; white-space: nowrap; transition: background .12s, transform .06s, filter .12s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: var(--accent-contrast); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent-grad); }
.btn.danger { color: var(--bad-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--accent-wash); }
.btn.sm { height: 29px; padding: 0 10px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.menu-btn { display: none; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 11px; cursor: pointer; font-weight: 580; color: var(--ink-2); border-radius: calc(var(--radius-sm) - 3px); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent-wash); color: var(--accent-ink); }
input[type="text"], input[type="number"], input[type="date"], input[type="password"], input[type="search"], select, textarea {
  height: 36px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
textarea { height: auto; padding: 8px 10px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; width: 100%; resize: vertical; }
label.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 580; }
label.field > span.hint { font-weight: 400; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; align-items: start; }
.form-grid > .btn, .form-grid > .actions { grid-column: 1 / -1; justify-self: start; }
.form-grid > .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-grid > .check { align-self: center; padding-top: 16px; }
label.field > select, label.field > input { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* menus suspensos (período, visual) */
.pop-wrap { position: relative; }
.pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0, 0, 0, .28); min-width: 260px; padding: 7px; }
.pop button.opt { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent; border-radius: var(--radius-xs); cursor: pointer; text-align: left; }
.pop button.opt:hover { background: var(--accent-wash); }
.pop button.opt .ck { width: 16px; font-weight: 800; color: var(--accent-ink); }
.pop .custom { border-top: 1px solid var(--border); margin-top: 6px; padding: 10px 8px 6px; display: grid; gap: 8px; }
.pop .custom .row input { flex: 1; }
.pop.skins { width: 330px; padding: 12px; display: grid; gap: 10px; }
.pop.skins h3 { font-size: 13px; }
.skin-opt { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; cursor: pointer; text-align: left; width: 100%; }
.skin-opt:hover { background: var(--surface-2); }
.skin-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.skin-opt b { display: block; font-size: 13.5px; } .skin-opt small { color: var(--muted); font-size: 12px; line-height: 1.35; display: block; }
.skin-prev { height: 60px; border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 22px 1fr; border: 1px solid rgba(128, 128, 128, .3); }
.skin-prev i { display: block; }
.skin-prev .p-main { padding: 7px; display: grid; gap: 5px; align-content: start; }
.skin-prev .p-card { height: 18px; border-radius: 4px; }
.skin-prev .p-bars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.skin-prev .p-bars i { flex: 1; border-radius: 2px 2px 0 0; }

/* ============ cartões ============ */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); min-width: 0; }
.card > header { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.card > header h2 { display: inline-flex; align-items: center; gap: 9px; }
.card > header .sub { color: var(--muted); font-size: 12.5px; }
.card > .body { padding: 14px 18px 18px; }
.card > .body.flush { padding: 10px 0 0; }
.card > .body.flush > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cols-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 6px 2px -6px; }
.section-title h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.section-title .sub { color: var(--muted); font-size: 12.5px; }

/* indicadores */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 15px 16px 13px; display: grid; gap: 4px; min-width: 0; box-shadow: var(--card-shadow); position: relative; overflow: hidden; align-content: start; }
.tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; text-transform: var(--label-case); letter-spacing: var(--label-track); }
:root[data-skin="carbono"] .tile .label { font-size: 11px; color: var(--muted); }
.tile .label .ico { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-wash); color: var(--accent-ink); display: inline-grid; place-items: center; flex: none; }
:root[data-skin="carbono"] .tile .label .ico { border-radius: 3px; }
:root[data-skin="brasa"] .tile .label { font-size: 11.5px; }
:root[data-skin="brasa"] .tile .label .ico { background: rgba(255, 255, 255, .065); color: var(--accent); }
.tile .value { font-size: 25px; font-weight: 720; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.tile .foot { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.tile .foot .badge { white-space: normal; }
.tile .spark { margin-left: auto; }
.tile.hero { grid-column: span 2; padding: 18px 20px; }
.tile.hero .value { font-size: 44px; line-height: 1.05; }
.tile.live::after { content: ""; position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .tile.live::after { animation: none; } }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 680; padding: 1px 7px; border-radius: var(--pill); font-size: 11.5px; }
.delta.good { color: var(--good-ink); background: var(--good-wash); } .delta.bad { color: var(--bad-ink); background: var(--bad-wash); } .delta.flat { color: var(--muted); background: var(--surface-2); }
.pos { color: var(--good-ink); } .neg { color: var(--bad-ink); }

/* faixa principal da visão geral */
.hero { position: relative; border-radius: calc(var(--radius) + 4px); background: var(--hero-bg); color: var(--hero-ink); padding: 26px 28px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; overflow: hidden; border: 1px solid var(--card-border); box-shadow: var(--card-shadow); min-height: 230px; }
:root[data-skin="carbono"] .hero { border-top: 2px solid var(--accent); }
:root[data-skin="brasa"] .hero { border-color: rgba(255, 110, 50, .26); }
:root[data-skin="brasa"] .hero .eyebrow { color: #ffb08a; }
.hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--hero-muted); display: flex; align-items: center; gap: 8px; }
.hero .eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .22); display: inline-block; }
.hero .big { font-size: clamp(40px, 5vw, 60px); font-weight: 760; letter-spacing: -.04em; line-height: 1.02; margin: 10px 0 8px; }
.hero .big.neg { color: #ffb3b3; }
.hero .line { color: var(--hero-muted); font-size: 14px; max-width: 520px; }
.hero .line b { color: var(--hero-ink); font-weight: 650; }
.hero .hstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; max-width: 620px; }
.hero .hstat { background: var(--hero-chip); border-radius: var(--radius-sm); padding: 9px 13px; min-width: 0; backdrop-filter: blur(6px); white-space: nowrap; overflow: hidden; }
.hero .hstat span { display: block; font-size: 11px; color: var(--hero-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero .hstat b { font-size: 17px; font-weight: 720; letter-spacing: -.02em; }
.hero .hstat em { font-style: normal; font-size: 11.5px; font-weight: 700; opacity: .9; display: block; }
.hero .art { position: relative; min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero .art .cap { position: absolute; top: 0; right: 0; font-size: 11.5px; color: var(--hero-muted); text-align: right; }
.hero .art .chart text { fill: var(--hero-muted); }
.hero .art .illo { position: absolute; right: -8px; top: -14px; width: 210px; opacity: .9; pointer-events: none; }
.hero .delta { background: var(--hero-chip); color: var(--hero-ink); font-size: 12.5px; padding: 3px 10px; }

/* ============ tabelas ============ */
.table-wrap { overflow-x: auto; }
.table-wrap.sticky { max-height: calc(100vh - var(--top-h) - 56px); overflow: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data tr { --row: var(--surface); }
table.data th, table.data td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
table.data td { font-family: var(--font-num); }
table.data td.l, table.data td.name { font-family: var(--font); }
table.data th:first-child, table.data td:first-child { text-align: left; padding-left: 18px; }
table.data th:last-child, table.data td:last-child { padding-right: 18px; }
table.data th.l, table.data td.l { text-align: left; }
table.data thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-2); font-weight: 650; font-size: 11.5px; border-bottom: 1px solid var(--axis); user-select: none; z-index: 3; text-transform: var(--label-case); letter-spacing: var(--label-track); }
table.data thead th.sortable { cursor: pointer; }
table.data thead th.sortable:hover { color: var(--ink); }
table.data thead th .arrow { display: inline-block; width: 10px; color: var(--accent-ink); }
table.data thead th[aria-sort] { color: var(--ink); }
table.data tbody tr:hover { --row: var(--row-hover); }
table.data tbody tr.selected { --row: var(--row-selected); }
table.data tbody tr:hover td, table.data tbody tr.selected td { background: var(--row); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot td { font-weight: 720; border-top: 1px solid var(--axis); border-bottom: 0; background: var(--surface-2); position: sticky; bottom: 0; z-index: 2; }
table.data .pin { position: sticky; left: var(--pin-left, 0); z-index: 2; background: var(--row); }
table.data thead th.pin { z-index: 5; background: var(--surface-2); }
table.data tfoot td.pin { z-index: 4; background: var(--surface-2); }
table.data .pin-last { box-shadow: 8px 0 12px -10px rgba(0, 0, 0, .35); }
table.data .pin-r { position: sticky; right: 0; z-index: 2; background: var(--row); box-shadow: -8px 0 12px -10px rgba(0, 0, 0, .35); }
table.data thead th.pin-r, table.data tfoot td.pin-r { z-index: 5; background: var(--surface-2); }
table.data td.sel, table.data th.sel { width: 40px; min-width: 40px; max-width: 40px; padding: 0 0 0 14px !important; text-align: left; }
table.data td.name { max-width: 420px; overflow: hidden; text-overflow: ellipsis; font-weight: 560; }
.table-wrap.sticky table.data td.name { max-width: 300px; }
.table-wrap.sticky table.data th, .table-wrap.sticky table.data td { padding-left: 10px; padding-right: 10px; }
.stdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--deemph); margin-right: 8px; vertical-align: 1px; flex: none; }
.stdot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-wash); }
.stdot.err { background: var(--bad); }
.btn.icon-only { width: 29px; padding: 0; justify-content: center; }
table.data.tight td.name { max-width: 250px; }
table.data.tight th, table.data.tight td { padding-left: 8px; padding-right: 8px; }
table.data td.name .sub { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
table.data td.wrap { white-space: normal; min-width: 220px; }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 4px; }
.empty strong { display: block; color: var(--ink); font-size: 15.5px; }
.empty .illo { width: 150px; margin-bottom: 6px; }
.barcell { display: inline-block; height: 6px; border-radius: 3px; background: var(--s1); vertical-align: middle; margin-right: 8px; min-width: 2px; }
.pillnum { display: inline-block; padding: 1px 8px; border-radius: var(--pill); font-weight: 680; font-size: 12px; }
.pillnum.good { background: var(--good-wash); color: var(--good-ink); } .pillnum.warn { background: var(--warn-wash); color: var(--warn-ink); } .pillnum.bad { background: var(--bad-wash); color: var(--bad-ink); } .pillnum.flat { background: var(--surface-2); color: var(--muted); }

/* ============ selos / avisos ============ */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--pill); font-size: 11.5px; font-weight: 680; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; font-family: var(--font); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.good { background: var(--good-wash); color: var(--good-ink); } .badge.good::before { background: var(--good); }
.badge.warn { background: var(--warn-wash); color: var(--warn-ink); } .badge.warn::before { background: var(--warn); }
.badge.bad { background: var(--bad-wash); color: var(--bad-ink); } .badge.bad::before { background: var(--bad); }
.badge.info { background: var(--info-wash); color: var(--accent-ink); } .badge.info::before { background: var(--accent); }
.badge.plain::before { display: none; }
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); background: var(--card-bg); align-items: flex-start; position: relative; overflow: hidden; }
.alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.alert .ico { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; margin-top: 1px; background: var(--info-wash); color: var(--accent-ink); }
.alert.danger::before { background: var(--bad); } .alert.danger .ico { background: var(--bad-wash); color: var(--bad-ink); }
.alert.warn::before { background: var(--warn); } .alert.warn .ico { background: var(--warn-wash); color: var(--warn-ink); }
.alert > div:nth-child(2) { flex: 1 1 0; min-width: 0; }
.alert .t { font-weight: 660; } .alert .d { color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.alert .acts { margin-left: auto; display: flex; align-items: center; gap: 4px; align-self: center; flex: none; }
.alert a.go { white-space: nowrap; font-weight: 620; font-size: 12.5px; padding: 4px 8px; }
.alert .x { width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.alert .x:hover { background: var(--surface-2); color: var(--ink); }
.alert.off { opacity: .72; }
.note { padding: 11px 14px; border-radius: var(--radius-sm); background: var(--info-wash); color: var(--ink-2); font-size: 13px; }
.note.warn { background: var(--warn-wash); }
code, .mono { font-family: ui-monospace, Consolas, "SF Mono", monospace; font-size: 12.5px; }
code.block { display: block; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-xs); overflow-x: auto; white-space: pre; }
pre.json { margin: 0; padding: 12px; background: var(--surface-2); border-radius: var(--radius-xs); overflow: auto; max-height: 460px; font: 12px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ============ gráficos ============ */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font: 11px var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .cross { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 14px; height: 3px; border-radius: 2px; }
.legend .swatch.box { height: 10px; width: 10px; border-radius: 3px; }
.tooltip { position: fixed; z-index: 200; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px; box-shadow: 0 12px 34px rgba(0, 0, 0, .3); font-size: 12.5px; min-width: 160px; max-width: 320px; }
.tooltip .tt-title { color: var(--muted); font-size: 11.5px; margin-bottom: 5px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 1px 0; }
.tooltip .tt-row .k { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tooltip .tt-row .k i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; }
.funnel { display: grid; gap: 4px; }
.funnel .frow { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 5px 0; }
.funnel .track { height: 18px; background: var(--surface-2); border-radius: 0 5px 5px 0; }
.funnel .fill { height: 18px; background: var(--s1); border-radius: 0 5px 5px 0; min-width: 2px; }
.funnel .rate { color: var(--muted); font-size: 12px; }
.funnel .drop { grid-column: 2; font-size: 11px; color: var(--muted); margin: -3px 0 -2px; }
.funnel .drop b { color: var(--ink-2); }
.meter { height: 8px; border-radius: 4px; background: var(--accent-wash); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.warn { background: var(--warn-wash); } .meter.warn > i { background: #c98500; }
.meter.bad { background: var(--bad-wash); } .meter.bad > i { background: var(--bad); }
.meter.good { background: var(--good-wash); } .meter.good > i { background: var(--good); }
.dre { width: 100%; border-collapse: collapse; }
.dre td { padding: 8px 0; border-bottom: 1px solid var(--grid); }
.dre td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 620; font-family: var(--font-num); }
.dre tr.total td { border-top: 1px solid var(--axis); border-bottom: 0; font-weight: 740; font-size: 15.5px; padding-top: 11px; }
.dre tr.sub td:first-child { padding-left: 14px; color: var(--ink-2); }
/* lista em barras (ranking) */
.barlist { display: grid; gap: 9px; }
.barlist .bl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: baseline; cursor: default; }
.barlist .bl .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; font-size: 13px; }
.barlist .bl .v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-weight: 650; font-size: 13px; white-space: nowrap; }
.barlist .bl .v small { color: var(--muted); font-weight: 500; margin-left: 6px; font-family: var(--font); }
.barlist .bl .t { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.barlist .bl .t i { display: block; height: 100%; background: var(--s1); border-radius: 3px; min-width: 2px; }
/* barra de participação (parte do todo) */
.sharebar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; }
.sharebar i { display: block; min-width: 2px; }
/* faixa de horas */
.heat { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; }
.heat i { display: block; height: 28px; border-radius: 3px; background: var(--surface-2); }
.heat-x { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ============ abas, modal, avisos flutuantes ============ */
.tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 9px 13px; cursor: pointer; color: var(--ink-2); font-weight: 620; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: var(--radius-xs) var(--radius-xs) 0 0; white-space: nowrap; flex: none; }
.tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
:root[data-skin="aurora"] .tabs { border-bottom: 0; background: rgba(255, 255, 255, .04); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); width: fit-content; max-width: 100%; }
:root[data-skin="aurora"] .tabs button { border-radius: 8px; border-bottom: 0; margin: 0; padding: 7px 13px; }
:root[data-skin="aurora"] .tabs button[aria-selected="true"] { background: var(--accent-wash); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
:root[data-skin="carbono"] .tabs button { text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.crumbs .sep { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: var(--pill); background: var(--accent-wash); color: var(--accent-ink); font-size: 12.5px; font-weight: 620; max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.chip button { border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; padding: 2px 5px; border-radius: 50%; }
.chip button:hover { background: var(--accent-wash); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 80; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border-strong); width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
.modal > header { padding: 18px 20px 0; } .modal > .body { padding: 14px 20px; display: grid; gap: 12px; } .modal > footer { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 220; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: #15171c; color: #fff; padding: 11px 15px; border-radius: var(--radius-sm); box-shadow: 0 12px 34px rgba(0, 0, 0, .4); font-size: 13px; overflow-wrap: anywhere; border: 1px solid rgba(255, 255, 255, .1); }
.toast.error { background: #8f2020; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
.login .illo { width: 160px; margin: 6px auto 0; display: block; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
.illo { display: block; max-width: 100%; height: auto; --il-card: var(--surface); --il-line: var(--border-strong); --il-a: var(--accent); --il-a2: color-mix(in srgb, var(--accent) 45%, var(--surface)); --il-soft: var(--surface-3); --il-ink: var(--ink); --il-coin: var(--warn); --il-shadow: rgba(0, 0, 0, .14); }
.hero .illo { --il-card: rgba(255, 255, 255, .13); --il-line: rgba(255, 255, 255, .32); --il-a: #ffffff; --il-a2: rgba(255, 255, 255, .55); --il-soft: rgba(255, 255, 255, .22); --il-ink: #ffffff; --il-coin: #ffd166; --il-shadow: rgba(0, 0, 0, .2); }
:root[data-skin="brasa"] .hero .illo { --il-a: var(--accent); --il-a2: rgba(255, 90, 31, .45); --il-coin: #ffb15c; --il-ink: #ffffff; }
:root[data-skin="carbono"] .hero .illo { --il-a: var(--accent); --il-a2: rgba(200, 240, 74, .45); --il-coin: var(--accent); --il-ink: var(--ink); }

/* barra de seleção (campanhas) */
.selbar { position: sticky; bottom: 16px; z-index: 25; justify-self: center; display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 16px 44px rgba(0, 0, 0, .35); max-width: 100%; flex-wrap: wrap; }
:root[data-skin="carbono"] .selbar, :root[data-skin="brasa"] .selbar { border-color: var(--accent); }
.selbar b { font-size: 13.5px; }
/* filtros em pílula */
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pills button { height: 30px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--border-strong); background: transparent; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.pills button:hover { color: var(--ink); background: var(--surface-2); }
.pills button[aria-pressed="true"] { background: var(--accent-wash); border-color: transparent; color: var(--accent-ink); }
.pills button small { opacity: .75; font-weight: 600; }
/* cartões-resumo de campanha (análise) */
.vcard { display: grid; gap: 8px; }
.verdict { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--radius-sm); background: var(--surface-2); }
.verdict .t { font-weight: 680; } .verdict .d { color: var(--ink-2); font-size: 13px; }
.statline { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 18px; }
.statline div > span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: var(--label-case); letter-spacing: var(--label-track); }
.statline div b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; font-family: var(--font-num); }
.statline div em { font-style: normal; font-size: 11.5px; color: var(--muted); display: block; }

/* relógio/fuso do painel na barra superior */
.tz-chip { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; white-space: nowrap; color: var(--ink-2); background: var(--surface-2); cursor: help; }
.tz-chip b { font-weight: 620; color: var(--ink); }
@media (max-width: 1340px) { .tz-chip { display: none; } }

/* barra inferior no celular */
.tabbar { display: none; }

/* ---- lista de campanhas: faixa de lucro/prejuízo, total em faixa fina e cartões ---- */
table.data tbody tr.win > td:first-child, table.data tbody tr.loss > td:first-child { background-size: 3px 100%; background-repeat: no-repeat; background-position: left top; }
table.data tbody tr.win > td:first-child { background-image: linear-gradient(var(--good), var(--good)); }
table.data tbody tr.loss > td:first-child { background-image: linear-gradient(var(--bad), var(--bad)); }
.camp-search { width: 230px; }
/* quadro de checkout (visão geral): 3 colunas x 2 linhas, como no painel do H&W */
.ckgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile.ck { box-shadow: none; background: var(--surface-2); }
.tile .label small { display: inline-block; width: 100%; text-decoration: none; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ivbar { margin-bottom: 12px; gap: 8px; }
.ivbar input[type="date"] { width: 158px; }
.sumstrip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); overflow: hidden; }
.sumstrip > div { padding: 11px 16px 12px; border-left: 1px solid var(--border); min-width: 0; }
.sumstrip > div:first-child { border-left: 0; }
.sumstrip > div > span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: var(--label-case); letter-spacing: var(--label-track); }
.sumstrip b { display: block; font-size: 17px; font-weight: 720; letter-spacing: -.02em; font-family: var(--font-num); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sortbar select { min-width: 150px; }
.ccards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.ccard { position: relative; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 13px 14px 12px 18px; display: grid; gap: 11px; overflow: hidden; min-width: 0; align-content: start; }
.ccard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--deemph); }
.ccard.win::before { background: var(--good); } .ccard.loss::before { background: var(--bad); }
.ccard.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-wash); }
.ccard > header { display: flex; gap: 10px; align-items: flex-start; }
.ccard .cname { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.ccard .cname strong { font-size: 14px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard .cname > span:not(.badge) { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ccard .croas { display: grid; justify-items: end; gap: 3px; flex: none; }
.ccard .croas small { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: .07em; }
.ccard .croas .pillnum { font-size: 13.5px; padding: 2px 10px; }
.ccard .cmain { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; }
.ccard .cgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.ccard .cmain > div, .ccard .cgrid > div { min-width: 0; }
.ccard .cmain > div > span:first-child, .ccard .cgrid > div > span:first-child { display: block; font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard .cmain b, .ccard .cgrid b { display: block; font-family: var(--font-num); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard .cmain b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.ccard .cmain .lead b { font-size: 16.5px; }
.ccard .cgrid b { font-size: 13px; font-weight: 620; }
.ccard .cgrid .barcell { display: none; }
.ccard > footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.ccard input.pick { flex: none; margin: 2px 0 0; width: 20px; height: 20px; }
.ctl { display: grid; gap: 3px; min-width: 0; }
.ctl > span { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sortbar { align-items: flex-end; }
.sortbar .btn.icon-only { font-size: 16px; }

/* explicações dos indicadores em telas de toque */
.tile .label .lt { min-width: 0; }
.hint-sheet { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 210; background: var(--surface-3); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 14px; padding: 13px 15px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); display: grid; gap: 5px; font-size: 13.5px; line-height: 1.45; max-width: 520px; margin: 0 auto; }
.hint-sheet[hidden] { display: none; }
.hint-sheet b { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); }
.hint-sheet small { color: var(--muted); font-size: 11px; }
@media (hover: none) { .tile.has-hint { cursor: pointer; } .tile.has-hint .label .lt { text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; } }
.subtools { display: none; }
.scroll { display: contents; } /* no computador a página inteira rola; no celular este miolo é quem rola (ver abaixo) */
html { -webkit-tap-highlight-color: transparent; }
button, a, select, input, label, summary { touch-action: manipulation; }

/* ============ telas menores ============ */
@media (max-width: 1100px) { .cols-2, .cols-3, .cols-2-1, .cols-1-2 { grid-template-columns: minmax(0, 1fr); } .hero { grid-template-columns: minmax(0, 1fr); } .hero .art { min-height: 130px; } }
@media (max-width: 940px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 70; transform: translateX(-105%); transition: transform .2s; margin: 0; height: 100vh; border-radius: 0 var(--side-radius) var(--side-radius) 0; top: 0; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
  .icon-btn.menu-btn { display: inline-grid; }
  .top { padding: 10px 14px; gap: 8px; } #view { padding: 14px 14px 28px; gap: 14px; }
  .top h1 { font-size: 17px; } .top .crumb { display: none; } .top-tools .btn .lbl { display: none; } .top .titles { flex: 1; }
  .tile.hero { grid-column: 1 / -1; } .tile.hero .value { font-size: 36px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 13px 11px; } .tile .value { font-size: 21px; }
  .hero { padding: 20px 18px; } .hero .art .illo { display: none; } .hero .hstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .funnel .frow { grid-template-columns: 112px minmax(0, 1fr) auto; }
  .table-wrap.sticky { max-height: 72vh; }
  table.data td.name { max-width: 190px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); z-index: 40; background: var(--surface); border-top: 1px solid var(--border-strong); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 5px 2px; border: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 620; border-radius: 10px; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-wash); }
  .selbar { bottom: 12px; }
  .alert.stack { flex-wrap: wrap; } .alert.stack > div:nth-child(2) { flex-basis: calc(100% - 44px); } .alert.stack .acts { flex-basis: 100%; padding-left: 40px; margin-left: 0; flex-wrap: wrap; }
  #toasts { bottom: 86px; }

  /* Celular como aplicativo: a página em si NÃO rola. O topo e a barra de baixo ficam parados, fora da rolagem, e só o
     miolo (#scroll) rola. Assim eles não dependem de "position: fixed", que no iPhone sai do lugar quando a tela rola
     depois de o teclado abrir e fechar (o topo sumia e a barra de baixo parava no meio da tela). */
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { display: flex; flex-direction: column; height: 100dvh; }
  #app.shell { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .main { flex: 1 1 auto; min-height: 0; }
  .scroll { display: block; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
  .tabbar { position: relative; flex: none; }
  .login { position: fixed; inset: 0; z-index: 300; overflow: auto; background: var(--page); min-height: 0; }

  /* topo fino: menu, título, atualizar e visual. Período e moeda vão para a faixa logo abaixo, que rola com o miolo. */
  .top { position: static; flex: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--page); min-height: 0; flex-wrap: nowrap; padding-top: 8px; padding-bottom: 8px; }
  .top h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-tools { flex-wrap: nowrap; flex: none; }
  .subtools { display: flex; gap: 8px; align-items: center; padding: 12px 14px 0; }
  .subtools[hidden] { display: none; }
  .subtools .pop-wrap { flex: 1; min-width: 0; }
  .subtools .pop-wrap > .btn { width: 100%; justify-content: space-between; }
  .side { height: 100dvh; }

  /* menus (período, visual) abrem como folha na parte de baixo da tela, ao alcance do polegar */
  .pop, .pop.skins { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); width: auto; min-width: 0; max-height: min(72vh, 620px); overflow-y: auto; z-index: 90; border-radius: 16px; padding: 10px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55), 0 18px 50px rgba(0, 0, 0, .4); }
  .pop button.opt { padding: 13px 12px; font-size: 15px; }
  .pop .custom .row { flex-wrap: nowrap; }
  .pop .custom .btn { height: 42px; justify-content: center; }

  /* tudo o que se toca com o dedo fica com pelo menos ~36–44px */
  .btn { height: 40px; } .btn.sm { height: 36px; padding: 0 12px; font-size: 13px; } .btn.icon-only { width: 38px; }
  .icon-btn { width: 40px; height: 40px; }
  .seg button { height: 34px; padding: 0 12px; }
  .pills button { height: 36px; padding: 0 14px; font-size: 13px; }
  .tabs { padding-right: 26px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 30px), transparent); }
  .tabs button { padding: 12px 13px; }
  input[type="text"], input[type="number"], input[type="date"], input[type="password"], input[type="search"], select { height: 42px; }
  input[type="checkbox"] { width: 20px; height: 20px; }
  .chip { padding: 6px 6px 6px 12px; } .chip button { font-size: 18px; padding: 4px 9px; }
  .alert .x { width: 38px; height: 38px; }
  .check { min-height: 36px; }

  /* janelas de confirmação sobem de baixo, com botões largos */
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 18px 18px 0 0; max-height: 88vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal > footer { flex-wrap: wrap; } .modal > footer .btn { flex: 1 1 0; justify-content: center; height: 46px; }

  /* tabelas: mais colunas por tela, rolagem lateral suave */
  .table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  table.data { font-size: 12.5px; }
  table.data th, table.data td, .table-wrap.sticky table.data th, .table-wrap.sticky table.data td { padding: 9px 9px; }
  table.data th:first-child, table.data td:first-child { padding-left: 14px; } table.data th:last-child, table.data td:last-child { padding-right: 14px; }
  .table-wrap.sticky table.data td.name, table.data.tight td.name { max-width: 150px; }
  .card > header { padding: 14px 14px 0; } .card > .body { padding: 12px 14px 14px; }

  /* campanhas */
  .camp-search { width: 100%; }
  /* checkout no celular: 2 colunas, cada número ao lado da sua conversão */
  .ckgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile.ck .label small { display: none; }
  .ckgrid > :nth-child(1) { order: 1; } .ckgrid > :nth-child(4) { order: 2; } .ckgrid > :nth-child(2) { order: 3; } .ckgrid > :nth-child(5) { order: 4; } .ckgrid > :nth-child(3) { order: 5; } .ckgrid > :nth-child(6) { order: 6; }
  .ivbar input[type="date"] { flex: 1 1 120px; width: auto; min-width: 0; } .ivbar .spacer { display: none; } .ivbar .seg { flex: 1 1 auto; } .ivbar .seg button { flex: 1; }
  .camp-tools .pills { flex-wrap: nowrap; min-width: 0; }
  .sumstrip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(30.5%, 1fr); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
  .sumstrip::-webkit-scrollbar { display: none; }
  .sumstrip > div { padding: 9px 12px 10px; scroll-snap-align: start; }
  .sumstrip b { font-size: 14px; }
  .ccards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
  .sortbar { flex-wrap: nowrap; gap: 8px; }
  .sortbar .spacer { display: none; }
  .sortbar .ctl { flex: 1 1 0; } .sortbar .ctl:last-child { flex: none; } .sortbar select { width: 100%; min-width: 0; }
  .selbar { justify-self: stretch; justify-content: center; border-radius: 16px; padding: 8px 10px; flex-wrap: nowrap; gap: 8px; } .selbar b { font-size: 12.5px; white-space: nowrap; }
  .statline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* celular deitado: pouca altura, então o topo rola junto com a página */
@media (max-height: 520px) { .top { position: static; } .table-wrap.sticky { max-height: none; } }
@media print { .side, .top-tools, .menu-btn, .tabbar, .selbar { display: none !important; } .shell { grid-template-columns: 1fr; } .top { position: static; } }

/* ---- instalado como aplicativo (iPhone/Android): respeita o entalhe e a barra inferior ---- */
@supports (padding: env(safe-area-inset-top)) {
  .top { padding-top: calc(14px + env(safe-area-inset-top)); padding-left: calc(28px + env(safe-area-inset-left)); padding-right: calc(28px + env(safe-area-inset-right)); }
  .side { padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  @media (max-width: 940px) {
    .top { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
  }
}
@media (max-width: 940px) { input[type="text"], input[type="password"], input[type="search"], input[type="date"], select, textarea { font-size: 16px; } } /* evita o zoom automático do iPhone ao tocar num campo */
