:root {
  color-scheme: light;
  --plano: #f9f9f7; --superficie: #fcfcfb; --tinta: #0b0b0b; --tinta2: #52514e; --apagado: #898781;
  --linha: #e1e0d9; --borda: rgba(11,11,11,.10);
  --azul: #2a78d6; --azul-claro: #86b6ef; --trilho: #e4eefb;
  --bom: #0ca30c; --alerta: #fab219; --serio: #ec835a; --critico: #d03b3b;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --plano: #0d0d0d; --superficie: #1a1a19; --tinta: #fff; --tinta2: #c3c2b7; --apagado: #898781;
    --linha: #2c2c2a; --borda: rgba(255,255,255,.10);
    --azul: #3987e5; --azul-claro: #1c5cab; --trilho: #10294a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--plano); color: var(--tinta); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--azul); text-decoration: none; } a:hover { text-decoration: underline; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 16px; margin: 0 0 8px; }
h1 span, .marca span { color: var(--tinta2); font-weight: 400; }

.topo { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 10px 16px; background: var(--superficie); border-bottom: 1px solid var(--linha); }
.marca { font-weight: 700; color: var(--tinta); }
.topo nav { display: flex; gap: 4px; flex: 1; }
.topo nav a { padding: 6px 12px; border-radius: 6px; color: var(--tinta2); }
.topo nav a[aria-current] { background: var(--trilho); color: var(--tinta); font-weight: 600; }
.sair { display: flex; align-items: center; gap: 10px; color: var(--tinta2); margin: 0; }

button, select, input { font: inherit; color: inherit; background: var(--superficie); border: 1px solid var(--borda); border-radius: 6px; padding: 6px 10px; }
button { cursor: pointer; } button.principal { background: var(--azul); color: #fff; border-color: transparent; font-weight: 600; }

.cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.destaque { display: grid; grid-template-columns: auto 1fr; gap: 20px 32px; align-items: center; }
.destaque .largo { grid-column: 1 / -1; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.rotulo { margin: 0; color: var(--tinta2); font-size: 13px; }
.heroi { margin: 2px 0; font-size: 48px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.valor { margin: 2px 0; font-size: 24px; font-weight: 650; } .valor.pequeno { font-size: 17px; }
.nota { margin: 0 0 8px; color: var(--tinta2); font-size: 13px; }
.total { float: right; color: var(--tinta2); font-weight: 400; font-size: 14px; }
.rodape { color: var(--apagado); font-size: 13px; }

.rolagem { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linha); vertical-align: middle; white-space: nowrap; }
td:nth-child(3) { white-space: normal; }
th { color: var(--tinta2); font-weight: 600; font-size: 13px; }
.n { text-align: right; font-variant-numeric: tabular-nums; }
.barra { width: 34%; min-width: 220px; white-space: normal; }
tr.cancelado td { color: var(--apagado); text-decoration: line-through; }
.vazio { text-align: center; color: var(--apagado); padding: 24px; }

.medidor { position: relative; display: flex; gap: 2px; height: 12px; background: var(--trilho); border-radius: 4px; }
.destaque .medidor { height: 16px; }
.seg { height: 100%; min-width: 2px; }
.seg:first-child { border-radius: 4px 0 0 4px; } .seg:last-of-type { border-radius: 0 4px 4px 0; } .seg:first-child:last-of-type { border-radius: 4px; }
.entregue { background: var(--azul); } .aberto { background: var(--azul-claro); } .semaut { background: var(--serio); }
.marca-teto { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--tinta); border-radius: 1px; }
.legenda { margin: 10px 0 0; color: var(--tinta2); font-size: 13px; }
.chave { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 5px 0 12px; vertical-align: -1px; }
.chave:first-child { margin-left: 0; } .chave.teto { width: 2px; height: 14px; background: var(--tinta); vertical-align: -3px; }

.selo { white-space: nowrap; color: var(--tinta); font-size: 13px; }
.selo i { font-style: normal; font-size: 12px; }
.selo.bom i { color: var(--bom); } .selo.alerta i { color: var(--alerta); } .selo.critico i { color: var(--critico); }
.aviso { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--borda); border-left: 4px solid var(--alerta); background: var(--superficie); }
.aviso.critico { border-left-color: var(--critico); }

.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 12px; }
.filtros label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--tinta2); }
.paginas { text-align: center; color: var(--tinta2); } .paginas a { margin: 0 12px; }

.login { max-width: 340px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.login label { display: flex; flex-direction: column; gap: 4px; color: var(--tinta2); font-size: 13px; }
@media (max-width: 720px) { .destaque { grid-template-columns: 1fr; } .heroi { font-size: 40px; } .total { float: none; display: block; } }

/* produtos e estoque */
.cresce { flex: 1; min-width: 260px; } .cresce input { width: 100%; }
.caixa { flex-direction: row !important; align-items: center; gap: 6px !important; padding-bottom: 7px; }
.kpis + .rolagem, .kpis + .nota { margin-top: 16px; }
.barra.estreita { width: 12%; min-width: 110px; }
tr.atual td { background: var(--trilho); }
details { margin-top: 10px; color: var(--tinta2); font-size: 13px; } summary { cursor: pointer; }
.colunas { display: flex; align-items: flex-end; gap: 2px; height: 190px; padding-top: 6px; border-bottom: 1px solid var(--linha); margin-bottom: 22px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col .haste { width: min(70%, 44px); min-height: 1px; background: var(--azul); border-radius: 4px 4px 0 0; }
.col:hover .haste { background: var(--azul-claro); }
.col .num { font-size: 12px; color: var(--tinta2); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.col .eixo { position: absolute; bottom: -20px; font-size: 12px; color: var(--apagado); white-space: nowrap; }

/* configurações */
td input, td select { width: 100%; max-width: 260px; } td input.n { max-width: 170px; }
.aviso.bom { border-left-color: var(--bom); } .espaco { margin-top: 20px; }
.grade-lojas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 10px 0; }
.grade-lojas label { display: flex; align-items: center; gap: 8px; } .grade-lojas input { flex: 1; }
tr.soma td { font-weight: 650; border-top: 2px solid var(--linha); }
