/* GRIP — bottle-green palette: deep forest to fresh green, brass accent, soft sage background */
:root {
  --bg: #f4f7f3; --card: #ffffff; --ink: #0f1f19; --muted: #5d6f66; --line: #e2eae4; --line2: #d2ded6;
  /* variable names kept from the first palette; the values are the bottle-green theme */
  --fuchsia: #0b6b4b; --violet: #0a3d2c; --coral: #b8913a; --gold: #c99a2e; --teal: #12806b; --sky: #2c6577; --indigo: #34566b; --plum: #0f4a35;
  --grad: linear-gradient(120deg, #072a1f 0%, #0a4632 42%, #0b6b4b 76%, #2c8a5c 100%);
  --grad-soft: linear-gradient(120deg, #e4f0e8 0%, #edf4ee 55%, #f5f1e3 100%);
  --ok: #1d8a57; --ok-soft: #e1f3e8; --warn: #b4720f; --warn-soft: #fbf0db; --bad: #c2392f; --bad-soft: #fbe6e3;
  --radius: 18px; --radius-s: 12px;
  --shadow: 0 1px 2px rgba(10,40,28,.05), 0 8px 24px -8px rgba(10,61,44,.14);
  --shadow-lg: 0 18px 50px -12px rgba(10,61,44,.35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Heebo, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 340px; background: radial-gradient(60% 120% at 85% -10%, rgba(11,107,75,.13), transparent 70%), radial-gradient(50% 100% at 0% 0%, rgba(10,61,44,.12), transparent 70%); pointer-events: none; z-index: -1; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: -.15em; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: var(--grad); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 24px -10px rgba(10,70,50,.6); }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo .mark { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 22px; backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.logo .wm { font-weight: 800; letter-spacing: .22em; font-size: 19px; line-height: 1; }
.logo .by { font-size: 11px; opacity: .85; letter-spacing: .04em; margin-top: 3px; }
.who { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 99px; padding: 5px 5px 5px 12px; cursor: pointer; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.who .av { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--fuchsia); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.who .rl { opacity: .8; }

/* nav */
.nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: flex; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; text-align: center; padding: 6px 2px; text-decoration: none; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; border-radius: 14px; font-weight: 500; }
.nav a .i { font-size: 22px; width: 46px; height: 30px; display: grid; place-items: center; border-radius: 99px; transition: background .15s; }
.nav a.on { color: var(--fuchsia); font-weight: 700; }
.nav a.on .i { background: linear-gradient(120deg, #e3f1e8, #e3f1e8); }
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 60px; bottom: auto; justify-content: center; gap: 6px; border-bottom: 1px solid var(--line); border-top: 0; padding: 8px; }
  .nav a { flex: 0 0 auto; flex-direction: row; gap: 4px; padding: 6px 16px 6px 10px; font-size: 15px; }
  .nav a .i { width: 30px; height: 30px; font-size: 19px; }
  .nav a.on { background: linear-gradient(120deg, #e3f1e8, #e3f1e8); }
  .nav a.on .i { background: none; }
}

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 24px; }
h1 { font-size: 24px; margin: 4px 0 14px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 26px 0 10px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.5; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }

/* hero (home) */
.hero { background: var(--grad); color: #fff; border-radius: 24px; padding: 20px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; margin-bottom: 16px; }
.hero::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero::before { content: ""; position: absolute; inset: -50px auto auto -30px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .hl { font-size: 14px; opacity: .9; }
.hero .hv { font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 4px; letter-spacing: -.02em; position: relative; z-index: 1; }
.hero .hv small { font-size: 18px; font-weight: 500; opacity: .85; }
.hero .hbar { height: 12px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; position: relative; z-index: 1; }
.hero .hbar i { display: block; height: 100%; background: #fff; border-radius: 99px; box-shadow: 0 0 12px rgba(255,255,255,.7); }
.hero .hs { font-size: 13px; opacity: .92; display: flex; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }

/* KPI */
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 13px; text-decoration: none; display: block; border: 1px solid var(--line); position: relative; overflow: hidden; transition: transform .12s; }
a.kpi:active { transform: scale(.98); }
.kpi .kic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; margin-bottom: 10px; color: #fff; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.bad .v { color: var(--bad); } .kpi.warn .v { color: var(--warn); } .kpi.ok .v { color: var(--ok); }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* color helpers for icon chips */
.c-fuchsia { background: linear-gradient(135deg, #2a9a6c, #0b6b4b); } .c-violet { background: linear-gradient(135deg, #2f6f58, #0a3d2c); }
.c-coral { background: linear-gradient(135deg, #d8b35c, #a37a23); } .c-teal { background: linear-gradient(135deg, #26a88a, #0d6e5c); }
.c-sky { background: linear-gradient(135deg, #4f8fa3, #2c6577); } .c-gold { background: linear-gradient(135deg, #e2be5e, #b8892a); }
.c-indigo { background: linear-gradient(135deg, #62869b, #34566b); } .c-plum { background: linear-gradient(135deg, #3f7d64, #1d4d3b); }
.c-red { background: linear-gradient(135deg, #e4685b, #c2392f); } .c-green { background: linear-gradient(135deg, #43b47c, #1d8a57); }

/* action tiles */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .tiles { grid-template-columns: repeat(4, 1fr); gap: 8px; } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(8, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 4px 10px; text-align: center; text-decoration: none; font-weight: 600; font-size: 12.5px; line-height: 1.25; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; box-shadow: var(--shadow); transition: transform .12s; }
.tile:active { transform: scale(.96); }
.tile .ti { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff; font-size: 23px; box-shadow: 0 6px 14px -6px rgba(10,61,44,.6); }
.tile.big { grid-column: span 2; flex-direction: row; justify-content: center; gap: 12px; font-size: 16px; font-weight: 800; background: var(--grad); color: #fff; border: 0; box-shadow: var(--shadow-lg); padding: 14px 10px; }
.tile.big .ti { background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }

/* buttons & inputs */
.btn { border: 1px solid var(--line2); background: #fff; border-radius: 13px; padding: 10px 16px; cursor: pointer; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; transition: transform .1s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 20px -8px rgba(11,107,75,.7); }
.btn.accent { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.soft { background: var(--grad-soft); border-color: transparent; color: var(--plum); }
.btn.danger { color: var(--bad); border-color: #f6c6d1; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, select, textarea { width: 100%; border: 1.5px solid var(--line2); background: #fff; border-radius: 13px; padding: 10px 13px; min-height: 46px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fuchsia); box-shadow: 0 0 0 4px rgba(11,107,75,.12); }
input[type=checkbox] { width: 21px; height: 21px; min-height: 0; accent-color: var(--fuchsia); }
.search { margin-bottom: 12px; padding-inline-start: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d6f86' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 13px center / 18px; }

/* lists & tables */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.li:last-child { border-bottom: 0; }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 700; }
.li .d { font-size: 13px; color: var(--muted); margin-top: 1px; }
.li .end { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.li .av { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px; flex: 0 0 auto; }
.li .gi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; background: var(--grad-soft); color: var(--fuchsia); font-size: 20px; }
a.li:hover, .li.click:hover { background: #f8faf7; cursor: pointer; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty .ei { font-size: 34px; color: #c6d5cb; display: block; margin: 0 auto 6px; }
.tbl-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f7faf6; }
td.n, th.n { text-align: left; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 800; background: var(--grad-soft); }
td a { color: var(--plum); font-weight: 600; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--line); color: var(--ink); font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.factory { background: #e6efe8; color: var(--violet); } .chip.transit { background: var(--warn-soft); color: var(--warn); }
.chip.stock { background: #e3f0ff; color: #1f6fd1; } .chip.sold { background: #e3f1e8; color: var(--fuchsia); }
.chip.bad { background: var(--bad-soft); color: var(--bad); } .chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.plain::before { display: none; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding: 4px; background: #fff; border-radius: 99px; border: 1px solid var(--line); box-shadow: var(--shadow); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex: 0 0 auto; border: 0; background: none; border-radius: 99px; padding: 8px 15px; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; font-weight: 600; color: var(--muted); }
.tabs .on { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px rgba(11,107,75,.7); }
.alert { border-radius: 15px; padding: 13px 14px; margin-bottom: 10px; font-size: 14px; display: flex; gap: 11px; align-items: center; text-decoration: none; font-weight: 600; border: 1px solid transparent; }
.alert .ai { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: 0 0 auto; background: rgba(255,255,255,.7); }
.alert .go { margin-inline-start: auto; font-size: 18px; opacity: .6; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border-color: #ffd0da; } .alert.warn { background: var(--warn-soft); color: #8d4c05; border-color: #ffe0b0; } .alert.ok { background: var(--ok-soft); color: var(--ok); border-color: #c2eedd; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; font-size: 13px; counter-reset: s; }
.steps span { flex: 1; text-align: center; padding: 8px 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.steps span.on { background: var(--grad); color: #fff; border-color: transparent; }

/* customer summary banner */
.cust-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.cust-head .big-av { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 24px; box-shadow: var(--shadow-lg); flex: 0 0 auto; }
.cust-head h1 { margin: 0; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.quick .btn { flex-direction: column; gap: 4px; min-height: 64px; font-size: 13px; }
.quick .btn .ic { font-size: 20px; }

/* scanner */
.scan-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 12px; margin: 12px 0; }
.scanner { background: #07140f; border-radius: 14px; overflow: hidden; position: relative; }
.scanner:empty { display: none; }
.scanner video { width: 100% !important; display: block; }
.scan-bar { display: flex; gap: 8px; }
.scan-bar .btn.cam { flex: 0 0 auto; }
.scan-bar form { display: flex; gap: 8px; flex: 1; }
.scan-bar input { flex: 1; direction: ltr; text-align: left; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .05em; }
.totals { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 14px 12px 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; z-index: 5; box-shadow: 0 16px 40px -12px rgba(10,24,18,.55); }
.totals b { font-size: 18px; }
.totals .tsub { font-size: 13px; opacity: .75; }
.totals .btn { background: var(--grad); color: #fff; border: 0; }
@media (min-width: 900px) { .totals { bottom: 14px; } }
.serial { font-family: ui-monospace, "SF Mono", Menlo, monospace; direction: ltr; unicode-bidi: embed; font-weight: 700; letter-spacing: .02em; }
.x { border: 0; background: var(--bad-soft); color: var(--bad); font-size: 16px; cursor: pointer; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.sig { border: 2px dashed var(--line2); border-radius: 14px; background: #fff; width: 100%; height: 180px; touch-action: none; display: block; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(10,24,18,.5); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-card { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(10,24,18,.25); }
/* iPhone: 92vh ignores Safari's toolbar/keyboard, so size to the visible screen and keep the form's main button reachable */
@supports (height: 100dvh) { .modal-card { max-height: 92dvh; } }
.modal-card form > .btn.primary.block:last-child { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); z-index: 2; box-shadow: 0 -14px 18px var(--bg); }
.modal-card::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line2); margin: -10px auto 14px; }
@media (min-width: 700px) { .modal { align-items: center; } .modal-card { border-radius: 26px; } .modal-card::before { display: none; } }
.toast { position: fixed; top: calc(72px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 14px; font-weight: 700; max-width: 92vw; box-shadow: 0 14px 40px -10px rgba(10,24,18,.5); }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }

/* login */
.login-wrap { min-height: 100vh; background: var(--grad); display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.login-wrap::before, .login-wrap::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.login-wrap::before { width: 420px; height: 420px; top: -140px; right: -120px; }
.login-wrap::after { width: 300px; height: 300px; bottom: -100px; left: -80px; }
.login { width: 100%; max-width: 380px; position: relative; z-index: 1; }
.login .lmark { width: 72px; height: 72px; border-radius: 22px; background: rgba(255,255,255,.2); display: grid; place-items: center; margin: 0 auto 14px; color: #fff; font-size: 40px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.login .brand { text-align: center; font-weight: 800; letter-spacing: .3em; font-size: 34px; color: #fff; margin-inline-start: .3em; }
.login .tag { text-align: center; color: rgba(255,255,255,.88); margin: 4px 0 26px; }
.login .card { padding: 22px; border-radius: 24px; box-shadow: 0 30px 60px -20px rgba(8,22,16,.5); border: 0; }
.login .foot { text-align: center; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 18px; }
body.anon { padding-bottom: 0; }
body.anon::before { display: none; }

/* doc view */
.doc-view { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 0; overflow: hidden; border: 1px solid var(--line); }
.doc-inner { padding: 20px; overflow-x: auto; }
.doc-band { background: var(--grad); color: #fff; padding: 18px 20px; display: flex; align-items: center; gap: 12px; }
.doc-band .db-title { font-size: 20px; font-weight: 800; margin: 0; }
.doc-band .db-sub { opacity: .9; font-size: 13px; }
.doc-band .mark { width: 42px; height: 42px; border-radius: 13px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-size: 24px; }
.doc-to { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 14px; }
.doc-to .lbl { font-size: 12px; color: var(--muted); }
.doc-sum { margin-top: 14px; margin-inline-start: auto; max-width: 300px; }
.doc-sum div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.doc-sum .grand { font-size: 18px; font-weight: 800; border: 0; background: var(--grad-soft); padding: 10px 12px; border-radius: 12px; margin-top: 6px; }
.doc-foot { display: flex; align-items: flex-end; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.sigbox { text-align: center; min-width: 180px; border-top: 1px solid var(--ink); padding-top: 6px; font-size: 13px; }
.sigimg { max-width: 220px; max-height: 90px; display: block; margin: 0 auto 4px; }

/* print */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; padding: 0; }
  body::before { display: none; }
  body.printing #app, body.printing .modal, body.printing .toast { display: none !important; }
  body.printing #print-area { display: block; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* A4 sheet of 24 labels, 70×35 mm: 3 columns × 8 rows = 280 mm, leaving 8.5 mm top and bottom */
.sheet { width: 210mm; height: 297mm; padding: 8.5mm 0 0; display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 35mm; page-break-after: always; overflow: hidden; background: #fff; }
.sheet:last-child { page-break-after: auto; }
.label { padding: 2mm 3mm; display: flex; gap: 2.6mm; align-items: center; overflow: hidden; font-family: Heebo, Arial, sans-serif; color: #000; direction: rtl; }
.label .qr { flex: 0 0 25mm; width: 25mm; height: 25mm; }
.label .qr svg { width: 25mm; height: 25mm; display: block; }
.label .lt { min-width: 0; flex: 1; line-height: 1.2; display: flex; flex-direction: column; gap: .5mm; }
.label .lb { display: flex; align-items: center; gap: 1.2mm; font-size: 7.5pt; letter-spacing: .25em; font-weight: 800; border-bottom: .3mm solid #000; padding-bottom: .8mm; }
.label .lb svg { width: 3.4mm; height: 3.4mm; stroke: #000; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.label .ls { font-family: ui-monospace, Menlo, monospace; font-size: 13pt; font-weight: 800; direction: ltr; text-align: right; letter-spacing: .03em; }
.label .lv { font-size: 7.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label .lw { font-size: 12pt; font-weight: 800; }
.label .lw small { font-size: 7pt; font-weight: 500; }
.doc-print { width: 210mm; min-height: 297mm; font-family: Heebo, Arial, sans-serif; color: #000; direction: rtl; background: #fff; }
.doc-print .doc-view { box-shadow: none; border: 0; border-radius: 0; }
.doc-print .doc-band { padding: 12mm 15mm 8mm; }
.doc-print .doc-inner { padding: 8mm 15mm; }
.doc-print table { font-size: 10pt; }

@media (max-width: 520px) { .hide-m { display: none; } th, td { padding: 10px 8px; } }
.doc-band { flex-wrap: wrap; }
.doc-band .db-title { white-space: nowrap; }
@media (max-width: 520px) { .doc-band > .spacer { flex-basis: 100%; height: 0; } .doc-band > div:last-child { text-align: right !important; } }

/* production steps */
.var-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.var-card { background: #fff; border: 1.5px solid var(--line2); border-radius: var(--radius); padding: 16px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; box-shadow: var(--shadow); text-decoration: none; font: inherit; color: inherit; }
.var-card:active { transform: scale(.97); }
.var-card.add { border-style: dashed; }
.var-dot { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 22px; flex: 0 0 auto; }
.weigh-row { display: flex; gap: 8px; align-items: center; }
.weigh-row input { flex: 1; font-size: 26px; font-weight: 800; text-align: center; min-height: 60px; direction: ltr; }
.weigh-row .unit { font-weight: 700; color: var(--muted); }
.weigh-row .btn { min-height: 60px; }
.lbl-n { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; z-index: 2; flex: 0 0 auto; }
.lbl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lbl-prev { position: relative; background: #fff; border: 1px solid var(--line2); border-radius: 10px; box-shadow: var(--shadow); height: 132px; overflow: hidden; }
.lbl-prev .label { width: 264.6px; height: 132.3px; transform-origin: top right; transform: scale(.94); position: absolute; top: 0; right: 0; }
.lbl-prev .label .qr, .lbl-prev .label .qr svg { width: 94px; height: 94px; flex-basis: 94px; }
.lbl-prev .label .ls { font-size: 17px; } .lbl-prev .label .lb { font-size: 10px; } .lbl-prev .label .lv { font-size: 11px; } .lbl-prev .label .lw { font-size: 16px; }
.lbl-prev .lbl-n { top: 8px; left: 10px; right: auto; }
table.compact th { white-space: normal; line-height: 1.2; } table.compact td, table.compact th { padding: 9px 6px; }
table.compact td:first-child { white-space: normal; min-width: 110px; }
.labels-card { flex-wrap: wrap; }
.labels-card.empty-pool { border-color: #ffd0da; background: #f7faf6; }
.card.how ol { margin: 6px 0 0; padding-inline-start: 22px; line-height: 1.7; }
.pool-line { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ok); margin: -2px 0 6px; }
.pool-line.bad { color: var(--bad); }
.pool-line a { color: var(--fuchsia); }
.how-line { margin: 0 0 4px; }
/* orders */
.stepper { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.stepper .btn.small { width: 40px; padding: 0; font-size: 20px; font-weight: 700; }
.stepper input { width: 58px; text-align: center; padding: 6px 4px; min-height: 40px; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sticky-go { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); margin-top: 14px; z-index: 5; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 16px 40px -12px rgba(10,24,18,.55); font-weight: 700; }
@media (min-width: 900px) { .sticky-go { bottom: 12px; } }
.ord-meta { grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .ord-meta { grid-template-columns: repeat(4, 1fr); } }
.li .gi.ord-new { background: linear-gradient(135deg, #2a9a6c, #0b6b4b); color: #fff; }
.perm-list { display: grid; gap: 4px; background: var(--bg, #f4f7f3); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.perm-list .perm { gap: 10px; font-size: 14.5px; padding: 5px 0; cursor: pointer; }
.li .go { color: var(--muted); font-size: 18px; }
/* work order */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
div.f { margin-bottom: 12px; }
div.f > .lab { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 0; display: flex; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px 6px; border: 1.5px solid var(--line2); border-radius: 13px; font-weight: 600; font-size: 14.5px; cursor: pointer; background: #fff; }
.seg input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px rgba(11,107,75,.2); }
table.work th { width: 40%; text-align: right; color: var(--muted); font-weight: 500; background: transparent; }
table.work td { font-weight: 700; }
.warranty { margin-top: 14px; font-size: 12.5px; line-height: 1.6; }
.wo-print { padding: 14mm 16mm; font-size: 12pt; }
.wo-print h1 { text-align: center; font-size: 20pt; text-decoration: underline; margin: 0 0 2mm; }
.wo-print h1 small { font-size: 11pt; text-decoration: none; font-weight: 500; }
.wo-print .wo-meta { text-align: center; margin-bottom: 6mm; font-size: 10pt; }
.wo-print table { width: 100%; border-collapse: collapse; margin-bottom: 7mm; font-size: 12pt; }
.wo-print th, .wo-print td { border: 1px solid #000; padding: 3mm 4mm; text-align: right; }
.wo-print th { width: 25%; font-weight: 500; background: #fff; }
.wo-print td.on { font-weight: 800; background: #eee; }
.wo-print h2 { font-size: 13pt; text-decoration: underline; font-style: italic; margin: 4mm 0 2mm; }
.wo-print .wo-notes { min-height: 40mm; border-bottom: 1px solid #000; padding: 2mm 0; background: repeating-linear-gradient(transparent 0 9mm, #000 9mm calc(9mm + 1px)); line-height: 9mm; }
.wo-print .wo-war { font-size: 10pt; font-style: italic; margin: 5mm 0 8mm; }
.wo-print .wo-money { width: 70%; margin: 0 auto; }
.wo-print .wo-money th { width: 50%; text-align: center; }
/* colour models */
.base-group { margin-bottom: 14px; }
.base-h { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.base-dot { display: inline-grid; place-items: center; min-width: 46px; height: 30px; padding: 0 10px; border-radius: 99px; background: var(--grad); color: #fff; font-weight: 800; font-size: 15px; direction: ltr; }
.model-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.model-grid .var-card { padding: 12px 8px; gap: 4px; }
.model-name { font-size: 19px; direction: ltr; }
.var-card.low { border-color: #f6c6d1; background: var(--bad-soft); }
table.models tr.base-row td { background: var(--grad-soft); font-weight: 800; color: var(--plum); font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
table.models tr.sub-total td { font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--line2); }
table.models td b { direction: ltr; unicode-bidi: embed; }
table.models th, table.models td { padding: 9px 6px; } table.models .sub { font-size: 11.5px; }
.model-grid .var-card .m-stock { font-size: 14px; } .model-grid .var-card .chip { margin-top: 2px; } .base-h b { color: var(--ink); }
.chip.assignee { background: var(--ok-soft); color: var(--fuchsia); } .chip.assignee .ic { width: 13px; height: 13px; }
.assign-line { display: flex; align-items: center; gap: 8px; padding: 0 16px 12px 16px; margin-top: -4px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 600; }
.assign-line span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.assign-line select { min-height: 36px; padding: 4px 10px; font-size: 14px; border-radius: 11px; flex: 1; max-width: 220px; background: var(--grad-soft); }
#ord-list > div:has(.assign-line) .li { border-bottom: 0; }
/* camera scanning */
.btn.cam-photo { flex: 0 0 auto; padding-inline: 12px; }
.scan-tip { font-size: 13px; color: var(--muted); text-align: center; margin: 6px 0 2px; }
.scan-bar { flex-wrap: wrap; } .scan-bar .btn.cam, .scan-bar .btn.cam-photo { flex: 1 1 0; } .scan-bar form { flex: 1 1 100%; }
.direct-opt { margin: 4px 0 12px; gap: 12px; align-items: flex-start; cursor: pointer; border: 1.5px solid var(--line2); } .direct-opt input { margin-top: 3px; flex: 0 0 auto; }
.direct-opt { flex-wrap: nowrap; } .direct-opt > div { flex: 1; min-width: 0; }
