/* Controle GB — KMNO
 * Identidade sóbria: grafite no cabeçalho, azul-aço como acento, fundo neutro.
 * 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: 3 primeiras do palette de referência (validadas nos 2 modos).
 */
:root {
  color-scheme: light;
  --head: #15181c;
  --head-2: #23282e;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --ink: #16191d;
  --ink-2: #48505a;
  --ink-3: #737b86;
  --line: #dce0e5;
  --line-2: #eceef1;
  --accent: #2d5d8a;
  --accent-hover: #244c71;
  --accent-soft: #e7eef6;
  --accent-ink: #ffffff;
  --red: #c4362f;
  --red-bg: #fbe9e7;
  --amber: #9a5b00;
  --amber-bg: #fdf1dc;
  --green: #177a4f;
  --green-bg: #e2f3ea;
  --blue-bg: #e5eef8;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 20, 24, .05), 0 3px 10px rgba(16, 20, 24, .05);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --head: #0b0d0f; --head-2: #171a1e;
    --bg: #0f1113; --surface: #171a1e; --surface-2: #1c2025;
    --ink: #eceef1; --ink-2: #b6bdc6; --ink-3: #8b939d;
    --line: #2b3037; --line-2: #22272d;
    --accent: #7aa7d4; --accent-hover: #93b9de; --accent-soft: #1d2b3a; --accent-ink: #0b0d0f;
    --red: #ef7d74; --red-bg: #3a1d1b; --amber: #e3a64a; --amber-bg: #34270f;
    --green: #5cc48f; --green-bg: #15301f; --blue-bg: #1b2836;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --head: #0b0d0f; --head-2: #171a1e;
  --bg: #0f1113; --surface: #171a1e; --surface-2: #1c2025;
  --ink: #eceef1; --ink-2: #b6bdc6; --ink-3: #8b939d;
  --line: #2b3037; --line-2: #22272d;
  --accent: #7aa7d4; --accent-hover: #93b9de; --accent-soft: #1d2b3a; --accent-ink: #0b0d0f;
  --red: #ef7d74; --red-bg: #3a1d1b; --amber: #e3a64a; --amber-bg: #34270f;
  --green: #5cc48f; --green-bg: #15301f; --blue-bg: #1b2836;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -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; }
}
