:root {
  --azul: #0b6bcb; --azul-esc: #084c91; --azul-claro: #e8f1fc;
  --verde: #16a34a; --verde-claro: #e7f7ee; --vermelho: #dc2626; --vermelho-claro: #fdecec;
  --laranja: #ea8a0c; --laranja-claro: #fff4e5;
  --texto: #14202b; --sutil: #66737f; --borda: #dfe5ec; --fundo: #f3f6fa; --cartao: #ffffff;
  --raio: 16px; --sombra: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--fundo); color: var(--texto); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--azul); }
[hidden] { display: none !important; }

.topo { background: var(--azul); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
        position: sticky; top: 0; z-index: 5; }
.topo h1 { font-size: 18px; margin: 0; flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .acao { background: rgba(255,255,255,.16); border: 0; color: #fff; padding: 8px 12px; border-radius: 999px; font-size: 14px; cursor: pointer; }
.pagina { max-width: 560px; margin: 0 auto; padding: 16px 16px 96px; }
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 18px; margin-bottom: 14px; }
.cartao h2 { font-size: 18px; margin: 0 0 6px; }
.sutil { color: var(--sutil); font-size: 14px; }
.centro { text-align: center; }
.linha { display: flex; gap: 10px; align-items: center; }
.entre { justify-content: space-between; }
.grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 18px; font-weight: 700;
       background: var(--azul); color: #fff; cursor: pointer; text-align: center; text-decoration: none; }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.verde { background: var(--verde); }
.btn.vermelho { background: var(--vermelho); }
.btn.laranja { background: var(--laranja); }
.btn.claro { background: var(--azul-claro); color: var(--azul-esc); }
.btn.contorno { background: transparent; color: var(--azul); border: 2px solid var(--azul); }
.btn.peq { padding: 10px 14px; font-size: 15px; width: auto; display: inline-block; border-radius: 10px; }
.btn + .btn { margin-top: 10px; }
.link { background: none; border: 0; color: var(--azul); font-weight: 600; padding: 10px; cursor: pointer; }

label.campo { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input.ent, select.ent, textarea.ent { width: 100%; padding: 14px; border: 1.5px solid var(--borda); border-radius: 12px; background: #fff; font-size: 17px; }
input.ent:focus, select.ent:focus, textarea.ent:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-claro); }

.opcao { display: block; border: 2px solid var(--borda); border-radius: 14px; padding: 14px 16px; background: #fff; cursor: pointer; margin-bottom: 10px; }
.opcao.sel { border-color: var(--azul); background: var(--azul-claro); }
.opcao .t { font-weight: 700; font-size: 17px; }
.opcao .v { font-weight: 800; font-size: 20px; color: var(--azul-esc); }
.selo { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--azul-claro); color: var(--azul-esc); }
.selo.urg { background: var(--vermelho-claro); color: var(--vermelho); }
.selo.ok { background: var(--verde-claro); color: var(--verde); }
.selo.alerta { background: var(--laranja-claro); color: #9a5a05; }

.contador { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0; }
.contador button { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--azul-claro); color: var(--azul-esc); font-size: 28px; font-weight: 700; cursor: pointer; }
.contador .n { font-size: 34px; font-weight: 800; min-width: 50px; text-align: center; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; margin-top: 8px; }
.total b { font-size: 26px; }

.aceite { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--laranja-claro); margin-top: 14px; }
.aceite input { width: 26px; height: 26px; flex: none; margin-top: 2px; accent-color: var(--azul); }

.codigo { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.codigo input { width: 54px; height: 68px; text-align: center; font-size: 32px; font-weight: 800; border: 2px solid var(--borda); border-radius: 12px; background: #fff; }
.codigo input:focus { outline: none; border-color: var(--azul); }

.grande-check { width: 96px; height: 96px; border-radius: 50%; background: var(--verde); color: #fff; font-size: 56px; line-height: 96px; margin: 8px auto 12px; text-align: center; }
.porta-num { font-size: 64px; font-weight: 900; line-height: 1; color: var(--verde); margin: 6px 0; }
.qr-pix { width: 240px; height: 240px; margin: 8px auto; display: block; image-rendering: pixelated; }
.copia { word-break: break-all; font-size: 12px; background: var(--fundo); border-radius: 10px; padding: 10px; color: var(--sutil); max-height: 64px; overflow: hidden; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--azul-claro); border-top-color: var(--azul); border-radius: 50%; animation: gira 1s linear infinite; margin: 12px auto; }
@keyframes gira { to { transform: rotate(360deg); } }

.passos-linha { display: flex; justify-content: space-between; margin: 10px 0 2px; }
.passos-linha div { flex: 1; text-align: center; font-size: 12px; color: var(--sutil); position: relative; }
.passos-linha div::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--borda); margin: 0 auto 6px; }
.passos-linha div.feito { color: var(--texto); font-weight: 600; }
.passos-linha div.feito::before { background: var(--verde); }

#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
.toast { background: #1f2937; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sombra); transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--verde); } .toast.erro { background: var(--vermelho); }
.toast.sai { opacity: 0; transform: translateY(8px); }

.modal-fundo { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 22px 18px 28px; position: relative; }
@media (min-width: 700px) { .modal-fundo { align-items: center; } .modal { border-radius: 20px; } }
.modal h3 { margin: 0 0 10px; font-size: 20px; padding-right: 30px; }
.modal-x { position: absolute; right: 12px; top: 10px; border: 0; background: var(--fundo); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.termo-texto { white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: #2b3a47; }
.passos li { margin-bottom: 8px; }

.instalar { position: fixed; right: 14px; bottom: 16px; z-index: 30; border: 0; background: var(--texto); color: #fff; padding: 12px 16px; border-radius: 999px; font-weight: 700; box-shadow: var(--sombra); cursor: pointer; }
.vazio { text-align: center; color: var(--sutil); padding: 28px 10px; }
.erro-box { background: var(--vermelho-claro); color: var(--vermelho); padding: 12px 14px; border-radius: 12px; font-weight: 600; margin-top: 12px; }

/* passo a passo do pedido */
.etapas { display: flex; gap: 6px; margin: 0 0 14px; }
.etapas span { flex: 1; height: 6px; border-radius: 99px; background: var(--borda); }
.etapas span.on { background: var(--azul); }
.etapas-rot { display: flex; justify-content: space-between; font-size: 12px; color: var(--sutil); margin: -8px 0 12px; }
.etapas-rot b { color: var(--azul); }
.atalho { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--verde-claro); color: #0f5132;
          border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; border: 0; width: 100%; cursor: pointer; font-size: 15px; text-align: left; }
.atalho b { white-space: nowrap; color: var(--verde); }
.detalhe-preco { font-size: 13px; color: var(--sutil); margin-top: 4px; }

/* porta travada / reset */
.aviso-porta { background: var(--azul-claro); color: var(--azul-esc); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 4px 0 12px; }
.reset-caixa { background: var(--vermelho-claro); color: #7f1d1d; border: 2px solid var(--vermelho); border-radius: 14px; padding: 6px 14px; font-size: 14px; }
.reset-caixa p { margin: 8px 0; }
.btn.contorno-vermelho { background: transparent; color: var(--vermelho); border: 2px solid var(--vermelho); }

/* modo LSF, abrir todas e painel de vendas */
.faixa-lsf { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff4d6; color: #6b4a00;
             border: 1.5px solid #f3c64b; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.acoes-lsf .btn.verde { font-size: 17px; }
.graf { width: 100%; height: 180px; display: block; }
.legenda { font-weight: 500; font-size: 12px; color: var(--sutil); margin-left: 8px; }
.legenda i, .sem-barras i { display: inline-block; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.legenda i.ant, .sem-barras i.ant { background: #c9d3dd; }
.legenda i.atu, .sem-barras i.atu { background: var(--azul); }
.sem-linha { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 10px; font-size: 14px; }
.sem-linha.melhor { background: var(--verde-claro); }
.sem-dia { font-weight: 700; }
.sem-barras { display: flex; flex-direction: column; gap: 3px; }
.sem-barras i { height: 8px; border-radius: 4px; min-width: 2px; }
.sem-val { white-space: nowrap; font-weight: 700; }
.sem-val small { font-weight: 400; color: var(--sutil); }
.sobe { color: var(--verde); font-weight: 700; font-size: 12px; }
.desce { color: var(--vermelho); font-weight: 700; font-size: 12px; }
