/* TREND Estoque · branco de fundo, azul nos detalhes.
   Verde, laranja e vermelho só onde pede atenção (situação, alerta, erro). */
:root {
  --fundo: #ffffff;
  --fundo-2: #f5f7fa;
  --linha: #e4e8ef;
  --linha-forte: #cfd6e1;
  --texto: #0f172a;
  --texto-2: #475569;
  --texto-3: #8792a6;

  --azul: #1d4ed8;
  --azul-escuro: #1e3a8a;
  --azul-claro: #eef3fe;
  --azul-linha: #c9d8fb;

  --verde: #15803d;   --verde-claro: #eaf7ef;   --verde-linha: #b7e3c6;
  --laranja: #c2410c; --laranja-claro: #fff4ec; --laranja-linha: #fbd2b4;
  --vermelho: #b91c1c; --vermelho-claro: #fdeeee; --vermelho-linha: #f5c2c2;

  --raio: 14px;
  --raio-p: 10px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --sombra-alta: 0 12px 32px rgba(15, 23, 42, .14);
  --fonte: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --barra-inferior: 64px;
  --topo: 60px;
  --lateral: 232px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: var(--fonte); background: var(--fundo-2); color: var(--texto); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--azul); text-decoration: none; }
.ic { flex-shrink: 0; display: block; }
.mono { font-family: var(--mono); letter-spacing: -.01em; }
.mut { color: var(--texto-2); }
.fraco { color: var(--texto-3); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Estrutura ───────────────────────────────────────────────── */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topo {
  position: sticky; top: 0; z-index: 20; height: var(--topo); background: var(--fundo);
  border-bottom: 1px solid var(--linha); display: flex; align-items: center; gap: 12px; padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topo) + env(safe-area-inset-top));
}
.topo-titulo { font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.marca-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--azul); color: #fff; display: grid; place-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--azul-claro); color: var(--azul); font-weight: 800; font-size: .82rem; display: grid; place-items: center; border: 1px solid var(--azul-linha); }
.conteudo { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(var(--barra-inferior) + 24px + env(safe-area-inset-bottom)); }

.nav-inferior {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--fundo); border-top: 1px solid var(--linha);
  display: flex; height: calc(var(--barra-inferior) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
}
.nav-inferior a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--texto-3); font-size: .72rem; font-weight: 600; }
.nav-inferior a.on { color: var(--azul); }
.nav-inferior a.bipar-central .bola { width: 50px; height: 50px; margin-top: -22px; border-radius: 16px; background: var(--azul); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(29, 78, 216, .35); border: 4px solid var(--fundo); }
.nav-lateral { display: none; }

@media (min-width: 900px) {
  .app { flex-direction: row; }
  .nav-inferior { display: none; }
  .nav-lateral {
    display: flex; flex-direction: column; gap: 4px; width: var(--lateral); flex-shrink: 0; height: 100vh; position: sticky; top: 0;
    background: var(--fundo); border-right: 1px solid var(--linha); padding: 16px 12px;
  }
  .nav-lateral .marca { padding: 4px 8px 18px; }
  .nav-lateral a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--raio-p); color: var(--texto-2); font-weight: 600; font-size: .92rem; }
  .nav-lateral a:hover { background: var(--fundo-2); color: var(--texto); }
  .nav-lateral a.on { background: var(--azul-claro); color: var(--azul); }
  .nav-lateral .rodape { margin-top: auto; border-top: 1px solid var(--linha); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
  .principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .conteudo { padding: 24px 28px 40px; }
  .topo { padding: 0 28px; }
  .so-celular { display: none !important; }
}
@media (max-width: 899px) { .so-desktop { display: none !important; } .principal { display: contents; } }

/* ── Componentes ─────────────────────────────────────────────── */
.cartao { background: var(--fundo); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra); }
.cartao-p { padding: 16px; }
.titulo-sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.titulo-sec h2 { font-size: .8rem; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.titulo-pag { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.sub-pag { color: var(--texto-2); margin-top: 2px; font-size: .92rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--raio-p); font-weight: 650; font-size: .92rem; border: 1px solid transparent; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-prim { background: var(--azul); color: #fff; }
.btn-prim:hover { background: var(--azul-escuro); }
.btn-sec { background: var(--fundo); border-color: var(--linha-forte); color: var(--texto); }
.btn-sec:hover { border-color: var(--azul-linha); background: var(--azul-claro); }
.btn-azul-claro { background: var(--azul-claro); color: var(--azul); }
.btn-perigo { background: var(--fundo); border-color: var(--vermelho-linha); color: var(--vermelho); }
.btn-p { height: 36px; padding: 0 12px; font-size: .85rem; }
.btn-bloco { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-icone { width: 40px; height: 40px; border-radius: var(--raio-p); display: grid; place-items: center; color: var(--texto-2); }
.btn-icone:hover { background: var(--fundo-2); color: var(--texto); }
.btn-redondo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 23, 42, .55); color: #fff; }

.campo { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--fundo); border: 1px solid var(--linha-forte); border-radius: var(--raio-p); color: var(--texto-3); }
.campo:focus-within { border-color: var(--azul); box-shadow: 0 0 0 3px var(--azul-claro); color: var(--azul); }
.campo input, .campo select { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--texto); height: 100%; }
.campo input::placeholder { color: var(--texto-3); }
label.rot { display: block; font-size: .8rem; font-weight: 650; color: var(--texto-2); margin: 0 0 6px 2px; }
select.sel { height: 44px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--fundo); padding: 0 12px; width: 100%; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linha-forte); background: var(--fundo); font-weight: 600; font-size: .85rem; color: var(--texto-2); display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-weight: 700; color: var(--texto-3); font-size: .78rem; }
.chip.on { background: var(--azul); border-color: var(--azul); color: #fff; }
.chip.on b { color: #c7d6fb; }

/* situações (só aqui entram as cores de atenção) */
.selo { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.selo .ic { width: 13px; height: 13px; }
.s-a_caminho { background: var(--azul-claro); color: var(--azul); }
.s-conferindo { background: var(--fundo); color: var(--azul); border-color: var(--azul-linha); }
.s-recebida, .s-paga { background: var(--verde-claro); color: var(--verde); }
.s-divergente, .s-vencida { background: var(--vermelho-claro); color: var(--vermelho); }
.s-atrasada, .s-vence_logo { background: var(--laranja-claro); color: var(--laranja); }
.s-cancelada, .s-neutro, .s-sem_duplicata, .s-desconhecido, .s-aberta, .s-antes { background: var(--fundo-2); color: var(--texto-2); }
.s-cancelada { text-decoration: line-through; }

.vazio { text-align: center; padding: 36px 16px; color: var(--texto-3); }
.vazio .ic { margin: 0 auto 10px; color: var(--linha-forte); }
.carregando { display: grid; place-items: center; padding: 40px; color: var(--texto-3); }
.giro { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--azul-claro); border-top-color: var(--azul); animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.aviso-faixa { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--raio-p); font-size: .86rem; font-weight: 550; }
.aviso-faixa.azul { background: var(--azul-claro); color: var(--azul-escuro); }
.aviso-faixa.laranja { background: var(--laranja-claro); color: var(--laranja); }
.aviso-faixa.vermelho { background: var(--vermelho-claro); color: var(--vermelho); }

/* ── Login ───────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--fundo); }
.login-caixa { width: 100%; max-width: 380px; }
.login-caixa .marca { font-size: 1.35rem; margin-bottom: 6px; }
.login-caixa .marca-ic { width: 44px; height: 44px; border-radius: 12px; }
.login-caixa form { display: grid; gap: 14px; margin-top: 28px; }
.login-erro { color: var(--vermelho); font-size: .88rem; font-weight: 600; min-height: 20px; }
.demo-dica { margin-top: 24px; padding: 12px 14px; border-radius: var(--raio-p); background: var(--azul-claro); color: var(--azul-escuro); font-size: .84rem; }

/* ── Bipar ───────────────────────────────────────────────────── */
.local-atual { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; }
.local-atual .ic-caixa { width: 40px; height: 40px; border-radius: 11px; background: var(--azul-claro); color: var(--azul); display: grid; place-items: center; }
.local-atual small { display: block; font-size: .74rem; color: var(--texto-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.local-atual b { font-size: 1rem; }

.leitura { margin-top: 12px; padding: 18px; border-radius: var(--raio); background: var(--fundo); border: 1px solid var(--linha); box-shadow: var(--sombra); min-height: 120px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.leitura::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--linha); }
.leitura.ok::before, .leitura.fim::before { background: var(--verde); }
.leitura.atencao::before { background: var(--laranja); }
.leitura.erro::before { background: var(--vermelho); }
.leitura.fim { background: var(--verde-claro); border-color: var(--verde-linha); }
.leitura.atencao { background: var(--laranja-claro); border-color: var(--laranja-linha); }
.leitura.erro { background: var(--vermelho-claro); border-color: var(--vermelho-linha); }
.leitura.pulso { animation: pulso .28s ease-out; }
@keyframes pulso { from { transform: scale(.985); } to { transform: scale(1); } }
.leitura-topo { display: flex; align-items: center; gap: 12px; }
.leitura-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--fundo-2); color: var(--texto-3); flex-shrink: 0; }
.ok .leitura-ic, .fim .leitura-ic { background: var(--verde); color: #fff; }
.atencao .leitura-ic { background: var(--laranja); color: #fff; }
.erro .leitura-ic { background: var(--vermelho); color: #fff; }
.leitura-titulo { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.leitura-sub { color: var(--texto-2); font-size: .9rem; margin-top: 2px; }
.leitura-loja { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--raio-p); background: var(--fundo); border: 1px solid var(--linha); }
.leitura-loja .ic { color: var(--azul); }
.leitura-loja b { font-size: 1.15rem; letter-spacing: -.01em; }
.leitura-loja .caixa-num { margin-left: auto; text-align: right; }
.leitura-loja .caixa-num strong { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; display: block; }
.leitura-loja .caixa-num small { font-size: .7rem; color: var(--texto-3); font-weight: 700; text-transform: uppercase; }
.pontos { display: flex; gap: 6px; flex-wrap: wrap; }
.ponto { min-width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--fundo-2); color: var(--texto-3); border: 1px solid var(--linha); }
.ponto.on { background: var(--verde); border-color: var(--verde); color: #fff; }
.ponto.novo { box-shadow: 0 0 0 3px var(--verde-linha); }
.barra { height: 8px; border-radius: 99px; background: var(--fundo-2); overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--azul); border-radius: 99px; transition: width .3s; }
.barra.verde i { background: var(--verde); }

.acoes-bipar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.btn-camera { height: 56px; font-size: 1rem; border-radius: var(--raio); }
.leitor-status { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: .8rem; color: var(--texto-3); margin-top: 10px; }
.leitor-status .luz { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 3px var(--verde-claro); }
.fila-offline { margin-top: 10px; }

.lista { display: flex; flex-direction: column; }
.lista > * + * { border-top: 1px solid var(--linha); }
.item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; background: var(--fundo); }
.item:hover { background: #fafbfd; }
.item-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--azul-claro); color: var(--azul); display: grid; place-items: center; flex-shrink: 0; }
.item-ic.verde { background: var(--verde-claro); color: var(--verde); }
.item-ic.laranja { background: var(--laranja-claro); color: var(--laranja); }
.item-ic.vermelho { background: var(--vermelho-claro); color: var(--vermelho); }
.item-ic.cinza { background: var(--fundo-2); color: var(--texto-3); }
.item-meio { flex: 1; min-width: 0; }
.item-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-l1 b { font-weight: 700; }
.item-l2 { color: var(--texto-2); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-l3 { color: var(--texto-3); font-size: .78rem; margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.item-l3 span { display: inline-flex; align-items: center; gap: 4px; }
.item-dir { padding-top: 1px; text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item-dir b { font-weight: 700; }
.item .chev { color: var(--linha-forte); align-self: center; }
.item-ic { margin-top: 1px; }

/* ── Notas ───────────────────────────────────────────────────── */
.barra-filtros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.barra-filtros > .campo { grid-column: 1 / -1; }
.filtros-linha { display: flex; gap: 8px; flex-wrap: wrap; }
.filtros-linha select { width: auto; flex: 1; min-width: 150px; }
@media (min-width: 900px) { .barra-filtros { grid-template-columns: 1fr auto auto; align-items: center; } .barra-filtros > .campo { grid-column: auto; } }
.resumo-lista { display: flex; gap: 14px; color: var(--texto-2); font-size: .84rem; margin: 4px 2px 10px; flex-wrap: wrap; }
.resumo-lista b { color: var(--texto); }

/* ── Detalhe ─────────────────────────────────────────────────── */
.det-cab { display: flex; align-items: flex-start; gap: 12px; }
.det-cab h1 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.det-cab .mut { font-size: .88rem; }
.grade-dados { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--linha); border-radius: var(--raio); overflow: hidden; border: 1px solid var(--linha); margin-top: 14px; }
.grade-dados > div { background: var(--fundo); padding: 12px 14px; min-width: 0; }
.grade-dados small { display: block; font-size: .72rem; color: var(--texto-3); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.grade-dados b { font-weight: 650; overflow-wrap: anywhere; }
@media (min-width: 900px) { .grade-dados { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.linha-tempo { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; padding: 16px; gap: 8px; }
.etapa { position: relative; text-align: center; font-size: .8rem; color: var(--texto-3); }
.etapa .bola { width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; background: var(--fundo-2); color: var(--texto-3); border: 2px solid var(--linha); position: relative; z-index: 1; }
.etapa::before { content: ''; position: absolute; top: 17px; left: -50%; right: 50%; height: 2px; background: var(--linha); }
.etapa:first-child::before { display: none; }
.etapa.feita .bola { background: var(--azul); border-color: var(--azul); color: #fff; }
.etapa.feita::before, .etapa.feita + .etapa.feita::before { background: var(--azul); }
.etapa.verde .bola { background: var(--verde); border-color: var(--verde); }
.etapa.laranja .bola { background: var(--laranja); border-color: var(--laranja); color: #fff; }
.etapa.vermelho .bola { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.etapa b { display: block; color: var(--texto); font-size: .85rem; }

.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--linha); margin: 20px 0 14px; overflow-x: auto; scrollbar-width: none; }
.aba { height: 42px; padding: 0 14px; font-weight: 650; color: var(--texto-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.aba.on { color: var(--azul); border-bottom-color: var(--azul); }
.aba b { font-size: .75rem; background: var(--fundo-2); color: var(--texto-2); border-radius: 99px; padding: 1px 7px; }

.tabela-wrap { overflow-x: auto; }
table.tab { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tab th { text-align: left; font-size: .72rem; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--linha); background: #fafbfd; white-space: nowrap; }
.tab td { padding: 11px 14px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
.tab tr:last-child td { border-bottom: none; }
.tab .d { text-align: right; }
.tab.grade th:not(:first-child), .tab.grade td:not(:first-child) { text-align: center; }
.tab.grade td.zero { color: var(--linha-forte); }
.tab tfoot td { font-weight: 800; background: #fafbfd; }
.tam { border-bottom: 1px dashed var(--texto-3); cursor: help; }

.caixas-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.caixa-cartao { padding: 12px; border-radius: var(--raio-p); border: 1px dashed var(--linha-forte); background: var(--fundo); }
.caixa-cartao.on { border: 1px solid var(--verde-linha); background: var(--verde-claro); }
.caixa-cartao b { font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.caixa-cartao small { display: block; color: var(--texto-2); font-size: .78rem; margin-top: 4px; }

.dup { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.dup-valor { font-weight: 800; font-size: 1.05rem; }

.tempo-lista { position: relative; padding-left: 26px; }
.tempo-lista::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--linha); }
.tempo-item { position: relative; padding: 8px 0 12px; }
.tempo-item .ic-t { position: absolute; left: -26px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--fundo); border: 2px solid var(--azul); display: grid; place-items: center; color: var(--azul); }
.tempo-item b { font-weight: 650; }
.tempo-item small { display: block; color: var(--texto-3); font-size: .78rem; }

/* ── Painel ──────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.kpi-topo { display: flex; align-items: center; justify-content: space-between; color: var(--texto-2); font-size: .8rem; font-weight: 650; }
.kpi-topo .ic { color: var(--azul); }
.kpi-valor { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi-sub { font-size: .8rem; color: var(--texto-3); }
.kpi.atencao .kpi-valor { color: var(--laranja); }
.kpi.alerta .kpi-valor { color: var(--vermelho); }
.duas-col { display: grid; gap: 16px; }
@media (min-width: 900px) { .duas-col { grid-template-columns: 1fr 1fr; } }

/* ── Folhas (bottom sheet) e diálogos ────────────────────────── */
.veu { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: surge .15s; }
.folha { background: var(--fundo); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: sobe .2s ease-out; }
.folha::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--linha-forte); margin: 4px auto 12px; }
.folha h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
@media (min-width: 900px) { .veu { align-items: center; } .folha { border-radius: 18px; } .folha::before { display: none; } .folha { padding-top: 20px; } }
@keyframes sobe { from { transform: translateY(40px); opacity: .5; } }
@keyframes surge { from { opacity: 0; } }
.opcao { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 10px; border-radius: var(--raio-p); text-align: left; font-weight: 600; }
.opcao:hover { background: var(--fundo-2); }
.opcao.on { background: var(--azul-claro); color: var(--azul); }
.opcao .ic { color: var(--texto-3); }
.opcao.on .ic { color: var(--azul); }

.avisos { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barra-inferior) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { .avisos { bottom: 24px; } }
.aviso-t { background: var(--texto); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: .88rem; font-weight: 550; display: flex; gap: 10px; align-items: center; box-shadow: var(--sombra-alta); animation: sobe .2s; }
.aviso-t.verde .ic { color: #86efac; } .aviso-t.vermelho .ic { color: #fca5a5; } .aviso-t.laranja .ic { color: #fdba74; }

/* ── Câmera ──────────────────────────────────────────────────── */
.camera { position: fixed; inset: 0; z-index: 70; background: #000; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera-mira { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.camera-mira span { width: min(78vw, 420px); height: 150px; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); border: 3px solid #fff; position: relative; }
.camera-mira span::after { content: ''; position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: #60a5fa; box-shadow: 0 0 10px #60a5fa; animation: varre 1.6s ease-in-out infinite alternate; }
@keyframes varre { from { transform: translateY(-50px); } to { transform: translateY(50px); } }
.camera.lido .camera-mira span { border-color: #4ade80; }
.camera-topo { position: absolute; top: 0; left: 0; right: 0; padding: calc(14px + env(safe-area-inset-top)) 14px 14px; display: flex; align-items: center; gap: 12px; }
.camera-dica { flex: 1; text-align: center; color: #fff; font-weight: 600; font-size: .92rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.camera-retorno { position: absolute; left: 14px; right: 14px; bottom: calc(24px + env(safe-area-inset-bottom)); background: #fff; border-radius: 16px; padding: 14px 16px; min-height: 64px; display: none; }
.camera-retorno.ok, .camera-retorno.fim, .camera-retorno.atencao, .camera-retorno.erro { display: block; }
.camera-retorno.fim, .camera-retorno.ok { border-left: 6px solid var(--verde); }
.camera-retorno.atencao { border-left: 6px solid var(--laranja); }
.camera-retorno.erro { border-left: 6px solid var(--vermelho); }

.modo-demo { background: var(--azul); color: #fff; text-align: center; font-size: .78rem; font-weight: 600; padding: 5px 10px; }
.modo-demo a { color: #fff; text-decoration: underline; }

@media print {
  .nav-lateral, .nav-inferior, .topo, .nao-imprimir, .modo-demo, .avisos { display: none !important; }
  body { background: #fff; } .conteudo { padding: 0; max-width: none; } .cartao { box-shadow: none; }
}

/* Cartão da câmera: o que foi lido, com a ação a um toque */
.camera.pausada .camera-mira span { border-color: #4ade80; }
.camera.pausada .camera-mira span::after { animation: none; opacity: 0; }
.camera-cartao { position: absolute; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; max-height: 72vh; overflow: auto;
  background: var(--fundo); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--sombra-alta); animation: sobe .18s ease-out; border-top: 6px solid var(--azul); }
.camera-cartao[hidden] { display: none; }
.camera-cartao.ok, .camera-cartao.fim { border-top-color: var(--verde); }
.camera-cartao.atencao { border-top-color: var(--laranja); }
.camera-cartao.erro { border-top-color: var(--vermelho); }
.cc-topo { display: flex; align-items: center; gap: 12px; }
.cc-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--azul-claro); color: var(--azul); }
.ok .cc-ic, .fim .cc-ic { background: var(--verde); color: #fff; }
.atencao .cc-ic { background: var(--laranja); color: #fff; }
.erro .cc-ic { background: var(--vermelho); color: #fff; }
.cc-ic .ic-loader { animation: giro .8s linear infinite; }
.cc-titulo { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.cc-sub { color: var(--texto-2); font-size: .88rem; margin-top: 2px; }
.cc-topo .btn-redondo.claro { margin-left: auto; background: var(--fundo-2); color: var(--texto-2); }
.cc-nota { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--raio-p); background: var(--fundo-2); color: var(--azul); }
.cc-nota b { color: var(--texto); font-size: 1.1rem; }
.cc-botoes { display: flex; flex-direction: column; gap: 8px; }
.btn-ok { background: var(--verde); color: #fff; }
.btn-ok:hover { background: #166534; }
.btn-grande { height: auto; min-height: 64px; padding: 10px 16px; border-radius: var(--raio); font-size: 1.08rem; justify-content: flex-start; gap: 12px; }
.btn-grande span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.btn-grande small { font-weight: 500; font-size: .8rem; opacity: .9; }
.ponto.lida { background: var(--azul-claro); border-color: var(--azul); color: var(--azul); box-shadow: 0 0 0 3px var(--azul-linha); }
.ponto.on.lida { background: var(--verde); border-color: var(--verde); color: #fff; box-shadow: 0 0 0 3px var(--verde-linha); }
.cc-tempo { height: 3px; border-radius: 3px; background: var(--fundo-2); overflow: hidden; }
.cc-tempo i { display: block; height: 100%; background: var(--azul); animation: encolhe 3.5s linear forwards; }
@keyframes encolhe { from { width: 100%; } to { width: 0; } }

/* Bipagem em equipe: caixa por caixa */
.ponto.on.outro { background: var(--verde-claro); border-color: var(--verde-linha); color: var(--verde); }
.ponto.on.lida { background: var(--verde); border-color: var(--verde); color: #fff; box-shadow: 0 0 0 3px var(--verde-linha); }
.atencao .ponto.lida, .erro .ponto.lida { box-shadow: 0 0 0 3px var(--laranja-linha); }
.faltam { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--texto-2); }
.faltam .ic { flex-shrink: 0; margin-top: 2px; color: var(--azul); }
.faltam b { color: var(--texto); }
.equipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .82rem; color: var(--texto-2); }
.equipe .ic { color: var(--azul); }
.equipe b { color: var(--texto); font-weight: 700; }
.linha-botoes { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-size: .86rem; font-weight: 600; color: var(--texto-2); background: none; }
.btn-link:hover { color: var(--vermelho); }

/* Importar XML */
.soltar { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--azul-linha); border-radius: var(--raio); background: var(--azul-claro); color: var(--azul); text-align: center; cursor: pointer; }
.soltar b { color: var(--azul-escuro); }
.soltar small { color: var(--texto-2); }
.soltar.sobre { border-color: var(--azul); background: #e2ebfd; }
.lista-import { display: flex; flex-direction: column; margin-top: 12px; }
.import-linha { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--linha); }
.import-linha:last-child { border-bottom: none; }
.import-linha .item-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.import-linha small { font-size: .82rem; }
.ic-loader { animation: giro .8s linear infinite; }
.faixa-sem-itens { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 12px; padding: 10px 12px 10px 14px; border-radius: var(--raio-p); background: var(--laranja-claro); color: var(--laranja); font-size: .86rem; font-weight: 550; }
.faixa-sem-itens > div:first-child { display: flex; gap: 8px; align-items: flex-start; flex: 1 1 220px; }
.faixa-sem-itens .ic { flex-shrink: 0; margin-top: 2px; }

/* Conteúdo da caixa */
button.caixa-cartao { text-align: left; width: 100%; cursor: pointer; }
button.caixa-cartao:hover { border-color: var(--azul-linha); }
.caixa-cartao b .chev { margin-left: auto; color: var(--texto-3); }
.grupo-caixa { border: 1px solid var(--linha); border-radius: var(--raio-p); padding: 12px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.grupo-topo { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tams { display: flex; flex-wrap: wrap; gap: 6px; }
.tams span { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 6px 8px; border-radius: 8px; background: var(--fundo-2); }
.tams small { font-size: .72rem; color: var(--texto-2); }
.tams b { font-size: 1rem; }
.aviso-faixa.verde { background: var(--verde-claro); color: var(--verde); }

/* Produtos */
.prod-cartao { padding: 14px 16px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px; }
.prod-topo { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prod-topo b { font-size: 1.02rem; }
.prod-numeros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--linha); border: 1px solid var(--linha); border-radius: var(--raio-p); overflow: hidden; }
.prod-numeros > div { background: var(--fundo); padding: 8px 10px; }
.prod-numeros small { display: block; font-size: .7rem; color: var(--texto-3); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.prod-numeros b { font-size: 1.1rem; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--fundo-2); }

/* Conferência */
.escolhas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.escolha { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--fundo); text-align: left; color: var(--texto-2); }
.escolha b { color: var(--texto); font-size: .92rem; }
.escolha small { font-size: .78rem; line-height: 1.3; }
.escolha.on { border-color: var(--azul); background: var(--azul-claro); color: var(--azul); box-shadow: 0 0 0 1px var(--azul); }
.lista-notas { max-height: 46vh; overflow: auto; border: 1px solid var(--linha); border-radius: var(--raio-p); }
.linha-nota { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--linha); cursor: pointer; font-size: .9rem; }
.linha-nota:last-child { border-bottom: none; }
.linha-nota.on { background: var(--azul-claro); }
.linha-nota input { width: 18px; height: 18px; accent-color: var(--azul); flex-shrink: 0; }
.rodape-folha { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; font-size: .85rem; }
.conf-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--linha); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; margin-top: 14px; }
.conf-kpis > div { background: var(--fundo); padding: 10px 14px; }
.conf-kpis small { display: block; font-size: .7rem; color: var(--texto-3); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.conf-kpis b { font-size: 1.35rem; font-weight: 800; }
.conf-kpis .k-falta b { color: var(--laranja); }
.conf-kpis .k-sobra b { color: var(--vermelho); }
@media (max-width: 560px) { .conf-kpis, .prod-numeros { grid-template-columns: repeat(2, minmax(0, 1fr)); } .escolhas { grid-template-columns: 1fr; } }
.qtd-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: .88rem; }
.qtd-stepper { display: flex; align-items: center; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); background: var(--fundo); }
.qtd-stepper input { width: 56px; height: 40px; border: none; text-align: center; font-weight: 800; font-size: 1.05rem; outline: none; background: transparent; }
td.dif-falta { color: var(--laranja); font-weight: 800; }
td.dif-sobra, td.dif-fora { color: var(--vermelho); font-weight: 800; }
td.dif-ok { color: var(--verde); }

/* Relatório impresso da conferência */
.so-impressao { display: none; }
@media print {
  .so-impressao { display: block; color: #000; font-size: 10.5pt; }
  .rel-cab { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
  .rel-titulo { font-size: 15pt; font-weight: 800; margin-bottom: 4px; }
  .rel-resumo { text-align: right; white-space: nowrap; }
  .rel-tab { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
  .rel-tab th, .rel-tab td { border: 1px solid #999; padding: 3px 6px; text-align: left; }
  .rel-tab th { background: #eee; font-size: 9pt; }
  .rel-tab .d { text-align: right; }
  .rel-tab tr.rel-marca td { background: #f3f3f3; font-weight: 700; }
  .rel-tab tfoot td { font-weight: 800; }
  .rel-assina { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 24px; margin-top: 36px; }
  .rel-assina div { border-top: 1px solid #000; padding-top: 4px; font-size: 9pt; }
  .rel-rodape { margin-top: 16px; font-size: 8pt; color: #555; }
  .rel-tab tr { break-inside: avoid; }
}
.btn-link.azul, .btn-link.azul:hover { color: var(--azul); }
.passo { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--azul); margin-bottom: 2px; }
.credenciais { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.credenciais small { display: block; font-size: .72rem; color: var(--texto-3); font-weight: 650; text-transform: uppercase; }
.credenciais b { font-size: 1.2rem; }

/* Equipe da conferência */
.pessoas-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 6px; }
.pessoa { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--linha-forte); border-radius: var(--raio-p); cursor: pointer; font-size: .88rem; }
.pessoa input { display: none; }
.pessoa .avatar { width: 32px; height: 32px; font-size: .72rem; flex-shrink: 0; }
.pessoa.on { border-color: var(--azul); background: var(--azul-claro); box-shadow: 0 0 0 1px var(--azul); }
.pessoa.on .avatar { background: var(--azul); color: #fff; border-color: var(--azul); }
.equipe-conf { margin-top: 12px; padding: 12px 14px; background: var(--fundo); border: 1px solid var(--linha); border-radius: var(--raio); }
.equipe-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: .9rem; }
.equipe-topo .ic { color: var(--azul); vertical-align: -2px; display: inline-block; }
.equipe-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pessoa-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--fundo-2); font-size: .84rem; }
.pessoa-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--linha-forte); }
.pessoa-chip.vivo i { background: var(--verde); box-shadow: 0 0 0 3px var(--verde-claro); }
.pessoa-chip .num { color: var(--texto-2); font-weight: 700; }

/* ── Auditoria: ajustes de leitura e de toque ─────────────────── */
:root { --texto-3: #64748b; }                       /* contraste 4,7:1 no branco (antes 3,1:1) */
.duas-col { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .duas-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.kpi { min-width: 0; }
.kpi-valor { font-size: clamp(.95rem, 4.1vw, 1.45rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 899px) {
  .btn-p, .chip { height: 40px; }                   /* alvo de toque maior no celular */
  .aviso-faixa { flex-wrap: wrap; }
  .aviso-faixa > .btn { margin-left: auto; }
}
.item-l2.quebra { white-space: normal; }

/* Bipar: no computador, leitura à esquerda e listas à direita */
.bipar-grade { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; }
@media (min-width: 1100px) { .bipar-grade { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } .bipar-dir > .titulo-sec:first-child { margin-top: 12px; } }
.hoje-tiras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.hoje-tiras > div { background: var(--fundo); border: 1px solid var(--linha); border-radius: var(--raio-p); padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.hoje-tiras small { font-size: .7rem; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hoje-tiras b { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.hoje-tiras span { font-size: .74rem; color: var(--texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hoje-tiras .aberto b { color: var(--azul); }

/* Painel: robô da SEFAZ */
.robo-linha .item-l1 .fraco { font-size: .78rem; }
.titulo-sec { flex-wrap: wrap; }

/* Painel: pares a chegar e situação das lojas */
.chegar-topo { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 14px 16px 6px; font-size: .9rem; }
.chegar-topo b { font-size: 1.05rem; }
.chegar-topo .fraco { font-size: .8rem; }
.chegar-lista { padding: 4px 16px 14px; display: grid; gap: 10px; }
.chegar-linha { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; align-items: center; gap: 12px; }
.chegar-nome { min-width: 0; font-size: .9rem; }
.chegar-nome b { font-weight: 700; }
.chegar-nome small { display: block; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chegar-barra { height: 8px; border-radius: 999px; background: var(--fundo-2); overflow: hidden; }
.chegar-barra i { display: block; height: 100%; border-radius: 999px; background: var(--azul); }
.chegar-num { min-width: 52px; text-align: right; font-size: .95rem; }
@media (max-width: 560px) { .chegar-linha { grid-template-columns: minmax(0, 1fr) auto; } .chegar-barra { grid-column: 1 / -1; grid-row: 2; } }
.lojas-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.loja-status { background: var(--fundo); border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; box-shadow: var(--sombra); }
.loja-status-topo { display: flex; flex-direction: column; gap: 0; }
.loja-status-topo small { font-size: .74rem; white-space: nowrap; }
.loja-selo { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.loja-status.verde .loja-selo { background: var(--verde-claro); color: var(--verde); }
.loja-status.laranja .loja-selo { background: var(--laranja-claro); color: var(--laranja); }
.loja-status.vermelho .loja-selo { background: var(--vermelho-claro); color: var(--vermelho); }
.loja-status.cinza .loja-selo { background: var(--fundo-2); color: var(--texto-2); }
.loja-status.vermelho { border-color: var(--vermelho-linha); }
.loja-status > small { font-size: .78rem; }

/* Bipar enxuto */
.item-nota { cursor: pointer; }
.item-nota:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; }
.item-nota .item-l1 { gap: 6px; }
.btn-link.zerar { font-size: .74rem; color: var(--vermelho); padding: 2px 0 0; gap: 4px; }
.vazio-curto { padding: 16px; font-size: .86rem; }

/* Aviso de versão nova do aplicativo */
.faixa-versao { position: fixed; left: 12px; right: 12px; bottom: calc(var(--barra-inferior) + 12px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: var(--raio); background: var(--texto); color: #fff; box-shadow: var(--sombra-alta); font-weight: 600; font-size: .9rem; }
.faixa-versao span { flex: 1; }
@media (min-width: 900px) { .faixa-versao { left: auto; right: 24px; bottom: 24px; width: 360px; } }

/* Notas: linha compacta (no celular sem ícone, valor na primeira linha, pagamento junto das datas) */
.nlinha { align-items: center; }
.nl-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nl-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nl-nf { font-weight: 700; white-space: nowrap; }
.nl-valor { margin-left: auto; font-weight: 700; white-space: nowrap; padding-left: 8px; }
.nl-l2 { color: var(--texto-2); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl-l3 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; color: var(--texto-3); font-size: .78rem; }
.nl-l3 > span:not(.selo) { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.nl-l3 .nl-pag { margin-left: auto; height: 22px; font-size: .72rem; }
@media (max-width: 899px) {
  .nlinha { padding: 12px 14px; }
  .nlinha > .item-ic { display: none; }
  .nl-l1 .selo { height: 20px; padding: 0 7px; font-size: .68rem; }
}

/* ── Bipar pelo teclado: tela cheia, campo sempre pronto, linha do tempo dos 3 últimos ── */
.veu.tela-cheia { align-items: stretch; background: var(--fundo-2); }
.veu.tela-cheia .folha { max-width: none; max-height: none; height: 100%; border-radius: 0; background: var(--fundo-2); padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); animation: surge .15s; }
.veu.tela-cheia .folha::before { display: none; }
.tk { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; height: 100%; }
.tk-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tk-topo b { font-size: 1.15rem; font-weight: 800; display: block; }
.tk-topo small { color: var(--texto-3); font-size: .82rem; }
.tk-campo { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 8px 0 16px; background: var(--fundo); border: 2px solid var(--azul); border-radius: 16px; color: var(--azul); box-shadow: 0 0 0 5px var(--azul-claro); }
.tk-campo input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: var(--mono); font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; color: var(--texto); height: 100%; }
.tk-campo input::placeholder { font-family: var(--fonte); font-weight: 500; font-size: 1rem; color: var(--texto-3); letter-spacing: 0; }
.tk-campo .btn { height: 48px; padding: 0 20px; border-radius: 12px; }
.tk-linha { position: relative; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); }
.tk-vazio { display: flex; align-items: center; gap: 12px; color: var(--texto-3); font-size: .9rem; padding: 18px 4px; }
.tk-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; background: var(--fundo); border: 1px solid var(--linha); border-left: 5px solid var(--linha-forte); border-radius: 14px; box-shadow: var(--sombra);
  transition: filter .35s, opacity .35s, transform .35s; transform-origin: top center; }
.tk-item.verde { border-left-color: var(--verde); }
.tk-item.laranja { border-left-color: var(--laranja); }
.tk-item.vermelho { border-left-color: var(--vermelho); }
.tk-item[data-pos="0"].verde { background: var(--verde-claro); }
.tk-item[data-pos="0"].laranja { background: var(--laranja-claro); }
.tk-item[data-pos="0"].vermelho { background: var(--vermelho-claro); }
.tk-item[data-pos="1"] { filter: blur(1.2px); opacity: .6; transform: scale(.97); }
.tk-item[data-pos="2"] { filter: blur(2.6px); opacity: .3; transform: scale(.94); }
.tk-item.entra { animation: tk-entra .28s ease-out; }
@keyframes tk-entra { from { opacity: 0; transform: translateY(-14px); } }
.tk-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--fundo-2); color: var(--texto-2); }
.tk-item.verde .tk-ic { color: var(--verde); } .tk-item.laranja .tk-ic { color: var(--laranja); } .tk-item.vermelho .tk-ic { color: var(--vermelho); }
.tk-item.lendo .tk-ic { color: var(--azul); }
.tk-meio { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tk-meio b { font-weight: 800; font-size: 1rem; }
.tk-meio span { color: var(--texto-2); font-size: .86rem; overflow-wrap: anywhere; }
.tk-meio .barra { margin-top: 6px; }
.tk-botoes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.tk-dir { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.tk-dir b { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.tk-dir small { color: var(--texto-3); font-size: .74rem; }
.tk-item[data-pos="0"] .tk-meio b { font-size: 1.1rem; }
@media (prefers-reduced-motion: reduce) { .tk-item, .tk-item.entra { animation: none; transition: none; } }

/* selo "Ao vivo" da conferência: verde piscando com o Realtime de pé, cinza se caiu (aí a tela atualiza a cada 4 s) */
.ao-vivo { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; vertical-align: middle; background: var(--fundo-2); color: var(--texto-3); border: 1px solid var(--linha); }
.ao-vivo i { width: 7px; height: 7px; border-radius: 50%; background: var(--texto-3); }
.ao-vivo.on { background: var(--verde-claro); color: var(--verde); border-color: var(--verde-linha); }
.ao-vivo.on i { background: var(--verde); animation: vivo 1.6s ease-in-out infinite; }
@keyframes vivo { 50% { opacity: .25; } }

/* Câmera com linha do tempo: a área de leitura sobe e os 3 últimos bipes ficam embaixo, sem pausar a leitura */
.camera.com-linha .camera-mira { bottom: 42%; }
.camera.com-linha .camera-mira span { height: 130px; }
.camera-linha { position: absolute; left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; height: 40%; overflow: hidden; }
.camera-linha .tk-vazio { color: rgba(255, 255, 255, .7); }
.camera-linha .tk-item { box-shadow: 0 8px 24px rgba(0, 0, 0, .35); border-color: transparent; }
.camera-linha .tk-item[data-pos="0"]:not(.verde):not(.laranja):not(.vermelho) { background: #fff; }

/* Conferência: a tela de bipe diz de qual conferência é */
.tk-contexto { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--azul-claro); border: 1px solid var(--azul-linha); color: var(--azul-escuro); font-weight: 700; font-size: .9rem; }
.tk-contexto span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-contexto { position: absolute; top: calc(66px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 28px); display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; background: rgba(29, 78, 216, .92); color: #fff; font-weight: 700; font-size: .82rem; }
.camera-contexto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.veu.sobre-camera { z-index: 90; }

/* Conferência por caixa: um cartão por nota, reorganizado ao vivo */
.nf-cards { display: flex; flex-direction: column; gap: 8px; }
.nf-card { background: var(--fundo); border: 1px solid var(--linha); border-left: 5px solid var(--linha-forte); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--sombra); cursor: default; }
.nf-card[data-chave] { cursor: pointer; }
.nf-card.st-ok { border-left-color: var(--verde); }
.nf-card.st-falta { border-left-color: var(--azul); }
.nf-card.st-extrema, .nf-card.st-semnota, .nf-card.st-fora { border-left-color: var(--laranja); }
.nf-card.st-extrema { background: var(--laranja-claro); }
.nf-card.pisca { animation: nf-pisca 1.2s ease-out; }
@keyframes nf-pisca { 0% { box-shadow: 0 0 0 3px var(--azul); transform: scale(1.01); } 100% { box-shadow: var(--sombra); transform: none; } }
.nf-l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nf-l1 .fraco { font-size: .86rem; }
.nf-cont { margin-left: auto; font-size: 1.15rem; font-weight: 800; }
.nf-l3 { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--texto-3); font-size: .8rem; }
.nf-l3 > span { display: inline-flex; align-items: center; gap: 4px; }
.nf-pergunta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; font-weight: 700; font-size: .86rem; color: var(--laranja); }
.nf-pergunta span { flex: 1; min-width: 150px; }
.feed-vivo .item b { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .nf-card.pisca { animation: none; } }

/* Relatório (impressão): resumo em quadros, seções por nota, "quem bipou" em letra pequena */
@media print {
  .rel-resumo-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin: 8px 0 12px; }
  .rel-resumo-grade div { border: 1px solid #999; padding: 4px 8px; }
  .rel-resumo-grade small { display: block; font-size: 7.5pt; color: #444; }
  .rel-resumo-grade b { font-size: 11pt; }
  .rel-sec { font-weight: 800; font-size: 10.5pt; margin-top: 10px; }
  .rel-tab td.rel-peq { font-size: 7.5pt; color: #444; }
}
