/* Layout: sidebar + work area on desktop, top bar + bottom tab bar on phones.
   The laundry's own brand colour replaces --brand at runtime. */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #eaf0f3;
  --line: #d8e1e6;
  --ink: #12222b;
  --ink-2: #4b5d68;
  --ink-3: #7b8c96;
  --brand: #0e7490;
  --on-brand: #ffffff;
  --ok: #157f4b;      --ok-bg: #e2f4ea;
  --warn: #9a5b00;    --warn-bg: #fdf0d9;
  --bad: #b42318;     --bad-bg: #fde7e4;
  --info: #1d5fb8;    --info-bg: #e3eefc;
  --shadow: 0 1px 2px rgb(18 34 43 / .06), 0 4px 16px rgb(18 34 43 / .06);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d161b; --surface: #142028; --surface-2: #1b2a33; --line: #2a3b45;
    --ink: #e6eef2; --ink-2: #a6b6bf; --ink-3: #7d8f99;
    --ok: #5fd39a; --ok-bg: #12301f; --warn: #f2b860; --warn-bg: #352712;
    --bad: #ff8a7d; --bad-bg: #3a1714; --info: #8ab8ff; --info-bg: #15263f;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d161b; --surface: #142028; --surface-2: #1b2a33; --line: #2a3b45;
  --ink: #e6eef2; --ink-2: #a6b6bf; --ink-3: #7d8f99;
  --ok: #5fd39a; --ok-bg: #12301f; --warn: #f2b860; --warn-bg: #352712;
  --bad: #ff8a7d; --bad-bg: #3a1714; --info: #8ab8ff; --info-bg: #15263f;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  color-scheme: dark;
}
:root { --brand-soft: color-mix(in srgb, var(--brand) 13%, var(--surface)); --brand-ink: color-mix(in srgb, var(--brand) 80%, var(--ink)); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, .money { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: .85rem; }
.label { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: .85rem; border-radius: 8px; }
.btn.wa { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
textarea { min-height: 76px; resize: vertical; }
input[type=color] { padding: 3px; width: 52px; }
input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack { display: grid; gap: 16px; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 18px; }
.auth-mark { display: flex; align-items: center; gap: 12px; }
.auth-mark .logo { width: 44px; height: 44px; }
.auth-mark b { font-family: var(--f-display); font-size: 1.35rem; }
.auth-switch { text-align: center; color: var(--ink-2); font-size: .92rem; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 600; cursor: pointer; }
.onboard { max-width: 760px; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.choice form { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; align-content: start; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.side { position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.brandbox { display: flex; gap: 12px; align-items: center; padding: 4px 6px; min-width: 0; }
.brandbox > div { min-width: 0; }
.brandbox b { display: block; font-family: var(--f-display); font-size: 1.05rem; line-height: 1.2; overflow-wrap: anywhere; }
.brandbox small { color: var(--ink-3); display: block; line-height: 1.3; }
.logo { width: 42px; height: 42px; border-radius: 10px; flex: none; object-fit: contain; background: var(--surface-2); }
.logo.initials { display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-family: var(--f-display); font-weight: 700; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-weight: 600; color: var(--ink-2); text-align: left; }
.nav button svg { width: 20px; height: 20px; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button.on { background: var(--brand-soft); color: var(--brand-ink); }
.side-foot { margin-top: auto; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.who { font-size: .85rem; color: var(--ink-2); overflow-wrap: anywhere; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding-block: 26px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 22px; align-content: start; }
.pagehead { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.pagehead p { color: var(--ink-2); margin-top: 4px; }
.tabbar { display: none; }
.demo-banner { background: var(--warn-bg); color: var(--warn); font-size: .85rem; font-weight: 600; text-align: center; padding: 7px 16px; }

/* ---------- panels, stats, lists ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.panel > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel .body { padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 6px; }
.stat .v { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat.hl { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stat.hl .label { color: inherit; opacity: .8; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.list { display: grid; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item .meta { min-width: 0; }
.item .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta small { color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.tag { font-family: var(--f-display); font-weight: 700; font-size: .85rem; min-width: 48px; padding: 6px 8px; text-align: center; border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.empty { padding: 34px 18px; text-align: center; color: var(--ink-3); display: grid; gap: 10px; justify-items: center; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-received, .s-queued { background: var(--info-bg); color: var(--info); }
.s-washing, .s-in_wash { background: var(--warn-bg); color: var(--warn); }
.s-ready, .s-car_ready { background: var(--ok-bg); color: var(--ok); }
.s-collected, .s-picked_up { background: var(--surface-2); color: var(--ink-2); }
.s-cancelled { background: var(--bad-bg); color: var(--bad); }
.owed { color: var(--bad); font-weight: 700; font-size: .85rem; }
.paidup { color: var(--ok); font-weight: 600; font-size: .85rem; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .c { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }
.search { max-width: 340px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
td.n, th.n { text-align: right; }
tfoot td { font-weight: 700; border-bottom: 0; }

/* ---------- order detail ---------- */
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); position: relative; }
.ticket-head { padding: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 2px dashed var(--line); }
.ticket-no { font-family: var(--f-display); font-size: 2rem; font-weight: 800; line-height: 1; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 18px 20px; }
.step { display: grid; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--ink-3); }
.step i { height: 6px; border-radius: 3px; background: var(--surface-2); }
.step.done i { background: var(--brand); }
.step.done { color: var(--ink); }
.totals { display: grid; gap: 6px; padding: 14px 18px; justify-content: end; grid-template-columns: auto 120px; text-align: right; }
.totals .big { font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; }
.lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px 36px; gap: 8px; align-items: center; }
.line .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px dashed var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.quick button:hover { border-color: var(--brand); color: var(--brand-ink); }
.sumbox { background: var(--surface-2); border-radius: 12px; padding: 16px; display: grid; gap: 8px; }
.sumbox .spread b { font-variant-numeric: tabular-nums; }
.sumbox .grand { font-family: var(--f-display); font-size: 1.4rem; font-weight: 800; }
.custpick { position: relative; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 240px; overflow: auto; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer; }
.suggest button:hover { background: var(--surface-2); }
.selected-cust { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 10px; }

/* loyalty card */
.stamps { display: flex; gap: 8px; flex-wrap: wrap; }
.stamps span { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--ink-3); }
.stamps span.on { border: 0; background: var(--brand); color: var(--on-brand); }
.reward { background: var(--ok-bg); color: var(--ok); padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .88rem; }

/* reports */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding: 10px 4px 0; border-bottom: 1px solid var(--line); }
.bars div { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div:hover { filter: brightness(1.15); }
.bars-x { display: flex; gap: 4px; padding: 6px 4px 0; font-size: .7rem; color: var(--ink-3); }
.bars-x span { flex: 1; text-align: center; overflow: hidden; }
.meter { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); }

/* settings */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.subtabs button.on { color: var(--brand-ink); border-color: var(--brand); }
.logo-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-edit .logo { width: 84px; height: 84px; border-radius: 16px; font-size: 1.8rem; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.code { font-family: var(--f-display); font-size: 1.8rem; letter-spacing: .25em; font-weight: 800; padding: 8px 16px; border: 2px dashed var(--brand); border-radius: 12px; color: var(--brand-ink); background: var(--brand-soft); }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgb(8 18 24 / .5); display: grid; place-items: center; z-index: 50; padding: 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); display: grid; max-height: calc(100vh - 32px); grid-template-rows: auto 1fr auto; }
.modal.wide { max-width: 860px; }
.modal > header { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal > .mbody { padding: 20px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.modal > footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); color: #fff; }
.err-msg { color: var(--bad); background: var(--bad-bg); padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.ok-msg { color: var(--ok); background: var(--ok-bg); padding: 10px 12px; border-radius: 10px; font-size: .9rem; font-weight: 600; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
.loading { min-height: 60vh; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* receipt (print) */
#print { display: none; }
.receipt { width: 300px; margin: 0 auto; font: 12px/1.45 "Courier New", monospace; color: #000; background: #fff; padding: 12px; }
.receipt img { max-width: 120px; max-height: 70px; display: block; margin: 0 auto 6px; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt .big { font-size: 15px; font-weight: 700; }
@media print {
  body { background: #fff; }
  #root, .overlay, .toast, .demo-banner { display: none !important; }
  #print { display: block; }
}

.item.planrow { grid-template-columns: auto 1fr; align-items: start; }
.item.planrow .meta b, .item.planrow .meta small { white-space: normal; }
.item.planrow > .row { grid-column: 2; justify-content: flex-start !important; }
.item.planrow > .row:empty { display: none; }
.voidrow { opacity: .7; }
.voidrow b { text-decoration: line-through; }
.voidrow small b { text-decoration: none; }
/* ---------- customer feedback ---------- */
.stars { display: inline-flex; gap: 2px; color: #f5a524; vertical-align: middle; }
.stars svg, .fb-stars svg { display: block; fill: currentColor; }
.stars .off, .stars svg:not(.on) { color: var(--line); }
.fb-form { display: flex; flex-direction: column; gap: 14px; }
.fb-q { margin: 0; font-weight: 700; font-size: 1.1rem; text-align: center; }
.fb-stars { display: flex; justify-content: center; gap: 6px; }
.fb-stars button { background: none; border: 0; padding: 6px; border-radius: 12px; color: var(--line); cursor: pointer; min-width: 48px; min-height: 48px; transition: transform .12s; }
.fb-stars button.on { color: #f5a524; }
.fb-stars button:hover, .fb-stars button:focus-visible { transform: scale(1.12); }
.fb-stars button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.fb-word { text-align: center; min-height: 1.3em; margin: 0; }
.fb-more { display: flex; flex-direction: column; gap: 10px; }
.fb-thanks { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 6px 0; }
.track-fb { margin-top: 14px; }
.fbrow { align-items: flex-start; }
.fbrow .fbtext { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.warnrow { border-left: 4px solid var(--bad); background: var(--bad-bg); }
.fb-poster { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  #print .fb-poster { display: flex; flex-direction: column; align-items: center; text-align: center; width: 210mm; height: 297mm; box-sizing: border-box; padding: 18mm 16mm; font-family: inherit; color: #10262e; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fb-poster .fp-top { display: flex; align-items: center; gap: 14px; font-size: 22pt; }
  .fb-poster .fp-top img, .fb-poster .fp-init { width: 22mm; height: 22mm; border-radius: 5mm; object-fit: cover; }
  .fb-poster .fp-init { display: flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; font-weight: 800; }
  .fb-poster .fp-top div { display: flex; flex-direction: column; align-items: flex-start; }
  .fb-poster .fp-top div span { font-size: 13pt; color: #4b5d68; }
  .fb-poster h1 { margin: 16mm 0 4mm; font-size: 46pt; line-height: 1.05; color: var(--brand); }
  .fb-poster .fp-sub { margin: 0; font-size: 17pt; line-height: 1.4; }
  .fb-poster .fp-stars { margin: 9mm 0; }
  .fb-poster .fp-stars .stars { gap: 4mm; }
  .fb-poster .fp-qr { border: 2mm solid var(--brand); border-radius: 6mm; padding: 5mm; background: #fff; }
  .fb-poster .fp-qr svg { width: 85mm; height: 85mm; display: block; }
  .fb-poster .fp-foot { margin: 10mm 0 0; font-size: 14pt; line-height: 1.45; color: #4b5d68; }
  .fb-poster .fp-by { margin-top: auto; font-size: 9pt; color: #7b8c96; }
}

/* ---------- responsive ---------- */
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } .cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; align-items: center; justify-content: space-between; gap: 10px;
    padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .brandbox { padding: 0; }
  .topbar .logo { width: 34px; height: 34px; }
  .page { padding-block: 18px 110px; gap: 18px; }
  h1 { font-size: 1.35rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .tabbar button { border: 0; background: none; padding: 8px 2px 10px; display: grid; justify-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--ink-3); cursor: pointer; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.on { color: var(--brand-ink); }
  .tabbar button.new span.dot { width: 44px; height: 44px; margin-top: -18px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; box-shadow: var(--shadow); }
  .stat .v { font-size: 1.3rem; }
  .line { grid-template-columns: minmax(0, 1fr) 70px 90px 32px; }
  .steps { grid-template-columns: repeat(4, 1fr); padding: 14px; }
  .step { font-size: .7rem; }
  .ticket-no { font-size: 1.6rem; }
  .overlay { padding: 0; align-items: end; }
  .modal { border-radius: 16px 16px 0 0; max-height: 94vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .item { padding: 12px 14px; gap: 10px; }
  .search { max-width: none; }
}

/* ---------- v2 additions: branches, roles, inventory, platform ---------- */
.stat .sub { font-size: .82rem; color: var(--ink-3); }
.stat.hl .sub { color: inherit; opacity: .8; }
.stat .v.neg { color: var(--bad); }
.stat.warnstat { border-color: var(--warn); background: var(--warn-bg); }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.scope select { font-weight: 600; }
.scope-fixed { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.scope-fixed svg { width: 18px; height: 18px; }
.scopebar { display: none; }
.sub-banner { background: var(--info-bg); color: var(--info); font-size: .88rem; font-weight: 600; text-align: center; padding: 8px 16px; }
.sub-banner.warn { background: var(--bad-bg); color: var(--bad); }
.sub-banner .linkbtn { color: inherit; text-decoration: underline; }
.demo-roles { display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 16px; }
.demo-roles .btn { justify-content: flex-start; text-align: left; min-height: 54px; white-space: normal; }
.demo-roles .btn span { display: grid; }
.demo-roles small { font-weight: 500; color: var(--ink-3); font-size: .78rem; }
.alert-panel { border-color: var(--warn); }
.alert-panel > header h2 { display: flex; align-items: center; gap: 8px; color: var(--warn); }
.alert-panel > header svg { width: 20px; height: 20px; }
.warnchip { background: var(--warn-bg); border-color: transparent; color: var(--warn); cursor: default; }
.clickrows tbody tr { cursor: pointer; }
.clickrows tbody tr:hover { background: var(--surface-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: .85rem; flex: none; }
.item.static { cursor: default; }
.item.static:hover { background: none; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.timeline li { position: relative; display: grid; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.step small { font-weight: 500; color: var(--ink-3); font-size: .72rem; min-height: 1em; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 16px; }
.mbody .plan-cards { padding: 0; }
.plan-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 4px; align-content: start; position: relative; cursor: pointer; }
.plan-card.current, .plan-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.plan-card input { position: absolute; top: 12px; right: 12px; width: 18px; min-height: 18px; accent-color: var(--brand); }
.plan-card .v { font-family: var(--f-display); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-card .v small { font-size: .8rem; font-weight: 500; color: var(--ink-3); }
.msgbox { white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 12px; font: inherit; font-size: .9rem; margin: 0; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-rev, .b-rev { background: var(--brand); }
.lg-exp, .b-exp { background: color-mix(in srgb, var(--bad) 70%, var(--surface)); }
.bars.pair .pairbar { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; background: none; }
.bars.pair .pairbar > div { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.stockmeter { height: 5px; max-width: 120px; margin-left: auto; }
.stockmeter i.s-ready { background: var(--ok); } .stockmeter i.s-washing { background: var(--warn); } .stockmeter i.s-cancelled { background: var(--bad); }
.logo.sm { width: 32px; height: 32px; border-radius: 8px; font-size: .75rem; }
.lock { max-width: 640px; }
.lock h1 { font-size: 1.5rem; }
details.panel summary { cursor: pointer; font-weight: 600; }
.side .nav { overflow-y: auto; }
@media (max-width: 1000px) { .stats.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .scopebar { display: block; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
  .scopebar .field > span { display: none; }
  .stats.three { grid-template-columns: 1fr; }
  .legend { font-size: .72rem; }
}

/* ---------- v3: plans & features ---------- */
.nav button.locked { color: var(--ink-3); }
.nav button.locked > svg:last-child { width: 14px; height: 14px; margin-left: auto; opacity: .7; }
.compare { min-width: 620px; }
.compare th, .compare td { text-align: center; vertical-align: top; }
.compare th:first-child, .compare td:first-child { text-align: left; min-width: 190px; }
.compare thead th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); padding-block: 14px; }
.compare thead th b { display: block; font-family: var(--f-display); font-size: 1.05rem; }
.compare .price { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.compare .price small { font-size: .75rem; font-weight: 500; color: var(--ink-3); }
.compare .desc { font-weight: 400; font-size: .78rem; margin-top: 4px; }
.compare th.cur, .compare td.cur { background: var(--brand-soft); }
.compare tr.hl td { box-shadow: inset 0 0 0 2px var(--warn); }
.compare thead .pill { margin-top: 6px; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.tick svg { width: 14px; height: 14px; }
.chip.incl { background: var(--ok-bg); border-color: transparent; color: var(--ok); cursor: default; display: inline-flex; align-items: center; gap: 6px; }
.chip.incl svg, .lockedchip svg { width: 14px; height: 14px; }
.lockedchip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); border-style: dashed; }
.lockedchip:hover { color: var(--brand-ink); border-color: var(--brand); }
.featgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 16px; margin-top: 8px; }
.featgrid .check { align-items: flex-start; font-weight: 500; }
.featgrid .check input { margin-top: 3px; }
.pkg { border: 1px dashed var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
.plangrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.plancard > header .check { font-size: .85rem; }
.addplan { border-style: dashed; }
.upsell { border-color: var(--brand); background: var(--brand-soft); }
.upsell .pill svg { width: 13px; height: 13px; }
.upsell h1 { font-size: 1.5rem; }
@media (max-width: 760px) { .plangrid { grid-template-columns: 1fr; } }
.compare .price { white-space: nowrap; }
.compare thead th { min-width: 120px; }

/* ---------- v4: cleaning jobs, business type, birthdays ---------- */
.s-booked { background: var(--info-bg); color: var(--info); }
.s-confirmed { background: var(--brand-soft); color: var(--brand-ink); }
.s-in_progress { background: var(--warn-bg); color: var(--warn); }
.s-completed { background: var(--ok-bg); color: var(--ok); }
.tag.job { border-style: solid; border-color: var(--brand-soft); background: var(--brand-soft); color: var(--brand-ink); }
.item .meta small svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.kindpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kindpick label, .kindpick button { position: relative; display: grid; gap: 2px; align-content: start; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.kindpick label:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.kindpick input { position: absolute; opacity: 0; pointer-events: none; }
.kindpick small { color: var(--ink-3); font-size: .8rem; }
.kindpick button:hover { border-color: var(--brand); }
.kindpick.big button { padding: 16px; gap: 6px; }
.kindpick.big svg { width: 26px; height: 26px; color: var(--brand); }
.jobinfo { display: grid; gap: 8px; padding: 16px 20px 14px; }
.jobinfo > div { display: flex; gap: 10px; align-items: flex-start; }
.jobinfo svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--ink-3); }
.jobinfo a { color: var(--brand-ink); font-weight: 600; }
.wa-row { margin-top: 10px; }
.grouphead { font-family: var(--f-display); font-size: 1.05rem; margin: 18px 0 10px; }
.compare tr.grp td { background: var(--surface-2); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); text-align: left; }
.bday-panel > header svg { width: 20px; height: 20px; vertical-align: -3px; margin-right: 6px; color: var(--brand); }
.bday-today { color: var(--brand-ink); }
.bday-sel select { min-width: 0; }
.bday-sel select:first-child { max-width: 90px; }
.panel > header h2 svg { width: 20px; height: 20px; vertical-align: -3px; margin-right: 6px; flex: none; }
.bday-today { font-weight: 700; }
.tablewrap td.n { white-space: nowrap; }

/* ---------- v5: contracts, attendance calendar, invoices ---------- */
.tag.inv { border-style: solid; background: var(--info-bg); border-color: var(--info-bg); color: var(--info); }
.btn.okbtn { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.btn.badbtn { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.visit-btns .btn svg { width: 15px; height: 15px; }
.chip.daychip { min-width: 52px; justify-content: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calh { text-align: center; font-size: .75rem; font-weight: 700; color: var(--ink-3); }
.calday { aspect-ratio: 1; min-height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font: inherit; font-weight: 600; cursor: pointer; }
.calday.due { color: var(--ink); border-color: var(--brand); border-style: dashed; }
.calday.done { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.calday.missed { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
.calday.today { box-shadow: 0 0 0 2px var(--brand); }
.calday:disabled { opacity: .45; cursor: default; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.dot.due { border: 1px dashed var(--brand); } .dot.done { background: var(--ok); border-color: var(--ok); } .dot.missed { background: var(--bad); border-color: var(--bad); }
/* printed invoice (A4) */
.invoice-print { max-width: 720px; margin: 0 auto; padding: 32px; color: #111; background: #fff; font: 13px/1.5 Figtree, Arial, sans-serif; }
.ip-head { display: flex; justify-content: space-between; gap: 24px; border-bottom: 2px solid #111; padding-bottom: 16px; }
.ip-head img { max-width: 140px; max-height: 70px; display: block; margin-bottom: 6px; }
.ip-biz { font-size: 18px; font-weight: 800; }
.ip-title { text-align: right; }
.ip-big { font-size: 26px; font-weight: 800; letter-spacing: .08em; }
.ip-to { margin: 18px 0; }
.ip-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #555; font-weight: 700; }
.ip-table { width: 100%; border-collapse: collapse; }
.ip-table th, .ip-table td { padding: 8px 6px; border-bottom: 1px solid #ddd; text-align: left; }
.ip-table .n { text-align: right; white-space: nowrap; }
.ip-table tfoot td { font-weight: 600; }
.ip-table .ip-bal td { font-size: 16px; font-weight: 800; border-top: 2px solid #111; }
.ip-pay { margin-top: 18px; padding: 12px; border: 1px solid #ddd; border-radius: 8px; }
.ip-foot { margin-top: 28px; text-align: center; color: #555; font-size: 11px; }
.cal { max-width: 460px; }

/* ---------- v6: pickups & deliveries, status page, QR labels ---------- */
.trip .meta small svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.trip .meta small a { color: var(--brand-ink); font-weight: 600; }
.trip-btns { margin-top: 8px; gap: 6px; }
.trip-btns select { padding: 6px 10px; font-size: .85rem; }
.item.trip .meta b, .item.trip .meta small { white-space: normal; }
.ok-msg svg { width: 16px; height: 16px; vertical-align: -3px; }
/* customer status page */
.track { min-height: 100vh; display: grid; place-items: start center; padding: 24px 16px 40px; background: linear-gradient(180deg, var(--brand-soft), var(--bg) 320px); }
.track-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: grid; gap: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.track-brand { display: flex; gap: 12px; align-items: center; }
.track-brand .logo { width: 46px; height: 46px; }
.track-head h1 { font-size: 1.45rem; margin: 6px 0 2px; line-height: 1.25; }
.track-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.track-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; position: relative; padding-bottom: 14px; color: var(--ink-3); }
.track-steps li:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.track-steps li.done:not(:last-child)::before { background: var(--brand); }
.track-steps i { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: var(--surface); }
.track-steps li.done i { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.track-steps li.now span { color: var(--ink); font-weight: 700; }
.track-steps li.done span { color: var(--ink); }
.track-steps i svg { width: 15px; height: 15px; }
.track-steps small { display: block; color: var(--ink-3); font-weight: 400; font-size: .8rem; }
.track-trip { display: flex; gap: 10px; align-items: center; background: var(--brand-soft); color: var(--brand-ink); padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.track-trip svg { width: 22px; height: 22px; flex: none; }
.track-items { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 14px; }
.track-items .grand { font-weight: 800; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.track-pay { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.track-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.track-contact .btn { flex: 1 1 auto; justify-content: center; }
.track-foot { text-align: center; color: var(--ink-3); font-size: .8rem; }
/* QR on receipts and label sheets */
.rqr svg { width: 110px; height: 110px; display: block; margin: 6px auto 2px; }
.qr-sheet { display: flex; flex-wrap: wrap; gap: 4mm; padding: 4mm; font-family: Arial, sans-serif; color: #000; background: #fff; }
.qr-label { width: 40mm; border: 1px dashed #999; border-radius: 2mm; padding: 2mm; display: grid; justify-items: center; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.qr-label svg { width: 30mm; height: 30mm; }
.qr-label b { display: block; font-size: 13pt; letter-spacing: .02em; }
.qr-label span { display: block; font-size: 8pt; }
.qr-label small { display: block; font-size: 6.5pt; color: #333; }
.qr-sheet.big .qr-label { width: 60mm; } .qr-sheet.big .qr-label svg { width: 48mm; height: 48mm; } .qr-sheet.big .qr-label b { font-size: 18pt; }

/* ---------- car wash ---------- */
.plate { display: inline-block; font-weight: 800; letter-spacing: .05em; font-variant-numeric: tabular-nums; background: #fff8d6; color: #1a1a1a; border: 2px solid #1a1a1a; border-radius: 6px; padding: 2px 8px; font-size: .9rem; white-space: nowrap; }
.plate.big { font-size: 1.5rem; padding: 4px 12px; }
.carrow { display: flex; align-items: center; gap: 10px; padding-right: 12px; }
.carrow .carmain { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: none; border: 0; padding: 12px 0 12px 16px; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.carrow .carmain .meta { min-width: 0; display: grid; gap: 2px; }
.carrow .carmain .meta small { color: var(--ink-2); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.carrow .carmain .meta small svg { width: 14px; height: 14px; }
.carrow .carmain .right { display: grid; justify-items: end; gap: 4px; }
.carrow > .btn { flex-shrink: 0; }
.carcols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.carcols .carrow, .carrow.stacked { display: block; padding: 12px 16px; }
.carcols .carrow .carmain { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "plate right" "meta meta"; gap: 6px 10px; padding: 0; width: 100%; }
.carcols .carrow .carmain .plate { grid-area: plate; justify-self: start; }
.carcols .carrow .carmain .meta { grid-area: meta; }
.carcols .carrow .carmain .right { grid-area: right; grid-auto-flow: column; align-items: center; }
.carcols .carrow > .btn { width: 100%; margin: 10px 0 0; justify-content: center; }
@media (max-width: 1100px) { .carcols { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .carrow { display: block; padding: 12px 16px; } .carrow .carmain { grid-template-columns: 1fr auto; grid-template-areas: "plate right" "meta meta"; gap: 6px 10px; padding: 0; width: 100%; } .carrow .carmain .plate { grid-area: plate; justify-self: start; } .carrow .carmain .meta { grid-area: meta; } .carrow .carmain .right { grid-area: right; } .carrow > .btn { width: 100%; margin: 10px 0 0; justify-content: center; } }
