/* Central de Pedidos — mesmas cores e jeito do protótipo (prototipo/index.html) */
:root {
  color-scheme: light;
  --bg: #f4f5f1; --surface: #ffffff; --ink: #1d2420; --muted: #5f6b64; --line: #dde2dc;
  --accent: #1f6b45; --accent-soft: #e3f0e8; --warn: #9a6400; --warn-soft: #fff3d6;
  --bad: #a63a2a; --bad-soft: #fbe6e2; --info: #2c5a8a; --info-soft: #e4eef8;
  --paper: #ffffff; --semped: #ffd9b0;
  --hl-rosa: rgba(255, 92, 170, .38); --hl-rosa-claro: rgba(255, 92, 170, .16); --hl-verde: rgba(120, 255, 0, .55);
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font-body); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 6px; font-weight: 500; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.marca { font-weight: 700; font-size: 16px; padding: 0 10px 12px; }
.marca small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }

/* Entrada */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; width: min(360px, 100%); display: grid; gap: 6px; }
.cartao .marca { padding: 0 0 10px; }
.cartao label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.cartao input { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--surface); }
.cartao .btn { margin-top: 12px; }
.erro { color: var(--bad); background: var(--bad-soft); border-radius: 6px; padding: 6px 10px; font-size: 14px; margin: 6px 0 0; }

/* Estrutura */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
nav { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
nav { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; align-self: start; }
nav > button { text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 6px; color: var(--muted); font-weight: 500; }
nav > button.on { background: var(--accent-soft); color: var(--accent); }
.nav-fim { margin-top: auto; display: grid; gap: 8px; padding: 0 10px; }
.quem { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
main { padding: 24px 28px; min-width: 0; }
h1 { font-size: 22px; margin: 0 0 12px; }
.gtabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.gtabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 7px 14px; font-weight: 600; font-size: 13px; color: var(--muted); border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.gtabs button.on { background: var(--surface); border-color: var(--line); color: var(--ink); }
.gtabs button:disabled { opacity: .5; cursor: not-allowed; }
.gtabs .sep-redes { align-self: center; margin: 0 4px 0 14px; padding-left: 14px; border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.barra label { font-size: 13px; color: var(--muted); }
.barra input, .barra select { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: var(--surface); }
.resumo { color: var(--muted); font-size: 13px; }
.esp { flex: 1; }
.aviso { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 8px 12px; font-size: 14px; }
.so-impressao { display: none; }
/* Próximos dias de entrega com pedido (sexta: sábado e segunda; feriado: até 3) */
.dias-abertos { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.dias-abertos button[data-dia] { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
.dias-abertos button[data-dia].on { background: var(--accent); border-color: var(--accent); color: #fff; }
.dias-abertos button[data-dia].on .count { background: rgba(255,255,255,.25); color: #fff; }
.dias-abertos .count { font-size: 12px; background: var(--bg); border-radius: 10px; padding: 0 7px; margin-left: 4px; }
.dias-abertos .ok { color: var(--accent); }
/* Redes: os dias numa linha só (os 3 próximos + "Outro dia…"); avisos de item e de loja numa linha fina. */
.dias-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.dias-linha .dias-abertos { margin: 0; }
.dias-linha select, .dias-linha input[type="date"] { min-height: 34px; border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; background: var(--surface); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); }
.dias-linha select { field-sizing: content; }  /* largura do dia escolhido, não da opção mais comprida */
.barra-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }  /* botões da barra quebram juntos, à esquerda, antes do resumo (24/11/2026) */
.dias-linha select.on, .dias-linha input[type="date"].on {background: var(--accent); border-color: var(--accent); color: #fff; }
.dias-linha select option { color: var(--ink); background: var(--surface); }
.avisos-linha { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--warn); }
.avisos-linha:not(:has(> :not([hidden]))) { display: none; }
/* Gaveta aberta sobre a planilha: espaço à direita e rolagem de lado para a loja aberta não ficar embaixo dela. */
.rwrap { overflow-x: auto; }
.rwrap.com-gaveta { padding-right: 420px; }
.rwrap.com-gaveta .rgrade { max-width: none; }
@media print { .rwrap { overflow: visible !important; padding: 0 !important; } .dias-linha, .avisos-linha { display: none !important; } }
.dias-abertos button[data-dia].on .ok { color: #fff; }
.impressao-varios { display: none; }

/* Planilha de controle da rede (igual ao papel) */
.rgrade { display: grid; grid-template-columns: repeat(2, minmax(0, 330px)); gap: 18px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 18px; width: max-content; max-width: 100%; }
.rgrade.r3 { grid-template-columns: repeat(3, minmax(0, 230px)); gap: 18px 22px; }  /* três quadrados por linha (PAGUE MENOS) */
.rgrade.estreito { grid-template-columns: repeat(2, minmax(0, 210px)); gap: 18px 60px; }  /* MAMBO e TENDA: como no MAMBO.xlsm / TENDA.xlsm */
.rtit { grid-column: 1 / -1; font: 700 22px Arial, sans-serif; background: #d9d9d9; padding: 6px 12px; text-align: center; color: #000; }
.rq { position: relative; cursor: pointer; font-family: Arial, sans-serif; color: #000; --alt: 25px; }
.rq table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rq td { border: 1px solid #000; padding: 3px 6px; font-size: 13px; height: 25px; }
.rq td.c { text-align: center; }
.rq td.b { font-weight: 700; }  /* como no Excel: só o nome da loja em negrito */
.rq td.n { text-align: center; font-size: 22px; line-height: 1; color: #1f3a93; font-family: "Caveat", "Segoe Print", cursive; }
.rq.lancado td { background: var(--hl-rosa); }
.rq.conferido td { background: var(--hl-verde); }
.rq.revisado td.rt { background: var(--hl-rosa-claro); }  /* PAGUE MENOS revisado: só as linhas do título */
.rq:hover { outline: 2px solid var(--accent); outline-offset: 2px; }
.rq .rnao { position: absolute; left: 0; right: 0; bottom: 0; top: calc(var(--linhas, 3) * var(--alt)); display: flex; align-items: center; justify-content: center; font: 700 62px "Caveat", "Segoe Print", cursive; color: #1f3a93; pointer-events: none; }
.rq .alerta { position: absolute; top: -9px; right: -9px; background: var(--bad); color: #fff; border-radius: 10px; font: 700 11px var(--font-body); padding: 1px 7px; }
.vazio { color: var(--muted); padding: 24px; }

/* Painel lateral */
.gaveta { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); padding: 20px; overflow: auto; scrollbar-gutter: stable; transform: translateX(105%); transition: transform .2s; z-index: 5; }
.gaveta.show { transform: none; }
/* Fechada, a gaveta some também para o Tab e o leitor de tela (antes só saía da tela e os botões, até o Apagar,
   continuavam alcançáveis pelo Tab). Fecha na hora; abrir continua deslizando. Matheus 17/11/2026. */
.gaveta:not(.show) { visibility: hidden; }
.gtopo { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 10px; }
.gaveta h2 { font-size: 18px; margin: 0; }
.meta { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.pill { font-size: 12px; font-weight: 600; border-radius: 4px; padding: 2px 8px; display: inline-block; }
.pill.lancado { background: var(--hl-rosa); color: #7a1747; }
.pill.conferido { background: var(--hl-verde); color: #1d3d00; }
.pill.revisado { background: var(--hl-rosa-claro); color: #7a1747; }
.pill.sem, .pill.nao { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin: 16px 0 6px; }
.gaveta table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gaveta th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 4px 6px; }
.gaveta td { border-bottom: 1px solid var(--line); padding: 6px; }
.gaveta .num { text-align: right; font-variant-numeric: tabular-nums; }
.linha-tempo { font-size: 13px; color: var(--muted); margin: 3px 0; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1d2420; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 9; }
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .gaveta, .toast { transition: none; } }
@media screen and (max-width: 760px) { .app { grid-template-columns: 1fr; } nav { flex-direction: row; flex-wrap: wrap; align-items: center; } .nav-fim { margin: 0 0 0 auto; grid-auto-flow: column; } nav { position: static; height: auto; } main { padding: 16px; } .rgrade, .rgrade.r3, .rgrade.estreito { grid-template-columns: 1fr; width: 100%; } }

/* Impressão: igual à planilha do Excel — quadrados compactos em duas colunas, letra normal, todas as lojas
   da TENDA numa folha só; cores rosa/verde e o NÃO saem como na tela. (A regra de celular acima vale só na
   tela: antes ela pegava a folha A4, que é estreita, e saía um quadrado por linha.) */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  body { background: #fff; }
  nav, .gtabs, .barra, .aviso, .gaveta, .toast, h1, .rtit { display: none !important; }
  .app { display: block; } main { padding: 0; }
  .so-impressao { display: block; font: 700 12pt Arial, sans-serif; margin: 0 0 10px; }
  .rgrade { border: 0; padding: 0; border-radius: 0; width: 72%; grid-template-columns: repeat(2, 1fr); gap: 20px 40px; }
  .rgrade.r3 { width: 90%; grid-template-columns: repeat(3, 1fr); gap: 20px 28px; }
  .rgrade.estreito { width: 62%; gap: 20px 60px; }
  .rq { --alt: 23px; break-inside: avoid; }
  .rq td { height: 23px; padding: 0 5px; font-size: 11.5pt; font-family: Calibri, Arial, sans-serif; border-width: 1.5px; }
  .rq td.n { font: 11.5pt Calibri, Arial, sans-serif; color: #000; }
  .rq .rnao { font-size: 54px; }
  .rq:hover { outline: none; } .rq .alerta { display: none; }
  .rq td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dias-abertos { display: none !important; }
  /* "Imprimir os N dias": só as folhas montadas para isso, uma por dia */
  body.imprimindo-varios #planilha, body.imprimindo-varios #titulo-impressao { display: none !important; }
  body.imprimindo-varios .impressao-varios { display: block; }
  .folha { break-after: page; }
  .folha:last-child { break-after: auto; }
  .titulo-folha { font: 700 12pt Arial, sans-serif; margin: 0 0 10px; }
}

/* Gaveta: mudar o dia de entrega do pedido (a data do PDF pode estar errada) */
.mover-dia { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 13px; color: var(--muted); }
.mover-dia span { flex-basis: 100%; }
.mover-dia input { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; margin-left: 4px; }

/* Dia fechado (planilha impressa) e pedido que chegou depois: "é de qual dia?" */
.fechado { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dias-abertos .fech { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.aguardando { display: grid; gap: 8px; margin: 0 0 12px; }
.aguarda { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff7e0; border: 1px solid #f0c75e; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #5c4400; }
.aguarda span { flex: 1 1 320px; }
@media print { .fechado, .aguardando { display: none !important; } }

/* Tela Lojas */
.tlojas { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tlojas th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tlojas td { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.tlojas td.c { text-align: center; color: var(--muted); }
.tlojas .nowrap { white-space: nowrap; }
.tlojas .acoes-linha { text-align: right; }
.btn.mini { padding: 3px 9px; font-size: 13px; min-height: 0; }
.floja label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0; }
.floja label small { color: var(--muted); font-weight: 400; font-size: 12px; }  /* sem a transparência: dava contraste 3,6 */
/* Cadastro só para ler: campo desligado não parece editável (sem borda nem fundo); com Editar vira campo de novo. */
#fcad input:disabled { background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
/* Salvar sempre à vista no fim da gaveta (o formulário da loja passa da altura do notebook). */
.gaveta .acoes-fixas { position: sticky; bottom: -20px; background: var(--surface); padding: 10px 0 14px; border-top: 1px solid var(--line); z-index: 1; }
/* erro do formulário dentro da barra fixa, para não ficar escondido atrás dela */
.acoes-fixas .erro-barra { flex-basis: 100%; margin: 0; }
.falta { color: var(--bad); }
/* Clientes das guias: o nome é um botão (Enter abre o cadastro) com a cara do texto em negrito da tabela. */
.nomebtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: inherit; text-align: left; cursor: pointer; }
.nomebtn:hover { text-decoration: underline; }
.floja input:not([type=checkbox]), .floja textarea { display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--ink, inherit); padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.floja .chk { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 4px 0; color: inherit; }
.floja .tipos { margin: 6px 0; }
@media screen and (max-width:760px) { .tlojas th:nth-child(4), .tlojas td:nth-child(4), .tlojas th:nth-child(5), .tlojas td:nth-child(5) { display: none; } }

/* Digitar as caixas no quadrado (GIGA) e diferença digitado × PDF */
.rq td.anot { padding: 0; }
.rq .anot-in, .rq .ext-in { width: 100%; height: 100%; min-height: 24px; border: 0; background: transparent; text-align: center; font: 22px "Caveat", "Segoe Print", cursive; color: #1f3a93; padding: 0; }
.rq .anot-in:focus, .rq .ext-in:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #fffbe6; }
.rq .anot-in.erro-campo, .rq .ext-in.erro-campo { background: var(--bad-soft); }
.rq td.dif { background: #ffd9d4 !important; position: relative; box-shadow: inset 0 0 0 2px var(--bad); }
.rq td.dif .anot-era { position: absolute; right: 3px; bottom: 1px; font: 600 10px Arial, sans-serif; color: var(--bad); }
@media print {
  .rq .anot-in, .rq .ext-in { font: 11.5pt Calibri, Arial, sans-serif; color: #000; background: transparent !important; outline: none !important; }
  .rq td.dif .anot-era { font-size: 7pt; }
}

/* Linhas do título editáveis na planilha (ex.: motorista da loja) */
.rq td.tit { padding: 0; }
.rq .tit-in { width: 100%; border: 0; background: transparent; text-align: center; font: inherit; font-weight: inherit; color: inherit; padding: 3px 6px; cursor: text; }
.rq .tit-in:hover { background: rgba(0, 0, 0, .04); }
.rq .tit-in:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #fffbe6; }
.rq .tit-in.erro-campo { background: var(--bad-soft); }
.rq td.tx { cursor: pointer; }  /* PAGUE MENOS: clique abre a loja, duplo clique corrige (como na Guia do dia) */
.rq td.tx:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.rq td.tx:has(.tit-in) { padding: 0; }
@media print { .rq .tit-in { background: transparent !important; outline: none !important; padding: 0 5px; font: inherit; font-weight: inherit; } }

/* ---------- Guia do dia (planilha PEDIDOS SEPARADOS CORRETO), igual ao protótipo ---------- */
.dias-abertos button[data-gdia] { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 6px 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
.dias-abertos button[data-gdia].on { background: var(--accent); border-color: var(--accent); color: #fff; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.legend.filtros { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 6px 0; gap: 4px 6px; }
.legend.filtros button { border: 1px solid transparent; background: none; color: inherit; font: inherit; padding: 3px 8px; border-radius: 999px; }
.legend.filtros button:hover { border-color: var(--line); }
.legend.filtros button.on { border-color: var(--ink); color: var(--ink); background: var(--surface); font-weight: 600; }
.legend.filtros > span { padding: 3px 8px; }
.selbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }
.selbar.acoes .esp { flex: 1; }
.selbar.corte { background: var(--bg); }
.selbar.corte label { font-size: 13px; color: var(--muted); font-weight: 600; }
.selbar.corte input { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: var(--surface); }
.ferram { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.ferram input[type=search] { width: 200px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.ferram .zm { min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; font-size: 13px; }
.posbar.on { background: var(--info-soft); border-color: var(--info); }
.posbar .chk, .floja .chk { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; font-size: 13px; }
.posbar i.amostra { display: inline-block; width: 22px; height: 12px; vertical-align: middle; border: 1px solid var(--line); }
.amostra.vazio, .xl.editando td.pos-vazio { background-image: repeating-linear-gradient(-45deg, rgba(31,107,72,.16) 0 5px, transparent 5px 10px); }
.amostra.outro, .xl.editando td.pos-outro { background-image: repeating-linear-gradient(-45deg, rgba(154,100,0,.20) 0 5px, transparent 5px 10px); }
.xl.editando td[data-pos] { cursor: pointer; }
.xl.editando td[data-pos]:hover { background-color: rgba(44,90,138,.10); }
.xl.editando td.pos-sel { background-color: rgba(44,90,138,.28) !important; }
.xlwrap { overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: calc(100vh - 260px); }
.xlbox { position: relative; display: inline-block; }
body:has(#gaveta.show).v-guia .xlbox { margin-right: min(420px, 90vw); }
.xl { table-layout: fixed; border-collapse: collapse; font: 11pt Arial, Helvetica, sans-serif; color: #000; zoom: var(--gz, 1); }
.xl td { border: 0; padding: 0 6px; white-space: pre; overflow: visible; vertical-align: bottom; line-height: 1.25; }
.xc { display: flex; align-items: center; gap: 2px; }
.xq { width: 52px; border: 0; background: transparent; padding: 1px 4px; border-radius: 3px; font: 700 11pt Arial, sans-serif; color: var(--accent); text-align: left; font-variant-numeric: tabular-nums; }
.xq:hover { background: var(--bg); }
.xq.filled { background: var(--accent-soft); }
.xq:disabled { color: #1d2420; background: transparent; pointer-events: none; }
/* Loja rosa/verde que ainda aceita a outra parte (venda ou bonificação): mesmo jeito do campo travado até ganhar o foco. */
.xq[data-marc]:not(.xbon-so):not(:focus) { color: #1d2420; background: transparent; }
/* Campo travado (pedido gerado, conferido, NÃO): o navegador não manda o clique de um campo desabilitado para a
   célula; sem pointer-events o clique cai na célula e dá para selecionar e somar como as outras (Matheus 14/11/2026). */
.xqv { min-width: 52px; display: inline-block; padding: 1px 4px; }
.xt { margin-left: auto; }
.xn { cursor: pointer; }
.xn:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.xl td.x-digitado { background-color: var(--accent-soft); }
.xl td.x-semped { background: repeating-linear-gradient(-45deg, var(--semped), var(--semped) 6px, #fff 6px, #fff 10px); }
.xmk { margin: 0 2px 0 0; vertical-align: middle; }
.xl td.xrede { cursor: pointer; } .xl td.xrede:hover { outline: 1px dashed var(--accent); outline-offset: -2px; }
.xl td.hl-rosa { background-color: var(--hl-rosa); }
.xl td.hl-verde { background-color: var(--hl-verde); }
.xl td.esmaece, .xmarca.esmaece { opacity: .2; }
.xl td.pisca { animation: pisca 1.4s ease-out 2; outline: 3px solid var(--accent); outline-offset: -3px; }
@keyframes pisca { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .xl td.pisca { animation: none; } }
.xl td.xtx { cursor: text; }
.xl td.xtx:hover { outline: 1px dashed var(--accent); outline-offset: -2px; }
.xl td.xtx:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.xti { width: 100%; box-sizing: border-box; border: 1px solid var(--accent); border-radius: 2px; font: inherit; text-align: inherit; padding: 0 2px; background: var(--surface); color: var(--ink); }
.xl td.csel { box-shadow: inset 0 0 0 9999px rgba(44,90,138,.16); }
.xl.arrastando, .xl.arrastando * { user-select: none; }
.soma { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.promo { color: #d10000; background: #fff200; font: 700 10.5pt Arial, sans-serif; padding: 0 3px; border-radius: 2px; white-space: nowrap; }
.xmarca { position: absolute; display: flex; align-items: center; justify-content: center; pointer-events: none; font-family: "Caveat", "Segoe Print", cursive; font-weight: 700; color: #1d3fbf; line-height: 1; transform: rotate(-12deg); opacity: .85; }
.caneta { font-family: "Caveat", "Segoe Print", cursive; color: #1d3fbf; font-size: 18px; }
.pill.digitado { background: var(--accent-soft); color: var(--accent); }
.toast.acao { pointer-events: auto; display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 4px; padding: 3px 10px; font: inherit; font-weight: 700; }
.impressao-guias { position: absolute; left: -99999px; top: 0; }
@page guia { size: A4 landscape; margin: 8mm; }
@media print {
  body.v-guia main { page: guia; }
  body.v-guia #guia-conteudo > :not(.xlwrap):not(.so-impressao):not(.impressao-guias) { display: none !important; }
  body.v-guia .so-impressao { display: block; font: 700 13pt Arial, sans-serif; margin: 0 0 6px; }
  body.v-guia .xlwrap { overflow: visible; max-height: none; border: 0; padding: 0; border-radius: 0; }
  body.v-guia .xlbox { zoom: var(--pz, 1); margin-right: 0 !important; }
  .xl { zoom: 1; }
  .xl td.x-digitado, .xl td.x-semped { background: none; }
  .xmk { display: none; }
  .xl tr { break-inside: avoid; }
  .xq, .xq.filled, .xq:disabled { background: none; color: #000; }
  .soma { color: #000; }
  .xl td.esmaece, .xmarca.esmaece { opacity: 1; }
  .xl td.pisca, .xl td.csel { box-shadow: none; outline: none; animation: none; }
  .xl td.hl-rosa, .xl td.hl-verde, .promo, .xmarca { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .xq.xbon-so { color: #d0021b; }
  body.imprimindo-guias #guia-conteudo > .xlwrap, body.imprimindo-guias #guia-conteudo > .so-impressao,
  body.imprimindo-guias #h-guia > :not(.impressao-guias) { display: none !important; }
  .folha-guia .xlbox { break-inside: avoid; }
  body.imprimindo-guias .impressao-guias { position: static; }
  .impressao-guias:empty { display: none; }
  .folha-guia { break-after: page; }
  .folha-guia:last-child { break-after: auto; }
}
/* Todas as abas da guia à mostra (como no protótipo), a data de entrega fica na dica (title) */
.gtabs-todas { align-items: flex-end; row-gap: 4px; }
.gtabs-todas button.dodia { color: var(--ink); }
.gtabs-todas button.sem-grupo { opacity: .4; }  /* filtro por grupo: aba sem loja do grupo */
.ggrupo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ggrupo select { max-width: 200px; }
.gtabs-todas button.dodia.on { box-shadow: inset 0 3px 0 var(--accent); }
/* Caixas que vieram do PDF (lojas das abas 3 com leitor): não se digitam; diferente do digitado = vermelho */
.xq.pdfq:disabled, .pdfq-amostra { color: #1f3a93; font-weight: 700; }
.pdfq-amostra { font: 700 11pt Arial, sans-serif; }
.xl td.dif { background-color: #ffd9d4 !important; box-shadow: inset 0 0 0 2px var(--bad); }
@media print { .xq.pdfq:disabled { color: #000; } .xl td.dif { box-shadow: none; } }
/* Histórico: guia de um dia (só consulta) e por loja */
body:has(#gaveta.show).v-hist .xlbox { margin-right: min(420px, 90vw); }
.xl td.hclic { cursor: pointer; }
.xl td.hclic:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.tabela-hist { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
table.hloja { width: 100%; border-collapse: collapse; font-size: 14px; }
table.hloja th, table.hloja td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.hloja th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--bg); }
table.hloja .num { text-align: right; font-variant-numeric: tabular-nums; }
table.hloja tbody tr { cursor: pointer; } table.hloja tbody tr:hover, table.hloja tbody tr:focus { background: var(--accent-soft); }
table.hloja tfoot td { font-weight: 700; border-top: 2px solid var(--line); border-bottom: 0; }
table.hloja .meta { color: var(--muted); font-size: 12px; }
@media print {
  body.v-hist main { page: guia; }
  body.v-hist #titulo-view, body.v-hist #hist-conteudo > :not(#h-guia):not(#h-tab), body.v-hist #h-guia > .aviso { display: none !important; }
  body.v-hist .so-impressao { display: block; font: 700 13pt Arial, sans-serif; margin: 0 0 6px; }
  body.v-hist .xlwrap { overflow: visible; max-height: none; border: 0; padding: 0; border-radius: 0; }
  body.v-hist .xlbox { zoom: var(--pz, 1); margin-right: 0 !important; }
  body.v-hist .tabela-hist { border: 0; overflow: visible; }
  .xl td.hclic:hover { box-shadow: none; }
}
/* Promoções */
.pform { align-items: flex-end; }
.pform > label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pform input, .pform select { color: var(--ink); font-weight: 400; font-size: 14px; }
.pdias { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pdias legend { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0; margin-bottom: 4px; }
.pdias .chk, .barra .chk { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--ink); }
.pdias .chk { white-space: nowrap; }
.pdias .chk input { width: auto; flex: none; }
table.ptab td.sit { white-space: normal; min-width: 220px; }
table.ptab tbody tr { cursor: default; }
table.ptab tbody tr:hover { background: none; }  /* a linha não é clicável: sem cor ao passar o mouse */
/* Promoções no notebook (1024px): textos quebram linha; só preço e botões ficam numa linha. */
table.ptab td { white-space: normal; }
table.ptab td.num, table.ptab td.pacoes { white-space: nowrap; }
table.ptab td.pacoes .btn { display: block; margin-left: auto; }  /* um botão por linha, à direita, como na gaveta */
table.ptab td.pacoes .btn + .btn { margin-top: 6px; }
table.ptab td:first-child { min-width: 150px; }
table.ptab td.sit { min-width: 180px; }
table.ptab .pcad { margin-top: 2px; }
.pintro { max-width: 75ch; }
table.ptab tr.venc { opacity: .55; }
.pav { color: var(--warn); font-size: 12px; margin-top: 4px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.floja select.psel { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.floja .pfixa { display: flex; margin: 14px 0 4px; color: var(--ink); }
.floja .pdatas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.floja .lbl small { text-transform: none; letter-spacing: 0; font-weight: 400; }
/* Lojas: Clientes das guias / Lojas das redes de PDF; grupos */
.modos { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 14px; background: var(--surface); }
.modos button { border: 0; background: none; padding: 7px 16px; font-weight: 600; font-size: 13px; color: var(--muted); }
.modos button + button { border-left: 1px solid var(--line); }
.modos button.on { background: var(--accent-soft); color: var(--accent); }  /* como o item ativo do menu: o verde cheio fica só para o botão de ação ("Novo grupo") */
.gtab { table-layout: fixed; width: 100%; margin-bottom: 8px; }
.gtab th:nth-child(1) { width: 150px; } .gtab th:nth-child(2) { width: 70px; } .gtab th:nth-child(4) { width: 90px; }
.pmodo { margin: 2px 0 4px; }
.pmodo button:disabled { opacity: .5; cursor: default; }
.pbusca { position: relative; }
.psug { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 4px; }
.psug button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--ink); font-weight: 600; }
.psug button small { color: var(--muted); font-weight: 400; font-size: 12px; }
.psug button:hover, .psug button.on { background: var(--bg); }
.psug .meta { margin: 6px 8px; }
.gtab td { padding-top: 4px; padding-bottom: 4px; }
.gtab .gnomes { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted, #555); font-size: 12px; }
.gtab .glinha { cursor: pointer; }
.gtab .glinha:hover td { background: var(--bg); }
.gtab .gbtns { white-space: nowrap; text-align: right; }
.gtab .gbtns .btn { margin-left: 4px; }
.grupos { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; margin-bottom: 8px; }
.grupo { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.grupo .gcab { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.grupo .gcab .meta { margin: 0; }
.chip { display: inline-block; font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1px 8px; margin: 2px 4px 2px 0; }
table.ctab tbody tr { cursor: default; }
.glista { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.glista .chk { display: flex; margin: 3px 0; font-weight: 400; }
.gacoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gacoes .btn { white-space: nowrap; }
.g-incluir { margin-top: 8px; }
.gmemb summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 2px; }
.gmemb .gm { font-size: 13px; margin: 2px 0 2px 12px; }
.riscado { text-decoration: line-through; color: var(--muted); }
.grupo .gcab .btn.mini { white-space: nowrap; }

/* Ler print da Coopercica */
.prdrop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--line); border-radius: 10px; padding: 22px 12px; margin: 10px 0; cursor: pointer; text-align: center; color: var(--muted); font-size: 13px; }
.prdrop b { color: var(--ink); font-size: 15px; }
.prdrop.sobre, .prdrop:hover { border-color: var(--accent); background: var(--accent-soft); }
.prmini { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; margin: 6px 0 10px; }
.prtab { width: 100%; border-collapse: collapse; font-size: 13px; }
.prtab th, .prtab td { border-bottom: 1px solid var(--line); padding: 4px 3px; text-align: left; vertical-align: top; }
.prtab th.num, .prtab td.num { text-align: center; }
.prtab td:first-child { font-size: 12px; }
.prtab td small { display: block; color: var(--muted); font-size: 11px; }
.prtab .prav { color: var(--bad, #b42318); }
.prq { width: 30px; text-align: center; font: inherit; padding: 3px 1px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.prq:disabled { background: transparent; border-color: transparent; color: var(--muted); }
.prduv .prq, .prduv-amostra { background: #fff3c4; border-color: #e0b100; }
.prduv-amostra { display: inline-block; width: 14px; height: 12px; border: 1px solid #e0b100; border-radius: 3px; vertical-align: middle; }
.prfalta .prq { border-color: var(--bad, #b42318); }

/* Aviso de confirmação do sistema (no lugar do confirm do navegador) */
.modal-fundo { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 28, 24, .38); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); max-width: 440px; width: 100%; padding: 20px 22px 16px; }
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 18px; color: var(--ink); line-height: 1.45; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; }
.btn.primary.perigo { background: var(--bad, #b42318); border-color: var(--bad, #b42318); }

/* Complementos: "+5" ao lado das caixas; laranja = falta gerar, rosa = gerado, verde = conferido */
.xcomp { font: 700 10.5pt Arial, sans-serif; padding: 0 3px; border-radius: 3px; white-space: nowrap; color: #8a3b00; background: #ffd9a8; border: 1px solid #e08a1e; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.xcomp.lancado { background: var(--hl-rosa); border-color: #d0508e; color: #6a1040; }
.xcomp.conferido { background: var(--hl-verde); border-color: #5aa000; color: #1d3d00; }
.ctipo { display: flex; gap: 16px; margin: 6px 0 8px; }
/* Bonificação: número vermelho depois da venda (rosa = pedido gerado, verde = conferido); célula só bonificação = número
   vermelho num círculo (em foco o círculo sai, para caber "venda bonificação") */
.xbon { font: 700 10.5pt Arial, sans-serif; padding: 0 3px; margin-left: 4px; border-radius: 3px; white-space: nowrap; color: #d0021b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Complemento, bonificação, promoção e preço lado a lado: espaço entre eles igual ao da esquerda da venda (Matheus 17/11/2026).
   O primeiro depois do campo fica como está (a célula só bonificação se alinha pela bonificação). */
.xc > :is(.xcomp, .xbon, .promo, .xpreco) + :is(.xcomp, .xbon, .promo, .xpreco) { margin-left: 8px; }
.xbon.lancado { background: var(--hl-rosa); }
.xbon.conferido { background: var(--hl-verde); }
.xq.xbon-so, .xqv.xbon-so { color: #d0021b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
/* Célula só bonificação: o número fica na coluna da bonificação das outras células (campo 52px + 2 + 4 + 3 = 61px),
   não embaixo da venda (Matheus 17/11/2026). Em foco volta ao normal, para digitar "venda bonificação". */
.xq.xbon-so:not(:focus) { width: 92px; padding-left: 61px; padding-right: 3px; }
.xqv.xbon-so { padding-left: 61px; padding-right: 3px; }
@supports (field-sizing: content) { .xq.xbon-so:not(:focus) { field-sizing: content; width: auto; min-width: 0; } }
/* Pedido de bonificação gerado (rosa) / conferido (verde): grifa só o número, como o .xbon (3px de cada lado). */
.xq.xbon-so.bon-lancado:not(:focus), .xqv.xbon-so.bon-lancado,
.xq.xbon-so.bon-conferido:not(:focus), .xqv.xbon-so.bon-conferido {
  background: linear-gradient(var(--hl), var(--hl)) right / calc(100% - 58px) 100% no-repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.xbon-so.bon-lancado { --hl: var(--hl-rosa); }
.xbon-so.bon-conferido { --hl: var(--hl-verde); }
.xl td.x-compl { box-shadow: inset 0 0 0 2px #e08a1e; }
/* Venda gerada, bonificação ainda não (pedido à parte): mesmo aviso do complemento, em vermelho. */
.xl td.x-bonif { box-shadow: inset 0 0 0 2px #d0021b; }
.xl td.x-compl.x-bonif { box-shadow: inset 0 0 0 2px #e08a1e, inset 0 0 0 4px #d0021b; }
.gbon { color: #d0021b; font-weight: 700; }
/* Gaveta da Guia (Matheus 17/11/2026): situação ao lado do nome; "depois do corte" em âmbar (é a loja que se esquece);
   traço de bonificação vazia em cinza; Apagar numa linha própria à esquerda, para o botão principal não mudar de lugar. */
.gcab { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.gcab .pill { font-size: 13px; padding: 3px 9px; }
.pill.corte { background: var(--warn-soft); color: var(--warn); }
.gaveta td.gtraco { color: var(--muted); }
/* Botão principal vem primeiro no HTML e fica sempre em cima, à direita; os outros vão para a esquerda dele e, se não
   couberem, descem (gaveta estreita ou letra maior). "Apagar o pedido" fica numa linha própria embaixo, à direita. */
/* Um botão por linha, à direita, principal em cima: o Tab desce na mesma ordem que a tela (antes, lado a lado com
   row-reverse, o Tab andava da direita para a esquerda). Matheus 17/11/2026. */
.acoes.acoes-gav, .gaveta .compl > .cacoes { flex-direction: column; align-items: flex-end; }
.acoes-sec { margin-top: 8px; display: flex; justify-content: flex-end; }  /* Apagar alinhado à direita com os outros botões */
.gaveta .compl .cacoes.cpilha { flex-direction: column; align-items: flex-end; }
.cacoes.cpilha > div { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.compl.gbonif { margin-top: 16px; }  /* bonificação depois das ações da venda (Matheus 17/11/2026) */
.compl { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.compl.digitado { border-color: #e08a1e; background: #fff7ec; }
.compl .cacoes, .cform .cacoes { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.cform .cqs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.cform label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.cform .cq { width: 64px; font: inherit; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.pill.c-dig { background: #ffd9a8; color: #8a3b00; }

/* Busca de loja da Guia do dia com a lista de sugestões da página */
.gbusca { display: inline-block; }
.gbusca .psug { left: auto; right: 0; min-width: 100%; width: 300px; z-index: 30; }

.prtab td small.prtroca { color: #8a3b00; font-weight: 700; }
.prtrocas { background: #fff7ec; border: 1px solid #e08a1e; border-radius: 8px; padding: 6px 10px; margin: 6px 0 10px; font-size: 13px; }
.prtrocas .prtl { padding-left: 14px; }
.prmini { cursor: zoom-in; }
.prmini + .prdica { margin: -6px 0 8px; font-size: 12px; }
.prgrande-caixa { background: var(--surface); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.3); padding: 12px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; }
.prgrande-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prgrande-img { overflow: auto; }
.prgrande-img img { display: block; width: min(1500px, calc(96vw - 24px)); height: auto; }

/* Ler e-mail Shopper */
.emtxt { width: 100%; font: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; margin: 8px 0; background: var(--surface); }
.emcab { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0; }
.emcab > div { display: flex; flex-direction: column; font-size: 13px; }
.emcab .meta { font-size: 11px; margin: 0; }
.emloja { display: block; font-size: 13px; color: var(--muted); margin: 8px 0; }
.emloja select { margin-top: 4px; }
.emtab td { font-size: 12px; }
.emtab .prq { width: 40px; }
.emtab tr.prfalta td { background: var(--bad-soft); }
.btn.perigo-txt { color: var(--bad); border-color: var(--bad-soft); }
.btn.perigo-txt:hover { border-color: var(--bad); }

/* Menus da barra da guia e seleção */
.menu { position: relative; display: inline-block; }
.menu-lista { position: absolute; top: calc(100% + 4px); left: 0; z-index: 40; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); padding: 4px; display: flex; flex-direction: column; }
.menu-lista[hidden] { display: none; }
.menu-bonif { position: fixed; top: auto; left: auto; min-width: 160px; }
.menu-bonif .menu-sec { padding: 6px 10px 2px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }
.menu-bonif .menu-sec:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.menu-bonif .menu-sep { border-top: 1px solid var(--line); margin: 4px 0; }
.menu-lista button.perigo-txt { color: var(--bad); }
/* Campo editando a bonificação (botão direito → Editar bonificação): número em vermelho, como a bonificação. */
/* Bonificação editável: clicar no número vermelho abre o campinho vermelho no lugar dele. */
.xbon.xbon-ed { cursor: pointer; }
.xbon.xbon-ed:hover { outline: 1px dashed #d0021b; }
.xbi { width: 38px; margin-left: 4px; padding: 0 3px; border: 1px solid #d0021b; border-radius: 3px; background: #fff; font: 700 10.5pt Arial, sans-serif; color: #d0021b; }
.xbi:focus { outline: 2px solid #d0021b33; }
.menu-lista button { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 14px; color: var(--ink); white-space: nowrap; cursor: pointer; }
.menu-lista button:hover, .menu-lista button:focus { background: var(--bg); outline: none; }
.selinfo { font-size: 13px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 6px 10px; }

/* Topo da Guia do dia numa linha só */
.gtopo-linha { gap: 10px; padding: 8px 12px; }
.dias-mini { margin: 0; gap: 4px; }
.dias-mini button[data-gdia] { padding: 4px 11px; font-size: 13px; }
.gdia-nav { display: inline-flex; align-items: center; gap: 4px; }
.gdia-nav .btn { padding: 4px 9px; }
.gdia-nav input[type=date] { padding: 4px 6px; }
.gcorte { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.gcorte input { padding: 4px 6px; }
.galerta { border: 1px dashed #c05a00; background: var(--semped, #fff1e0); color: #8a3b00; border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gtabs-linha { display: flex; align-items: flex-end; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.gtabs-linha .gtabs { border-bottom: 0; margin-bottom: 0; flex: 1; }
.gtabs-linha .ferram { padding-bottom: 6px; }
@media print { .gtabs-linha, .gtopo-linha { display: none !important; } }
.gtopo-linha .ferram { margin-left: 0; }
.gtopo-linha .ferram input[type=search] { width: 180px; padding: 4px 8px; }
.gtopo-linha .ferram .btn { padding: 4px 9px; }

/* Legenda da guia num balão */
.leg-menu { margin-left: auto; }
.leg-menu .linkbtn { font-size: 12px; }
.leg-lista { left: auto; right: 0; min-width: 320px; padding: 8px 12px; gap: 6px; font-size: 12px; color: var(--ink); }
.leg-lista span { display: flex; align-items: center; gap: 6px; }
.leg-lista i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: none; }
.xped { display: block; text-align: center; font-weight: 700; font-size: 10pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Redes (PDF): quadro com complemento para conferir */
.rq.r-compl { box-shadow: 0 0 0 2px #e08a1e; }
.rq td.n .xcomp { font-size: 9.5pt; margin-left: 2px; }
.xq.xfixo { font-style: italic; }
.xfixo-imp { color: #555; }
.xpreco { font: 600 9pt Arial, sans-serif; color: #1f4e8a; background: #e6eefb; border-radius: 2px; padding: 0 3px; margin-left: 3px; white-space: nowrap; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* Pedidos fixos */
.fxtab td, .fxtab th { white-space: nowrap; }
.fxdias { display: flex; gap: 6px; flex-wrap: nowrap; }  /* Seg a Sáb numa linha só (antes o Sáb caía sozinho embaixo) */
.fxdias label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; margin: 0; }
.fxdias .fxq { width: 48px !important; text-align: center; }
.fxdica { font-size: 12px; }  /* antes ficava com 10px */
/* Editar e Excluir um embaixo do outro, à direita (a tabela cabe no notebook, como em Promoções). */
.fxtab td.fxacoes .btn { display: block; margin-left: auto; }
.fxtab td.fxacoes .btn + .btn { margin-top: 4px; }

/* Pedido fora do dia */
.xl td.xvazia { cursor: pointer; }
.xl td.xvazia:hover { background: rgba(31, 78, 138, .07); }
.xl td.x-avulso { box-shadow: inset 0 0 0 2px #1f4e8a; }
.xl td.x-avulso { position: relative; }
.xl td.x-avulso::after { content: "fora do dia"; position: absolute; right: 2px; top: 1px; font-size: 6.5pt; font-weight: 600; color: #1f4e8a; line-height: 1; }
@media print { .xl td.x-avulso::after { content: ""; } .xl td.x-avulso { box-shadow: none; } }
.avlista { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 4px; }
.avlista label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.avlista label:last-child { border-bottom: 0; }
.avlista label b { color: var(--muted); font-weight: 600; margin-left: 4px; }
.floja .avlista .avq { width: 70px !important; display: inline-block !important; margin: 0 !important; text-align: center; }
.hnav .pbusca { display: inline-block; }
.hnav .psug { min-width: 100%; width: 280px; z-index: 30; }

/* ---------- Telas menores (notebook): tudo mais compacto ---------- */
.ab-c { display: none; }
@media screen and (max-width: 1800px) {
  body { font-size: 14px; }
  .app { grid-template-columns: 190px 1fr; }
  main { padding: 18px 20px; }
  nav { padding: 16px 10px; }
  .btn { padding: 6px 11px; }
  .gtabs button { padding: 6px 9px; font-size: 12px; }
  .gtopo-linha { gap: 6px; padding: 7px 10px; }
  .gtopo-linha .ferram input[type=search] { width: 150px; }
  .gtopo-linha .resumo { font-size: 12px; }
  .dias-mini button[data-gdia] { padding: 3px 9px; font-size: 12px; }
  .legend.filtros { font-size: 11.5px; }
  .selbar { padding: 6px 10px; gap: 8px; }
}
@media screen and (max-width: 1640px) {
  .ab-l { display: none; } .ab-c { display: inline; }
  .app { grid-template-columns: 170px 1fr; }
  main { padding: 14px 16px; }
  h1 { font-size: 20px; margin-bottom: 8px; }
  .gtabs button { padding: 5px 8px; }
  .gtopo-linha .ferram input[type=search] { width: 130px; }
  .gtopo-linha .resumo { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gcorte input { width: 92px; }
}
/* Guia do dia: menos espaço entre as faixas de cima, para sobrar mais tela para a planilha */
.legend.filtros { margin-bottom: 4px; padding: 2px 0; }
.gtabs-linha { margin-bottom: 6px; }
.v-guia .selbar.acoes { margin-bottom: 8px; padding-top: 5px; padding-bottom: 5px; }
.v-guia .gtopo-linha { margin-bottom: 8px; }

/* Menu da esquerda recolhível */
.marca-btn { border: 0; background: none; text-align: left; cursor: pointer; width: 100%; border-radius: 6px; color: inherit; font: inherit; font-weight: 700; font-size: 16px; }
.marca-btn:hover { background: var(--bg); }
.nav-abrir { display: none; }
body.nav-recolhida .app { grid-template-columns: 1fr !important; }
body.nav-recolhida nav { display: none; }
body.nav-recolhida .nav-abrir { display: block; position: fixed; left: 8px; top: 10px; z-index: 50; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 10px; font-size: 18px; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
body.nav-recolhida main { padding-left: 56px !important; }
@media print { .nav-abrir { display: none !important; } }
.v-guia .xlwrap, .v-hist .xlwrap { padding: 6px; }
.hnav .ferram { margin-left: 0; }
.xpednome { font-weight: 600; font-size: 8.5pt; color: #1f4e8a; white-space: nowrap; }
@media print { .xpednome { color: #000; } }
.logo-nav { display: block; width: 100%; max-width: 150px; height: auto; margin: 0 0 8px; }
.cartao .logo-nav { max-width: 170px; }
/* Usuários */
.ustab td { vertical-align: middle; }
.us-inativo td { color: var(--muted); }
.us-off { color: var(--bad); }
.pill.us-admin { background: #fde8ea; color: #b3121f; }
.us-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.us-check input { width: auto; margin: 0; }
.ferram .zm { display: inline-flex; align-items: center; gap: 1px; }
.ferram .zm input { width: 2.6em; text-align: right; font: inherit; font-variant-numeric: tabular-nums; border: 1px solid transparent; border-radius: 4px; padding: 2px 1px 2px 3px; background: transparent; }
.ferram .zm input:hover { border-color: var(--line); }
.ferram .zm input:focus { border-color: var(--line); background: var(--surface); outline: none; }
@media screen { .rq .ext-in { font-size: 18px; } }

/* Gaveta da loja: abas Pedido do dia / Cadastro */
.gtabs-gav { margin: 10px 0 12px; }
table.ctab tbody tr.clinha { cursor: pointer; }
table.ctab tbody tr.clinha:hover td { background: var(--bg); }

/* Guia do dia: total da aba por produto e soma da seleção (como a barra de baixo do Excel) */
.gtotal { font-size: 13px; color: var(--muted); white-space: nowrap; }
.gtotal b, .gsomasel b { color: var(--ink, inherit); }
.gsomasel { position: fixed; right: 18px; bottom: 14px; z-index: 30; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
.gsomasel-n { color: var(--muted); font-size: 12px; margin-left: 4px; }
@media print { .gsomasel, .gtotal { display: none !important; } }

/* Aba Orgânicas: cópia da planilha ORGÂNICAS FAVA (bordas grossas, título grande) */
.org-folha { background: #fff; color: #000; border: 1px solid var(--line); border-radius: 8px; padding: 18px; width: max-content; max-width: 100%; overflow: auto; }
.org-tit { border: 2px solid #000; font-size: 40px; font-weight: 700; text-align: center; padding: 14px 24px; margin-bottom: 8px; }
table.org-tab { border-collapse: separate; border-spacing: 0 6px; width: 100%; }
table.org-tab th, table.org-tab td { border: 2px solid #000; height: 34px; padding: 0 8px; font-weight: 700; white-space: nowrap; }
.org-cli { font-size: 15px; text-align: center; min-width: 140px; }
.org-emb { text-align: center; min-width: 110px; }
.org-q { min-width: 110px; }
.org-q span { font-size: 13px; }
.org-q b { display: inline-block; min-width: 40px; margin-left: 8px; text-align: right; }
.org-in { width: 56px; margin-left: 8px; padding: 2px 4px; border: 1px solid transparent; border-bottom-color: var(--line, #ccc);
  background: transparent; font: inherit; font-weight: 700; text-align: right; }
.org-in:hover, .org-in:focus { border-color: var(--line, #999); background: #fff; outline: none; }
.org-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }  /* campo com o cursor bem visível (antes só uma borda cinza-clara) */
.org-in.erro-campo { background: var(--bad-soft); }
.org-cli { position: relative; }
.org-x { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--bad, #b00);
  font-size: 16px; line-height: 1; padding: 2px 4px; cursor: pointer; opacity: .45; }
.org-x:hover, .org-x:focus { opacity: 1; }
@media print { .org-x { display: none !important; } }
@media print { .org-in { border-color: transparent !important; background: transparent !important; } }
@media print { body.v-org nav, body.v-org #titulo-view, body.v-org .nav-abrir, body.v-org #organicas-conteudo .barra { display: none !important; } body.v-org .org-folha { border: 0; padding: 0; } }

/* Quadro TOTAL ORGÂNICAS (ASSAÍ): no fim da planilha, como no Excel */
.rtotorg { font-family: Arial, sans-serif; color: #000; align-self: start; }
.rtotorg-tit { border: 2px solid #000; font-weight: 700; font-size: 18px; text-align: center; padding: 2px 6px; }
.rtotorg-n { border: 2px solid #000; border-top: 0; text-align: center; font-size: 56px; line-height: 1.3; }
/* Ficha da loja na gaveta da guia: Editar no alto, à direita (Matheus, 12/11/2026) */
.floja .cad-topo { display: flex; justify-content: flex-end; margin: 0 0 4px; }
.floja label.semrot, .floja label.semrot input { margin-top: 0; }  /* campo sem rótulo: cola no título da seção */
/* Ficha da loja (gaveta da guia e tela Lojas), 24/11/2026: três níveis que não se confundem.
   Seção (NOME NA GUIA, ERP, PRODUTOS): caixa alta, cor da tinta, com uma linha acima separando os blocos.
   Rótulo do campo (Nome no ERP, CNPJ): 13px, negrito, sem caixa alta.
   Valor preenchido: 15px, sem negrito (Matheus: título em negrito, conteúdo não). Lendo, o campo não tem borda; no Editar a borda volta. */
#fcad .lbl { color: var(--ink); font-weight: 700; border-top: 1px solid var(--line); padding-top: 14px; margin: 18px 0 8px; }
#fcad label:not(.chk) { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
#fcad input:not([type=checkbox]), #fcad select.psel { font-size: 15px; font-weight: 400; margin-top: 3px; }
#fcad input:disabled { padding-top: 2px; padding-bottom: 2px; }
#fcad select.psel:disabled { appearance: none; -webkit-appearance: none; background: transparent; border-color: transparent; padding: 2px 0; color: var(--ink); opacity: 1; }
#fcad #cad-prods select.psel { font-size: 14px; }
.cad-dl { margin: 0; display: grid; gap: 10px; }
.cad-dl dt { font-size: 13px; font-weight: 700; color: var(--ink); }
.cad-dl dd { margin: 3px 0 0; font-size: 15px; font-weight: 400; color: var(--ink); line-height: 1.4; }
/* Histórico > Por loja: várias lojas com o nome digitado; a pessoa escolhe (antes abria a primeira sem avisar). */
.hescolha { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.xl td.hclic:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }  /* loja selecionada pelo Tab na guia do histórico */
.fxtab td:first-child, .fxtab td.meta { white-space: normal; }  /* nome comprido e "Alterado" quebram linha: Editar/Excluir ficam à vista no notebook */
.fxtab td:first-child { min-width: 140px; }
.fxtab td.meta { min-width: 90px; word-break: break-word; }

/* Gaveta "Produtos da rede": uma linha por código do cliente; sem produto fica destacada no topo */
.lin-prod { display: flex; gap: 8px; align-items: center; }
.lin-prod .psel { flex: 1; min-width: 0; }
.cod-lin { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--linha, #ddd); }
.cod-lin.sem-produto { background: #fff4d6; padding: 8px; border-radius: 6px; border-bottom: 0; margin-bottom: 4px; }
#fcad .cad-val { font-size: 15px; margin: 0 0 10px; }  /* nome na guia sem campo (quem não é administrador) */
