:root {
  --red: #E10600;
  --red-brand: #FF0000;
  --red-soft: #FFECEB;
  --ink: #0E0E10;
  --ink-2: #4A4A52;
  --ink-3: #8C8C96;
  --line: #E8E8EC;
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --ok: #12A150;
  --ok-soft: #E6F6EC;
  --warn: #E58A00;
  --warn-soft: #FFF3E0;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(14,14,16,.04), 0 6px 20px rgba(14,14,16,.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: inherit; }
.muted { color: var(--ink-3); margin: 0; }

.view { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

/* ---------- buttons ---------- */
.btn {
  height: 52px; padding: 0 20px; border-radius: 14px;
  font-weight: 600; font-size: 15px; letter-spacing: .1px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(225,6,0,.25); }
.btn.primary:disabled { background: #F1A7A5; box-shadow: none; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--ink); color: #fff; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input {
  height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card);
  padding: 0 16px; font-size: 16px; outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--ink); }

/* ---------- login ---------- */
.login { justify-content: center; padding: 32px 24px calc(32px + var(--safe-b)); background: var(--card); }
.login-box { width: 100%; text-align: center; }
.login-logo { width: 72%; max-width: 280px; }
.login-tag {
  display: inline-block; margin: 18px 0 40px; padding: 6px 14px; border-radius: 99px;
  background: var(--red-soft); color: var(--red); font-weight: 700; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-foot { margin-top: 28px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- appbar / home ---------- */
.appbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 20px 10px;
  background: rgba(245,245,247,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.appbar-logo { height: 38px; }
.home { padding: 6px 20px calc(28px + var(--safe-b)); }
.hello-kicker { margin: 4px 0 2px; font-size: 13px; color: var(--ink-3); }
.hello-title { margin: 0 0 18px; font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -.4px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px 14px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kpi.accent { background: var(--ink); color: #fff; }
.kpi.accent .kpi-l { color: #B9B9C2; }
.kpi-n { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 26px; line-height: 1.1; }
.kpi-l { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.tabs { display: flex; gap: 6px; background: #EAEAEE; border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; height: 38px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background .15s; }
.tab.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.orders { display: flex; flex-direction: column; gap: 12px; }
.order {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  text-align: left; width: 100%; display: flex; flex-direction: column; gap: 12px;
  transition: transform .08s;
}
.order:active { transform: scale(.985); }
.order-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.order-id { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 17px; margin: 0; }
.order-client { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.order-meta { display: flex; gap: 16px; font-size: 13px; color: var(--ink-3); }
.order-meta b { color: var(--ink); font-weight: 600; }
.order-bar { height: 6px; background: #EFEFF2; border-radius: 99px; overflow: hidden; }
.order-bar i { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.order.is-done .order-bar i { background: var(--ok); }

.tag { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 5px 9px; border-radius: 8px; white-space: nowrap; background: #EFEFF2; color: var(--ink-2); }
.tag.alta { background: var(--red-soft); color: var(--red); }
.tag.andamento { background: var(--warn-soft); color: var(--warn); }
.tag.concluido { background: var(--ok-soft); color: var(--ok); }

.empty { text-align: center; color: var(--ink-3); padding: 48px 0; }

/* ---------- picking ---------- */
.pick { background: var(--bg); }
.pick-bar { display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) 16px 12px; }
.pick-head { flex: 1; min-width: 0; text-align: center; }
.pick-order { margin: 0; font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 16px; }
.pick-client { margin: 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 6px; margin: 0 16px; background: #E4E4E8; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--red); border-radius: 99px; transition: width .35s ease; }
.pick-step { margin: 8px 16px 0; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 1px; }

.pick-main { flex: 1; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.pick-main.enter { animation: slideIn .28s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.addr { background: var(--ink); color: #fff; border-radius: 22px; padding: 16px 18px 18px; position: relative; overflow: hidden; }
.addr::after { content: ""; position: absolute; right: -54px; top: -64px; width: 130px; height: 130px; border-radius: 50%; border: 14px solid var(--red-brand); }
.addr-label { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: #9D9DA8; }
.addr-parts { display: flex; gap: 8px; margin-top: 10px; position: relative; z-index: 1; }
.addr-part { flex: 1; background: #1E1E22; border-radius: 12px; padding: 8px 4px 6px; text-align: center; }
.addr-part b { display: block; font-family: Montserrat, Inter, sans-serif; font-weight: 900; font-size: 30px; line-height: 1.05; }
.addr-part.long b { font-size: 24px; padding-top: 4px; }
.addr-part small { font-size: 10px; color: #9D9DA8; text-transform: uppercase; letter-spacing: .8px; }

.product { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.product-thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--red-soft); display: grid; place-items: center; flex-shrink: 0; }
.product-thumb svg { width: 30px; height: 30px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.product-info { min-width: 0; }
.product-desc { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.3; }
.product-meta { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.qty { background: var(--card); border-radius: var(--radius); padding: 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.qty-btn { width: 60px; height: 60px; border-radius: 16px; background: var(--bg); font-size: 28px; font-weight: 500; }
.qty-btn:active { background: #E6E6EA; }
.qty-center { flex: 1; text-align: center; }
.qty-val { font-family: Montserrat, Inter, sans-serif; font-weight: 900; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.qty-of { font-size: 22px; color: var(--ink-3); font-weight: 700; margin-left: 4px; }
.qty-l { font-size: 12px; color: var(--ink-3); }
.qty.full .qty-val { color: var(--ok); }
.qty.over .qty-val { color: var(--red); }
.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.12); } }

.scan { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 0 6px 0 14px; height: 56px; transition: border-color .15s; }
.scan:focus-within { border-color: var(--ink); }
.scan-ico { width: 22px; height: 22px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; flex-shrink: 0; }
.scan input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; height: 100%; min-width: 0; }
/* botão OK do campo de leitura: confirma o código digitado à mão; some com o campo vazio */
.scan-ok { height: 44px; padding: 0 16px; border-radius: 12px; background: var(--red); color: #fff; font-weight: 800; font-size: 16px; flex: none; }
.scan:has(input:placeholder-shown) .scan-ok { display: none; }
.scan-cam { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); display: grid; place-items: center; }
.scan-cam svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.scan.err { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.scan-msg { margin: -4px 4px 0; min-height: 18px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.scan-msg.ok { color: var(--ok); }
.scan-msg.err { color: var(--red); }

/* erro de leitura no topo: só existe no modo compacto (ver o fim do arquivo) */
.sp-alerta { display: none; }
.sp-curto { display: none; }
.pick-foot { display: flex; gap: 10px; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--bg); position: sticky; bottom: 0; }

/* ---------- done ---------- */
.done { justify-content: center; padding: 32px 20px calc(32px + var(--safe-b)); }
.done-box { text-align: center; }
.done h1 { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 26px; margin: 18px 0 4px; }
.done-check svg { width: 96px; height: 96px; }
.done-check circle { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 2; }
.done-check path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .15s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0 16px; }
.done-stats > div { background: var(--card); border-radius: var(--radius); padding: 14px 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.done-list { text-align: left; margin-bottom: 20px; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(14,14,16,.42); z-index: 20; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
  background: var(--card); border-radius: 26px 26px 0 0; padding: 10px 20px calc(20px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px; max-height: 86dvh; animation: up .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: #DCDCE1; margin: 0 auto 4px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet-title { margin: 0; font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 19px; }
.sheet-list { overflow-y: auto; display: flex; flex-direction: column; margin: 0 -4px; }

.line { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.line:last-child { border-bottom: 0; }
/* Separação: item que o gestor zerou antes de separar */
.line.sp-cortado { opacity: .5; }
.line.sp-cortado .line-desc { text-decoration: line-through; }
.line-addr { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 12px; background: var(--bg); padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.line-desc { flex: 1; min-width: 0; font-size: 14px; }
.line-desc small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.line-q { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.current { background: var(--red-soft); border-radius: 12px; border-bottom-color: transparent; padding-left: 10px; padding-right: 10px; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; display: grid; place-items: center; }
.dot.ok { background: var(--ok); border-color: var(--ok); }
.dot.falta { background: var(--warn); border-color: var(--warn); }
.dot svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 14px; border-radius: 99px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip.active { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---------- camera ---------- */
.cam { position: fixed; inset: 0; z-index: 40; background: #000; display: grid; place-items: center; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: relative; width: 74vw; max-width: 340px; aspect-ratio: 1.6; border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); border: 3px solid var(--red-brand); }
.cam-close { position: absolute; bottom: calc(28px + var(--safe-b)); left: 50%; transform: translateX(-50%); min-width: 160px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: fade .2s; max-width: 90vw; text-align: center;
}
a.btn { text-decoration: none; }

/* ===================== login por perfil ===================== */
.login-err { margin: -4px 0 0; color: var(--red); font-size: 13px; font-weight: 600; }
.quick { margin-top: 28px; }
.quick-t { margin: 0 0 10px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.quick-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-list button { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 6px; display: flex; flex-direction: column; gap: 2px; background: var(--card); transition: border-color .15s; }
.quick-list button:active, .quick-list button:hover { border-color: var(--red); }
.quick-list b { font-size: 13px; }
.quick-list small { font-size: 11px; color: var(--ink-3); }
.quick-list button:last-child:nth-child(odd) { grid-column: span 2; }

/* ===================== setor (Expedição / Montagem) ===================== */
.sx { justify-content: center; padding: calc(28px + var(--safe-t)) 22px calc(28px + var(--safe-b)); background: var(--card); }
.sx-box { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; }
.sx-logo { width: 46%; max-width: 180px; margin: 0 auto 26px; }
.sx-box .hello-title { margin-bottom: 18px; }
.sx-opts { display: flex; flex-direction: column; gap: 12px; }
.sx-opt { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; padding: 18px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); transition: border-color .15s, transform .1s; }
.sx-opt:active { transform: scale(.98); }
.sx-opt:hover { border-color: var(--red); }
.sx-opt.mont:hover { border-color: var(--ink); }
.sx-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; background: var(--red-soft); }
.sx-ico svg { width: 30px; height: 30px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sx-opt.mont .sx-ico { background: var(--ink); }
.sx-opt.mont .sx-ico svg { stroke: #fff; }
.sx-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sx-t b { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 20px; }
.sx-t small { font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.sx-cur { display: none; position: absolute; top: 10px; right: 12px; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--red); background: var(--red-soft); padding: 3px 7px; border-radius: 6px; }
.sx-opt.cur { border-color: var(--red); }
.sx-opt.mont.cur { border-color: var(--ink); }
.sx-opt.cur .sx-cur { display: block; }
.sx-opt.mont .sx-cur { color: #fff; background: var(--ink); }
.sx-note { margin: 16px 0 18px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.sx-out { margin: 14px auto 0; font-size: 14px; font-weight: 600; color: var(--ink-3); padding: 8px 16px; }

.setor-chip { margin-left: auto; margin-right: 10px; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px 0 12px; border-radius: 99px; background: var(--red-soft); color: var(--red); font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .9px; text-transform: uppercase; }
.setor-chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.setor-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.setor-chip.mont { background: var(--ink); color: #fff; }

/* ===================== embarque ===================== */
.carga-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.carga-row b { color: var(--ink); }
.plate { font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .8px; padding: 4px 8px; border: 2px solid var(--ink); border-radius: 6px; color: var(--ink); background: #fff; }
.carga-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.carga-facts > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.carga-facts small { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.carga-facts b { font-size: 14px; }
.load-n { min-width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.load-n svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.truck { background: var(--ink); color: #fff; border-radius: 22px; padding: 16px 18px; display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden; }
.truck::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--red-brand); }
.truck.full::after { background: #22C55E; }
.truck-l { display: flex; flex-direction: column; }
.truck-doca { font-family: Montserrat, Inter, sans-serif; font-weight: 900; font-size: 38px; line-height: 1; }
.truck-r { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.truck-plate { align-self: flex-start; font-family: Montserrat, Inter, sans-serif; font-weight: 800; letter-spacing: 1px; font-size: 15px; background: #fff; color: var(--ink); padding: 4px 10px; border-radius: 7px; border-top: 5px solid #1C4FBF; }
.truck-sub { font-size: 12px; color: #9D9DA8; }
.truck-count { position: relative; z-index: 1; text-align: right; font-family: Montserrat, Inter, sans-serif; display: flex; flex-direction: column; align-items: flex-end; }
.truck-count b { font-weight: 900; font-size: 34px; line-height: 1; }
.truck-count span { font-weight: 800; color: #9D9DA8; font-size: 16px; }
.truck-count small { font-family: Inter, sans-serif; font-size: 11px; color: #9D9DA8; }
.truck-count > b + span { margin-top: -2px; }

.last-read { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 2px solid transparent; }
.last-read.in { animation: bump .25s ease; }
.lr-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; flex-shrink: 0; }
.lr-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--ink-3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lr-txt { min-width: 0; }
.lr-t { margin: 0; font-weight: 700; font-size: 15px; }
.lr-s { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-3); }
.last-read.ok { border-color: var(--ok); background: var(--ok-soft); }
.last-read.ok .lr-ico { background: var(--ok); } .last-read.ok .lr-ico svg { stroke: #fff; }
.last-read.ok .lr-s { color: #0B7A3B; }
.last-read.err { border-color: var(--red); background: var(--red-soft); }
.last-read.err .lr-ico { background: var(--red); } .last-read.err .lr-ico svg { stroke: #fff; }
.last-read.err .lr-t, .last-read.err .lr-s { color: #A30400; }
.last-read.warn { border-color: var(--warn); background: var(--warn-soft); }
.last-read.warn .lr-ico { background: var(--warn); } .last-read.warn .lr-ico svg { stroke: #fff; }
.last-read.warn .lr-s { color: #9A5B00; font-weight: 600; }

.load-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; padding: 0 2px; }
.load-head span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); }
.load-head small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.load-head span { white-space: nowrap; }
.load-list { display: flex; flex-direction: column; gap: 10px; }
.lp { display: flex; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); border: 2px solid transparent; }
.lp.next { border-color: var(--ink); }
.lp.next .load-n { background: var(--ink); color: #fff; }
.lp.ok { opacity: .62; }
.lp.ok .load-n { background: var(--ok); }
.lp-body { flex: 1; min-width: 0; }
.lp-t { margin: 0; display: flex; justify-content: space-between; font-size: 15px; }
.lp-t b { font-family: Montserrat, Inter, sans-serif; font-weight: 800; }
.lp-t span { font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-t .obs-btn { margin: -4px 8px -4px auto; }
.obs-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px 0 7px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; flex-shrink: 0; }
.obs-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.obs-btn.warn { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.so-cli { margin: -4px 0 0; font-size: 14px; font-weight: 600; }
.so-box { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.so-box small, .so-at small { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-3); }
.so-list { display: flex; flex-direction: column; gap: 6px; }
.so-row { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; }
.so-row b { min-width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: Montserrat, Inter, sans-serif; font-weight: 800; }
.so-at { border: 1.5px solid var(--red); background: var(--red-soft); border-radius: 14px; padding: 10px 14px; }
.so-at small { color: var(--red); }
.so-at p { margin: 4px 0 0; font-size: 15px; font-weight: 700; }
.so-por { margin: 0; font-size: 12.5px; }
.lp-s { margin: 2px 0 10px; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vchips { display: flex; flex-wrap: wrap; gap: 8px; }
.vchip { width: 40px; height: 40px; border-radius: 11px; border: 2px dashed #CFCFD6; font-family: Montserrat, Inter, sans-serif; font-weight: 800; font-size: 15px; color: var(--ink-2); display: grid; place-items: center; }
.vchip.on { border: 2px solid var(--ok); background: var(--ok); }
.vchip svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.vchip.pop { animation: bump .35s ease; }
.done-check.warn circle { fill: var(--warn-soft); stroke: var(--warn); }
.done-check.warn path { stroke: var(--warn); }
.done .kpi-n { font-size: 22px; word-break: break-all; }
.carga .carga-row { justify-content: space-between; font-size: 14px; color: var(--ink); }
.carga-mot { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carga-mot svg { width: 16px; height: 16px; fill: none; stroke: var(--ink-3); stroke-width: 2; flex-shrink: 0; }
.carga-veic { display: flex; align-items: center; gap: 8px; color: var(--ink-2); white-space: nowrap; }

/* ===== Separação: lote, partes e doca de expedição ===== */
.tag.lote { background: #E8F0FE; color: #1A56DB; }
.order-note { margin: 0; font-size: 12px; color: var(--ink-3); }
.order-note.ok { color: var(--ok); font-weight: 600; }
.order.lote { border-left: 4px solid #1A56DB; }
.order.is-off { opacity: .45; }
.order.is-sel { outline: 2px solid var(--red); }
.order-cb { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.order.is-sel .order-cb { background: var(--red); border-color: var(--red); }
.order-cb svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 3; }
.lote-peds { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--ink-2); }
.lote-peds span { display: inline-flex; align-items: center; gap: 6px; }
/* letra da caixa do carrinho no lote ("cx-pos": não confundir com body.pos, o modo posto da Conferência) */
.cx-pos { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 6px; background: #1A56DB; color: #fff; font: 800 12px Montserrat, Inter, sans-serif; }
.cx-pos.big { min-width: 32px; height: 32px; font-size: 16px; border-radius: 9px; flex: none; }
.lote-bar { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; }
.lote-bar .btn { align-self: flex-start; padding: 9px 14px; font-size: 14px; }
.lote-bar .btn.on { border-color: var(--red); color: var(--red); }
.lote-dica { margin: 0; font-size: 13px; color: var(--ink-3); }
.sel-bar { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 16px calc(14px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.lote-box { display: flex; flex-direction: column; gap: 6px; }
.lote-h { margin: 0; font-size: 13px; color: var(--ink-2); }
.caixa { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 2px solid var(--line); }
.caixa.atual { border-color: #1A56DB; background: #F3F7FF; }
.caixa.cheia { border-color: var(--ok); }
.caixa.cheia .cx-pos { background: var(--ok); }
.caixa.falta { border-color: var(--warn); }
.caixa-ped { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.caixa-ped small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caixa-q { font: 800 20px Montserrat, Inter, sans-serif; font-variant-numeric: tabular-nums; }
.caixa-q small { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.doca-hero { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.doca-t { font: 800 18px Montserrat, Inter, sans-serif; margin: 6px 0 4px; }
.doca-hero .muted { margin: 0; font-size: 13px; }
.doca-list .line-desc { color: var(--ink-3); font-size: 12px; }
.done-doca { margin: 8px auto 0; display: inline-block; background: #E8F0FE; color: #1A56DB; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
#startUndo { margin-bottom: 8px; color: var(--red); }

/* ===== Separação: confirmar o endereço antes do produto ===== */
.addr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: relative; z-index: 1; }
.addr-status { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: #2A2A30; color: #fff; }
.addr.wait { box-shadow: 0 0 0 3px var(--red-brand); animation: addrPulse 1.6s ease-in-out infinite; }
.addr.wait .addr-status { background: var(--red-brand); }
.addr.ok .addr-status { background: var(--ok); }
@keyframes addrPulse { 50% { box-shadow: 0 0 0 6px rgba(225, 6, 0, .25); } }
.qty.locked { opacity: .45; }
.qty.locked .qty-btn:disabled, #btnShort:disabled { cursor: not-allowed; }
#btnShort:disabled { opacity: .5; }

/* ===== Separação: quantidade digitada (sem + e −) ===== */
#qtyInput { width: 3.2ch; min-width: 96px; border: 0; border-bottom: 3px solid var(--line); background: none; outline: none; text-align: center;
  font: 900 44px Montserrat, Inter, sans-serif; color: var(--ink); font-variant-numeric: tabular-nums; padding: 0; }
#qtyInput:focus { border-bottom-color: var(--red-brand); }
#qtyInput::placeholder { color: #D4D4DA; }
.qty.full #qtyInput { color: var(--ok); }
.qty.over #qtyInput { color: var(--red); }
.qty-center .qty-l { display: block; margin-bottom: 4px; }
#pickCard .product { transition: box-shadow .2s; }
#pickCard .product.wait { box-shadow: 0 0 0 3px var(--red-brand); }
#pickCard .product.ok { box-shadow: 0 0 0 2px var(--ok); }

/* =====================================================================
   MODO COMPACTO — coletores com tela pequena (ex.: 4", 320×480)
   Quando a tela é baixa, o mesmo app fica mais enxuto para que, na separação,
   endereço, produto, quantidade, campo de bipe, mensagem e botões caibam sem rolar.
   Celular grande (altura acima de 600 px) não muda nada.
   ===================================================================== */
@media (max-height: 600px) {
  /* separação */
  .pick-bar { padding: calc(4px + var(--safe-t)) 10px 4px; gap: 8px; }
  .pick-bar .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
  .pick-order { font-size: 14px; }
  .pick-client { font-size: 11.5px; }
  .progress { height: 4px; margin: 0 10px; }
  .pick-step { margin: 3px 10px 0; font-size: 10.5px; }
  .pick-main { padding: 4px 10px 6px; gap: 6px; }
  .addr { border-radius: 14px; padding: 7px 10px 8px; }
  .addr::after { display: none; }
  .addr-label { font-size: 10px; }
  .addr-status { font-size: 10.5px; padding: 2px 8px; }
  .addr-parts { gap: 5px; margin-top: 5px; }
  .addr-part { border-radius: 9px; padding: 3px 2px 2px; }
  .addr-part b { font-size: 25px; }
  .addr-part.long b { font-size: 19px; padding-top: 3px; }
  .addr-part small { font-size: 8.5px; }
  .product { padding: 7px 10px; gap: 8px; border-radius: 12px; }
  .product-thumb { display: none; }
  .product-desc { font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .product-meta { font-size: 11px; margin-top: 2px; }
  .qty { padding: 4px 10px; border-radius: 12px; }
  .qty-center { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
  .qty-val { font-size: 28px; }
  .qty-of { font-size: 16px; }
  .qty-center .qty-l { margin: 0; white-space: nowrap; font-size: 11.5px; }
  .qty-val { display: flex; align-items: baseline; white-space: nowrap; }
  #qtyInput { width: 4ch; min-width: 70px; border-bottom-width: 2px; }
  .pick-step { line-height: 1.2; }
  .scan { height: 44px; border-radius: 12px; padding: 0 4px 0 10px; gap: 8px; }
  .scan input { font-size: 15px; }
  .scan-ok, .scan-cam { height: 36px; border-radius: 10px; }
  .scan-cam { width: 36px; }
  .scan-msg { margin: -2px 2px 0; min-height: 15px; font-size: 11.5px; }
  .lote-box { gap: 4px; }
  .caixa { padding: 4px 8px; }
  .pick-foot { padding: 6px 10px calc(6px + var(--safe-b)); gap: 8px; }
  .pick-foot .btn { height: 44px; font-size: 14px; border-radius: 12px; padding: 0 12px; }
  .sp-longo { display: none; }
  .sp-curto { display: inline; }
  /* a tecla física do coletor que confirma aparece no botão (Enter) */
  .pick-foot [data-tecla]::after { content: attr(data-tecla); font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.1); }
  /* erro de leitura: faixa vermelha por cima de tudo */
  .sp-alerta { display: block; position: fixed; left: 0; right: 0; top: 0; z-index: 50; margin: 0; padding: calc(10px + var(--safe-t)) 12px 10px;
    background: var(--red); color: #fff; font-weight: 800; font-size: 14px; text-align: center; line-height: 1.25; overflow-wrap: anywhere; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

  /* tela inicial: saudação e números numa faixa só, para caber mais pedidos */
  .appbar-logo { height: 30px; }
  .home { padding: 2px 12px calc(16px + var(--safe-b)); }
  .hello-kicker { display: none; }
  .hello-title { font-size: 17px; margin: 0 0 8px; }
  .kpis { gap: 6px; margin-bottom: 8px; }
  .kpi { padding: 6px 8px; border-radius: 12px; flex-direction: row; align-items: baseline; gap: 5px; }
  .kpi-n { font-size: 18px; }
  .kpi-l { font-size: 10.5px; margin: 0; line-height: 1.1; }
  .tabs { margin-bottom: 8px; padding: 3px; }
  .tab { height: 32px; font-size: 13px; }
  .orders { gap: 8px; }
  .order { padding: 10px 12px; gap: 6px; }
  .order-id { font-size: 15px; }
  .order-client { font-size: 13px; }
}

/* ===== envio ao servidor (Fase 1b): linha de estado e ações recusadas ===== */
.sinc-estado { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.sinc-estado[hidden] { display: none; }
.sinc-estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.sinc-estado[data-tipo="warn"] { color: var(--warn); }
.sinc-estado[data-tipo="warn"]::before { background: var(--warn); }
.sinc-estado[data-tipo="err"] { color: var(--red); }
.sinc-estado[data-tipo="err"]::before { background: var(--red); }
.pick-head .sinc-estado { margin-top: 2px; font-size: 11px; }
.sinc-recusas { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 600; }
.sinc-recusas p { margin: 0 0 8px; }

/* ===== lote: quantidade por caixa (v50) ===== */
.caixa.espera { opacity: .55; }
.falta-todas p { margin: 4px 0 12px; font-weight: 600; }
.falta-todas .btn + .btn { margin-top: 8px; }
