/* Controle GB — identidade KMNO SPORTS (www.kmno.com.br, out/2026)
 * Monocromática como o site: grafite #2C2C2B, hover #3E3E3C, preto na faixa de
 * menu, cinzas claros (#EBEDEF/#F2F3F4), Montserrat, cantos quase retos.
 * Cores só por variável: claro em :root, escuro pelo sistema (sem escolha) ou
 * pelo botão de tema (data-theme). Vermelho/âmbar/verde ficam para estado.
 * Séries do gráfico: grafite, cinza-quente e azul-aço (distinguíveis nos 2 modos).
 */
:root {
  color-scheme: light;
  --head: #000000;
  --head-2: #2c2c2b;
  --topo: #ffffff;
  --topo-ink: #2c2c2b;
  --bg: #f2f3f4;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --ink: #2c2c2b;
  --ink-2: #3e3e3c;
  --ink-3: #6f6f6c;
  --line: #e1e2e4;
  --line-2: #ebedef;
  --accent: #2c2c2b;
  --accent-hover: #3e3e3c;
  --accent-soft: #ebedef;
  --accent-ink: #ffffff;
  --red: #c4362f;
  --red-bg: #fbe9e7;
  --amber: #9a5b00;
  --amber-bg: #fdf1dc;
  --green: #177a4f;
  --green-bg: #e2f3ea;
  --blue-bg: #eceef0;
  --s1: #2c2c2b;
  --s2: #b0a999;
  --s3: #4f7a9c;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 8px rgba(0, 0, 0, .04);
  --logo-filtro: none;
  --fonte: Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --head: #000000; --head-2: #121212; --topo: #1a1a19; --topo-ink: #f2f3f4;
    --bg: #121212; --surface: #1c1c1b; --surface-2: #232322;
    --ink: #f2f3f4; --ink-2: #c9cacb; --ink-3: #9a9b9c;
    --line: #333331; --line-2: #2a2a29;
    --accent: #f2f3f4; --accent-hover: #ffffff; --accent-soft: #2a2a29; --accent-ink: #000000;
    --red: #ef7d74; --red-bg: #3a1d1b; --amber: #e3a64a; --amber-bg: #34270f;
    --green: #5cc48f; --green-bg: #15301f; --blue-bg: #262626;
    --s1: #e8e8e6; --s2: #a39c8c; --s3: #6b9cc2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --logo-filtro: invert(1);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --head: #000000; --head-2: #121212; --topo: #1a1a19; --topo-ink: #f2f3f4;
  --bg: #121212; --surface: #1c1c1b; --surface-2: #232322;
  --ink: #f2f3f4; --ink-2: #c9cacb; --ink-3: #9a9b9c;
  --line: #333331; --line-2: #2a2a29;
  --accent: #f2f3f4; --accent-hover: #ffffff; --accent-soft: #2a2a29; --accent-ink: #000000;
  --red: #ef7d74; --red-bg: #3a1d1b; --amber: #e3a64a; --amber-bg: #34270f;
  --green: #5cc48f; --green-bg: #15301f; --blue-bg: #262626;
  --s1: #e8e8e6; --s2: #a39c8c; --s3: #6b9cc2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --logo-filtro: invert(1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13.5px/1.5 var(--fonte);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.content { max-width: 1480px; width: 100%; margin: 0 auto; padding: 20px; flex: 1; min-width: 0; }

/* ---------- cabeçalho ---------- */
.topbar { background: var(--head); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1480px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fff; color: #15181c; font-weight: 700; font-size: 13px; letter-spacing: .5px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.brand-text b { font-size: 15px; font-weight: 600; }
.brand-text small { font-size: 11.5px; color: rgba(255,255,255,.6); }
.topbar-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.nav-link { color: rgba(255,255,255,.78); text-decoration: none; padding: 7px 11px; border-radius: 8px; font-size: 13.5px; white-space: nowrap; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar-user { display: flex; align-items: center; gap: 8px; flex: none; }
.user-name { color: rgba(255,255,255,.8); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-tema { width: 32px; padding: 6px 0 !important; justify-content: center; }
.inline-form { display: inline; margin: 0; }

/* ---------- faixa superior ---------- */
.hero { background: linear-gradient(180deg, var(--head) 0%, var(--head-2) 100%); color: #fff; }
.hero-inner { max-width: 1480px; margin: 0 auto; padding: 22px 20px 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: rgba(255,255,255,.55); }
.page-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.3px; }
.ultima { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,.72); }
.ultima b { color: #fff; font-weight: 600; }
.ultima-velha b { color: #ffb4ad; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-curta { padding-bottom: 22px; }
.link-claro { color: #fff; text-decoration: none; opacity: .85; }
.link-claro:hover { opacity: 1; text-decoration: underline; }

.abas { display: flex; gap: 2px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.abas::-webkit-scrollbar { display: none; }
.abas button { border: 0; background: transparent; color: rgba(255,255,255,.7); padding: 10px 14px; border-radius: 10px 10px 0 0; cursor: pointer; font-weight: 500; white-space: nowrap; }
.abas button:hover { color: #fff; background: rgba(255,255,255,.06); }
.abas button.on { background: var(--bg); color: var(--ink); }
.aba-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; margin-left: 4px; }

/* ---------- botões e selos ---------- */
.btn { border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-weight: 500; background: var(--surface); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; transition: background .15s, border-color .15s; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.hero .btn-primary { background: #fff; color: #15181c; }
.hero .btn-primary:hover:not(:disabled) { background: #e6e9ed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-ok { background: var(--green); color: #fff; }
.btn-block { width: 100%; justify-content: center; margin-top: 20px; padding: 11px 18px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--green-bg); color: var(--green); }
.pill-warn { background: var(--amber-bg); color: var(--amber); }
.pill-err { background: var(--red-bg); color: var(--red); }
.pill-run { background: var(--blue-bg); color: var(--accent); }
.pill-run::before { animation: pulse 1s infinite alternate; }
.pill-muted { background: rgba(255,255,255,.12); color: #fff; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }

.avisos { margin-top: 14px; display: grid; gap: 6px; }
.aviso { background: var(--red-bg); color: var(--red); border-left: 4px solid var(--red); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.aviso.aviso-info { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); border-left-color: rgba(255,255,255,.4); }

.badge { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); margin: 1px 4px 1px 0; }
.b-ok { background: var(--green-bg); color: var(--green); }
.b-warn { background: var(--amber-bg); color: var(--amber); }
.b-err { background: var(--red-bg); color: var(--red); }
.b-info { background: var(--blue-bg); color: var(--accent); }
.b-off { background: var(--line-2); color: var(--ink-3); }
.sev { display: inline-flex; align-items: center; gap: 5px; }
.sev::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }

/* ---------- filtros ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.toolbar { padding: 12px 14px; margin-bottom: 16px; display: grid; gap: 10px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; justify-self: start; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.f { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.f-grow { flex: 1 1 220px; }
.f input, .f select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); font-size: 13.5px; min-width: 140px; max-width: 100%; color: var(--ink); }
.f-grow input { width: 100%; }
.f input:focus, .f select:focus, .field-input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
.filtro-nota { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.subfiltros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line); }

/* ---------- cards de indicador ---------- */
.secao-titulo { font-size: 15px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.secao-titulo:first-child { margin-top: 0; }
.secao-titulo small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.kpi-passo { position: absolute; top: 10px; right: 12px; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; padding-right: 22px; }
.kpi-num { font-size: 26px; font-weight: 600; letter-spacing: -.4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-foot { font-size: 12px; color: var(--ink-3); }
.kpi-destaque { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.kpi-alerta .kpi-num { color: var(--red); }
.kpi-atencao .kpi-num { color: var(--amber); }
.fluxo-seta { color: var(--ink-3); }

/* ---------- gráfico ---------- */
.grafico { padding: 14px 16px 10px; }
.grafico-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.grafico svg { display: block; overflow: visible; }
.grafico .eixo { fill: var(--ink-3); font-size: 11px; }
.grafico .grade { stroke: var(--line-2); stroke-width: 1; }
.grafico .base { stroke: var(--line); stroke-width: 1; }
.grafico .barra { transition: opacity .1s; }
.grafico .hit { fill: transparent; cursor: default; }
.grafico .hit:hover { fill: var(--line-2); fill-opacity: .5; }
.grafico-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.15); min-width: 150px; }
.tooltip b { display: block; margin-bottom: 4px; }
.tooltip .tt-linha { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tooltip .tt-linha i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

/* ---------- tabelas ---------- */
.table-card { overflow: hidden; margin-bottom: 16px; }
.table-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.table-title { margin: 0; font-size: 15px; font-weight: 600; }
.table-count { color: var(--ink-3); font-size: 12.5px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.grid th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 11.5px; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; }
.grid th[data-sort] { cursor: pointer; user-select: none; }
.grid th[data-sort]:hover { color: var(--accent); }
.grid th.sorted.asc::after { content: " ▲"; font-size: 9px; }
.grid th.sorted.desc::after { content: " ▼"; font-size: 9px; }
.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; vertical-align: top; }
.grid .n { text-align: right; }
.grid tr.row { cursor: pointer; }
.grid tr.row:hover td { background: var(--surface-2); }
.grid tr.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid tr.row.open td { background: var(--accent-soft); }
.grid tr.total td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); }
.grid tr.apagada td { color: var(--ink-3); }
.grid tr.apagada td .riscar { text-decoration: line-through; }
.grid td.wrap { white-space: normal; min-width: 200px; }
.grid tr.detail > td { background: var(--surface-2); padding: 12px 14px 16px; white-space: normal; }
.det-inner { position: sticky; left: 14px; max-width: min(1420px, calc(100vw - 72px)); }
.grid td.c-emit { white-space: normal; min-width: 220px; max-width: 300px; }
.mono { font-family: var(--mono); font-size: 12px; }
.zero { color: var(--ink-3); opacity: .6; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.neg { color: var(--red); font-weight: 600; }
.pos { color: var(--green); }
.warn { color: var(--amber); }
.empty { text-align: center; color: var(--ink-3); padding: 32px 10px !important; white-space: normal !important; }
.mais { display: flex; justify-content: center; padding: 10px; }
.chev { display: inline-block; width: 7px; height: 7px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-45deg); transition: transform .15s; }
tr.open .chev { transform: rotate(45deg); }
.barra-pct { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--line-2); vertical-align: middle; margin-left: 6px; overflow: hidden; }
.barra-pct i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- detalhe ---------- */
.det-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.det-bloco { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.det-bloco h4 { margin: 0 0 8px; font-size: 13px; }
.det-bloco .table-wrap { margin: 0 -4px; }
table.tl { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tl th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11px; padding: 5px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .3px; }
.tl td { padding: 5px 6px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tl .n { text-align: right; }
.det-nums { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.det-nums div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.det-nums span { display: block; font-size: 11px; color: var(--ink-3); }
.det-nums b { font-size: 15px; font-variant-numeric: tabular-nums; }
.form-linha { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-linha .f { min-width: 0; }
.form-linha textarea, .form-linha input[type=text] { min-width: 240px; }
.hist { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); }
.hist li { padding: 4px 0; border-top: 1px dashed var(--line); }

/* ---------- materiais ---------- */
.forn-blocos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.forn { cursor: pointer; text-align: left; }
.forn.on { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent), var(--shadow); }
.forn-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12.5px; margin-top: 6px; }
.forn-nums span { color: var(--ink-3); }
.forn-nums b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- pendências ---------- */
.pend-grupo { margin-bottom: 14px; }
.pend-grupo summary { cursor: pointer; list-style: none; padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pend-grupo summary::-webkit-details-marker { display: none; }
.pend-grupo summary h3 { margin: 0; font-size: 14px; font-weight: 600; }
.pend-grupo[open] summary { border-bottom: 1px solid var(--line); }

/* ---------- modal e toast ---------- */
.modal { border: 1px solid var(--line); border-radius: 12px; padding: 0; background: var(--surface); color: var(--ink); width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(10, 12, 14, .45); }
.modal-form { padding: 18px 20px; }
.modal-title { margin: 0 0 6px; font-size: 17px; }
.modal-texto { margin: 0 0 6px; color: var(--ink-2); font-size: 13.5px; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.erro { background: var(--red); color: #fff; }

/* ---------- rodapé ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; color: var(--ink-3); }
.footer-inner { max-width: 1480px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.footer-brand { font-weight: 600; color: var(--ink-2); }
.footer-fontes { margin: 0; max-width: 900px; }

/* ---------- login ---------- */
body.pagina-login { background: var(--surface); }
body.pagina-login .content { max-width: none; padding: 0; display: flex; }
.login-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); flex: 1; min-height: 100vh; }
.login-marca { background: linear-gradient(160deg, #15181c 0%, #23282e 60%, #2d5d8a 140%); color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.login-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: #fff; color: #15181c; font-weight: 700; font-size: 20px; }
.login-marca-texto { max-width: 500px; }
.login-eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255,255,255,.55); }
.login-marca h1 { font-size: 34px; line-height: 1.2; font-weight: 600; margin: 0 0 12px; }
.login-desc { margin: 0; color: rgba(255,255,255,.75); font-size: 15px; line-height: 1.55; }
.login-rodape-marca { margin: 0; font-size: 12px; color: rgba(255,255,255,.5); }
.login-form-lado { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(380px, 100%); }
.login-title { margin: 0; font-size: 24px; font-weight: 600; }
.login-sub { margin: 6px 0 20px; color: var(--ink-3); }

/* ---------- formulários / admin ---------- */
.field-label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 500; margin: 12px 0 5px; }
.field-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface); color: var(--ink); }
.field-input-small { width: auto; padding: 6px 10px; }
.alert { border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-info { background: var(--blue-bg); color: var(--ink-2); }
.admin-section { margin-bottom: 24px; }
.section-title { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.form-card { padding: 16px 18px; max-width: 460px; }
.admin-card { padding: 20px 22px; }
.admin-card .form-card { box-shadow: none; background: var(--surface-2); }
.users-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.users-table th, .users-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); text-align: left; font-size: 13px; vertical-align: middle; }
.users-table th { color: var(--ink-2); font-weight: 600; background: var(--surface-2); font-size: 12px; }
.actions-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.reset-details summary { list-style: none; }
.reset-details summary::-webkit-details-marker { display: none; }
.reset-form { display: inline-flex; gap: 6px; margin-top: 6px; }
.tag { border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.tag-admin { background: var(--blue-bg); color: var(--accent); }
.tag-consulta { background: var(--line-2); color: var(--ink-2); }
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-off { background: var(--line-2); color: var(--ink-3); }
.empty-row { text-align: center; color: var(--ink-3); }
.cell-data { color: var(--ink-3); font-size: 12px; }
.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 16px; }
.param-grid .f input { width: 100%; }
.param-ajuda { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* ---------- celular ---------- */
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; min-height: 0; }
  .login-marca { padding: 26px 16px; }
  .login-marca h1 { font-size: 24px; }
  .login-desc { display: none; }
  .topbar-inner { flex-wrap: wrap; row-gap: 6px; }
  .topbar-nav { order: 3; flex-basis: 100%; }
  .topbar-user { margin-left: auto; }
}
@media (max-width: 640px) {
  .content { padding: 14px 16px; }
  .topbar-inner { padding: 8px 16px; }
  .brand-text small, .user-name { display: none; }
  .hero-inner { padding: 16px 16px 0; }
  .page-title { font-size: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 11px 12px; }
  .kpi-num { font-size: 21px; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .f, .f input, .f select { width: 100%; min-width: 0; }
  .f-grow { grid-column: 1 / -1; }
  .det-grid { grid-template-columns: 1fr; }
  .det-inner { left: 0; max-width: calc(100vw - 62px); }
  .form-linha textarea, .form-linha input[type=text] { min-width: 0; width: 100%; }
  .footer-inner { padding: 14px 16px; }
  .users-table thead { display: none; }
  .users-table tr { display: block; border-bottom: 1px solid var(--line); }
  .users-table td { display: flex; justify-content: space-between; border: 0; }
  .users-table td::before { content: attr(data-label); color: var(--ink-3); font-size: 12px; }
}

/* visão do cliente */
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td, tr.clicavel:focus-visible td { background: color-mix(in srgb, currentColor 5%, transparent); }
tr.total td { border-top: 2px solid currentColor; }

/* ================= identidade KMNO SPORTS =================
 * Cabeçalho branco com o logo (como o site), faixa preta com título e abas
 * (como a barra de menu do site), rótulos em Montserrat bold maiúscula. */
.topbar { background: var(--topo); color: var(--topo-ink); border-top: 4px solid var(--head-2); border-bottom: 1px solid var(--line); }
.topbar-inner { padding: 12px 20px; }
.brand { color: var(--topo-ink); gap: 14px; }
.brand-logo { height: 30px; width: auto; display: block; filter: var(--logo-filtro); flex: none; }
.brand-text { border-left: 1px solid var(--line); padding-left: 14px; }
.brand-text b { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.brand-text small { color: var(--ink-3); font-size: 11px; }
.nav-link { color: var(--topo-ink); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-radius: 2px; padding: 8px 12px; }
.nav-link:hover { background: var(--line-2); color: var(--topo-ink); }
.topbar .btn-ghost { color: var(--topo-ink); border-color: var(--line); }
.topbar .btn-ghost:hover { background: var(--line-2); border-color: var(--topo-ink); }
.user-name { color: var(--ink-2); font-weight: 600; }

.hero { background: var(--head); }
.page-eyebrow { text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; font-size: 11px; }
.page-title { font-weight: 800; text-transform: uppercase; letter-spacing: .6px; font-size: 26px; }
.abas button { border-radius: 0; text-transform: uppercase; font-weight: 700; font-size: 12px; letter-spacing: .6px; padding: 12px 16px; }
.abas button.on { box-shadow: inset 0 3px 0 var(--head-2); }

.btn { border-radius: 2px; font-weight: 600; }
.btn-primary { text-transform: uppercase; letter-spacing: .5px; font-size: 12.5px; font-weight: 700; }
.hero .btn-primary { background: #ffffff; color: #000000; }
.hero .btn-primary:hover:not(:disabled) { background: #ebedef; }
.btn-xs, .badge, .pill { border-radius: 2px; }
.seg, .seg button, .f input, .f select, .field-input, .det-bloco, .det-nums div, .tooltip, .modal, .aviso { border-radius: 2px; }

.kpi { border-radius: var(--radius); border-top: 3px solid var(--line); }
.kpi-label { font-weight: 700; letter-spacing: .7px; font-size: 11px; }
.kpi-num { font-weight: 700; letter-spacing: -.3px; }
.kpi-destaque { border-color: var(--line); border-top-color: var(--accent); box-shadow: var(--shadow); }
.kpi-atencao { border-top-color: var(--amber); }
.kpi-alerta { border-top-color: var(--red); }
.secao-titulo, .table-title { text-transform: uppercase; letter-spacing: .7px; font-weight: 800; font-size: 13px; }
.grid th { text-transform: uppercase; letter-spacing: .5px; font-size: 11px; font-weight: 700; }
.link-claro { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.site-footer .footer-brand { text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }

.login-marca { background: #000000; }
.login-logo { height: 46px; width: auto; display: block; filter: invert(1); }
.login-marca h1 { font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.login-eyebrow { color: rgba(255, 255, 255, .6); }
.login-title { font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }

@media (max-width: 720px) {
  .brand-logo { height: 22px; }
  .brand-text { display: none; }
  .page-title { font-size: 21px; }
}
.alert { border-radius: 2px; }
.hero .alert-info { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); border-left: 3px solid rgba(255, 255, 255, .5); }
.campo-codigo { font-family: var(--mono); font-size: 22px; letter-spacing: 8px; text-align: center; }
.login-acoes { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; }

/* PDFs (pedido da GB e DANFE da Omie) — abrem em aba nova */
.doc-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.doc-link:hover { text-decoration-thickness: 2px; }
.doc-nfs { margin: 8px 0 0; line-height: 1.8; }

/* Legenda e ações de tabela da visão do cliente */
.table-acoes { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.termos { margin: 12px 0 16px; }
.termos > summary { cursor: pointer; padding: 11px 16px; font-weight: 600; font-size: 13.5px; }
.termos[open] > summary { border-bottom: 1px solid var(--line); }
.leg-corpo { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 32px; padding: 12px 16px 4px; }
.leg-corpo h3 { margin: 0 0 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); }
.leg-corpo dl { margin: 0; }
.leg-item { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 5px 0; font-size: 13px; line-height: 1.45; }
.leg-item dt { font-weight: 600; }
.leg-item dd { margin: 0; color: var(--ink-2); }
.leg-nota { margin: 4px 16px 12px; }
@media (max-width: 600px) {
  .leg-corpo { grid-template-columns: minmax(0, 1fr); }
  .leg-item { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 6px 0; }
}

/* ================= Controladoria KMNO =================
 * Cabeçalho fixo (menu + filtro), tela inicial no modelo B, telas de detalhe e gráficos.
 * Mobile primeiro: nada passa de 100% da largura; tabela rola dentro do próprio .table-wrap. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cabecalho { position: sticky; top: 0; z-index: 20; }
.topbar { position: static; }
.nav-link.ativo { box-shadow: inset 0 -3px 0 var(--head-2); }
.bloco { margin-bottom: 22px; min-width: 0; }
.nota { font-size: 12.5px; color: var(--ink-3); margin: 6px 0; }
.nota.vazio { font-weight: 600; color: var(--ink-2); }
.vazio-pagina { padding: 22px 18px; }
.vazio-pagina .nota { margin: 0; font-size: 14px; }

/* filtro */
.filtro { background: var(--head); color: #fff; }
.filtro-inner { max-width: 1480px; margin: 0 auto; padding: 8px 20px; display: flex; gap: 8px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.filtro-form { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; min-width: 0; }
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 6px 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: rgba(255,255,255,.8); }
.chip input:checked + span { background: #fff; color: #000; border-color: #fff; }
.chip input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.mes select { border: 1px solid rgba(255,255,255,.35); border-radius: 2px; background: #000; color: #fff; padding: 6px 8px; font-size: 12.5px; font-weight: 600; max-width: 100%; }
.atualizacao { margin: 0; font-size: 12px; color: rgba(255,255,255,.75); }
.aviso-velho { background: var(--amber-bg); color: var(--amber); border-left: 4px solid var(--amber); border-radius: 2px; padding: 8px 12px; font-size: 13px; margin: 8px 0; overflow-wrap: anywhere; }
.filtro .aviso-velho { margin: 0; border-radius: 0; padding: 8px 20px; }
.aviso-alerta { background: var(--red-bg); color: var(--red); border-left: 4px solid var(--red); border-radius: 2px; padding: 8px 12px; font-size: 13px; margin: 10px 0; overflow-wrap: anywhere; }

/* tela inicial (modelo B) */
.alertas { list-style: none; margin: 0; padding: 0; }
.alerta { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.alerta:last-child { border-bottom: 0; }
.alerta-frase { overflow-wrap: anywhere; }
.alerta-frase a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.alerta-valor { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.nada { margin: 0; padding: 16px 18px; font-weight: 600; color: var(--green); }
.kx-g { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.kx-c { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; min-width: 0; box-shadow: var(--shadow); }
.kx-l { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); }
.kx-v { font-size: 24px; font-weight: 700; margin: 4px 0 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kx-s { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.kx-leg { font-size: 11px; color: var(--ink-3); margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.kx-bar { height: 6px; background: var(--line-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.kx-bar i { display: block; height: 100%; background: var(--accent); }
.kx-t { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 2px; display: inline-block; letter-spacing: .3px; }
.kx-t.r { color: var(--red); background: var(--red-bg); }
.kx-t.a { color: var(--amber); background: var(--amber-bg); }
.kx-t.g { color: var(--green); background: var(--green-bg); }
.kx-t.c { color: var(--ink-2); background: var(--line-2); }
.lista-assuntos { list-style: none; margin: 0; padding: 0; }
.lista-assuntos li { border-bottom: 1px solid var(--line-2); }
.lista-assuntos li:last-child { border-bottom: 0; }
.lista-assuntos a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.lista-assuntos a:hover { background: var(--surface-2); }
.a-titulo { font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 12px; }
.a-principal { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.a-detalhe { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }

/* telas de detalhe */
.legenda-numero { margin: 10px 0 18px; color: rgba(255,255,255,.85); font-size: 13px; max-width: 70ch; }
.legenda-numero p { margin: 0; }
.legenda-t { margin: 0 0 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.55); }
.kpis-2 { margin-top: 12px; }
.kpi-num { overflow-wrap: anywhere; }
.bruto { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.bruto summary { cursor: pointer; }
.table-acoes { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-width: 0; }
.busca { border: 1px solid var(--line); border-radius: 2px; padding: 6px 9px; background: var(--surface); min-width: 0; width: 240px; max-width: 100%; }
.grid tr.interno td { color: var(--ink-3); }
.grid td.wrap { white-space: normal; min-width: 180px; overflow-wrap: anywhere; }
.grafico { margin-bottom: 12px; padding: 12px 14px 8px; min-width: 0; }
.grafico-corpo { width: 100%; min-width: 0; }
.grafico-corpo svg { display: block; max-width: 100%; }

@media (max-width: 640px) {
  .filtro-inner { padding: 8px 16px; }
  .filtro .aviso-velho { padding: 8px 16px; }
  .chip span { padding: 6px 9px; font-size: 11px; }
  .kx-v { font-size: 21px; }
  .kpi-num { font-size: 17px; }
  .busca { width: 100%; }
  .table-head { padding: 10px 12px; }
  .legenda-numero { font-size: 12.5px; }
}
@media (max-width: 900px) {
  .cabecalho { position: static; }
}
