/* Comevap PCP - tema claro/escuro, responsivo (desktop e celular) */
:root {
    --bg: #f3f5f8; --bg2: #ffffff; --bg3: #eef1f5; --borda: #d9dee6; --texto: #1d2733; --texto2: #5b6878;
    --accent: #0a6ed1; --accent2: #e8f1fb; --ok: #188038; --aviso: #c26400; --erro: #c5221f; --info: #0a6ed1;
    --ok-bg: #e6f4ea; --aviso-bg: #fef3e2; --erro-bg: #fce8e6; --info-bg: #e8f1fb;
    --barra: #0a6ed1; --barra2: #5aa9e6; --sombra: 0 1px 3px rgba(20, 30, 45, .08), 0 1px 2px rgba(20, 30, 45, .05);
    --menu-w: 250px; --topo-h: 52px; --raio: 8px;
    color-scheme: light;
}
[data-tema="escuro"] {
    --bg: #12171e; --bg2: #1b222c; --bg3: #232c38; --borda: #313c4a; --texto: #e3e8ef; --texto2: #9aa7b8;
    --accent: #4ea1f3; --accent2: #1d3550; --ok: #5bc27a; --aviso: #f0a24b; --erro: #f28b82; --info: #4ea1f3;
    --ok-bg: #1d3526; --aviso-bg: #3a2c19; --erro-bg: #3d1f1d; --info-bg: #1d3550;
    --barra: #4ea1f3; --barra2: #2f6ea8; --sombra: 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--texto); }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0; font-weight: 600; }
h2 { font-size: 1rem; margin: 0; font-weight: 600; }
h3 { font-size: .92rem; margin: 0 0 .4rem; font-weight: 600; }
.muted { color: var(--texto2); }
.pequeno { font-size: .82rem; }
.r { text-align: right; }
.c { text-align: center; }
.nowrap { white-space: nowrap; }
.forte { font-weight: 600; }

/* ---------------------------------------------------------------- estrutura */
header.shell {
    position: fixed; inset: 0 0 auto 0; height: var(--topo-h); z-index: 30; display: flex; align-items: center; gap: .6rem;
    padding: 0 .9rem; background: var(--bg2); border-bottom: 1px solid var(--borda); box-shadow: var(--sombra);
}
.marca { display: flex; align-items: center; gap: .55rem; color: var(--texto); font-weight: 600; white-space: nowrap; overflow: hidden; }
.marca .logo { width: 32px; height: 32px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.marca .sub { color: var(--texto2); font-weight: 400; }
.espaco { flex: 1; }
.btn-icone { position: relative; border: 0; background: transparent; color: var(--texto); font-size: 1.15rem; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.btn-icone:hover { background: var(--bg3); }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--erro); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; }

.app { padding-top: var(--topo-h); display: grid; grid-template-columns: var(--menu-w) 1fr; min-height: 100vh; }
/* tela simples (perfil Recebimento): sem menu lateral, conteúdo centralizado */
.app.simples { grid-template-columns: 1fr; }
.app.simples .pagina { max-width: 1100px; width: 100%; margin: 0 auto; }
.barra-simples { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.barra-simples h1 { font-size: 1.2rem; margin: 0; }
.decl-num { font-variant-numeric: tabular-nums; color: var(--accent); margin-right: .25rem; }
/* registrar saída (Expedição) */
.saida-grade { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .saida-grade { grid-template-columns: 1fr; } }
.saida-campo { font-size: 1.3rem; padding: .55rem .7rem; width: 100%; }
.saida-botao { width: 100%; font-size: 1.15rem; padding: .8rem; margin-top: .4rem; }
.saida-ok { text-align: center; }
.saida-ok-icone { font-size: 2.6rem; color: var(--ok); }
.saida-cancelada td { text-decoration: line-through; opacity: .6; }
.saida-cancelada td:last-child { text-decoration: none; opacity: 1; }
nav.menu {
    position: sticky; top: var(--topo-h); height: calc(100vh - var(--topo-h)); overflow-y: auto; background: var(--bg2);
    border-right: 1px solid var(--borda); padding: .6rem .5rem 2rem;
}
nav.menu .grupo { margin: 1rem .6rem .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto2); font-weight: 600; }
nav.menu a { display: flex; align-items: center; gap: .55rem; padding: .42rem .6rem; border-radius: 6px; color: var(--texto); }
nav.menu a:hover { background: var(--bg3); }
nav.menu a.active { background: var(--accent2); color: var(--accent); font-weight: 600; }
nav.menu .ic { width: 1.2rem; text-align: center; opacity: .85; }
.menu-fundo { display: none; }
main.conteudo { min-width: 0; }
.so-mobile { display: none; }

.pagina { padding: 1rem 1.25rem 3rem; display: flex; flex-direction: column; gap: 1rem; max-width: 1500px; }
.cab-pagina { padding: 1rem 1.25rem 0; display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.cab-pagina .textos { flex: 1; min-width: 240px; }
.cab-pagina .trilha { font-size: .78rem; color: var(--texto2); }
.cab-pagina .descricao { color: var(--texto2); margin-top: .2rem; max-width: 900px; }
.cab-pagina .acoes { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- cartoes e grades */
.card { background: var(--bg2); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); min-width: 0; }
.card-cab { padding: .7rem 1rem; border-bottom: 1px solid var(--borda); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-cab h2 { flex: 1; }
.card-corpo { padding: 1rem; }
.grade { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.grade-2 { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--bg2); border: 1px solid var(--borda); border-radius: var(--raio); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--sombra); color: var(--texto); }
a.tile:hover { border-color: var(--accent); }
.tile .t-titulo { font-size: .8rem; color: var(--texto2); font-weight: 600; }
.tile .t-valor { font-size: 1.55rem; font-weight: 600; line-height: 1.2; }
.tile .t-sub { font-size: .78rem; color: var(--texto2); }
.tile.ok .t-valor { color: var(--ok); } .tile.aviso .t-valor { color: var(--aviso); } .tile.erro .t-valor { color: var(--erro); }

/* ---------------------------------------------------------------- formularios */
.filtros { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; }
.form { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.form .largo { grid-column: 1 / -1; }
.campo { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.campo label { font-size: .78rem; color: var(--texto2); font-weight: 600; }
.campo .ajuda { font-size: .74rem; color: var(--texto2); }
input, select, textarea {
    font: inherit; color: var(--texto); background: var(--bg2); border: 1px solid var(--borda); border-radius: 6px;
    padding: .42rem .55rem; min-height: 34px; width: 100%; min-width: 0;
}
input[type=checkbox] { width: auto; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent2); border-color: var(--accent); }
.filtros .campo input, .filtros .campo select { width: auto; min-width: 150px; }
.check { display: flex; gap: .45rem; align-items: center; font-size: .9rem; }
input.num { text-align: right; max-width: 120px; }
.tabela input, .tabela select { min-height: 30px; padding: .25rem .4rem; }
/* célula alterada e ainda não gravada (ex.: lançamento de caixas) */
.tabela input.alterado { border-color: var(--aviso); box-shadow: 0 0 0 2px color-mix(in srgb, var(--aviso) 35%, transparent); }

.btn {
    font: inherit; font-weight: 600; border: 1px solid var(--borda); background: var(--bg2); color: var(--accent);
    border-radius: 6px; padding: .42rem .9rem; min-height: 34px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem;
}
.btn:hover { background: var(--bg3); }
.btn.primario { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primario:hover { filter: brightness(1.08); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.perigo { color: var(--erro); }
.btn.peq { padding: .2rem .55rem; min-height: 28px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.arquivo { border: 2px dashed var(--borda); border-radius: var(--raio); padding: 1rem; text-align: center; background: var(--bg3); }
.arquivo input[type=file] { border: 0; background: transparent; }
.arquivo-pronto { display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap; }
.embutida { display: flex; flex-direction: column; gap: 1rem; }
/* tela Importações: área de soltar o arquivo (o campo de arquivo cobre a área inteira, invisível) */
.soltar { position: relative; border: 2px dashed var(--borda); border-radius: var(--raio); background: var(--bg3); padding: 2rem 1rem; text-align: center; transition: border-color .15s, background .15s; }
.soltar:hover, .soltar:focus-within { border-color: var(--accent); }
.soltar input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.soltar-icone { font-size: 2rem; line-height: 1; }
.tipos-importacao { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------------------------------------------------------------- tabelas */
.tabela-wrap { overflow: auto; }
table.tabela { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tabela th { position: sticky; top: 0; background: var(--bg3); color: var(--texto2); font-weight: 600; font-size: .78rem; text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--borda); white-space: nowrap; z-index: 1; }
.tabela td { padding: .42rem .6rem; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tabela th.r, .tabela td.r { text-align: right; }
.tabela tbody tr:hover { background: var(--bg3); }
.tabela tr.sel { background: var(--accent2); }
.tabela tr.inativo td { color: var(--texto2); }
.tabela tfoot td { font-weight: 700; background: var(--bg3); }
.tabela tr.grupo-inicio td { border-top: 2px solid var(--borda); }
.vazio { text-align: center; color: var(--texto2); padding: 1.5rem; }

.etiqueta { display: inline-block; padding: .08rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--bg3); color: var(--texto2); white-space: nowrap; }
.etiqueta.ok { background: var(--ok-bg); color: var(--ok); }
.etiqueta.aviso { background: var(--aviso-bg); color: var(--aviso); }
.etiqueta.erro { background: var(--erro-bg); color: var(--erro); }
.etiqueta.info { background: var(--info-bg); color: var(--info); }

.alerta { border-radius: 6px; padding: .55rem .8rem; border-left: 4px solid var(--info); background: var(--info-bg); font-size: .88rem; }
.alerta.aviso { border-color: var(--aviso); background: var(--aviso-bg); }
.alerta.erro { border-color: var(--erro); background: var(--erro-bg); }
.alerta.ok { border-color: var(--ok); background: var(--ok-bg); }
.lista-alertas { display: flex; flex-direction: column; gap: .4rem; }

/* ---------------------------------------------------------------- graficos */
.barras { display: flex; flex-direction: column; gap: .45rem; }
.barras .linha { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: .6rem; align-items: center; font-size: .84rem; }
.barras .rot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barras .trilho { background: var(--bg3); border-radius: 4px; height: 14px; overflow: hidden; }
.barras .b { height: 100%; background: var(--barra); border-radius: 0 4px 4px 0; min-width: 2px; }
.barras .val { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--texto2); }
svg.colunas { width: 100%; height: auto; display: block; }
svg.colunas .col { fill: var(--barra); }
svg.colunas .col:hover { fill: var(--barra2); }
svg.colunas .linha2 { fill: none; stroke: var(--aviso); stroke-width: 2; }
svg.colunas .ponto2 { fill: var(--aviso); }
svg.colunas text { fill: var(--texto2); font-size: 10px; }
svg.colunas .grade-linha { stroke: var(--borda); stroke-width: 1; }
.legenda { display: flex; gap: 1rem; font-size: .78rem; color: var(--texto2); margin-top: .4rem; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }

/* ---------------------------------------------------------------- modal, toasts, carregando */
.modal-fundo { position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 50; display: grid; place-items: center; padding: 1rem; }
.modal { background: var(--bg2); border-radius: 10px; width: min(820px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.modal.largo { width: min(1150px, 100%); }
.modal .m-cab { padding: .8rem 1rem; border-bottom: 1px solid var(--borda); display: flex; align-items: center; }
.modal .m-cab h2 { flex: 1; }
.modal .m-corpo { padding: 1rem; overflow: auto; }
.modal .m-rodape { padding: .7rem 1rem; border-top: 1px solid var(--borda); display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast { padding: .7rem 1rem; border-radius: 8px; background: var(--texto); color: var(--bg2); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-size: .9rem; cursor: pointer; }
.toast.ok { background: var(--ok); color: #fff; } .toast.erro { background: var(--erro); color: #fff; } .toast.aviso { background: var(--aviso); color: #fff; }
.carregando { display: flex; gap: .6rem; align-items: center; justify-content: center; padding: 2rem; color: var(--texto2); }
.carregando::before { content: ""; width: 18px; height: 18px; border: 3px solid var(--borda); border-top-color: var(--accent); border-radius: 50%; animation: gira 0.8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.notif { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--borda); }
.notif:last-child { border-bottom: 0; }
.notif .ic { font-size: 1.1rem; width: 1.6rem; text-align: center; }
.notif.lida { opacity: .6; }
.notif .corpo { flex: 1; min-width: 0; }
.notif .titulo { font-weight: 600; }
.lote-cab { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- celular */
@media (max-width: 1000px) {
    .grade-2, .grade-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
    .app { grid-template-columns: 1fr; }
    .so-mobile { display: inline-block; }
    .marca .sub { display: none; }
    nav.menu { position: fixed; left: 0; top: var(--topo-h); bottom: 0; width: min(290px, 85vw); z-index: 40; transform: translateX(-100%); transition: transform .2s; height: auto; }
    .menu-aberto nav.menu { transform: none; box-shadow: 0 0 30px rgba(0, 0, 0, .3); }
    .menu-aberto .menu-fundo { display: block; position: fixed; inset: var(--topo-h) 0 0 0; background: rgba(0, 0, 0, .35); z-index: 35; }
    .pagina { padding: .8rem .7rem 3rem; }
    .cab-pagina { padding: .8rem .7rem 0; }
    .grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile .t-valor { font-size: 1.25rem; }
    .filtros .campo, .filtros .campo input, .filtros .campo select { width: 100%; }
    .filtros .campo { flex: 1 1 140px; }
    .barras .linha { grid-template-columns: minmax(80px, 42%) 1fr; }
    .barras .val { grid-column: 2; font-size: .76rem; }
    .esconder-mobile { display: none; }
}
.so-impressao, .aviso-impressao { display: none; }
@page { size: A4 landscape; margin: 10mm; }
@media print {
    header.shell, nav.menu, .menu-fundo, .acoes, .toasts, .filtros button, .filtros .btn { display: none !important; }
    .app { display: block; padding: 0; }
    html, body, .conteudo { background: #fff !important; height: auto !important; overflow: visible !important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .so-impressao { display: block; margin-top: .3rem; }
    .pagina { max-width: none; padding: .5rem 0 0; }
    /* tabelas com rolagem: no papel saem inteiras */
    .tabela-wrap { max-height: none !important; overflow: visible !important; }
    .tile, .grade > *, .grafico-barras, svg { break-inside: avoid; }
    .card-cab { break-after: avoid; }
    /* Diretoria: a exportação/impressão não está disponível */
    .sem-impressao .conteudo { display: none !important; }
    .sem-impressao .aviso-impressao { display: block; padding: 2rem; font: 16px sans-serif; }
}

/* ---- ressuprimento (cores do RESUMO) e lembrete de chegada */
.tabela.ressup tr.st-vermelho td:first-child { box-shadow: inset 4px 0 0 var(--erro); }
.tabela.ressup tr.st-amarelo td:first-child { box-shadow: inset 4px 0 0 var(--aviso); }
.tabela.ressup tr.st-verde td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.tabela.ressup tr.st-vermelho { background: color-mix(in srgb, var(--erro-bg) 55%, transparent); }
.tabela.ressup tr.st-amarelo { background: color-mix(in srgb, var(--aviso-bg) 55%, transparent); }
.grade-rank { display: grid; gap: 1rem; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.chegadas { display: flex; flex-direction: column; gap: .6rem; }
.chegada { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; padding: .7rem .8rem;
           border: 1px solid var(--borda); border-left: 4px solid var(--info); border-radius: 8px; background: var(--bg2); }
.chegada.atrasada { border-left-color: var(--erro); }
.chegada .c-info { flex: 1 1 260px; min-width: 0; }
.chegada .c-titulo { font-size: 1rem; margin-bottom: .15rem; }
.chegada .c-botoes { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.chegada .c-botoes .btn:not(.peq) { min-width: 84px; }
.chegada .c-botoes input[type=date] { width: auto; }
/* ---- login */
.login-fundo { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra); padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.login-card h2 { margin: .6rem 0 .2rem; font-size: 1.15rem; }
.login-card form { display: flex; flex-direction: column; gap: .7rem; }
.login-card .campo { display: flex; flex-direction: column; gap: .25rem; }
.login-card .campo input { width: 100%; }
.login-marca { display: flex; gap: .7rem; align-items: center; }
.login-marca .logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; }
.login-rodape { margin-top: .6rem; color: var(--texto2); border-top: 1px solid var(--borda); padding-top: .6rem; word-break: break-all; }
.btn.largo { width: 100%; justify-content: center; }

/* ---- cabeçalho: tema e usuário */
.tema-escolha { width: auto; min-height: 32px; padding: .2rem .4rem; font-size: .82rem; border-radius: 6px; background: var(--bg2); color: var(--texto); border: 1px solid var(--borda); }
.usuario-menu { position: relative; }
.usuario-btn { width: auto; border-radius: 999px; display: flex; gap: .4rem; align-items: center; padding: 0 .5rem 0 .2rem; font-size: .9rem; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent2); color: var(--accent); font-weight: 700; font-size: .78rem; }
.usuario-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px; background: var(--bg2); border: 1px solid var(--borda); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: .7rem; display: flex; flex-direction: column; gap: .5rem; }
.usuario-pop a { color: var(--accent); text-decoration: none; font-size: .88rem; }
@media (max-width: 640px) { .tema-escolha { max-width: 92px; } }

/* ---- abas e tabelas do dashboard de faturamento */
.abas { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 1px solid var(--borda); }
.aba { border: 1px solid transparent; border-bottom: 0; background: transparent; color: var(--texto2); padding: .5rem .85rem; border-radius: 8px 8px 0 0; cursor: pointer; font-size: .88rem; font-weight: 600; }
.aba:hover { color: var(--texto); background: var(--bg3); }
a.aba { text-decoration: none; display: inline-block; }
.aba.ativa { background: var(--bg2); color: var(--accent); border-color: var(--borda); margin-bottom: -1px; }
.tabela td.ok { color: var(--ok); font-weight: 600; }
.tabela td.erro { color: var(--erro); font-weight: 600; }
.tabela.compacta td, .tabela.compacta th { padding: .3rem .45rem; font-size: .82rem; }
.trilho-mix { display: inline-block; vertical-align: middle; width: 70px; height: 10px; border-radius: 5px; background: var(--bg3); overflow: hidden; margin-right: .35rem; }
.trilho-mix > div { height: 100%; background: var(--barra); }
.trilho-mix > div.ok { background: var(--ok); }
.trilho-mix > div.baixo { background: var(--aviso); }
/* números nunca quebram linha (R$ e valor juntos) */
.tabela td.r, .tabela th.r { white-space: nowrap; }

/* ---- logo da empresa (fundo branco também no tema escuro) */
.logo-empresa { display: inline-flex; align-items: center; background: #fff; border-radius: 7px; padding: 3px 8px; height: 40px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.logo-empresa img { height: 34px; width: auto; display: block; }
.login-marca { flex-direction: column; align-items: center; text-align: center; gap: .35rem; }
.login-marca img { width: 100%; max-width: 280px; height: auto; background: #fff; border-radius: 10px; padding: 8px 12px; }
@media (max-width: 640px) { .logo-empresa { height: 34px; } .logo-empresa img { height: 28px; } }

/* ---- grupos do menu: recolher/expandir */
nav.menu button.grupo { display: flex; width: calc(100% - 1.2rem); justify-content: space-between; align-items: center; border: 0; background: transparent;
    cursor: pointer; padding: .35rem .25rem; border-radius: 6px; text-align: left; font-family: inherit; }
nav.menu button.grupo:hover { background: var(--bg3); color: var(--texto); }
nav.menu button.grupo .seta { font-size: .8rem; transition: transform .15s ease; }
nav.menu button.grupo.aberto .seta { transform: rotate(90deg); }

/* ---- senha com botão mostrar/ocultar */
.campo-senha { position: relative; display: flex; }
.campo-senha input { width: 100%; padding-right: 2.4rem; }
.campo-senha .olho { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--texto2);
    width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.campo-senha .olho:hover { color: var(--texto); background: var(--bg3); }
/* decisões do PCP na programação */
.decisoes { border-left: 4px solid var(--aviso); }
.decisao { display: flex; flex-direction: column; gap: .5rem; padding: .4rem 0; }
.decisao + .decisao { border-top: 1px solid var(--borda); }
.decisao .opcoes { display: flex; flex-wrap: wrap; gap: .5rem; }

.ultima-importacao { font-size: .92rem; background: var(--accent2); color: var(--texto); padding: .3rem .7rem; border-radius: 6px; }

/* edição das embalagens da produção */
.item-edit { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .15rem 0; }
.item-edit select { width: auto; max-width: 260px; min-height: 30px; padding: .15rem .35rem; font-size: .82rem; }
.item-edit input.num { width: 90px; min-height: 30px; padding: .15rem .35rem; font-size: .85rem; }
.item-edit.manual select, .item-edit.manual input.num { border-color: var(--aviso); }
.btn-icone.peq { width: 26px; height: 26px; font-size: .8rem; }
/* apontamento: motivo obrigatório (desvio acima da tolerância) */
select.invalido { border-color: var(--erro); background: var(--erro-bg); }

/* ---------------------------------------------------------------- códigos de tela (estilo transação) e busca Ctrl+K */
nav.menu a .txt { flex: 1; min-width: 0; }
nav.menu a .cod { font: 600 .68rem/1 Consolas, "Cascadia Mono", monospace; color: var(--texto2); opacity: .75; letter-spacing: .02em; }
nav.menu a.active .cod { color: var(--accent); opacity: 1; }
.cod-tela { font: 600 .74rem/1 Consolas, "Cascadia Mono", monospace; background: var(--bg3); border: 1px solid var(--borda); border-radius: 4px;
    padding: .12rem .35rem; margin-right: .45rem; color: var(--texto); }
.campo-transacao { display: flex; align-items: center; gap: .45rem; border: 1px solid var(--borda); background: var(--bg); color: var(--texto2);
    border-radius: 6px; padding: .32rem .6rem; cursor: pointer; font: 600 .82rem Consolas, "Cascadia Mono", monospace; min-width: 0; }
.campo-transacao:hover { border-color: var(--accent); color: var(--texto); }
kbd { font: .7rem Consolas, monospace; border: 1px solid var(--borda); border-bottom-width: 2px; border-radius: 4px; padding: .05rem .3rem; background: var(--bg2); color: var(--texto2); }
.busca-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(10, 15, 25, .45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 1rem 1rem; }
.busca-caixa { width: min(640px, 100%); background: var(--bg2); border: 1px solid var(--borda); border-radius: 10px; box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
    display: flex; flex-direction: column; max-height: 75vh; overflow: hidden; }
.busca-campo { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--borda); }
.busca-campo input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--texto); font-size: 1.05rem; min-width: 0; }
.busca-lista { overflow: auto; padding: .3rem; }
.busca-sec { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texto2); font-weight: 600; padding: .5rem .6rem .2rem; }
.busca-item { display: flex; width: 100%; align-items: center; gap: .7rem; border: 0; background: transparent; color: var(--texto); text-align: left;
    padding: .45rem .6rem; border-radius: 6px; cursor: pointer; font: inherit; }
.busca-item.sel { background: var(--accent2); color: var(--accent); }
.busca-item .cod { font: 600 .8rem Consolas, "Cascadia Mono", monospace; min-width: 4.6rem; }
.busca-item .nome { flex: 1; min-width: 0; }
.busca-item .grupo { font-size: .75rem; color: var(--texto2); white-space: nowrap; }
.busca-vazio { padding: 1rem; color: var(--texto2); text-align: center; }
.busca-rodape { border-top: 1px solid var(--borda); padding: .45rem .9rem; font-size: .75rem; color: var(--texto2); }
@media (max-width: 700px) { .busca-item .grupo { display: none; } .busca-fundo { padding-top: 4vh; } }

/* Lançar vale de caixas por foto */
.vale-captura { display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 1.6rem 1rem; text-align: center; }
.vale-botao { font-size: 1.05rem; padding: .8rem 1.6rem; }
.vale-captura .vale-botao { min-width: min(320px, 100%); justify-content: center; }
.btn.desabilitado { opacity: .5; pointer-events: none; }
.vale-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem; align-items: start; }
.vale-foto { display: flex; justify-content: center; align-items: center; overflow: hidden; background: var(--bg3); border-radius: 6px; min-height: 240px; }
.vale-foto img { max-width: 100%; max-height: 70vh; object-fit: contain; transition: transform .2s; }
@media (max-width: 900px) { .vale-grade { grid-template-columns: minmax(0, 1fr); } .vale-foto img { max-height: 45vh; } }

/* Conferir declarações e transportadores */
.decl-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: .8rem; margin-bottom: .8rem; }
.decl { border-left: 4px solid var(--aviso); }
.pin-grande { font-size: 2.4rem; font-weight: 700; letter-spacing: .5rem; text-align: center; padding: .8rem; margin: .6rem 0; background: var(--bg3); border-radius: 8px; font-variant-numeric: tabular-nums; }

/* aviso de caixas: botão do WhatsApp (wa.me) e texto com quebras de linha */
.btn.whatsapp { background: #1f8f4e; border-color: #1f8f4e; color: #fff; text-decoration: none; }
.btn.whatsapp:hover { background: #18733e; }
.aviso-texto { white-space: pre-line; }

/* previsão de falta de caixas */
.tabela tr.linha-erro { background: color-mix(in srgb, var(--erro-bg) 60%, transparent); }
.tabela td.neg { color: var(--erro); }
.tabela tr.difere td { background: var(--erro-bg); }
.tabela tr.clicavel { cursor: pointer; }
.chave-gerada { font-size: .95rem; padding: .35rem .5rem; background: var(--bg3); border-radius: 4px; word-break: break-all; user-select: all; }
