:root {
  /* Vidro de garrafa escuro + ouro da marca + cinza mineral */
  --tampa: #10201A;
  --tampa-2: #182B24;
  --tampa-3: #233B32;
  --ouro: #F2B41C;
  --ouro-esc: #8E6300;
  --ouro-claro: #FFF5D6;
  --vermelho: #B42318;
  --vermelho-claro: #FDECEA;
  --verde: #12704A;
  --verde-claro: #E3F3EB;
  --ambar: #8A5300;
  --ambar-claro: #FFF1D6;
  --azul: #1F4E79;
  --azul-claro: #E6EEF7;
  --fundo: #EDF1EF;
  --papel: #FFFFFF;
  --nevoa: #F5F8F6;
  --linha: #D9E1DD;
  --linha-2: #E8EDEA;
  --tinta: #13201B;
  --sub: #55655E;
  --lat-txt: #E2EBE6;
  --lat-sub: #87A096;
  --lateral: 252px;
  --raio: 14px;
  --raio-ctl: 9px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: "Archivo", system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: var(--tinta); background: var(--fundo); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--ouro-esc); outline-offset: 2px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.sub { color: var(--sub); }

/* ---------- Login ---------- */
#login { min-height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.login-marca { background: var(--tampa); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 20px; }
.login-marca img { width: min(280px, 60vw); }
.login-marca p { margin: 0; color: #A6BAB1; font-size: 15px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--papel); }
.login-form form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login-form h1 { font-size: 26px; font-weight: 750; margin: 0; letter-spacing: -.01em; }
@media (max-width: 760px) { #login { grid-template-columns: 1fr; } .login-marca { padding: 32px 16px 24px; } .login-marca img { width: 160px; } }

/* ---------- Campos e botões ---------- */
label.campo { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--sub); }
label.campo small { font-weight: 400; }
input, select, textarea { padding: 8px 10px; border: 1px solid #CFD8D4; border-radius: 7px; background: #fff; min-height: 36px; font-size: 14px; color: var(--tinta); }
input[readonly] { background: #F2F5F3; color: var(--sub); }
input:focus, select:focus, textarea:focus { border-color: var(--ouro-esc); outline: 3px solid rgba(242,180,28,.28); outline-offset: 0; }
input.invalido { border-color: var(--vermelho); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; min-height: 36px; border-radius: 7px; border: 1px solid transparent; font-weight: 600; cursor: pointer; white-space: nowrap; font-size: 14px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-pri { background: var(--tampa); color: #fff; }
.btn-pri:hover:not(:disabled) { background: var(--tampa-3); }
.btn-ouro { background: var(--ouro); color: var(--tampa); }
.btn-ouro:hover:not(:disabled) { background: #E5A60F; }
.btn-sec { background: #fff; border-color: #CFD8D4; color: var(--tinta); }
.btn-sec:hover:not(:disabled) { background: var(--nevoa); border-color: #B8C4BE; }
.btn-perigo { background: #fff; border-color: #EBC3C4; color: var(--vermelho); }
.btn-link { background: none; border: 0; color: var(--azul); padding: 0; min-height: 0; font-weight: 600; cursor: pointer; }
.btn-mini { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn-icone { width: 32px; height: 32px; padding: 0; min-height: 0; }
.erro { color: var(--vermelho); font-size: 13px; min-height: 18px; }

/* ---------- Estrutura ---------- */
#app { display: grid; grid-template-columns: var(--lateral) 1fr; min-height: 100%; }
aside.lateral { background: var(--tampa); color: var(--lat-txt); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 30; }
.marca { display: flex; align-items: center; gap: 11px; padding: 16px 16px; border-bottom: 1px solid var(--tampa-3); width: 100%; background: none; border-width: 0 0 1px; text-align: left; font: inherit; color: inherit; cursor: default; }
.marca img { width: 44px; height: 44px; }
.marca b { display: block; font-weight: 750; font-size: 15px; color: #fff; line-height: 1.15; }
.marca span { font-size: 12px; color: var(--lat-sub); }
nav.menu { padding: 12px 10px; flex: 1; overflow-y: auto; }
.grupo { margin-bottom: 14px; }
.grupo h3 { margin: 0 0 4px; padding: 0 10px; font-size: 11.5px; font-weight: 600; color: var(--lat-sub); }
.item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: #C3D3CB; border-radius: 7px; cursor: pointer; text-align: left; position: relative; font-weight: 500; font-size: 14px; }
.item svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.item:hover { background: var(--tampa-2); color: #fff; }
.item.ativo { background: var(--tampa-3); color: #fff; font-weight: 600; }
.item.ativo svg { opacity: 1; color: var(--ouro); }
.item.ativo::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ouro); }
.item .badge { margin-left: auto; background: var(--vermelho); color: #fff; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; border-radius: 9px; }
.item .badge.ouro { background: var(--ouro); color: var(--tampa); }
.rodape-lateral { padding: 12px 14px 14px; border-top: 1px solid var(--tampa-3); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ouro); color: var(--tampa); display: grid; place-items: center; font-weight: 800; flex: none; font-size: 13px; }
.rodape-lateral .quem { min-width: 0; flex: 1; font-size: 12.5px; }
.rodape-lateral .quem div { color: var(--lat-txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rodape-lateral .quem small { color: var(--lat-sub); }
.sair { border: 1px solid var(--tampa-3); background: transparent; color: #B3C5BC; border-radius: 7px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; }
.sair:hover { color: #fff; border-color: #3A564B; }

.conteudo { min-width: 0; display: flex; flex-direction: column; }
header.topo { display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: var(--papel); border-bottom: 1px solid var(--linha); position: sticky; top: 0; z-index: 20; min-height: 72px; }
header.topo .titulo { flex: 1; min-width: 0; }
.trilha { font-size: 12.5px; color: var(--sub); margin-bottom: 1px; }
header.topo h1 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
header.topo .acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hamburguer { display: none; border: 1px solid var(--linha); background: #fff; border-radius: 7px; width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; flex: none; }
main { padding: 22px 28px 56px; max-width: 1320px; width: 100%; }
.veu { display: none; }
@media (max-width: 960px) {
  #app { grid-template-columns: 1fr; }
  aside.lateral { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-102%); transition: transform .2s ease; }
  body.menu-aberto aside.lateral { transform: none; }
  body.menu-aberto .veu { display: block; position: fixed; inset: 0; background: rgba(8,20,16,.5); z-index: 25; }
  .hamburguer { display: inline-flex; }
  header.topo { padding: 10px 16px; flex-wrap: wrap; min-height: 0; }
  header.topo .acoes { width: 100%; }
  header.topo .acoes .btn { flex: 1; }
  main { padding: 16px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { aside.lateral { transition: none; } }

/* ---------- Blocos ---------- */
.painel { background: var(--papel); border: 1px solid var(--linha); border-radius: 10px; }
.painel-cab { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--linha-2); }
.painel-cab h2 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.painel-cab .sub { font-size: 13px; }
.painel-corpo { padding: 16px 18px; }
.pilha > * + * { margin-top: 16px; }

/* ---------- Painel (dashboard) ---------- */
.indicadores { display: grid; grid-template-columns: repeat(4, 1fr); }
.indicador { padding: 16px 18px; border-left: 1px solid var(--linha-2); text-align: left; background: none; border-top: 0; border-right: 0; border-bottom: 0; cursor: default; }
.indicador:first-child { border-left: 0; }
button.indicador { cursor: pointer; }
button.indicador:hover { background: var(--nevoa); }
.indicador .rot { font-size: 13px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.indicador .rot i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.indicador .v { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.indicador .det { font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.v.pos { color: var(--verde); } .v.neg { color: var(--vermelho); }
@media (max-width: 1100px) { .indicadores { grid-template-columns: 1fr 1fr; } .indicador:nth-child(3) { border-left: 0; } .indicador:nth-child(n+3) { border-top: 1px solid var(--linha-2); } }
@media (max-width: 520px) { .indicadores { grid-template-columns: 1fr; } .indicador { border-left: 0; border-top: 1px solid var(--linha-2); } .indicador:first-child { border-top: 0; } }
.grade-2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grade-2 { grid-template-columns: 1fr; } }
.grafico { position: relative; height: 260px; }

/* ---------- Tabelas ---------- */
.barra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--linha-2); }
.barra .busca { flex: 1; min-width: 220px; position: relative; }
.barra .busca input, .kb-barra .busca input { width: 100%; padding-left: 34px; }
.barra .busca svg, .kb-barra .busca svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--sub); }
.abas { display: inline-flex; background: #E6ECE9; border-radius: 8px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.abas button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; color: var(--sub); font-size: 13.5px; }
.abas button.ativo { background: #fff; color: var(--tinta); box-shadow: 0 1px 2px rgba(16,32,26,.14); }
.abas button .n { font-weight: 500; color: var(--sub); margin-left: 4px; }
.rolagem { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--linha-2); white-space: nowrap; vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--sub); background: var(--nevoa); position: sticky; top: 0; }
tbody tr:hover { background: #F8FAF9; }
tbody tr:last-child td { border-bottom: 0; }
td.texto { white-space: normal; min-width: 200px; }
td .linha2 { display: block; color: var(--sub); font-size: 12.5px; }
td.cod { color: var(--sub); font-variant-numeric: tabular-nums; }
.valor-rec { color: var(--verde); font-weight: 600; }
.valor-pag { color: var(--vermelho); font-weight: 600; }
.rodape-tabela { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 11px 14px; font-weight: 600; background: var(--nevoa); border-top: 1px solid var(--linha-2); border-radius: 0 0 10px 10px; }
.vazio { padding: 44px 16px; text-align: center; color: var(--sub); white-space: normal; }
.vazio b { display: block; color: var(--tinta); font-size: 15px; margin-bottom: 4px; }
.selo { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; line-height: 18px; }
.selo.pago, .selo.ok { background: var(--verde-claro); color: var(--verde); }
.selo.pendente, .selo.neutro { background: #E6ECE9; color: var(--sub); }
.selo.vencido, .selo.baixo { background: var(--vermelho-claro); color: var(--vermelho); }
.selo.entrada, .selo.novo { background: var(--ambar-claro); color: var(--ambar); }
.selo.saida, .selo.vinculo { background: var(--azul-claro); color: var(--azul); }
.acoes-linha { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Upload ---------- */
.soltar { display: block; border: 1.5px dashed #B9C5BF; border-radius: 10px; background: var(--papel); padding: 28px 20px; text-align: center; cursor: pointer; }
.soltar:hover, .soltar.sobre { border-color: var(--ouro-esc); background: #FFFCF3; }
.soltar svg { width: 28px; height: 28px; color: var(--ouro-esc); margin-bottom: 6px; }
.soltar b { display: block; font-size: 15px; margin-bottom: 3px; }
.soltar span { color: var(--sub); }
.aviso { white-space: pre-line; padding: 12px 14px; border-radius: 8px; background: #FFF8E6; border: 1px solid #F0D898; }
.aviso.perigo { background: var(--vermelho-claro); border-color: #F0C4C5; }

/* ---------- Entrada de nota ---------- */
.inicio-entrada { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 860px) { .inicio-entrada { grid-template-columns: 1fr; } }
.opcao-manual { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; padding: 24px; }
.opcao-manual b { font-size: 15px; }
.entrada { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.entrada > *, .pilha > * { min-width: 0; }
.resumo { position: sticky; top: 90px; }
.resumo dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; }
.resumo dt { color: var(--sub); }
.resumo dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.resumo .total { border-top: 1px solid var(--linha-2); padding-top: 10px; margin-top: 4px; font-size: 16px; }
.campos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.campos .c2 { grid-column: span 2; } .campos .c3 { grid-column: span 3; } .campos .c4 { grid-column: span 4; } .campos .c6 { grid-column: 1 / -1; }
@media (max-width: 760px) { .campos { grid-template-columns: 1fr 1fr; } .campos > * { grid-column: span 2 !important; } }
.itens-entrada td { vertical-align: top; }
.itens-entrada td.texto { min-width: 200px; max-width: 280px; }
.itens-entrada input { min-height: 32px; padding: 5px 8px; }
.itens-entrada .w-qtd { width: 84px; } .itens-entrada .w-fator { width: 70px; } .itens-entrada .w-valor { width: 110px; } .itens-entrada .w-un { width: 60px; }
.vinculo-box { display: flex; flex-direction: column; gap: 6px; min-width: 250px; }
.vinculo-box .linha { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.novo-prod { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 6px; background: #FFFCF3; border: 1px solid #F0E2B8; border-radius: 8px; padding: 8px; }
.novo-prod input { min-height: 30px; font-size: 13px; }
.novo-prod .inteiro { grid-column: 1 / -1; }
.parcelas td { vertical-align: middle; }
.parcelas input { min-height: 32px; }

/* ---------- Diálogos ---------- */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(620px, 94vw); box-shadow: 0 24px 60px rgba(8,20,16,.35); color: var(--tinta); }
dialog.largo { width: min(860px, 96vw); }
dialog::backdrop { background: rgba(8,20,16,.5); }
.dlg-cab { padding: 18px 22px 4px; }
.dlg-cab h2 { margin: 0; font-size: 18px; font-weight: 700; }
.dlg-cab p { margin: 4px 0 0; color: var(--sub); }
.dlg-corpo { padding: 14px 22px; max-height: 70vh; overflow: auto; }
.dlg-pe { display: flex; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--linha-2); }
.dlg-pe .esp { flex: 1; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .inteira { grid-column: 1 / -1; }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }
.tipo-escolha { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-column: 1 / -1; }
.tipo-escolha label { border: 1px solid var(--linha); border-radius: 8px; padding: 9px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.tipo-escolha input { min-height: 0; accent-color: var(--tampa); }
.tipo-escolha label:has(input:checked) { border-color: var(--tampa); background: #F3F7F5; }
.info-nota p { margin: 0 0 6px; }
.chave { font-size: 12px; color: var(--sub); word-break: break-all; }
.estoque-atual { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #F2F5F3; border-radius: 8px; grid-column: 1 / -1; }
.estoque-atual b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* Avisos rápidos */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; max-width: min(420px, calc(100vw - 32px)); }
.toast { pointer-events: auto; cursor: pointer; display: flex; align-items: flex-start; gap: 10px; background: var(--tampa); color: #fff; padding: 11px 16px 11px 13px; border-radius: 10px; box-shadow: 0 12px 32px rgba(8,20,16,.28); font-weight: 600; line-height: 1.35; animation: toastEntra .22s ease-out; transition: opacity .25s, transform .25s; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--ouro); margin-top: 1px; }
.toast.erro-t { background: var(--vermelho); }
.toast.erro-t svg { color: #fff; }
.toast.saindo { opacity: 0; transform: translateX(12px); }
@keyframes toastEntra { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 640px) { #toasts { left: 16px; right: 16px; bottom: 16px; align-items: stretch; max-width: none; } }
.carregando { padding: 40px; text-align: center; color: var(--sub); }

@media (max-width: 1600px) {
  .entrada { grid-template-columns: 1fr; }
  .resumo { position: static; }
  .resumo dl { grid-template-columns: repeat(3, auto 1fr); }
  .resumo dd { text-align: left; }
  .resumo .total { border-top: 0; padding-top: 0; margin-top: 0; }
  .resumo #rsBtn { width: auto !important; }
}
@media (max-width: 700px) { .resumo dl { grid-template-columns: 1fr auto; } .resumo dd { text-align: right; } .resumo #rsBtn { width: 100% !important; } }

/* ---------- PDV ---------- */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pdv > * { min-width: 0; }
@media (max-width: 1000px) { .pdv { grid-template-columns: 1fr; } }
.pdv-leitor { display: flex; gap: 12px; padding: 14px 16px; align-items: end; }
.pdv-qtd { width: 96px; flex: none; }
.pdv-codigo { flex: 1; }
.pdv-leitor input { min-height: 48px; font-size: 18px; }
.pdv-codigo input { border-width: 2px; border-color: var(--tampa); }
.pdv-pag { position: sticky; top: 90px; }
@media (max-width: 1000px) { .pdv-pag { position: static; } }
.pdv-total { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--linha-2); }
.pdv-total b { font-size: 38px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.formas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.formas button { border: 1px solid #CFD8D4; background: #fff; border-radius: 7px; padding: 9px 6px; font-weight: 600; cursor: pointer; }
.formas button:hover { border-color: #B8C4BE; }
.formas button.ativo { background: var(--tampa); color: #fff; border-color: var(--tampa); }
.btn-grande { min-height: 50px; font-size: 16px; width: 100%; }
#pdvItens input { min-height: 34px; padding: 5px 8px; text-align: right; }
#pdvItens .w-q { width: 90px; } #pdvItens .w-p { width: 100px; }
.ultima-venda { border: 1px solid #CDE6D7; background: var(--verde-claro); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.linha-alerta { color: var(--vermelho); font-size: 12.5px; display: block; }

/* ---------- Produto: códigos extras ---------- */
.codigos-extra { display: flex; flex-direction: column; gap: 8px; }
.cod-linha { display: grid; grid-template-columns: 1.4fr 90px 1fr 32px; gap: 6px; align-items: center; }
.cod-linha input { min-height: 32px; }
@media (max-width: 560px) { .cod-linha { grid-template-columns: 1fr 80px 32px; } .cod-linha .cod-desc { display: none; } }

/* ---------- Entrada: destino ---------- */
select.destino { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.sem-estoque { color: var(--sub); font-size: 13px; }
.barra-destino { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.barra-destino select { min-height: 32px; padding: 4px 8px; font-size: 13px; }

/* ---------- Comprovante ---------- */
#cupom { display: none; }
@media print {
  body > *:not(#cupom) { display: none !important; }
  body.imprime-rel > #cupom { display: none !important; }
  body.imprime-rel > #relImpressao { display: block !important; }
  #cupom { display: block; width: 72mm; font: 12px/1.35 "Courier New", monospace; color: #000; }
  #cupom h1 { font-size: 14px; margin: 0 0 4px; text-align: center; }
  #cupom .c { text-align: center; }
  #cupom table { width: 100%; border-collapse: collapse; }
  #cupom td { padding: 1px 0; border: 0; white-space: normal; }
  #cupom hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  @page { margin: 4mm; }
}

.troco-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.troco-box b { font-size: 20px; color: var(--tinta); white-space: nowrap; min-height: 36px; display: flex; align-items: center; }

.cod-linha input { min-width: 0; width: 100%; }
.pdv-codigo { min-width: 0; }
.pdv-codigo input { width: 100%; min-width: 0; }
.pdv-qtd input { width: 100%; }
@media (max-width: 560px) { .pdv-leitor { padding: 12px; gap: 8px; } .pdv-qtd { width: 72px; } .pdv-leitor input { font-size: 16px; } .pdv-total b { font-size: 32px; } }
.codigos-extra > .btn { align-self: flex-start; }

.pdf-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--linha); border-radius: 8px; margin: 0 0 12px; background: var(--nevoa); }
.pdf-box > span:first-child { display: inline-flex; align-items: center; gap: 8px; min-width: 0; word-break: break-all; }
.pdf-box svg { width: 18px; height: 18px; color: var(--vermelho); flex: none; }

/* ---------- Escolher produto ---------- */
.pdv-escolher { min-height: 48px; flex: none; }
.tecla { font-size: 11px; font-weight: 700; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 0 5px; margin-left: 2px; }
@media (max-width: 700px) { .pdv-leitor { flex-wrap: wrap; } .pdv-escolher { width: 100%; } .tecla { display: none; } }
.escolher-barra { display: flex; gap: 10px; align-items: end; }
.escolher-barra .busca { flex: 1; position: relative; }
.escolher-barra .busca input { width: 100%; padding-left: 34px; min-height: 42px; font-size: 15px; }
.escolher-barra .busca svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--sub); }
.es-qtd { width: 90px; } .es-qtd input { width: 100%; min-height: 42px; }
.es-cats { margin-top: 10px; }
#esLista tbody tr { cursor: pointer; }
#esLista tbody tr.sel { background: var(--ouro-claro); }
#esLista tbody tr.sem td { color: var(--sub); }

/* ---------- Papéis ---------- */
body.papel-caixa [data-papel="gestor"], body.papel-caixa [data-papel="admin"], body.papel-gerente [data-papel="admin"] { display: none !important; }

/* ---------- Contas e caixa ---------- */
.contas-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.conta-card { background: var(--papel); border: 1px solid var(--linha); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.conta-card.inativa { opacity: .6; }
.conta-card .tipo { font-size: 12.5px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.conta-card .tipo svg { width: 16px; height: 16px; }
.conta-card .nome { font-weight: 700; font-size: 15px; }
.conta-card .saldo { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.conta-card .mov { font-size: 12.5px; color: var(--sub); }
.conta-card .acoes-linha { justify-content: flex-start; margin-top: 10px; flex-wrap: wrap; }
.cx-status { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
@media (max-width: 900px) { .cx-status { grid-template-columns: 1fr; } }
.cx-grande { font-size: 34px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cx-aberto { border-left: 4px solid var(--verde); }
.cx-fechado { border-left: 4px solid var(--sub); }
.pdv-caixa { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Relatórios ---------- */
.dre td { white-space: normal; }
.dre tr.grupo-dre td { font-weight: 700; background: var(--nevoa); }
.dre tr.total-dre td { font-weight: 750; font-size: 15px; border-top: 2px solid var(--linha); }
.dre td.ind { padding-left: 30px; color: var(--sub); }
.rel-nota { padding: 12px 16px; font-size: 13px; color: var(--sub); border-top: 1px solid var(--linha-2); }
.barra-mini { height: 6px; border-radius: 3px; background: var(--ouro); display: block; margin-top: 4px; }
body.papel-caixa #tbProd th:nth-child(5), body.papel-caixa #tbProd td:nth-child(5), body.papel-caixa #tbProd th:nth-child(7), body.papel-caixa #tbProd td:nth-child(7), body.papel-caixa #rdProd span:last-child { display: none; }
.cx-status .resumo dl, .resumo.fixo dl { grid-template-columns: 1fr auto !important; }
.cx-status .resumo dd, .resumo.fixo dd { text-align: right !important; }
.cx-status .resumo .total, .resumo.fixo .total { border-top: 1px solid var(--linha-2) !important; padding-top: 10px !important; }

/* CPF/CNPJ e seletor de cliente/fornecedor */
.doc-info { font-size: 12px; font-weight: 500; color: var(--sub); min-height: 15px; }
.doc-info.ok { color: var(--verde); }
.doc-info.ruim { color: var(--vermelho); }
.sub-campo { font-size: 12px; font-weight: 400; color: var(--sub); }
.duplo { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.parc-status { font-size: 13px; color: var(--tinta); font-weight: 400; display: block; }
.parc-status .selo { margin-right: 6px; }
.parc-sug { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--linha-2); border-radius: 10px; box-shadow: 0 14px 34px rgba(8,20,16,.22); padding: 4px; max-height: 330px; overflow-y: auto; }
.parc-sug button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; font: inherit; color: var(--tinta); cursor: pointer; }
.parc-sug button b { font-weight: 600; font-size: 14px; }
.parc-sug button span { font-size: 12px; color: var(--sub); }
.parc-sug button:hover, .parc-sug button.sel { background: #FBF3DC; }
.parc-sug button.novo { color: #8a5a00; font-weight: 600; border-top: 1px solid var(--linha); border-radius: 0 0 7px 7px; }

/* Confirmações do sistema */
dialog.pergunta { width: min(460px, calc(100vw - 32px)); border-radius: 14px; animation: pgEntra .16s ease-out; }
dialog.pergunta::backdrop { background: rgba(8,20,16,.55); animation: pgFundo .16s ease-out; }
@keyframes pgEntra { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes pgFundo { from { opacity: 0; } }
.pg-corpo { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 22px 22px 18px; }
.pg-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--ouro-claro); color: var(--ouro-esc); }
.pg-ico svg { width: 21px; height: 21px; }
.tom-perigo .pg-ico { background: var(--vermelho-claro); color: var(--vermelho); }
.tom-info .pg-ico { background: #EFEAE4; color: var(--tampa); }
.pg-txt h2 { margin: 2px 0 6px; font-size: 17px; font-weight: 700; line-height: 1.3; }
.pg-txt p { margin: 0 0 8px; color: var(--sub); line-height: 1.5; }
.pg-lista { margin: 8px 0 10px; padding: 10px 12px 10px 28px; background: var(--fundo); border: 1px solid var(--linha); border-radius: 8px; display: grid; gap: 4px; }
.pg-lista b { font-weight: 650; color: var(--tinta); }
.pg-nota { font-size: 13px; color: var(--sub); }
.tom-perigo .pg-nota { color: var(--vermelho); font-weight: 600; }
.pg-campo { margin: 12px 0 4px; }
.pg-pe { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--linha-2); background: var(--nevoa); border-radius: 0 0 14px 14px; }
.btn-perigo-cheio { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.btn-perigo-cheio:hover:not(:disabled) { background: #A51117; }
.btn-perigo-cheio:disabled { opacity: .45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { dialog.pergunta, dialog.pergunta::backdrop, .toast { animation: none; transition: none; } }
@media (max-width: 640px) { .pg-pe { flex-direction: column-reverse; } .pg-pe .btn { width: 100%; justify-content: center; } }

#relImpressao { display: none; }

/* Quadro de tarefas */
.kb-barra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.kb-barra .busca { flex: 1; min-width: 200px; position: relative; max-width: 360px; }
.kb-barra select { min-height: 38px; }
.kb-quadro { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 14px; min-height: calc(100vh - 200px); }
.kb-col { flex: 1 0 260px; max-width: 360px; background: #ECE9E4; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.kb-col.finaliza { background: #E4EEE7; }
.kb-col header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 14px; }
.kb-col h3 { margin: 0; font-size: 14.5px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-n { font-size: 12.5px; font-weight: 700; color: var(--sub); background: rgba(255,255,255,.7); border-radius: 999px; padding: 1px 8px; }
.kb-menu { border: 0; background: none; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; color: var(--sub); cursor: pointer; }
.kb-menu:hover { background: rgba(0,0,0,.06); color: var(--tinta); }
.kb-menu svg { width: 18px; height: 18px; }
.kb-lista { flex: 1; overflow-y: auto; padding: 2px 10px 6px; display: flex; flex-direction: column; gap: 8px; min-height: 48px; border-radius: 8px; transition: background .15s; }
.kb-lista.sobre { background: rgba(242,180,28,.12); }
.kb-vazio { font-size: 13px; color: var(--sub); text-align: center; padding: 14px 6px; border: 1.5px dashed rgba(0,0,0,.12); border-radius: 9px; }
.kb-marca { height: 4px; border-radius: 2px; background: var(--ouro); flex: none; }
.kb-card { position: relative; background: #fff; border-radius: 10px; padding: 11px 12px 10px 40px; box-shadow: 0 1px 2px rgba(16,32,26,.1); border: 1px solid transparent; cursor: pointer; }
.kb-card:hover { border-color: var(--linha); box-shadow: 0 3px 10px rgba(16,32,26,.1); }
.kb-card:focus-visible { outline: 2px solid var(--ouro-esc); }
.kb-card.pri-urgente { box-shadow: inset 3px 0 0 var(--vermelho), 0 1px 2px rgba(16,32,26,.1); }
.kb-card.pri-importante { box-shadow: inset 3px 0 0 var(--ouro), 0 1px 2px rgba(16,32,26,.1); }
.kb-card.arrastando { opacity: .35; }
.kb-card h4 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.kb-card.feita h4 { color: var(--sub); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.kb-check { position: absolute; left: 11px; top: 10px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #B9B3AC; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.kb-check:hover { border-color: var(--verde); background: var(--verde-claro); }
.kb-card.feita .kb-check { background: var(--verde); border-color: var(--verde); }
.kb-check svg { width: 12px; height: 12px; stroke-width: 3; }
.kb-etqs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.kb-etqs span { font-size: 11px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 5px; padding: 1px 7px; }
.kb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 12px; color: var(--sub); }
.kb-meta:empty { display: none; }
.kb-meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.kb-pri { color: var(--vermelho); font-weight: 600; }
.pri-importante .kb-pri { color: var(--ouro-esc); }
.kb-prazo { font-weight: 600; }
.kb-prazo.atrasada { color: #fff; background: var(--vermelho); border-radius: 5px; padding: 1px 7px; }
.kb-prazo.hoje { color: #6B4A00; background: var(--ouro-claro); border-radius: 5px; padding: 1px 7px; }
.kb-prazo.breve { color: var(--ouro-esc); }
.kb-chk.ok { color: var(--verde); font-weight: 600; }
.kb-av { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: var(--tampa); color: var(--ouro); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.kb-add { padding: 4px 10px 10px; }
.kb-add-btn { width: 100%; border: 0; background: none; text-align: left; padding: 8px 6px; border-radius: 8px; color: var(--sub); font: inherit; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.kb-add-btn:hover { background: rgba(0,0,0,.05); color: var(--tinta); }
.kb-add-btn svg { width: 16px; height: 16px; }
.kb-add input { width: 100%; }
.menu-pop { position: fixed; z-index: 1500; width: 240px; background: #fff; border: 1px solid var(--linha-2); border-radius: 10px; box-shadow: 0 14px 34px rgba(8,20,16,.22); padding: 4px; display: flex; flex-direction: column; }
.menu-pop button { border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 7px; font: inherit; cursor: pointer; color: var(--tinta); }
.menu-pop button:hover { background: #EBF0ED; }
.menu-pop button.perigo { color: var(--vermelho); border-top: 1px solid var(--linha-2); border-radius: 0 0 7px 7px; }
@media (max-width: 760px) { .kb-col { flex-basis: 84vw; } .kb-quadro { scroll-snap-type: x mandatory; } .kb-col { scroll-snap-align: start; } }

/* Janela da tarefa */
.tf-corpo { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.tf-titulo { font-size: 20px; font-weight: 700; border: 1px solid transparent; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.tf-titulo:hover, .tf-titulo:focus { border-color: var(--linha); }
.tf-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tf-pri, .tf-etq { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tf-pri label, .tf-etq label { cursor: pointer; }
.tf-pri input, .tf-etq input { position: absolute; opacity: 0; pointer-events: none; }
.tf-pri span, .tf-etq span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--linha); font-size: 13px; font-weight: 600; color: var(--tinta); background: #fff; }
.tf-pri input:checked + span { background: var(--tampa); border-color: var(--tampa); color: #fff; }
.tf-pri input[value=urgente]:checked + span { background: var(--vermelho); border-color: var(--vermelho); }
.tf-pri input[value=importante]:checked + span { background: var(--ouro); border-color: var(--ouro); color: var(--tampa); }
.tf-etq span { color: var(--c); border-color: color-mix(in srgb, var(--c) 35%, #fff); }
.tf-etq input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.tf-pri input:focus-visible + span, .tf-etq input:focus-visible + span { outline: 2px solid var(--ouro-esc); outline-offset: 2px; }
.tf-chk-n { font-weight: 600; color: var(--sub); margin-left: 6px; }
.tf-barra-chk { height: 5px; background: var(--linha-2); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.tf-barra-chk span { display: block; height: 100%; background: var(--verde); transition: width .2s; }
.tf-chk { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; }
.tf-chk li { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; }
.tf-chk li:hover { background: var(--nevoa); }
.tf-chk li label { flex: 1; display: flex; align-items: center; gap: 9px; font-weight: 400; color: var(--tinta); font-size: 14px; cursor: pointer; }
.tf-chk li input { min-height: 0; width: 17px; height: 17px; accent-color: var(--verde); }
.tf-chk li.feito span { text-decoration: line-through; color: var(--sub); }
.tf-chk li .btn-link svg { width: 14px; height: 14px; color: var(--sub); }
.tf-chk-add { display: flex; gap: 8px; }
.tf-chk-add input { flex: 1; }
.tf-info { margin: 0; font-size: 12.5px; }
@media (max-width: 640px) { .tf-grade { grid-template-columns: 1fr; } }

/* Relatório impresso de tarefas */
@media print {
  #relImpressao { font: 10.5pt/1.4 "Archivo", Arial, sans-serif; color: #000; padding: 6mm 8mm; }
  #relImpressao .ri-cab { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  #relImpressao h1 { font-size: 17pt; margin: 0; }
  #relImpressao .ri-cab p { margin: 2px 0 0; }
  #relImpressao .ri-data { text-align: right; font-size: 9pt; color: #333; }
  #relImpressao .ri-resumo { display: flex; gap: 10px; margin: 8px 0 12px; }
  #relImpressao .ri-resumo div { flex: 1; border: 1px solid #999; border-radius: 6px; padding: 6px 10px; }
  #relImpressao .ri-resumo b { display: block; font-size: 18pt; }
  #relImpressao .ri-resumo small { display: block; color: #444; }
  #relImpressao h2 { font-size: 12.5pt; margin: 14px 0 6px; border-bottom: 1px solid #999; padding-bottom: 3px; }
  #relImpressao h3 { font-size: 10.5pt; margin: 10px 0 4px; }
  #relImpressao table { width: 100%; border-collapse: collapse; page-break-inside: auto; }
  #relImpressao tr { page-break-inside: avoid; }
  #relImpressao th { text-align: left; font-size: 9pt; border-bottom: 1px solid #000; padding: 3px 5px; }
  #relImpressao td { border-bottom: 1px solid #ccc; padding: 4px 5px; vertical-align: top; }
  #relImpressao .n { text-align: right; }
  #relImpressao .ri-etq { display: block; font-size: 8.5pt; color: #444; }
  #relImpressao .ri-chk { margin: 2px 0 0; padding: 0; list-style: none; font-size: 9pt; color: #333; }
  #relImpressao .ri-vazio { color: #444; font-style: italic; }
  #relImpressao .ri-ass { display: flex; gap: 40px; margin-top: 40px; }
  #relImpressao .ri-ass span { flex: 1; border-top: 1px solid #000; padding-top: 3px; text-align: center; font-size: 9pt; }
}

/* Troca de empresa */
.marca > div { flex: 1; min-width: 0; }
.marca b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marca-seta { width: 18px; height: 18px; color: #A89A8C; flex: none; display: none; }
.marca.pode { cursor: pointer; }
.marca.pode .marca-seta { display: block; }
.marca.pode:hover { background: var(--tampa-2); }
.emp-pop .emp-tit { margin: 6px 10px 4px; font-size: 12px; color: var(--sub); font-weight: 600; }
.emp-pop button { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
.emp-pop button b { font-weight: 650; }
.emp-pop button span { grid-column: 1; font-size: 12px; color: var(--sub); }
.emp-pop button svg { grid-row: 1 / span 2; grid-column: 2; width: 16px; height: 16px; color: var(--verde); }
.emp-pop button.atual { background: #FBF3DC; }
.emp-pop .emp-ger { border-top: 1px solid var(--linha-2); border-radius: 0 0 7px 7px; color: var(--ouro-esc); font-weight: 600; display: block; }
body.empresa-sec .menu .grupo:not([data-sempre]) { display: none !important; }
body.empresa-sec .menu [data-rota="config"] { display: none !important; }
.ea-lista { display: flex; flex-direction: column; gap: 6px; }
.ea-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--linha); border-radius: 9px; cursor: pointer; }
.ea-item:hover { background: var(--nevoa); }
.ea-item input { width: 18px; height: 18px; min-height: 0; accent-color: var(--tampa); }
.ea-item span { display: flex; flex-direction: column; }
.ea-item small { color: var(--sub); font-size: 12px; }

.marca-ini { width: 44px; height: 44px; border-radius: 12px; background: var(--ouro); color: var(--tampa); display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }

/* Identidade: Jeniffer Cristine Estética Avançada */
body.tema-jc { --tampa: #0B0B0B; --tampa-2: #1B1A19; --tampa-3: #2C2A28; --ouro: #D8CFC2; --ouro-esc: #7E7465; --ouro-claro: #F4F1EC; }
body.tema-jc .marca img { width: 46px; height: 46px; }
body.tema-jc .marca b { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: #ECE7E0; white-space: normal; line-height: 1.15; }
body.tema-jc .marca span { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 13.5px; letter-spacing: .12em; color: #A9A196; }
body.tema-jc #tituloPagina { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 28px; letter-spacing: .01em; }
body.tema-jc .kb-col.finaliza { background: #E9E7E3; }
body.tema-jc .kb-av { color: #ECE7E0; }
body.tema-jc .kb-card.pri-importante { box-shadow: inset 3px 0 0 #9C8F7C, 0 1px 2px rgba(30,26,23,.1); }
body.tema-jc .btn-ouro { color: #0B0B0B; }
@media print { #relImpressao .ri-cab { gap: 14px; } #relImpressao .ri-logo { height: 46px; width: auto; } body.tema-jc #relImpressao .ri-logo { height: 78px; } body.tema-jc #relImpressao h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 20pt; } }

/* App instalado no iPhone: respeita o entalhe e a barra de início */
@supports (padding: env(safe-area-inset-top)) {
  header.topo { padding-top: max(14px, env(safe-area-inset-top)); }
  .lateral { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  #toasts { bottom: max(20px, env(safe-area-inset-bottom)); }
  .dlg-pe, .pg-pe { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
}

/* Leitor pela câmera */
.com-camera { display: flex; gap: 6px; }
.com-camera input { flex: 1; min-width: 0; }
.pdv-camera { min-height: 48px; }
dialog.scanner { width: min(560px, 100vw); max-height: 100dvh; border-radius: 16px; padding: 0; background: #111; color: #fff; overflow: hidden; }
dialog.scanner::backdrop { background: rgba(6,14,11,.75); }
.sc-cab { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px 18px; }
.sc-cab > div { flex: 1; }
.sc-cab h2 { margin: 0 0 2px; font-size: 17px; }
.sc-cab p { margin: 0; font-size: 13px; color: #A9B6B0; }
.sc-fechar { border: 0; background: rgba(255,255,255,.1); color: #fff; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.sc-fechar svg { width: 18px; height: 18px; }
.sc-video { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.sc-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-mira { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.sc-mira span { width: min(86%, 440px); height: min(34%, 190px); border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); position: relative; transition: border-color .15s; }
.sc-mira span::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #F2443A; box-shadow: 0 0 8px #F2443A; }
.sc-video.lido .sc-mira span { border-color: #3BD27A; }
.sc-video.erro .sc-mira span { border-color: #F2443A; }
.sc-carregando { position: absolute; inset: 0; display: grid; place-items: center; color: #A9B6B0; font-weight: 600; }
.sc-status { padding: 12px 18px; min-height: 46px; font-weight: 600; font-size: 14.5px; color: #E6DFD6; }
.sc-status.ok { color: #6FE3A0; }
.sc-status.ruim { color: #FF8A80; }
.sc-lidos { list-style: none; margin: 0; padding: 0 18px 6px; font-size: 13px; color: #A9B6B0; display: flex; flex-direction: column; gap: 3px; }
.sc-lidos li:first-child { color: #fff; }
.sc-pe { display: flex; gap: 8px; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.08); }
.sc-pe .btn-sec { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.15); }
.sc-pe .btn-sec.ativo { background: var(--ouro); color: #1C1612; }
.sc-pe .btn-pri { background: #fff; color: #111; }
@media (max-width: 560px) { dialog.scanner[open] { width: 100vw; height: 100dvh; max-width: 100vw; border-radius: 0; margin: 0; display: flex; flex-direction: column; } dialog.scanner .sc-video { flex: 1; aspect-ratio: auto; } }
@media (max-width: 700px) { .pdv-codigo { flex: 1 1 calc(100% - 96px); min-width: 0; } .pdv-leitor .pdv-camera, .pdv-leitor .pdv-escolher { flex: 1 1 40%; width: auto; justify-content: center; } }

/* ===== Celular ===== */
.nav-baixo { display: none; }
@media (max-width: 960px) {
  /* campos com 16px: o iPhone não dá zoom ao tocar */
  input, select, textarea { font-size: 16px; }
  header.topo .acoes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; width: calc(100% + 32px); }
  header.topo .acoes::-webkit-scrollbar { display: none; }
  header.topo .acoes .btn { flex: 1 0 auto; white-space: nowrap; }
  .nav-baixo { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; background: var(--tampa); padding: 6px 6px max(6px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(8,20,16,.18); }
  .nav-baixo button { flex: 1; border: 0; background: none; color: #B8AA98; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .nav-baixo button svg { width: 22px; height: 22px; }
  .nav-baixo button.ativo { color: var(--ouro); background: rgba(255,255,255,.06); }
  #app:not(.hide) ~ .nav-baixo { display: flex; }
  #app.hide ~ .nav-baixo, body.menu-aberto .nav-baixo { display: none; }
  main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(80px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 640px) {
  /* tabelas viram cartões */
  .rolagem > table:not(.sem-cartao) { display: block; }
  .rolagem > table:not(.sem-cartao) thead { display: none; }
  .rolagem > table:not(.sem-cartao) tbody { display: block; }
  .rolagem > table:not(.sem-cartao) tr { display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; border-bottom: 1px solid var(--linha-2); }
  .rolagem > table:not(.sem-cartao) td { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; padding: 0; border: 0; text-align: right; white-space: normal; min-width: 0; }
  .rolagem > table:not(.sem-cartao) td::before { content: attr(data-label); flex: none; max-width: 48%; margin-right: auto; text-align: left; color: var(--sub); font-size: 12.5px; font-weight: 500; }
  .rolagem > table:not(.sem-cartao) td[data-label=""]::before { content: none; }
  .rolagem > table:not(.sem-cartao) td[data-label="#"] { display: none; }
  .rolagem > table:not(.sem-cartao) td.titulo-cartao { order: -1; display: block; text-align: left; font-size: 15px; margin-bottom: 2px; }
  .rolagem > table:not(.sem-cartao) td.titulo-cartao::before { content: none; }
  .rolagem > table:not(.sem-cartao) td.acoes-cel { justify-content: flex-end; margin-top: 6px; }
  .rolagem > table:not(.sem-cartao) td.acoes-cel .acoes-linha { flex-wrap: wrap; justify-content: flex-end; }
  .rolagem > table:not(.sem-cartao) td.vazio { display: block; text-align: center; padding: 18px 0; }
  .rolagem > table:not(.sem-cartao) td.vazio::before { content: none; }
  .rolagem > table:not(.sem-cartao) td .linha2 { display: inline; }
  .rolagem > table:not(.sem-cartao) td.titulo-cartao .linha2 { display: block; }
  .rolagem > table:not(.sem-cartao) td:empty { display: none; }
  .rolagem > table:not(.sem-cartao) tr[style*="opacity"] { opacity: .6; }
  /* PDV: itens da venda */
  #pdvItens input { max-width: 110px; }
  /* resultado (DRE) sem a coluna de % */
  table.dre th:nth-child(3), table.dre td:nth-child(3) { display: none; }
  table.dre td, table.dre th { padding: 9px 12px; }
  table.dre td.num { white-space: nowrap; }
  .painel-cab { flex-wrap: wrap; row-gap: 6px; }
  header.topo .acoes .btn { padding-left: 12px; padding-right: 12px; }
  /* janelas sobem de baixo, ocupando a largura */
  dialog:not(.scanner):not(.pergunta)[open] { position: fixed; inset: auto 0 0 0; width: 100vw; max-width: 100vw; margin: 0; border-radius: 16px 16px 0 0; max-height: 94dvh; max-height: min(94dvh, calc(var(--vvh, 100dvh) - 12px)); display: flex; flex-direction: column; }
  dialog:not(.scanner):not(.pergunta)[open] > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; max-height: inherit; }
  dialog:not(.scanner):not(.pergunta)[open] .dlg-corpo { max-height: none; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px 16px; }
  .dlg-cab { padding: 16px 16px 4px; }
  .dlg-pe { padding: 12px 16px max(14px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .dlg-pe .btn { flex: 1 1 auto; justify-content: center; }
  .dlg-pe .esp { display: none; }
  .barra { padding: 10px 12px; }
  .barra .busca { min-width: 0; flex-basis: 100%; }
}

.pdv-barra { display: none; }
@media (max-width: 1000px) {
  .pdv-barra { display: flex; align-items: center; gap: 12px; position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 15; background: var(--tampa); color: #fff; border-radius: 12px; padding: 10px 10px 10px 16px; box-shadow: 0 8px 24px rgba(8,20,16,.25); order: 2; }
  .pdv-barra div { flex: 1; display: flex; flex-direction: column; }
  .pdv-barra b { font-size: 20px; font-variant-numeric: tabular-nums; }
  .pdv-barra span { font-size: 12px; color: #C9BCAA; }
}
@media (min-width: 961px) and (max-width: 1000px) { .pdv-barra { bottom: 12px; } }
@media (max-width: 640px) { table.dre th { white-space: normal; } }

/* Notas da SEFAZ */
.sf-status .painel-corpo { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 10px 28px; align-items: start; }
.sf-status .painel-corpo > div { display: flex; flex-direction: column; gap: 2px; }
.sf-status .sub { font-size: 12.5px; }
.sf-status.erro { border-color: #EBC3C4; }
@media (max-width: 760px) { .sf-status .painel-corpo { grid-template-columns: 1fr 1fr; } .sf-msg { grid-column: 1 / -1; } }
.cert-status { margin-bottom: 12px; font-size: 14px; }
.cert-passos { margin: 14px 0 0; padding-left: 20px; color: var(--sub); font-size: 13.5px; display: grid; gap: 6px; }
.cert-passos code { background: #E9EEEB; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--tinta); }
.menu-pop button .sub { font-weight: 400; }
.cert-auto { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; cursor: pointer; }
.cert-auto input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.cert-auto .sub { font-size: 12.5px; }
.sf-datas { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sf-datas select { min-height: 38px; }
.sf-datas .campo.sf-data { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
@media (max-width: 640px) { .sf-datas .campo.sf-data { flex: 1; } .sf-datas .campo.sf-data input { min-width: 0; width: 100%; } }
.sf-data.hide { display: none; }
@media (max-width: 640px) { .sf-datas { width: 100%; } .sf-datas select { flex: 1; } }
dialog:focus { outline: none; }
.chk-sem-est { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; cursor: pointer; margin-left: auto; margin-right: 12px; }
.chk-sem-est input { width: 16px; height: 16px; }
@media (max-width: 640px) { .chk-sem-est { margin: 6px 0 0; width: 100%; } }

/* Fechamento do dia */
body.sem-pdv .so-pdv { display: none !important; }
.fech-grade { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 16px; align-items: start; }
.fech-grade #formFech { display: grid; gap: 12px; }
.fech-formas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fech-formas.hide, #fcTotalBox.hide { display: none; }
.fech-soma { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--linha-2); }
.fech-soma b { font-size: 18px; }
.fech-acoes { display: flex; gap: 8px; justify-content: flex-end; }
#fcResumo { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .fech-grade { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .fech-acoes .btn { flex: 1; justify-content: center; } }
.pag-linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 760px; }
.seg { display: inline-flex; background: #E9EEEB; border-radius: 9px; padding: 3px; gap: 2px; }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 7px; font-size: 14px; font-weight: 500; color: var(--sub); }
.seg input:checked + span { background: #fff; color: var(--tinta); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--ouro); }
.campo.lc-pago { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.lc-pago > span:first-child { font-size: 13px; font-weight: 500; }
.lc-pg.hide { display: none; }
.seg-mini span { padding: 5px 10px; font-size: 13px; }
.pag-feito { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.campo-mini { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--sub); }
.campo-mini input, .campo-mini select { min-height: 34px; padding: 5px 8px; font-size: 13.5px; }
input.falta { border-color: var(--vermelho, #C0392B); box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.selo.validar { background: #FFF1CC; color: #8A5A00; }
.abas button .n.alerta { background: #F2B705; color: #2A1E00; border-radius: 9px; padding: 1px 7px; font-size: 12px; font-weight: 600; }
.lc-validar { margin-top: 0; }

/* ================= Redesenho 2026-10: vidro de garrafa + ouro ================= */
body { font-size: 14px; letter-spacing: .002em; }
/* Títulos e valores em Archivo estreito: é a assinatura visual do sistema */
header.topo h1, .painel-cab h2, .dlg-cab h2, .login-form h1 { font-stretch: 88%; letter-spacing: -.012em; }
.indicador .v, .estoque-atual b, .fech-soma b { font-stretch: 82%; font-weight: 650; letter-spacing: -.02em; }
.indicador .v { font-size: 30px; line-height: 1.1; margin-top: 6px; }
td.num, .valor-rec, .valor-pag { font-variant-numeric: tabular-nums; }

/* Menu lateral */
body:not(.tema-jc) aside.lateral { background: linear-gradient(180deg, var(--tampa) 0%, #0C1A15 100%); }
aside.lateral { color: var(--lat-txt); }
.marca { padding: 18px 16px; border-bottom-color: rgba(255,255,255,.06); }
nav.menu { padding: 14px 12px; }
.grupo h3 { color: var(--lat-sub); font-size: 11.5px; font-weight: 500; padding: 0 10px; margin-bottom: 6px; letter-spacing: .01em; }
.item { padding: 8px 10px; border-radius: var(--raio-ctl); }
body:not(.tema-jc) .item { color: #C3D3CB; }
.item:hover { background: rgba(255,255,255,.05); }
.item.ativo { background: rgba(242,180,28,.12); color: #fff; }
.item.ativo::before { left: -12px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; }
.rodape-lateral { border-top-color: rgba(255,255,255,.06); }
.sair { border-color: rgba(255,255,255,.1); }

/* Topo da página: sem barra branca, título grande sobre o fundo */
header.topo { background: rgba(237,241,239,.88); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; padding: 18px 32px 14px; }
header.topo h1 { font-size: 26px; font-weight: 700; }
.trilha { font-size: 12.5px; color: var(--sub); margin-bottom: 2px; }
main { padding: 6px 32px 64px; }

/* Blocos */
.painel { border-radius: var(--raio); border-color: var(--linha); }
.painel-cab { padding: 15px 20px; }
.painel-cab h2 { font-size: 16px; font-weight: 650; }
.painel-corpo { padding: 18px 20px; }
.rodape-tabela { border-radius: 0 0 var(--raio) var(--raio); background: var(--nevoa); }
.indicador { padding: 18px 20px; }
.indicador .rot { font-size: 13px; }

/* Controles */
input, select, textarea { border-radius: var(--raio-ctl); border-color: #CFD8D4; }
input:hover:not(:focus):not([readonly]), select:hover:not(:focus) { border-color: #B8C4BE; }
.btn { border-radius: var(--raio-ctl); font-weight: 600; }
.btn-pri { background: var(--tampa); }
.btn-pri:hover:not(:disabled) { background: var(--tampa-3); }
.btn-ouro { background: var(--ouro); color: #1A1400; box-shadow: inset 0 -1px 0 rgba(0,0,0,.12); }
.btn-ouro:hover:not(:disabled) { background: #E6A70E; }
.abas { background: #E3EAE6; border-radius: 10px; }
.abas button { border-radius: 8px; }

/* Tabelas: mais ar, cabeçalho discreto */
th, td { padding: 11px 16px; }
th { font-weight: 500; font-size: 12.5px; background: var(--nevoa); color: var(--sub); }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #F7FAF8; }
.selo { border-radius: 999px; padding: 2px 9px; font-weight: 600; }

/* Diálogos e avisos */
dialog { border-radius: 16px; }
.aviso { border-radius: 10px; }
.toast { border-radius: 12px; }

@media (max-width: 960px) {
  header.topo { padding: 12px 16px; background: rgba(237,241,239,.94); }
  header.topo h1 { font-size: 21px; }
  main { padding: 4px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { tbody tr { transition: none; } }
body.tema-jc { --fundo: #F3F2F0; --nevoa: #F8F7F5; --linha: #E3E0DB; --linha-2: #EEECE8; --tinta: #1A1817; --sub: #66605A; --lat-txt: #ECE7E0; --lat-sub: #9A9187; }
body.tema-jc header.topo { background: rgba(243,242,240,.9); }
body.tema-jc .item.ativo { background: rgba(216,207,194,.14); }
/* Login: brilho dourado discreto atrás da tampinha */
.login-marca { background: radial-gradient(60% 45% at 50% 46%, rgba(242,180,28,.16), rgba(242,180,28,0) 70%), var(--tampa); }
#pdNome, .novo-prod input[data-k="novo.nome"] { text-transform: uppercase; }

/* Fluxo de caixa */
.fx-barra { gap: 10px 12px; }
.fx-barra .campo.fx-c { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.fx-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--sub); cursor: pointer; }
.fx-chk input { width: 16px; height: 16px; min-height: 0; }
#fxAlerta:empty { display: none; }
#fxAlerta .aviso + .aviso { margin-top: 8px; }
.fx-tab tr.fx-ini td { background: var(--nevoa); color: var(--sub); }
.fx-tab tr.fx-clic { cursor: pointer; }
.fx-tab tr.fx-clic:focus-visible { outline: 2px solid var(--ouro-esc); outline-offset: -2px; }
.fx-tab tr.fx-neg td { background: #FDF3F2; }
.fx-tab .fx-seta { display: inline-block; width: 16px; color: var(--sub); }
.fx-tab tr.fx-it td { background: #FAFCFB; font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.fx-tab tr.fx-it td:first-child { padding-left: 34px; white-space: normal; }
.fx-tab tfoot td { background: var(--nevoa); border-top: 1px solid var(--linha); padding: 12px 16px; }
@media (max-width: 640px) { .fx-barra .campo.fx-c { flex: 1 1 45%; } .fx-barra .campo.fx-c input, .fx-barra .campo.fx-c select { flex: 1; min-width: 0; } }

/* Relatório impresso do fluxo de caixa (A4, com gráficos) */
@media print {
  html:has(body.imprime-rel), body.imprime-rel { background: #fff !important; }
  #relImpressao.rf { padding: 0; font-size: 9.5pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #relImpressao.rf .rf-cab { border-bottom: 3px solid #10201A; align-items: center; }
  #relImpressao.rf .rf-sobre { font-size: 8pt; letter-spacing: .12em; text-transform: uppercase; color: #12704A; font-weight: 700; }
  #relImpressao.rf h1 { font-size: 20pt; color: #10201A; }
  #relImpressao.rf .ri-data b { font-size: 10.5pt; color: #10201A; }
  #relImpressao.rf h2 { font-size: 11pt; color: #10201A; border-bottom: 1.5px solid #10201A; margin: 0 0 6px; }
  .rf-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 10px 0; }
  .rf-kpis > div { border: 1px solid #C9D2CE; border-radius: 6px; padding: 6px 8px; background: #F6F8F7; break-inside: avoid; }
  .rf-kpis span { display: block; font-size: 7.5pt; color: #444; text-transform: uppercase; letter-spacing: .04em; }
  .rf-kpis span i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
  .rf-kpis b { display: block; font-size: 13pt; margin: 2px 0 1px; color: #10201A; white-space: nowrap; }
  .rf-kpis small { display: block; font-size: 7.5pt; color: #555; }
  .rf-kpis .rf-destaque { background: #10201A; border-color: #10201A; }
  .rf-kpis .rf-destaque span, .rf-kpis .rf-destaque small { color: #C8D6D0; }
  .rf-kpis .rf-destaque b { color: #fff; }
  .rf-kpis .rf-destaque b.rf-neg { color: #FFB4A8; }
  .rf-neg { color: #B42318 !important; }
  .rf-alerta { border: 1px solid #B42318; border-left: 4px solid #B42318; background: #FDF1EF; padding: 5px 9px; border-radius: 4px; margin: 0 0 8px; font-size: 9pt; break-inside: avoid; }
  .rf-alerta.rf-info { border-color: #D9822B; background: #FDF6EE; }
  .rf-bloco { margin: 10px 0 0; break-inside: avoid; }
  .rf-bloco.rf-quebra { break-inside: auto; }
  .rf-bloco img { display: block; width: 100%; height: auto; max-width: 100%; }
  .rf-leg { margin: -2px 0 4px; font-size: 7.5pt; color: #555; }
  .rf-duas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .rf-vazio { border: 1px dashed #bbb; padding: 30px 0; text-align: center; color: #666; font-style: italic; }
  #relImpressao.rf th { background: #EDF1EF; font-size: 8pt; text-transform: uppercase; letter-spacing: .03em; }
  #relImpressao.rf td { padding: 3px 5px; }
  #relImpressao.rf thead { display: table-header-group; }
  #relImpressao.rf tfoot td { border-top: 1.5px solid #10201A; border-bottom: 0; font-weight: 700; }
  .rf-ent { color: #12704A; } .rf-sai { color: #B42318; }
  .rf-ini td { background: #F6F8F7; }
  .rf-linneg td { background: #FDF1EF; }
  .rf-dem td:first-child { color: #333; }
  .rf-dem .rf-tot td { border-top: 1.5px solid #10201A; border-bottom: 0; font-weight: 700; font-size: 10pt; }
  .rf-mai .rf-sub td { font-weight: 700; font-size: 8pt; text-transform: uppercase; color: #10201A; background: #EDF1EF; }
  .rf-st { display: inline-block; font-size: 7.5pt; font-weight: 700; padding: 0 5px; border-radius: 3px; border: 1px solid; }
  .rf-realizado { color: #12704A; border-color: #12704A; } .rf-previsto { color: #555; border-color: #999; } .rf-atrasado { color: #B42318; border-color: #B42318; }
  .rf-barcol { width: 30%; padding-left: 14px !important; }
  #relImpressao.rf h2 { break-after: avoid; page-break-after: avoid; }
  #relImpressao.rf .rf-quebra > h2 + table thead { break-before: avoid; }
  .rf-barra { display: inline-block; width: calc(100% - 46px); height: 8px; background: #EDF1EF; border-radius: 2px; vertical-align: middle; overflow: hidden; }
  .rf-barra i { display: block; height: 100%; background: #C9372C; }
  .rf-pct { display: inline-block; width: 42px; text-align: right; font-size: 8pt; }
  .rf-nota { margin: 12px 0 0; font-size: 7.5pt; color: #555; border-top: 1px solid #ccc; padding-top: 5px; }
}

/* ================= Módulos: menu lateral por módulo + tela inicial ================= */
.menu .grupo[data-mod]:not(.mod-on) { display: none; }
.menu .grupo.mod-on { animation: modEntra .22s ease-out; }
@keyframes modEntra { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.mod-topo { margin: -2px 0 14px; }
.mod-voltar { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--lat-sub); font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 8px 4px 4px; border-radius: 7px; cursor: pointer; }
.mod-voltar svg { width: 16px; height: 16px; }
.mod-voltar:hover { color: #fff; background: rgba(255,255,255,.06); }
.mod-atual { display: flex; gap: 10px; align-items: center; padding: 10px 8px 4px; }
.mod-atual b { display: block; color: #fff; font-size: 15px; font-stretch: 90%; letter-spacing: -.01em; line-height: 1.2; }
.mod-atual small { display: block; color: var(--lat-sub); font-size: 11.5px; line-height: 1.3; margin-top: 1px; }
.mod-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--mc) 22%, transparent); color: color-mix(in srgb, var(--mc) 55%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 40%, transparent); }
.mod-ico svg { width: 19px; height: 19px; }
.mod-lista h3 { margin-top: 14px !important; }
.mod-bt { gap: 11px; }
.mod-pt { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.mod-bt .mod-nome { flex: 1; min-width: 0; }
.mod-bt .mod-seta { width: 15px !important; height: 15px !important; opacity: .45; transition: opacity .15s, transform .15s; }
.mod-bt:hover .mod-seta { opacity: 1; transform: translateX(2px); }
.trilha { cursor: default; }
body:not([data-mod="_inicio"]) .trilha { cursor: pointer; }
body:not([data-mod="_inicio"]) .trilha:hover { color: var(--tinta); text-decoration: underline; text-underline-offset: 2px; }

/* Tela inicial: só os módulos */
#v-inicio { max-width: 1180px; }
.mods-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.mod-card { --mc: #12704A; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 190px; padding: 22px 22px 20px; background: #fff; border: 1px solid var(--linha); border-radius: 16px; text-align: left; font: inherit; color: var(--tinta); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mod-card:hover { border-color: color-mix(in srgb, var(--mc) 55%, var(--linha)); box-shadow: 0 12px 28px -16px color-mix(in srgb, var(--mc) 70%, transparent); }
.mod-card:focus-visible { outline: none; border-color: var(--mc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 30%, transparent); }
.mod-card-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--mc) 12%, #fff); color: var(--mc); margin-bottom: 14px; }
.mod-card-ico svg { width: 26px; height: 26px; }
.mod-card-nome { font-size: 20px; font-weight: 700; font-stretch: 85%; letter-spacing: -.015em; }
.mod-card-desc { font-size: 13px; color: var(--sub); line-height: 1.45; max-width: 34ch; }
.mod-card-pend { position: absolute; top: 22px; right: 22px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--vermelho); background: var(--vermelho-claro); padding: 4px 9px; border-radius: 999px; }
.mod-card-seta { position: absolute; right: 22px; bottom: 20px; width: 20px; height: 20px; color: var(--sub); transition: transform .15s, color .15s; }
.mod-card:hover .mod-card-seta { color: var(--mc); transform: translateX(3px); }
@media (max-width: 1000px) { .mods-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mods-grade { grid-template-columns: 1fr; gap: 10px; } .mod-card { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 16px; column-gap: 14px; }
  .mod-card-ico { margin: 0; width: 44px; height: 44px; } .mod-card-nome { font-size: 17px; flex: 1; } .mod-card-desc { flex-basis: 100%; padding-right: 26px; }
  .mod-card-pend { position: static; } .mod-card-seta { bottom: 16px; right: 16px; } }
@media (prefers-reduced-motion: reduce) { .menu .grupo.mod-on { animation: none; } }

/* ======================================================================
   Remodelação 2026-10: grafite escuro + barra de módulos + menu do módulo
   (cores só na empresa principal; a JC mantém o tema dela)
   ====================================================================== */
:root { --trilho: 76px; }
#app { grid-template-columns: var(--trilho) var(--lateral) minmax(0, 1fr); }
aside.trilho { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0 12px; z-index: 31; background: #151A18; border-right: 1px solid #2A322E; }
.trilho-logo { width: 38px; height: 38px; margin-bottom: 12px; }
.trilho-mods { display: flex; flex-direction: column; gap: 4px; }
.trilho-pe { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tm { position: relative; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 0 7px; border: 0; border-radius: 10px; background: none; color: #96A29B; font-family: inherit; font-size: 10.5px; font-weight: 500; line-height: 1.1; cursor: pointer; }
.tm svg { width: 20px; height: 20px; }
.tm:hover { background: #232A27; color: #E7ECE9; }
.tm.on { background: #363E3A; color: #fff; }
.tm.on svg { color: var(--ouro); }
.tm:focus-visible { outline: 2px solid var(--ouro); outline-offset: 1px; }
.tm i { position: absolute; top: 7px; right: 17px; width: 7px; height: 7px; border-radius: 50%; background: #F07167; box-shadow: 0 0 0 2px #151A18; }
.trilho-av { width: 32px; height: 32px; border-radius: 50%; background: var(--ouro); color: #1A1400; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
aside.lateral { border-right: 1px solid var(--linha); }
.marca img { display: none; }
.marca { padding: 16px 18px 14px; }
.mod-topo { margin: 2px 0 2px; padding: 0 10px; }
.mod-atual b { display: block; font-size: 11.5px; font-weight: 600; color: var(--lat-sub); letter-spacing: .02em; }
.mod-atual { padding: 4px 0 6px; }
.grupo h3 { display: none; }
.menu .grupo { margin-bottom: 0; }
.menu .grupo.mod-on { animation: none; }
nav.menu { flex: 0 1 auto; }
.lat-acoes { padding: 4px 12px 0; border-top: 1px solid var(--linha); margin: 8px 12px 0; padding-left: 0; padding-right: 0; }
.lat-acoes:empty { display: none; }
.lat-saldo { margin-top: auto !important; }
.lat-acoes h3 { margin: 6px 0 6px; padding: 0 10px; font-size: 11.5px; font-weight: 600; color: var(--lat-sub); }
.lat-acoes .qa svg { opacity: 1; color: var(--ouro); width: 16px; height: 16px; }
.lat-saldo { margin: 10px 12px 12px; }
.lat-saldo button { width: 100%; text-align: left; border: 1px solid var(--lat-ln, #3A423E); background: var(--lat-card, #2F3532); border-radius: 10px; padding: 11px 12px; color: inherit; font: inherit; cursor: pointer; }
.lat-saldo button:hover { border-color: #57615B; }
.lat-saldo span { display: block; font-size: 11.5px; color: var(--lat-sub); }
.lat-saldo b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -.01em; color: #fff; margin: 2px 0; font-variant-numeric: tabular-nums; }
.lat-saldo b.neg { color: #F07167; }
.lat-saldo small { color: var(--lat-sub); font-size: 11px; }
.busca-geral { display: flex; align-items: center; gap: 10px; width: min(380px, 34vw); height: 38px; padding: 0 12px; border: 1px solid var(--linha); border-radius: 9px; background: var(--papel); color: var(--sub); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; flex: none; }
.busca-geral svg { width: 17px; height: 17px; flex: none; }
.busca-geral span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca-geral kbd { font-family: inherit; font-size: 10.5px; font-weight: 600; line-height: 1; border: 1px solid var(--linha); border-radius: 5px; padding: 3px 6px; color: var(--sub); }
.busca-geral:hover { border-color: #57615B; }
@media (max-width: 1200px) { .busca-geral { width: 42px; padding: 0; justify-content: center; } .busca-geral span, .busca-geral kbd { display: none; } }
@media (max-width: 960px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  aside.trilho { position: fixed; left: 0; top: 0; bottom: 0; height: auto; transform: translateX(-102%); transition: transform .2s ease; z-index: 32; padding-top: max(14px, env(safe-area-inset-top)); }
  aside.lateral { left: var(--trilho) !important; width: min(250px, calc(86vw - var(--trilho))) !important; }
  body.menu-aberto aside.trilho { transform: none; }
  .busca-geral { order: 2; }
}

/* ---------- Tema da marca (padrão): preto quente, ouro e vermelho da logo ---------- */
body.tema-escuro:not(.tema-jc) {
  --tampa: #282E2B; --tampa-2: #323936; --tampa-3: #363E3A;
  --fundo: #1F2422; --papel: #282E2B; --nevoa: #2F3532; --linha: #3A423E; --linha-2: #363E3A;
  --tinta: #E7ECE9; --sub: #A3AEA8;
  --lat-txt: #D3DBD7; --lat-sub: #8A958F; --lat-ln: #3A423E; --lat-card: #2F3532;
  --vermelho: #F07167; --vermelho-claro: rgba(240,113,103,.12);
  --verde: #4ADE80; --verde-claro: rgba(74,222,128,.10);
  --ambar: #F2B41C; --ambar-claro: rgba(242,180,28,.12);
  --azul: #7AA7FF; --azul-claro: rgba(122,167,255,.12);
  --ouro-claro: rgba(242,180,28,.10); --ouro-esc: #F2B41C;
  font-family: "Inter", "Archivo", system-ui, sans-serif; font-size: 13.5px; font-feature-settings: "tnum" 1, "cv11" 1;
  color-scheme: dark; background: var(--fundo);
}
body.tema-escuro:not(.tema-jc) header.topo h1, body.tema-escuro:not(.tema-jc) .painel-cab h2, body.tema-escuro:not(.tema-jc) .dlg-cab h2,
body.tema-escuro:not(.tema-jc) .indicador .v, body.tema-escuro:not(.tema-jc) .estoque-atual b, body.tema-escuro:not(.tema-jc) .fech-soma b { font-stretch: 100%; }
body.tema-escuro:not(.tema-jc) .indicador .v { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
body.tema-escuro:not(.tema-jc) header.topo h1 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; }
body.tema-escuro:not(.tema-jc) aside.lateral { background: var(--papel); }
body.tema-escuro:not(.tema-jc) .marca { border-bottom-color: var(--linha); }
body.tema-escuro:not(.tema-jc) .marca b { color: #fff; }
body.tema-escuro:not(.tema-jc) .item { color: var(--lat-txt); }
body.tema-escuro:not(.tema-jc) .item:hover { background: var(--nevoa); color: #fff; }
body.tema-escuro:not(.tema-jc) .item.ativo { background: var(--tampa-3); color: #fff; box-shadow: inset 2px 0 0 var(--ouro); }
body.tema-escuro:not(.tema-jc) .item.ativo::before { display: none; }
body.tema-escuro:not(.tema-jc) .item .badge { background: var(--vermelho-claro); color: var(--vermelho); }
body.tema-escuro:not(.tema-jc) .item .badge.ouro { background: var(--ambar-claro); color: var(--ouro); }
body.tema-escuro:not(.tema-jc) .rodape-lateral { border-top-color: var(--linha); }
body.tema-escuro:not(.tema-jc) header.topo { background: rgba(15,17,21,.88); border-bottom: 1px solid var(--linha); }
body.tema-escuro:not(.tema-jc) .trilha { color: #8A958F; }
body.tema-escuro:not(.tema-jc) .painel, body.tema-escuro:not(.tema-jc) .conta-card, body.tema-escuro:not(.tema-jc) .soltar, body.tema-escuro:not(.tema-jc) .login-form { background: var(--papel); border-color: var(--linha); }
body.tema-escuro:not(.tema-jc) .painel-cab { border-bottom-color: var(--linha); }
body.tema-escuro:not(.tema-jc) input, body.tema-escuro:not(.tema-jc) select, body.tema-escuro:not(.tema-jc) textarea { background: #1F2422; border-color: #4A534E; color: var(--tinta); }
body.tema-escuro:not(.tema-jc) input::placeholder, body.tema-escuro:not(.tema-jc) textarea::placeholder { color: #7A857F; }
body.tema-escuro:not(.tema-jc) input:hover:not(:focus):not([readonly]), body.tema-escuro:not(.tema-jc) select:hover:not(:focus) { border-color: #64706A; }
body.tema-escuro:not(.tema-jc) input:focus, body.tema-escuro:not(.tema-jc) select:focus, body.tema-escuro:not(.tema-jc) textarea:focus { outline: none; border-color: var(--ouro); box-shadow: 0 0 0 3px rgba(242,180,28,.18); }
body.tema-escuro:not(.tema-jc) input[readonly] { background: #2F3532; color: var(--sub); }
body.tema-escuro:not(.tema-jc) .btn-pri { background: var(--ouro); color: #1A1400; }
body.tema-escuro:not(.tema-jc) .btn-pri:hover:not(:disabled) { background: #FFC53D; }
body.tema-escuro:not(.tema-jc) .btn-ouro { background: var(--ouro); color: #1A1400; box-shadow: none; }
body.tema-escuro:not(.tema-jc) .btn-sec, body.tema-escuro:not(.tema-jc) .formas button, body.tema-escuro:not(.tema-jc) .hamburguer { background: #2F3532; border-color: #4A534E; color: var(--tinta); }
body.tema-escuro:not(.tema-jc) .btn-sec:hover:not(:disabled) { background: #363E3A; border-color: #64706A; }
body.tema-escuro:not(.tema-jc) .btn-perigo { background: transparent; border-color: rgba(240,113,103,.45); color: var(--vermelho); }
body.tema-escuro:not(.tema-jc) .btn-link { color: var(--ouro); }
body.tema-escuro:not(.tema-jc) .abas, body.tema-escuro:not(.tema-jc) .seg { background: var(--papel); border: 1px solid var(--linha); }
body.tema-escuro:not(.tema-jc) .abas button { color: var(--sub); }
body.tema-escuro:not(.tema-jc) .abas button.ativo, body.tema-escuro:not(.tema-jc) .seg input:checked + span { background: var(--tampa-3); color: #fff; box-shadow: none; }
body.tema-escuro:not(.tema-jc) th { background: var(--papel); color: #96A29B; border-bottom-color: var(--linha); }
body.tema-escuro:not(.tema-jc) td { border-bottom-color: var(--linha); }
body.tema-escuro:not(.tema-jc) tbody tr:hover { background: #2D3431; }
body.tema-escuro:not(.tema-jc) .rodape-tabela, body.tema-escuro:not(.tema-jc) .fx-tab tfoot td, body.tema-escuro:not(.tema-jc) .fx-tab tr.fx-ini td, body.tema-escuro:not(.tema-jc) .dre tr.grupo-dre td { background: var(--nevoa); border-color: var(--linha); }
body.tema-escuro:not(.tema-jc) .fx-tab tr.fx-it td { background: #232826; }
body.tema-escuro:not(.tema-jc) .fx-tab tr.fx-neg td { background: rgba(240,113,103,.07); }
body.tema-escuro:not(.tema-jc) .indicador { border-color: var(--linha); }
body.tema-escuro:not(.tema-jc) button.indicador:hover { background: var(--nevoa); }
body.tema-escuro:not(.tema-jc) .indicador .v.neg, body.tema-escuro:not(.tema-jc) .valor-pag { color: var(--vermelho); }
body.tema-escuro:not(.tema-jc) .indicador .v.pos, body.tema-escuro:not(.tema-jc) .valor-rec { color: var(--verde); }
body.tema-escuro:not(.tema-jc) .selo { background: var(--tampa-3); color: var(--sub); }
body.tema-escuro:not(.tema-jc) .selo.pago, body.tema-escuro:not(.tema-jc) .selo.ok { background: var(--verde-claro); color: var(--verde); }
body.tema-escuro:not(.tema-jc) .selo.vencido { background: var(--vermelho-claro); color: var(--vermelho); }
body.tema-escuro:not(.tema-jc) .selo.pendente, body.tema-escuro:not(.tema-jc) .selo.neutro { background: var(--tampa-3); color: var(--sub); }
body.tema-escuro:not(.tema-jc) .selo.validar, body.tema-escuro:not(.tema-jc) .selo.novo { background: var(--ambar-claro); color: var(--ouro); }
body.tema-escuro:not(.tema-jc) .selo.vinculo { background: var(--azul-claro); color: var(--azul); }
body.tema-escuro:not(.tema-jc) .aviso { background: rgba(242,180,28,.08); border-color: rgba(242,180,28,.3); color: #E8D9AE; }
body.tema-escuro:not(.tema-jc) .aviso.perigo { background: rgba(240,113,103,.08); border-color: rgba(240,113,103,.35); color: #F6C3BD; }
body.tema-escuro:not(.tema-jc) .aviso a { color: var(--ouro); }
body.tema-escuro:not(.tema-jc) dialog { background: var(--papel); color: var(--tinta); border: 1px solid var(--linha); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
body.tema-escuro:not(.tema-jc) dialog::backdrop { background: rgba(0,0,0,.6); }
body.tema-escuro:not(.tema-jc) .dlg-pe, body.tema-escuro:not(.tema-jc) .pg-pe { background: var(--nevoa); border-top-color: var(--linha); }
body.tema-escuro:not(.tema-jc) .pg-lista { background: var(--fundo); border-color: var(--linha); }
body.tema-escuro:not(.tema-jc) .tom-info .pg-ico { background: var(--tampa-3); color: var(--ouro); }
body.tema-escuro:not(.tema-jc) .parc-sug, body.tema-escuro:not(.tema-jc) .menu-pop, body.tema-escuro:not(.tema-jc) .emp-pop, body.tema-escuro:not(.tema-jc) .ini-sug { background: #2F3532; border-color: #4A534E; color: var(--tinta); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
body.tema-escuro:not(.tema-jc) .parc-sug button, body.tema-escuro:not(.tema-jc) .menu-pop button, body.tema-escuro:not(.tema-jc) .ini-sug button { color: var(--tinta); }
body.tema-escuro:not(.tema-jc) .parc-sug button:hover, body.tema-escuro:not(.tema-jc) .parc-sug button.sel, body.tema-escuro:not(.tema-jc) .menu-pop button:hover, body.tema-escuro:not(.tema-jc) .emp-pop button.atual, body.tema-escuro:not(.tema-jc) .ini-sug button.sel, body.tema-escuro:not(.tema-jc) .ini-sug button:hover { background: #3A423E; }
body.tema-escuro:not(.tema-jc) .soltar:hover, body.tema-escuro:not(.tema-jc) .soltar.sobre { background: rgba(242,180,28,.05); border-color: var(--ouro); }
body.tema-escuro:not(.tema-jc) .soltar { border-color: #57615B; }
body.tema-escuro:not(.tema-jc) .novo-prod { background: rgba(242,180,28,.06); border-color: rgba(242,180,28,.25); }
body.tema-escuro:not(.tema-jc) .tipo-escolha label { border-color: #4A534E; }
body.tema-escuro:not(.tema-jc) .tipo-escolha label:has(input:checked) { border-color: var(--ouro); background: rgba(242,180,28,.06); }
body.tema-escuro:not(.tema-jc) .estoque-atual, body.tema-escuro:not(.tema-jc) .cert-passos code { background: var(--nevoa); color: var(--tinta); }
body.tema-escuro:not(.tema-jc) .kb-col { background: #282E2B; border: 1px solid var(--linha); }
body.tema-escuro:not(.tema-jc) .kb-col.finaliza { background: #1E2A23; }
body.tema-escuro:not(.tema-jc) .kb-card { background: #323936; border-color: #3A423E; box-shadow: none; color: var(--tinta); }
body.tema-escuro:not(.tema-jc) .kb-check { background: #1F2422; border-color: #64706A; }
body.tema-escuro:not(.tema-jc) .kb-etqs span { background: color-mix(in srgb, var(--c) 18%, #282E2B); }
body.tema-escuro:not(.tema-jc) .tf-chk li:hover, body.tema-escuro:not(.tema-jc) .ea-item:hover { background: var(--nevoa); }
body.tema-escuro:not(.tema-jc) .mod-card { background: var(--papel); border-color: var(--linha); color: var(--tinta); }
body.tema-escuro:not(.tema-jc) .mod-card-ico { background: color-mix(in srgb, var(--mc) 16%, #282E2B); color: color-mix(in srgb, var(--mc) 60%, #fff); }
body.tema-escuro:not(.tema-jc) .mod-card-pend { background: var(--vermelho-claro); color: var(--vermelho); }
body.tema-escuro:not(.tema-jc) .nav-baixo { background: #151A18; border-top: 1px solid #2A322E; }
body.tema-escuro:not(.tema-jc) .vazio { color: var(--sub); }
body.tema-escuro:not(.tema-jc) .vazio b { color: var(--tinta); }
body.tema-escuro:not(.tema-jc) hr { border-color: var(--linha); }
body.tema-escuro:not(.tema-jc) .carregando { color: var(--sub); }
body.tema-escuro:not(.tema-jc) .toast { box-shadow: 0 16px 40px rgba(0,0,0,.5); }
body.tema-escuro:not(.tema-jc) ::-webkit-scrollbar { width: 10px; height: 10px; }
body.tema-escuro:not(.tema-jc) ::-webkit-scrollbar-thumb { background: #434C47; border-radius: 6px; border: 2px solid var(--fundo); }
body.tema-escuro:not(.tema-jc) ::-webkit-scrollbar-track { background: transparent; }
/* Busca geral */
dialog.busca-dlg { width: min(640px, 94vw); margin: 10vh auto auto; padding: 0; border-radius: 14px; overflow: hidden; }
.bd-campo { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linha); }
.bd-campo svg { width: 19px; height: 19px; color: var(--sub); flex: none; }
.bd-campo input { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 16px; padding: 4px 0; min-height: 0; }
.busca-dlg kbd { font-family: inherit; font-size: 10.5px; font-weight: 600; border: 1px solid var(--linha); border-radius: 5px; padding: 2px 6px; color: var(--sub); }
.bd-lista { max-height: min(60vh, 460px); overflow-y: auto; padding: 6px; }
.bd-grupo { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--sub); }
.bd-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--tinta); font: inherit; text-align: left; cursor: pointer; }
.bd-item svg { width: 17px; height: 17px; color: var(--sub); flex: none; }
.bd-item span { flex: 1; min-width: 0; }
.bd-item b { display: block; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-item small { display: block; color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-item em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-item.sel, .bd-item:hover { background: var(--nevoa); }
.bd-item.sel svg { color: var(--ouro); }
.bd-vazio { padding: 22px 12px; color: var(--sub); text-align: center; }
.bd-pe { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--linha); color: var(--sub); font-size: 12px; }
.bd-pe kbd { margin-right: 3px; }
body.tema-jc dialog.busca-dlg { background: #fff; }
/* Contas a pagar / receber: resumo, seleção em lote e painel de detalhes */
.lc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--linha); border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.lc-kpis.hide { display: none; }
.lk { text-align: left; border: 0; background: var(--papel); padding: 13px 16px; font: inherit; color: var(--tinta); cursor: pointer; }
.lk:hover { background: var(--nevoa); }
.lk span { display: block; font-size: 12px; color: var(--sub); }
.lk b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 3px 0 1px; font-variant-numeric: tabular-nums; }
.lk small { font-size: 11.5px; color: var(--sub); }
.lk.lk-venc b { color: var(--vermelho); }
.lk.lk-ok b { color: var(--verde); }
.lc-area { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
body.det-aberto .lc-area { grid-template-columns: minmax(0, 1fr) 360px; }
.lc-cb { width: 38px; padding-right: 0 !important; }
.lc-cb input { width: 16px; height: 16px; min-height: 0; accent-color: var(--ouro); cursor: pointer; }
.lc-tr { cursor: pointer; }
.lc-tr.sel td { background: rgba(242,180,28,.06); }
.lc-tr.aberto td { background: var(--nevoa); }
.lc-tr.aberto td:first-child, .lc-tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--ouro); }
.lc-dt { white-space: nowrap; font-weight: 550; }
.lc-ds { font-weight: 550; }
.lc-vl { font-weight: 600; white-space: nowrap; }
.selo.hoje, .selo.breve { background: var(--ambar-claro); color: var(--ambar); }
.selo.breve { background: var(--ambar-claro); color: var(--ambar); opacity: .85; }
.lc-lote { display: flex; align-items: center; gap: 12px; padding: 9px 14px; background: rgba(242,180,28,.08); border-bottom: 1px solid rgba(242,180,28,.3); }
.lc-lote .esp { flex: 1; }
.lc-lote span:not(.esp) { color: var(--sub); font-variant-numeric: tabular-nums; }
.lc-lote .btn svg { width: 15px; height: 15px; }
.lc-det { position: sticky; top: 90px; padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 110px); overflow-y: auto; }
.lc-det.hide { display: none; }
.ld-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ld-cab h2 { margin: 8px 0 2px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.ld-cab p { margin: 0; color: var(--sub); }
.ld-cab .btn-icone svg { width: 16px; height: 16px; }
.ld-valor { background: var(--nevoa); border: 1px solid var(--linha); border-radius: 10px; padding: 12px 14px; }
.ld-valor span { font-size: 12px; color: var(--sub); }
.ld-valor b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ld-dados { display: grid; grid-template-columns: 104px 1fr; gap: 8px 10px; margin: 0; font-size: 13px; }
.ld-dados dt { color: var(--sub); }
.ld-dados dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ld-tit { font-size: 11.5px; font-weight: 600; color: var(--sub); margin-bottom: -6px; }
.ld-parc { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.ld-p { text-align: left; border: 1px solid var(--linha); background: var(--nevoa); border-radius: 8px; padding: 7px 9px; font: inherit; color: var(--tinta); cursor: pointer; }
.ld-p b { display: block; font-size: 13px; }
.ld-p small { display: block; font-size: 11px; color: var(--sub); }
.ld-p.pago { border-color: rgba(74,222,128,.35); }
.ld-p.pago small:first-of-type { color: var(--verde); }
.ld-p.vencido { border-color: rgba(240,113,103,.45); }
.ld-p.vencido small:first-of-type { color: var(--vermelho); }
.ld-p.atual { box-shadow: 0 0 0 2px var(--ouro); }
.ld-obs { margin: 0; font-size: 12.5px; color: var(--sub); white-space: pre-line; }
.ld-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.ld-acoes .ld-principal { flex: 1; }
.ld-acoes svg { width: 16px; height: 16px; }
@media (max-width: 1200px) { body.det-aberto .lc-area { grid-template-columns: minmax(0, 1fr); } body.det-aberto .lc-det { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); max-height: none; z-index: 40; border-radius: 0; box-shadow: -20px 0 50px rgba(0,0,0,.45); } }
@media (max-width: 760px) { .lc-kpis { grid-template-columns: 1fr 1fr; } .lk b { font-size: 17px; } }
body.det-aberto .lc-tab th:nth-child(4), body.det-aberto .lc-tab td:nth-child(4) { display: none; }
body.det-aberto .lc-lista .barra .busca { min-width: 0; flex: 1 1 160px; }
.lc-tab .selo { white-space: nowrap; }
.lc-tab td .acoes-linha { flex-wrap: nowrap; }
body.det-aberto .lc-tab th:last-child, body.det-aberto .lc-tab td:last-child { display: none; }
@media (max-width: 960px) {
  aside.lateral { transform: translateX(calc(-100% - var(--trilho) - 8px)); }
  body.menu-aberto aside.lateral { transform: none; }
  .busca-geral { width: 38px; height: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 960px) {
  header.topo .titulo { flex: 1; min-width: 0; order: 1; }
  .hamburguer { order: 0; }
  .busca-geral { order: 2; }
  header.topo .acoes { order: 3; }
}
dialog:focus, dialog:focus-visible, dialog form:focus, dialog form:focus-visible, .dlg-corpo:focus-visible { outline: none; }

/* ---------- Tema corporativo claro (padrão da empresa principal) ----------
   Referência: ERPs de gestão (lateral azul-marinho, conteúdo cinza-claro, cartões brancos, azul como cor de ação). */
body.tema-claro:not(.tema-jc) {
  --tampa: #0F1E36; --tampa-2: #162A4A; --tampa-3: #1C3157;
  --fundo: #F1F4F8; --papel: #FFFFFF; --nevoa: #F7F9FC; --linha: #DFE5EE; --linha-2: #EBEFF5;
  --tinta: #172033; --sub: #5B6779;
  --pri: #1D4ED8; --pri-h: #1E40AF; --pri-claro: #EEF3FF;
  --lat-txt: #334155; --lat-sub: #7A8699; --lat-ln: #DFE5EE; --lat-card: #F7F9FC;
  --vermelho: #DC2626; --vermelho-claro: #FEECEC;
  --verde: #15803D; --verde-claro: #E3F6EA;
  --ambar: #B45309; --ambar-claro: #FEF3C7;
  --azul: #1D4ED8; --azul-claro: #E5EDFF;
  font-family: "Inter", "Archivo", system-ui, sans-serif; font-size: 13.5px; font-feature-settings: "tnum" 1, "cv11" 1;
  background: var(--fundo); color: var(--tinta);
}
body.tema-claro:not(.tema-jc) header.topo h1, body.tema-claro:not(.tema-jc) .painel-cab h2, body.tema-claro:not(.tema-jc) .dlg-cab h2,
body.tema-claro:not(.tema-jc) .indicador .v, body.tema-claro:not(.tema-jc) .estoque-atual b, body.tema-claro:not(.tema-jc) .fech-soma b { font-stretch: 100%; }
body.tema-claro:not(.tema-jc) .indicador .v { font-size: 22px; font-weight: 650; letter-spacing: -.015em; }
body.tema-claro:not(.tema-jc) header.topo h1 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; }
/* barra de módulos: azul-marinho */
body.tema-claro:not(.tema-jc) aside.trilho { background: #0F1E36; border-right-color: #0F1E36; }
body.tema-claro:not(.tema-jc) .tm { color: #8EA0BC; }
body.tema-claro:not(.tema-jc) .tm:hover { background: #162A4A; color: #fff; }
body.tema-claro:not(.tema-jc) .tm.on { background: #1C3157; color: #fff; box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-claro:not(.tema-jc) .tm.on svg { color: #fff; }
body.tema-claro:not(.tema-jc) .tm i { box-shadow: 0 0 0 2px #0F1E36; background: #F87171; }
/* menu do módulo: branco */
body.tema-claro:not(.tema-jc) aside.lateral { background: #fff; color: var(--lat-txt); border-right: 1px solid var(--linha); }
body.tema-claro:not(.tema-jc) .marca { border-bottom-color: var(--linha); }
body.tema-claro:not(.tema-jc) .marca b { color: var(--tinta); }
body.tema-claro:not(.tema-jc) .marca span { color: var(--sub); }
body.tema-claro:not(.tema-jc) .marca.pode:hover { background: var(--nevoa); }
body.tema-claro:not(.tema-jc) .item { color: #334155; }
body.tema-claro:not(.tema-jc) .item svg { opacity: .7; }
body.tema-claro:not(.tema-jc) .item:hover { background: #F1F4F8; color: var(--tinta); }
body.tema-claro:not(.tema-jc) .item.ativo { background: var(--pri-claro); color: var(--pri); font-weight: 600; box-shadow: inset 3px 0 0 var(--pri); }
body.tema-claro:not(.tema-jc) .item.ativo svg { color: var(--pri); opacity: 1; }
body.tema-claro:not(.tema-jc) .item.ativo::before { display: none; }
body.tema-claro:not(.tema-jc) .item .badge { background: #FEECEC; color: #B91C1C; }
body.tema-claro:not(.tema-jc) .item .badge.ouro { background: #FEF3C7; color: #92400E; }
body.tema-claro:not(.tema-jc) .lat-acoes .qa svg { color: var(--pri); }
body.tema-claro:not(.tema-jc) .lat-saldo b { color: var(--tinta); }
body.tema-claro:not(.tema-jc) .lat-saldo button:hover { border-color: #BFCADB; }
body.tema-claro:not(.tema-jc) .rodape-lateral { border-top-color: var(--linha); }
body.tema-claro:not(.tema-jc) .rodape-lateral .quem div { color: var(--tinta); }
body.tema-claro:not(.tema-jc) .sair { border-color: var(--linha); color: var(--sub); }
body.tema-claro:not(.tema-jc) .sair:hover { color: var(--tinta); border-color: #BFCADB; }
body.tema-claro:not(.tema-jc) .avatar { background: var(--pri); color: #fff; }
body.tema-claro:not(.tema-jc) .trilho-av { background: var(--ouro); color: #1A1400; }
/* topo e blocos */
body.tema-claro:not(.tema-jc) header.topo { background: rgba(255,255,255,.92); border-bottom: 1px solid var(--linha); }
body.tema-claro:not(.tema-jc) .trilha { color: var(--sub); }
body.tema-claro:not(.tema-jc) .painel, body.tema-claro:not(.tema-jc) .conta-card { background: #fff; border-color: var(--linha); box-shadow: 0 1px 2px rgba(15,30,54,.04); }
body.tema-claro:not(.tema-jc) .busca-geral { background: var(--nevoa); }
/* controles */
body.tema-claro:not(.tema-jc) input, body.tema-claro:not(.tema-jc) select, body.tema-claro:not(.tema-jc) textarea { background: #fff; border-color: #CBD5E1; color: var(--tinta); }
body.tema-claro:not(.tema-jc) input:hover:not(:focus):not([readonly]), body.tema-claro:not(.tema-jc) select:hover:not(:focus) { border-color: #94A3B8; }
body.tema-claro:not(.tema-jc) input:focus, body.tema-claro:not(.tema-jc) select:focus, body.tema-claro:not(.tema-jc) textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
body.tema-claro:not(.tema-jc) input[readonly] { background: var(--nevoa); color: var(--sub); }
body.tema-claro:not(.tema-jc) :focus-visible { outline-color: var(--pri); }
body.tema-claro:not(.tema-jc) .btn-pri, body.tema-claro:not(.tema-jc) .btn-ouro { background: var(--pri); color: #fff; box-shadow: none; }
body.tema-claro:not(.tema-jc) .btn-pri:hover:not(:disabled), body.tema-claro:not(.tema-jc) .btn-ouro:hover:not(:disabled) { background: var(--pri-h); }
body.tema-claro:not(.tema-jc) .btn-sec { background: #fff; border-color: #CBD5E1; color: var(--tinta); }
body.tema-claro:not(.tema-jc) .btn-sec:hover:not(:disabled) { background: var(--nevoa); border-color: #94A3B8; }
body.tema-claro:not(.tema-jc) .btn-link { color: var(--pri); }
body.tema-claro:not(.tema-jc) .abas, body.tema-claro:not(.tema-jc) .seg { background: #EEF2F7; border: 0; }
body.tema-claro:not(.tema-jc) .abas button { color: var(--sub); }
body.tema-claro:not(.tema-jc) .abas button.ativo, body.tema-claro:not(.tema-jc) .seg input:checked + span { background: #fff; color: var(--tinta); box-shadow: 0 1px 2px rgba(15,30,54,.12); }
/* tabelas */
body.tema-claro:not(.tema-jc) th { background: var(--nevoa); color: #64748B; border-bottom-color: var(--linha); }
body.tema-claro:not(.tema-jc) td { border-bottom-color: var(--linha-2); }
body.tema-claro:not(.tema-jc) tbody tr:hover { background: #F8FAFD; }
body.tema-claro:not(.tema-jc) .rodape-tabela { background: var(--nevoa); }
body.tema-claro:not(.tema-jc) .valor-pag { color: var(--vermelho); }
body.tema-claro:not(.tema-jc) .valor-rec { color: var(--verde); }
body.tema-claro:not(.tema-jc) .indicador .v.neg { color: var(--vermelho); }
body.tema-claro:not(.tema-jc) .indicador .v.pos { color: var(--verde); }
/* selos */
body.tema-claro:not(.tema-jc) .selo { background: #EEF2F7; color: #475569; }
body.tema-claro:not(.tema-jc) .selo.pago, body.tema-claro:not(.tema-jc) .selo.ok { background: var(--verde-claro); color: var(--verde); }
body.tema-claro:not(.tema-jc) .selo.vencido { background: var(--vermelho-claro); color: #B91C1C; }
body.tema-claro:not(.tema-jc) .selo.hoje, body.tema-claro:not(.tema-jc) .selo.breve, body.tema-claro:not(.tema-jc) .selo.validar, body.tema-claro:not(.tema-jc) .selo.novo { background: var(--ambar-claro); color: #92400E; }
body.tema-claro:not(.tema-jc) .selo.vinculo { background: var(--azul-claro); color: var(--azul); }
/* contas: seleção e detalhe em azul */
body.tema-claro:not(.tema-jc) .lc-cb input { accent-color: var(--pri); }
body.tema-claro:not(.tema-jc) .lc-tr.sel td { background: #F3F7FF; }
body.tema-claro:not(.tema-jc) .lc-tr.aberto td { background: #EEF3FF; }
body.tema-claro:not(.tema-jc) .lc-tr.aberto td:first-child, body.tema-claro:not(.tema-jc) .lc-tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--pri); }
body.tema-claro:not(.tema-jc) .lc-lote { background: #EEF3FF; border-bottom-color: #C7D6FB; }
body.tema-claro:not(.tema-jc) .ld-p.atual { box-shadow: 0 0 0 2px var(--pri); }
body.tema-claro:not(.tema-jc) .lk.lk-venc b { color: var(--vermelho); }
body.tema-claro:not(.tema-jc) .bd-item.sel svg { color: var(--pri); }
/* módulos da tela inicial */
body.tema-claro:not(.tema-jc) .mod-card { background: #fff; }
body.tema-claro:not(.tema-jc) .mod-card:hover { border-color: #BFCADB; box-shadow: 0 10px 24px -14px rgba(15,30,54,.35); }
body.tema-claro:not(.tema-jc) .nav-baixo { background: #0F1E36; }
body.tema-claro:not(.tema-jc) dialog { box-shadow: 0 24px 60px rgba(15,30,54,.28); }
body.tema-claro:not(.tema-jc) dialog::backdrop { background: rgba(15,30,54,.45); }
/* botão de tema */
.btn-tema { border: 1px solid var(--linha); background: transparent; color: var(--sub); border-radius: 7px; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; flex: none; }
.btn-tema svg { width: 16px; height: 16px; }
.btn-tema:hover { color: var(--tinta); }
body.tema-claro:not(.tema-jc) .kb-col { background: #EAEEF4; }
body.tema-claro:not(.tema-jc) .kb-col.finaliza { background: #E6F2EA; }
body.tema-claro:not(.tema-jc) .kb-card { box-shadow: 0 1px 2px rgba(15,30,54,.08); }

/* Tema da marca: o vermelho fica só para informação negativa (saídas, vencidas, saldo negativo); a interface usa preto e ouro */
body.tema-escuro:not(.tema-jc) .tm.on { box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-escuro:not(.tema-jc) .item.ativo { box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-escuro:not(.tema-jc) .trilho-av { background: var(--ouro); color: #1A1400; }
body.tema-escuro:not(.tema-jc) aside.trilho { background: #151A18; border-right-color: #2A322E; }
body.tema-escuro:not(.tema-jc) .marca b { color: #F2B41C; }
body.tema-escuro:not(.tema-jc) header.topo h1 { color: #E7ECE9; }
body.tema-escuro:not(.tema-jc) .lc-tr.aberto td:first-child, body.tema-escuro:not(.tema-jc) .lc-tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-escuro:not(.tema-jc) .tm i { background: #F2B41C; box-shadow: 0 0 0 2px #151A18; }
body.tema-escuro:not(.tema-jc) .item .badge { background: rgba(242,180,28,.14); color: #F2B41C; }
body.tema-escuro:not(.tema-jc) .mod-card-pend { background: rgba(242,180,28,.14); color: #F2B41C; }
body.tema-escuro:not(.tema-jc) .mod-card { --mc: #F2B41C !important; }
body.tema-escuro:not(.tema-jc) .mod-card-ico { background: rgba(242,180,28,.10); color: #F2B41C; }

/* ---------- Tema verde (padrão): verde-garrafa da lateral + conteúdo claro acinzentado + ouro ---------- */
body.tema-verdeclaro:not(.tema-jc) { font-family: "Inter", "Archivo", system-ui, sans-serif; font-size: 13.5px; font-feature-settings: "tnum" 1, "cv11" 1; --verde-claro: #E3F3EB; --ambar-claro: #FFF1D6; }
.tv aside.trilho, body.tema-verdeclaro:not(.tema-jc) aside.trilho { background: #0A1611; border-right-color: #0A1611; }
body.tema-verdeclaro:not(.tema-jc) .tm { color: #7F978C; }
body.tema-verdeclaro:not(.tema-jc) .tm:hover { background: #142A21; color: #fff; }
body.tema-verdeclaro:not(.tema-jc) .tm.on { background: #1C3129; color: #fff; box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-verdeclaro:not(.tema-jc) .tm.on svg { color: var(--ouro); }
body.tema-verdeclaro:not(.tema-jc) .tm i { background: var(--ouro); box-shadow: 0 0 0 2px #0A1611; }
body.tema-verdeclaro:not(.tema-jc) aside.lateral { border-right: 0; }
body.tema-verdeclaro:not(.tema-jc) .marca { border-bottom-color: rgba(255,255,255,.07); }
body.tema-verdeclaro:not(.tema-jc) .item.ativo { background: rgba(242,180,28,.12); color: #fff; box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-verdeclaro:not(.tema-jc) .item.ativo::before { display: none; }
body.tema-verdeclaro:not(.tema-jc) .item .badge { background: var(--ouro); color: #1A1400; }
body.tema-verdeclaro:not(.tema-jc) .lat-acoes { border-top-color: rgba(255,255,255,.07); }
body.tema-verdeclaro:not(.tema-jc) .lat-saldo button { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.09); }
body.tema-verdeclaro:not(.tema-jc) .lat-saldo button:hover { border-color: rgba(255,255,255,.2); }
body.tema-verdeclaro:not(.tema-jc) .btn-tema { border-color: rgba(255,255,255,.1); color: #B3C5BC; }
body.tema-verdeclaro:not(.tema-jc) .trilho-av { background: var(--ouro); color: #1A1400; }
body.tema-verdeclaro:not(.tema-jc) .busca-geral { background: #fff; border-color: #CFD8D4; }
body.tema-verdeclaro:not(.tema-jc) header.topo { border-bottom: 1px solid var(--linha); }
body.tema-verdeclaro:not(.tema-jc) .lc-cb input { accent-color: var(--tampa); }
body.tema-verdeclaro:not(.tema-jc) .lc-tr.sel td { background: #FFF9E6; }
body.tema-verdeclaro:not(.tema-jc) .lc-tr.aberto td { background: #F1F6F3; }
body.tema-verdeclaro:not(.tema-jc) .lc-tr.aberto td:first-child, body.tema-verdeclaro:not(.tema-jc) .lc-tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-verdeclaro:not(.tema-jc) .lc-lote { background: #FFF6DC; border-bottom-color: #F0D898; }
body.tema-verdeclaro:not(.tema-jc) .lk { background: #fff; }
body.tema-verdeclaro:not(.tema-jc) .lk:hover { background: var(--nevoa); }
body.tema-verdeclaro:not(.tema-jc) .selo.hoje, body.tema-verdeclaro:not(.tema-jc) .selo.breve { background: #FFF1D6; color: #8A5300; }
body.tema-verdeclaro:not(.tema-jc) .ld-p.atual { box-shadow: 0 0 0 2px var(--ouro); }
body.tema-verdeclaro:not(.tema-jc) .mod-card-pend { background: #FFF1D6; color: #8A5300; }

/* Padrão: menu verde-garrafa + conteúdo grafite esverdeado escuro */
body.tema-escuro:not(.tema-jc) aside.trilho { background: #0A1611; border-right-color: #0A1611; }
body.tema-escuro:not(.tema-jc) .tm { color: #7F978C; }
body.tema-escuro:not(.tema-jc) .tm:hover { background: #142A21; color: #fff; }
body.tema-escuro:not(.tema-jc) .tm.on { background: #1C3129; color: #fff; }
body.tema-escuro:not(.tema-jc) .tm i { box-shadow: 0 0 0 2px #0A1611; }
body.tema-escuro:not(.tema-jc) aside.lateral { background: linear-gradient(180deg, #10201A 0%, #0C1A15 100%); border-right: 0; --lat-txt: #C3D3CB; --lat-sub: #87A096; }
body.tema-escuro:not(.tema-jc) .marca { border-bottom-color: rgba(255,255,255,.07); }
body.tema-escuro:not(.tema-jc) .item { color: #C3D3CB; }
body.tema-escuro:not(.tema-jc) .item:hover { background: rgba(255,255,255,.05); color: #fff; }
body.tema-escuro:not(.tema-jc) .item.ativo { background: rgba(242,180,28,.12); color: #fff; }
body.tema-escuro:not(.tema-jc) .lat-acoes { border-top-color: rgba(255,255,255,.07); }
body.tema-escuro:not(.tema-jc) .lat-saldo button { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.09); }
body.tema-escuro:not(.tema-jc) .rodape-lateral { border-top-color: rgba(255,255,255,.07); }
body.tema-escuro:not(.tema-jc) .marca b { color: #fff; }

/* ======================================================================
   Visual padrão "Garrafa": moldura verde-garrafa (barra, menu e fundo) e o conteúdo
   numa folha clara e quente encaixada na moldura, com ouro nas ações.
   ====================================================================== */
body.tema-folha:not(.tema-jc) {
  --fundo: #ECE9E2; --papel: #FAF8F4; --nevoa: #F3F0EA; --linha: #DCD6CB; --linha-2: #E7E2D8;
  --tinta: #1C231F; --sub: #626B66; --moldura: #0F241C;
  background: var(--moldura);
}
body.tema-folha:not(.tema-jc) aside.trilho { background: #0A1A14; border-right: 0; }
body.tema-folha:not(.tema-jc) aside.lateral { background: var(--moldura); border-right: 0; }
body.tema-folha:not(.tema-jc) .conteudo { background: var(--fundo); margin: 10px 10px 10px 0; border-radius: 18px; min-height: calc(100vh - 20px); box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 20px 50px -20px rgba(0,0,0,.6); overflow: clip; }
body.tema-folha:not(.tema-jc) header.topo { top: 0; background: rgba(236,233,226,.9); border-bottom: 1px solid var(--linha); }
body.tema-folha:not(.tema-jc) .painel, body.tema-folha:not(.tema-jc) .conta-card, body.tema-folha:not(.tema-jc) .lk, body.tema-folha:not(.tema-jc) .mod-card { background: var(--papel); border-color: var(--linha); }
body.tema-folha:not(.tema-jc) .painel { box-shadow: 0 1px 2px rgba(28,35,31,.05); }
body.tema-folha:not(.tema-jc) .lc-kpis { background: var(--linha); border-color: var(--linha); }
body.tema-folha:not(.tema-jc) .lk:hover { background: var(--nevoa); }
body.tema-folha:not(.tema-jc) th, body.tema-folha:not(.tema-jc) .rodape-tabela { background: var(--nevoa); }
body.tema-folha:not(.tema-jc) td { border-bottom-color: var(--linha-2); }
body.tema-folha:not(.tema-jc) tbody tr:hover { background: #F6F3ED; }
body.tema-folha:not(.tema-jc) input, body.tema-folha:not(.tema-jc) select, body.tema-folha:not(.tema-jc) textarea, body.tema-folha:not(.tema-jc) .busca-geral { background: #FFFDF9; border-color: #D2CBBE; }
body.tema-folha:not(.tema-jc) .btn-sec { background: #FFFDF9; border-color: #D2CBBE; }
body.tema-folha:not(.tema-jc) .btn-sec:hover:not(:disabled) { background: var(--nevoa); }
body.tema-folha:not(.tema-jc) .btn-pri { background: #14372A; color: #fff; }
body.tema-folha:not(.tema-jc) .btn-pri:hover:not(:disabled) { background: #1C4A39; }
body.tema-folha:not(.tema-jc) .abas, body.tema-folha:not(.tema-jc) .seg { background: #E4E0D7; }
body.tema-folha:not(.tema-jc) .abas button.ativo, body.tema-folha:not(.tema-jc) .seg input:checked + span { background: var(--papel); }
body.tema-folha:not(.tema-jc) dialog { background: var(--papel); }
body.tema-folha:not(.tema-jc) .dlg-pe, body.tema-folha:not(.tema-jc) .pg-pe { background: var(--nevoa); }
body.tema-folha:not(.tema-jc) .ld-valor, body.tema-folha:not(.tema-jc) .ld-p { background: var(--nevoa); border-color: var(--linha); }
body.tema-folha:not(.tema-jc) .lc-tr.aberto td { background: #EFEBE2; }
body.tema-folha:not(.tema-jc) .lc-tr.sel td { background: #FBF3DD; }
body.tema-folha:not(.tema-jc) .lc-lote { background: #FBF0D2; border-bottom-color: #EAD6A0; }
body.tema-folha:not(.tema-jc) .kb-col { background: #E4E0D7; }
body.tema-folha:not(.tema-jc) .kb-card { background: var(--papel); }
body.tema-folha:not(.tema-jc) .aviso { background: #FBF3DD; border-color: #EAD6A0; }
body.tema-folha:not(.tema-jc) .indicador { border-color: var(--linha); }
body.tema-folha:not(.tema-jc) button.indicador:hover { background: var(--nevoa); }
@media (max-width: 960px) {
  body.tema-folha:not(.tema-jc) .conteudo { margin: 0; border-radius: 0; min-height: 100vh; box-shadow: none; }
  body.tema-folha:not(.tema-jc) { background: var(--fundo); }
}
body.tema-folha:not(.tema-jc) .btn-link { color: #7A5600; }
.trilho-ini { width: 38px; height: 38px; margin-bottom: 12px; border-radius: 10px; display: grid; place-items: center; background: var(--ouro); color: #1A1400; font-weight: 800; font-size: 14px; }
.trilho-ini.hide, .trilho-logo.hide { display: none; }
body.tema-jc aside.trilho { background: #0B0B0B; border-right-color: #0B0B0B; }
body.tema-jc .trilho-logo { width: 44px; height: 44px; object-fit: contain; }
body.tema-jc .tm { color: #8C857B; }
body.tema-jc .tm:hover { background: #1B1A19; color: #ECE7E0; }
body.tema-jc .tm.on { background: #2C2A28; color: #fff; box-shadow: inset 3px 0 0 var(--ouro); }
body.tema-jc .tm.on svg { color: var(--ouro); }
body.tema-jc .trilho-av { background: var(--ouro); color: #0B0B0B; }
body.tema-jc .busca-geral { background: #fff; }
.lat-saldo.hide + .rodape-lateral { margin-top: auto; }
body.tema-jc .lat-acoes { border-top-color: rgba(255,255,255,.08); }
/* Espaço do banco */
.uso-item { margin-bottom: 16px; }
.uso-cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.uso-cab span { font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.uso-barra { height: 10px; border-radius: 6px; background: var(--nevoa); border: 1px solid var(--linha); overflow: hidden; }
.uso-barra i { display: block; height: 100%; background: var(--verde); border-radius: 6px; }
.uso-barra i.medio { background: var(--ouro); }
.uso-barra i.alto { background: var(--vermelho); }
.uso-item small { display: block; margin-top: 4px; font-size: 12px; }
.uso-tit { font-size: 12px; font-weight: 600; color: var(--sub); margin: 4px 0 6px; }
.uso-tab { width: 100%; font-size: 13px; }
.uso-tab td { padding: 6px 4px; }

/* ===== Celular: ajustes de corte ===== */
@media (max-width: 960px) {
  main { padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important; }
  /* botões do topo quebram em linhas em vez de sumirem para o lado */
  header.topo .acoes { flex-wrap: wrap; overflow-x: visible; margin: 0; padding: 0; width: 100%; gap: 8px; }
  header.topo .acoes > * { flex: 1 1 calc(50% - 4px); min-width: 0; }
  header.topo .acoes .btn { justify-content: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  header.topo .acoes > input, header.topo .acoes > select, header.topo .acoes > .busca { flex-basis: 100%; }
  /* abas numa linha só, rolando de lado */
  .abas { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .abas::-webkit-scrollbar { display: none; }
  .abas button { flex: 0 0 auto; white-space: nowrap; }
  /* cabeçalho dos painéis: subtítulo desce para baixo do título */
  .painel-cab { flex-wrap: wrap; row-gap: 4px; }
  .painel-cab h2 { flex: 1 1 auto; min-width: 0; }
  .painel-cab > .sub { flex-basis: 100%; order: 3; }
  /* quadro de tarefas: uma coluna por vez */
  .kb-quadro { margin: 0 -16px; padding: 0 16px 14px; scroll-padding: 0 16px; min-height: 0; }
  .kb-col { flex: 0 0 86vw; max-width: 86vw; }
  /* mês vazio não mostra "-------" */
  /* tabelinhas da configuração */
  .uso-tab td:first-child { word-break: break-word; }
  .uso-tab td:not(:first-child) { white-space: nowrap; text-align: right; }
  .rolagem { -webkit-overflow-scrolling: touch; }
}
@media (max-width: 640px) {
  /* cartão de conta: caixinha ao lado do título */
  .lc-tab tr { position: relative; }
  .lc-tab td.lc-cb { position: absolute; top: 12px; right: 14px; }
  .lc-tab td.lc-cb::before { content: none !important; }
  .lc-tab td.titulo-cartao { padding-right: 34px !important; }
}
input[type="month"]:invalid:not(:focus)::-webkit-datetime-edit { color: transparent; }
