/* Produção — estilos. Barra azul-marinho Bola de Fios; ecrãs de tablet com cartões grandes e etiquetas à escala real. */
:root {
  --navy: #2d3d4b; --navy-2: #3e5266; --on-navy: #ffffff;
  --bg: #f1f3f5; --surface: #ffffff; --sunk: #e4e8ec; --line: #d3dae1;
  --ink: #1d2732; --muted: #5f6d7b; --accent: #2d3d4b; --on-accent: #ffffff;
  --ok: #24704a; --ok-bg: #dff0e6; --warn: #8a5a0b; --warn-bg: #f6ead0; --hot: #a4321e; --hot-bg: #f7e0da; --info: #275b86; --info-bg: #dfe9f3;
  --extra: #6a3f8f; --extra-bg: #ece2f5;
  --label: #ffffff; --label-ink: #111111;
  --display: 'Montserrat', 'Segoe UI', system-ui, sans-serif; --body: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --navy: #22303c; --navy-2: #33475a; --on-navy: #ffffff;
  --bg: #141b22; --surface: #1c252e; --sunk: #25303b; --line: #34414e;
  --ink: #e9eef3; --muted: #a2b0bd; --accent: #9fc0dc; --on-accent: #10171e;
  --ok: #86d0a6; --ok-bg: #1d3528; --warn: #e8bf6e; --warn-bg: #3a2f17; --hot: #f19a86; --hot-bg: #42231c; --info: #9cc3e6; --info-bg: #1d2e3e;
  --extra: #cfa8ef; --extra-bg: #33264a;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --navy: #22303c; --navy-2: #33475a; --on-navy: #ffffff;
  --bg: #141b22; --surface: #1c252e; --sunk: #25303b; --line: #34414e;
  --ink: #e9eef3; --muted: #a2b0bd; --accent: #9fc0dc; --on-accent: #10171e;
  --ok: #86d0a6; --ok-bg: #1d3528; --warn: #e8bf6e; --warn-bg: #3a2f17; --hot: #f19a86; --hot-bg: #42231c; --info: #9cc3e6; --info-bg: #1d2e3e;
  --extra: #cfa8ef; --extra-bg: #33264a;
  color-scheme: dark }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--navy); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1200px; margin: 0 auto; }

header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--navy); color: var(--on-navy); }
header.top .wrap { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; padding-block: 10px; }
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.marca img.bf { height: 30px; width: auto; display: block; }
.marca .nome { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .02em; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); white-space: nowrap; }
.marca .nome small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
nav.tabs button { background: transparent; border: 0; color: var(--on-navy); padding: 8px 12px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 13.5px; opacity: .8; }
nav.tabs button[aria-selected="true"] { background: var(--on-navy); color: #2d3d4b; opacity: 1; }
.dir { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.quem-btn { background: var(--navy-2); border: 0; color: var(--on-navy); border-radius: 999px; padding: 7px 12px 7px 8px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--on-navy); color: #2d3d4b; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 12px; }
.dir img.navita { height: 28px; width: auto; display: block; opacity: .9; }
.aviso { background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.aviso .wrap { padding-block: 7px; }
main .wrap { padding-block: 22px 70px; }
h1 { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.15; margin: 0 0 4px; text-wrap: balance; color: var(--ink); letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 20px; max-width: 72ch; }
h2 { font-family: var(--display); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 10px; font-weight: 700; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid2.fila-det { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 880px) { .grid2, .grid2.fila-det { grid-template-columns: minmax(0, 1fr); } }
.painel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.campo input, .campo select, .ler input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; min-height: 48px; width: 100%; }
.linha { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 9px 15px; font-weight: 600; min-height: 44px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip.hot[aria-pressed="true"] { background: var(--hot); border-color: var(--hot); color: var(--surface); }

.lista-art { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.lista-art button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: baseline; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; flex-wrap: wrap; }
.lista-art button:last-child { border-bottom: 0; }
.lista-art button[aria-pressed="true"] { background: var(--sunk); box-shadow: inset 4px 0 0 var(--accent); }
.sku { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.origem { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.btn { border: 0; border-radius: 10px; padding: 14px 18px; font-family: var(--display); font-weight: 700; font-size: 15px; min-height: 52px; background: var(--accent); color: var(--on-accent); }
.btn.sec { background: var(--sunk); color: var(--ink); }
.btn.ok { background: var(--ok); color: var(--surface); }
.btn.grande { font-size: 20px; min-height: 78px; border-radius: 14px; }
.btn.peq { min-height: 42px; padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.acoes .btn { flex: 1 1 200px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.p-plan { background: var(--info-bg); color: var(--info); }
.p-curso { background: var(--warn-bg); color: var(--warn); }
.p-rot { background: var(--ok-bg); color: var(--ok); }
.p-fech { background: var(--sunk); color: var(--muted); }
.p-urg { background: var(--hot-bg); color: var(--hot); }
.p-extra { background: var(--extra-bg); color: var(--extra); }
.p-oport { background: var(--warn-bg); color: var(--warn); }

/* Etiquetas à escala: 60×40 mm a 5 px/mm; 40×25 mm a 6 px/mm. Papel branco nos dois temas. */
.etq-zona { background: var(--sunk); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; overflow-x: auto; }
.etq-zona .legenda { font-size: 13px; color: var(--muted); text-align: center; max-width: 46ch; }
.etq-fila { display: flex; gap: 34px 12px; flex-wrap: wrap; justify-content: center; padding-top: 24px; }
.etq60 { width: 300px; height: 200px; flex: none; background: var(--label); color: var(--label-ink); border-radius: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 18px rgba(20,30,40,.16); padding: 10px 12px; display: grid; grid-template-columns: 1fr 86px; grid-template-rows: auto 1fr auto; gap: 2px 8px; font-family: var(--display); }
.etq60 .n { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #111; padding-bottom: 3px; }
.etq60 .n b { font-size: 22px; font-weight: 800; }
.etq60 .n span { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border: 1.5px solid #111; border-radius: 3px; }
.etq60 .n span.urg { background: #111; color: #fff; }
.etq60 .prod { font-size: 11.5px; line-height: 1.2; font-weight: 600; overflow: hidden; }
.etq60 .prod strong { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; margin-top: 3px; }
.etq60 .qr { grid-row: 2 / 4; grid-column: 2; display: flex; align-items: center; justify-content: center; }
.etq60 .qr svg { width: 86px; height: 86px; }
.etq60 .pe { font-size: 10.5px; line-height: 1.3; font-weight: 500; }
.etq60 .pe b { font-size: 12.5px; }
.etq40 { width: 240px; height: 150px; flex: none; background: var(--label); color: var(--label-ink); border-radius: 5px; box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 18px rgba(20,30,40,.16); padding: 7px 9px 5px; display: flex; flex-direction: column; font-family: var(--display); position: relative; }
.etq40 .t { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.etq40 .nome { font-size: 11px; font-weight: 600; line-height: 1.15; margin-top: 2px; }
.etq40 .big { font-size: 15px; font-weight: 800; line-height: 1.1; }
.etq40 svg { width: 100%; height: 36px; margin-top: auto; }
.etq40 .lote { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8.5px; }
.etq40 .vezes { position: absolute; top: -25px; right: 0; background: var(--accent); color: var(--on-accent); font-family: var(--display); font-weight: 800; font-size: 12px; border-radius: 999px; padding: 3px 8px; }
.etq40 .vezes.extra { background: var(--extra); color: var(--surface); }
.etq40 .vezes.oport { background: var(--warn); color: var(--surface); }
.etq40.oport .t span:last-child { background: #111; color: #fff; padding: 1px 4px; border-radius: 2px; }

/* Quadro */
.quadro { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.coluna { background: var(--sunk); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.coluna h3 { margin: 0; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.coluna h3 .cont { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; text-align: left; width: 100%; }
.cartao .cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cartao .num { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.cartao .nome { font-weight: 700; line-height: 1.25; }
.cartao .meta { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.vazio { font-size: 14px; color: var(--muted); padding: 8px 2px; }

/* Posto */
.fila { display: flex; flex-direction: column; gap: 10px; }
.fila .cartao { padding: 14px 16px; border-width: 2px; }
.fila .cartao[aria-pressed="true"] { border-color: var(--accent); }
.ordem { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.grande-prod { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1.15; margin: 0; text-wrap: balance; }
.dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.dado { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.dado span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.dado b { font-family: var(--display); font-size: 19px; font-variant-numeric: tabular-nums; }
.ficha { border-top: 1px solid var(--line); padding-top: 12px; }
.ficha summary { font-weight: 700; cursor: pointer; padding: 6px 0; }
.ficha table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 6px; }
.ficha td { padding: 7px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ficha td:first-child { color: var(--muted); width: 44%; }
.passos { display: flex; gap: 6px; flex-wrap: wrap; }
.passo { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.passo.feito { background: var(--ok-bg); color: var(--ok); }
.passo.agora { background: var(--accent); color: var(--on-accent); }
.tablet-link { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--info-bg); color: var(--info); border-radius: var(--r); padding: 12px 14px; margin-bottom: 18px; }
.tablet-link p { margin: 0; flex: 1 1 280px; min-width: 0; }
.tablet-link code { font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* Rotulagem */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 24px; font-weight: 700; }
.stepper output { font-family: var(--display); font-size: 30px; font-weight: 800; min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.lote-linha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: end; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.lote-linha.extra { border-color: var(--extra); background: var(--extra-bg); }
.lote-linha.oport { border-color: var(--warn); background: var(--warn-bg); }
.lote-linha .novo { grid-column: 1 / -1; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.lote-linha .novo .sku { color: var(--ink); font-size: 14px; }
.lote-linha .tit { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.lote-linha .tira { background: transparent; border: 0; color: var(--muted); font-weight: 600; text-decoration: underline; padding: 6px; }
@media (max-width: 520px) { .lote-linha { grid-template-columns: minmax(0, 1fr); } }
.resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.destinos { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

table.tab { width: 100%; border-collapse: collapse; font-size: 15px; }
table.tab th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 8px; border-bottom: 2px solid var(--line); font-family: var(--display); }
table.tab td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: top; }
table.tab td.n, table.tab th.n { text-align: right; }
.rolar { overflow-x: auto; }
.sug { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sug:last-child { border-bottom: 0; }
.sug .txt { flex: 1 1 220px; min-width: 0; }
.sug .barra { height: 6px; background: var(--sunk); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.sug .barra i { display: block; height: 100%; background: var(--hot); }

/* Entrar */
.entrar { max-width: 760px; margin: 0 auto; }
.pessoas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pessoa { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; }
.pessoa[aria-pressed="true"] { border-color: var(--accent); }
.pessoa .avatar { width: 40px; height: 40px; font-size: 15px; background: var(--navy); color: var(--on-navy); }
.pessoa b { font-family: var(--display); }
.pessoa span { font-size: 13px; color: var(--muted); }
.bloqueado { text-align: center; padding: 40px 18px; }
.bloqueado b { display: block; font-family: var(--display); font-size: 20px; margin-bottom: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 20; }
.ler { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ler input { flex: 1 1 220px; font-family: var(--mono); font-size: 18px; background: var(--surface); }
.rodape { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px; justify-content: center; padding-block: 10px 30px; }
@media (prefers-reduced-motion: no-preference) { .toast { animation: sobe .25s ease-out; } @keyframes sobe { from { transform: translate(-50%, 12px); opacity: 0; } } }

/* app real */
.carregar { color: var(--muted); padding: 30px 4px; }
.erro-campo { color: var(--hot); font-weight: 600; font-size: 14px; }
.fila-imp { font-size: 13.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.fila-imp b { color: var(--ink); }
.menu-quem { display: flex; gap: 8px; align-items: center; }
select.mes { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 46px; }

/* Balcão: artigos com fotografia à esquerda, a venda à direita (fica à vista ao rolar) */
.bal-teste { background: var(--warn-bg); color: var(--warn); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; font-size: 14.5px; }
.bal-empresa { margin-bottom: 16px; }
.bal-empresa .chip { font-size: 16px; padding: 10px 20px; }
.bal-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 20px; }
.bal-artigos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bal-art { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; min-width: 0; }
.bal-art:hover, .bal-art:focus-visible { border-color: var(--accent); }
.bal-art:active { transform: scale(.98); }
.bal-foto { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--sunk); }
.sem-foto { display: grid; place-items: center; background: var(--sunk); color: var(--muted); font-family: var(--display); font-weight: 800; font-size: 28px; }
.bal-art-nome { font-size: 13.5px; font-weight: 600; line-height: 1.25; padding: 8px 9px 2px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bal-art-pe { margin-top: auto; padding: 4px 9px 9px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.bal-art-pe .sku { font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bal-art-pe b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.bal-venda { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.bal-linha { display: grid; grid-template-columns: 44px minmax(0, 1fr) 84px 96px auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bal-mini { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; font-size: 16px; }
.bal-linha-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bal-nome { border: 1px solid transparent; background: transparent; font-weight: 600; padding: 4px 6px; border-radius: 6px; width: 100%; }
.bal-nome:hover, .bal-nome:focus { border-color: var(--line); background: var(--bg); }
.bal-linha-txt .sku { padding-left: 6px; white-space: normal; }
.bal-num { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bal-num input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 42px; width: 100%; font-variant-numeric: tabular-nums; color: var(--ink); font-size: 15px; }
.bal-num s { font-size: 12px; }
.bal-sub { grid-column: 4; text-align: right; font-family: var(--display); font-variant-numeric: tabular-nums; }
.bal-linha .tira { grid-column: 5; grid-row: 1; background: transparent; border: 0; color: var(--muted); text-decoration: underline; font-weight: 600; padding: 6px; }
.bal-total { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--display); }
.bal-total span { font-weight: 700; color: var(--muted); }
.bal-total b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bal-cliente { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.bal-novo { background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 12px; align-items: end; }
.bal-hoje, .bal-stock { margin-bottom: 20px; }
.bal-art .sem-foto { aspect-ratio: 3 / 1; font-size: 20px; }
.bal-barra { display: none; }
@media (max-width: 880px) {
  .bal-barra { display: flex; align-items: center; gap: 8px; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 6;
    background: var(--accent); color: var(--on-accent); border: 0; border-radius: 12px; padding: 14px 16px; font-weight: 600; font-size: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
  .bal-barra b { font-family: var(--display); }
  .bal-barra span { margin-left: auto; font-family: var(--display); font-weight: 700; }
}
@media (max-width: 880px) { .bal-grid { grid-template-columns: minmax(0, 1fr); } .bal-venda { position: static; max-height: none; } main .wrap:has(.bal-barra) { padding-bottom: 110px; } }
@media (max-width: 560px) {
  .bal-artigos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bal-linha { grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr); }
  .bal-linha-txt { grid-column: 2 / 4; }
  .bal-linha .bal-num:nth-of-type(1) { grid-column: 1 / 3; grid-row: 2; }
  .bal-linha .bal-num:nth-of-type(2) { grid-column: 3; grid-row: 2; }
  .bal-sub { grid-column: 3; grid-row: 3; }
  .bal-linha .tira { grid-column: 1 / 3; grid-row: 3; justify-self: start; }
}

/* Estatísticas: barras de uma só série na cor da marca; grelha e eixos discretos; imprime em A4 */
.est-cab { display: flex; justify-content: space-between; align-items: start; gap: 12px 20px; flex-wrap: wrap; }
.est-cab .sub { margin-bottom: 14px; }
.est-acoes { flex: 0 1 auto; }
.est-acoes .btn { flex: 0 0 auto; }
.est-filtros { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.est-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
@media (max-width: 880px) { .est-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.est-kpi small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.est-kpi b { font-size: 24px; }
.est-linha { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.est-linha h2 { margin: 0; }
.est-linha .chip { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.est-medida { margin: 20px 0 12px; justify-content: flex-start; }
.est-grid { margin: 0 0 20px; }
.est-graf { margin-bottom: 0; }
#ecra > section.painel + section.painel, #ecra > .est-grid + section.painel, #ecra > section.painel + .est-grid { margin-top: 20px; }
.graf { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 220px auto; gap: 6px 8px; }
.graf-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; transform: translateY(-.5em); }
.graf-y span:last-child { transform: translateY(.5em); }
.graf-area { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--muted);
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
.graf-col { flex: 1 1 0; min-width: 0; height: 100%; background: transparent; border: 0; padding: 0; display: flex; align-items: flex-end; justify-content: center; border-radius: 4px 4px 0 0; }
.graf-col:hover, .graf-col:focus-visible { background: var(--sunk); }
.graf-col i { display: block; width: min(100%, 22px); min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; position: relative; }
.graf-col i b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px; font-size: 12px; font-weight: 700; font-style: normal; color: var(--ink); white-space: nowrap; font-family: var(--display); }
.graf-x { display: flex; gap: 2px; font-size: 11.5px; color: var(--muted); }
.graf-x span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; }
.graf-tip { position: absolute; top: 4px; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 2; }
.barras-h { display: flex; flex-direction: column; gap: 8px; }
.bh { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14.5px; }
.bh-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-trilho { height: 12px; background: var(--sunk); border-radius: 0 4px 4px 0; overflow: hidden; }
.bh-trilho i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bh-val { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; min-width: 5ch; }
.est-rodape { margin: 20px 0 0; font-size: 13px; }
table.est-larga { min-width: 760px; }
@media print { table.est-larga { min-width: 0; } }
@media (max-width: 520px) { .bh { grid-template-columns: minmax(0, 1fr) auto; } .bh-trilho { grid-column: 1 / -1; grid-row: 2; } .graf { grid-template-rows: 170px auto; } }
@media print {
  header.top, .aviso, .toast, .graf-tip, .est-acoes, .est-filtros .chips, .est-linha .chips, .est-medida, details.ficha, body::before { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main .wrap { padding: 0; max-width: none; }
  .painel, .dado { break-inside: avoid; border-color: #bbb; }
  .est-filtros select { border: 0; padding: 0; font-weight: 700; appearance: none; }
  .graf-col i, .bh-trilho i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .rolar { overflow: visible; }
}

/* Ecrã da produção (modo TV): ecrã inteiro, sem barra da app, letras que crescem com o ecrã (1920 px → base 20 px). Tema escuro forçado. */
body.modo-tv header.top, body.modo-tv .aviso { display: none; }
body.modo-tv main .wrap { max-width: none; padding: 0; }
body.ecra-tv { cursor: none; }
.tv { min-height: 100vh; height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: .8em; padding: .9em 1.2em .6em; font-size: clamp(13px, 1.04vw, 44px); background: var(--bg); overflow: hidden; }
.tv-topo { display: flex; align-items: center; gap: 1em 1.6em; background: var(--navy); color: var(--on-navy); border-radius: .6em; padding: .55em 1em; flex-wrap: wrap; }
.tv-topo .marca img.bf { height: 2em; }
.tv-topo .marca .nome { font-size: 1.3em; }
.tv-topo .marca .nome small { font-size: .5em; }
.tv-kpis { display: flex; gap: .6em; flex: 1 1 auto; justify-content: center; flex-wrap: wrap; }
.tv-kpi { display: flex; align-items: baseline; gap: .4em; background: var(--navy-2); border-radius: .5em; padding: .3em .8em; }
.tv-kpi b { font-family: var(--display); font-weight: 800; font-size: 2em; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-kpi span { font-size: .85em; font-weight: 600; opacity: .85; }
.tv-kpi.ok b { color: #9be0b6; }
.tv-kpi.hot { background: #7a2516; }
.tv-hora { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.tv-hora b { font-family: var(--display); font-weight: 800; font-size: 2.3em; font-variant-numeric: tabular-nums; }
.tv-hora span { font-size: .8em; opacity: .8; }
.tv-postos { display: grid; gap: .7em; min-height: 0; }
.tv-col { background: var(--sunk); border-radius: .6em; padding: .6em; display: flex; flex-direction: column; gap: .5em; min-width: 0; min-height: 0; overflow: hidden; }
.tv-cab { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: .4em; font-family: var(--display); font-size: 1.2em; font-weight: 800; color: var(--ink); text-transform: none; letter-spacing: 0; }
.tv-cab > span:first-child { display: flex; align-items: center; gap: .4em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-cab i { font-style: normal; font-size: .7em; width: 1.6em; height: 1.6em; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); color: var(--muted); flex: none; }
.tv-estado { font-size: .62em; font-weight: 800; padding: .25em .6em; border-radius: 999px; white-space: nowrap; }
.tv-estado.on { background: var(--ok-bg); color: var(--ok); }
.tv-estado.off { background: var(--warn-bg); color: var(--warn); }
.tv-espera { font-size: .85em; color: var(--muted); font-weight: 600; margin-top: -.2em; }
.tv-op { border-radius: .45em; padding: .45em .6em; display: flex; flex-direction: column; gap: .15em; border: 1px dashed var(--line); color: var(--muted); }
.tv-op.agora { background: var(--surface); border: 2px solid var(--ok); color: var(--ink); }
.tv-op.urg { border-color: var(--hot); }
.tv-op .l1 { display: flex; align-items: center; gap: .4em; flex-wrap: wrap; }
.tv-op .num { font-family: var(--mono); font-weight: 600; font-size: .9em; }
.tv-op .maq { font-family: var(--display); font-weight: 800; font-size: 1em; background: var(--ok); color: var(--surface); border-radius: .3em; padding: 0 .4em; }
.tv-op .pill { font-size: .7em; }
.tv-op .art { font-weight: 700; font-size: 1.05em; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-op.agora .art { color: var(--ink); }
.tv-op .l3 { display: flex; justify-content: space-between; gap: .3em .8em; flex-wrap: wrap; font-size: .85em; }
.tv-op.agora .l3 span:last-child { color: var(--ok); font-weight: 700; }
.tv-sep { font-size: .72em; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); padding-top: .4em; }
.tv-vazio { color: var(--muted); font-size: .95em; padding: .3em .1em; }
.tv-mais { margin-top: auto; text-align: center; font-weight: 700; color: var(--muted); font-size: .9em; }
.tv-rodape { display: flex; justify-content: space-between; align-items: center; gap: 1em; color: var(--muted); font-size: .75em; }
.tv-rodape .btn { font-size: 13px; }
.tv-erro { color: var(--hot); font-weight: 700; font-size: 1.3em; }
@media (max-width: 900px) {
  .tv { height: auto; overflow: visible; font-size: 15px; }
  .tv-postos { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tv-hora { align-items: flex-start; }
}
@media (max-width: 520px) { .tv-postos { grid-template-columns: minmax(0, 1fr) !important; } }

/* Folha A4 da OP (Criar OP e Quadro → janela de imprimir; pré-visualização reduzida no Criar OP) */
.folha { width: 186mm; min-height: 260mm; background: #fff; color: #111; font-size: 13pt; display: flex; flex-direction: column; gap: 7mm; padding: 0; box-sizing: border-box; }
.folha-prev { zoom: .42; padding: 12mm; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.f-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; border-bottom: 1.2mm solid #111; padding-bottom: 5mm; }
.f-marca { font-size: 11pt; letter-spacing: .12em; font-weight: 700; }
.f-tit { font-size: 14pt; margin-top: 2mm; }
.f-n { font-size: 40pt; font-weight: 800; line-height: 1.05; font-family: var(--mono, monospace); }
.f-urg { display: inline-block; margin-top: 2mm; padding: 1.5mm 4mm; background: #111; color: #fff; font-weight: 800; letter-spacing: .1em; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.f-qr svg { width: 46mm; height: 46mm; display: block; }
.f-nome { font-size: 22pt; font-weight: 700; }
.f-var { font-size: 26pt; font-weight: 800; margin-top: 1mm; }
.f-sku { font-family: var(--mono, monospace); font-size: 13pt; margin-top: 2mm; }
.f-qtd { font-size: 24pt; font-weight: 800; border: .8mm solid #111; padding: 4mm 5mm; }
.f-tab { width: 100%; border-collapse: collapse; font-size: 13pt; }
.f-tab th { text-align: left; width: 45mm; padding: 2.5mm 0; color: #444; font-weight: 600; vertical-align: top; }
.f-tab td { padding: 2.5mm 0; border-bottom: .3mm solid #ccc; }
.f-passos { display: flex; flex-wrap: wrap; gap: 3mm; }
.f-passo { border: .5mm solid #111; padding: 2.5mm 4mm; font-weight: 600; display: flex; gap: 2.5mm; align-items: center; }
.f-passo b { display: inline-grid; place-items: center; width: 7mm; height: 7mm; border-radius: 50%; background: #111; color: #fff; font-size: 11pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.f-pe { margin-top: auto; font-size: 11pt; color: #444; border-top: .3mm solid #999; padding-top: 3mm; }
#folha-imp { display: none; }
@page { size: A4; margin: 12mm; }
@media print {
  body.imp-folha > *:not(#folha-imp) { display: none !important; }
  body.imp-folha #folha-imp { display: block; }
  body.imp-folha { background: #fff; }
}

/* Etiqueta final 60×40 (mesma informação da 40×25, maior) */
.etq40.g60 { width: 300px; height: 200px; padding: 10px 12px 7px; }
.etq40.g60 .t { font-size: 10.5px; }
.etq40.g60 .nome { font-size: 14px; margin-top: 4px; }
.etq40.g60 .big { font-size: 20px; margin-top: 2px; }
.etq40.g60 svg { height: 58px; }
.etq40.g60 .lote { font-size: 10.5px; }

/* Inventário: menu lateral com o que se vai fazer */
.inv { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.inv-menu { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 12px; }
.inv-menu button { text-align: left; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 15px; }
.inv-menu button[aria-current="true"] { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.inv-corpo { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inv-l { align-items: end; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.inv-l .tira { background: transparent; border: 0; color: var(--muted); font-weight: 600; text-decoration: underline; padding: 12px 6px; }
@media (max-width: 760px) { .inv { grid-template-columns: 1fr; } .inv-menu { position: static; flex-direction: row; flex-wrap: wrap; } .inv-menu button { flex: 1 1 40%; padding: 10px 12px; font-size: 14px; } }
