/* Estoque: tema por cima do Bulma.
   Quase tudo neutro; cor só com significado:
   verde = ação principal, vermelho = acabou ou vencido, âmbar = acaba logo ou vai sobrar. */

@font-face {
  font-family: "Geist";
  src: url("geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --fundo: #fbfbfa;
  --lateral: #f3f3f1;
  --sup: #ffffff;
  --linha: #e8e7e4;
  --linha2: #f0efec;
  --hover: #f4f4f2;
  --t1: #1c1c1e;
  --t2: #66666b;
  --t3: #8e8e93;
  --ac: #1e6b58;
  --ac-escuro: #185848;
  --ac-claro: #e3f0eb;
  --pe: #c2362b;
  --pe-claro: #fbeae7;
  --at: #9a5b00;
  --at-claro: #fcefd8;
  --at-listra: repeating-linear-gradient(-45deg, #e9a23b 0 4px, #f6d49b 4px 8px);
  --az: #3a6ea5;
  --az-claro: #e6eef7;
  --tile: #f1f0ee;
  --sombra: 0 0 0 1px var(--linha), 0 2px 8px rgba(0, 0, 0, .04);
  --m-sup: #f2f5f2;
  --m-sup2: #e8ede9;
  --m-ind: #c9e6da;

  --bulma-family-primary: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bulma-primary-h: 165deg;
  --bulma-primary-s: 56%;
  --bulma-primary-l: 27%;
  --bulma-link-h: 165deg;
  --bulma-link-s: 56%;
  --bulma-link-l: 27%;
  --bulma-radius: 9px;
  --bulma-radius-small: 7px;
  --bulma-body-background-color: var(--fundo);
  --bulma-text: var(--t1);
  --bulma-border: var(--linha);
  --bulma-input-border-color: var(--linha);
  --bulma-input-shadow: none;
}

html { background: var(--fundo); }
body {
  font-family: var(--bulma-family-primary);
  color: var(--t1);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: var(--ac); }
a:hover { color: var(--ac-escuro); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.p { width: 15px; height: 15px; }
svg.i.g { width: 22px; height: 22px; stroke-width: 1.6; }
svg.i.gg { width: 30px; height: 30px; stroke-width: 1.4; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- moldura ---------- */

.app { display: flex; min-height: 100vh; }
.lado {
  flex: 0 0 236px; box-sizing: border-box; padding: 16px 12px;
  background: var(--lateral); border-right: 1px solid var(--linha);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: var(--t1); font-weight: 600; font-size: 15px; }
.marca:hover { color: var(--t1); }
.marca-ico { display: inline-flex; width: 28px; height: 28px; border-radius: 8px; align-items: center; justify-content: center; background: var(--ac); color: #fff; }
.marca-ico svg.i { width: 16px; height: 16px; stroke-width: 2; }
.busca-lado { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; margin: 0 0 8px; border-radius: 8px; background: #e9e9e6; color: var(--t3); }
.busca-lado input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--t1); outline: none; }
kbd { font-family: inherit; font-size: 11px; color: var(--t3); border: 1px solid #d6d5d1; border-radius: 4px; padding: 0 5px; background: transparent; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--t1); font-size: 14px; }
.nav a:hover { background: #e9e9e6; color: var(--t1); }
.nav a.ativo { background: #e4e4e1; font-weight: 600; }
.nav .rot { font-size: 11px; font-weight: 600; color: var(--t3); padding: 16px 10px 4px; letter-spacing: .02em; }
.cont { margin-left: auto; font-size: 12px; color: var(--t3); }
.cont.forte { color: var(--at); font-weight: 600; }
.eu { display: flex; align-items: center; gap: 8px; padding: 10px; margin-top: auto; }
.eu-conta { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin: -4px; padding: 4px; border-radius: 9px; color: var(--t1); }
.eu-conta:hover, .eu-conta.ativo { background: var(--hover); color: var(--t1); }
.eu-conta > span:last-child { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: #deddda; font-size: 11px; font-weight: 600; flex: none; color: var(--t1); }
.avatar.grande { width: 64px; height: 64px; font-size: 20px; }

.principal { flex: 1; min-width: 0; padding: 28px 36px 48px; box-sizing: border-box; }
.estreito { max-width: 820px; margin: 0 auto; }
.com-inspetor { display: flex; align-items: stretch; flex: 1; min-width: 0; }
.com-inspetor > .principal { flex: 1; }

.topo-movel, .nav-movel, .fab, .so-movel, .abas-movel, .veu, .mira, .voltar-movel, .fila-abrir { display: none; }
.barra-acao, .topo-tarefa { display: contents; }

.cab { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.cab h1, h1.titulo { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; flex: 1 1 auto; color: var(--t1); line-height: 1.2; }
.sub { font-size: 13px; color: var(--t3); margin-top: 3px; }
.voltar { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--t3); margin-bottom: 6px; }
.voltar:hover { color: var(--t1); }

/* ---------- controles ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 9px; font: inherit; font-size: 14px; font-weight: 500; border: 1px solid var(--linha);
  background: var(--sup); color: var(--t1); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: #d3d2ce; color: var(--t1); }
.btn.pri { background: var(--ac); border-color: var(--ac); color: #fff; }
.btn.pri:hover { background: var(--ac-escuro); }
.btn.pe { color: var(--pe); }
.btn.fan { border-color: transparent; background: transparent; color: var(--t2); }
.btn.fan:hover { background: #f1f0ee; }
.btn.grande { height: 44px; }
.btn:disabled, .btn[aria-disabled="true"] { background: #e9e9e6; border-color: #e9e9e6; color: var(--t3); cursor: not-allowed; }
.ico { border: 0; background: transparent; color: var(--t3); cursor: pointer; padding: 6px; display: inline-flex; border-radius: 8px; }
.ico:hover { background: #ecebe8; color: var(--t1); }
.mini {
  display: inline-flex; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; align-items: center; justify-content: center;
  border: 1px solid var(--linha); background: var(--sup); font: inherit; font-size: 13px; font-weight: 600; color: var(--t1); cursor: pointer;
}
.mini:hover { border-color: #c9c8c4; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px;
  color: var(--t2); background: transparent; border: 1px solid var(--linha); cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: #d3d2ce; color: var(--t1); }
.chip.ativo { background: var(--t1); border-color: var(--t1); color: #fff; }
.chip .n { opacity: .65; }
.pilula {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--linha); background: var(--sup); font: inherit; font-size: 14px; color: var(--t1);
}
.pilula select, .pilula input { border: 0; background: transparent; font: inherit; color: var(--t1); outline: none; padding: 0; }
.pilula select { font-weight: 600; cursor: pointer; }

.passo { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: 9px; overflow: hidden; background: var(--sup); }
.passo button { width: 34px; height: 34px; border: 0; background: transparent; font-size: 17px; color: var(--t2); cursor: pointer; font-family: inherit; }
.passo button:hover { background: var(--hover); color: var(--t1); }
.passo input, .campo .passo input { width: 52px; border: 0; border-radius: 0; padding: 0; height: 34px; border: 0; text-align: center; font: inherit; font-size: 16px; font-weight: 600; color: var(--t1); background: transparent; outline: none; font-variant-numeric: tabular-nums; }
.passo.grande button { width: 44px; height: 48px; font-size: 20px; }
.passo.grande input, .campo .passo.grande input { width: 84px; height: 48px; font-size: 24px; }
.passo input::placeholder { color: #c9c8c4; font-weight: 500; }

.campo { display: flex; flex-direction: column; gap: 4px; }
.campo > label, .campo > .r { font-size: 11px; color: var(--t3); }
.campo input, .campo select, .entrada-texto {
  height: 34px; border: 1px solid var(--linha); border-radius: 9px; padding: 0 10px; font: inherit; font-size: 14px;
  color: var(--t1); background: var(--sup); width: 100%; box-sizing: border-box;
}
.campo input:focus, .campo select:focus, .entrada-texto:focus { outline: 2px solid rgba(30, 107, 88, .3); outline-offset: 0; border-color: var(--ac); }
.campo .nv { height: 34px; display: flex; align-items: center; font-size: 13px; color: var(--t3); }

/* ---------- blocos ---------- */

.cartao { background: var(--sup); border: 1px solid var(--linha); border-radius: 14px; }
.cartao.pad { padding: 16px 18px; }
.rot-sec { font-size: 12px; font-weight: 600; color: var(--t2); margin-bottom: 8px; }
.sec { display: flex; align-items: baseline; gap: 8px; padding: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--t2); }
.sec .n { color: var(--t3); font-weight: 500; }
.sec-ico { display: flex; align-items: center; gap: 10px; margin: 34px 0 12px; font-size: 15px; font-weight: 600; }
.sec-ico:first-of-type { margin-top: 24px; }
.sec-ico .n { color: var(--t3); font-weight: 500; }
.sec-ico .ico-q { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; align-items: center; justify-content: center; }
.sec-ico .ico-q svg.i { width: 15px; height: 15px; stroke-width: 2; }
.q-az { background: var(--az-claro); color: var(--az); }
.q-pe { background: var(--pe-claro); color: var(--pe); }
.q-at { background: var(--at-claro); color: var(--at); }
.q-ro { background: #ece9f6; color: #5b4a9b; }
.q-ac { background: var(--ac-claro); color: var(--ac); }

.tile { display: inline-flex; width: 40px; height: 40px; border-radius: 11px; align-items: center; justify-content: center; background: var(--tile); color: #3a3a3c; flex: none; }
.tile.pe { background: var(--pe-claro); color: var(--pe); }
.tile.at { background: var(--at-claro); color: var(--at); }
.tile.g { width: 52px; height: 52px; border-radius: 14px; }
.tile.gg { width: 64px; height: 64px; border-radius: 18px; }
.tile.vazio { background: transparent; border: 1.5px dashed #d3d2ce; color: var(--t3); }

.vazio-tela { text-align: center; color: var(--t3); padding: 64px 16px; }
.vazio-tela svg.i { width: 40px; height: 40px; stroke-width: 1.4; margin-bottom: 10px; }

.barra { height: 8px; border-radius: 4px; background: var(--linha2); overflow: hidden; display: flex; }
.barra > span { display: block; height: 100%; }
.barra .usa { background: var(--ac); }
.barra .sobra { background: var(--at-listra); }
.barra .fraco { background: #c9d9d3; }

.msg { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.msg.erro { background: var(--pe-claro); color: var(--pe); }
.msg.ok { background: var(--ac-claro); color: var(--ac); }
.msg.aviso { background: var(--at-claro); color: var(--at); }

.pe-t { color: var(--pe); }
.at-t { color: var(--at); }
.ac-t { color: var(--ac); }
.t3 { color: var(--t3); }

/* ---------- lista do setor ---------- */

.linha {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px 150px 76px; align-items: center; gap: 14px;
  padding: 10px 12px; margin: 0 -12px; border-radius: 12px; cursor: pointer; color: var(--t1);
}
.linha:hover { background: var(--hover); color: var(--t1); }
.linha.sel { background: var(--sup); box-shadow: var(--sombra); }
.linha .nome { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha .msg-l { font-size: 13px; color: var(--t3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linha .msg-l.pe { color: var(--pe); }
.linha .msg-l.at { color: var(--at); }
.linha .dura { font-size: 13px; color: var(--t3); text-align: right; }
.saldo { text-align: right; white-space: nowrap; }
.saldo b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.saldo b.pe { color: var(--pe); }
.saldo small { font-size: 12px; color: var(--t3); margin-left: 4px; }
.acoes { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .1s; }
.linha:hover .acoes, .linha.sel .acoes, .linha:focus-within .acoes { opacity: 1; }
.setor-de { font-size: 11px; color: var(--t3); }

/* ---------- inspetor ---------- */

.inspetor {
  flex: 0 0 380px; box-sizing: border-box; padding: 24px 26px 40px; background: var(--sup); border-left: 1px solid var(--linha);
  display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.inspetor:empty { display: none; }
.insp-topo { display: flex; align-items: flex-start; gap: 14px; }
.insp-topo .nome { font-size: 19px; font-weight: 600; line-height: 1.25; }
.numeros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.numeros b { display: block; font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.numeros b.fraco { color: var(--t2); }
.numeros span { display: block; font-size: 12px; color: var(--t3); margin-top: 6px; }
.lote { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.lote .barra { grid-column: 1 / -1; height: 10px; border-radius: 5px; }
.lotes { display: flex; flex-direction: column; gap: 18px; }
.semanas { display: flex; align-items: flex-end; gap: 5px; height: 56px; }
.semanas span { flex: 1; border-radius: 3px; min-height: 3px; background: var(--ac); }
.semanas span.zero { background: var(--linha); }
.mov { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--linha2); font-size: 13px; }
.mov .q { font-weight: 600; font-variant-numeric: tabular-nums; }
.mov .d { color: var(--t3); font-size: 12px; grid-column: 1 / -1; }
.descarte-d { position: relative; justify-self: end; }
.descarte-d summary { list-style: none; }
.descarte-d summary::-webkit-details-marker { display: none; }
.descarte { position: absolute; right: 0; top: 34px; z-index: 5; display: flex; gap: 6px; align-items: center; padding: 10px; border-radius: 12px; background: var(--sup); box-shadow: 0 0 0 1px var(--linha), 0 8px 24px rgba(0, 0, 0, .1); }
.descarte .entrada-texto { width: auto; }

/* ---------- toast ---------- */

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; }
/* O aviso fica um minuto (o Desfazer vale 15) e para de sumir enquanto o
   mouse está em cima; o × fecha antes. */
.toast { display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-radius: 12px; background: var(--t1); color: #fff; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); animation: some 60s forwards; }
.toast:hover { animation-play-state: paused; }
.toast .fechar { border: 0; background: transparent; color: rgba(255, 255, 255, .6); cursor: pointer; padding: 4px; display: inline-flex; border-radius: 6px; }
.toast .fechar:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.toast .btn { height: 30px; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
.toast .btn:hover { border-color: #fff; }
.toast.ok { gap: 12px; padding: 12px 12px 12px 14px; }
.toast-ico { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--ac); color: #fff; flex: none; }
.toast-ico svg.i { width: 16px; height: 16px; stroke-width: 2.4; }
.toast-txt { display: flex; flex-direction: column; min-width: 0; }
.toast-txt b { font-size: 15px; font-weight: 600; }
.toast-txt span { font-size: 13px; color: rgba(255, 255, 255, .7); }
.selo-lancada { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: var(--ac-claro); color: var(--ac); font-size: 13px; font-weight: 600; letter-spacing: 0; }
@keyframes some { 0%, 97% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

/* ---------- hoje ---------- */

.tarefa { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 14px 16px; }
.tarefa .corpo { flex: 1 1 200px; min-width: 0; }
.tarefa .t { font-size: 15px; font-weight: 500; }
.tarefa .d { font-size: 13px; color: var(--t3); margin-top: 1px; }
.foto-mini { width: 220px; height: 64px; object-fit: cover; object-position: right center; border-radius: 9px; border: 1px solid var(--linha); background: var(--tile); }
.fornecedores { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.it { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--linha2); font-size: 14px; }
.it:first-child { border-top: 0; }
.it .q { font-size: 13px; text-align: right; }
.lin-sobra { display: grid; grid-template-columns: 40px minmax(0, 1fr) 180px 16px; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--linha2); color: var(--t1); }
.lin-sobra:first-child { border-top: 0; }
.lin-sobra:hover { background: #fafaf8; color: var(--t1); }
.lista-cartao > * + * { border-top: 1px solid var(--linha2); }

/* ---------- conferência ---------- */

.lado-a-lado { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.lado-a-lado > .larga { flex: 999 1 600px; min-width: 0; }
.lado-a-lado > .estreita { flex: 1 1 280px; max-width: 340px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; }
/* A lista do painel lateral rola sozinha: o botão de confirmar fica sempre à vista. */
.lado-a-lado > .estreita > .cartao { max-height: calc(100vh - 220px); overflow-y: auto; }
.item-conf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 472px) 76px; gap: 22px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--linha2); }
.item-conf:first-child { border-top: 0; }
.item-conf .nome { font-size: 15px; font-weight: 600; }
.faixas { display: flex; flex-direction: column; gap: 6px; }
.faixa { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--linha); background: #e9e9e6; }
.bolha { fill: transparent; stroke: transparent; stroke-width: .6; cursor: pointer; }
.bolha:hover { stroke: rgba(30, 107, 88, .45); }
.bolha.marcada { fill: rgba(30, 107, 88, .14); stroke: var(--ac); }
.bolha.duvidosa { fill: rgba(240, 170, 50, .3); stroke: #e0a030; stroke-width: .8; }
.total-conf { font-size: 30px; font-weight: 600; text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.total-conf small { display: block; font-size: 12px; font-weight: 500; color: var(--at); margin-top: 6px; }
.baixa { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--linha2); font-size: 14px; }
.baixa:first-child { border-top: 0; }
.baixa > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baixa .d { font-size: 12px; color: var(--t3); }
.selo-duvida { display: inline-flex; min-width: 22px; height: 22px; border-radius: 11px; align-items: center; justify-content: center; background: #f2c46b; color: #4a2e00; font-size: 12px; font-weight: 700; padding: 0 5px; }

/* ---------- entrada ---------- */

.item-ent { display: grid; grid-template-columns: 40px minmax(120px, 1fr) 148px 128px 90px 104px 28px; gap: 12px; align-items: end; padding: 14px 16px; border-top: 1px solid var(--linha2); }
.item-ent:first-child { border-top: 0; }
.item-ent > .tile, .item-ent > .info, .item-ent > .ico { align-self: center; }
.item-ent .nome { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-linha { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--linha2); }
.add-linha select { flex: 1; border: 0; outline: none; font: inherit; font-size: 15px; background: transparent; color: var(--t3); cursor: pointer; }
.sug { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px dashed #d3d2ce; background: transparent; font-size: 13px; color: var(--t2); cursor: pointer; font-family: inherit; }
.sug:hover { border-style: solid; color: var(--t1); }
.vai { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--linha2); font-size: 14px; }
.vai:first-child { border-top: 0; }
.vai .d { font-size: 12px; color: var(--t3); }
.vai .e { font-size: 12px; color: var(--ac); text-align: right; }

/* ---------- contagem ---------- */

.fila { flex: 0 0 272px; box-sizing: border-box; padding: 20px 14px; background: var(--lateral); border-right: 1px solid var(--linha); display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.fila .grupo { font-size: 11px; font-weight: 600; color: var(--t3); padding: 14px 10px 4px; }
.fila-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; border: 0; background: transparent; width: 100%; text-align: left; font-family: inherit; color: inherit; }
.fila-item:hover { background: #ecece9; }
.fila-item.atual { background: var(--sup); box-shadow: var(--sombra); font-weight: 600; }
.fila-item > span:last-child { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est { display: inline-flex; min-width: 20px; height: 20px; border-radius: 10px; align-items: center; justify-content: center; flex: none; font-size: 10px; font-weight: 700; box-shadow: inset 0 0 0 1.5px #cfceca; padding: 0 4px; box-sizing: border-box; }
.est.ok { background: var(--ac); color: #fff; box-shadow: none; }
.est.dif { background: var(--at-claro); color: var(--at); box-shadow: none; }
.progresso { height: 6px; border-radius: 3px; background: #e2e1de; margin-top: 10px; overflow: hidden; }
.progresso span { display: block; height: 100%; background: var(--ac); border-radius: 3px; }
.lote-cont { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto 84px; gap: 18px; align-items: center; padding: 18px 22px; border-top: 1px solid var(--linha2); }
.lote-cont:first-child { border-top: 0; }
.lote-cont .val { font-size: 16px; font-weight: 600; }
.lote-cont .sis { text-align: right; }
.lote-cont .sis small { display: block; font-size: 11px; color: var(--t3); }
.lote-cont .sis b { font-size: 17px; font-weight: 500; color: var(--t2); }
.igual { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px dashed #cfceca; background: transparent; font-size: 12px; color: var(--t2); cursor: pointer; font-family: inherit; }
.igual:hover { border-style: solid; color: var(--t1); }
.dif-l { font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- protocolos ---------- */

.lista-col { flex: 0 0 290px; box-sizing: border-box; padding: 24px 14px; border-right: 1px solid var(--linha); display: flex; flex-direction: column; gap: 4px; }
.prot { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; color: var(--t1); }
.prot:hover { background: #f1f0ee; color: var(--t1); }
.prot.sel { background: var(--sup); box-shadow: var(--sombra); }
.prot .n { font-size: 15px; font-weight: 600; }
.rec { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px 190px 28px; gap: 16px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--linha2); }
.rec:first-child { border-top: 0; }
.rec .barra { height: 6px; margin-top: 6px; }
.etiquetas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.etiqueta { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; background: var(--tile); font-size: 13px; color: var(--t2); }
.etiqueta input, .etiqueta select { border: 0; background: transparent; font: inherit; color: var(--t1); outline: none; width: 130px; }
.etiqueta select { width: auto; }
.titulo-edit { width: 100%; border: 0; background: transparent; font: inherit; font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--t1); outline: none; padding: 0; border-radius: 6px; }
.titulo-edit:focus { box-shadow: 0 0 0 2px rgba(30, 107, 88, .25); }
.destaque { border-radius: 14px; padding: 16px 18px; border: 1px solid var(--linha); background: var(--sup); }
.destaque b { display: block; font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.destaque span { display: block; font-size: 13px; margin-top: 6px; color: var(--t3); }
.destaque.at { background: var(--at-claro); color: var(--at); border-color: #f2d9a6; }
.destaque.at span { color: var(--at); }
.grade-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 24px 0; }

/* ---------- tabelas e formulários simples ---------- */

.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th { text-align: left; font-size: 12px; font-weight: 600; color: var(--t3); padding: 10px 12px; border-bottom: 1px solid var(--linha); white-space: nowrap; }
.tabela td { padding: 10px 12px; border-bottom: 1px solid var(--linha2); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .n { text-align: right; font-variant-numeric: tabular-nums; }
.rolagem { overflow-x: auto; }
.form-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grade .largo { grid-column: 1 / -1; }
.troca { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.troca input { width: 16px; height: 16px; accent-color: var(--ac); }
.acoes-form { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ---------- folhas ---------- */

.folha-previa { width: 100%; max-width: 520px; height: auto; border: 1px solid var(--linha); border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, .06); background: #fff; }
.linha-folha { display: grid; grid-template-columns: 40px minmax(0, 1fr) 120px 28px; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--linha2); }
.linha-folha:first-child { border-top: 0; }
.ocupacao { height: 8px; border-radius: 4px; background: var(--linha2); overflow: hidden; }
.ocupacao span { display: block; height: 100%; background: var(--ac); }
.ocupacao.cheia span { background: var(--pe); }
.soltar { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 24px; border: 2px dashed #d3d2ce; border-radius: 18px; background: var(--sup); color: var(--t2); cursor: pointer; text-align: center; }
.soltar:hover, .soltar.sobre { border-color: var(--ac); color: var(--ac); background: #f7fbf9; }
.soltar svg.i { width: 44px; height: 44px; stroke-width: 1.4; }
.soltar input { display: none; }
.giro { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--linha); border-top-color: var(--ac); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- entrar ---------- */

.login { display: flex; flex-wrap: wrap; min-height: 100vh; }
.login-marca {
  flex: 1 1 520px; position: relative; overflow: hidden; background: var(--ac); color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; box-sizing: border-box; min-height: 420px;
}
.login-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; }
.login-logo .marca-ico { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.login-logo .marca-ico svg.i { width: 20px; height: 20px; }
.login-data { position: relative; z-index: 1; font-size: 13px; color: rgba(255, 255, 255, .6); }
.folha-marca {
  position: absolute; left: 50%; top: 50%; width: min(420px, 78%); height: auto;
  transform: translate(-46%, -50%) rotate(-7deg); filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .28)); pointer-events: none;
}
.login-lado { flex: 1 1 520px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; box-sizing: border-box; background: var(--fundo); }
.login-caixa { width: 100%; max-width: 360px; }
.login-titulo { margin: 0 0 22px; padding: 0 14px; font-size: 28px; font-weight: 600; letter-spacing: -.015em; color: var(--t1); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .login-titulo { margin: 0; padding: 0; }
.login-caixa.login-form .campo input { height: 44px; font-size: 16px; } /* 16px: o iOS não amplia a tela no foco */
.cab-conta { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.cab-conta > div { flex: 1; min-width: 0; }
.cab-conta .avatar { width: 52px; height: 52px; font-size: 17px; }
.cab-conta .titulo { margin: 0; }
.provisoria { margin-bottom: 12px; }
.senha-prov { display: block; margin-top: 2px; padding: 0; background: none; color: var(--t1); font-size: 20px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* ---------- celular ---------- */

@media (max-width: 860px) {
  .login { flex-direction: column; min-height: 100dvh; }
  .login-marca { flex: 0 0 300px; min-height: 0; padding: 28px 24px; }
  .folha-marca { width: 300px; left: auto; right: -70px; top: 60px; transform: rotate(-9deg); }
  .login-data { display: none; }
  .login-lado { flex: 1; align-items: flex-start; margin-top: -26px; border-radius: 26px 26px 0 0; padding: 30px 24px; position: relative; z-index: 2; }
  .login-titulo { font-size: 26px; padding: 0 4px; margin-bottom: 14px; }
  /* Moldura do celular (Material 3): busca no topo, quatro destinos
     embaixo, botão flutuante com a ação da tela. O #lado vira só esses
     pedaços (display: contents), então o SSE que redesenha o menu
     atualiza também os números da barra. */
  .app { flex-direction: column; }
  .lado { display: contents; }
  .lado > .marca, .lado .busca-lado, .lado .nav, .lado .eu { display: none; }
  .topo-movel {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top)) 16px 8px; background: var(--fundo);
  }
  .busca-movel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 8px 0 18px; border-radius: 26px; background: var(--m-sup2); color: var(--t2); }
  .busca-movel input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--t1); outline: none; }
  .busca-movel input::placeholder { color: var(--t2); }
  .topo-movel > .avatar { width: 40px; height: 40px; font-size: 13px; border: 0; cursor: pointer; background: #ddd8cf; color: #5d564b; }
  .conta:popover-open {
    position: fixed; inset: auto 16px auto auto; top: calc(66px + env(safe-area-inset-top)); margin: 0; min-width: 220px;
    display: flex; flex-direction: column; padding: 8px 0; border: 0; border-radius: 16px; background: var(--sup);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .1); color: var(--t1);
  }
  .conta .conta-eu { height: auto; display: flex; align-items: center; gap: 12px; padding: 8px 16px 12px; border-bottom: 1px solid var(--linha2); margin-bottom: 4px; }
  .conta a, .conta button { display: flex; align-items: center; gap: 14px; width: 100%; height: 48px; padding: 0 16px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--t1); cursor: pointer; }
  .conta a svg.i, .conta button svg.i { color: var(--t2); }
  .conta a:active, .conta button:active { background: var(--hover); }
  .nav-movel {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 12px 0 calc(16px + env(safe-area-inset-bottom)); background: var(--m-sup2);
  }
  .nav-movel a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--t2); -webkit-tap-highlight-color: transparent; }
  .nav-movel a.ativo { color: var(--t1); font-weight: 700; }
  .pilula-nav { position: relative; display: flex; align-items: center; justify-content: center; width: 64px; height: 32px; border-radius: 16px; transition: background .15s; }
  .nav-movel a.ativo .pilula-nav { background: var(--m-ind); color: var(--ac-escuro); }
  .nav-movel svg.i { width: 22px; height: 22px; }
  .selo { position: absolute; top: -3px; left: 36px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pe); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
  .fab {
    position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 19;
    display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px 0 16px; border-radius: 16px;
    background: var(--ac-claro); color: var(--ac-escuro); font-size: 15px; font-weight: 600;
    box-shadow: 0 3px 6px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .18);
  }
  .fab:hover { color: var(--ac-escuro); }
  .fab:active { box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
  .fab { transition: bottom .2s; }
  body:has(#toast .toast) .fab { bottom: calc(160px + env(safe-area-inset-bottom)); }
  .principal { padding: 4px 16px calc(176px + env(safe-area-inset-bottom)); }
  #toast { left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); transform: none; z-index: 21; }
  .toast { border-radius: 6px; background: #2f312f; min-height: 52px; }
  .toast .btn { border: 0; color: #8fd4b9; font-weight: 600; }
  .toast > span:first-child:not(.toast-ico), .toast-txt { flex: 1; min-width: 0; }
  /* Dois botões (Foi perda e Desfazer): o texto fica sozinho em cima. */
  .toast:has(.btn + .btn) { flex-wrap: wrap; justify-content: flex-end; row-gap: 0; padding-top: 14px; }
  .toast:has(.btn + .btn) > span:first-child { flex-basis: 100%; padding-right: 6px; }
  a, button, summary, .linha { -webkit-tap-highlight-color: transparent; }
  .btn:active, .chip:active { filter: brightness(.93); }
  .so-movel { display: inline-block; }
  .rotulo { display: none; }

  /* Hoje no celular */
  h1.titulo { font-size: 28px; margin-top: 10px; }
  #hoje .sec-ico, #hoje .sec-ico:first-of-type { margin: 22px 0 8px; font-size: 14px; color: var(--ac-escuro); letter-spacing: .01em; }
  #hoje .sec-ico .ico-q, #hoje .sec-ico .n { display: none; }
  #hoje .cartao { border: 0; border-radius: 16px; background: var(--m-sup); }
  #hoje .cartao + .cartao, #hoje .fornecedores { margin-top: 10px; }
  #hoje .lista-cartao > * + *, #hoje .lin-sobra { border-top-color: #e1e7e2; }
  #hoje .tarefa { flex-wrap: nowrap; gap: 14px; padding: 12px 8px 12px 16px; min-height: 68px; }
  #hoje .tarefa:has(.foto-mini) { padding-left: 12px; }
  #hoje .foto-mini { width: 96px; height: 56px; border-radius: 8px; flex: none; }
  #hoje .tarefa .t { font-size: 15.5px; }
  #hoje .tarefa .d { font-size: 13.5px; color: var(--t2); }
  #hoje .tarefa .btn { width: 44px; height: 44px; padding: 0; border-radius: 22px; border: 0; flex: none; }
  #hoje .tarefa .btn.pri { background: transparent; color: var(--t3); }
  #hoje .tarefa .btn.pe { background: var(--pe-claro); }
  #hoje .tarefa .btn svg.i { width: 20px; height: 20px; }
  #hoje .tarefa .btn:not(.pri, .pe) { width: auto; height: 40px; padding: 0 18px; border-radius: 20px; background: var(--ac-claro); color: var(--ac-escuro); font-weight: 600; }
  #hoje .fornecedores .cartao > div:last-child { justify-content: flex-end; margin-top: 4px !important; }
  #hoje .fornecedores .btn { flex: none !important; width: 40px; padding: 0; }
  #hoje .fornecedores { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #hoje .fornecedores .cartao.pad { padding: 14px 16px 10px; }
  #hoje .it { font-size: 15px; border-top-color: #e1e7e2; }
  #hoje .it .q { font-size: 14px; }
  #hoje .fornecedores .btn { height: 40px; border: 0; border-radius: 20px; background: var(--ac-claro); color: var(--ac-escuro); }
  #hoje .fornecedores .btn svg.i { width: 18px; height: 18px; }
  #hoje .lin-sobra { grid-template-columns: 40px minmax(0, 1fr) 16px; row-gap: 10px; padding: 12px 16px; }
  #hoje .lin-sobra > :nth-child(3) { grid-column: 2 / 3; grid-row: 2; }
  #hoje .lin-sobra > :nth-child(4) { grid-row: 1 / 3; grid-column: 3; }
  .com-inspetor { flex-direction: column; }
  .inspetor, .fila, .lista-col { position: static; height: auto; flex: none; border: 0; border-top: 1px solid var(--linha); width: auto; }
  .linha { grid-template-columns: 36px minmax(0, 1fr) auto 64px; }
  .linha .dura { display: none; }
  .acoes { opacity: 1; }
  .so-largo { display: none; }

  /* Estoque no celular: abas dos setores, filtros que rolam de lado, uma
     linha por produto com o nome inteiro e um só −1 (a entrada fica no
     botão flutuante e no painel). */
  .abas-movel {
    display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; margin: 0 -16px 14px;
    border-bottom: 1px solid var(--linha);
  }
  .abas-movel a {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px;
    font-size: 14.5px; font-weight: 600; color: var(--t2); -webkit-tap-highlight-color: transparent;
  }
  .abas-movel a small { font-size: 12px; font-weight: 500; color: var(--t3); }
  .abas-movel a.ativo { color: var(--ac-escuro); }
  .abas-movel a.ativo::after { content: ""; position: absolute; bottom: -1px; left: 50%; width: 72px; margin-left: -36px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ac); }
  .abas-movel a:active { background: var(--hover); }
  .principal:has(.abas-movel) .cab h1 { display: none; }
  .principal:has(.abas-movel) .cab { gap: 8px; margin-bottom: 12px; }
  .app > .abas-movel { margin: 0; }
  .cab .btn { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 14px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 34px; border-radius: 8px; }
  .chip.ativo { background: var(--m-ind); border-color: var(--m-ind); color: var(--ac-escuro); }
  .sec { padding: 22px 0 6px; font-size: 14px; color: var(--ac-escuro); }
  .linha { grid-template-columns: 40px minmax(0, 1fr) auto 48px; gap: 12px; margin: 0 -16px; padding: 10px 8px 10px 16px; border-radius: 0; -webkit-tap-highlight-color: transparent; }
  .linha:hover { background: none; }
  .linha:active, .linha.sel { background: var(--m-sup); box-shadow: none; }
  .linha .nome, .linha .msg-l { white-space: normal; overflow: visible; }
  .linha .nome { line-height: 1.3; }
  .linha .msg-l { font-size: 13.5px; line-height: 1.35; margin-top: 2px; }
  .linha .saldo { display: flex; flex-direction: column; align-items: flex-end; }
  .linha .saldo small { margin: 0; font-size: 11.5px; }
  .linha .acoes a.mini { display: none; }
  .linha .mini[data-baixa] { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--m-sup2); font-size: 15px; font-weight: 600; color: var(--t1); }
  .linha .mini[data-baixa]:active { background: var(--m-ind); }

  /* Painel do produto: folha que sobe de baixo, sobre um véu. Tocar no
     véu, arrastar para baixo ou o voltar do Android fecham (app.js). */
  .inspetor:not(:empty) {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; height: auto; max-height: 88dvh;
    padding: 0 20px calc(28px + env(safe-area-inset-bottom)); gap: 22px; border: 0; border-radius: 28px 28px 0 0;
    background: var(--m-sup); box-shadow: 0 -2px 16px rgba(0, 0, 0, .12); overscroll-behavior: contain;
    animation: folha-sobe .25s cubic-bezier(.2, 0, 0, 1);
  }
  .inspetor:not(:empty)::before { content: ""; flex: none; align-self: center; width: 32px; height: 4px; margin: 14px 0 -8px; border-radius: 2px; background: #c3c8c3; }
  .inspetor .insp-topo { position: sticky; top: 0; z-index: 1; margin: 0 -20px; padding: 10px 12px 10px 20px; background: var(--m-sup); align-items: center; }
  .inspetor .insp-topo .ico { width: 44px; height: 44px; justify-content: center; align-items: center; border-radius: 22px; }
  .inspetor .msg { border-radius: 12px; }
  .inspetor .numeros b { font-size: 28px; }
  .inspetor .btn { flex: 1; justify-content: center; height: 44px; border: 0; border-radius: 22px; background: var(--ac-claro); color: var(--ac-escuro); font-weight: 600; }
  .inspetor .btn.pri { background: var(--ac); color: #fff; }
  .inspetor .btn.pe { flex: none; background: var(--pe); color: #fff; }
  .inspetor .descarte { right: -8px; }
  .inspetor .lote { grid-template-columns: minmax(0, 1fr) auto 44px; row-gap: 4px; }
  .inspetor .lote .barra, .inspetor .lote > span:nth-child(4) { grid-column: 1 / 3; }
  .inspetor .lote > span:nth-child(4):empty { display: none; }
  .inspetor .descarte-d { grid-column: 3; grid-row: 1 / 3; }
  .inspetor .descarte-d summary { width: 44px; height: 44px; justify-content: center; align-items: center; border-radius: 22px; }
  .veu { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, .32); animation: aparece .2s; }
  .com-inspetor:has(> .inspetor:not(:empty)) > .veu { display: block; }
  body:has(.inspetor:not(:empty)) { overflow: hidden; }
  #toast { z-index: 31; }

  /* Ler folha: a mira mostra o que enquadrar (a folha inteira, com os 4
     quadrados dos cantos) e os botões ficam embaixo, perto do polegar. */
  #ler form { display: flex; flex-direction: column; gap: 12px; min-height: calc(100dvh - 300px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .mira { display: block; width: 58%; max-width: 230px; margin: auto; padding: 12px 0 28px; overflow: visible; }
  .mira-canto { fill: none; stroke: var(--ac); stroke-width: 5; stroke-linecap: round; }
  .mira-folha { fill: #fff; stroke: var(--linha); stroke-width: 1.5; }
  .mira-marca { fill: var(--t1); }
  .mira-linha { stroke: #dcdcd8; stroke-width: 7; stroke-linecap: round; }
  .mira-bolha circle { fill: none; stroke: #b5b5b0; stroke-width: 1.6; }
  .mira-x { stroke: var(--ac-escuro); stroke-width: 2.4; stroke-linecap: round; }
  #ler .soltar, #ler .soltar:hover { flex-direction: row; gap: 10px; height: 56px; padding: 0; border: 0; border-radius: 28px; background: var(--ac); color: #fff; }
  #ler .soltar svg.i { width: 22px; height: 22px; stroke-width: 2; }
  #ler .soltar .so-movel { display: inline; font-size: 16px; font-weight: 600; }
  #ler label.t3 { display: flex !important; align-items: center; justify-content: center; gap: 8px; height: 52px; margin: 0 !important; border-radius: 26px; background: var(--ac-claro); color: var(--ac-escuro); font-size: 15px !important; font-weight: 600; }
  #ler label.t3 svg.i { width: 18px; height: 18px; }
  #ler .msg { margin-bottom: 4px; }

  /* Conferência: tela de tarefa. Seta de voltar no topo, sem a busca e a
     barra de navegação; "Confirmar baixa" e o dia ficam fixos embaixo. */
  /* Tela com a ação fixa embaixo é tela de tarefa: sem busca e sem a barra
     de navegação (a seta de voltar e o voltar do Android saem dela). */
  body:has(.barra-acao, .acoes-form) .topo-movel, body:has(.barra-acao, .acoes-form) .nav-movel { display: none; }
  .voltar-movel { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; margin-left: -12px; border-radius: 24px; color: var(--t1); }
  .voltar-movel:active { background: var(--hover); }
  form[data-conferencia] .cab { position: sticky; top: 0; z-index: 5; flex-wrap: nowrap; gap: 6px; margin: 0 -16px 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; background: var(--fundo); }
  form[data-conferencia] .cab h1.titulo { margin: 0; font-size: 22px; }
  form[data-conferencia] .cab .sub { font-size: 12.5px; }
  form[data-conferencia] .cab .btn { width: 48px; height: 48px; padding: 0 !important; justify-content: center; border: 0; border-radius: 24px; background: none; }
  form[data-conferencia] .larga > .cartao { border: 0; background: none; box-shadow: none; overflow: visible; }
  form[data-conferencia] .item-conf { gap: 10px 12px; margin-bottom: 10px; padding: 14px 14px 12px; border: 0; border-radius: 16px; background: var(--m-sup); }
  form[data-conferencia] .total-conf { font-size: 28px; }
  form[data-conferencia] .faixa { border: 0; }
  .lado-a-lado > .estreita > .cartao { max-height: none; border: 0; border-radius: 16px; background: var(--m-sup); }
  .barra-acao {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--m-sup2);
  }
  .barra-acao .pilula { flex: none; height: 52px; padding: 0 14px; border: 0; border-radius: 26px; background: var(--sup); }
  .barra-acao .btn.grande { flex: 1; height: 52px; border-radius: 26px; font-size: 15.5px; }
  .barra-acao .pilula > .t3 { display: none; }
  .barra-acao input[type=date] { width: 118px; font-size: 15px; }
  .barra-acao input[type=date]::-webkit-calendar-picker-indicator { margin: 0; opacity: .55; }
  .barra-acao .btn.grande { min-width: 0; white-space: nowrap; }

  /* Contagem: um produto por tela. A fila vira a barra de cima (voltar,
     progresso, lista) e abre por cima de tudo pelo botão de lista;
     Concluir fica no canto de cima e Anterior/Pular/Próximo embaixo. Com o
     teclado aberto, o "próximo" do teclado segue (Enter, app.js). */
  .fila {
    position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center;
    gap: 0 6px; padding: calc(6px + env(safe-area-inset-top)) 140px 8px 4px; border: 0; background: var(--fundo); overflow: visible;
  }
  .fila > :not(.voltar, .fila-cab, .fila-abrir) { display: none; }
  .fila > .voltar { width: 48px; height: 48px; margin: 0; padding: 0 !important; justify-content: center; border-radius: 24px; color: var(--t1); }
  .fila > .voltar svg.i { width: 24px; height: 24px; }
  .fila-cab { padding: 0 !important; min-width: 0; }
  .fila-cab .sub { display: none; }
  .fila-cab .progresso { margin-top: 6px; height: 4px; }
  .fila-abrir { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 24px; background: none; color: var(--t1); cursor: pointer; }
  .fila-abrir svg.i { width: 24px; height: 24px; }
  .fila-abrir svg.i + svg.i, body.fila-aberta .fila-abrir svg.i:first-child { display: none; }
  body.fila-aberta .fila-abrir svg.i + svg.i { display: block; }
  .voltar:active, .fila-abrir:active { background: var(--hover); }
  body.fila-aberta { overflow: hidden; }
  body.fila-aberta .fila {
    position: fixed; inset: 0; z-index: 40; grid-template-columns: minmax(0, 1fr) 48px; align-content: start;
    padding: calc(6px + env(safe-area-inset-top)) 8px 32px 16px; overflow-y: auto; animation: aparece .15s;
  }
  body.fila-aberta .fila > * { display: flex; grid-column: 1 / -1; }
  body.fila-aberta .fila > .voltar, body.fila-aberta .fila > .grupo[hidden], body.fila-aberta .fila > .fila-item[hidden] { display: none; }
  body.fila-aberta .fila > .fila-cab { display: block; grid-column: 1; }
  body.fila-aberta .fila > .fila-abrir { grid-column: 2; }
  body.fila-aberta .fila > .busca-lado { height: 48px; margin: 10px 8px 6px 0 !important; padding: 0 16px; border: 0; border-radius: 24px; background: var(--m-sup2); }
  body.fila-aberta .fila-item { min-height: 48px; font-size: 15.5px; border-radius: 12px; }
  body.fila-aberta .fila-item.atual { background: var(--m-ind); box-shadow: none; }
  body.fila-aberta .fila .grupo { padding: 16px 10px 4px; font-size: 12.5px; color: var(--ac-escuro); }
  .concluir-linha { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 11; }
  .concluir-linha .btn { height: 40px; padding: 0 10px 0 16px; border: 0; border-radius: 20px; background: var(--ac-claro); color: var(--ac-escuro); font-weight: 600; }
  section[data-produto] { margin-top: 10px !important; }
  section[data-produto] > div:first-child { gap: 14px !important; margin-bottom: 16px !important; }
  section[data-produto] > div:first-child > div > div:first-child { font-size: 22px !important; line-height: 1.25; }
  [data-contagem] .cartao { border: 0; border-radius: 16px; background: var(--m-sup); }
  .lote-cont { gap: 12px; padding: 14px 16px; border-top-color: #e1e7e2; }
  .lote-cont .passo { display: flex; width: 100%; border: 0; border-radius: 28px; background: var(--sup); }
  .lote-cont .passo button { width: 56px; height: 56px; font-size: 24px; color: var(--t1); }
  /* O campo do número é uma caixa funda dentro da pílula, com o cursor e o
     contorno verde quando está ativo: parece lugar de digitar, não um traço. */
  .lote-cont .passo input, .lote-cont .campo .passo input { flex: 1; min-width: 0; height: 44px; margin: 6px 0; border-radius: 14px; background: var(--m-sup2); font-size: 26px; caret-color: var(--ac); }
  .lote-cont .passo input:focus { background: var(--sup); box-shadow: inset 0 0 0 2px var(--ac); }
  .lote-cont .passo input::placeholder { color: transparent; }
  .lote-cont .igual { height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--m-ind); color: var(--ac-escuro); font-size: 14px; font-weight: 600; }
  .lote-cont .dif-l { font-size: 18px; font-weight: 600; }
  [data-contagem] .add-linha { min-height: 48px; border-top-color: #e1e7e2 !important; }
  .barra-cont {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 8px; margin: 0 !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--m-sup2);
  }
  .barra-cont > div { flex: 1; justify-content: flex-end; }
  .barra-cont .btn { height: 52px; border-radius: 26px; font-size: 15.5px; }
  .barra-cont .btn[data-acao=anterior] { width: 52px; padding: 0; justify-content: center; background: var(--sup); }
  .barra-cont .btn[data-acao=anterior] svg.i { width: 22px; height: 22px; }
  .barra-cont .btn.pri { flex: 1; justify-content: center; }
  .barra-cont kbd { display: none; }

  /* Entrada: tela de tarefa como a conferência. Cada produto é um cartão
     com os campos em duas colunas; "Registrar entrada" fica fixo embaixo. */
  .topo-tarefa { display: flex; align-items: center; gap: 4px; position: sticky; top: 0; z-index: 5; margin: 0 -16px 6px; padding: calc(8px + env(safe-area-inset-top)) 16px 4px; background: var(--fundo); }
  .topo-tarefa h1.titulo { margin: 0 !important; font-size: 22px; }
  #entrada .larga > div:has(> .pilula) { margin-bottom: 14px !important; }
  #entrada .pilula { height: 44px; border-radius: 22px; }
  #entrada .larga > .cartao { border: 0; background: none; box-shadow: none; overflow: visible; }
  .item-ent {
    grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 12px 12px; margin-bottom: 10px;
    padding: 14px 8px 16px 14px; border: 0; border-radius: 16px; background: var(--m-sup);
  }
  .item-ent > .info { grid-column: 2 / 4; }
  .item-ent > .ico { grid-column: 4; grid-row: 1; width: 44px; height: 44px; justify-content: center; align-items: center; border-radius: 22px; }
  .item-ent .campo { grid-column: span 2; min-width: 0; }
  .item-ent .nome { white-space: normal; line-height: 1.3; }
  .item-ent .campo > .r { font-size: 12px; color: var(--t2); }
  .item-ent .campo input { height: 48px; border-radius: 12px; font-size: 16px; }
  .item-ent .passo { display: flex; height: 48px; border-radius: 12px; }
  .item-ent .passo button { width: 44px; height: 48px; font-size: 20px; color: var(--t1); }
  .item-ent .passo input, .item-ent .campo .passo input { flex: 1; min-width: 0; width: auto; height: 48px; font-size: 18px; }
  .item-ent .campo .nv { height: 48px; }
  #entrada .add-linha { min-height: 56px; border: 0; border-radius: 16px; background: var(--ac-claro); }
  #entrada .add-linha .tile.vazio { border: 0; background: transparent; color: var(--ac-escuro); }
  #entrada .add-linha select { color: var(--ac-escuro); font-weight: 600; }
  .sug { flex: none; white-space: nowrap; height: 36px; border-radius: 8px; }
  #entrada .estreita { margin-top: 18px !important; }
  /* A grade da entrada com painel ao lado (@container larga, mais abaixo) é
     do computador; aqui a tela empilha e vale a grade de cartão. */
  #entrada.lado-a-lado > .larga { container-type: normal; }
  .item-conf { grid-template-columns: 1fr 56px; }
  .item-conf .faixas { grid-column: 1 / -1; order: 3; }
  .lote-cont { grid-template-columns: 1fr auto; }
  .lado-a-lado > .estreita { position: static; max-width: none; }

  /* ---- Demais telas no celular (fim do bloco: vale sobre o que veio antes) ---- */
  .vazio-tela .btn { height: 48px; margin-top: 12px; padding: 0 24px; border-radius: 24px; font-size: 15px; }
  /* Cartões e listas no tom do Material 3, como no Hoje. */
  .cartao { border: 0; border-radius: 16px; background: var(--m-sup); box-shadow: none; }
  .lista-cartao > * + * { border-top-color: #e1e7e2; }
  .tarefa { gap: 14px; padding: 12px 12px 12px 16px; min-height: 64px; }
  .tarefa .d { color: var(--t2); }
  .destaque { border: 0; border-radius: 16px; background: var(--m-sup); }

  /* Seta de voltar das telas de detalhe: só o ícone, ao lado do título. */
  .principal .voltar, .principal .voltar-movel, .larga > .voltar {
    float: left; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    margin: 2px 4px 0 -12px; padding: 0; border-radius: 24px; color: var(--t1);
  }
  .principal .voltar svg.i, .principal .voltar-movel svg.i { width: 24px; height: 24px; }
  .principal .voltar + .cab, .principal .voltar + h1.titulo, .principal .voltar-movel + h1.titulo, .larga > .voltar + h1.titulo { margin-top: 10px; }
  .topo-tarefa > .voltar-movel, .cab > .voltar-movel { float: none; margin: 0 0 0 -12px; }

  /* Formulário (produto, ajustes): Salvar fixo embaixo. */
  .acoes-form {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; flex-wrap: nowrap; margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--m-sup2);
  }
  .acoes-form .btn { height: 52px; border-radius: 26px; }
  .acoes-form > .btn.pri { flex: 1; justify-content: center; font-size: 15.5px; }
  .form-grade { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .campo input, .campo select { height: 48px; border-radius: 12px; font-size: 16px; }
  .campo > label { font-size: 12.5px; color: var(--t2); }

  /* Folha (detalhe) e nova folha. */
  .principal > .cab > div:first-child { flex: 1 1 100% !important; }
  .principal > .cab .sub { font-size: 13px; }
  .linha-folha { grid-template-columns: 40px minmax(0, 1fr) 104px 44px; gap: 10px; padding: 10px 6px 10px 14px; border-top-color: #e1e7e2; }
  .linha-folha .entrada-texto { height: 44px; border-radius: 12px; }
  .linha-folha .ico { width: 44px; height: 44px; justify-content: center; align-items: center; }
  [data-folha-nova] .add-linha, .lista-col ~ .principal .add-linha { min-height: 56px; border-top-color: #e1e7e2; }

  /* Protocolos: a lista vira chips acima do editor, quebrando linha para
     que nenhum fique escondido fora da tela. */
  .lista-col { flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px; border: 0; }
  .lista-col > div:first-child { padding: 0 !important; flex: none; }
  .lista-col > div:first-child h1 { display: none; }
  .lista-col > div:first-child .ico { width: 44px; height: 44px; justify-content: center; align-items: center; border-radius: 12px; background: var(--ac-claro); color: var(--ac-escuro); }
  .prot { flex: none; gap: 0; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--linha); background: transparent; }
  .prot .n { font-size: 14px; white-space: nowrap; }
  .prot > .t3:not(:last-child) { display: none; }
  .prot > span:last-child { font-size: 12px !important; white-space: nowrap; }
  .prot.sel { border-color: var(--m-ind); background: var(--m-ind); box-shadow: none; }
  .prot.sel .n { color: var(--ac-escuro); }
  .lista-col + .principal { padding-top: 12px; }
  .lista-col + .principal form > div:first-of-type { flex-wrap: wrap; justify-content: flex-end; }
  .lista-col + .principal form > div:first-of-type > div:first-child { flex: 1 1 100% !important; }
  .titulo-edit { font-size: 24px; }
  .grade-2 { grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
  .destaque { padding: 14px 16px; }
  .destaque b { font-size: 26px; }
  .rec { grid-template-columns: 40px 112px minmax(0, 1fr) 44px; gap: 10px 12px; padding: 12px 6px 14px 14px; border-top-color: #e1e7e2; }
  .rec > .glifo { grid-column: 1; grid-row: 1; }
  .rec > div:not([id]) { grid-column: 2 / 4; grid-row: 1; }
  .rec > div:not([id]) > div:first-child { white-space: normal !important; }
  .rec > .ico { grid-column: 4; grid-row: 1; width: 44px; height: 44px; justify-content: center; align-items: center; }
  .rec > .passo { grid-column: 1 / 3; grid-row: 2; display: flex; height: 44px; border-radius: 12px; }
  .rec > .passo button { width: 40px; height: 44px; }
  .rec > .passo input { flex: 1; min-width: 0; height: 44px; }
  .rec > [id^="rec-da-"] { grid-column: 3 / 5; grid-row: 2; padding-right: 8px; }

  /* Movimentos: cada linha da tabela vira um item (produto e quantidade
     em cima; dia, tipo, validade, pessoa e origem embaixo). */
  .tabela.movs thead { display: none; }
  .tabela.movs, .tabela.movs tbody { display: block; }
  .tabela.movs tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 12px 16px; border-top: 1px solid #e1e7e2; }
  .tabela.movs tr:first-child { border-top: 0; }
  .tabela.movs td { padding: 0; border: 0; font-size: 13px; color: var(--t2); }
  .tabela.movs td:empty { display: none; }
  .tabela.movs td:nth-child(3) { order: -2; flex: 1 0 60%; font-size: 15px; font-weight: 500; color: var(--t1); }
  .tabela.movs td:nth-child(5) { order: -1; margin-left: auto; font-size: 15px; color: var(--t1); }
  .tabela.movs td:nth-child(1), .tabela.movs td:nth-child(2), .tabela.movs td:nth-child(4), .tabela.movs td:nth-child(6) { flex: none; }
  .tabela.movs td:nth-child(1)::after, .tabela.movs td:nth-child(2)::after, .tabela.movs td:nth-child(4)::after { content: " ·"; }
  .tabela.movs td:nth-child(6):not(:last-child)::after { content: ""; }
  .tabela.movs td:nth-child(7) { flex: 1 0 100%; }
  .cartao.rolagem:has(.movs) { overflow: visible; }
  form.chips .pilula { flex: none; height: 40px; border-radius: 20px; }

  /* Consumo: a tabela rola de lado com o nome do produto parado. */
  .tabela.consumo th:first-child, .tabela.consumo td:first-child { position: sticky; left: 0; z-index: 1; min-width: 132px; max-width: 150px; background: var(--m-sup); box-shadow: 1px 0 0 #e1e7e2; }
  .tabela.consumo td, .tabela.consumo th { padding: 10px; border-bottom-color: #e1e7e2; }

  /* Pessoas */
  #pessoas .tarefa, #nova-pessoa { flex-wrap: wrap; }
  #pessoas .btn:not(.confirma) { border: 0; border-radius: 20px; background: var(--ac-claro); color: var(--ac-escuro); font-weight: 600; }
}

/* Entrada com o painel ao lado e pouco espaço (a grade de uma linha só
   precisa de ~770 px): os campos descem para baixo do nome, em quatro
   colunas, e o botão de tirar fica no canto de cima. Depois do bloco do
   celular, que continua empilhando abaixo de 480 px. */
.lado-a-lado > .larga { container: larga / inline-size; }
@container larga (min-width: 480px) and (max-width: 779px) {
  .item-ent { grid-template-columns: 40px repeat(4, minmax(0, 1fr)) 28px; row-gap: 10px; }
  .item-ent > .tile { grid-row: 1 / 3; align-self: start; }
  .item-ent > .info { grid-column: 2 / 6; }
  .item-ent > .ico { grid-column: 6; grid-row: 1; }
  .item-ent > .campo { grid-row: 2; min-width: 0; }
  .item-ent .passo { display: flex; }
  .item-ent .passo input, .item-ent .campo .passo input { flex: 1; min-width: 0; width: auto; }
}

/* Confirmação no próprio botão (modelo "confirmar"). */
.btn.confirma { background: var(--pe); border-color: var(--pe); color: #fff; }
#protocolo-erro > .msg { margin-top: 16px; }
#primeiro-erro > .msg { margin: 0; }

@keyframes folha-sobe { from { transform: translateY(100%); } }
@keyframes aparece { from { opacity: 0; } }
