/* =====================================================================
   BI PlacasWEB — tokens de tema (claro/escuro) e layout.
   Marca: Continental Tech (#0066FF, #0099FF, #2056ED, #001C5F, #040720, #F3F9FF;
   fontes Quantico + Public Sans) e PlacasWEB (#314D79, #BDBCBC).
   Paleta categórica dos gráficos: instância validada (CVD-safe) do método de dataviz.
   ===================================================================== */
:root {
    color-scheme: light;
    --brand-blue: #0066FF;
    --brand-sky: #0099FF;
    --brand-royal: #2056ED;
    --brand-navy: #001C5F;
    --brand-deep: #040720;
    --brand-ice: #F3F9FF;
    --pw-navy: #314D79;
    --pw-gray: #BDBCBC;

    --page: #F4F7FC;
    --viz-surface: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F8FAFE;
    --ink-1: #0B1220;
    --ink-2: #4A5568;
    --ink-3: #8A94A6;
    --viz-grid: #E6EAF2;
    --viz-axis: #C9D1E0;
    --border: #E3E8F2;
    --hover: rgba(0, 102, 255, 0.05);
    --brush-fill: rgba(0, 102, 255, 0.12);
    --accent: #0066FF;
    --accent-ink: #0052CC;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(4, 7, 32, .16);
    --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
    --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
    --other: #b5b3ab;
    --ord-1: #86b6ef; --ord-2: #6da7ec; --ord-3: #5598e7; --ord-4: #3987e5;
    --ord-5: #2a78d6; --ord-6: #256abf; --ord-7: #1c5cab; --ord-8: #104281;
    --seq-lo: #eef4fc; --seq-hi: #0d366b;
    --good: #0ca30c; --good-ink: #006300;
    --warning: #fab219; --warning-ink: #8a5a00;
    --serious: #ec835a;
    --critical: #d03b3b; --critical-ink: #b42323;
    --radius: 14px;
    --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-brand: "Quantico", "Bahnschrift", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) {
        color-scheme: dark;
        --page: #060A19; --viz-surface: #0D142B; --surface: #0D142B; --surface-2: #111A36;
        --ink-1: #EEF2FA; --ink-2: #B6C0D4; --ink-3: #7C879E;
        --viz-grid: #1C2645; --viz-axis: #2A3557;
        --border: rgba(255, 255, 255, 0.08); --hover: rgba(61, 139, 255, 0.08);
        --brush-fill: rgba(61, 139, 255, 0.18);
        --accent: #3D8BFF; --accent-ink: #86B6FF;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4);
        --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
        --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
        --other: #5a5955;
        --ord-1: #184f95; --ord-2: #1c5cab; --ord-3: #256abf; --ord-4: #2a78d6;
        --ord-5: #3987e5; --ord-6: #5598e7; --ord-7: #86b6ef; --ord-8: #b7d3f6;
        --seq-lo: #16203b; --seq-hi: #cde2fb;
        --good-ink: #0ca30c; --warning-ink: #fab219; --critical-ink: #e66767;
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #060A19; --viz-surface: #0D142B; --surface: #0D142B; --surface-2: #111A36;
    --ink-1: #EEF2FA; --ink-2: #B6C0D4; --ink-3: #7C879E;
    --viz-grid: #1C2645; --viz-axis: #2A3557;
    --border: rgba(255, 255, 255, 0.08); --hover: rgba(61, 139, 255, 0.08);
    --brush-fill: rgba(61, 139, 255, 0.18);
    --accent: #3D8BFF; --accent-ink: #86B6FF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
    --other: #5a5955;
    --ord-1: #184f95; --ord-2: #1c5cab; --ord-3: #256abf; --ord-4: #2a78d6;
    --ord-5: #3987e5; --ord-6: #5598e7; --ord-7: #86b6ef; --ord-8: #b7d3f6;
    --seq-lo: #16203b; --seq-hi: #cde2fb;
    --good-ink: #0ca30c; --warning-ink: #fab219; --critical-ink: #e66767;
}

html, body { background: var(--page); color: var(--ink-1); font-family: var(--font); margin: 0; }
.mud-typography, .mud-input, .mud-button-root, .mud-list-item-text, .mud-nav-link-text, .mud-input-slot { font-family: var(--font) !important; }

/* ------------------------------------------------------------------ boot */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: radial-gradient(1200px 600px at 20% 0%, #0b1a4d 0%, var(--brand-deep) 60%); color: #fff; }
.boot-title { font: 700 24px var(--font-brand); letter-spacing: .02em; }
.boot-sub, .loading-progress-text { color: #9fb3e0; font-size: 14px; }
.loading-progress-text::after { content: var(--blazor-load-percentage-text, ""); }
#blazor-error-ui { background: #fff3cd; color: #0b0b0b; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ------------------------------------------------------------------ marca */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-family: var(--font-brand); font-size: 19px; letter-spacing: .01em; line-height: 1; }
.brand-name .bi { color: var(--brand-sky); font-weight: 700; margin-right: 6px; }
.brand-name .placas { font-weight: 400; opacity: .82; }
.brand-name .web { font-weight: 700; }

/* ------------------------------------------------------------------ app bar e menu */
.appbar.mud-appbar { background: linear-gradient(90deg, var(--brand-deep) 0%, var(--brand-navy) 70%, #0a3a9e 100%) !important; color: #fff !important; box-shadow: 0 1px 0 rgba(255,255,255,.06) !important; }
.appbar .fresh { margin-left: 14px; font-size: 12px; color: #b9c8ea; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); padding: 3px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .fresh b { color: #fff; font-weight: 600; }
@media (max-width: 760px) { .appbar .fresh { display: none; } }
.appbar-btn { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; font: 600 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; white-space: nowrap; }
.appbar-btn:hover { background: rgba(255,255,255,.16); }
.appbar-btn.primary { background: var(--brand-blue); border-color: var(--brand-blue); }
@media (max-width: 600px) { .appbar-btn .lbl { display: none; } }
.user-menu { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: linear-gradient(135deg, var(--brand-sky), var(--brand-royal)); color: #fff; font: 700 13px var(--font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.menu-pop { position: absolute; right: 0; top: 42px; min-width: 220px; background: var(--surface); color: var(--ink-1); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 1500; }
.menu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-pop .who b { display: block; font-size: 14px; }
.menu-pop .who span { font-size: 12px; color: var(--ink-3); }
.menu-pop button, .menu-pop a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: transparent; color: var(--ink-1); font: 14px var(--font); border-radius: 8px; cursor: pointer; text-decoration: none; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--hover); }

.nav-wrap .mud-nav-link { border-radius: 10px; margin: 2px 8px; width: auto; }
.nav-wrap .mud-nav-link.active { background: var(--hover) !important; color: var(--accent) !important; font-weight: 600; }
.nav-wrap .mud-nav-link .mud-nav-link-icon { color: var(--nav-c, var(--accent)) !important; }
.nav-wrap .mud-nav-item:nth-child(1) { --nav-c: #0066FF; }
.nav-wrap .mud-nav-item:nth-child(2) { --nav-c: #6250d6; }
.nav-wrap .mud-nav-item:nth-child(3) { --nav-c: #1baf7a; }
.nav-wrap .mud-nav-item:nth-child(4) { --nav-c: #eb6834; }
.nav-wrap .mud-nav-item:nth-child(5) { --nav-c: #0099FF; }
.nav-wrap .mud-nav-item:nth-child(6) { --nav-c: #eda100; }
.nav-wrap .mud-nav-item:nth-child(7) { --nav-c: #e87ba4; }
.nav-wrap .mud-nav-item:nth-child(8) { --nav-c: #314D79; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 14px 20px 4px; }
.drawer-foot { padding: 16px 18px; font-size: 11px; color: var(--ink-3); }
.drawer-foot img { height: 14px; display: block; margin-top: 6px; opacity: .9; }
:root[data-theme="dark"] .logo-light, .logo-dark { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* ------------------------------------------------------------------ páginas */
.page { padding: 18px 24px 56px; max-width: 1600px; margin: 0 auto; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.page-h h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.015em; }
.page-h p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.section-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.section-h h2 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-h p { margin: 2px 0 0; color: var(--ink-3); font-size: 13px; }
.count-pill { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--hover); padding: 2px 8px; border-radius: 999px; }
@media (max-width: 600px) { .page { padding: 12px 16px 40px; } }

/* ------------------------------------------------------------------ controles */
.ctl, .ctl-select {
    height: 36px; border: 1px solid var(--border); border-radius: 10px; padding: 0 11px;
    background: var(--surface); color: var(--ink-1); font: 14px var(--font);
}
.ctl:focus, .ctl-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ctl-date { width: 142px; }
.sep { color: var(--ink-3); }
.btn {
    height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--ink-1); font: 600 14px var(--font); cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; box-shadow: var(--shadow);
}
.btn:hover { border-color: var(--viz-axis); background: var(--surface-2); }
.btn.primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.btn.primary:hover { background: #0057db; }
.btn.danger { background: transparent; border-color: var(--critical); color: var(--critical-ink); box-shadow: none; }
.btn.danger:hover { background: rgba(208, 59, 59, .08); }
.btn.danger.solid { background: var(--critical); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.big { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg, .btn .mud-icon-root { width: 18px; height: 18px; }

/* interruptor */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: var(--ink-2); height: 36px; padding: 0 12px 0 8px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.switch input { display: none; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--viz-axis); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch.on { color: var(--good-ink); border-color: rgba(12,163,12,.35); }
.switch.small { height: 30px; font-size: 12px; padding: 0 10px 0 6px; box-shadow: none; }
.switch.small .track { width: 28px; height: 16px; }
.switch.small .track::after { width: 12px; height: 12px; }
.switch.small input:checked + .track::after { transform: translateX(12px); }
.nav-wrap .mud-nav-item:nth-child(9) { --nav-c: #1baf7a; }
.nav-wrap .mud-nav-item:nth-child(10) { --nav-c: #52514e; }

/* ------------------------------------------------------------------ barra de filtros */
.filterbar { position: sticky; top: 64px; z-index: 5; background: var(--page); padding: 8px 0 10px; margin-bottom: 8px; }
@media (max-width: 960px) { .filterbar { top: 56px; } }
@media (max-width: 600px) { .filterbar { position: static; } }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row .grow { flex: 1 1 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--ink-1); max-width: 100%; box-shadow: var(--shadow); }
.chip b { font-weight: 600; color: var(--accent-ink); }
.chip .x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 15px; width: 22px; height: 22px; border-radius: 11px; }
.chip .x:hover { background: var(--border); color: var(--ink-1); }
.chip span.txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.filter-panel { margin-top: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.filter-values { max-height: 260px; overflow: auto; margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 12px; }
.filter-values label { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 4px 2px; cursor: pointer; border-radius: 6px; }
.filter-values label:hover { background: var(--hover); }
.filter-values .cnt { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.estamp-ac { min-width: 240px; flex: 1 1 240px; max-width: 380px; }
.estamp-ac .mud-input-outlined-border { border-radius: 10px !important; }

/* seletor de estados */
/* estados: lista simples, todos marcados por padrão */
.uf-strip { margin-top: 10px; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.uf-strip-h { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.uf-strip-h .mud-icon-root { color: var(--brand-blue); }
.uf-strip-h .grow { flex: 1; }
.uf-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.uf-c { min-width: 40px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--ink-3); font: 700 12.5px var(--font); cursor: pointer; transition: all .1s; }
.uf-c:hover { border-color: var(--accent); color: var(--ink-1); }
.uf-c.on { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.uf-c.on:hover { filter: brightness(1.08); }
.uf-c.proj .star { color: var(--series-4); margin-right: 2px; font-size: 11px; }
.uf-c.proj.on .star { color: #ffd76a; }
.uf-strip.filtering { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.proj-btn { font-weight: 700; }
.proj-form .ctl-select { flex: 0 1 240px; }
/* clique para copiar */
.copy-cells td, .copy-cells dd { cursor: copy; }
.copy-cells td:hover, .copy-cells dd:hover { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; }
.copy-cells td.copied, .copy-cells dd.copied { animation: copiedFlash .8s ease-out; }
@keyframes copiedFlash { 0% { background: color-mix(in srgb, var(--good) 35%, transparent); } 100% { background: transparent; } }
.copy-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 3000;
    background: #0b1220; color: #fff; padding: 9px 16px; border-radius: 10px; font: 600 13px var(--font); box-shadow: 0 8px 24px rgba(0,0,0,.25);
    transition: opacity .18s, transform .18s; max-width: calc(100vw - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* placa no padrão Mercosul (fica branca também no tema escuro, como a placa real) */
.placa-mercosul { display: inline-flex; flex-direction: column; width: 88px; border: 1.5px solid #222; border-radius: 5px; background: #fff;
    overflow: hidden; vertical-align: middle; box-shadow: 0 1px 2px rgba(0,0,0,.18); line-height: 1; cursor: copy; }
.placa-mercosul.copied { animation: copiedRing .8s ease-out; }
@keyframes copiedRing { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 55%, transparent); } 100% { box-shadow: 0 1px 2px rgba(0,0,0,.18); } }
/* CNPJ copiável (campo-chave do PlacasWEB) */
.cnpj-tag { display: inline-flex; align-items: center; gap: 4px; font: 600 12px ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink-2);
    padding: 1px 6px; border-radius: 6px; border: 1px dashed transparent; cursor: copy; white-space: nowrap; }
.cnpj-tag::after { content: "⧉"; font-size: 11px; opacity: .45; }
.cnpj-tag:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cnpj-tag:hover::after { opacity: .9; }
.cnpj-tag.copied { animation: copiedFlash .8s ease-out; }
/* contas de pagamento da estampadora (clique copia o e-mail) */
.conta-tag { display: inline-flex; align-items: center; margin-left: 4px; padding: 0 7px; height: 18px; border-radius: 9px; font: 700 10.5px var(--font);
    letter-spacing: .03em; cursor: copy; vertical-align: middle; border: 1px solid transparent; }
.conta-tag.mp { background: #e6f4fd; color: #0a5e95; border-color: #b9e0f8; }
.conta-tag.asaas { background: #e8f0ff; color: #1d3fbf; border-color: #c6d5ff; }
.conta-tag:hover { filter: brightness(.96); }
.conta-tag.copied { animation: copiedFlash .8s ease-out; }
.cnpj-list { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-top: 2px; margin-left: -6px; }
td > .cnpj-tag, td br + .cnpj-tag, dd > .cnpj-tag { margin-left: -6px; }
.placa-mercosul .pm-faixa { position: relative; height: 10px; background: #003399; color: #fff; display: flex; align-items: center; justify-content: center;
    font: 700 6.5px/10px Arial, Helvetica, sans-serif; letter-spacing: .18em; }
.placa-mercosul .pm-mercosul { position: absolute; left: 3px; top: 0; font-size: 7px; line-height: 10px; color: #fff; letter-spacing: 0; }
.placa-mercosul .pm-bandeira { position: absolute; right: 3px; top: 2px; width: 9px; height: 6px; background: #009c3b; }
.placa-mercosul .pm-bandeira::before { content: ""; position: absolute; inset: 1px 1px; background: #ffdf00; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.placa-mercosul .pm-bandeira::after { content: ""; position: absolute; left: 3px; top: 1.6px; width: 3px; height: 3px; border-radius: 50%; background: #002776; }
.placa-mercosul .pm-num { color: #111; text-align: center; padding: 2px 3px 3px; font: 700 17px/1 "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
    font-stretch: condensed; letter-spacing: .07em; }
.placa-mercosul.lg { width: 150px; border-width: 2px; border-radius: 7px; }
.placa-mercosul.lg .pm-faixa { height: 16px; font-size: 10px; line-height: 16px; }
.placa-mercosul.lg .pm-mercosul { font-size: 11px; line-height: 16px; left: 5px; }
.placa-mercosul.lg .pm-bandeira { width: 14px; height: 10px; top: 3px; right: 5px; }
.placa-mercosul.lg .pm-bandeira::after { left: 5px; top: 3px; width: 4px; height: 4px; }
.placa-mercosul.lg .pm-num { font-size: 30px; padding: 3px 4px 4px; }

/* mapa */
.map-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.map-tools .grow { flex: 1; }
.map-body { display: grid; grid-template-columns: 1fr; gap: 14px; }
.map-body.with-table { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); }
@media (max-width: 900px) { .map-body.with-table { grid-template-columns: 1fr; } }
.map-canvas { min-width: 0; border-radius: 12px; background: color-mix(in srgb, var(--brand-sky) 5%, var(--surface)); }
.map-foot { margin-top: 8px; font-size: 12px; }
/* auditoria de dados: janela de registros */
.modal.wide.rec-modal { max-width: min(1320px, calc(100vw - 32px)); width: 100%; }
.rec-h { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.rec-h h3 { display: flex; gap: 8px; align-items: center; margin: 0; }
td.hl { background: color-mix(in srgb, var(--series-4) 14%, transparent); font-weight: 600; }
.uf-zero { margin-top: 8px; font-size: 12.5px; color: var(--warning-ink); background: color-mix(in srgb, var(--series-4) 12%, var(--surface)); padding: 7px 10px; border-radius: 8px; }
.nav-action { display: flex; align-items: center; gap: 10px; width: calc(100% - 16px); margin: 6px 8px 0; padding: 9px 12px; border: 1px dashed var(--border); border-radius: 10px; background: transparent; color: var(--ink-2); font: 500 13px var(--font); cursor: pointer; text-align: left; }
.nav-action:hover { border-color: var(--accent); color: var(--accent); background: var(--hover); }
.add-analysis { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 6px; }
.estamp-btn.active { border-color: var(--accent); color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.estamp-btn .mud-icon-root { color: var(--series-7); }
/* sessão: quem está logado e de onde */
.session-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12.5px; color: var(--ink-2); margin: -4px 0 12px; }
.session-bar > span { display: inline-flex; align-items: center; gap: 5px; }
.session-bar .mud-icon-root { color: var(--brand-blue); font-size: 17px; }
.empresa-chip { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .empresa-chip { max-width: 150px; font-size: 12px; } }
/* pesquisa por campo */
.search-fields { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.search-fields .sf { height: 30px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink-2); font: 600 12.5px var(--font); cursor: pointer; }
.search-fields .sf:hover { border-color: var(--accent); }
.search-fields .sf.on { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
/* explorador: galeria */
.sugg.diy { border-style: dashed; border-width: 2px; }
.sugg.saved { position: relative; cursor: pointer; }
.sugg.saved .icon-x { position: absolute; top: 6px; right: 6px; }
/* usuários: ações compactas */
.acts { text-align: right; white-space: nowrap; }
.act { vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.act:hover { background: var(--hover); border-color: var(--border); color: var(--accent); }
.act.warn:hover { color: var(--warning-ink); }
.act.good { color: var(--good-ink); }
.act.danger:hover { color: var(--critical-ink); }
tr.row-off td { opacity: .6; }
tr.row-off td.acts { opacity: 1; }
/* auditoria */
tr.row-fail td { background: color-mix(in srgb, var(--series-8) 6%, transparent); }
.kpi.alert-kpi .kpi-value { color: var(--critical-ink); }
.audit-tbl td { font-size: 12.5px; }
.uf-btn { min-width: 150px; justify-content: space-between; }
.uf-btn .mud-icon-root { color: var(--brand-blue); }
.uf-panel .regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; margin-top: 10px; }
.uf-region-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; cursor: pointer; }
.uf-region-h:hover { color: var(--accent); }
.uf-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.uf-chip { position: relative; width: 58px; height: 46px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--ink-1); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 14px var(--font); line-height: 1.1; transition: all .12s; }
.uf-chip small { font-size: 10px; font-weight: 500; color: var(--ink-3); }
.uf-chip:hover { border-color: var(--accent); }
.uf-chip.on { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.uf-chip.on small { color: #d6e6ff; }
.uf-chip.off-mode.on { background: var(--critical); border-color: var(--critical); text-decoration: line-through; }
.uf-chip.empty { opacity: .35; cursor: default; }
.uf-chip .cls { position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid var(--surface); }
.cls-A { background: #104281; } .cls-B { background: #3987e5; } .cls-C { background: #9ec5f4; color: #0d366b !important; }
.uf-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ------------------------------------------------------------------ KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 4px; transition: opacity .2s; }
@media (max-width: 600px) { .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 8px; cursor: pointer; position: relative; min-width: 0; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi:hover { border-color: color-mix(in srgb, var(--kc, var(--accent)) 45%, transparent); transform: translateY(-1px); }
.kpi.selected { border-color: var(--kc, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kc, var(--accent)) 18%, transparent); }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--kc, var(--accent)) 14%, transparent); color: var(--kc, var(--accent)); flex: none; }
.kpi-ico .mud-icon-root { width: 18px; height: 18px; }
.kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 4px; white-space: nowrap; }
@media (max-width: 600px) { .kpi-value { font-size: 21px; } .kpi { padding: 10px 10px 6px; } }
.kpi-deltas { display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.delta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }
.delta .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.good .v { color: var(--good-ink); }
.delta.bad .v { color: var(--critical-ink); }
.delta.neutral .v { color: var(--ink-2); }
.kpi-spark { height: 34px; margin: 4px -4px 0; }
.compare-note { font-size: 12px; color: var(--ink-3); margin: 6px 0 4px; }

/* ------------------------------------------------------------------ cards / gráficos */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.grid-2 > .span-2, .grid-3 > .span-2 { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; min-width: 0; transition: opacity .2s; box-shadow: var(--shadow); position: relative; }
.card.accent::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cc, var(--accent)); }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.card-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.card-ico { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--cc, var(--accent)) 14%, transparent); color: var(--cc, var(--accent)); flex: none; }
.card-ico .mud-icon-root { width: 18px; height: 18px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-h .sub { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-f { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.is-loading { opacity: .55; pointer-events: none; }
.echart { width: 100%; }
.chart-error { color: var(--ink-3); font-size: 13px; padding: 24px; text-align: center; }
.empty { color: var(--ink-3); font-size: 13px; padding: 32px 8px; text-align: center; }
.icon-x { border: 0; background: transparent; color: var(--ink-3); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.icon-x:hover { background: rgba(208,59,59,.1); color: var(--critical-ink); }

/* alternância Gráfico | Tabela — bem visível */
.view-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.view-toggle button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--ink-2); font: 600 12px var(--font); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.view-toggle button.on { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(16,24,40,.15); }
.view-toggle svg { width: 15px; height: 15px; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; flex-wrap: wrap; background: var(--surface); }
.seg button { border: 0; background: var(--surface); color: var(--ink-2); font: 600 13px var(--font); padding: 6px 11px; cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand-blue); color: #fff; }
.seg button:hover:not(.on) { background: var(--hover); }
.seg button.suggested:not(.on) { color: var(--brand-blue); }
.seg button.suggested::after { content: "✦"; font-size: 10px; margin-left: 4px; vertical-align: 1px; }

/* ------------------------------------------------------------------ sugestões de análise */
.suggestions { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sugg { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; color: var(--ink-1); font: 14px var(--font); transition: all .15s; }
.sugg:hover { border-style: solid; border-color: var(--cc, var(--accent)); box-shadow: var(--shadow); transform: translateY(-1px); }
.sugg .card-ico { width: 38px; height: 38px; }
.sugg b { display: block; font-size: 14px; margin-bottom: 2px; }
.sugg span { font-size: 12px; color: var(--ink-3); line-height: 1.35; display: block; }
.sugg .add { margin-left: auto; color: var(--cc, var(--accent)); font-size: 20px; font-weight: 700; line-height: 1; }

/* ------------------------------------------------------------------ tabelas */
.tbl-wrap { overflow: auto; max-height: 520px; border-radius: 8px; border: 1px solid var(--border); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 700; color: var(--ink-2); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink-1); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.tbl th .sort-ico { display: inline-block; margin-left: 4px; font-size: 11px; color: var(--ink-3); opacity: .55; transition: opacity .15s; }
.tbl th.sortable:hover .sort-ico { opacity: 1; }
.tbl th.sorted { color: var(--accent); }
.tbl th.sorted .sort-ico { color: var(--accent); opacity: 1; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--viz-grid); white-space: nowrap; }
.tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl tr.sel td { background: var(--brush-fill); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--viz-axis); border-bottom: 0; }
.tbl td.wrap { white-space: normal; min-width: 220px; }
.tbl-wrap.cross .tbl th, .tbl-wrap.cross .tbl td { padding: 5px 6px; font-size: 12px; }
.tbl-wrap.cross .tbl th { letter-spacing: 0; }
.tbl-wrap.cross .tbl td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tbl-wrap.cross .tbl th:first-child { left: 0; z-index: 2; }
.bar-cell { position: relative; }
.bar-cell .bar { position: absolute; left: 0; top: 5px; bottom: 5px; background: color-mix(in srgb, var(--cc, var(--accent)) 16%, transparent); border-radius: 0 4px 4px 0; }
.bar-cell span { position: relative; }

/* ------------------------------------------------------------------ badges (ícone + texto) */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
.badge::before { font-size: 11px; }
.badge.good { color: var(--good-ink); } .badge.good::before { content: "▲"; }
.badge.bad { color: var(--critical-ink); } .badge.bad::before { content: "▼"; }
/* qualidade: problema subindo = ruim (▲ vermelho); caindo = bom (▼ verde) */
.badge.q-up { color: var(--critical-ink); } .badge.q-up::before { content: "▲"; }
.badge.q-down { color: var(--good-ink); } .badge.q-down::before { content: "▼"; }
.badge.warn { color: var(--warning-ink); } .badge.warn::before { content: "◆"; }
.badge.new { color: var(--accent-ink); } .badge.new::before { content: "★"; }
.badge.neutral { color: var(--ink-2); } .badge.neutral::before { content: "●"; }
.badge.lost { color: var(--critical-ink); } .badge.lost::before { content: "✕"; }
.badge.crit { color: var(--critical-ink); } .badge.crit::before { content: "!"; font-weight: 800; }
.badge.cls-a, .badge.cls-b, .badge.cls-c { color: #fff; border: 0; }
.badge.cls-a { background: #104281; } .badge.cls-b { background: #3987e5; } .badge.cls-c { background: #9ec5f4; color: #0d366b; }

/* ------------------------------------------------------------------ explorador */
.explorer { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; }
@media (max-width: 900px) { .explorer { grid-template-columns: 1fr; } }
.fields { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; max-height: calc(100vh - 190px); overflow: auto; position: sticky; top: 130px; box-shadow: var(--shadow); }
@media (max-width: 900px) { .fields { position: static; max-height: 300px; } }
.fields h4 { margin: 10px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.field { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px 6px 0; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); cursor: grab; font-size: 13px; user-select: none; }
.field:hover { border-color: var(--accent); }
.field.metric::before { content: "Σ"; color: var(--accent-ink); font-weight: 800; font-size: 12px; }
.field.dim::before { content: "≡"; color: var(--ink-3); font-weight: 800; font-size: 12px; }
.field.used { opacity: .45; }
.zones { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
@media (max-width: 700px) { .zones { grid-template-columns: 1fr; } }
.zone { border: 1.5px dashed var(--viz-axis); border-radius: var(--radius); padding: 8px; min-height: 64px; background: var(--surface); }
.zone.over { border-color: var(--accent); background: var(--brush-fill); }
.zone-t { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.zone .field { cursor: grab; background: var(--surface); }
.zone .field .x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; }
.hint { font-size: 12px; color: var(--ink-3); }

/* ------------------------------------------------------------------ pesquisa / detalhes / log */
.search-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.search-box .ctl { flex: 1 1 320px; height: 44px; font-size: 15px; border-radius: 12px; }
.detail { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.detail dt { color: var(--ink-3); }
.detail dd { margin: 0; word-break: break-all; }
.lgpd { font-size: 12px; color: var(--ink-2); border-left: 3px solid var(--warning); padding: 6px 12px; margin: 4px 0 12px; background: var(--surface); border-radius: 0 8px 8px 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.log { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-height: 280px; overflow: auto; white-space: pre-wrap; }
.dropzone { border: 2px dashed var(--viz-axis); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--ink-2); background: var(--surface-2); position: relative; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.alert { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--critical); color: var(--critical-ink); margin-bottom: 12px; font-size: 13px; background: var(--surface); }
.ok-msg { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--good); color: var(--good-ink); margin-bottom: 12px; font-size: 13px; background: var(--surface); }
.note { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); margin-bottom: 12px; font-size: 13px; }
code { font-size: 12px; background: var(--hover); padding: 1px 5px; border-radius: 4px; }

.action-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.action-bar .spacer { flex: 1; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }

/* ------------------------------------------------------------------ modal */
.modal-back { position: fixed; inset: 0; background: rgba(4, 7, 32, .55); backdrop-filter: blur(2px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 480px; background: var(--surface); color: var(--ink-1); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; border: 1px solid var(--border); }
.modal h3 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.modal p { color: var(--ink-2); font-size: 14px; line-height: 1.45; margin: 6px 0; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal .ctl { width: 100%; box-sizing: border-box; margin-top: 6px; }
.modal label.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.modal.wide { max-width: 900px; max-height: calc(100vh - 40px); overflow: auto; }
.modal.wide .chip span.txt { max-width: 640px; }
.modal.wide .chip { min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid .ctl, .form-grid .ctl-select { width: 100%; box-sizing: border-box; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.perfil-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 700px) { .perfil-opts { grid-template-columns: 1fr; } }
.perfil-opt { border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.perfil-opt input { display: none; }
.perfil-opt b { font-size: 14px; color: var(--ink-1); }
.perfil-opt span { font-size: 12px !important; color: var(--ink-3) !important; font-weight: 400 !important; margin: 0 !important; }
.perfil-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
/* seleção de CNPJs no cadastro de usuários: tabela completa, filtrável e ordenável */
.cnpj-picker { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cp-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cp-tools .ctl { flex: 1 1 220px; margin-top: 0 !important; width: auto !important; }
.cp-tools .ctl-select { flex: 0 1 220px; }
.chk-inline { display: inline-flex !important; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); font-weight: 500 !important; margin: 0 !important; white-space: nowrap; }
.cp-table { max-height: 330px; overflow: auto; }
.cp-table .tbl { width: 100%; }
.cp-table .tbl td { padding-top: 7px; padding-bottom: 7px; }
.cp-table .tbl th, .cp-table .tbl td { padding-left: 6px; padding-right: 6px; }
.sel-chips { max-height: 118px; overflow: auto; }
.cp-table .grp-btn { padding: 0 8px; white-space: nowrap; }
.cp-table .tbl tr.sel td { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.cp-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--border); background: var(--surface-2); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; white-space: nowrap; }
.code-box { font: 700 28px ui-monospace, Consolas, monospace; letter-spacing: 5px; text-align: center; color: var(--brand-navy); background: var(--brand-ice); border: 1px solid #CFE0FF; border-radius: 12px; padding: 14px; margin: 8px 0 12px; }
:root[data-theme="dark"] .code-box { color: #cde2fb; background: #111A36; border-color: #2A3557; }
.badge.perfil-admin { color: #fff; background: var(--brand-navy); border: 0; }
.badge.perfil-tech { color: #fff; background: var(--brand-blue); border: 0; }
.badge.perfil-estampador { color: var(--brand-navy); background: color-mix(in srgb, var(--brand-sky) 18%, var(--surface)); border-color: color-mix(in srgb, var(--brand-sky) 40%, transparent); }
.scope-note { margin: 10px 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand-sky) 10%, var(--surface)); color: var(--ink-2); font-size: 12px; display: flex; gap: 6px; align-items: flex-start; }

/* ------------------------------------------------------------------ login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--page); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } }
.login-art { position: relative; overflow: hidden; color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(900px 500px at 85% 110%, rgba(0,153,255,.45), transparent 60%), radial-gradient(700px 500px at -10% -10%, rgba(32,86,237,.35), transparent 60%), linear-gradient(140deg, #040720 0%, #001C5F 55%, #0A3DB8 100%); }
@media (max-width: 900px) { .login-art { padding: 26px 22px; min-height: 0; } .login-art .pitch, .login-art .stats { display: none; } }
.login-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
    background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 44px 44px;
    mask-image: radial-gradient(600px 400px at 30% 40%, #000 0%, transparent 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand img { width: 46px; height: 46px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.login-art .brand-name { font-size: 26px; }
.login-art .pitch h2 { font: 700 38px/1.12 var(--font); letter-spacing: -.02em; margin: 0 0 14px; max-width: 520px; }
.login-art .pitch h2 em { font-style: normal; color: #7cc4ff; }
.login-art .pitch p { color: #b9c8ea; font-size: 16px; max-width: 480px; line-height: 1.5; margin: 0; }
.login-art .stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.login-art .stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 16px; min-width: 130px; backdrop-filter: blur(4px); }
.login-art .stat b { display: block; font-size: 15px; }
.login-art .stat span { font-size: 12px; color: #a9bbe6; }
.login-art .by { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #a9bbe6; }
.login-art .by img { height: 16px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 22px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.015em; }
.login-card .lead { color: var(--ink-3); margin: 0 0 24px; font-size: 14px; }
.field-l { display: block; margin-bottom: 14px; }
.field-l > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input-wrap { position: relative; }
.input-wrap .ctl { width: 100%; height: 46px; border-radius: 12px; font-size: 15px; box-sizing: border-box; padding-left: 40px; }
.input-wrap .lead-ico { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; color: var(--ink-3); }
.input-wrap:has(.eye) .ctl { padding-right: 78px; }
.input-wrap .eye { position: absolute; right: 8px; top: 8px; height: 30px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font: 600 12px var(--font); border-radius: 8px; padding: 0 8px; }
.input-wrap .eye:hover { background: var(--hover); color: var(--ink-1); }
.login-row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 18px; font-size: 13px; color: var(--ink-2); }
.login-row label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.login-card .btn.primary { width: 100%; height: 48px; justify-content: center; font-size: 15px; border-radius: 12px; background: linear-gradient(90deg, var(--brand-royal), var(--brand-blue)); border: 0; }
.login-card .btn.primary:hover { filter: brightness(1.06); }
.login-row a, .login-links a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px; }
.login-row a:hover, .login-links a:hover { text-decoration: underline; }
.login-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.code-input { font: 700 20px ui-monospace, Consolas, monospace !important; letter-spacing: 4px; text-transform: uppercase; }
.login-foot { margin-top: 28px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; justify-content: center; }
.login-foot img { height: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ cobertura de valores */
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cov { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); font-size: 12px; }
.cov b { font-size: 14px; }
.cov .meter { height: 5px; border-radius: 3px; background: var(--viz-grid); margin: 6px 0 4px; overflow: hidden; }
.cov .meter i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.cov.low .meter i { background: var(--warning); }

/* ---------- Pagamentos ---------- */
.pay-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.pay-bar .lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pay-bar .hint { flex: 1 1 260px; }
.pay-excl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--border); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.pay-excl > span { flex: 1 1 320px; }
.pay-excl.incl { border-style: solid; }
.pay-pivot-card { margin: 14px 0; }
.pay-pivot th .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.pay-pivot td.via { font-size: 12px; color: var(--ink-2); white-space: normal; min-width: 56px; }
.pay-pivot td.low { color: var(--warning-ink); font-weight: 600; }
.pay-pivot td .cnpj-tag { margin-top: 2px; }
.pay-pivot th { white-space: normal; vertical-align: bottom; line-height: 1.25; min-width: 64px; }
.pay-pivot th:first-child { min-width: 150px; }
.pay-pivot { font-size: 12.5px; }
.pay-pivot th { letter-spacing: 0; font-size: 11px; }
.pay-pivot td { padding: 7px 6px; }
.pay-pivot th { padding: 9px 6px; }
.exp-modal { max-width: 560px; }
.exp-modal .exp-opt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.exp-modal .exp-opt > span { font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 64px; }
.exp-modal p.hint { font-size: 12px; margin-top: 14px; }
.ok-msg.ok-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.ok-msg.ok-row .btn { flex: none; }

/* ---- sessão: conectados agora, aviso de inatividade */
.online-card { margin-bottom: 16px; }
.presence { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--ink-3); }
.presence.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.presence.idle { background: var(--warning, #fab219); }
.session-warn { max-width: 440px; }
.session-warn .countdown { font-variant-numeric: tabular-nums; color: var(--critical-ink, #c62828); }
.session-notice { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
