/* MORO PWA – one stylesheet. Logical properties (inline-start/end) so RTL and LTR share every rule. */
:root {
  --navy: #16263f;
  --navy-2: #22385a;
  --teal: #00807f;
  --teal-soft: #dff1f0;
  --brand: #ee7326;
  --bg: #f0f2f5;
  --surface: #ffffff;
  --ink: #1c2633;
  --muted: #65717f;
  --line: #dde2e8;
  --filled: #e1f2fe;
  --food: #2e7d32;
  --food-soft: #d2ecd4;
  --pack: #e65100;
  --pack-soft: #ffe2be;
  --chilled: #1f5fa8;
  --chilled-soft: #d6e8fb;
  --final: #6a3fa0;
  --final-soft: #e9dcf7;
  --clean: #00838f;
  --clean-soft: #d2f1f4;
  --equip: #6d4c41;
  --equip-soft: #efe6e2;
  --danger: #c0392b;
  --danger-soft: #fde4e1;
  --warn: #b35c00;
  --warn-soft: #fff1df;
  --ok: #1e8449;
  --ok-soft: #dcf3e4;
  --radius: 8px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ---------- boot / login ---------- */
.boot { height: 100vh; display: grid; place-content: center; justify-items: center; gap: 8px; background: var(--navy); color: #fff; font-size: 22px; font-weight: 700; letter-spacing: .08em; }
.boot small { font-size: 13px; font-weight: 400; letter-spacing: .03em; color: #9fb0c8; }
.boot-help { display: grid; gap: 10px; justify-items: center; max-width: 340px; margin-top: 18px; font-size: 14px; font-weight: 400; letter-spacing: 0; text-align: center; }
.boot-help p { margin: 0; }
.boot-help small { color: #9fb0c8; }
.boot-help code { font-size: 11px; color: #9fb0c8; direction: ltr; word-break: break-word; }
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 24px 16px; }
.auth-card { width: min(380px, 100%); background: var(--surface); border-radius: 12px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.auth-card .logo { justify-self: center; width: 92px; height: 92px; }
.auth-card h1 { margin: 0; text-align: center; font-size: 20px; }
.auth-card p { margin: 0; color: var(--muted); text-align: center; font-size: 14px; }
.auth-card .lang { justify-self: center; }
.auth-card .tagline { display: grid; justify-items: center; gap: 2px; margin-top: -6px; }
.auth-card .tagline b { font-size: 22px; letter-spacing: .08em; color: var(--navy); }
.auth-card .tagline span { font-size: 12px; color: var(--muted); letter-spacing: .02em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--bg); color: var(--ink); display: flex; flex-direction: column; padding: 16px 12px; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; border-inline-end: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.brand img { width: 40px; height: 40px; }
.brand b { display: block; font-size: 18px; letter-spacing: .06em; color: var(--navy); }
.brand small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }
.nav-group { color: var(--muted); font-size: 12px; font-weight: 600; padding: 10px 12px 2px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: start; }
.nav-group:hover { color: var(--ink); }
.nav-arrow { font-size: 11px; transition: transform .15s; }
.nav-sec.folded .nav-arrow { transform: rotate(90deg); }
[dir="rtl"] .nav-sec.folded .nav-arrow { transform: rotate(-90deg); }
.nav-items { display: flex; flex-direction: column; gap: inherit; }
.nav-sec.folded .nav-items { display: none; }
/* a folded group with work waiting shows a dot on its title */
.nav-sec.folded:has(.badge:not([hidden])) .nav-group > span:first-child::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand, #f07c2a); margin-inline-start: 6px; vertical-align: middle; }
/* the screens as pill-shaped buttons, in the spirit of the round buttons of the home screen */
.nav { display: grid; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 5px 14px 5px 6px; border-radius: 999px;
  position: relative; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(22, 38, 63, .06); font-size: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.nav a .ico { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); flex: none;
  transition: background-color .18s ease, color .18s ease; }
.nav a:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(22, 38, 63, .10); border-color: var(--brand); }
.nav a:hover .ico { background: var(--brand); color: #fff; }
.nav a.active { border-color: var(--brand); font-weight: 600; box-shadow: 0 0 0 2px rgba(238, 115, 38, .18); }
.nav a.active .ico { background: var(--brand); color: #fff; }
.nav a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.nav .badge { margin-inline-start: auto; background: var(--brand); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 7px; }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding: 12px 4px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.side-foot button { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-align: center; padding: 6px 12px; cursor: pointer;
  transition: border-color .18s ease, color .18s ease; }
.side-foot button:hover { border-color: var(--brand); color: var(--brand); }
@media (prefers-reduced-motion: reduce) { .nav a, .nav a .ico, .side-foot button { transition: none; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 19px; }
.topbar .spacer { flex: 1; }
.shift-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; margin-bottom: 12px;
  background: var(--teal-soft); border-radius: var(--radius); }
.order-src { margin: 8px 0; flex-wrap: wrap; }
.inv-sums { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0; font-size: 14px; }
.trip-pick { display: grid; gap: 6px; margin: 8px 0 12px; }
.trip-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.trip-row b.num { min-width: 1.2em; color: var(--brand); }
.trip-depart { margin: 8px 10px; }
.arrival { display: inline-flex; align-items: center; gap: 8px; }
.arrival-temp { width: 100px; }
.trip-left { display: block; padding: 4px 10px; }
.rep-foot p { margin: 4px 0; font-size: .92em; }
.dr-review { margin-top: 10px; }
.dr-day { display: grid; grid-template-columns: auto 90px minmax(0, 360px) auto; justify-content: start; gap: 8px; align-items: center; margin-top: 8px; }
.rep-out, .rep-preview { min-width: 0; }
@media (max-width: 560px) { .dr-day { grid-template-columns: auto 1fr; } .dr-day input { grid-column: 1 / -1; } }
.trip-stop { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px; border-top: 1px solid var(--line); }
.trip-stop > b.num { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; flex: none; }
.trip-stop-main { flex: 1 1 150px; min-width: 0; display: grid; gap: 2px; }
.recv-short { display: inline-flex; gap: 4px; margin-inline-start: 6px; }
.recv-short[hidden] { display: none; }
.shop-groups { margin: 4px 0 12px; flex-wrap: wrap; }
.shop-groups small { opacity: .7; }
.req-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; max-height: 150px; overflow-y: auto; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--teal); background: var(--teal-soft); }
.chip small { color: var(--muted); }
.name-ar { display: block; }
.home-note { display: block; width: fit-content; margin: 0 auto 10px; padding: 8px 18px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 700; text-decoration: none; }
.home-note[hidden] { display: none; }
.top-user { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--navy); font-size: 14px; font-weight: 600; max-width: 40vw; }
.top-user bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user-ico { font-size: 13px; }
.sync { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync.offline .dot { background: var(--danger); }
.sync.pending .dot { background: var(--warn); }
.content { padding: 20px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }

.bottom-nav { display: none; }

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.card h2 { margin: 0; font-size: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-head h2 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { border: 0; border-radius: var(--radius); padding: 14px 16px; color: #fff; text-align: start; cursor: pointer; display: grid; gap: 2px; }
.kpi b { font-size: 30px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13.5px; opacity: .92; }
.kpi.k1 { background: var(--teal); } .kpi.k2 { background: var(--danger); } .kpi.k3 { background: var(--pack); } .kpi.k4 { background: #2f6fae; }
.kpi:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.kpi.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--navy); }
.kpi-hint { text-align: center; margin: 4px 0 0; }
.store-tabs { flex-wrap: wrap; margin-bottom: 8px; }
.dash-stores { margin-bottom: 12px; }

.btn { border: 0; border-radius: var(--radius); padding: 9px 16px; background: var(--teal); color: #fff; font-weight: 600; cursor: pointer; }
.btn:active { transform: translateY(1px); filter: brightness(.9); }
.btn.secondary { background: #e7ebf0; color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; padding: 12px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--teal); cursor: pointer; padding: 0; font-weight: 600; }

.field { display: grid; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input { width: 100%; border: 1px solid #c9d1da; border-radius: 6px; padding: 9px 11px; background: #fff; transition: background .15s; }
.input.filled { background: var(--filled); }
.input:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.input.pin { letter-spacing: .5em; text-align: center; font-size: 20px; direction: ltr; }
@keyframes flashErr { 0%, 60% { background: #ff7373; } 100% { background: #fff; } }
@keyframes flashOk { 0%, 60% { background: #a6e6b1; } 100% { background: inherit; } }
.flash-err { animation: flashErr .25s 3; }
.flash-ok { animation: flashOk .3s 2; }
.err-text { color: var(--danger); font-size: 13.5px; min-height: 1.2em; margin: 0; }

.tabs { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: #e7ebf0; border-radius: var(--radius); padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.table-wrap { overflow: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 7px 10px; text-align: start; border-bottom: 1px solid #eef1f4; white-space: nowrap; }
th { position: sticky; top: 0; background: #f5f7f9; font-weight: 600; color: var(--muted); z-index: 1; }
td.wrap { white-space: normal; min-width: 180px; }
tbody tr:hover { background: #f7fafc; }
tr.click { cursor: pointer; }
.pill { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.pill.food { background: var(--food-soft); color: var(--food); }
.pill.pack { background: var(--pack-soft); color: var(--pack); }
.pill.st-dry { background: var(--food-soft); color: var(--food); }
.pill.st-chilled { background: var(--chilled-soft); color: var(--chilled); }
.pill.st-pack { background: var(--pack-soft); color: var(--pack); }
.pill.st-final { background: var(--final-soft); color: var(--final); }
/* the lines of a price list being imported */
.pill.imp-new { background: var(--food-soft); color: var(--food); }
.pill.imp-update { background: var(--final-soft); color: var(--final); }
.pill.imp-same { background: var(--line, #eee); color: var(--muted, #666); }
.pill.imp-conflict, .pill.imp-dup, .pill.imp-bad { background: #fde8e8; color: #b42318; }
.pill.st-clean { background: var(--clean-soft); color: var(--clean); }
.pill.st-equip { background: var(--equip-soft); color: var(--equip); }
.pill.low { background: var(--danger-soft); color: var(--danger); }
tr.req-none td { background: var(--danger-soft); }
.fam-box { border: 1px solid var(--line, #d9dee5); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.fam-box summary { cursor: pointer; }
.cf-steps { margin-bottom: 10px; }
/* coffee stock cards: packed bags, roasted ground coffee, green coffee */
.cp-stat.cp-bags { border-top: 5px solid #0e7c74; background: #e6f4f2; }
.cp-stat.cp-roasted { border-top: 5px solid #6d4c41; background: #f3ebe7; }
.cp-stat.cp-green { border-top: 5px solid #5f8f2a; background: #eef5e4; }
.cp-kind { justify-self: start; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; color: #fff; margin-bottom: 4px; }
.cp-bags .cp-kind { background: #0e7c74; } .cp-roasted .cp-kind { background: #6d4c41; } .cp-green .cp-kind { background: #5f8f2a; }
.cf-roasts { display: flex; flex-direction: column; gap: 12px; }
.cf-roast { border: 1px solid var(--line, #d9dee5); border-radius: 12px; padding: 10px 12px; }
.ret-box { grid-column: 1 / -1; }
body.dept-return .form-card { background: #e8f5e9; border-color: #9ccc9f; }
.cost-fold summary { cursor: pointer; }
.cost-fold > div, .cost-fold > small, .cost-fold > button { margin-top: 4px; }
.recipe-cost { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.recipe-cost:empty { display: none; }
.kiosk-box { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line, #d9dee5); }
.kiosk-box h3 { margin: 0; }
.kiosk-box > summary { cursor: pointer; }
details.fold-card > summary { cursor: pointer; list-style: revert; }
details.fold-card > summary h2 { display: inline; margin: 0; }
details.fold-card[open] > summary { margin-bottom: 10px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.fam-field { border: 1px solid var(--line, #d9dee5); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.fam-brand { display: inline-block; border: 1px solid var(--line, #d9dee5); border-radius: 10px; padding: 1px 8px; margin: 2px; font-size: 13px; white-space: nowrap; }
tr.req-none td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
[dir=rtl] tr.req-none td:first-child { box-shadow: inset -4px 0 0 var(--danger); }
tr.req-none .pill.low { margin-inline-start: 6px; background: var(--danger); color: #fff; }
.pill.soon { background: var(--warn-soft); color: var(--warn); }
.pill.in { background: var(--ok-soft); color: var(--ok); }
.pill.out { background: #e8edf4; color: #3c4c63; }
.qty-neg { color: var(--danger); }
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }
.search { display: flex; gap: 10px; align-items: center; }
.search .input { flex: 1; }

.toast { position: fixed; inset-inline: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); margin-inline: auto; max-width: 460px; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 11px 16px; text-align: center; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.dialog-back { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.dialog { background: var(--surface); border-radius: 10px; width: min(420px, 100%); padding: 20px; display: grid; gap: 12px; }
.dialog h3 { margin: 0; font-size: 17px; }
.dialog .actions { display: flex; gap: 8px; justify-content: flex-end; }

.soon:not(.pill) { text-align: center; padding: 48px 16px; display: grid; gap: 8px; justify-items: center; color: var(--muted); }
.soon b { color: var(--ink); font-size: 18px; }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .content { padding: 14px 12px calc(90px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi b { font-size: 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; background: var(--navy); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
  .bottom-nav a { color: #c9d4e4; text-decoration: none; display: grid; justify-items: center; gap: 2px; font-size: 11.5px; padding: 4px 2px; border-radius: 8px; }
  .bottom-nav a.active { color: #fff; background: var(--navy-2); }
  .bottom-nav svg { width: 22px; height: 22px; }
  .table-wrap { max-height: 300px; }
}
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- work screens ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.form-card { transition: background .2s; }
body[data-zone="dry"] .form-card { background: var(--food-soft); border-color: #b9dcbc; }
body[data-zone="pack"] .form-card { background: var(--pack-soft); border-color: #f4c99a; }
body[data-zone="chilled"] .form-card { background: var(--chilled-soft); border-color: #a9c9ee; }
body[data-zone="final"] .form-card { background: var(--final-soft); border-color: #cfb6ec; }
body[data-zone="clean"] .form-card { background: var(--clean-soft); border-color: #9fdbe1; }
body[data-zone="dry"] .form-card h2 { color: var(--food); }
body[data-zone="pack"] .form-card h2 { color: var(--pack); }
body[data-zone="chilled"] .form-card h2 { color: var(--chilled); }
body[data-zone="final"] .form-card h2 { color: var(--final); }
body[data-zone="clean"] .form-card h2 { color: var(--clean); }
body[data-zone="equip"] .form-card { background: var(--equip-soft); border-color: #d7c3bb; }
body[data-zone="equip"] .form-card h2 { color: var(--equip); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid .wide, .form-grid .item-info, .form-grid .check.wide { grid-column: 1 / -1; }
.field.end { align-self: end; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.save-btn { min-width: 180px; padding: 11px 20px; font-size: 15.5px; }
.save-btn:focus-visible, .save-btn:focus { outline: 3px solid #ffc107; outline-offset: 2px; background: #ffc107; color: var(--ink); }
.form-status { margin: 0; min-height: 1.4em; font-weight: 600; font-size: 14px; color: var(--muted); }
.form-status.ok { color: var(--ok); } .form-status.err { color: var(--danger); } .form-status.warn { color: var(--warn); }
.item-info { margin: -4px 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; }
.item-info.low { color: var(--danger); font-weight: 600; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.zone { display: flex; gap: 6px; align-items: center; }
.zone-btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 14px; font-weight: 600; cursor: pointer; color: var(--muted); }
.zone.stores { flex-wrap: wrap; }
.zone-btn:disabled { opacity: .45; cursor: not-allowed; }
.zone-btn.on[data-store="DRY"] { background: var(--food); border-color: var(--food); color: #fff; }
.zone-btn.on[data-store="PACK"] { background: var(--pack); border-color: var(--pack); color: #fff; }
.zone-btn.on[data-store="CHILLED"] { background: var(--chilled); border-color: var(--chilled); color: #fff; }
.zone-btn.on[data-store="FINAL"] { background: var(--final); border-color: var(--final); color: #fff; }
.zone-btn.on[data-store="CLEAN"] { background: var(--clean); border-color: var(--clean); color: #fff; }
.zone-btn.on[data-store="EQUIP"] { background: var(--equip); border-color: var(--equip); color: #fff; }
.no-store { padding: 18px; text-align: center; }
.unit-pair { display: flex; gap: 6px; }
.unit-pair .input:first-child { flex: 1; min-width: 0; }
.unit-pair .pack-unit { width: 6.5em; flex: none; }
.units-box { border: 1px solid var(--line, #d0d7de); border-radius: 10px; padding: 4px 12px 10px; margin: 6px 0 10px; display: grid; gap: 8px; }
.buy-line { display: flex; align-items: center; gap: 8px; }
.buy-line #e-buyunit { width: 7em; }
.show-units { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notice.warn { background: #fdecea; color: #b3261e; border-radius: 8px; padding: 8px 10px; font-weight: 600; }
#cv-factor { width: 7em; }
.nowrap { white-space: nowrap; }
.units-box .notice { background: #fff4e5; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.buy-line #e-buya { width: 4.5em; }
.buy-line #e-buyqty { width: 6em; }
.buy-line .buy-stock { font-weight: 700; }
.input.locked { background: var(--bg-soft, #eef1f4); color: inherit; cursor: not-allowed; }
.units-box legend { padding: 0 6px; font-weight: 700; font-size: 13px; }
.conv-info { grid-column: 1 / -1; margin: -4px 0 4px; font-size: 13px; color: var(--teal, #00796b); font-weight: 600; }
.table-wrap.tall { max-height: 620px; }
tr.pending td { color: var(--warn); }
tr.selected { background: #fff7d6 !important; }
.slip-auto { padding: 9px 11px; border: 1px dashed #b8c2cc; border-radius: 6px; color: var(--muted); font-size: 13px; background: rgba(255,255,255,.6); }
select.input { appearance: auto; }
.input.small { width: 90px; padding: 5px 8px; }
.input[disabled] { background: #eef1f4; color: var(--muted); }
.req-list { display: grid; gap: 12px; }
.req-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: #fff; }

/* searchable list */
.combo { position: relative; }
.combo-list { position: absolute; inset-inline: 0; top: calc(100% + 2px); z-index: 30; background: #fff; border: 1px solid #c9d1da; border-radius: 6px;
  margin: 0; padding: 4px 0; list-style: none; max-height: 280px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.combo-list li { padding: 7px 11px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.combo-list li small { color: var(--muted); white-space: nowrap; }
.combo-list li.hi, .combo-list li:hover { background: var(--teal-soft); }

@media (max-width: 1100px) { .work { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .save-btn { flex: 1; }
  .table-wrap.tall { max-height: 420px; }
}
.form-grid > *, .field { min-width: 0; }
input[type="date"].input { min-width: 0; }

/* ---------- reports ---------- */
.rep-layout { display: grid; grid-template-columns: 250px minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.rep-cards { display: grid; gap: 12px; }
.rep-group { display: grid; gap: 5px; }
.rep-group-title { font-size: 12px; font-weight: 700; color: var(--muted); }
.rep-card { text-align: start; border: 0; background: #f2f4f7; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-size: 14px; color: var(--ink);
  border-inline-start: 4px solid transparent; }
.rep-card:hover { background: #d6eaea; color: #006060; }
.rep-card.on { background: var(--teal); color: #fff; font-weight: 600; border-inline-start-color: #ffc107; }
.rep-opts { display: grid; gap: 12px; }
.rep-opts h2 { margin: 0; font-size: 16px; }
.quick { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; font-size: 13px; }
.ms { display: grid; gap: 6px; }
.ms-list { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: #fff; }
.ms-row { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 13.5px; cursor: pointer; }
.ms-foot { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.rep-head { display: grid; gap: 2px; }
.rep-table th, .rep-table td { text-align: left; }
.rep-table td.num { text-align: right; }
.btn.wa { background: #1fa855; }
#print-area { display: none; }
@media (max-width: 1250px) { .rep-layout { grid-template-columns: 240px minmax(0, 1fr); } .rep-out { grid-column: 1 / -1; } }
@media (max-width: 860px) { .rep-layout { grid-template-columns: 1fr; } .rep-cards { grid-template-columns: 1fr; } }

/* ---------- formal print (PDF) ---------- */
@page { size: A4; margin: 12mm 10mm 16mm;
  @bottom-center { content: "Page " counter(page) " of " counter(pages); font: 8pt Calibri, Arial, sans-serif; color: #6e757d; }
  @bottom-left { content: "ALAKER SWEETS - MORO"; font: 8pt Calibri, Arial, sans-serif; color: #6e757d; } }
@media print {
  body > *:not(#print-area) { display: none !important; }
  body { background: #fff; }
  #print-area { display: block; font: 10pt Calibri, Arial, sans-serif; color: #212529; direction: ltr; }
  .pr-company { text-align: center; font-size: 20pt; font-weight: 700; color: #16263f; }
  .pr-sub { text-align: center; color: #6e757d; font-size: 10pt; margin-bottom: 8pt; }
  .pr-title { text-align: center; font-size: 15pt; font-weight: 700; border-bottom: 2px solid #16263f; padding-bottom: 4pt; }
  .pr-meta { display: flex; justify-content: space-between; margin: 6pt 0 10pt; color: #6e757d; }
  .pr-meta b { color: #212529; }
  .pr-table { width: 100%; border-collapse: collapse; }
  .pr-table thead { display: table-header-group; }
  .pr-table th { background: #16263f !important; color: #fff !important; padding: 5pt 6pt; border: 1px solid #c8ced6; font-weight: 700;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-table td { padding: 4pt 6pt; border: 1px solid #c8ced6; }
  .pr-table tbody tr:nth-child(even) td { background: #f2f5f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-table td.num { text-align: right; } .pr-table td.ctr { text-align: center; }
  .pr-table tr { page-break-inside: avoid; }
  .pr-count { margin-top: 10pt; font-weight: 700; }
  .pr-foot p { margin: 4pt 0; }
  .pr-note { font-size: 8pt; color: #6e757d; font-style: italic; }
}
.combo .input { padding-inline-end: 34px; }
.combo-arrow { position: absolute; inset-inline-end: 1px; top: 1px; bottom: 1px; width: 32px; border: 0; background: transparent;
  color: var(--muted); font-size: 14px; cursor: pointer; border-radius: 0 6px 6px 0; }
[dir="rtl"] .combo-arrow { border-radius: 6px 0 0 6px; }
.combo-arrow:hover { background: #eef2f6; color: var(--ink); }
.combo-list li.cur { font-weight: 600; }
.combo-list { max-height: 320px; }

/* charts (reports → charts) */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 14px; margin-top: 14px; }
.an-card h3 { margin: 0 0 4px; font-size: 15px; }
.an-card > small { display: block; margin-bottom: 8px; }
.an-card select { margin: 6px 0; max-width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-zero { stroke: var(--muted); stroke-width: 1; }
.ch-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ch-total { fill: var(--ink); font-size: 18px; font-weight: 700; font-family: var(--font); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ch-legend.col { flex-direction: column; }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; }
.ch-legend b { color: var(--ink); font-weight: 600; }
.ch-donut { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 14px; align-items: center; }
@media (max-width: 480px) { .ch-donut { grid-template-columns: 1fr; } .ch-donut svg { max-width: 220px; margin: auto; } }
.ch-rank { display: grid; gap: 6px; }
.ch-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.ch-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-bar { background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.ch-bar i { display: block; height: 100%; border-radius: 4px; }
.ch-val { font-size: 12px; white-space: nowrap; }
.ch-empty { color: var(--muted); padding: 30px 0; text-align: center; font-size: 13px; }
.store-ops { font-size: 13px; }
.store-ops th, .store-ops td.c { text-align: center; white-space: nowrap; }
.caps { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
.check.cap { align-items: flex-start; }
.check.cap span { display: grid; line-height: 1.35; }
.check.cap small { font-size: 12px; }
.dialog { max-height: calc(100vh - 32px); overflow-y: auto; width: min(560px, 100%); }
@media (max-width: 560px) { .caps { grid-template-columns: 1fr; } }
.sync button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.sync .sync-text:hover, .sync .sync-warn:hover { text-decoration: underline; }
.sync .sync-warn { color: var(--danger); font-weight: 600; }

/* stock counts */
.count-in { display: flex; gap: 6px; min-width: 12em; }
.count-in .count-qty { flex: 1; min-width: 5em; }
.count-in .count-unit { width: 6em; flex: none; }
.qty-pos { color: #1b7f3b; font-weight: 600; }
.rec-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 8px; }
.rec-filters .rf-who { width: auto; min-width: 10em; flex: 1; }
.rec-filters .rf-date { width: auto; }
.count-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.count-tools input { flex: 1; }
.count-tools .count-filter { width: auto; min-width: 11em; }
.count-mark { display: inline-block; width: 1.3em; font-weight: 700; }
.count-mark.saved { color: #1b7f3b; }
.count-mark.unsaved { color: #e67e22; }
.count-waiting { color: #e67e22; }
.count-exp-cell { display: flex; flex-direction: column; gap: 2px; min-width: 9.5em; }
.count-exp-cell .count-exp { width: 100%; }
.exp-changed .count-exp { border-color: #e67e22; background: #fff4e5; }
.btn.small { padding: 4px 12px; font-size: 13px; min-height: 0; }
tr.count-diff td { background: #fff4e5; }
tr.count-diff td:first-child { border-inline-start: 4px solid #e67e22; font-weight: 600; }
.search select.input { width: auto; min-width: 9em; flex: none; }
/* phone: the search box takes a row of its own; the filter and the button share the next one */
@media (max-width: 640px) {
  .search { flex-wrap: wrap; }
  .search input[type="search"] { flex: 1 1 100%; }
  .search select.input, .search .btn { flex: 1 1 auto; min-width: 0; white-space: normal; }
}
.kpi.alarm { background: var(--danger); animation: kpi-alarm 1.2s ease-in-out infinite; }
.kpi-alarm { font-style: normal; font-weight: 700; font-size: 13px; background: #fff; color: var(--danger); border-radius: 10px; padding: 1px 8px; justify-self: start; margin-top: 4px; }
@keyframes kpi-alarm { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .7); } 50% { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); } }
@media (prefers-reduced-motion: reduce) { .kpi.alarm { animation: none; outline: 3px solid var(--danger); outline-offset: 2px; } }
/* permissions: headings that open into tabs and buttons */
.perm-tree { border: 1px solid var(--line); border-radius: 6px; padding: 6px; max-height: 420px; overflow-y: auto; display: grid; gap: 2px; }
.pt-head { display: flex; align-items: center; gap: 4px; padding-block: 3px; }
.pt-toggle { border: 0; background: none; width: 22px; cursor: pointer; font-size: 14px; color: var(--muted); }
.pt-group { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.pt-leaf { display: flex; align-items: center; gap: 4px; padding-block: 3px; font-size: 14px; cursor: pointer; }
.pt-leaf .pt-view { font-weight: 600; }
/* what's new */
.wn-entry { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.wn-entry ul { margin: 6px 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.wn-todo { background: #e8f4ea; border-radius: 8px; padding: 6px 10px; margin-top: 4px; }
.wn-todo.admin { background: #fff4e5; }

/* LPO: the purchase order form, its history panel, and the printed form */
.bottom-nav a { position: relative; }
.bottom-nav .badge { position: absolute; top: 0; inset-inline-end: 18%; background: var(--brand); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.form-actions .spacer { flex: 1; }
.lpo-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin: 10px 0 14px; }
.lpo-form .field.wide { grid-column: span 2; }
.lpo-work { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.lpo-edit td { padding: 4px; vertical-align: top; }
.lpo-edit .combo { min-width: 160px; }
.lpo-edit .lpo-desc { min-width: 150px; }
.lpo-edit .lpo-qty, .lpo-edit .lpo-price { width: 90px; }
.lpo-edit .lpo-unit { width: 74px; text-transform: uppercase; }
.lpo-total { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lpo-total .btn { margin-inline-end: auto; }
.lpo-total b { font-size: 17px; }
.lpo-hist { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fafbfc; }
.lpo-hist h3 { margin: 0 0 6px; font-size: 15px; }
.lpo-hist h4 { margin: 10px 0 4px; font-size: 13.5px; color: var(--muted); }
.lpo-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lpo-hist-table { max-height: 280px; overflow: auto; }
.lpo-hist-table td, .lpo-hist-table th { padding: 4px 6px; font-size: 13px; }
.lpo-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; margin: 8px 0 12px; }
.party-contact { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
@media (max-width: 900px) {
  .lpo-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lpo-work { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  #print-area.lpo-print { font: 9.5pt Arial, Helvetica, sans-serif; color: #000; page: lpo; }
  .lpo-print td { white-space: normal; border: 0; }
  .lpo-print .lp-b { font-weight: 700; }
  .lpo-print .lp-head { display: grid; grid-template-columns: 52% 16% 32%; align-items: end; }
  .lpo-print .lp-u { text-decoration: underline; }
  .lpo-print .lp-to { border-collapse: collapse; margin-top: 1pt; }
  .lpo-print .lp-to td { padding: 0 6pt 0 0; vertical-align: top; line-height: 1.2; }
  .lpo-print .lp-gap { margin-inline-start: 26pt; }
  .lpo-print .lp-logo { text-align: center; align-self: center; }
  .lpo-print .lp-logo img { width: 80pt; height: auto; }
  .lpo-print .lp-co { padding-inline-start: 12pt; padding-bottom: 14pt; line-height: 1.25; }
  .lpo-print .lp-co-name { font-weight: 900; font-family: 'Arial Black', Arial, sans-serif; }
  .lpo-print .lp-grid { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: 2pt; border: 1.5pt solid #000; }
  .lpo-print .lp-grid td { border: 1pt solid #000; padding: 1.5pt 4pt; text-align: center; }
  .lpo-print .lp-th td { font-weight: 700; font-size: 10pt; border-width: 1.5pt; }
  .lpo-print .lp-th td.lp-small { font-size: 7.5pt; }
  .lpo-print .lp-line td { border-top: 0; border-bottom: 0; }
  .lpo-print .lp-line:last-child td { border-bottom: 1pt solid #000; }
  .lpo-print .lp-line td.lp-desc { text-align: left; font-weight: 700; font-size: 8pt; }
  .lpo-print .lp-foot { display: flex; justify-content: space-between; align-items: flex-start; }
  .lpo-print .lp-admin { padding-top: 12pt; }
  .lpo-print .lp-ok { margin-top: 4pt; font-size: 8.5pt; }
  .lpo-print .lp-sum { border-collapse: collapse; width: 40%; }
  .lpo-print .lp-sum td { text-align: right; padding: 0 4pt; }
  .lpo-print .lp-sum td:first-child { width: 50%; }
  .lpo-print .lp-sum .lp-box { border: 1.5pt solid #000; font-weight: 700; }
  .lpo-print .lp-terms { margin: 14pt 0 0; padding-inline-start: 14pt; line-height: 1.25; }
  .lpo-print .lp-sign { display: flex; justify-content: space-between; margin-top: 60pt; }
  .lpo-print .lp-sign div { width: 150pt; text-align: center; }
  .lpo-print .lp-sign span { display: block; border-top: 1.5pt solid #000; margin-bottom: 14pt; }
}
/* the LPO page carries no app footer, like the paper form */
/* a wide report (many columns): landscape, smaller type, so the whole table fits */
@page wide { size: A4 landscape; margin: 10mm 8mm 14mm; }
@media print { #print-area.pr-wide { page: wide; font-size: 7.5pt; } #print-area.pr-wide .pr-table { table-layout: auto; width: 100%; }
  #print-area.pr-wide .pr-table th, #print-area.pr-wide .pr-table td { padding: 2pt 3pt; font-size: 7.5pt; white-space: normal; overflow-wrap: anywhere; } }
@page lpo { margin: 14mm 10mm 12mm; @bottom-center { content: none; } @bottom-left { content: none; } }
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.recent-head h2 { margin: 0; }

/* Coffee bag calculator */
.cf { display: grid; gap: 14px; max-width: 640px; }
.cf.cf-wide { max-width: none; }
.cp-figs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cp-fig { display: grid; gap: 2px; }
.cp-fig b { font-size: 20px; }
.cp-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cp-stat { display: grid; gap: 2px; }
.cp-stat b { font-size: 22px; }
.cp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.cp-head h3 { margin: 0; }
@media (max-width: 560px) { .cp-figs { grid-template-columns: 1fr 1fr; } }
.cf-result { background: #6b4423; color: #fff8f1; border-color: #6b4423; }
.cf-result .muted { color: #e8d6c4; }
.cf-big { font-size: 34px; font-weight: 700; }
.cf-big span:last-child { font-size: 16px; font-weight: 600; }
.cf-split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #8a5d38; }
.cf-split .cf-a { background: #9bbf63; } .cf-split .cf-b { background: #c89b6d; }
.cf-buy { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-buy > div { display: grid; gap: 2px; }
.cf-buy b { font-size: 19px; }
.cf-lbl { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #e8d6c4; }
.cf-dot { width: 10px; height: 10px; border-radius: 50%; } .cf-dot.a { background: #9bbf63; } .cf-dot.b { background: #c89b6d; }
.cf-roasted { display: flex; justify-content: space-between; border-top: 1px solid #8a5d38; padding-top: 10px; }
.cf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cf-row label { display: grid; font-weight: 600; }
.cf-stepper { display: flex; align-items: center; gap: 6px; }
.cf-stepper .input { width: 110px; text-align: center; }
.cf-stepper .btn { min-width: 40px; padding: 6px 0; font-size: 18px; }
.cf-blend { display: grid; gap: 6px; }
.cf-blend-head, .cf-blend-ends, .cf-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cf-foot { flex-wrap: wrap; }
.cf-foot-btns { display: flex; align-items: center; gap: 12px; }
.cf-blend-head label { font-weight: 600; }
.cf-blend input[type=range] { width: 100%; accent-color: #6b4423; }

.table-wrap tfoot td { position: sticky; bottom: 0; background: var(--surface); border-top: 2px solid var(--line); }
.table-wrap tfoot td[colspan] { text-align: end; }
@media (max-width: 860px) { .table-wrap:has(> .lpo-edit) { max-height: none; } }

/* Home: the screens this user may open, around the turning disc (the disc itself: css/disc.css).
   Phones: the disc on top and the screens in a grid; wide screens: the screens in a ring around it. */
.home { display: grid; justify-items: center; container-type: inline-size; }
.home-stage { width: 100%; display: grid; gap: 30px; justify-items: center; padding-top: 8px; }
.home-disc { position: relative; width: min(210px, 54cqw); aspect-ratio: 1; container-type: inline-size; margin-bottom: 18px; }
.home-nav { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.home-tab { position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 16px 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none;
  text-align: center; font-weight: 600; box-shadow: 0 1px 2px rgba(22, 38, 63, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.home-tab:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(22, 38, 63, .13); border-color: var(--brand); }
.home-tab:active { transform: translateY(-1px); }
.home-tab:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.home-ico { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--teal-soft); color: var(--teal);
  transition: transform .18s ease, background-color .18s ease, color .18s ease; }
.home-ico .ico { width: 26px; height: 26px; }
.home-tab:hover .home-ico { background: var(--brand); color: #fff; transform: scale(1.08); }
.home-label { font-size: 14px; line-height: 1.3; }
.home-tab .badge { position: absolute; top: 8px; inset-inline-end: 8px; background: var(--brand); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 7px; }
@container (max-width: 560px) {
  .home-nav { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .home-tab { padding: 12px 4px 10px; gap: 6px; border-radius: 12px; }
  .home-ico { width: 42px; height: 42px; }
  .home-ico .ico { width: 22px; height: 22px; }
  .home-label { font-size: 12.5px; }
}
/* wide and tall enough: round buttons on a circle around the disc (the side menu is hidden on home) */
@container (min-width: 600px) {
  @media (min-height: 600px) {
    .home-stage.ring { position: relative; display: block; padding: 0; width: min(100%, max(540px, calc(100vh - 150px))); aspect-ratio: 1; }
    .home-stage.ring .home-disc { position: absolute; left: 50%; top: 50%; width: 36%; margin: 0; translate: -50% -50%; --hand-start: 112; --hand-h: 145; --hand-m: 165; --hand-s: 172; --head-h: 1; --head-m: .9; }
    .home-stage.ring .home-nav { display: block; position: absolute; inset: 0; }
    .home-stage.ring .home-tab { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%;
      width: clamp(96px, 16%, 118px); aspect-ratio: 1; border-radius: 50%; padding: 8px; gap: 4px; align-content: center;
      box-shadow: 0 4px 14px rgba(22, 38, 63, .10); }
    .home-stage.ring .home-ico { width: 40px; height: 40px; }
    .home-stage.ring .home-ico .ico { width: 22px; height: 22px; }
    .home-stage.ring .home-label { font-size: 12px; line-height: 1.25; max-width: 92%; }
    .home-stage.ring .home-tab .badge { top: 4px; inset-inline-end: 10px; }
  }
}
@media (min-width: 861px) {
  .shell.at-home { grid-template-columns: 1fr; }
  .shell.at-home .side { display: none; }
}
/* the user's own buttons: in rows under the screens, or on the two sides of the circle when there is room */
.home-grid { width: 100%; display: grid; justify-items: center; gap: 18px; }
.home-grid > .home-stage { order: 1; }
.home-side { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; order: 2; width: 100%; }
.home-side + .home-stage + .home-side { order: 3; }
.home-user { display: grid; justify-items: center; text-align: center; padding: 10px 18px; line-height: 1.35; }
.home-user small { color: var(--muted); }
.home-side button { min-width: 180px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(22, 38, 63, .06);
  transition: transform .18s ease, border-color .18s ease, color .18s ease; }
.home-side button:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--brand); }
.home-side button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.home-side .push-note { max-width: 200px; text-align: center; }
/* phone: home stands alone, without the bottom bar (every screen is on it, and the account buttons under them) */
@media (max-width: 860px) {
  .shell.at-home + .bottom-nav { display: none; }
  .shell.at-home .content { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .home-grid { gap: 12px; }
  .home-user { flex-basis: 100%; padding: 6px 0 0; }
  .home-side button { min-width: 0; flex: 1 1 140px; padding: 8px 12px; font-size: 13.5px; }
}
@container (min-width: 900px) {
  @media (min-width: 861px) and (min-height: 600px) {
    .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, max(540px, calc(100vh - 150px))) minmax(0, 1fr); align-items: stretch; gap: 0 16px; }
    .home-grid > .home-stage, .home-side, .home-side + .home-stage + .home-side { order: 0; }
    .home-side { flex-direction: column; flex-wrap: nowrap; justify-content: space-evenly; }
  }
}
.home-tab.resume { border: 2px solid var(--brand); animation: home-resume 1.8s ease-in-out infinite; }
.home-tab.resume .home-ico { background: var(--brand); color: #fff; }
.home-resume { font-size: 11px; font-weight: 700; color: var(--brand); line-height: 1; }
@keyframes home-resume { 0%, 100% { box-shadow: 0 0 0 0 rgba(238, 115, 38, .45); } 50% { box-shadow: 0 0 0 9px rgba(238, 115, 38, 0); } }
@media (prefers-reduced-motion: reduce) { .home-tab, .home-ico { transition: none; } .home-tab.resume { animation: none; box-shadow: 0 0 0 4px rgba(238, 115, 38, .25); } }

/* Cash purchases (petty cash) */
.lpo-sections { margin-bottom: 12px; }
.lpo-sections .badge { margin-inline-start: 6px; background: var(--brand); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.cash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cash-head h2 { margin: 0; }
.cash-sum { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius); }
.cash-edit .cash-kind { width: 120px; }
.cash-edit .cash-who, .cash-edit .cash-paid, .cash-edit .cash-req { width: 140px; }
.cash-edit .cash-desc { min-width: 220px; }
.cash-edit .cash-amount { width: 100px; }
@media print {
  .cash-print .cp-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .cash-print .cp-grid td { border: 1pt solid #000; padding: 2pt 4pt; font-size: 9pt; white-space: normal; }
  .cash-print .cp-head td { font-weight: 700; font-size: 10.5pt; background: #d9d9d9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cash-print .cp-hand td, .cash-print .cp-total td { font-weight: 700; }
  .cash-print .cp-num { text-align: right; }
  .cash-print .lp-ok { margin-top: 8pt; }
}
.cash-bal { font-weight: 600; }
tr.cash-off td { background: #fdecea; }
tr.cash-off td:nth-child(2) bdi { text-decoration: line-through; }
.cash-why { margin-top: 4px; width: 180px; }
.cash-refused { font-size: 12.5px; margin-top: 2px; }
.cash-ledger { max-height: 60vh; overflow: auto; }
@media print {
  .cash-print tr.cp-off td { color: #666; }
  .cash-print .cp-note { font-size: 8pt; font-weight: 700; color: #000; }
}

.grand-total { font-size: 16px; text-align: end; padding: 4px 2px; }
.grand-total b { font-size: 18px; }
.trip-load { margin: 0 10px 10px; margin-inline-start: 50px; width: auto; }
.tab-count { margin-inline-start: 6px; background: var(--brand); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.inv-qty tr.inv-off td { color: var(--warn, #b45309); font-weight: 600; }
.photo-view { display: grid; gap: 8px; max-height: 70vh; overflow: auto; }
.photo-view img { width: 100%; height: auto; border-radius: 8px; }
.order-kind { margin-bottom: 8px; }
.trip-row-main { display: flex; flex-direction: column; gap: 2px; }
.trip-row.trip-special { border: 2px solid var(--warn, #b45309); background: color-mix(in srgb, var(--warn, #b45309) 8%, transparent); }

/* the admin's home: waiting for you, favourites, folding groups */
.home-admin { gap: 14px; }
.home-disc-small { width: min(120px, 30cqw); margin: 0 auto; }
.home-groups { width: 100%; display: grid; gap: 12px; }
.home-group { width: 100%; background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.home-group-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; cursor: pointer; }
details.home-group:not([open]) > .home-group-title { margin-bottom: 0; }
.home-wait { border: 2px solid var(--brand); }
.home-star { position: absolute; top: 4px; inset-inline-start: 6px; border: 0; background: none; color: var(--warn, #b45309); font-size: 16px; cursor: pointer; padding: 2px; line-height: 1; }
.home-admin .home-nav { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.home-team { font-size: 13px; color: var(--muted, #555); margin-top: 8px; line-height: 1.8; }
.home-team a { color: inherit; text-decoration: none; white-space: nowrap; }
.home-team a b { color: var(--brand); }
.home-wait.home-wait-team { border-width: 1px; border-color: var(--line); padding: 6px 12px; }
.home-wait-team .home-team { margin-top: 0; }
.top-admin { display: flex; align-items: center; gap: 8px; }
.top-ver { font-size: 12px; color: var(--muted, #666); cursor: pointer; direction: ltr; }
@media (max-width: 640px) { .top-admin .top-ver { display: none; } .top-admin .btn { padding: 4px 8px; font-size: 12px; } }
.home-waiting { width: 100%; display: grid; gap: 12px; }
.home-waiting[hidden] { display: none; }
.home-team-box { padding: 8px 12px; }
.home-team-box .home-team { margin-top: 0; }
details.fold > summary { cursor: pointer; list-style: revert; }
details.req-card.fold > summary.card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
details.req-card.fold[open] > summary.card-head { margin-bottom: 10px; }
.sales-grid th, .sales-grid td { white-space: nowrap; }
.sales-grid tfoot td { border-top: 2px solid var(--line); }
.row-actions { display: flex; gap: 6px; }
tr.new td { background: var(--warn-soft, #fff4e0); }
summary .badge { background: var(--brand); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 7px; }
.btn.attn { animation: attn 0.9s ease-in-out 3; box-shadow: 0 0 0 3px var(--warn, #b45309); }
@keyframes attn { 50% { transform: scale(1.08); } }
tr.send-group th { text-align: start; background: var(--teal-soft, #e6f4f1); padding: 6px 8px; }

/* ---------- the general manager's screen (exec) ---------- */
.ex { display: grid; gap: 16px; }
.ex-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between;
  padding: 20px 22px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #0e5f63 100%);
  box-shadow: 0 12px 30px rgba(22, 38, 63, .18); }
.ex-title h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: .2px; }
.ex-head .ex-stamp { color: rgba(255,255,255,.75); }
.ex-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ex-periods { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.12); }
.ex-periods button { border: 0; background: none; color: #fff; padding: 6px 13px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; opacity: .85; }
.ex-periods button.on { background: #fff; color: var(--navy); opacity: 1; font-weight: 700; }
.ex-custom { display: flex; gap: 6px; align-items: center; }
.ex-custom[hidden] { display: none; }
.ex-custom .input { padding: 4px 8px; height: auto; width: 150px; }
.ex-tools .btn.secondary { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.ex-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.ex-tabs button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 16px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; transition: .15s; }
.ex-tabs button:hover { border-color: var(--teal); }
.ex-tabs button.on { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 700; box-shadow: 0 6px 14px rgba(0,128,127,.25); }
.ex-body { display: grid; gap: 16px; }
.ex-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ex-kpi { position: relative; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ex-kpi::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--teal); }
.ex-kpi.hero { background: linear-gradient(160deg, #fff 0%, var(--teal-soft) 140%); border-color: #b9dedd; }
.ex-kpi.warn::before { background: var(--warn); }
.ex-kpi.bad::before, .ex-kpi.hero.bad::before { background: var(--danger); }
.ex-kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.ex-kpi-value { margin: 6px 0 4px; font-size: 28px; font-weight: 800; color: var(--navy); line-height: 1.1; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.ex-kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); }
.ex-kpi-foot { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; min-height: 20px; font-size: 12px; }
.ex-delta { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; direction: ltr; }
.ex-delta.good { background: var(--ok-soft); color: var(--ok); }
.ex-delta.bad { background: var(--danger-soft); color: var(--danger); }
.ex-delta.flat { background: #eef1f4; color: var(--muted); }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.ex-panel { padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.ex-panel-title { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.ex-bars { display: grid; gap: 9px; }
.ex-bar-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 10px; align-items: center; }
.ex-bar-label { display: grid; font-size: 13px; line-height: 1.25; min-width: 0; }
.ex-bar-label bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-bar-label small { font-size: 11px; }
.ex-bar-track { height: 10px; border-radius: 999px; background: #eef1f4; overflow: hidden; }
.ex-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #26a69a); }
[dir='rtl'] .ex-bar-fill { margin-inline-start: 0; }
.ex-bar-fill.good { background: linear-gradient(90deg, var(--ok), #4caf50); }
.ex-bar-fill.warn { background: linear-gradient(90deg, var(--warn), var(--brand)); }
.ex-bar-fill.bad { background: linear-gradient(90deg, var(--danger), #e57373); }
.ex-bar-value { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 13px; color: var(--navy); }
.ex-trend-svg { width: 100%; height: 150px; display: block; }
.ex-trend-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.ex-donut { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.ex-donut-chart { position: relative; width: 150px; height: 150px; flex: none; }
.ex-donut-svg { width: 100%; height: 100%; }
.ex-donut-centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ex-donut-centre b { font-size: 18px; color: var(--navy); }
.ex-donut-centre small { color: var(--muted); }
.ex-legend { flex: 1; min-width: 160px; display: grid; gap: 7px; }
.ex-legend-row { display: grid; grid-template-columns: 12px 1fr auto 40px; gap: 8px; align-items: center; font-size: 13px; }
.ex-legend-row i { width: 12px; height: 12px; border-radius: 3px; }
.ex-legend-row small { text-align: end; }
.ex-waits { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ex-wait { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); }
.ex-wait b { font-size: 22px; color: var(--warn); min-width: 1.5em; text-align: center; }
.ex-wait span { font-size: 13px; line-height: 1.3; }
.ex-table { display: grid; gap: 8px; }
.ex-tr { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ex-tr:last-child { border-bottom: 0; }
.ex-note { margin: 0; font-size: 13px; color: var(--muted); }
.ex-note.bad { color: var(--danger); font-weight: 600; margin-top: 10px; }
.ex-empty { color: var(--muted); font-size: 13px; margin: 4px 0; }
.ex-skeleton { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ex-skeleton div { height: 110px; border-radius: 14px; background: linear-gradient(90deg, #eef1f4 25%, #f7f8fa 50%, #eef1f4 75%); background-size: 200% 100%; animation: exsh 1.2s infinite; }
@keyframes exsh { to { background-position: -200% 0; } }
@media (max-width: 640px) {
  .ex-head { padding: 16px; border-radius: 12px; }
  .ex-kpi-value { font-size: 23px; }
  .ex-grid { grid-template-columns: 1fr; }
  .ex-bar-row { grid-template-columns: minmax(80px, 38%) 1fr auto; }
}
@media print {
  body.ex-printing .side, body.ex-printing .topbar, body.ex-printing .bottom-nav, body.ex-printing .ex-tabs, body.ex-printing .ex-tools { display: none !important; }
  body.ex-printing .ex-head { color: var(--navy); background: none; box-shadow: none; padding: 0 0 8px; border-bottom: 2px solid var(--navy); border-radius: 0; }
  body.ex-printing .ex-head .ex-stamp { color: var(--muted); }
  body.ex-printing .ex-panel, body.ex-printing .ex-kpi { break-inside: avoid; }
  body.ex-printing .ex-bar-fill, body.ex-printing .ex-kpi::before, body.ex-printing .ex-delta { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.ex-best { display: inline-flex; gap: 4px; align-items: center; }
.ex-best i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }

/* ---------- the follow-up of the orders ---------- */
.fu-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.fu-chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.fu-chip b { color: var(--teal); }
.fu-chip.bad b { color: var(--danger); }
.fu-chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.fu-chip.on b { color: #fff; }
.fu-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.4fr) minmax(150px, 1fr); gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-inline-start: 5px solid var(--ok); border-radius: 12px; background: var(--surface); }
.fu-row.late { border-inline-start-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), var(--surface) 40%); }
.fu-row.very { border-inline-start-color: var(--danger); background: linear-gradient(90deg, var(--danger-soft), var(--surface) 40%); }
[dir='rtl'] .fu-row.late { background: linear-gradient(270deg, var(--warn-soft), var(--surface) 40%); }
[dir='rtl'] .fu-row.very { background: linear-gradient(270deg, var(--danger-soft), var(--surface) 40%); }
.fu-who { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.fu-steps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.fu-step { height: 8px; border-radius: 999px; background: #e4e8ed; }
.fu-step.done { background: var(--teal); opacity: .55; }
.fu-step.now { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.fu-row.late .fu-step.now { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.fu-row.very .fu-step.now { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.fu-now { display: grid; gap: 2px; }
.fu-age { color: var(--muted); }
.fu-row.late .fu-age { color: var(--warn); font-weight: 600; }
.fu-row.very .fu-age { color: var(--danger); font-weight: 700; }
@media (max-width: 720px) { .fu-row { grid-template-columns: 1fr; gap: 8px; } }

/* the branch manager: their note, on the order and the sales sheet */
.mgr-note { color: var(--orange, #b35c00); font-weight: 600; }
.br-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.br-note p { margin: 0; color: var(--orange, #b35c00); font-weight: 600; }
.br-card { margin-bottom: 10px; }

/* lines picked up in a shop (a department working there) */
.pickup { color: var(--teal); font-weight: 600; }
p.pickup { margin: 8px 0 2px; }

/* a final product's cost from its recipe */
.cost-box { display: grid; gap: 2px; font-size: 14px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line, #d9dee5); border-radius: 10px; background: var(--card, #fff); align-content: center; }
.cost-box .cost-fold > * { font-size: 13px; }
.cost-box .cost-fold > summary { font-size: 15px; }

/* the branch manager's period chips sit on a light card (the general manager's on a dark band) */
.card.ex > .card-head .ex-periods { background: #e7ebf0; }
.card.ex > .card-head .ex-periods button { color: var(--muted); }
.card.ex > .card-head .ex-periods button.on { background: var(--teal); color: #fff; }

/* the user guide */
.help-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--teal); font-weight: 800; font-size: 16px; cursor: pointer; flex: none; }
.guide-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.guide-body { display: grid; gap: 14px; margin-top: 12px; }
.guide-ch { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; line-height: 1.8; min-width: 0; }
.guide-ch.here { border: 2px solid var(--teal); background: var(--teal-soft); box-shadow: 0 4px 14px rgba(0,128,127,.18); }
.guide-here { display: inline-block; background: var(--teal); color: #fff; border-radius: 999px; padding: 1px 12px; font-size: 13px; margin-bottom: 8px; }
.guide-ch h2 { font-size: 18px; margin: 0 0 6px; color: var(--navy); }
.guide-ch h3 { font-size: 15px; margin: 14px 0 4px; color: var(--teal); }
.guide-ch ul, .guide-ch ol { padding-inline-start: 22px; margin: 4px 0; }
.guide-ch .k { font-weight: 600; background: var(--teal-soft); border-radius: 6px; padding: 0 6px; }
.guide-ch .btnname { font-weight: 600; color: var(--orange, #d9661b); }
.guide-ch .screens { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.guide-ch .screens span { font-size: 12px; border: 1px solid var(--teal); color: var(--teal); border-radius: 999px; padding: 0 8px; }
.guide-ch .tip, .guide-ch .warn { border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.guide-ch .tip { background: var(--teal-soft); }
.guide-ch .warn { background: #fff4dd; }
.guide-ch .flow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.guide-ch .flow span { border: 1px solid var(--line); border-radius: 8px; padding: 1px 8px; font-size: 13px; }
.guide-ch .tbl { overflow-x: auto; }
.guide-ch table { border-collapse: collapse; width: 100%; font-size: 13px; }
.guide-ch th, .guide-ch td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: start; vertical-align: top; }
.guide-note { background: #fff4dd; border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* the batch record, printed in the layout of the company form */
.card.batch h3 { margin: 16px 0 6px; color: var(--teal); }
@media print {
  #print-area.bt-print { direction: rtl; font: 10pt Tahoma, Arial, sans-serif; color: #000; }
  .bt-print .bt-title { text-align: center; font-weight: 700; font-size: 13pt; margin-bottom: 8px; display: grid; gap: 2px; }
  .bt-print .bt-en { font-size: 10pt; font-weight: 600; }
  .bt-print h4 { margin: 10px 0 4px; font-size: 11pt; background: #e8f2f2; padding: 3px 6px; }
  .bt-print table.bt-t { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
  .bt-print table.bt-t th, .bt-print table.bt-t td { border: 1px solid #555; padding: 3px 5px; text-align: center; vertical-align: middle; }
  .bt-print table.bt-t th { background: #f1f1f1; }
}

/* a row of buttons under a search line */
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tool-row .btn { white-space: nowrap; }
.pcols { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }

/* customers' orders (views/online.js) */
.ol-list { display: grid; gap: 12px; margin-top: 12px; }
.ol-card { background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; }
.ol-card.st-new { border-inline-start-color: #f07c2a; }
.ol-card.st-accepted { border-inline-start-color: var(--teal); }
.ol-card.st-out { border-inline-start-color: #2f6fb3; }
.ol-card.st-delivered { border-inline-start-color: #3f8a3a; }
.ol-card.st-rejected, .ol-card.st-cancelled { border-inline-start-color: var(--danger); opacity: .8; }
.ol-card.late { background: #fff6ee; box-shadow: 0 0 0 2px #f07c2a55; }
.ol-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ol-top b { font-size: 16px; }
.ol-when { margin-inline-start: auto; font-weight: 600; }
.ol-pill { border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; background: var(--line); }
.ol-pill.new { background: #fff1e5; color: #b4560f; }
.ol-pill.accepted { background: var(--teal-soft); color: var(--teal); }
.ol-pill.out { background: #e3edf8; color: #2f6fb3; }
.ol-pill.delivered { background: #e6f2e4; color: #3f8a3a; }
.ol-pill.rejected, .ol-pill.cancelled, .ol-pill.late { background: #fde8e8; color: var(--danger); }
.ol-pill.called { background: #eef0f3; color: var(--muted); }
.ol-lines { display: grid; gap: 2px; background: #f6f7f9; border-radius: 8px; padding: 6px 10px; }
.ol-note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 6px 10px; font-weight: 600; }
.ol-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; }
.ol-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ol-btns .btn { flex: 1 1 120px; text-align: center; text-decoration: none; }
.ol-sold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.ol-sold summary { cursor: pointer; font-weight: 600; }
.ol-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip.ol-off { background: #fde8e8; border-color: var(--danger); color: var(--danger); text-decoration: line-through; }
.ol-set { display: grid; gap: 14px; margin-top: 12px; }
.ol-prods { display: grid; gap: 6px; max-height: 460px; overflow: auto; }
.ol-prod { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 8px; border-radius: 8px; }
.ol-prod.on { background: var(--teal-soft); }
.ol-ck { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; cursor: pointer; }
.ol-ck.small { flex: 0 0 auto; font-size: 13px; }
.ol-ck input { width: 18px; height: 18px; accent-color: var(--teal); }
.ol-ph-btn { padding: 4px 10px; font-size: 13px; }
.ol-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ol-fees { display: grid; gap: 8px; }
.ol-fee { display: grid; grid-template-columns: 1.3fr 1.3fr .8fr 1fr auto auto; gap: 6px; align-items: center; }
@media (max-width: 640px) { .ol-fee { grid-template-columns: 1fr 1fr; } }
.ol-hours { display: grid; gap: 6px; }
.ol-day { display: grid; grid-template-columns: 90px 1fr auto 1fr auto; gap: 6px; align-items: center; }
.ol-links { display: grid; gap: 8px; }
.ol-link { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; }
.ol-link a { overflow-wrap: anywhere; font-size: 13px; }
@media (max-width: 640px) { .ol-link { grid-template-columns: 1fr auto; } .ol-link a { grid-column: 1 / -1; } }

.ol-pay { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.ol-pay.paid { color: #3f8a3a; } .ol-pay.wait { color: var(--warn); }
.ol-collect { background: #fff1e5; color: #b4560f; border-radius: 8px; padding: 8px 12px; font-weight: 800; font-size: 17px; text-align: center; }
.ol-amount { font-size: 22px; font-weight: 800; text-align: center; }

.ol-delivered { color: #3f8a3a; font-weight: 700; font-size: 13.5px; }
.ol-driver { font-size: 13px; color: var(--muted); font-weight: 600; }
.ol-pay .paid { color: #3f8a3a; } .ol-pay .wait { color: var(--warn); }
.ol-pill.handed { background: #ede7f6; color: #5e35b1; }
.ol-card.st-handed { border-inline-start-color: #5e35b1; }
.ol-when.late { color: var(--danger); }
.sync .sync-btn { border: 0; background: var(--teal); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; font-weight: 700; cursor: pointer; display: grid; place-items: center; flex: none; }
.sync .sync-btn:active { transform: rotate(90deg); }
.sync .sync-btn.spin { animation: sync-spin .8s linear infinite; }
@keyframes sync-spin { to { transform: rotate(360deg); } }

.ol-pill.trusted { background: #fff6d6; color: #8a6d00; }
.ol-linkbtn { border: 0; background: none; color: var(--teal); text-decoration: underline; font-size: 12.5px; cursor: pointer; padding: 0 4px; }

.ol-archive { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 8px 12px; }
.ol-archive summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.ol-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.ol-fold > summary::-webkit-details-marker { display: none; }
.ol-fold > summary::after { content: '▾'; color: var(--muted); transition: transform .15s; }
.ol-fold[open] > summary::after { transform: rotate(180deg); }
.ol-fold-in { display: grid; gap: 10px; margin-top: 10px; }
.tray-ico { width: 26px; height: 17px; vertical-align: -3px; margin-inline-end: 4px; }
.fu-driver { font-size: 13px; font-weight: 600; color: var(--ink); }
.wk-list { max-height: 420px; overflow: auto; margin-top: 8px; }
.wk-acts { white-space: nowrap; }
.link.wk-del { color: var(--danger); }
.ol-gps { color: var(--teal); font-weight: 600; }

.dm-box { display: grid; gap: 10px; }
.dm-canvas { height: 360px; border-radius: var(--radius); border: 1px solid var(--line); background: #eef1f4; }
.dm-list { display: grid; gap: 6px; }
.dm-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; display: grid; gap: 4px; }
.dm-row:hover { background: var(--teal-soft); }
.dm-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.dm-who small { margin-inline-start: auto; color: var(--muted); }
.dm-who small.dm-none { color: var(--warn); }
.dm-stops { font-size: 13px; }
.dm-stop.done { color: #3f8a3a; }
.dm-mark { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.dm-pin { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f07c2a; font-size: 17px; box-shadow: 0 2px 6px rgba(0,0,0,.25); flex: none; }
.dm-tag { background: #fff; border-radius: 6px; padding: 1px 6px; font: 600 11px Tahoma, sans-serif; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.dm-coming { margin-top: 14px; }
.dm-coming summary { cursor: pointer; }

.fl-mine { display: grid; gap: 12px; }
.fl-status { border-radius: var(--radius); padding: 10px 14px; font-weight: 700; }
.fl-status.ok { background: #e6f2e4; color: #3f8a3a; } .fl-status.todo { background: var(--warn-soft); color: var(--warn); }
.fl-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.fl-big .btn { padding: 16px; font-size: 16px; }
.fl-row { border: 1px solid var(--line); border-inline-start: 4px solid var(--line); border-radius: var(--radius); padding: 8px 12px; display: grid; gap: 4px; }
.fl-row.open { border-inline-start-color: var(--danger); background: #fff8f7; }
.fl-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.fl-closed { color: #3f8a3a; }
.fl-check { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fl-pair { display: flex; gap: 6px; }
.chip.on { background: var(--teal-soft); border-color: var(--teal); }
.chip.fl-bad.on { background: #fde8e8; border-color: var(--danger); color: var(--danger); }
.fl-urgent { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--danger); }
.fl-photo { display: flex; align-items: center; gap: 10px; }
.fl-list { display: grid; gap: 8px; margin-top: 10px; }
tr.fl-open td { background: #fff8f7; }
.make-hint { color: var(--teal); font-weight: 600; font-size: 12px; }

.fl-shift { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.fl-shift > div { display: grid; gap: 2px; }
.fl-shift.on { border-color: var(--teal); background: var(--teal-soft); }
.dm-pin.dm-p { background: #6b7380; }
.dm-parked summary { cursor: pointer; font-weight: 700; margin: 6px 0; }
.shift-need { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; font-weight: 700; margin: 8px 0; }
.shift-need .btn { text-decoration: none; white-space: nowrap; }

.rep-type > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rep-type > summary::-webkit-details-marker { display: none; }
.rep-type > summary::after { content: '▾'; margin-inline-start: auto; color: var(--muted); transition: transform .15s; }
.rep-type[open] > summary::after { transform: rotate(180deg); }
.rep-type > summary h2 { margin: 0; }
.rep-type-name { background: var(--teal-soft); color: var(--teal); border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: 13.5px; }
.rep-type[open] .rep-cards { margin-top: 12px; }
/* the report's options take only the room they need (not the whole width beside the report type) */
@media (max-width: 1250px) { .rep-layout { grid-template-columns: 240px minmax(0, 560px); } }
.rep-opts .input:not(.combo-input) { max-width: 340px; }
.rep-opts .btn { justify-self: start; min-width: 200px; }
.rep-type > summary { min-height: 0; }
/* the report's options as small as they can be: tight spacing, a field beside its title, small boxes and button */
.rep-layout > .card:has(> .rep-opts) { padding: 12px 14px; }
.rep-opts { gap: 8px; }
.rep-opts h2 { font-size: 15px; }
.rep-opts .field:has(> input.input) { grid-template-columns: auto minmax(0, 160px); align-items: center; justify-content: start; gap: 8px; }
.rep-opts .field .input { padding: 5px 8px; }
.rep-opts .form-grid { gap: 8px; }
.rep-opts .check-grid, .rep-opts .ms-row { font-size: 13px; }
.rep-opts .check-grid { gap: 2px 14px; }
.rep-opts .form-actions { margin: 0; }
.rep-opts .form-actions .btn { padding: 7px 18px; font-size: 14px; min-width: 0; width: auto; }
.rep-opts .form-status:empty { display: none; }

/* the report's options in a few low lines */
.rep-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.rep-inl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.rep-opts .rep-date { width: 140px; padding: 4px 6px; }
.rep-opts .rep-num { width: 80px; padding: 4px 6px; }
.rep-opts .rep-quick { width: auto; padding: 4px 6px; font-size: 13px; }
.rep-seg button { padding: 3px 10px; font-size: 12.5px; }
.rep-tog { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 8px; cursor: pointer; }
.rep-tog:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.rep-folds { display: flex; flex-wrap: wrap; gap: 6px; }
.rep-fold { border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.rep-fold[open] { flex-basis: 100%; }
.rep-fold > summary { cursor: pointer; padding: 4px 10px; font-size: 13px; list-style: none; display: flex; gap: 4px; align-items: center; }
.rep-fold > summary::-webkit-details-marker { display: none; }
.rep-fold > summary::after { content: '▾'; color: var(--muted); margin-inline-start: 4px; }
.rep-fold-val { color: var(--teal); font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-fold-in { padding: 6px 10px 10px; font-size: 13px; }
.rep-fold-in .ms-list { max-height: 180px; }
.rep-end { justify-content: flex-start; }
.rep-opts .rep-run { padding: 6px 18px; font-size: 14px; }
.rep-opts .form-status { margin: 0; }
.rep-opts .rep-run { min-width: 0; margin-inline-start: auto; align-self: center; }
.rep-folds { align-items: flex-start; }
.rep-opts .form-status:empty { display: none; }
.idir-modes { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.isrc { font-size: 11px; margin-inline-start: 4px; white-space: nowrap; }
.isrc-direct { background: #fff4e5; color: #a15c00; }
.isrc-request { background: #e8f1ff; color: #1d4ed8; }
.isrc-shop { background: #eef7ee; color: #1f7a3a; }
.src-sel { width: auto; flex: none; }
.rep-item1 .combo { min-width: 280px; }
/* the phone: the top bar fits the screen (nothing wider than it, no sideways drag); version, language and
   sign out are in "More"; the sync shows its dot and refresh button */
@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar h1 { font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .top-admin, .topbar .sync .sync-text { display: none; }
  .top-user { max-width: 34vw; padding: 4px 10px; }
}
.main { min-width: 0; }
.search select.input { max-width: 100%; }
/* the recipe calculator (production) */
.calc-box { border: 2px solid var(--teal); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; background: #f7fbfb; }
.calc-head { display: flex; justify-content: space-between; align-items: center; }
.calc-size { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.calc-size .input { width: 120px; }
.calc-box td .input.num { width: 110px; padding: 4px 6px; }
.calc-add { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .calc-add { grid-template-columns: minmax(0, 1fr) 90px; } .calc-add .btn { grid-column: 1 / -1; } }
tr.rc-off td { color: var(--muted); text-decoration: line-through; }
tr.rc-off td .check, tr.rc-off td .btn, tr.rc-off td button { text-decoration: none; }
.req-fixed { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f4f6f8; font-weight: 700; }
/* the employees' requests (HR) */
.hr-form { display: grid; gap: 12px; }
.hr-kind button { padding: 6px 16px; }
.hr-days { margin: 0; align-self: end; font-weight: 700; color: var(--teal); }
.hr-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; margin-bottom: 8px; background: var(--surface); }
.hr-card.hr-pending { border-inline-start: 4px solid var(--warn); }
.hr-card.hr-approved, .hr-card.hr-ready { border-inline-start: 4px solid var(--ok); }
.hr-card.hr-rejected { border-inline-start: 4px solid var(--danger); }
.hr-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hr-head .num { margin-inline-start: auto; }
.hr-answer { background: #f6f8fa; border-radius: 6px; padding: 4px 8px; }
.hr-card .form-actions { flex-wrap: wrap; align-items: center; }
.hr-card .form-actions .input { flex: 1 1 180px; min-width: 0; }
.hr-sub { margin-bottom: 8px; }
.hr-card.pen-issued, .hr-card.pen-kept { border-inline-start: 4px solid var(--danger); }
.hr-card.pen-proposed, .hr-card.pen-objected { border-inline-start: 4px solid var(--warn); }
.pen-deadline { color: var(--warn); font-weight: 700; }
.hr-card .form-actions .pen-amt { flex: 0 0 110px; }
.pen-form { margin-bottom: 10px; }
/* the HR screen: a light mark in the menu; the banners; the tabs' numbers */
.nav a[data-route="hr"], .bottom-nav a[data-route="hr"] { box-shadow: inset 3px 0 0 #8b5cf6; }
.nav a[data-route="hr"] .ico { color: #7c3aed; }
.home-tab[data-route="hr"], a.home-tab[href="#/hr"] { background: #f5f0ff; }
.hr-tabs button { position: relative; }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
#hr-banner { display: grid; gap: 4px; padding: 6px 12px 0; }
.hr-banner { border: 0; border-radius: var(--radius); padding: 10px 14px; font: inherit; font-weight: 600; text-align: start; cursor: pointer; color: #fff; }
.hr-banner.red { background: var(--danger); }
.hr-banner.green { background: var(--ok); }
.pen-cat { background: #f5f0ff; color: #6d28d9; }
.pen-search { flex-wrap: wrap; }
.pen-search .pen-day { flex: 0 0 150px; }
.hr-card .form-actions .pen-catsel { flex: 1 1 160px; }
.hr-group { margin-bottom: 6px; }
.hr-group[open] > summary { margin-bottom: 8px; }
.hr-preview { background: #fff7e0; color: #8a5a00; border: 1px dashed #e0b84c; border-radius: var(--radius); padding: 8px 12px; font-weight: 600; margin-bottom: 8px; }
.toast.warn { background: #b7791f; }
/* My file */
.hf { display: grid; gap: 12px; }
.hf-head { display: grid; gap: 6px; }
.hf-name { font-size: 18px; }
.hf-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.hf-facts { display: flex; gap: 24px; flex-wrap: wrap; }
.hf-facts > div { display: grid; gap: 2px; }
.pill.hf-bad { background: #fde8e8; color: var(--danger); }
.pill.hf-warn { background: #fff4e0; color: #a15c00; }
.pill.hf-ok { background: #e7f6ec; color: #1f7a3a; }
.hr-me { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fbfaff; display: grid; gap: 10px; }
.myfiles-btn { font-weight: 700; color: #7c3aed !important; }
/* maintenance */
.pill.mt-urgent { background: #fde8e8; color: #b42318; }
.pill.mt-important { background: #fff4e0; color: #b54708; }
.pill.mt-normal { background: #eef2f6; color: #475467; }
.mt-reply { background: #f0f7ff; border-radius: 6px; padding: 4px 8px; }
.mt-money { display: grid; gap: 3px; border-top: 1px dashed var(--line); padding-top: 6px; font-size: .92em; }
.mt-mbtns { display: inline-flex; gap: 10px; margin-inline-start: 8px; }
.mt-btns { flex-wrap: wrap; gap: 6px; }
.mt-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.mt-sums > div { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; display: grid; gap: 2px; }
.mt-sums b { font-size: 1.25em; }
.mt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mt-top { width: 100%; } .mt-top td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mt-assets { list-style: none; padding: 0; display: grid; gap: 4px; }
.mt-assets li { display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }

/* the logo at the corner of the top bar (ordinary size) */
.top-logo { width: 34px; height: 34px; flex: none; border-radius: 8px; }
@media (max-width: 760px) { .top-logo { width: 30px; height: 30px; } }
/* phones: the page never moves sideways – wide content scrolls inside its own box (tables, card rows) */
html, body { max-width: 100%; overflow-x: clip; }
.shell, .main, .content { min-width: 0; max-width: 100%; }
.content > *, .card { min-width: 0; max-width: 100%; }

/* the cashier's order: store / department headings (one open at a time), items as cards, a bar at hand */
.pos-src { display: grid; gap: 8px; }
.pos-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-src-head { text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; cursor: pointer; }
.pos-src-head.on { border-color: var(--brand); background: #fff7ed; }
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.pos-card { position: relative; display: grid; gap: 4px; align-content: start; text-align: start; min-height: 86px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; cursor: pointer; }
.pos-card.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; background: #fff7ed; }
.pos-card.in { background: #f0fdf4; }
.pos-name { font-weight: 700; font-size: 14px; line-height: 1.25; word-break: break-word; }
.pos-unit { color: var(--muted); }
.pos-av { font-size: 11.5px; justify-self: start; border-radius: 999px; padding: 1px 8px; }
.pos-av.in { background: #dcfce7; color: #166534; } .pos-av.low { background: #fee2e2; color: #991b1b; }
.pos-hot { position: absolute; top: 6px; inset-inline-end: 8px; color: #f59e0b; font-size: 13px; }
.pos-bar { position: sticky; bottom: 0; z-index: 4; display: grid; gap: 6px; padding: 10px 12px; margin: 0 -16px -16px; background: var(--surface); border-top: 2px solid var(--brand); box-shadow: 0 -6px 16px rgba(0,0,0,.08); }
.pos-bar-item { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-bar-row { display: grid; grid-template-columns: minmax(64px, 90px) 1fr 1fr; gap: 8px; align-items: center; }
.pos-bar-row .btn { white-space: nowrap; padding-inline: 10px; }
.pos-bar-row .input { min-width: 0; }
@media (max-width: 860px) { .pos-bar { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); margin: 0 -12px -12px; } .pos-cards { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); max-height: 46vh; } }

/* an item's picture, faint behind the card's name (a watermark) */
.pos-card.has-pic { overflow: hidden; isolation: isolate; }
.pos-card.has-pic::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--pic, none) center / cover no-repeat; opacity: .7; }
.pos-card.has-pic.on::before { opacity: .9; }
/* the name and unit stay readable over the picture */
.pos-card.has-pic .pos-name, .pos-card.has-pic .pos-unit { text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 10px #fff; }
.pos-card.has-pic .pos-name { background: rgba(255,255,255,.72); border-radius: 6px; padding: 1px 4px; justify-self: start; }
/* the chosen item: a bold frame drawn above its picture */
/* an item already in the order: a wide orange frame; the chosen one: a blue frame (blue wins when both) */
.pos-card.in { outline: 4px solid #ea580c; outline-offset: -4px; }
.pos-card.on { outline: 3px solid #2563eb; outline-offset: -3px; box-shadow: 0 0 0 3px rgba(37,99,235,.4); }

/* the cashier's order screen, on a phone: only the order. One bar on top (home, the shop, end the shift)
   in place of the top bar and the bottom bar */
.pos-home { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); text-decoration: none; font-weight: 600; padding: 6px 10px; border-radius: 10px; background: var(--surface); }
.pos-home svg { width: 20px; height: 20px; }
.shift-bar .shift-shop { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
  body.pos-focus .topbar, body.pos-focus .bottom-nav { display: none; }
  body.pos-focus .shift-bar { position: sticky; top: 0; z-index: 6; margin: -14px -12px 0; border-radius: 0; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  body.pos-focus .shift-bar .btn { padding: 6px 10px; }
  body.pos-focus .card-head h2 { display: none; }
  body.pos-focus .pos-bar { bottom: env(safe-area-inset-bottom, 0px); }
  body.pos-focus .content { padding-bottom: 12px; }
}
/* the bar at the bottom: its buttons fit the phone's width (a long label wraps rather than runs off) */
.pos-bar-row .btn { white-space: normal; line-height: 1.2; min-width: 0; }
.pos-bar-row.one { grid-template-columns: minmax(64px, 110px) 1fr; }
/* the cashier's order on a phone: the tabs on one short line (slid sideways when they do not fit), and
   normal / special a small switch, so the items start right under the bar */
@media (max-width: 860px) {
  body.pos-focus .card-head .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  body.pos-focus .card-head .tabs::-webkit-scrollbar { display: none; }
  body.pos-focus .card-head .tabs button { white-space: nowrap; padding: 4px 9px; font-size: 12.5px; }
  body.pos-focus .order-kind { margin-bottom: 6px; }
  body.pos-focus .order-kind button { padding: 3px 10px; font-size: 12px; }
}
