/* CLEENZEE POS — approved brand system
   ------------------------------------------------------------------
   Brand palette from the approved CLEENZEE guidelines: Deep Navy / Midnight
   Blue / Amber / Mint / Off White. Amber is reserved for the primary action;
   operational states use clear blue, green and amber meaning instead. One addition:
   --danger (muted red) used ONLY for destructive actions and negative
   money (void, refund, deactivate, shortage).

   Brand font "Schibsted Grotesk": self-host by dropping the woff2 into
   /fonts and uncommenting the @font-face below (no external origins —
   the CSP blocks them and the counter must work offline).

@font-face { font-family: "Schibsted Grotesk"; src: url("/fonts/SchibstedGrotesk-Variable.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
*/

:root {
  --ink: #14263B;
  --chrome: #0B2339;
  --on-chrome: #F9FAFB;
  --yellow: #F1AE22;
  --warm-white: #F9FAFB;
  --stone: #B8C8D4;
  --danger: #a8341f;
  --success: #23776F;
  --mint: #8FD0C9;

  --ink-70: #42566C;
  --ink-50: #6B7F92;
  --ink-30: #98A9B7;
  --paper: #ffffff;
  --paper-2: #F4F7F9;
  --line: #DCE5EB;
  --line-strong: var(--stone);
  --pill: #E7F3F2;
  --highlight: #F0F9F8;
  --muted-strong: #42566C;
  --disabled-text: #7B8D9D;
  --switch-bg: #D7E5EB;
  --switch-text: #42566C;
  --detail-surface: rgba(20,38,59,0.035);

  --fs-0: 11px; --fs-1: 12px; --fs-2: 13px; --fs-3: 14px; --fs-4: 16px; --fs-5: 20px; --fs-6: 28px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --r-1: 8px; --r-2: 10px; --r-3: 14px; --r-4: 16px; --r-pill: 999px;
  --tap: 48px;                 /* minimum touch target */
  --shadow-1: 0 1px 3px rgba(11,35,57,0.08);
  --shadow-2: 0 8px 24px rgba(11,35,57,0.18);
  --focus: 0 0 0 3px rgba(241,174,34,0.42);
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* A counter-friendly dark palette: the same hierarchy and accent colours,
   without a bright surface during late shifts. Kept as variable overrides so
   every screen changes together and the preference can persist per device. */
html[data-theme="dark"] {
  /* Midnight Blue surfaces and Amber accents. Text and app chrome are separate
     tokens so controls remain legible instead of looking colour-inverted. */
  --ink: #edf2f7;
  --chrome: #071827;
  --on-chrome: #f5f8fb;
  --yellow: #F1AE22;
  --warm-white: #0E2234;
  --stone: #4E6A80;
  --danger: #ee705d;
  --success: #8FD0C9;
  --ink-70: #d5dee8;
  --ink-50: #9cabb9;
  --ink-30: #718497;
  --paper: #162D43;
  --paper-2: #1B354D;
  --line: #38556B;
  --line-strong: #4E6A80;
  --pill: #254258;
  --highlight: #1D3A4D;
  --muted-strong: #cbd6e1;
  --disabled-text: #a9b8c6;
  --switch-bg: #254258;
  --switch-text: #d5dee8;
  --detail-surface: #11283B;
  --shadow-1: 0 1px 3px rgba(0,0,0,.3);
  --shadow-2: 0 14px 34px rgba(0,0,0,.46);
  --focus: 0 0 0 3px rgba(241,174,34,.55);
}
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .nav button { color: var(--on-chrome); }
html[data-theme="dark"] .nav button.active { background: #273542; color: var(--on-chrome); }
html[data-theme="dark"] .panel .toolbar button:not(.accent):not(.primary):not(.danger),
html[data-theme="dark"] .detail-row button, html[data-theme="dark"] .modal-cancel { background: var(--paper-2); color: var(--ink); }
html[data-theme="dark"] .btn-primary:disabled, html[data-theme="dark"] .btn-secondary:disabled,
html[data-theme="dark"] .btn-danger:disabled, html[data-theme="dark"] .btn-dark:disabled { background: #3b4a58; border-color: #3b4a58; color: #91a1b0; }
html[data-theme="dark"] .create-btn:disabled { background: #3b4a58; color: #91a1b0; }
html[data-theme="dark"] .cat-pill { color: #c7d1dc; }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #2a3744 25%, #354555 37%, #2a3744 63%); }
html[data-theme="dark"] .pill-ok { background: #203c2b; color: #a3dfb1; }
html[data-theme="dark"] .pill-bad { background: #482921; color: #ffb4a5; }
html[data-theme="dark"] .totals-row { color: var(--ink-50); }
html[data-theme="dark"] .view-switch { border: 1px solid var(--line-strong); }
html[data-theme="dark"] .view-switch button { color: var(--switch-text); }
html[data-theme="dark"] .view-switch button.active { background: #e7edf3; color: #15202a; box-shadow: none; }
html[data-theme="dark"] .btn-sm.danger { border-color: #8f554b; }
html[data-theme="dark"] .panel .toolbar button.btn-sm:disabled {
  background: #3b4a58; border-color: #3b4a58; color: #a9b8c6;
}

/* ---------- operations dashboard ---------- */
.dashboard { flex: 1; overflow-y: auto; padding: 24px; }
.dashboard-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; max-width: 1240px; margin: 0 auto 18px; }
.dashboard-head h2 { margin: 3px 0 4px; font-size: var(--fs-6); letter-spacing: -.04em; }
.dashboard-head p { margin: 0; color: var(--ink-50); }
.eyebrow { font-size: var(--fs-1); font-weight: 800; letter-spacing: .08em; color: var(--ink-50); }
.dashboard-kpis { max-width: 1240px; margin: 0 auto 18px; display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; }
.dashboard-kpis .kpi { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.dashboard-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dashboard-grid .panel { max-width: none; margin: 0; }
.dashboard-action-list { display: grid; gap: 8px; }
.dashboard-action { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); background: var(--highlight); color: inherit; border-radius: var(--r-2); text-align: left; }
.dashboard-action b, .dashboard-action span { display: block; }.dashboard-action span { color: var(--ink-50); font-size: var(--fs-2); margin-top: 2px; }

/* ---------- delivery desk ---------- */
.delivery-desk { max-width: 1320px; margin: 0 auto; }
.delivery-desk-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 16px; }
.delivery-desk-head h2 { margin: 3px 0 4px; font-size: var(--fs-6); letter-spacing: -.04em; }.delivery-desk-head p { margin: 0; color: var(--ink-50); }
.delivery-summary { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.delivery-summary .kpi { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.delivery-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.delivery-lane { background: color-mix(in srgb, var(--paper) 55%, transparent); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.delivery-lane-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }.delivery-lane-head h3 { margin: 0; font-size: var(--fs-3); }.delivery-lane-head span { color: var(--ink-50); font-size: var(--fs-2); }
.delivery-card { margin: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--paper); box-shadow: var(--shadow-1); }.delivery-card-top { display: flex; gap: 8px; align-items: start; justify-content: space-between; }.delivery-card h4 { margin: 0; font-size: var(--fs-4); }.delivery-card p { margin: 6px 0 0; color: var(--ink-50); line-height: 1.35; }.delivery-card .address { color: inherit; font-size: var(--fs-2); }.delivery-card .delivery-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }.delivery-card .assign-controls { margin-top: 12px; display: grid; gap: 8px; }.delivery-card .assign-controls select, .delivery-card .assign-controls input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-1); }
.delivery-empty { padding: 18px 14px; color: var(--ink-50); font-size: var(--fs-2); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; height: 100%;
  font-family: var(--font); font-size: var(--fs-3); letter-spacing: -0.015em;
  background: var(--warm-white); color: var(--ink);
  overscroll-behavior: none; -webkit-text-size-adjust: 100%;
}
html.driver-native-refresh, body.driver-native-refresh { overscroll-behavior-y: auto; }
[dir="rtl"] body { letter-spacing: 0; }
button, input, select { font-family: inherit; }
button { color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [role=button]:focus-visible { outline: none; box-shadow: var(--focus); }
input, select { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-50); }
.neg { color: var(--danger); }
.ok { color: var(--success); }

/* ---------- buttons: three roles ---------- */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 var(--sp-4); border-radius: var(--r-2);
  font-weight: 700; font-size: var(--fs-2); text-transform: uppercase; letter-spacing: 0.02em;
  border: 1.5px solid transparent; transition: transform .06s var(--ease), background .15s;
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; color: var(--ink-70); }
.btn-dark { background: var(--chrome); color: var(--on-chrome); border-color: var(--chrome); }
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-dark:active { transform: scale(0.97); }
.btn-primary:disabled, .btn-secondary:disabled, .btn-danger:disabled, .btn-dark:disabled { background: var(--stone); color: var(--disabled-text); border-color: var(--stone); cursor: not-allowed; transform: none; }
.btn-sm { min-height: 40px; padding: 0 var(--sp-3); font-size: var(--fs-1); }
.btn-lg { min-height: 60px; font-size: var(--fs-4); border-radius: var(--r-4); }
.btn-block { width: 100%; }

/* ---------- app frame ---------- */
.app { display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; }
.app-credit { min-height: 22px; flex: 0 0 22px; display: flex; align-items: center; padding: 0 14px; border-top: 1px solid var(--line); background: var(--paper); color: var(--ink-50); font-size: 10px; letter-spacing: .01em; }
.app-credit strong { margin-left: 3px; color: var(--ink-70); font-weight: 800; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 10px var(--sp-5); background: var(--chrome); color: var(--on-chrome); flex-shrink: 0;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.topbar .brand .z-mark { width: 22px; height: 22px; flex-shrink: 0; }
.z-mark .brand-symbol { fill: var(--on-chrome); }
.z-mark .brand-dot { fill: var(--yellow); }
.topbar .brand .wordmark { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; background: rgba(246,241,228,0.12); padding: 4px; border-radius: var(--r-2); flex-shrink: 0; }
.nav button {
  border: none; background: transparent; color: var(--on-chrome); opacity: 0.7; min-height: 40px;
  padding: 0 var(--sp-4); border-radius: var(--r-1); font-size: var(--fs-2); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em; position: relative;
}
.nav button.active { background: var(--warm-white); color: var(--ink); opacity: 1; }
.nav button .badge-count {
  position: absolute; top: -4px; right: 0; background: var(--yellow); color: var(--ink);
  font-size: 10px; font-weight: 800; border-radius: var(--r-pill); padding: 1px 5px; min-width: 15px;
}
.nav button .badge-count.alert { background: var(--danger); color: #fff; }
.nav-more { position: relative; }
.nav-more-btn {
  font-size: 19px; line-height: 1; padding: 0 12px !important; min-height: 40px;
  border: none; background: rgba(246,241,228,0.12); color: var(--on-chrome); border-radius: var(--r-1);
}
.nav-more-btn.active { background: var(--warm-white); color: var(--ink); }
.nav-more-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; min-width: 180px;
  background: var(--paper); border-radius: var(--r-2); box-shadow: var(--shadow-2, var(--shadow-1));
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.nav-more-menu[hidden] { display: none; }
/* #navMoreMenu (ID) beats the general `.staff-box button` rule further down
   this file, which would otherwise leak its uppercase/padding styling onto
   these items now that Log/Manage/Close Shift/Log Out all live inside
   .staff-box (moved there so the whole menu sits in the top-right corner). */
#navMoreMenu button {
  background: transparent; border: none !important; color: var(--ink); opacity: 1; text-align: left;
  min-height: 40px; padding: 0 12px; border-radius: var(--r-1); font-size: var(--fs-2); font-weight: 700;
  text-transform: none; letter-spacing: normal; width: 100%;
}
#navMoreMenu button:hover, #navMoreMenu button.active { background: var(--stone); }
.nav-more-sep { height: 1px; background: var(--line); margin: 4px 6px; }
#navMoreMenu .btn-shift-close { color: var(--danger); }
#navMoreMenu .btn-logout { color: var(--danger); }
.topbar-spacer { flex: 1; }
.location-tag { font-size: var(--fs-2); color: var(--stone); white-space: nowrap; }
.staff-box { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.staff-box .who { text-align: right; font-size: var(--fs-2); color: var(--stone); line-height: 1.3; }
.staff-box .who b { display: block; color: var(--on-chrome); font-size: var(--fs-3); }
.staff-box button { min-height: 40px; border-radius: var(--r-1); padding: 0 14px; font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; border: none; }
.driver-theme-toggle { background: rgba(246,241,228,0.15); color: var(--on-chrome); white-space: nowrap; }
.driver-theme-toggle:hover { background: rgba(246,241,228,0.25); }
.btn-shift-open { background: var(--yellow); color: var(--ink); }
.btn-shift-close { background: rgba(246,241,228,0.15); color: var(--on-chrome); }
.btn-logout { background: transparent; color: var(--stone); border: 1px solid var(--stone) !important; }

/* status banner (offline / Odoo unreachable) */
.banner {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: 8px var(--sp-4); font-size: var(--fs-2); font-weight: 700; text-align: center; flex-shrink: 0;
  background: var(--danger); color: #fff;
}
.banner.warn { background: var(--yellow); color: var(--ink); }
.banner button { min-height: 32px; padding: 0 10px; border-radius: var(--r-1); border: 1px solid currentColor; background: transparent; color: inherit; font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; }

.new-order-screen { display: flex; flex: 1; width: 100%; flex-direction: column; overflow: hidden; }
#orderWorkspace { display: flex; flex: 1; min-height: 0; flex-direction: column; overflow: hidden; }
.shift-closed-gate { display: flex; flex: 1; align-items: center; justify-content: center; padding: 24px; background: var(--warm-white); }
.shift-closed-card { width: min(440px, 100%); padding: 32px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--paper); text-align: center; box-shadow: var(--shadow); }
.shift-closed-card .section-kicker { width: 32px; height: 32px; margin-bottom: 12px; background: var(--yellow); font-size: var(--fs-3); }
.shift-closed-card h2 { margin: 0; font-size: var(--fs-5); }
.shift-closed-card p { margin: 10px 0 22px; color: var(--ink-50); line-height: 1.5; }
.shift-closed-card .create-btn { width: 100%; }
.main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); width: 100%; flex: 1; min-height: 0; overflow: hidden; }
.order-flow { display: flex; align-items: center; gap: 38px; min-height: 64px; padding: 8px 20px; background: var(--paper); border-bottom: 1px solid var(--line-strong); flex-shrink: 0; overflow-x: auto; }
.order-flow-step { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 12px; border: 1px solid transparent; border-radius: var(--r-2); color: var(--ink-50); flex: 0 0 auto; }
.order-flow-step:not(:last-child)::after { content: '→'; position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%); color: var(--ink-30); font-size: 20px; font-weight: 700; }
.order-flow-step.active { background: var(--highlight); border-color: var(--yellow); color: var(--ink); }
.order-flow-step.complete { color: var(--ink); }
.order-flow-number, .section-kicker { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--stone); color: var(--ink); font-size: var(--fs-1); font-weight: 800; font-variant-numeric: tabular-nums; }
.order-flow-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--stone); color: var(--ink-70); }
.order-flow-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.order-flow-step.active .order-flow-icon { background: var(--yellow); color: var(--ink); }
.order-flow-step.complete .order-flow-icon { background: var(--chrome); color: var(--on-chrome); }
.order-flow-step div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.order-flow-step strong { font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .03em; }
.order-flow-step small { font-size: var(--fs-1); color: var(--ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- catalog ---------- */
.catalog { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line-strong); overflow: hidden; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 20px 0; color: var(--ink-50); font-size: var(--fs-2); }
.catalog-heading > div, .panel-heading, .cart-header { display: flex; align-items: center; gap: 9px; }
.catalog-heading strong { color: var(--ink); font-size: var(--fs-3); text-transform: uppercase; letter-spacing: .03em; }
.cat-pills { display: flex; gap: var(--sp-2); padding: var(--sp-3) 20px; overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  min-height: 40px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: var(--r-pill); background: var(--pill);
  font-weight: 700; font-size: var(--fs-2); color: var(--muted-strong); cursor: pointer; white-space: nowrap; user-select: none;
  text-transform: uppercase; letter-spacing: 0.02em; flex-shrink: 0;
}
.cat-pill.active { background: var(--chrome); color: var(--on-chrome); }
.catalog-search { padding: 0 20px 14px 20px; flex-shrink: 0; }
.catalog-search input, .field {
  width: 100%; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-2); border: 1.5px solid var(--line-strong);
  font-size: var(--fs-4); background: var(--paper); color: var(--ink);
}
.tile-grid {
  flex: 1; overflow-y: auto; padding: 0 20px 20px 20px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; align-content: start;
}
.catalog-order-setup-slot { flex: 0 0 auto; }
.tile {
  position: relative; background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-3); text-align: center; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-2); min-height: 96px; cursor: pointer;
  user-select: none; transition: transform 0.05s ease; -webkit-tap-highlight-color: transparent;
}
.tile:active { transform: scale(0.96); }
.tile.has-qty { border-color: var(--yellow); border-width: 2px; background: var(--highlight); }
.tile .name { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.tile .price { color: var(--ink-50); font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.tile-icon {
  width: 40px; height: 40px; padding: 8px; color: var(--ink-70); flex-shrink: 0;
  background: var(--pill); border-radius: 50%;
}
.tile.has-qty .tile-icon { color: var(--ink); background: #DDF3F0; }
.tile .qty-badge {
  position: absolute; top: 7px; right: 7px; z-index: 1; background: var(--yellow); color: var(--ink);
  border-radius: var(--r-pill); min-width: 26px; height: 26px; display: flex; align-items: center;
  justify-content: center; font-size: var(--fs-2); font-weight: 800; padding: 0 6px; border: 2px solid var(--paper);
  box-shadow: 0 1px 2px rgba(18,17,16,0.16);
}

/* skeleton / states */
.skeleton { background: linear-gradient(90deg, var(--pill) 25%, #f3efe4 37%, var(--pill) 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-2); min-height: 96px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.state { text-align: center; color: var(--ink-30); padding: 40px 20px; font-size: 15px; grid-column: 1 / -1; width: 100%; }
.state.error { color: var(--danger); }
.state .btn-secondary { margin-top: var(--sp-3); }
.state b { display: block; color: var(--ink-70); font-size: var(--fs-4); margin-bottom: 4px; }

/* ---------- cart ---------- */
.cart { min-width: 0; display: flex; flex-direction: column; background: var(--paper-2); overflow: hidden; }
.customer-panel { padding: 12px var(--sp-5); border-bottom: 1px solid var(--line-strong); background: var(--paper); flex-shrink: 0; }
.panel-heading { margin-bottom: var(--sp-2); }
.panel-heading > div { min-width: 0; }
.panel-heading span:not(.section-kicker):not(.customer-panel-icon) { display: block; color: var(--ink-50); font-size: var(--fs-1); }
.panel-heading .cp-label { margin-bottom: 1px; }
.customer-panel-icon { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--yellow); color: var(--ink); }
.customer-panel-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cp-label, .field-label, .detail-section { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-50); margin-bottom: var(--sp-2); }
.cp-search-row { position: relative; }
.cp-search-row input { width: 100%; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-2); border: 1.5px solid var(--line-strong); font-size: 15px; background: var(--warm-white); color: var(--ink); }
.customer-results { position: absolute; top: 105%; left: 0; right: 0; background: var(--paper); border-radius: var(--r-2); overflow: hidden; box-shadow: var(--shadow-2); z-index: 20; max-height: 40vh; overflow-y: auto; }
.customer-results .row { min-height: var(--tap); display: flex; align-items: center; padding: 0 14px; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--line); }
.customer-results .row:hover { background: var(--warm-white); }
.cp-selected { display: flex; align-items: center; justify-content: space-between; background: var(--warm-white); border-radius: var(--r-2); padding: var(--sp-3) 14px; gap: var(--sp-2); }
.cp-selected b { display: block; font-size: 15px; }
.cp-selected span { font-size: var(--fs-2); color: var(--ink-50); }
.cp-actions { display: flex; gap: 6px; }
.cp-change { min-height: 40px; border: 1.5px solid var(--line-strong); background: var(--paper); border-radius: var(--r-1); padding: 0 12px; font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cp-clear { width: 40px; min-height: 40px; padding: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--ink-70); font-size: 24px; font-weight: 400; line-height: 1; }
.cp-clear:hover { color: var(--ink); border-color: var(--ink); }
.cp-selected-wrap { background: var(--warm-white); border-radius: var(--r-2); }
.cp-selected-wrap .cp-selected { background: transparent; border-radius: 0; padding: var(--sp-3) 14px; }
.cp-wallet { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 0 14px var(--sp-3); border-top: 1px solid var(--line); }
.cp-wallet span { font-size: var(--fs-2); font-weight: 700; color: var(--ink); }
.cp-wallet .credit-offers-btn { flex: 0 0 auto; border-color: var(--ink); background: var(--yellow); }
.cp-new { margin-top: 10px; padding: var(--sp-3); background: var(--warm-white); border-radius: var(--r-2); }
.cp-new-hint { font-size: var(--fs-2); color: var(--ink-50); margin-bottom: var(--sp-2); }
.cp-new input { width: 100%; min-height: 44px; padding: 0 12px; margin-bottom: var(--sp-2); border-radius: var(--r-1); border: 1.5px solid var(--line-strong); font-size: var(--fs-3); }
.cp-new select { width: 100%; min-height: 40px; padding: 0 10px; margin-bottom: var(--sp-2); border-radius: var(--r-1); border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: var(--fs-2); font-weight: 700; }
.cp-new button { width: 100%; min-height: 44px; border: none; border-radius: var(--r-1); background: var(--chrome); color: var(--on-chrome); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; font-size: var(--fs-2); }

.cart-header { padding: 11px var(--sp-5) 8px; flex-shrink: 0; }
.cart-header div { display: flex; flex-direction: column; gap: 1px; }
.cart-header strong { font-size: var(--fs-4); }
.cart-header span:not(.section-kicker) { color: var(--ink-50); font-size: var(--fs-1); }
.cancel-order-btn { margin-left: auto; min-height: 36px; padding: 0 11px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink-50); font-size: var(--fs-1); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.cancel-order-btn:disabled { opacity: .45; cursor: not-allowed; }
.cart-items { flex: 0 1 170px; min-height: 78px; overflow-y: auto; padding: 4px var(--sp-5); scrollbar-gutter: stable; }
.cart-empty { color: var(--ink-30); text-align: center; padding: 24px 20px; font-size: 15px; }
.cart-line { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info .n { font-weight: 600; font-size: 14.5px; }
.cart-line .info .p { font-size: var(--fs-2); color: var(--ink-30); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: var(--r-2); border: none; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.stepper .minus { background: var(--stone); color: var(--ink); }
.stepper .plus { background: var(--chrome); color: var(--on-chrome); }
.stepper .qty { min-width: 24px; text-align: center; font-weight: 700; font-size: var(--fs-4); font-variant-numeric: tabular-nums; }
.cart-line .line-total { min-width: 58px; text-align: right; font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.customer-phone { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.live-customer { display: flex; flex-direction: column; gap: 2px; }
.live-customer small { color: var(--ink-50); font-size: var(--fs-1); font-variant-numeric: tabular-nums; }

.cart-footer { flex: 1 1 auto; min-height: 0; padding: 12px var(--sp-5) 18px; border-top: 1px solid var(--line-strong); background: var(--paper); overflow-y: auto; scrollbar-gutter: stable; }

/* Customer-first keeps the starting task unmistakable: find or create the
   customer first, then reveal the service and order controls. */
#orderWorkspace.customer-first .main { grid-template-columns: minmax(0, 600px); justify-content: center; background: var(--warm-white); }
#orderWorkspace.customer-first .catalog,
#orderWorkspace.customer-first .cart-header,
#orderWorkspace.customer-first .cart-items,
#orderWorkspace.customer-first .cart-footer { display: none; }
#orderWorkspace.customer-first .cart { background: transparent; overflow: visible; padding-top: clamp(36px, 11vh, 150px); }
#orderWorkspace.customer-first .customer-panel { padding: 0; border: 0; background: transparent; }
#orderWorkspace.customer-first .panel-heading { flex-direction: column; justify-content: center; gap: 7px; margin-bottom: 16px; text-align: center; }
#orderWorkspace.customer-first .panel-heading > div { text-align: center; }
#orderWorkspace.customer-first .panel-heading .cp-label { color: var(--ink); font-size: var(--fs-4); letter-spacing: .01em; }
#orderWorkspace.customer-first .panel-heading span:not(.section-kicker):not(.customer-panel-icon) { font-size: var(--fs-2); }
#orderWorkspace.customer-first .customer-panel-icon { width: 44px; height: 44px; flex-basis: 44px; background: var(--highlight); color: var(--chrome); border: 1px solid var(--line-strong); }
#orderWorkspace.customer-first .customer-panel-icon svg { width: 25px; height: 25px; }
#orderWorkspace.customer-first .cp-search-row input { min-height: 62px; padding: 0 18px; font-size: 17px; box-shadow: var(--shadow-1); }
.totals-row { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: var(--muted-strong); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.totals-row.discount { color: var(--danger); }
.totals-row.grand { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 10px; margin-bottom: 14px; }
.ready-by-card { padding: 10px; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--warm-white); }
.fulfilment-card, .pickup-booking-card { padding: 10px; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--warm-white); }
.fulfilment-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.fulfilment-choice button { min-height: 40px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font-weight: 700; }
.fulfilment-choice button.active { background: var(--chrome); color: var(--on-chrome); border-color: var(--chrome); }
.fulfilment-summary { margin-top: 8px; padding: 8px 10px; border-radius: var(--r-1); font-size: var(--fs-1); font-weight: 800; letter-spacing: .01em; }
.fulfilment-summary.pickup { background: var(--paper); color: var(--ink-70); border: 1px solid var(--line-strong); }
.fulfilment-summary.delivery { background: var(--highlight); color: var(--ink); border: 1px solid var(--yellow); }
#deliveryDetails { margin-top: 12px; }
#deliveryDetails select { width: 100%; min-height: 44px; margin: 5px 0 10px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); font: inherit; }
#deliveryDetails .btn-secondary-sm { margin: -2px 0 12px; }
.pickup-booking-card select { width: 100%; min-height: 42px; margin: 5px 0 4px; padding: 6px 8px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font: inherit; }
.pickup-booking-card > span { display: block; color: var(--ink-50); font-size: var(--fs-1); line-height: 1.35; }
.delivery-fee-preview { padding: 9px 10px; border-radius: var(--r-1); background: var(--paper); font-weight: 700; font-variant-numeric: tabular-nums; }
.delivery-payment-rule { margin-top: 8px; color: var(--ink-50); font-size: var(--fs-1); font-weight: 700; }
.ready-by-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.ready-by-heading label { font-weight: 800; }
.ready-by-heading span { color: var(--ink-50); font-size: var(--fs-1); text-align: right; }
.ready-quick, .ready-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ready-quick { margin-bottom: 8px; }
.ready-quick button { min-height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; }
.ready-quick button:active { background: var(--yellow); }
.ready-inputs input, .ready-inputs select { width: 100%; min-height: 42px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); padding: 6px 8px; font: inherit; background: var(--paper); color: var(--ink); }
.order-notes { margin: 8px 0; }
.order-notes textarea { width: 100%; resize: vertical; min-height: 50px; padding: 9px 10px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font: inherit; line-height: 1.35; }
.order-notes > span { display: block; margin-top: 4px; color: var(--ink-50); font-size: var(--fs-1); }
.cart-action-row { display: flex; gap: var(--sp-2); margin-bottom: 10px; }
.btn-secondary-sm { flex: 1; min-height: var(--tap); padding: 0 var(--sp-3); border-radius: var(--r-2); border: 1.5px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: var(--fs-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.btn-secondary-sm.active-flag { border-color: var(--ink); background: var(--warm-white); }
.btn-secondary-sm.full { width: 100%; flex: none; margin-bottom: var(--sp-3); }
.btn-secondary-sm:disabled { color: var(--ink-30); cursor: not-allowed; }
.create-btn { width: 100%; min-height: 60px; border: none; border-radius: var(--r-4); background: var(--yellow); color: var(--ink); font-size: var(--fs-4); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cart-footer .create-btn { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -8px 12px var(--paper); }

/* A wide counter display should use the confirmation space, not create a
   tall form next to an empty catalogue. Keep the compact single-column form
   for tablets; desktop gets two short, readable columns. */
@media (min-width: 1300px) {
  .main { grid-template-columns: minmax(560px, .9fr) minmax(680px, 1.1fr); }
  .topbar { padding-top: 7px; padding-bottom: 7px; }
  .nav button { min-height: 36px; }
  .order-flow { min-height: 56px; padding-top: 4px; padding-bottom: 4px; }
  .order-flow-step { min-height: 44px; }
  .cart-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-content: start; }
  .cart-footer .ready-by-card { grid-column: 1; }
  .cart-footer .fulfilment-card { grid-column: 2; }
  .cart-footer .pickup-booking-card { grid-column: 1 / -1; }
  .cart-footer .order-notes, .cart-footer .totals-row, .cart-footer .cart-action-row,
  .cart-footer .status-msg, .cart-footer .create-btn { grid-column: 1 / -1; }
  .cart-footer .order-notes { margin-top: 4px; }
  .cart-footer .create-btn { margin-top: 4px; }
  /* Setup happens where the services are chosen. The right panel remains a
     compact, always-visible order review and final action area. */
  #catalogOrderSetupSlot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 20px 12px; border-top: 1px solid var(--line-strong); background: var(--paper); }
  #catalogOrderSetupSlot .ready-by-card, #catalogOrderSetupSlot .fulfilment-card { margin: 0; }
  #catalogOrderSetupSlot .pickup-booking-card { grid-column: 1 / -1; margin: 0; }
  #catalogOrderSetupSlot .order-notes { grid-column: 1 / -1; margin: 0; }
  #catalogOrderSetupSlot .order-notes textarea { min-height: 42px; height: 42px; resize: none; }
  /* Keep the original, coherent summary on the right. Three garment rows
     fit before scrolling; the remaining checkout area stays compact. */
  /* The garment review owns the flexible space. The total and final action
     stay at the bottom of the panel, so the cashier never has to hunt for
     them below a large empty gap. */
  .cart-items { flex: 1 1 auto; min-height: 0; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 8px; align-content: start; }
  .cart-line { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--warm-white); }
  .cart-line .info .n { font-size: 13.5px; }
  .cart-line .line-total { min-width: 48px; font-size: 13px; }
  .stepper { gap: 4px; }
  .stepper .qty { min-width: 18px; font-size: 15px; }
  .stepper button { width: 34px; height: 34px; font-size: 18px; }
  .cart-footer { flex: 0 0 auto; max-height: none; padding-top: 8px; padding-bottom: 10px; }
  .ready-by-card, .fulfilment-card { padding: 8px; margin-bottom: 6px; }
  .ready-by-heading { margin-bottom: 6px; }
  .ready-quick { margin-bottom: 6px; }
  .ready-quick button { min-height: 34px; }
  .ready-inputs input, .ready-inputs select { min-height: 36px; }
  .fulfilment-choice { margin-top: 6px; }
  .fulfilment-choice button { min-height: 34px; }
  .fulfilment-summary { margin-top: 6px; padding: 6px 8px; }
  .order-notes { margin: 5px 0; }
  .order-notes textarea { min-height: 42px; padding: 7px 9px; }
  .totals-row.grand { margin-top: 6px; margin-bottom: 8px; }
  .cart-action-row { margin-bottom: 6px; }
  .create-btn { min-height: 52px; }
}

/* Counter monitors are often wide but short. Keep a normal 100% browser
   zoom usable by tightening the optional/secondary space before asking the
   cashier to scroll. The controls keep their touch targets. */
@media (min-width: 1300px) and (max-height: 850px) {
  .cart-items { flex: 1 1 auto; min-height: 0; max-height: none; gap: 6px; }
  .cart-line { min-height: 58px; padding: 5px 7px; gap: 6px; }
  .cart-footer { padding: 5px 12px 7px; }
  .ready-by-card, .fulfilment-card { padding: 6px; margin-bottom: 4px; }
  .ready-by-heading { margin-bottom: 3px; }
  .ready-by-heading span, .order-notes > span { display: none; }
  .ready-quick { margin-bottom: 4px; }
  .ready-quick button, .fulfilment-choice button { min-height: 30px; }
  .ready-inputs input, .ready-inputs select { min-height: 32px; }
  .fulfilment-choice { margin-top: 4px; }
  .fulfilment-summary { margin-top: 4px; padding: 5px 7px; }
  .order-notes { margin: 3px 0; }
  .cp-label, .field-label { margin-bottom: 2px; }
  .order-notes textarea { min-height: 34px; height: 34px; padding: 5px 8px; resize: none; }
  .totals-row { margin-bottom: 3px; }
  .totals-row.grand { font-size: 20px; margin: 3px 0 5px; }
  .cart-action-row { margin-bottom: 4px; }
  .cart-action-row .btn-secondary-sm { min-height: 34px; }
  .create-btn { min-height: 46px; }
}
.create-btn:disabled { background: var(--stone); color: var(--disabled-text); cursor: not-allowed; }
.status-msg { text-align: center; padding: var(--sp-2); font-size: var(--fs-3); min-height: 20px; }
.status-msg.error { color: var(--danger); }
.status-msg.success { color: var(--success); }

/* ---------- Order Desk board ---------- */
.board { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.board-tools { display: flex; gap: var(--sp-2); padding: var(--sp-4) 20px 0 20px; flex-shrink: 0; align-items: center; }
.board-tools input { flex: 1; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-2); border: 1.5px solid var(--line-strong); font-size: var(--fs-3); background: var(--paper); }
.live-status { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); padding: var(--sp-4) 20px 0; flex-shrink: 0; }
.live-status-card { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); }
.live-status-card.ready-delivery { border-top: 4px solid #277ac2; }
.live-status-card.ready-pickup { border-top: 4px solid #2f7a50; }
.live-status-card.attention { border-top: 4px solid #b76518; }
.live-status-card.overdue { background: var(--chrome); color: var(--on-chrome); border-color: var(--chrome); }
.live-status-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.live-status-icon-wrap { width: 54px; height: 54px; flex: 0 0 54px; display: inline-flex; align-items: center; justify-content: center; border-radius: 18px; background: var(--highlight); color: var(--ink-50); }
.process-icon { width: 31px; height: 31px; flex: 0 0 auto; color: currentColor; }
.live-status-card.ready-delivery .live-status-icon-wrap { background: #e4f1fb; color: #277ac2; }.live-status-card.ready-pickup .live-status-icon-wrap { background: #e7f3eb; color: #2f7a50; }.live-status-card.attention .live-status-icon-wrap { background: #fff1df; color: #b76518; }
.live-status-label { font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-50); }
.live-status-card.overdue .live-status-label { color: var(--on-chrome); opacity: .72; }
.live-status-card.overdue .live-status-icon-wrap { background: #1e3a53; color: #f0a34a; }
.live-status-value { font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.live-status-detail { font-size: var(--fs-1); color: var(--ink-50); }
.live-status-card.overdue .live-status-detail { color: #f0a34a; }
.board-cols { flex: 1; display: flex; overflow-x: auto; padding: 20px; gap: 20px; align-items: flex-start; }
.board-col { flex: 1 1 320px; min-width: 280px; display: flex; flex-direction: column; gap: var(--sp-3); }
.board-col h3 { margin: 0 0 4px 4px; font-size: var(--fs-2); color: var(--muted-strong); text-transform: uppercase; letter-spacing: 0.03em; }
.order-card { background: var(--paper); border-radius: var(--r-3); padding: var(--sp-4); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: var(--sp-2); }
.order-card .row1 { display: flex; justify-content: space-between; align-items: center; }
.order-card .name { font-weight: 700; font-size: var(--fs-4); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.badge { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap; }
.badge.not_paid { background: var(--chrome); color: var(--on-chrome); }
.badge.partially_paid { background: var(--stone); color: var(--ink); }
.badge.paid { background: #2f7a50; color: #fff; }
.order-card .customer { color: var(--ink-70); font-size: var(--fs-3); }
.order-card .meta { color: var(--ink-50); font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.delivery-flag { color: #13517f; background: #e4f1fb; border: 1px solid #6baddd; border-radius: var(--r-pill); padding: 3px 8px; font-size: var(--fs-1); font-weight: 800; width: fit-content; }
.order-card .board-stage { color: var(--ink-70); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.order-card .due { color: var(--ink); font-weight: 700; font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.order-card .due::before { content: "● "; color: #b76518; }
.order-card .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.order-card .actions button { border: none; border-radius: var(--r-1); min-height: 40px; padding: 0 12px; font-size: var(--fs-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.act-primary { background: var(--chrome); color: var(--on-chrome); }
.act-success { background: #2f7a50; color: #fff; }
.act-delivery { background: #277ac2; color: #fff; }
.act-warning { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line-strong) !important; }
.board-empty { color: var(--ink-30); padding: 40px; text-align: center; width: 100%; }

/* A successful tender is not the end of the counter workflow: show the
   customer-facing receipt before asking staff to print or close it. */
.receipt-preview { margin: var(--sp-4) 0; border: 1px solid var(--line-strong); border-radius: var(--r-2); overflow: hidden; background: var(--paper-2); }
.receipt-preview-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--highlight); }
.receipt-preview-head strong, .receipt-preview-head span { display: block; }
.receipt-preview-head strong { font-size: var(--fs-3); }
.receipt-preview-head span { margin-top: 2px; font-size: var(--fs-1); color: var(--ink-50); }
.receipt-preview-tabs { display: flex; gap: 4px; padding: 3px; border-radius: var(--r-1); background: var(--switch-bg); }
.receipt-preview-tabs button { min-height: 32px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: var(--switch-text); font: inherit; font-size: var(--fs-1); font-weight: 700; white-space: nowrap; }
.receipt-preview-tabs button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.receipt-preview-frame { display: block; width: 100%; height: min(48vh, 460px); min-height: 300px; border: 0; background: #fff; }

/* ---------- Live: Board/List view switch ---------- */
.view-switch { display: flex; background: var(--switch-bg); border-radius: var(--r-2); padding: 3px; gap: 2px; flex-shrink: 0; }
.view-switch button { border: none; background: transparent; min-height: 34px; padding: 0 14px; border-radius: var(--r-1); font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--switch-text); }
.view-switch button.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- Live: List view (grouped, expandable — mirrors the Odoo list) ---------- */
.live-groups { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.live-group { display: flex; flex-direction: column; gap: 6px; }
.live-group-header { display: flex; align-items: center; gap: 10px; cursor: pointer; border-bottom: 2px solid var(--line-strong); padding-bottom: 6px; user-select: none; }
.live-group-header .caret { display: inline-block; transition: transform .15s; color: var(--ink-50); }
.live-group-header.open .caret { transform: rotate(90deg); }
.live-group-header h3 { margin: 0; font-size: var(--fs-3); color: var(--ink); text-transform: uppercase; letter-spacing: 0.03em; flex: 1; }
.live-subtotals { display: flex; gap: 18px; color: var(--ink-70); font-variant-numeric: tabular-nums; }
.live-subtotal { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.live-subtotal-label { color: var(--ink-50); font-size: var(--fs-0); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.live-subtotal-value { color: var(--ink-70); font-size: var(--fs-2); font-weight: 700; }
.live-table { display: none; flex-direction: column; overflow-x: auto; }
.live-table.open { display: flex; }
.live-row {
  display: grid; grid-template-columns: 28px 90px 1.2fr 100px 110px 55px 85px 85px 85px 110px 120px;
  gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: center;
  font-size: var(--fs-2); font-variant-numeric: tabular-nums; min-width: 900px;
}
.live-row-openable { cursor: pointer; }
.live-row-openable:hover { background: var(--highlight); }
.live-row-openable:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.live-row-head { font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.02em; color: var(--ink-50); border-bottom: 1px solid var(--line-strong); }
.live-row .caret-btn { background: none; border: none; cursor: pointer; font-size: 12px; color: var(--ink-50); padding: 0; }
.live-row .ticket { font-weight: 700; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.live-detail { padding: 10px 14px 16px 42px; background: var(--detail-surface); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 900px; }
.live-detail .item-line { display: flex; justify-content: space-between; font-size: var(--fs-2); padding: 2px 0; }
.live-detail .live-order-note { max-width: 760px; padding: 7px 9px; border-left: 3px solid var(--yellow); background: var(--highlight); color: var(--ink-70); font-size: var(--fs-2); line-height: 1.35; }
.live-detail .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.live-detail .row-actions button { border: none; border-radius: var(--r-1); min-height: 38px; padding: 0 12px; font-size: var(--fs-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.live-detail .full-link { align-self: flex-start; background: none; border: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; font-size: var(--fs-2); padding: 0; }

/* ---------- Log (full order history, grouped by stage) ---------- */
.log { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.log .board-tools select { min-height: var(--tap); padding: 0 10px; border-radius: var(--r-2); border: 1.5px solid var(--line-strong); font-size: var(--fs-3); background: var(--paper); }
.log-groups { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.log-group { display: flex; flex-direction: column; gap: 6px; }
.log-group-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid var(--line-strong); padding-bottom: 6px; }
.log-group-header h3 { margin: 0; font-size: var(--fs-3); color: var(--ink); text-transform: uppercase; letter-spacing: 0.03em; }
.log-subtotals { display: flex; gap: 14px; font-size: var(--fs-2); font-weight: 700; color: var(--ink-70); font-variant-numeric: tabular-nums; }
.log-table { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 1.1fr 1.3fr 0.6fr 0.9fr 0.9fr 0.9fr 1.2fr; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: center; font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.log-row-head { font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.02em; color: var(--ink-50); border-bottom: 1px solid var(--line-strong); }
.log-row .name { font-weight: 700; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.log-customer { display: flex; align-items: center; gap: 6px; min-width: 0; }
.log-customer .delivery-flag { flex: 0 0 auto; padding: 2px 6px; font-size: 10px; }

/* ---------- held list ---------- */
.held-list { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; margin-bottom: var(--sp-2); }
.held-item { background: var(--warm-white); border-radius: var(--r-2); padding: var(--sp-3) 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.held-item .hi-info b { display: block; font-size: 14.5px; }
.held-item .hi-info span { font-size: var(--fs-2); color: var(--ink-50); }
.held-item .hi-actions { display: flex; gap: 6px; }
.held-item .hi-actions button { border: none; border-radius: var(--r-1); min-height: 40px; padding: 0 11px; font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; }
.held-recovery-title { margin-top: 8px; padding: 10px 2px 2px; border-top: 1px solid var(--line); color: var(--ink-50); font-size: var(--fs-2); font-weight: 700; }
.held-item.held-discarded { opacity: .76; background: var(--paper); }
.held-empty { text-align: center; color: var(--ink-30); padding: var(--sp-5); }

/* ---------- modals (bottom sheets on phones) ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(18,17,16,0.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: var(--sp-4); }
.modal { background: var(--paper); border-radius: var(--r-4); padding: var(--sp-5); width: 360px; max-width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal.wide { width: 440px; }
.modal h3 { margin: 0 0 var(--sp-4) 0; font-size: var(--fs-5); }
.modal-title-row { display: flex; align-items: flex-start; gap: 10px; }
.modal-title-row h3 { flex: 1; }
.modal-close { width: 38px; height: 38px; margin: -5px -5px 0 0; flex: 0 0 auto; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--ink); font-size: 27px; font-weight: 400; line-height: 1; }
.modal input[type=number], .modal input[type=text], .modal input[type=password], .modal input[type=date] {
  width: 100%; min-height: var(--tap); padding: 0 12px; font-size: var(--fs-4); border-radius: var(--r-2); border: 1.5px solid var(--line-strong); margin-bottom: 14px;
}
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: 18px; }
.method-grid button { min-height: var(--tap); border-radius: var(--r-2); border: 2px solid var(--line-strong); background: var(--paper); font-weight: 600; }
.method-grid button.selected { border-color: var(--ink); background: var(--warm-white); color: var(--ink); }

/* ---------- service-type modal (grouped catalog variants, e.g. Dishdasha > Iron/Dry Clean/…) ---------- */
.svc-title-price { color: var(--ink-50); font-weight: 500; font-size: var(--fs-4); }
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin: var(--sp-2) 0 18px; }
.svc-btn {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 12px; border-radius: var(--r-2); border: 2px solid var(--line-strong);
  background: var(--paper); font-weight: 600; font-size: var(--fs-3); text-align: left; color: var(--ink);
}
.svc-btn.selected { border-color: var(--ink); background: var(--highlight); }
.svc-btn-custom { justify-content: center; grid-column: 1 / -1; }
.ghutra-details { margin: -4px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--warm-white); }
.ghutra-details > .cp-label { margin-bottom: 10px; color: var(--ink); }
.ghutra-choice-label { display: block; margin: 12px 0 7px; color: var(--ink-50); font-size: var(--fs-1); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ghutra-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.ghutra-choice-grid button { min-height: 40px; padding: 0 7px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font-size: var(--fs-2); font-weight: 700; }
.ghutra-choice-grid button.selected { border-color: var(--yellow); background: var(--highlight); box-shadow: inset 0 0 0 1px var(--yellow); }
.cart-line .service-note { color: var(--ink-70); font-size: var(--fs-2); font-weight: 700; }
.svc-price {
  background: var(--chrome); color: var(--on-chrome); border-radius: var(--r-pill); padding: 3px 10px;
  font-size: var(--fs-2); font-weight: 800; white-space: nowrap; flex-shrink: 0;
}
.topup-intro { margin: -4px 0 12px; color: var(--ink-50); font-size: var(--fs-2); }
.credit-offer { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; min-height: 88px; padding: 14px; border: 2px solid var(--line-strong); border-radius: var(--r-2); background: var(--paper); color: var(--ink); text-align: left; }
.credit-offer.selected { border-color: var(--ink); background: var(--highlight); }
.credit-offer-pay { color: var(--ink-50); font-size: var(--fs-2); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.credit-offer strong { align-self: end; font-size: var(--fs-4); font-variant-numeric: tabular-nums; }
.credit-offer-bonus { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: 4px 8px; border-radius: var(--r-pill); background: var(--yellow); color: var(--ink); font-size: var(--fs-1); font-weight: 800; white-space: nowrap; }
.credit-offer-bonus.muted { background: var(--stone); }
#topupTierGrid { grid-template-columns: 1fr; margin-bottom: 14px; }
#serviceTypeCustomRow { margin: -8px 0 18px; }
#serviceTypeCustomRow input {
  width: 100%; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-2);
  border: 2px solid var(--line-strong); font-size: var(--fs-3); font-weight: 600; color: var(--ink);
}
#serviceTypeCustomRow .cp-label { margin: 10px 0 5px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; min-height: 52px; border: none; border-radius: var(--r-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.modal-cancel { background: var(--pill); color: var(--ink); }
.modal-submit { background: var(--yellow); color: var(--ink); }
.modal-submit.danger { background: var(--danger); color: #fff; }
.modal-more { background: var(--paper); color: var(--ink-70); border: 1.5px solid var(--line-strong); }

/* ---------- customer profile ---------- */
.modal.customer-profile-modal { width: min(920px, calc(100vw - 32px)); }
.profile-overview { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 12px; margin: -4px 0 14px; background: var(--warm-white); border-radius: var(--r-2); font-size: var(--fs-2); }
.profile-overview b { color: var(--ink); }.profile-overview span { color: var(--ink-50); }.profile-overview strong { margin-left: auto; }
.profile-workspace { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 20px; }.profile-section { border-top: 1px solid var(--line); padding: 14px 0; }.profile-section h4 { margin: 0 0 8px; font-size: var(--fs-3); }
.profile-help, .profile-empty { color: var(--ink-50); font-size: var(--fs-2); margin: 0 0 10px; }
.profile-orders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 230px; overflow-y: auto; padding-right: 3px; }
.profile-order, .saved-address { border: 1px solid var(--line-strong); background: var(--warm-white); border-radius: var(--r-1); padding: 9px 10px; font-size: var(--fs-2); }
.profile-order b, .profile-order span, .profile-order small, .saved-address b, .saved-address span, .saved-address small { display: block; }.profile-order span, .profile-order small, .saved-address span, .saved-address small { color: var(--ink-50); margin-top: 2px; }
.profile-order-action { margin-top: 7px; margin-right: 5px; min-height: 30px; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); padding: 0 8px; font-size: var(--fs-1); font-weight: 700; }.profile-order-action.danger { color: var(--danger); border-color: var(--danger); }
.saved-address { position: relative; margin-bottom: 8px; padding-right: 132px; }.saved-address a { display: inline-block; margin-top: 6px; color: var(--ink); font-weight: 700; }.address-remove, .address-edit { position: absolute; top: 8px; border: 1px solid var(--line-strong); background: var(--paper); border-radius: var(--r-1); min-height: 32px; padding: 0 8px; font-size: var(--fs-1); font-weight: 700; }.address-remove { right: 8px; color: var(--danger); border-color: var(--danger); }.address-edit { right: 70px; }
.customer-profile-modal textarea, .customer-profile-modal input[type=text], .customer-profile-modal input[type=url] { width: 100%; min-height: 42px; padding: 9px 11px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); background: var(--paper); color: var(--ink); font: inherit; margin: 0 0 8px; }.customer-profile-modal textarea { min-height: 72px; resize: vertical; }
.directory-results { position: static; display: flex; flex-direction: column; gap: 6px; max-height: 48vh; overflow-y: auto; margin-top: 10px; }.directory-row { border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--warm-white); color: var(--ink); text-align: left; padding: 10px 12px; min-height: 54px; }.directory-row b, .directory-row span { display: block; }.directory-row span { color: var(--ink-50); font-size: var(--fs-2); margin-top: 2px; }
.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }.address-default { display: block; margin: 2px 0 10px; font-size: var(--fs-2); }.address-default input { accent-color: var(--yellow); }
.paci-lookup { margin: 4px 0 10px; padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--highlight); }
.paci-lookup strong { display: block; font-size: var(--fs-2); }.paci-lookup p { margin: 4px 0 8px; color: var(--ink-50); font-size: var(--fs-1); line-height: 1.35; }
.customer-profile-modal .paci-lookup input[type=text] { margin-bottom: 8px; background: var(--paper); font-size: var(--fs-2); }
.paci-lookup-actions { display: flex; gap: 8px; }.paci-lookup-actions button { flex: 1; min-height: 38px; }
.paci-status { color: var(--success) !important; font-weight: 700; }
.driver-paci-link { display: inline-flex; width: fit-content; margin-top: 10px; text-decoration: none; }
@media (max-width: 800px) { .modal.customer-profile-modal { width: 100%; }.profile-workspace { grid-template-columns: 1fr; gap: 0; }.profile-orders { grid-template-columns: 1fr; max-height: 220px; }.profile-overview strong { width: 100%; margin-left: 0; }.address-grid { grid-template-columns: 1fr; gap: 0; } }

/* ---------- login ---------- */
.login-screen { position: fixed; inset: 0; background: var(--chrome); display: flex; align-items: center; justify-content: center; z-index: 100; padding: var(--sp-5); overflow-y: auto; }
.login-box { width: 380px; max-width: 100%; text-align: center; }
.login-box .z-mark { width: 48px; height: 48px; margin: 0 auto 8px auto; display: block; }
.login-box .wordmark { color: var(--on-chrome); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; display: block; }
.login-step-title { color: var(--stone); font-size: var(--fs-3); margin-bottom: 22px; }
.login-box input { width: 100%; min-height: 52px; padding: 0 14px; margin-bottom: var(--sp-3); border-radius: var(--r-2); border: none; font-size: var(--fs-4); background: var(--warm-white); color: var(--ink); }
.login-box button.primary { width: 100%; min-height: 52px; border: none; border-radius: var(--r-2); background: var(--yellow); color: var(--ink); font-size: 15px; font-weight: 700; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.02em; }
.login-error { color: var(--yellow); font-size: 13.5px; min-height: 18px; margin-top: 10px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--sp-3); max-height: 50vh; overflow-y: auto; margin-bottom: 6px; }
.pick-tile { background: rgba(246,241,228,0.08); border: 1.5px solid rgba(246,241,228,0.25); border-radius: var(--r-3); min-height: 64px; display: flex; align-items: center; justify-content: center; padding: var(--sp-3); color: var(--on-chrome); font-weight: 700; font-size: var(--fs-3); cursor: pointer; text-align: center; user-select: none; }
.pick-tile:active { background: rgba(245,197,24,0.18); border-color: var(--yellow); }
.login-back { background: none; border: none; color: var(--stone); font-size: var(--fs-2); cursor: pointer; margin-bottom: 14px; text-decoration: underline; min-height: 40px; }
.login-selected-name { color: var(--yellow); font-weight: 700; font-size: 17px; margin-bottom: 20px; }
.login-install { margin-top: 18px; }
.login-install button { background: transparent; border: 1px solid var(--stone); color: var(--stone); min-height: 40px; padding: 0 14px; border-radius: var(--r-1); font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }

/* ---------- shift summary ---------- */
.shift-summary { text-align: left; font-size: var(--fs-3); margin-bottom: var(--sp-4); font-variant-numeric: tabular-nums; }
.shift-summary .row { display: flex; justify-content: space-between; padding: 4px 0; }
.shift-summary .row.total { font-weight: 700; border-top: 1px solid var(--line-strong); margin-top: 6px; padding-top: 8px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--chrome); color: var(--on-chrome); padding: 14px 22px; border-radius: var(--r-3); font-size: var(--fs-3); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,0.3); z-index: 200; max-width: min(80vw, 520px); text-align: center; }
.toast.error { background: var(--danger); }

/* ---------- Z-mark transition ----------
   Plays on login and shift open/close only. Never captures pointer
   events. The "shine" is a separate opacity-animated halo (compositor
   only) instead of an animated drop-shadow filter, which forced
   per-frame rasterisation on low-end Android. */
.transition-overlay { position: fixed; inset: 0; background: var(--chrome); z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.18s ease; }
.idle-clock { position: fixed; inset: 0; z-index: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: var(--sp-5); background: var(--chrome); color: var(--on-chrome); text-align: center; user-select: none; }
.idle-brand { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-5); color: var(--yellow); font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.idle-brand .z-mark { width: 34px; height: 34px; }
.idle-time { display: flex; align-items: baseline; gap: .14em; color: var(--on-chrome); font-size: clamp(64px, 15vw, 150px); font-weight: 800; line-height: .9; letter-spacing: -0.07em; font-variant-numeric: tabular-nums; }
.idle-period { color: var(--yellow); font-size: .34em; font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
.idle-date { color: var(--stone); font-size: clamp(16px, 2.5vw, 24px); font-weight: 600; }
.idle-clock p { margin: var(--sp-5) 0 0; color: var(--yellow); font-size: var(--fs-2); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.transition-overlay.show { opacity: 1; }
.transition-overlay svg { width: 150px; height: 150px; overflow: visible; }
.transition-overlay .z-outline { fill: none; stroke: rgba(249,250,251,0.22); stroke-width: 2.5; }
.transition-overlay .cloth { offset-path: path('M30,27 C56,33 34,47 62,55 C70,57.5 68,61 60,60'); offset-rotate: 0deg; offset-distance: 0%; r: 5; fill: #6B7F92; }
.transition-overlay .halo { offset-path: path('M30,27 C56,33 34,47 62,55 C70,57.5 68,61 60,60'); offset-rotate: 0deg; offset-distance: 0%; r: 11; fill: var(--yellow); opacity: 0; }
.transition-overlay.show .cloth { animation: clothMove 820ms ease-in-out forwards; }
.transition-overlay.show .halo { animation: haloMove 820ms ease-in-out forwards; }
@keyframes clothMove { 0% { offset-distance: 0%; fill: #6B7F92; r: 5; } 55% { fill: #8FD0C9; r: 5.5; } 100% { offset-distance: 100%; fill: #F1AE22; r: 6.5; } }
@keyframes haloMove { 0% { offset-distance: 0%; opacity: 0; } 70% { opacity: 0; } 100% { offset-distance: 100%; opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) {
  .transition-overlay { transition: opacity 0.15s ease; }
  .transition-overlay.show .cloth, .transition-overlay.show .halo { animation: none; }
  .tile, .btn, .btn-primary, .btn-secondary, .btn-danger, .btn-dark { transition: none; }
  .skeleton { animation: none; }
}
html.reduce-motion .transition-overlay.show .cloth, html.reduce-motion .transition-overlay.show .halo { animation: none; }
html.reduce-motion .skeleton { animation: none; }

/* ---------- payments / detail / receipts ---------- */
.pay-summary { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-size: 15px; color: var(--muted-strong); }
.pay-summary b { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.pay-summary.small b { font-size: var(--fs-4); }
.tender-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); }
.tender-row { display: flex; justify-content: space-between; align-items: center; background: var(--warm-white); border-radius: var(--r-2); padding: 10px 12px; font-size: var(--fs-3); font-variant-numeric: tabular-nums; }
.tender-row b { text-transform: uppercase; font-size: var(--fs-1); letter-spacing: 0.02em; }
.tender-row button { border: none; background: transparent; color: var(--danger); font-weight: 700; min-height: 40px; }
.change-hint { font-size: var(--fs-3); font-weight: 700; margin: -6px 0 12px 0; color: var(--success); min-height: 18px; font-variant-numeric: tabular-nums; }
.pay-result { text-align: center; padding: 18px 0 22px 0; }
.pay-result-big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-result-sub { color: var(--muted-strong); margin-top: 6px; font-size: var(--fs-3); }
.detail-body { max-height: 55vh; overflow-y: auto; font-size: var(--fs-3); margin-bottom: var(--sp-3); }
.detail-section { margin: var(--sp-3) 0 6px 0; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.detail-row .grow { flex: 1; min-width: 0; }
.detail-row .muted { color: var(--ink-50); font-size: var(--fs-2); }
.detail-row button { border: 1.5px solid var(--line-strong); background: var(--paper); border-radius: var(--r-1); min-height: 36px; padding: 0 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.detail-totals { margin-top: 10px; font-weight: 700; }
.receipt-row button { margin-left: 6px; }
.ticket-reminder { margin: 0 0 var(--sp-4); padding: 14px 16px; border-radius: var(--r-2); background: var(--chrome); color: var(--on-chrome); }
.ticket-reminder span { display: block; color: var(--yellow); font-size: var(--fs-1); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ticket-reminder strong { display: block; margin: 3px 0 4px; font-size: 28px; line-height: 1; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.ticket-reminder p { margin: 0; color: var(--on-chrome); font-size: var(--fs-2); line-height: 1.35; }

/* ---------- manage area ---------- */
.manage { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.manage-tabs { display: flex; gap: var(--sp-2); padding: var(--sp-4) 20px var(--sp-3) 20px; overflow-x: auto; flex-shrink: 0; border-bottom: 1px solid var(--line-strong); background: var(--paper); scrollbar-width: none; }
.manage-body { flex: 1; overflow-y: auto; padding: 20px; }
#screen-driver { position: relative; }
.panel { background: var(--paper); border-radius: var(--r-3); padding: 18px 20px; box-shadow: var(--shadow-1); margin-bottom: var(--sp-4); max-width: 980px; }
.panel h3 { margin: 0 0 var(--sp-3) 0; font-size: var(--fs-4); }
.panel .toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
.panel .toolbar input, .panel .toolbar select { min-height: 40px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); font-size: 13.5px; background: var(--paper); color: var(--ink); }
.panel .toolbar button, .btn-sm { border: 1.5px solid var(--line-strong); background: var(--paper); border-radius: var(--r-1); min-height: 40px; padding: 0 12px; font-size: var(--fs-1); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.btn-sm.primary { background: var(--chrome); color: var(--on-chrome); border-color: var(--chrome); }
.btn-sm.accent { background: var(--yellow); border-color: var(--yellow); }
.btn-sm.danger { color: var(--danger); border-color: #e5b7ae; }
/* The generic toolbar rule is intentionally broad. These more-specific
   action rules keep driver/dispatch controls visibly primary, accent, or
   disabled instead of falling back to a pale white button. */
.panel .toolbar button.btn-sm.primary { background: var(--chrome); color: var(--on-chrome); border-color: var(--chrome); }
.panel .toolbar button.btn-sm.accent { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.panel .toolbar button.btn-sm.danger { color: var(--danger); border-color: #e5b7ae; }
.panel .toolbar button.btn-sm:disabled { background: var(--stone); color: var(--disabled-text); border-color: var(--stone); cursor: not-allowed; }
.photo-capture { position: relative; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.photo-capture input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-capture.saving { opacity: .62; pointer-events: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.grid th { text-align: left; font-size: var(--fs-1); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-50); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); }
table.grid td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid td.num, table.grid th.num { text-align: right; white-space: nowrap; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover { background: var(--warm-white); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--warm-white); border-radius: var(--r-2); padding: 12px 14px; }
.kpi .k { font-size: var(--fs-1); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-50); }
.kpi .v { font-size: var(--fs-5); font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .v.neg { color: var(--danger); }
.kpi .v.ok { color: var(--success); }
.pill-ok { background: #e3efe3; color: var(--success); border-radius: var(--r-pill); padding: 3px 9px; font-size: var(--fs-1); font-weight: 700; }
.pill-bad { background: #f6dcd7; color: var(--danger); border-radius: var(--r-pill); padding: 3px 9px; font-size: var(--fs-1); font-weight: 700; }
.pill-pending { background: #e7eff6; color: #365a78; border-radius: var(--r-pill); padding: 3px 9px; font-size: var(--fs-1); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.form-grid label { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-50); margin-bottom: 4px; }
.form-grid input[type=text], .form-grid input[type=number] { width: 100%; min-height: 44px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: var(--r-1); font-size: var(--fs-3); }
.form-grid .check { display: flex; align-items: center; gap: 8px; padding-top: 22px; font-size: var(--fs-3); }
.form-grid .check input { width: 22px; height: 22px; }
.form-grid .ar-input { direction: rtl; }
.order-promotion { display: grid; gap: 5px; margin-top: 8px; }
.promotion-input-row { display: flex; gap: 8px; }
.promotion-input-row input { flex: 1; min-width: 0; text-transform: uppercase; }
.promotion-input-row button { white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .board-col { flex: 0 0 260px; }
  .cart { min-width: 300px; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; row-gap: 6px; gap: var(--sp-2); }
  .topbar-spacer { display: none; }
  .location-tag { order: 5; width: 100%; text-align: center; }
  .nav { order: 4; width: 100%; justify-content: space-between; }
  .nav button { flex: 1; padding: 0 6px; font-size: var(--fs-1); }
  .staff-box { margin-left: auto; gap: 6px; }
  .staff-box .who { display: none; }
  .order-flow { display: grid; grid-template-columns: 1fr; gap: 0; padding: 0; border-bottom: 0; overflow: visible; }
  .order-flow-step { min-height: 48px; padding: 8px 12px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
  .order-flow-step:not(:last-child)::after { content: none; }
  .order-flow-step small { display: none; }
  .main { display: flex; flex-direction: column; overflow-y: auto; }
  #orderWorkspace.customer-first .main { justify-content: flex-start; }
  #orderWorkspace.customer-first .cart { padding: 24px 16px 32px; }
  /* The driver screen is a real page scroll on phones. This lets the
     browser provide its own familiar pull-to-refresh spinner at the top. */
  #appRoot.driver-native-scroll { height: auto; min-height: 100dvh; }
  #appRoot.driver-native-scroll #screen-driver { flex: 1 0 auto; overflow: visible; }
  #appRoot.driver-native-scroll #screen-driver .manage-body { flex: 0 0 auto; min-height: calc(100dvh - 150px); overflow: visible; }
  .catalog { border-right: none; border-bottom: 1px solid var(--line-strong); flex: none; max-height: 50vh; }
  .cart { min-width: 0; flex: none; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; padding: 0 12px 12px 12px; }
  .catalog-heading, .cat-pills, .catalog-search { padding-left: 12px; padding-right: 12px; }
  .customer-panel, .cart-items, .cart-footer, .cart-header { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .cart-items { flex: none; max-height: 34vh; }
  .cart-footer { min-height: auto; overflow: visible; }
  .board-cols { padding: 12px; gap: 12px; }
  .board-tools { padding: 12px 12px 0 12px; }
  .live-status { padding: 12px 12px 0; gap: 10px; }
  .board-col { flex: 0 0 82vw; }
  .manage-body { padding: var(--sp-3); }
  .log-groups { padding: 12px; gap: 16px; }
  .log-table { overflow-x: auto; }
  .log-row { grid-template-columns: 140px 160px 70px 100px 100px 100px 140px; min-width: 750px; }
  .log-subtotals { font-size: 11px; gap: 8px; }
  .live-groups { padding: 12px; gap: 16px; }
  .live-subtotals { gap: 10px; }
  .live-subtotal-label { font-size: 10px; }
  .live-subtotal-value { font-size: 11px; }
  .board-tools { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .dashboard { padding: 16px 12px; }.dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }.dashboard-grid { grid-template-columns: 1fr; }
  .delivery-desk { padding: 0; }.delivery-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }.delivery-lanes { grid-template-columns: 1fr; }
  /* modals become bottom sheets */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; border-radius: var(--r-4) var(--r-4) 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)) 18px; max-height: 92vh; max-height: 92dvh; }
  .modal.wide { width: 100%; }
  .modal-actions button { min-height: 52px; }
  .detail-body { max-height: 50vh; }
}
@media (max-width: 600px) {
  .topbar .brand .wordmark { display: none; }
  .tile { min-height: 84px; padding: 12px 8px; }
  .tile .name { font-size: 13.5px; }
  .tile-icon { width: 34px; height: 34px; padding: 7px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .live-status { grid-template-columns: 1fr 1fr; }
  .live-status-card { min-height: 76px; padding: 10px 12px; }
  .totals-row.grand { font-size: 20px; }
  #screen-driver .manage-body, #screen-delivery .manage-body { padding: 12px; }
  #screen-driver .panel, #screen-delivery .panel { padding: 14px; }
  #screen-driver .panel .toolbar, #screen-delivery .panel .toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  #screen-driver .panel .toolbar > button, #screen-driver .panel .toolbar > .photo-capture, #screen-delivery .panel .toolbar > button, #screen-delivery .panel .toolbar > .photo-capture { width: 100%; min-height: 48px; }
  #screen-driver input[type=file], #screen-delivery input[type=file] { width: 100%; min-height: 42px; }
  .dashboard-head, .delivery-desk-head { flex-direction: column; }.dashboard-head .btn-secondary, .delivery-desk-head .btn-secondary { width: 100%; }
}
/* keyboard open on phones: keep the focused input above it (JS sets --kb) */
.app.kb-open .main { padding-bottom: var(--kb, 0px); }
.modal-overlay.kb-open .modal { max-height: calc(100dvh - var(--kb, 0px)); }
.consent-choice {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: .7rem 0 .15rem;
  color: var(--ink, #102a43);
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.35;
}
.consent-choice input { margin-top: .18rem; accent-color: var(--accent, #f7b21b); }
