/* =====================================================================
   Painel de gestão — identidade Giants (v2: estrutura de aplicativo)
   Paleta do manual: laranja #D62828 / #A3201E · bege #F6F2EA / #DCD3C3 · verde-escuro #1C1816 / #0F0D0C
   Tipografia: Graduate só em títulos de página e frases de marca · Noto Sans em todo o resto.
   Cornero só no logotipo (imagem).
   ===================================================================== */
@font-face { font-family: "Graduate"; src: url("fonts/graduate.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/noto-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --laranja: #D62828; --laranja-escuro: #A3201E; --bege: #F6F2EA; --bege-2: #DCD3C3; --verde: #1C1816; --verde-escuro: #0F0D0C;
  --page: #F6F2EA;
  --surface: #FFFDF9;
  --surface-2: #EFE8DD;
  --ink: #1C1816;
  --ink-2: #4A403A;
  --muted: #7A6F67;
  --grid: #E9E1D4;
  --axis: #CFC3AE;
  --border: rgba(28, 24, 22, 0.10);
  --border-forte: rgba(28, 24, 22, 0.18);
  /* menu lateral: sempre verde-escuro */
  --lat-bg: #0F0D0C; --lat-ink: #F6F2EA; --lat-ink-2: #B9AEA3; --lat-rot: #7D7267; --lat-hover: rgba(246,242,234,.06); --lat-borda: rgba(246,242,234,.08);
  /* séries dos gráficos (validadas para daltonismo): teal (receber/principal) e laranja (pagar) */
  --s1: #A87A1E;
  --s2: #D62828;
  --s1-track: #EFE1BF;
  --ord-1: #E9D29B; --ord-2: #D1AA52; --ord-3: #A87A1E; --ord-4: #6E4F12;
  --good: #0ca30c; --good-ink: #00610f;
  --warning: #fab219; --serious: #ec835a; --critical: #d03b3b; --critical-ink: #b42323;
  --accent: #A3201E;          /* botões e links: laranja escuro (contraste) */
  --accent-vivo: #D62828;     /* indicadores, marcas, detalhes */
  --shadow: 0 1px 0 rgba(28,24,22,.03), 0 1px 2px rgba(28,24,22,.04), 0 8px 24px -12px rgba(28,24,22,.10);
  --raio: 16px; --raio-p: 10px;
  --lat-w: 264px;
  --fonte: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fonte-destaque: "Graduate", "Noto Sans", Impact, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0F0D0C; --surface: #1A1715; --surface-2: #26211E;
    --ink: #F6F2EA; --ink-2: #DCD3C3; --muted: #A39789;
    --grid: #2C2622; --axis: #463D37; --border: rgba(246,242,234,0.09); --border-forte: rgba(246,242,234,0.16);
    --lat-bg: #0A0908;
    --s1: #E0B33A; --s2: #D62828; --s1-track: #4A3B1C;
    --ord-1: #6E4F12; --ord-2: #A87A1E; --ord-3: #E0B33A; --ord-4: #F2D88A;
    --good-ink: #2fbf3f; --critical-ink: #f07a7a; --accent: #D62828;
    --shadow: 0 1px 0 rgba(0,0,0,.2);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0F0D0C; --surface: #1A1715; --surface-2: #26211E;
  --ink: #F6F2EA; --ink-2: #DCD3C3; --muted: #A39789;
  --grid: #2C2622; --axis: #463D37; --border: rgba(246,242,234,0.09); --border-forte: rgba(246,242,234,0.16);
  --lat-bg: #0A0908;
  --s1: #E0B33A; --s2: #D62828; --s1-track: #4A3B1C;
  --ord-1: #6E4F12; --ord-2: #A87A1E; --ord-3: #E0B33A; --ord-4: #F2D88A;
  --good-ink: #2fbf3f; --critical-ink: #f07a7a; --accent: #D62828;
  --shadow: 0 1px 0 rgba(0,0,0,.2);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page); color: var(--ink);
  font: 14px/1.5 var(--fonte);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
code { font: 12px ui-monospace, Consolas, monospace; background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 5px; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.ic { flex: none; display: block; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--accent-vivo); }

/* ---------- estrutura: menu lateral + área principal ---------- */
.app { display: grid; grid-template-columns: var(--lat-w) minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: var(--lat-bg); color: var(--lat-ink);
  display: flex; flex-direction: column; border-right: 1px solid var(--lat-borda);
  z-index: 40;
}
.lateral::after { /* símbolo em marca d'água no pé do menu */
  content: ""; position: absolute; left: -70px; bottom: -80px; width: 300px; height: 300px;
  background: url("img/giants.png") no-repeat center / contain; opacity: .045; pointer-events: none;
}
.lat-topo { display: flex; align-items: center; justify-content: space-between; padding: 26px 22px 22px 24px; }
.lat-marca img { display: block; width: 188px; height: auto; }
.lat-x { display: none; }
.lat-nav { flex: 1; overflow-y: auto; grid-template-columns: minmax(0, 1fr); padding: 6px 14px 16px; display: grid; align-content: start; gap: 22px; scrollbar-width: thin; scrollbar-color: rgba(246,242,234,.15) transparent; position: relative; z-index: 1; }
.lat-grupo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.lat-rot { font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--lat-rot); padding: 0 12px 8px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  height: 42px; padding: 0 12px; border: 0; border-radius: var(--raio-p); background: none;
  color: var(--lat-ink-2); font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item .ic { color: var(--lat-rot); transition: color .15s; }
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--lat-hover); color: var(--lat-ink); }
.nav-item:hover .ic { color: var(--lat-ink-2); }
.nav-item[aria-current="page"] { background: linear-gradient(90deg, rgba(214,40,40,.16), rgba(214,40,40,.04)); color: #fff; font-weight: 600; }
.nav-item[aria-current="page"] .ic { color: var(--accent-vivo); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-vivo); }
.nav-selo { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--accent-vivo); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-item:focus-visible, .lat-btn:focus-visible, .lat-usr:focus-visible { outline: 2px solid var(--accent-vivo); outline-offset: -2px; }
.lat-pe { padding: 14px 14px 20px; border-top: 1px solid var(--lat-borda); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; position: relative; z-index: 1; }
.lat-usr-linha { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lat-usr-linha .lat-usr { flex: 1; min-width: 0; }
.lat-usr-anon { color: var(--lat-ink-2); }
.lat-versao { position: relative; flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--lat-borda); background: rgba(246,242,234,.04); color: var(--lat-ink-2); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-decoration: none; font-variant-numeric: tabular-nums; transition: color .15s, border-color .15s, background .15s; }
.lat-versao:hover { color: var(--lat-ink); border-color: rgba(214,40,40,.5); background: rgba(214,40,40,.08); }
.lat-versao .nav-novo { position: absolute; top: -2px; right: -2px; margin: 0; }
.nav-novo { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-vivo); box-shadow: 0 0 0 2px var(--lat-bg); margin-left: auto; flex: none; }
.nav-novo[hidden] { display: none; }
.lat-usr { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--raio-p); text-decoration: none; color: var(--lat-ink); }
.lat-usr:hover, .lat-usr.ativo { background: var(--lat-hover); }
.usr-av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-vivo); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; flex: none; }
.usr-nm { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.usr-nm, .usr-nm small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usr-nm small { font-weight: 400; color: var(--lat-ink-2); font-size: 11.5px; margin-top: 2px; }
.lat-acoes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.lat-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; border-radius: var(--raio-p); border: 1px solid var(--lat-borda); background: transparent; color: var(--lat-ink-2); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.lat-btn .ic { width: 17px; height: 17px; }
.lat-btn:hover { background: var(--lat-hover); color: var(--lat-ink); }
.lat-slogan { margin: 6px 10px 0; font-family: var(--fonte-destaque); font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--lat-rot); line-height: 1.3; white-space: nowrap; overflow: hidden; }
.lat-slogan span { color: var(--accent-vivo); }
.lat-veu { display: none; }

.principal { min-width: 0; display: flex; flex-direction: column; }
.barra {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 36px 16px; min-height: 84px;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.barra.rolada { border-bottom-color: var(--border); box-shadow: 0 8px 24px -18px rgba(15,13,12,.35); }
.barra-menu { display: none; }
.barra-tit { display: grid; gap: 4px; margin-right: auto; min-width: 0; }
.barra-tit h1 { margin: 0; padding-top: .12em; font-family: var(--fonte-destaque); font-weight: 400; font-size: 30px; line-height: 1.2; letter-spacing: .015em; text-transform: uppercase; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.status-att { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pulso { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.status-att[data-estado="carregando"] .pulso { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent); animation: pulsar 1s ease-in-out infinite; }
.status-att[data-estado="erro"] .pulso { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 22%, transparent); }
.status-att:not([data-estado]) .pulso { background: var(--axis); box-shadow: none; }
@keyframes pulsar { 50% { opacity: .35; } }

/* controles */
.ctrl { height: 36px; padding: 0 12px; border: 1px solid var(--border-forte); background: var(--surface); border-radius: var(--raio-p); color: var(--ink); }
.ctrl:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
select.ctrl { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7774' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.ctrl[hidden] { display: none; }
.btn { height: 36px; padding: 0 14px; border: 1px solid var(--border-forte); background: var(--surface); border-radius: var(--raio-p); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--ink); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn .ic { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-2); }
.btn.primario { background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
.btn.primario:hover { background: #B02E00; }
:root[data-theme="dark"] .btn.primario:hover { background: #E84545; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primario:hover { background: #E84545; } }
.btn:focus-visible, .ctrl:focus-visible, .chips button:focus-visible, .switch input:focus-visible + .sw { outline: 2px solid var(--accent-vivo); outline-offset: 2px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.chk input { accent-color: var(--accent); }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { width: 34px; height: 20px; border-radius: 999px; background: var(--axis); position: relative; transition: background .2s; flex: none; }
.switch .sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .sw { background: var(--accent-vivo); }
.switch input:checked + .sw::after { transform: translateX(14px); }

/* avisos do sistema (demonstração, senha única) */
.aviso-sis { display: flex; gap: 10px; align-items: baseline; line-height: 1.5; padding: 11px 16px; margin-bottom: 12px; border-radius: var(--raio-p); font-size: 13px; color: var(--ink-2); background: color-mix(in srgb, var(--accent-vivo) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent-vivo) 22%, transparent); }
.aviso-sis::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-vivo); flex: none; transform: translateY(-1px); }
.aviso-sis b { color: var(--ink); font-weight: 600; }
.aviso-sis + .aviso-sis { margin-top: -4px; }
.aviso-sis:last-of-type { margin-bottom: 22px; }

/* ---------- conteúdo ---------- */
main { width: 100%; max-width: 1480px; padding: 8px 36px 40px; flex: 1; }
.aba { display: none; }
.aba.ativa { display: block; animation: entrar .25s ease-out; }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } }
.carregando main .aba.ativa { opacity: .55; transition: opacity .2s; }
.filtros { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 0 0 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio); }
.filtros label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.filtros label > .ctrl, .filtros label > .chips { text-transform: none; letter-spacing: 0; font-weight: 400; }
.filtros > .btn { margin-left: auto; }
.filtros > .btn.primario { margin-left: 0; }
.chips { display: inline-flex; gap: 2px; padding: 3px; border-radius: calc(var(--raio-p) + 2px); background: var(--surface-2); text-transform: none; letter-spacing: 0; }
.chips button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s; }
.chips button:hover { color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,13,12,.12), 0 0 0 1px var(--border); }

.grade { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1280px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g4, .g2 { grid-template-columns: 1fr; } .hb { --lw: 96px !important; } .hb-val small { display: none; } }
.mt { margin-top: 18px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio);
  padding: 20px 22px; box-shadow: var(--shadow); min-width: 0;
}
.card h2 { font-family: var(--fonte); font-weight: 600; font-size: 15.5px; letter-spacing: -.005em; line-height: 1.3; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink); }
.card .sub { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; }
.card-cab { display: flex; align-items: start; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.card-cab .sub { margin-bottom: 0; }

/* tiles (indicadores) */
.tile .rot { font-size: 13px; font-weight: 500; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.tile .val { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 8px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile .det { font-size: 12.5px; color: var(--muted); }
.tile .key { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.card.tile { position: relative; overflow: hidden; }
.delta { font-size: 12px; font-weight: 600; }
.delta.bom { color: var(--good-ink); }
.delta.ruim { color: var(--critical-ink); }
.hero { display: flex; gap: 40px; align-items: end; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .val { font-size: clamp(36px, 7vw, 56px); white-space: nowrap; font-weight: 700; letter-spacing: -.035em; line-height: 1; margin-top: 12px; font-variant-numeric: tabular-nums; }
.hero .conta { font-size: 13px; color: var(--ink-2); padding-bottom: 4px; line-height: 1.7; }
.hero .conta b { font-weight: 600; color: var(--ink); }

/* status (sempre ícone + rótulo) */
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.st.ok { color: var(--good-ink); } .st.ok::before { background: var(--good); }
.st.at { color: #8a5d00; } .st.at::before { background: var(--warning); }
.st.se { color: #a8461f; } .st.se::before { background: var(--serious); }
.st.cr { color: var(--critical-ink); } .st.cr::before { background: var(--critical); }
.st.ne { color: var(--ink-2); } .st.ne::before { background: var(--axis); }
:root[data-theme="dark"] .st.at { color: var(--warning); } :root[data-theme="dark"] .st.se { color: var(--serious); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st.at { color: var(--warning); } :root:not([data-theme="light"]) .st.se { color: var(--serious); } }

/* alertas */
.alertas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alertas li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 13px; color: var(--ink-2); align-items: start; }
.alertas li b { color: var(--ink); font-weight: 600; }
.ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.ico.cr { background: var(--critical); } .ico.at { background: var(--warning); color: #3a2a00; } .ico.ok { background: var(--good); }
.vazio { color: var(--muted); font-size: 13px; padding: 12px 0; }

/* legendas */
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* gráfico de colunas (SVG) */
.col-chart svg { display: block; width: 100%; overflow: visible; }
.col-chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.col-chart .grid { stroke: var(--grid); stroke-width: 1; }
.col-chart .base { stroke: var(--axis); stroke-width: 1; }
.col-chart .hit { fill: transparent; cursor: default; }
.col-chart .hit:hover, .col-chart .hit:focus { fill: var(--ink); fill-opacity: .04; outline: none; }

/* barras horizontais (HTML) */
.hb { display: grid; gap: 6px; }
.hb-row { display: grid; grid-template-columns: var(--lw, 150px) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
.hb-row:hover, .hb-row:focus { background: var(--surface-2); outline: none; }
.hb-lab { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { position: relative; min-width: 0; height: 18px; display: flex; align-items: center; gap: 8px; }
.hb-bar { height: 16px; border-radius: 0 4px 4px 0; min-width: 2px; flex: none; }
.hb-val { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; }
.hb-val small { color: var(--muted); margin-left: 4px; }
.hb-track.bullet { display: block; }
.hb-track.bullet .trk { position: absolute; left: 0; top: 1px; height: 16px; border-radius: 0 4px 4px 0; background: var(--s1-track); }
.hb-track.bullet .fil { position: absolute; left: 0; top: 5px; height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); }
.hb-track.bullet .hb-val { position: absolute; top: 0; }

/* tabelas */
.tab-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.tab-tools .busca { flex: 1 1 200px; max-width: 320px; }
.tab-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--border); border-radius: 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th, table.t td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.t th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; color: var(--ink-2); font-size: 12px; cursor: pointer; user-select: none; z-index: 1; }
table.t th.n, table.t td.n { text-align: right; }
table.t th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
table.t th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t td.nome { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
table.t tfoot td { font-weight: 600; background: var(--surface-2); position: sticky; bottom: 0; }
.rodape-tab { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* tooltip */
#tip {
  position: fixed; z-index: 50; pointer-events: none; display: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.14); padding: 8px 10px; font-size: 12px; min-width: 140px;
}
#tip .tt { color: var(--ink-2); margin-bottom: 4px; font-size: 11.5px; }
#tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
#tip .tr span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
#tip .tr b { font-variant-numeric: tabular-nums; }
#tip .lk { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }

.erro-box { border: 1px solid var(--critical); background: color-mix(in srgb, var(--critical) 8%, var(--surface)); color: var(--ink); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }

/* botões "i" e popover de explicação */
.i-btn {
  display: inline-grid; place-items: center; width: 17px; height: 17px; padding: 0; margin-left: 4px; flex: none;
  border-radius: 50%; border: 1px solid var(--axis); background: transparent; color: var(--muted);
  font: italic 600 11px/1 Georgia, "Times New Roman", serif; cursor: pointer; vertical-align: 1px;
}
.i-btn:hover, .i-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.i-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
table.t th .i-btn { width: 15px; height: 15px; font-size: 10px; }
.tab-tools .i-btn { width: 22px; height: 22px; font-size: 13px; }
#infoPop {
  position: fixed; z-index: 60; background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 32px rgba(0,0,0,.18); padding: 12px 14px 12px; font-size: 13px; line-height: 1.5;
  max-height: min(70vh, 520px); overflow: auto;
}
#infoPop[hidden] { display: none; }
#infoPop .ip-cab { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 6px; }
#infoPop .ip-cab b { font-size: 14px; }
#infoPop .ip-x { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
#infoPop p { margin: 0 0 7px; color: var(--ink-2); }
#infoPop .ip-rot { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 4px; }
#infoPop pre { margin: 0; white-space: pre-wrap; font: 12px/1.5 ui-monospace, Consolas, monospace; background: var(--surface-2); border-radius: 6px; padding: 7px 9px; color: var(--ink); }
#infoPop .ip-agora { color: var(--ink); font-variant-numeric: tabular-nums; }
#infoPop .ip-fonte { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--grid); font-size: 11.5px; color: var(--muted); }
#infoPop .ip-fonte code { font: 11px ui-monospace, Consolas, monospace; color: var(--ink-2); }
body.tv .i-btn { display: none; }

/* cliente na fila da expedição */
table.t td.cli { max-width: 300px; white-space: normal; }
.cli-rz { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-fn { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.tv .cli-fn { font-size: 14px; }

.chips .cnt { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
body.tv .tab-tools { display: none; }


/* ---------- ajustes finos de componentes ---------- */
.alertas { gap: 12px; }
.alertas li { font-size: 13.5px; line-height: 1.5; padding-bottom: 12px; border-bottom: 1px solid var(--grid); }
.alertas li:last-child { border-bottom: 0; padding-bottom: 0; }
.hb { gap: 8px; }
.hb-bar { border-radius: 0 5px 5px 0; }
.tab-tools { gap: 10px; margin-bottom: 14px; }
.tab-tools .busca { padding-left: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E7774' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; }
.tab-wrap { border-radius: var(--raio-p); border-color: var(--border); }
table.t { font-size: 13px; }
table.t th, table.t td { padding: 10px 12px; border-bottom-color: var(--grid); }
table.t th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
table.t th:hover { color: var(--ink); }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tfoot td { border-top: 1px solid var(--border-forte); }
.rodape-tab { font-size: 12px; margin-top: 12px; }
#tip, #infoPop { border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(15,13,12,.35), 0 0 0 1px var(--border); border: 0; }
.i-btn { border-color: var(--border-forte); }
.erro-box { border-radius: var(--raio-p); }

/* ---------- destaque da visão geral (bloco verde da marca) ---------- */
.card.destaque { background: #1C1816; color: #F6F2EA; border-color: transparent; position: relative; overflow: hidden; padding: 28px 30px; box-shadow: 0 18px 40px -24px rgba(15,13,12,.6); }
.card.destaque::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 140% at 100% 0%, rgba(214,40,40,.20), transparent 55%); pointer-events: none; }
.card.destaque::after { content: ""; position: absolute; right: -50px; top: 50%; transform: translateY(-50%); width: 260px; height: 260px; background: url("img/giants.png") no-repeat center / contain; opacity: .10; pointer-events: none; }
.card.destaque .rot { color: #CFC3AE; font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.card.destaque .rot::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--accent-vivo); }
.card.destaque .val { color: #fff; }
.card.destaque .conta { color: #DCD3C3; }
.card.destaque .conta b { color: #F6F2EA; }
.card.destaque .i-btn { border-color: rgba(246,242,234,.3); color: #CFC3AE; }
:root[data-theme="dark"] .card.destaque { background: #1C1816; box-shadow: 0 0 0 1px rgba(246,242,234,.08); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.destaque { background: #1C1816; box-shadow: 0 0 0 1px rgba(246,242,234,.08); } }

/* ---------- rodapé da marca ---------- */
.rodape { padding: 8px 36px 32px; max-width: 1480px; width: 100%; }
.rodape-notas { font-size: 12px; color: var(--muted); line-height: 1.65; padding: 18px 0; border-top: 1px solid var(--border); }
.rodape-notas b { color: var(--ink-2); font-weight: 600; }
.rodape-marca { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.rodape-marca img { opacity: .9; }
.rodape-marca b { color: var(--ink); font-weight: 700; letter-spacing: .02em; }
.rodape-sep { color: var(--axis); }

/* ---------- modo TV (expedição) ---------- */
body.tv .app { display: block; }
body.tv .lateral, body.tv .barra, body.tv .aviso-sis, body.tv .filtros, body.tv .rodape { display: none; }
body.tv main { max-width: none; padding: 24px; }
body.tv .tile .val { font-size: 40px; }
body.tv table.t { font-size: 16px; }
body.tv .tab-wrap { max-height: none; }
body.tv .i-btn, body.tv .tab-tools { display: none; }
.sair-tv { display: none; }
body.tv .sair-tv { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 30; }

/* ---------- tablet e celular: menu vira gaveta ---------- */
@media (max-width: 1080px) {
  .app { display: block; }
  .lateral { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--lat-w), 86vw); transform: translateX(-102%); transition: transform .25s cubic-bezier(.3,.7,.3,1), box-shadow .25s; box-shadow: none; }
  body.menu-aberto .lateral { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .lat-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--raio-p); background: var(--lat-hover); color: var(--lat-ink); cursor: pointer; }
  .lat-veu { display: block; position: fixed; inset: 0; background: rgba(11,16,15,.55); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.menu-aberto .lat-veu { opacity: 1; pointer-events: auto; }
  body.menu-aberto { overflow: hidden; }
  .barra { padding: 12px 20px; min-height: 0; gap: 10px 12px; }
  .barra-menu { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--raio-p); border: 1px solid var(--border-forte); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
  .barra-tit h1 { font-size: 22px; }
  main { padding: 8px 20px 32px; }
  .rodape { padding: 8px 20px 28px; }
}
@media (max-width: 700px) {
  .barra-acoes { width: 100%; }
  .barra-acoes .status-att { margin-right: auto; }
  .barra-acoes .sw-rot, #btnAtualizar span { display: none; }
  #btnAtualizar { width: 36px; padding: 0; justify-content: center; }
  .barra-tit .eyebrow { display: none; }
  main, .rodape { padding-left: 16px; padding-right: 16px; }
  .barra { padding-left: 16px; padding-right: 16px; }
  .card { padding: 16px; }
  .card.destaque { padding: 22px 20px; }
  .filtros { padding: 12px; }
  .filtros > .btn { margin-left: 0; }
  .chips { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
}

/* ---------- telas de acesso (login, primeiro acesso, troca de senha) ---------- */
body.acesso { background: #0F0D0C; }
.acesso-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.acesso-marca {
  background: radial-gradient(110% 80% at 0% 0%, #3A1412 0%, #1C1816 45%, #0F0D0C 100%);
  color: #F6F2EA; padding: 56px 64px 44px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.acesso-marca::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 100% 100%, rgba(214,40,40,.18), transparent 70%); pointer-events: none; }
.acesso-marca::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 520px; height: 520px; background: url("img/giants.png") no-repeat center / contain; opacity: .08; }
.acesso-marca > * { position: relative; z-index: 1; }
.acesso-marca img { width: 168px; height: auto; }
.acesso-slogan { font-family: var(--fonte-destaque); font-size: clamp(38px, 4.1vw, 66px); line-height: 1.16; text-transform: uppercase; margin: auto 0 0; letter-spacing: .01em; }
.acesso-slogan span { color: #D62828; }
.acesso-rodape { color: #7F8A86; font-size: 11.5px; margin: 32px 0 0; letter-spacing: .14em; text-transform: uppercase; }
.acesso-rodape span { color: #D62828; margin: 0 4px; }
.acesso-form { background: #F6F2EA; color: #1C1816; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 40px 24px 28px; max-width: none; }
.acesso-caixa { width: 100%; max-width: 380px; }
.acesso-caixa .eyebrow { color: #7A6F67; }
.acesso-caixa h1 { font-family: var(--fonte-destaque); font-weight: 400; font-size: 38px; line-height: 1.4; text-transform: uppercase; letter-spacing: .015em; margin: 14px 0 10px; }
.acesso-sub { color: #4A403A; margin: 0 0 28px; font-size: 14px; }
.acesso-caixa form { display: grid; gap: 16px; }
.acesso-caixa label { display: grid; gap: 7px; font-size: 12.5px; font-weight: 600; color: #1C1816; }
.acesso-caixa input { height: 46px; padding: 0 14px; border: 1px solid rgba(28,24,22,.2); border-radius: 10px; background: #FFFDF9; color: #1C1816; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.acesso-caixa input:hover { border-color: rgba(28,24,22,.35); }
.acesso-caixa input:focus { outline: none; border-color: #D62828; box-shadow: 0 0 0 4px rgba(214,40,40,.14); }
.acesso-caixa .btn.grande { height: 48px; justify-content: center; font-size: 15px; background: #A3201E; border-radius: 10px; margin-top: 4px; }
.acesso-caixa .btn.grande:hover { background: #B02E00; }
.acesso-caixa .erro { background: #fbe1dc; color: #8a1c0c; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.acesso-caixa .aviso { background: #E7E3D5; color: #1C1816; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.acesso-caixa .dica { color: #7A6F67; font-size: 12px; margin: 4px 0 0; line-height: 1.55; }
.acesso-caixa .dica a { color: #A3201E; }
.acesso-caixa code { background: rgba(28,24,22,.07); }
.acesso-pe { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8C938F; margin: 24px 0 0; }
@media (max-width: 860px) {
  .acesso-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .acesso-marca { padding: 28px 22px 26px; }
  .acesso-marca::after { width: 300px; height: 300px; right: -90px; bottom: -110px; }
  .acesso-marca img { width: 118px; }
  .acesso-slogan { font-size: 34px; margin-top: 22px; }
  .acesso-rodape { display: none; }
  .acesso-form { place-items: start center; padding: 32px 22px 24px; }
  .acesso-caixa h1 { font-size: 32px; }
}
