:root {
  --fundo: #f4f1ea; --cartao: #ffffff; --texto: #22261f; --suave: #6b7064; --linha: #e2ddd2;
  --verde: #1f7a5a; --verde-claro: #e3f1ea; --verde-texto: #ffffff;
  --laranja: #c8621b; --laranja-claro: #fbeadc; --vermelho: #b3261e; --vermelho-claro: #f9e1df;
  --azul: #2b5f9e; --azul-claro: #e2ecf8;
  --raio: 14px; --sombra: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --abas: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #151814; --cartao: #1f231e; --texto: #ecefe8; --suave: #a1a79a; --linha: #31362f;
    --verde: #3fae84; --verde-claro: #1d3329; --verde-texto: #0d1a14;
    --laranja: #e88a45; --laranja-claro: #3a2717; --vermelho: #ef7b73; --vermelho-claro: #3b1d1b;
    --azul: #7fb0ee; --azul-claro: #1b2a3d;
    --sombra: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--fundo); color: var(--texto);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent; padding-bottom: calc(var(--abas) + env(safe-area-inset-bottom));
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h2 { font-size: 1.2rem; } h3 { font-size: 1rem; color: var(--suave); font-weight: 600; }

.topo { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--verde); color: var(--verde-texto); }
.marca { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 1.05rem; }
.marca img { width: 28px; height: 28px; }
.sinal { border: 0; border-radius: 999px; padding: 6px 12px; background: rgba(255,255,255,.18); color: inherit; font-size: .85rem; }
.sinal.off { background: var(--laranja); color: #fff; }

.tela { max-width: 1200px; margin: 0 auto; padding: 16px; }
.carregando { color: var(--suave); text-align: center; margin-top: 40px; }

.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; height: calc(var(--abas) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--cartao); border-top: 1px solid var(--linha); }
.abas a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--suave); font-size: .78rem; }
.abas a .ic { font-size: 1.35rem; line-height: 1; }
.abas a.ativa { color: var(--verde); font-weight: 700; }

.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; border: 1px solid var(--linha); }
.pilha > * + * { margin-top: 12px; }
.linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.suave { color: var(--suave); } .peq { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

.btn { border: 1px solid var(--linha); background: var(--cartao); border-radius: 12px; padding: 10px 16px; min-height: 44px; font-weight: 600; }
.btn.prim { background: var(--verde); border-color: var(--verde); color: var(--verde-texto); }
.btn.perigo { color: var(--vermelho); border-color: var(--vermelho); background: transparent; }
.btn.grande { min-height: 56px; font-size: 1.1rem; }
.btn.bloco { width: 100%; }
.btn:disabled { opacity: .5; }
.link { border: 0; background: none; color: var(--verde); font-weight: 600; padding: 6px; }

label.campo { display: block; }
label.campo > span { display: block; font-size: .85rem; color: var(--suave); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--linha); background: var(--fundo); min-height: 46px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--verde); outline-offset: 0; }
.grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 22px; height: 22px; min-height: 0; }

.seg { display: flex; background: var(--fundo); border-radius: 12px; padding: 4px; gap: 4px; border: 1px solid var(--linha); flex-wrap: wrap; }
.seg button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 10px 8px; font-weight: 600; color: var(--suave); min-width: 80px; }
.seg button.on { background: var(--cartao); color: var(--verde); box-shadow: var(--sombra); }

/* ---- Vender ---- */
.vender { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.vender > *, .pilha > * { min-width: 0; }
@media (min-width: 900px) { .vender { grid-template-columns: 1fr 360px; align-items: start; } .carrinho { position: sticky; top: 72px; } }
.busca { position: relative; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--linha); background: var(--cartao); border-radius: 999px; padding: 8px 14px; font-weight: 600; color: var(--suave); }
.chips button.on { background: var(--verde); border-color: var(--verde); color: var(--verde-texto); }
.produtos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.secao { margin: 18px 0 8px; color: var(--texto); font-size: .95rem; }
.secao:first-child { margin-top: 4px; }
.ic-g { font-size: .95em; }
.vals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vb { border: 1px solid transparent; background: var(--verde-claro); color: var(--verde); border-radius: 9px; padding: 6px 9px; min-height: 36px;
  font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.vb:active { transform: scale(.95); }
.vb.outro { background: transparent; border-color: var(--linha); color: var(--suave); font-weight: 600; }
.vals.grandes .vb { min-height: 48px; padding: 8px 14px; font-size: 1.05rem; flex: 1 0 auto; }
.prod { position: relative; text-align: left; border: 1px solid var(--linha); background: var(--cartao); border-radius: var(--raio);
  padding: 12px; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--sombra); }
.prod:active { transform: scale(.98); }
.prod .nome { font-weight: 600; line-height: 1.2; }
.prod .preco { font-weight: 700; color: var(--verde); margin-top: 6px; }
.prod .livre { color: var(--azul); font-weight: 600; font-size: .9rem; margin-top: 6px; }
.prod .est { position: absolute; top: 8px; right: 8px; font-size: .72rem; padding: 2px 6px; border-radius: 999px; background: var(--fundo); color: var(--suave); }
.prod .est.baixo { background: var(--vermelho-claro); color: var(--vermelho); font-weight: 700; }
.prod .qtd { position: absolute; top: -8px; left: -6px; background: var(--laranja); color: #fff; border-radius: 999px; min-width: 26px; height: 26px;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem; padding: 0 6px; }
.vazio { color: var(--suave); text-align: center; padding: 24px; }

.carrinho .itens { max-height: 40vh; overflow: auto; }
.item { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--linha); }
.item .ctl { display: flex; gap: 6px; align-items: center; }
.item .ctl button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--linha); background: var(--fundo); font-weight: 700; }
.total { font-size: 1.8rem; font-weight: 800; }
.pagar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pagar .btn { min-height: 64px; font-size: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.pagar .btn .ic { font-size: 1.4rem; }
.barra-carrinho { display: none; }
@media (max-width: 899px) {
  .carrinho { display: none; }
  .barra-carrinho { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(var(--abas) + 10px + env(safe-area-inset-bottom)); z-index: 4;
    background: var(--verde); color: var(--verde-texto); border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 700; font-size: 1.05rem;
    justify-content: space-between; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
  .vender { padding-bottom: 70px; }
}

/* ---- listas e números ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px; }
.kpi .rot { font-size: .82rem; color: var(--suave); }
.kpi .val { font-size: 1.4rem; font-weight: 800; margin-top: 2px; }
.kpi .det { font-size: .8rem; color: var(--suave); margin-top: 2px; }
.pos { color: var(--verde); } .neg { color: var(--vermelho); }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: 12px 0; border-bottom: 1px solid var(--linha); }
.lista li:last-child { border-bottom: 0; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--fundo); color: var(--suave); font-weight: 600; }
.tag.dinheiro { background: var(--verde-claro); color: var(--verde); }
.tag.pix { background: var(--azul-claro); color: var(--azul); }
.tag.cartao { background: var(--laranja-claro); color: var(--laranja); }
.tag.pend { background: var(--laranja); color: #fff; }
.cancelada { opacity: .5; text-decoration: line-through; }
table.tab { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tab th { text-align: left; font-size: .78rem; color: var(--suave); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--linha); }
.tab td { padding: 8px 4px; border-bottom: 1px solid var(--linha); }
.tab .d { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rolagem { overflow-x: auto; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.modal .caixa { background: var(--cartao); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .modal { align-items: center; } .modal .caixa { border-radius: 20px; } }
.teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.teclado button { min-height: 60px; border-radius: 12px; border: 1px solid var(--linha); background: var(--fundo); font-size: 1.4rem; font-weight: 700; }
.visor { font-size: 2rem; font-weight: 800; text-align: center; padding: 10px; border-radius: 12px; background: var(--fundo); margin-bottom: 10px; min-height: 64px; }
.pin-pontos { display: flex; justify-content: center; gap: 14px; margin: 14px 0 18px; }
.pin-pontos i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--verde); }
.pin-pontos i.on { background: var(--verde); }
.pessoas { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pessoas button { min-height: 80px; border-radius: var(--raio); border: 1px solid var(--linha); background: var(--cartao); font-size: 1.1rem; font-weight: 700; box-shadow: var(--sombra); }

.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--abas) + 84px); z-index: 30; background: var(--texto); color: var(--fundo);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.aviso.erro { background: var(--vermelho); color: #fff; }
.entrada { max-width: 480px; margin: 24px auto; }

/* ---- relatórios ---- */
.alerta { background: var(--laranja-claro); color: var(--texto); border-radius: 12px; padding: 10px 14px; margin: 0; font-size: .92rem; }
.frases { margin: 0; padding-left: 18px; }
.frases li { margin: 6px 0; }
.frases b { font-weight: 700; }
.dica { position: fixed; z-index: 40; max-width: 280px; background: var(--texto); color: var(--fundo); padding: 8px 12px; border-radius: 10px;
  font-size: .85rem; line-height: 1.35; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

.graf { position: relative; height: 220px; padding: 22px 0 0 54px; }
.graf.baixo { height: 180px; }
.grade-y { position: absolute; left: 0; right: 0; top: 22px; bottom: 34px; pointer-events: none; }
.grade-y span { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--linha); font-size: .72rem; color: var(--suave); transform: translateY(-50%); }
.grade-y span::before { content: ''; }
.colunas { display: flex; height: 100%; gap: 4px; }
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; cursor: pointer; outline: none; }
.col:focus-visible .barra, .col:hover .barra { filter: brightness(1.1); }
.barra-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--suave); }
.barra { position: relative; width: min(24px, 70%); background: var(--verde); border-radius: 4px 4px 0 0; }
.barra.hach { background: repeating-linear-gradient(45deg, var(--verde) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1.5px var(--verde); }
.rot-barra { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 3px; font-size: .74rem; font-weight: 700; white-space: nowrap; color: var(--texto); }
.rot-x { height: 34px; text-align: center; font-size: .78rem; color: var(--suave); padding-top: 4px; line-height: 1.1; }
details summary { cursor: pointer; color: var(--verde); font-weight: 600; margin-top: 8px; }

.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--linha); cursor: pointer; }
.ranking li:last-child { border-bottom: 0; }
.pos-n { width: 26px; flex: none; text-align: right; color: var(--suave); font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 1px; }
.rk-corpo { flex: 1; min-width: 0; }
.rk-barra { height: 8px; margin: 6px 0 4px; }
.rk-barra i { display: block; height: 100%; background: var(--verde); border-radius: 0 4px 4px 0; }

table.mapa { border-collapse: separate; border-spacing: 2px; font-size: .82rem; }
.mapa th { font-weight: 600; color: var(--suave); padding: 4px 6px; white-space: nowrap; }
.mapa thead th { text-align: center; }
.mapa tbody th { text-align: left; color: var(--texto); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mapa th.inc { color: var(--laranja); }
.mapa td { min-width: 42px; height: 32px; text-align: center; border-radius: 4px; font-variant-numeric: tabular-nums; cursor: pointer;
  background: color-mix(in oklab, var(--verde) var(--f), var(--fundo)); color: var(--texto); }
.mapa td.escuro { color: var(--verde-texto); font-weight: 700; }
.mapa td.zero { background: var(--fundo); }
.mapa td.d { background: none; text-align: right; color: var(--suave); cursor: default; }
.tab tr.tot td { font-weight: 700; border-top: 2px solid var(--linha); }
.mapa tbody th { position: sticky; left: 0; z-index: 1; background: var(--cartao); }

/* ---- venda guiada ---- */
.prod .guia { color: var(--azul); font-weight: 700; font-size: .85rem; margin-top: 6px; }
.prod.combo { border-color: var(--verde); }
.guiada h2 { font-size: 1.35rem; margin: 4px 0 0; }
.trilha { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .85rem; color: var(--suave); }
.trilha button { border: 0; background: var(--fundo); border-radius: 999px; padding: 4px 10px; color: var(--verde); font-weight: 600; }
.opcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; }
.opc { min-height: 56px; border-radius: 12px; border: 1px solid var(--linha); background: var(--fundo); font-weight: 600; padding: 8px; line-height: 1.2; }
.opc.sug { background: var(--verde-claro); border-color: var(--verde); color: var(--verde); font-weight: 700; }
.opc:active { transform: scale(.97); }
@media (min-width: 600px) { .modal .caixa:has(.guiada) { max-width: 760px; } }

/* ---- quanto (preço × quantidade) ---- */
.qcampos { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.qc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px solid var(--linha); border-radius: 12px;
  background: var(--fundo); padding: 8px 4px; min-height: 84px; cursor: pointer; }
.qc.ativo { border-color: var(--verde); background: var(--verde-claro); }
.qc .rot { font-size: .75rem; color: var(--suave); }
.qc .v { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.qc.tot .v { color: var(--verde); }
.qc .pm { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--linha); background: var(--cartao); font-weight: 800; }
.quanto .teclado button { min-height: 52px; }
.faixa-teste { background: var(--laranja-claro); color: var(--texto); font-size: .85rem; text-align: center; padding: 6px 12px; position: sticky; top: 48px; z-index: 4; }
.tag.teste { background: var(--laranja-claro); color: var(--laranja); }
.ativ { display: flex; gap: 10px; align-items: flex-start; }
.ativ .ic-t { font-size: 1.2rem; width: 26px; text-align: center; }

/* etapas 1-4 (15/11/2026): troca de pessoa, versão nova, caixa do dia, problemas */
.topo-dir { gap: 6px; flex-wrap: nowrap; }
.quem { border: 0; border-radius: 999px; padding: 6px 12px; background: rgba(255,255,255,.18); color: inherit; font-size: .85rem; font-weight: 700;
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versao { position: sticky; top: 48px; z-index: 6; display: block; width: 100%; border: 0; padding: 10px 16px; background: var(--azul-claro); color: var(--azul);
  font-weight: 700; font-size: .92rem; }
.pessoas button.atual { border-color: var(--verde); outline: 2px solid var(--verde); }
.tag.abaixo { background: var(--vermelho-claro); color: var(--vermelho); }
.alerta-borda { border: 2px solid var(--laranja); }
.caixa-dia .linha.entre { flex-wrap: wrap; }
.caixa-dia .num.grande { font-size: 1.4rem; font-weight: 800; }
.dif-ok { color: var(--verde); font-weight: 700; } .dif-mal { color: var(--vermelho); font-weight: 700; }

/* verificação em duas etapas */
.codigo-2fa { font-size: 2rem; letter-spacing: .3em; text-align: center; width: 100%; padding: 10px; border-radius: 12px; }
.codigo-2fa.reserva { letter-spacing: .08em; font-size: 1.5rem; }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: min(240px, 70vw); margin: 4px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.passos-2fa { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.chave-2fa { font-size: 1.05rem; word-break: break-all; background: var(--fundo); padding: 8px; border-radius: 8px; }
.reservas { columns: 2; font-size: 1.2rem; font-weight: 700; margin: 0; padding-left: 1.6em; }
.reservas li { margin: 4px 0; }
