/* Feira de Livros - estilos (sem estilos inline: a CSP bloqueia style="") */
:root {
  --papel: #f2f4f9;
  --cartao: #ffffff;
  --tinta: #171f30;
  --suave: #5c6579;
  --linha: #dfe3ec;
  --acento: #b04a1a;
  --acento-esc: #8f3a12;
  --acento-fundo: #fdece1;
  --perigo: #b3261e;
  --perigo-fundo: #fbe9e7;
  --aviso: #8a5a00;
  --aviso-fundo: #fff4d6;
  --ok-fundo: #e3f4ec;
  --raio: 14px;
  --laranja: #ffa33a;
  --lateral: #171f30;
  --sombra: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1 { font-size: 1.6rem; margin: 0 0 .75rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
p { margin: .4rem 0 .9rem; }
a { color: var(--acento); }
small, .suave { color: var(--suave); }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }

/* Abas (relatorios) */
.menu { display: flex; flex-wrap: wrap; gap: .25rem; }
.menu a { color: var(--tinta); text-decoration: none; padding: .5rem .75rem; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.menu a:hover { background: var(--acento-fundo); }
.menu a.ativo { background: var(--tinta); color: #fff; }
.perfil { background: #e9ecf4; color: var(--suave); border-radius: 99px; padding: .1rem .55rem; font-size: .75rem; margin-left: .25rem; }

/* Estrutura: menu lateral + barra superior */
.app { display: flex; min-height: 100vh; }
.lateral { width: 232px; flex: none; background: var(--lateral); color: #cfd5e4; display: flex; flex-direction: column; padding: 1rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; }
.lateral .marca { color: #fff; font-weight: 800; font-size: 1.05rem; text-decoration: none; padding: .4rem .6rem 1.1rem; line-height: 1.2; }
.lateral-nav { display: grid; gap: .3rem; }
.lateral a, .lateral button { display: flex; align-items: center; gap: .75rem; color: #cfd5e4; text-decoration: none; font: inherit; font-weight: 600; font-size: .96rem; padding: .7rem .8rem; border-radius: 10px; background: transparent; border: 0; width: 100%; cursor: pointer; text-align: left; }
.lateral a:hover, .lateral button:hover { background: rgba(255,255,255,.08); color: #fff; }
.lateral a.ativo { background: var(--laranja); color: #1a1205; font-weight: 800; }
.lateral .ico { flex: none; }
.lateral-fim { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: .3rem; }
.lateral a:focus-visible, .lateral button:focus-visible { outline-color: #ffd19a; }
.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.barra { background: var(--lateral); color: #fff; height: 64px; display: flex; align-items: center; justify-content: flex-end; padding: 0 1.5rem; gap: 1rem; }
.barra-quem { display: flex; align-items: center; gap: .8rem; font-size: .95rem; }
.barra .perfil { background: rgba(255,255,255,.16); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #b9bcc6; color: #2b2f3b; display: grid; place-items: center; font-weight: 800; }
.menu-toggle { display: none; background: transparent; border: 1.5px solid rgba(255,255,255,.35); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; margin-right: auto; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
@media (max-width: 860px) {
  .lateral { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.menu-aberto .lateral { transform: none; }
  .menu-toggle { display: flex; }
  .barra { padding: 0 1rem; }
  .barra-nome { display: none; }
}

.conteudo { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.5rem 2rem; flex: 1; }
.conteudo.estreita { max-width: 600px; }

/* Cartoes e grade */
.cartao { background: var(--cartao); border: 1px solid var(--linha); border-radius: var(--raio); padding: 1rem 1.1rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.cartao > h2:first-child, .cartao > h3:first-child { margin-top: 0; }
.grade { display: grid; gap: .75rem 1rem; grid-template-columns: repeat(12, 1fr); }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c6 { grid-column: span 6; }
.c4 { grid-column: span 4; } .c3 { grid-column: span 3; } .c2 { grid-column: span 2; }
@media (max-width: 760px) { .c8, .c6, .c4, .c3 { grid-column: span 12; } .c2 { grid-column: span 6; } }

/* Formularios */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number],
input[type=search], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; padding: .7rem .8rem; font: inherit; color: inherit; background: #fff;
  border: 1.5px solid #c3c9d8; border-radius: 10px; min-height: 46px;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #f2b48d; outline-offset: 1px; border-color: var(--acento);
}
input[readonly] { background: #f0eee8; }
.ajuda { font-size: .82rem; color: var(--suave); margin-top: .2rem; }
.erro-campo { border-color: var(--perigo) !important; }
.linha-acoes { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }

/* Botoes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  border: 1.5px solid var(--acento); background: var(--acento); color: #fff; font: inherit; font-weight: 700;
  padding: .7rem 1.2rem; border-radius: 10px; min-height: 46px; text-decoration: none; touch-action: manipulation;
}
.btn:hover { background: var(--acento-esc); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sec { background: #fff; color: var(--acento); }
.btn-sec:hover { background: var(--acento-fundo); }
.btn-perigo { background: var(--perigo); border-color: var(--perigo); }
.btn-perigo:hover { background: #8f1d17; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn-link { background: transparent; border: 0; color: var(--tinta); font-weight: 700; min-height: 40px; }
.btn-link:hover { background: transparent; text-decoration: underline; }
.btn-link.perigo { color: var(--perigo); }
.btn-ghost:hover { background: rgba(255,255,255,.15); }
.btn-sm { padding: .3rem .7rem; min-height: 34px; font-size: .85rem; }
.btn-grande { min-height: 56px; font-size: 1.15rem; padding: .9rem 1.6rem; }
.btn-bloco { width: 100%; }

/* Alertas / selos */
.alerta { padding: .75rem 1rem; border-radius: 10px; margin-bottom: .9rem; border: 1px solid transparent; }
.alerta ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.alerta-erro { background: var(--perigo-fundo); border-color: #f0b8b3; color: #6e1510; }
.alerta-aviso { background: var(--aviso-fundo); border-color: #ecd28a; color: #5b3b00; }
.alerta-ok { background: var(--ok-fundo); border-color: #a9d6c5; color: #07422f; }
.alerta-info { background: #e8f0fe; border-color: #b6cdf7; color: #17346b; }
.selo { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eceae3; color: #444; }
.selo-ok { background: var(--acento-fundo); color: var(--acento-esc); }
.selo-aviso { background: var(--aviso-fundo); color: var(--aviso); }
.selo-erro { background: var(--perigo-fundo); color: var(--perigo); }

/* Tabelas */
.tabela-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); background: #faf9f5; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 800; border-top: 2px solid var(--tinta); }

/* Login */
.login-caixa { max-width: 400px; margin: 8vh auto 0; }
.login-caixa h1 { text-align: center; }

/* Venda (assinatura) */
.venda-grade { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.produtos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.produto { border: 2px solid var(--linha); border-radius: var(--raio); padding: .8rem; background: #fff; display: flex; flex-direction: column; gap: .4rem; }
.produto.sel { border-color: var(--acento); background: var(--acento-fundo); }
.produto .nome { font-weight: 700; }
.produto .preco { font-size: 1.15rem; font-weight: 800; color: var(--acento-esc); }
.qtd { display: flex; align-items: center; gap: .4rem; margin-top: auto; }
.qtd button { width: 48px; height: 48px; font-size: 1.5rem; font-weight: 700; border-radius: 10px; border: 1.5px solid var(--acento); background: #fff; color: var(--acento); cursor: pointer; touch-action: manipulation; }
.qtd button:active { background: var(--acento-fundo); }
.qtd input { width: 64px; text-align: center; font-size: 1.2rem; font-weight: 700; padding: .3rem; }
.barra-total { position: sticky; bottom: 0; background: var(--tinta); color: #fff; margin: 1rem -1rem -1rem; padding: .8rem 1rem; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; z-index: 10; }
.barra-total .valor { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.barra-total .itens { color: #d8d5cc; font-size: .9rem; }
.aviso-cliente { margin-top: .4rem; }

/* Ticket do pedido */
.ticket-numero { font-size: 4.5rem; font-weight: 900; text-align: center; letter-spacing: -.02em; margin: .5rem 0; color: var(--acento-esc); }
.ticket-nome { text-align: center; font-size: 1.4rem; font-weight: 700; }
.ticket-total { text-align: center; font-size: 2rem; font-weight: 800; margin: .5rem 0 1rem; }

/* Caixa: fila */
.fila { display: grid; gap: .6rem; }
.fila-item { display: grid; grid-template-columns: 90px 1fr auto; gap: .5rem 1rem; align-items: center; background: #fff; border: 1.5px solid var(--linha); border-radius: var(--raio); padding: .7rem 1rem; }
.fila-item .num { font-size: 1.5rem; font-weight: 900; color: var(--acento-esc); }
.fila-item .quem { font-weight: 700; font-size: 1.1rem; }
.fila-item .detalhe { font-size: .88rem; color: var(--suave); }
.fila-item .valor { font-size: 1.3rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.fila-item.ocupado { opacity: .6; background: #f3f1ea; }
.fila-item.novo { animation: pisca 2s ease-out; }
@keyframes pisca { from { background: #fff3b0; } to { background: #fff; } }
@media (max-width: 640px) { .fila-item { grid-template-columns: 1fr; } .fila-item .valor { text-align: left; } }
.vazio { text-align: center; color: var(--suave); padding: 2rem 1rem; border: 2px dashed var(--linha); border-radius: var(--raio); }
.estado-fila { font-size: .85rem; color: var(--suave); }

/* Caixa: pagamento */
.pag-topo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .pag-topo { grid-template-columns: 1fr; } }
.painel-total { background: var(--tinta); color: #fff; border-radius: var(--raio); padding: 1rem 1.2rem; }
.painel-total .rot { color: #bdb9ae; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.painel-total .grande { font-size: 2.4rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
.painel-total .restante { font-size: 1.4rem; font-weight: 800; margin-top: .4rem; font-variant-numeric: tabular-nums; }
.painel-total .restante.zerado { color: #7be0b8; }
.painel-total .restante.excede { color: #ffb4ab; }
.pag-linha { border: 2px solid var(--linha); border-radius: var(--raio); padding: .8rem; background: #fff; margin-bottom: .75rem; }
.pag-linha.pix-ativo { border-color: var(--acento); }
.metodos { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .6rem; }
@media (max-width: 640px) { .metodos { grid-template-columns: repeat(3, 1fr); } }
.metodo { border: 2px solid #bdb8ab; background: #fff; border-radius: 10px; padding: .7rem .3rem; font: inherit; font-weight: 700; cursor: pointer; min-height: 52px; touch-action: manipulation; color: var(--tinta); }
.metodo[aria-pressed="true"] { background: var(--acento); border-color: var(--acento); color: #fff; }
.pag-campos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; align-items: end; }
@media (max-width: 640px) { .pag-campos { grid-template-columns: 1fr; } }
.pag-extra { display: contents; }
.pag-valor input { font-size: 1.5rem; font-weight: 800; text-align: right; }
.troco { font-weight: 800; color: var(--acento-esc); }
.pix-box { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--linha); }
@media (max-width: 640px) { .pix-box { grid-template-columns: 1fr; justify-items: center; } }
.pix-qr { width: 240px; height: 240px; background: #fff; border: 1px solid var(--linha); padding: 8px; image-rendering: pixelated; }
.pix-codigo { width: 100%; font: .78rem/1.3 ui-monospace, Menlo, Consolas, monospace; min-height: 96px; resize: none; word-break: break-all; }
.itens-pedido { font-size: .95rem; }
.itens-pedido li { margin: .15rem 0; }

/* Relatorios */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: .8rem 1rem; }
.kpi .rot { font-size: .78rem; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.positivo { color: var(--acento-esc); }
.negativo { color: var(--perigo); }
.filtros { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.filtros > div { min-width: 150px; }

/* Impressao (comprovantes e fechamento de caixa) */
@page { margin: 12mm; }
@media print {
  .lateral, .barra, .nao-imprimir, .barra-total, .menu, .passos { display: none !important; }
  body { background: #fff; }
  .conteudo { max-width: none; padding: 0; }
  .app { display: block; }
  .cartao { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Abas de relatorios */
.abas { background: transparent; margin-bottom: .75rem; gap: .4rem; }
.abas .aba { background: #fff; border: 1.5px solid var(--linha); color: var(--tinta); }
.abas .aba:hover { background: var(--acento-fundo); color: var(--tinta); }
.abas .aba.ativo { background: var(--tinta); color: #fff; border-color: var(--tinta); }
details { margin: .5rem 0 1rem; }
summary { cursor: pointer; font-weight: 700; color: var(--acento-esc); padding: .4rem 0; }
code { background: #eceae3; padding: .1rem .35rem; border-radius: 5px; }

/* Pix automatico / baixa manual */
.pix-dir { display: grid; gap: .5rem; min-width: 0; }
.pix-estado { padding: .5rem .7rem; border-radius: 8px; background: var(--papel); font-weight: 600; }
.pix-estado.pix-espera { background: var(--aviso-fundo); color: var(--aviso); }
.pix-estado.pix-ok { background: var(--ok-fundo); color: var(--acento-esc); font-size: 1.05rem; }
.pix-estado.pix-erro { background: var(--perigo-fundo); color: var(--perigo); }
.pix-manual { display: grid; gap: .5rem; margin-top: .25rem; padding-top: .6rem; border-top: 1px dashed var(--linha); }
.pix-manual input[readonly] { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 600; margin: .5rem 0; }
label.check input { width: auto; }
.tag-manual { display: inline-block; padding: 0 .4rem; border-radius: 6px; background: var(--aviso-fundo); color: var(--aviso); font-size: .75rem; font-weight: 700; }
.tag-auto { display: inline-block; padding: 0 .4rem; border-radius: 6px; background: var(--ok-fundo); color: var(--acento-esc); font-size: .75rem; font-weight: 700; }
form.inline { display: inline; }


/* Login em duas colunas */
.login-tela { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-marca { background: var(--lateral); color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 4rem; gap: .6rem; }
.login-marca h2 { font-size: 2.6rem; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.login-marca p { margin: 0; color: #cfd5e4; font-size: 1.05rem; }
.login-form { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2rem; background: var(--papel); }
.login-form form { width: 100%; max-width: 400px; display: grid; gap: 1rem; }
.login-logo { width: 96px; height: 96px; border-radius: 50%; background: var(--lateral); color: #fff; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; margin: 0 auto 1.5rem; }
.login-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.login-form .rodape-login { margin-top: 2rem; color: var(--suave); font-size: .85rem; text-align: center; max-width: 400px; }
@media (max-width: 860px) { .login-tela { grid-template-columns: 1fr; } .login-marca { display: none; } }

/* Passos do pedido */
.saudacao h1 { font-size: 2rem; margin-bottom: .2rem; }
.passos { list-style: none; display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0 1.4rem; padding: 0; }
.passo { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .95rem; white-space: nowrap; color: var(--suave); }
.passo::after { content: ""; display: block; height: 1px; background: #b5bccb; min-width: 24px; flex: 1; margin-left: .6rem; }
.passo:last-child { flex: none; } .passo:last-child::after { display: none; }
.passo:not(:last-child) { flex: 1; }
.bolinha { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #9aa1b2; color: #fff; font-size: .8rem; font-weight: 800; flex: none; }
.passo.ativo { color: var(--tinta); } .passo.ativo .bolinha { background: var(--acento); }
.passo.feito { color: var(--tinta); } .passo.feito .bolinha { background: #0e8a5f; }
@media (max-width: 640px) { .passo::after { display: none; } .passos { justify-content: space-between; gap: .4rem; } .passo { font-size: .82rem; } }

/* Pedido em 2 colunas */
.pedido-grade { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
@media (max-width: 980px) { .pedido-grade { grid-template-columns: 1fr; } }
.busca-cpf { display: flex; gap: .8rem; align-items: stretch; max-width: 520px; }
.busca-cpf input { flex: 1; }
.cliente-topo { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cliente-topo .avatar { width: 48px; height: 48px; font-size: 1.1rem; }
.cliente-rotulo { font-size: .8rem; color: var(--suave); }
.cliente-nome { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.cliente-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem 1.5rem; }
.cliente-dados .rot { font-size: .8rem; color: var(--suave); }
.cliente-dados .val { font-weight: 700; word-break: break-word; }
.add-produto { display: grid; grid-template-columns: 1fr 140px auto; gap: .8rem; align-items: end; }
@media (max-width: 640px) { .add-produto { grid-template-columns: 1fr 1fr; } .add-produto > :first-child { grid-column: span 2; } }
.resumo { position: sticky; top: 1rem; }
.resumo h2 { margin: 0 0 1rem; }
.resumo-linha { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.resumo-linha span:first-child { color: var(--suave); }
.resumo-linha span:last-child { font-weight: 700; text-align: right; }
.resumo-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--linha); margin-top: .8rem; padding-top: 1rem; }
.resumo-total strong { font-size: 1.05rem; }
.resumo-total .valor { font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.resumo .btn { width: 100%; margin-top: .6rem; }
.btn-claro { background: #fff; color: var(--tinta); border-color: var(--linha); }
.btn-claro:hover { background: var(--papel); }
.tabela-itens td, .tabela-itens th { padding: .8rem 1rem; }
.tabela-itens input[type=number] { width: 76px; min-height: 38px; padding: .3rem .5rem; text-align: center; }
.itens-vazio { text-align: center; color: var(--suave); padding: 1.4rem 1rem; }
.cartao.sem-padding { padding: 0; overflow: hidden; }
.cartao-titulo { padding: 1.1rem 1.2rem .4rem; margin: 0; }
.ico-remover { background: transparent; border: 0; color: var(--perigo); cursor: pointer; font-weight: 700; min-height: 36px; padding: .2rem .5rem; border-radius: 8px; }
.ico-remover:hover { background: var(--perigo-fundo); }

.conteudo.cheia { max-width: none; padding: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.foto-comprovante { display: grid; gap: .5rem; justify-items: start; margin-top: .5rem; }
.foto-btn { cursor: pointer; }
.foto-thumb { max-width: 240px; max-height: 240px; border-radius: 10px; border: 1px solid var(--linha); }
.chave-pix-auto { font-size: 1.1rem; }

/* ---- Celular e tablet ---- */
.barra-mobile { display: none; }
@media (max-width: 980px) {
  .barra-mobile { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--lateral); color: #fff; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); gap: 1rem; align-items: center; justify-content: space-between; box-shadow: 0 -6px 20px rgba(0,0,0,.25); }
  .barra-mobile[hidden] { display: none !important; }
  .barra-mobile .rot { color: #cfd5e4; font-size: .85rem; }
  .barra-mobile .valor { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
  .barra-mobile .btn { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.2rem; }
  body.com-barra .conteudo { padding-bottom: 110px; }
  .resumo { position: static; }
  .resumo #btn-gerar { display: none; }
}
@media (max-width: 640px) {
  .conteudo { padding: 1rem .8rem 2rem; }
  .cartao { padding: .9rem; }
  .saudacao h1 { font-size: 1.5rem; }
  .busca-cpf { flex-direction: column; max-width: none; }
  .busca-cpf .btn { width: 100%; }
  .cliente-topo { flex-wrap: wrap; }
  .cliente-topo .btn { margin-left: auto; }
  .tabela-itens thead { display: none; }
  .tabela-itens, .tabela-itens tbody, .tabela-itens tr, .tabela-itens td { display: block; width: 100%; }
  .tabela-itens tr { padding: .7rem 1rem; border-bottom: 1px solid var(--linha); }
  .tabela-itens td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; align-items: center; text-align: right !important; white-space: normal; }
  .tabela-itens td::before { content: attr(data-rotulo); color: var(--suave); font-size: .8rem; text-align: left; margin-right: 1rem; }
  .tabela-itens td.desc { font-weight: 700; }
  .tabela-itens td.desc::before, .tabela-itens td.acao::before { content: none; }
  .tabela-itens td.acao { justify-content: flex-end; }
  .tabela-itens input[type=number] { width: 90px; min-height: 44px; }
  .ico-remover { min-height: 44px; padding: .4rem .8rem; }
  .linha-acoes .btn-grande { width: 100%; }
  .lateral a, .lateral button { padding: .85rem .8rem; }
}
@media (hover: none) { .btn:hover { filter: none; } }

/* Lista de produtos em botoes (toque) */
.lista-produtos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 4px; max-height: 280px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.prod-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 10px 12px; text-align: left; background: #fff; border: 1.5px solid #cfd5e2; border-radius: 10px; font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.prod-btn .prod-nome { font-weight: 600; line-height: 1.25; }
.prod-btn .prod-preco { color: var(--acento); font-weight: 700; }
.prod-btn.sel { border-color: var(--acento); background: #fff3e8; box-shadow: 0 0 0 2px var(--laranja); }

/* Fechamento: contagem por cedulas */
.contagem { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.cont-item { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
.cont-item input { min-height: 44px; text-align: center; }
.cartao-diferenca { margin: 12px 0; padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.dif-ok { background: #e6f6ea; color: #14532d; }
.dif-erro { background: #fdecea; color: #7f1d1d; }

/* Logo no menu lateral */
.lateral .marca { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.marca-logo { max-width: 100%; max-height: 72px; width: auto; height: auto; object-fit: contain; }

.dif-campo { display: block; min-height: 1.2em; margin-top: 4px; font-weight: 600; font-size: .88rem; }
.dif-ok-t { color: #14532d; }
.dif-erro-t { color: #991b1b; }

/* Foto do comprovante no computador: arrastar, colar, webcam */
.foto-comprovante.arrastando { outline: 3px dashed var(--laranja); outline-offset: 4px; background: #fff7ec; }
.cam-box { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid #cfd5e2; border-radius: 10px; background: #f6f7fb; }
.cam-video { width: 100%; max-width: 480px; border-radius: 8px; background: #000; }

.filtros .filtro-largo { flex: 1 1 280px; }
.marcar-caixas { border: 1px solid var(--borda, #d8d8e0); border-radius: 8px; margin: 12px 0; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.marcar-caixas legend { font-weight: 600; padding: 0 6px; }
.marcar-caixas .opcao { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.marcar-caixas input { width: auto; }
