/* PurePro Water Management System — design system.
   Glass redesign (M13): tokens from the option 4 board. Light = solid white cards on a pale tint; dark (default) =
   see-through cards over a soft navy/aqua glow. Rules + contrast numbers: docs/design-system.md */
:root {
  /* text-safe brand colours (links, active text) */
  --brand: #035e5c;
  --brand-600: #024c4a;
  --brand-700: #013d3c;
  --teal: #035e5c;
  /* fills: the aqua button colour and the ink that goes on it */
  --accent: #2fd2cb;
  --accent-hover: #5adcd6;
  --accent-ink: #06302f;
  --navy: #1a3a86;
  --hero: linear-gradient(140deg, #0c6c76 0%, #1a3a86 100%);
  --bg: #edf2f8;
  --base: #edf2f8;
  --surface: #ffffff;          /* solid panel: pop-ups, menus, sticky cells */
  --surface-2: #f4f7fb;
  --card: #ffffff;             /* cards: solid in light */
  --card-bd: #dfe6ef;
  --card-hi: 0 0 #0000;
  --card-sh: 0 1px 2px rgba(15,27,51,.05), 0 10px 30px rgba(15,27,51,.07);
  --chrome: rgba(255,255,255,.92);
  --chrome-bd: rgba(15,27,51,.08);
  --blur: none;                /* blur exists in dark only */
  --field: #ffffff;
  --field-bd: #c9d3e0;
  --line: #e3e9f1;
  --border: #dfe6ef;
  --text: #0f1b33;
  --muted: #45526b;
  --muted-2: #4f5b72;
  --side-ink: #33415c;
  --on-bg: #dff5f4;
  --on-ink: #05605f;
  --ok: #0f6e48;
  --ok-bg: #dcf3e8;
  --warn: #8f5200;
  --warn-bg: #fdefd6;
  --danger: #b3302a;
  --danger-bg: #fde6e3;
  --info: #2152b8;
  --info-bg: #e3ebfb;
  --solid-ok: #0f7a50;         /* fills carrying white text */
  --solid-danger: #c23a32;
  --blob1: rgba(47,210,203,.16);
  --blob2: rgba(33,61,133,.10);
  --blob3: rgba(110,160,255,.10);
  --shadow: 0 1px 2px rgba(15,27,51,.05), 0 10px 30px rgba(15,27,51,.07);
  --shadow-lg: 0 16px 48px rgba(15,27,51,.18);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 256px;
  --font: 'Manrope', 'Noto Sans Arabic', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* M15: the colours that used to be fixed in code (calendar kinds, map price lists), per theme */
  --k-install: #0b69a3; --k-service: #08776d; --k-repair: #935200; --k-visit: #4451c4; --k-maint: #7442bd; --k-remind: #a63d7c;
  --cat-end_user: #0b69a3; --cat-walk_in: #5f6878; --cat-wholesale: #08776d; --cat-bulk: #935200;
  --chart-line: #0a8580;
}
:root[data-theme="dark"] {
  --brand: #93f0ea;
  --brand-600: #aaf3ee;
  --brand-700: #c0f6f2;
  --teal: #93f0ea;
  --hero: linear-gradient(140deg, rgba(28,170,170,.50), rgba(44,74,170,.55));
  --bg: #050a16;
  --base: #050a16;
  --surface: #111a2e;
  --surface-2: rgba(255,255,255,.06);
  --card: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.045));
  --card-bd: rgba(255,255,255,.12);
  --card-hi: inset 0 1px 0 rgba(255,255,255,.10);
  --card-sh: 0 12px 40px rgba(0,0,0,.28);
  --chrome: rgba(12,20,40,.64);
  --chrome-bd: rgba(255,255,255,.10);
  --blur: blur(22px) saturate(150%);
  --field: rgba(255,255,255,.06);
  --field-bd: rgba(255,255,255,.22);
  --line: rgba(255,255,255,.09);
  --border: rgba(255,255,255,.12);
  --text: #f3f7fd;
  --muted: #d3dbe7;
  --muted-2: #c6d0df;
  --side-ink: #d3dbe7;
  --on-bg: rgba(47,210,203,.12);
  --on-ink: #93f0ea;
  --ok: #a3f0cb;
  --ok-bg: rgba(79,210,154,.12);
  --warn: #ffdaa6;
  --warn-bg: rgba(243,178,83,.12);
  --danger: #ffcdc8;
  --danger-bg: rgba(255,138,128,.12);
  --info: #cfdfff;
  --info-bg: rgba(110,160,255,.12);
  --blob1: rgba(47,210,203,.14);
  --blob2: rgba(39,72,160,.36);
  --blob3: rgba(64,48,150,.20);
  --shadow: 0 12px 40px rgba(0,0,0,.28);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.55);
  --k-install: #8fcbff; --k-service: #5fe0cf; --k-repair: #f6b860; --k-visit: #bac0ff; --k-maint: #d6b8ff; --k-remind: #f9b0db;
  --cat-end_user: #8fcbff; --cat-walk_in: #bdc5d2; --cat-wholesale: #5fe0cf; --cat-bulk: #f6b860;
  --chart-line: #2fd2cb;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
a { color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px rgba(47,210,203,.28); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Auth ---------- */
.auth-screen { min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 70% -10%, rgba(18,179,166,.18), transparent),
              radial-gradient(1000px 500px at 0% 100%, rgba(33,82,184,.16), transparent); }
.auth-card { background: var(--surface); width: 360px; max-width: calc(100vw - 32px);
  padding: 34px 30px; border-radius: 20px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); text-align: center; }
.auth-card h1 { margin: 14px 0 2px; font-size: 26px; letter-spacing: -.5px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-weight: 500; }
.auth-form { text-align: left; display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.auth-form input, .auth-form select { padding: 11px 12px; }
.auth-foot { margin: 18px 0 0; font-size: 12px; color: var(--muted-2); }

/* PurePro logo: navy on light, white in dark theme (embedded PNGs, see --logo-* near the end of this sheet) */
.pp-logo { display: block; background: var(--logo) no-repeat center / contain; aspect-ratio: 291 / 53; }
.auth-logo { width: 250px; max-width: 100%; margin: 6px auto 12px; }
.sidebar-logo { width: 100%; max-width: 196px; }
.doc-logo { width: 150px; margin-bottom: 8px; }

/* ---------- Inputs ---------- */
input, select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; width: 100%; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,210,203,.25); }
label.field { display: grid; gap: 6px; font-weight: 600; font-size: 12.5px; }
.search { width: 260px; background: var(--surface-2); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; padding: 20px 22px 14px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted-2);
  font-weight: 700; padding: 14px 12px 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; cursor: pointer; font-size: 13.5px; transition: .12s; border: none; background: none; width: 100%; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--on-bg); color: var(--on-ink); font-weight: 800; box-shadow: inset 0 0 0 1px rgba(47,210,203,.35); }
.nav-item .ico { width: 20px; text-align: center; font-size: 15px; }
.nav-item .badge { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.theme-toggle { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px; cursor: pointer;
  font-family: inherit; font-weight: 600; color: var(--muted); font-size: 12.5px; }
.theme-toggle:hover { color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(150deg, var(--brand), var(--teal));
  color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 12px; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--chrome);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 12px 22px; }
.crumb { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
.view { padding: 22px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------- Cards / layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head .btn { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.section-title h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.section-title .btn { margin-left: auto; }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi .k-label { color: var(--muted); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.kpi .k-val { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin-top: 8px; }
.kpi .k-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kpi .k-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 16px;
  background: var(--surface-2); border: 1px solid var(--card-bd); color: var(--text); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  font-weight: 700; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.t-strong { font-weight: 600; }
.t-sub { color: var(--muted); font-size: 12px; }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.brand { background: var(--on-bg); color: var(--on-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.pill-tabs { display: inline-flex; max-width: 100%; overflow-x: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.pill-tabs button { flex: 0 0 auto; white-space: nowrap; }
.pill-tabs button { border: none; background: none; padding: 7px 14px; border-radius: 8px; font-family: inherit; font-weight: 600;
  font-size: 13px; color: var(--muted); cursor: pointer; }
.pill-tabs button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.pos-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.prod-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px;
  cursor: pointer; transition: .12s; text-align: left; }
.prod-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.prod-card .p-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--teal); }
.prod-card .p-name { font-weight: 600; margin: 6px 0; line-height: 1.25; min-height: 34px; }
.prod-card .p-foot { display: flex; align-items: center; justify-content: space-between; }
.prod-card .p-price { font-weight: 800; }
.cart { position: sticky; top: 84px; }
#pos-mbar-wrap { display: none; }
/* phone cart bar: see "M14 phone layout" below */
.cart-items { max-height: 46vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.cart-line .cl-name { font-weight: 600; }
.cart-line .cl-price { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.qty button { border: none; background: var(--surface-2); width: 26px; height: 26px; cursor: pointer; font-size: 15px; color: var(--text); }
.qty span { min-width: 28px; text-align: center; font-weight: 600; font-size: 13px; }
.totals { padding-top: 10px; }
.totals .t-line { display: flex; justify-content: space-between; padding: 4px 0; color: var(--muted); }
.totals .t-line.grand { color: var(--text); font-weight: 800; font-size: 19px; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(5,10,22,.6); z-index: 100;
  display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 560px; max-width: calc(100vw - 40px);
  max-height: 90vh; display: flex; flex-direction: column; animation: pop .18s; }
.modal.wide { width: 760px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.pu-add-row .pu-pick { flex: 1; min-width: 220px; }
.town-results.pu-results { min-width: min(760px, 92vw); max-height: 360px; overflow-y: auto; box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.15)); }
.town-results.pu-results li { white-space: normal; line-height: 1.35; }
@media (max-width: 480px) { /* phones: document tables fit the modal; purchase product picker gets its own line */
  .modal-body .tbl th, .modal-body .tbl td { padding: 10px 6px; }
  .pu-add-row { flex-wrap: wrap; }
  .pu-add-row .pu-pick { flex: 1 1 100%; min-width: 0; }
  .pu-add-row #pu-prod { width: 100%; min-width: 0; }
  .town-results.pu-results { min-width: 0; }
  .pu-add-row #pu-cost { flex: 1; min-width: 0; }
}

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 12px 16px; border-radius: 11px; font-weight: 600;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: slidein .2s; max-width: 320px; }
.toast.ok { background: var(--solid-ok); color: #fff; }
.toast.danger { background: var(--solid-danger); color: #fff; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

/* ---------- Misc ---------- */
.progress { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--teal)); }
.list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.list-head .search { width: 300px; }
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 500; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline .ti { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline .ti::before { content: ''; position: absolute; left: 9px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.timeline .ti:last-child::before { display: none; }
.timeline .ti .tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); margin-top: 5px; }

a.btn { text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Notifications ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; font-size: 18px; line-height: 1; padding: 7px 9px; }
.bell-count { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--solid-danger); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 350px; max-width: calc(100vw - 24px); z-index: 50;
  box-shadow: var(--shadow-lg); overflow: hidden; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; align-items: flex-start; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .n-ico { font-size: 16px; width: 22px; text-align: center; }

/* ---------- Reminders ---------- */
.rem { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: center; }
.rem:last-child { border-bottom: none; }
.rem-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--info-bg); color: var(--info); }
.rem-ico.reorder { background: var(--warn-bg); }
.rem-ico.manual { background: rgba(142,91,214,.14); }
.rem-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Maps ---------- */
.map { height: 420px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); position: relative; z-index: 0; }
.map-sm { height: 190px; } .map-md { height: 260px; } .map-lg { height: 560px; }
.map-fallback { height: auto !important; min-height: 150px; padding: 18px; border: 1px dashed var(--border); }
.map-fallback a { display: inline-block; margin: 4px 10px 0 0; font-weight: 600; font-size: 12.5px; }
.num-pin span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; font-size: 12px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-family: var(--font); }
.num-pin.hq span { background: #14202b; font-size: 10px; }
.num-pin.done span { background: var(--solid-ok); color: #fff; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-right: 12px; }
.ldot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.leaflet-container { font-family: var(--font); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 320px; transition: .12s; }
.kcol.drop { border-color: var(--accent); background: var(--on-bg); }
.kcol-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 2px 4px 10px; }
.kcol-head .t-sub { margin-left: auto; font-weight: 600; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 12px; margin-bottom: 9px;
  cursor: grab; box-shadow: var(--shadow); transition: .12s; }
.kcard:hover { border-color: var(--brand); }
.kcard.dragging { opacity: .45; }
.kcard .kc-val { font-weight: 800; font-size: 15px; }
.kcard .kc-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kcard .kc-foot .btn { padding: 3px 8px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; flex-shrink: 0; }
.kcard .badge, .kcol-head .badge { white-space: nowrap; }
.cart-line .qty { justify-self: start; }

/* ---------- POS line editing ---------- */
.cl-edit { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.cl-edit label { display: grid; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.cl-edit input { width: 92px; padding: 5px 8px; text-align: right; font-size: 13px; }
.cl-edit input.overridden { border-color: var(--warn); background: var(--warn-bg); }
.cl-edit .cl-note { font-size: 11.5px; color: var(--muted); padding-bottom: 6px; }
.strike { text-decoration: line-through; color: var(--muted-2); font-weight: 500; font-size: 12px; }

/* ---------- My Day stops ---------- */
.stop { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.stop:last-child { border-bottom: none; }
.stop-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 12.5px; }
.stop.done .stop-num { background: var(--solid-ok); color: #fff; }
.stop-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

/* ---------- Documents (statements / receipts) ---------- */
.doc-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.doc-head h3 { margin: 0 0 4px; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.tbl tr.subtotal td { background: var(--surface-2); font-weight: 700; }
.tbl tr.static, .tbl.static tbody tr { cursor: default; }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }
.stat-row > div { min-width: 120px; }

@media (max-width: 1000px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 260px; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: block; }
  .search { width: 150px; }
  .cols-4, .cols-2, .form-grid { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar-actions .search { display: none; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .crumb { font-size: 15px; }
  #quick-sale { padding: 8px 11px; }
  .notif-pop { position: fixed; left: 12px; right: 12px; top: 58px; width: auto; }
  .kanban { grid-template-columns: repeat(5, 240px); }
  .map-lg { height: 380px; }
  .rem { grid-template-columns: 38px 1fr; }
  .rem-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .list-head .search { width: 100%; }
}

/* ---------- TVA toggle ---------- */
.tva-toggle { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; color: var(--text); cursor: pointer; }
.tva-toggle input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--brand); cursor: pointer; }

/* ---------- Service calendar ---------- */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-title { font-weight: 800; font-size: 17px; letter-spacing: -.3px; min-width: 190px; }
.cal-nav { display: inline-flex; gap: 6px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 0; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-dow { background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; }
.cal-day { background: var(--surface); min-height: 116px; padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; transition: background .12s; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-dnum { color: var(--muted-2); }
.cal-dnum { font-size: 12px; font-weight: 700; min-width: 24px; height: 24px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; align-self: flex-start; }
.cal-day.today .cal-dnum { background: var(--accent); color: var(--accent-ink); }
.cal-week .cal-day { min-height: 380px; }
.cal-chip { --c: var(--brand); display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; border: none; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 3px 5px 3px 6px; border-radius: 6px; cursor: pointer; text-align: left; line-height: 1.3; }
.cal-chip:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.cal-chip .cc-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip .cc-time { color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cal-chip .dot { width: 7px; height: 7px; flex-shrink: 0; }
.cal-chip .avatar.xs { width: 18px; height: 18px; font-size: 8.5px; }
.cal-chip.done { opacity: .62; }
.cal-chip.cancel .cc-t { text-decoration: line-through; }
.cal-chip.overdue { box-shadow: inset 0 0 0 1px var(--danger); }
.cal-chip .cc-proj { flex-shrink: 0; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--c); }
.cal-chip.projected { border-left-style: dashed; background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); font-weight: 500; }
.cal-chip.projected .cc-t { color: var(--muted); }  /* M15: was opacity .6 (took the text under 4.5:1) */
.ck-Installation { --c: var(--k-install); } .ck-Service { --c: var(--k-service); } .ck-Repair { --c: var(--k-repair); }
.ck-Visit { --c: var(--k-visit); } .ck-maintenance { --c: var(--k-maint); } .ck-reminder { --c: var(--k-remind); }
/* map price-list colours: list dots + legend (themed) and the pins on the map (always the light set: the tiles are light) */
.cat-end_user { --c: var(--cat-end_user); } .cat-walk_in { --c: var(--cat-walk_in); } .cat-wholesale { --c: var(--cat-wholesale); }
.cat-bulk { --c: var(--cat-bulk); }
.ldot { background: var(--c, var(--cat-end_user)); }
.leaflet-container { --k-install: #0b69a3; --cat-end_user: #0b69a3; --cat-walk_in: #5f6878; --cat-wholesale: #08776d; --cat-bulk: #935200; }
.leaflet-container path.pin { fill: var(--c, var(--cat-end_user)); }
.leaflet-container path.route { stroke: var(--k-install); }
.cal-more { border: none; background: none; padding: 1px 4px; font: inherit; font-size: 11px; font-weight: 700; color: var(--brand); cursor: pointer; text-align: left; }
.cal-agenda { display: none; }
.cal-ag-day { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 6px; }
.cal-ag-day:last-child { border-bottom: none; }
.cal-ag-day.today { background: var(--on-bg); }
.cal-ag-head { display: flex; align-items: center; gap: 8px; }
.cal-ag-day .cal-chip { font-size: 13px; padding: 7px 8px; }
@media (max-width: 760px) {
  .cal-grid-wrap { display: none; }
  .cal-agenda { display: block; }
  .cal-title { min-width: 0; flex: 1 1 100%; }
}

/* ---------- M5: bell (details/summary), map notes ---------- */
.bell-wrap > summary { list-style: none; cursor: pointer; }
.bell-wrap > summary::-webkit-details-marker { display: none; }
a.notif-item { color: var(--text); text-decoration: none; }
.map-note { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 500; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); max-height: 40%; overflow-y: auto; }
.map-note a { display: inline-block; margin: 2px 10px 0 0; font-weight: 600; }
.cal-chip, .rem a.t-strong, .kcard a, a.badge { text-decoration: none; }
.tbl .badge { white-space: nowrap; }

/* Logo images (sources: workspace/build/site-src/logo-transparent.png, logo-white.png) */
:root { --logo-navy: url("../img/logo-transparent.png"); --logo-white: url("../img/logo-white.png"); --logo: var(--logo-navy); }
:root[data-theme="dark"] { --logo: var(--logo-white); }

/* ---------- Print: only the open document (modal) or the current view ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, #toast-root, .no-print, .modal-foot, .modal-head .icon-btn { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; }
  body.has-modal #shell { display: none !important; }
  .modal-overlay { position: static; background: none; backdrop-filter: none; padding: 0; display: block; }
  .modal { box-shadow: none; max-height: none; width: 100% !important; max-width: none; border-radius: 0; }
  .modal-body { overflow: visible; }
  .pp-logo { background-image: var(--logo-navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ===== Django app additions (M1) — not in the demo ===== */
a.nav-item { text-decoration: none; }
.sidebar-foot form { margin: 0; }
.user-chip .uc-name { font-weight: 700; color: var(--text); }
.user-chip .uc-role { color: var(--muted); font-size: 11.5px; }
.logout-btn { margin-left: auto; }
.flash { margin-bottom: 14px; padding: 11px 14px; border-radius: var(--radius-sm); font-weight: 600; background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.errorlist { list-style: none; margin: 2px 0 0; padding: 0; color: var(--danger); font-size: 12px; font-weight: 600; }
.field-help { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.auth-error { background: var(--danger-bg); color: var(--danger); padding: 9px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 12.5px; }
.sidebar-backdrop { display: none; }
@media (max-width: 760px) {
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10,22,33,.35); }
}


/* ---------- M2: list paging, notices, forms ---------- */
.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.flash.warn-flash { background: var(--warn-bg); color: var(--warn); }
.flash.warn-flash a { color: inherit; text-decoration: underline; }
.kv.kv-wide { grid-template-columns: minmax(130px, 34%) 1fr; }
.loc-block { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--border); }
label.field input[type=checkbox] { justify-self: start; width: auto; }
.tbl tbody tr[data-href] a { color: inherit; text-decoration: none; }


/* ---------- M3: sales screens ---------- */
.pill-tabs a { flex: 0 0 auto; white-space: nowrap; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--muted); text-decoration: none; }
.pill-tabs a.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.qty input { width: 52px; border: none; border-radius: 0; padding: 0 2px; height: 26px; text-align: center; font-weight: 600;
  font-size: 13px; background: var(--surface); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cl-rem { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; padding: 8px 10px;
  background: var(--surface-2); border-radius: 8px; }
.cl-rem label { display: grid; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.cl-rem label.grow { flex: 1; min-width: 180px; }
.cl-rem select, .cl-rem input { padding: 5px 8px; font-size: 13px; }
.cl-rem .cl-note { font-size: 11.5px; color: var(--muted); padding-bottom: 6px; }
.doc-foot-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; margin-top: 8px; }
@media (max-width: 760px) { .doc-foot-grid { grid-template-columns: 1fr; } }
.doc-card .doc-logo { width: 190px; margin-bottom: 8px; }

/* M4: header action groups align right like single buttons; plain row links; narrow-screen tables */
.section-title > .row { margin-left: auto; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: underline; }
.show-sm { display: none; }
@media (max-width: 760px) { .tbl .col-sku { display: none; } .show-sm { display: block; } }

/* M8: pending payments bucket cards; POS payment choice */
.cols-auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pay-choice { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pay-choice label { flex: 1 1 0; min-width: 110px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer; }
.pay-choice label:has(input:checked) { border-color: var(--accent); background: var(--on-bg); color: var(--on-ink); }
.pay-choice label.disabled { opacity: .45; cursor: not-allowed; }
.pay-choice input { margin: 0; width: auto; }
.modal [hidden] { display: none !important; } /* label.field sets display:grid, which would beat the hidden attribute */

/* Town picker on the customer form (M10) */
.town-field { display: grid; gap: 6px; font-weight: 600; font-size: 12.5px; }
.town-pick { position: relative; }
.town-pick input { width: 100%; }
.town-pick.town-bad input { border-color: var(--danger, #c0392b); }
.town-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; }
.town-results[hidden] { display: none; }
.town-results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.town-results li b { font-weight: 700; }
.town-results li span { color: var(--muted); }
.town-results li.active, .town-results li:hover { background: var(--surface-2); }
.town-results li.empty { cursor: default; color: var(--muted); }

/* ---------- M11: Data tables ---------- */
.dt-help { margin: -6px 0 10px; }
.tbl.dt td { padding: 4px 6px; vertical-align: top; }
.tbl.dt th { padding: 10px 8px; }
.tbl.dt td.dt-edit input:not([type=checkbox]), .tbl.dt td.dt-edit select, .tbl.dt td.dt-edit textarea {
  border-color: transparent; background: transparent; padding: 7px 8px; min-width: 70px; resize: vertical; }
.tbl.dt td.dt-edit input:not([type=checkbox]):hover, .tbl.dt td.dt-edit select:hover, .tbl.dt td.dt-edit textarea:hover {
  border-color: var(--border); background: var(--surface); }
.tbl.dt td.dt-edit input:focus, .tbl.dt td.dt-edit select:focus, .tbl.dt td.dt-edit textarea:focus {
  border-color: var(--brand); background: var(--surface); }
.tbl.dt td.dt-edit input[type=checkbox] { width: 18px; height: 18px; margin: 8px; }
.tbl.dt td.num input { text-align: right; }
/* Notes etc.: wrapped and sized to the text by datatables.js (capped), more room while being edited */
.tbl.dt td.dt-edit textarea { resize: vertical; overflow-y: auto; max-height: 6.4em; line-height: 1.35; }
.tbl.dt td.dt-edit textarea:focus { max-height: 14em; }
.tbl.dt .dt-ro { display: inline-block; padding: 8px 2px; white-space: nowrap; }
.tbl.dt .dt-info { display: block; padding: 0 8px 4px; }
.tbl.dt .dt-actions form { display: flex; align-items: center; gap: 8px; padding: 4px 0; white-space: nowrap; }
.tbl.dt td.dt-actions, .tbl.dt th:last-child { position: sticky; right: 0; background: var(--surface);
  box-shadow: -6px 0 8px -6px rgba(0,0,0,.18); z-index: 1; }
.tbl.dt tr.dt-new td.dt-actions { background: var(--surface-2); }
.tbl.dt tr.dt-dirty td.dt-actions { background: var(--warn-bg); }
.tbl.dt tr.dt-err td.dt-actions { background: var(--danger-bg); }
.tbl.dt .dt-actions .errorlist { white-space: normal; max-width: 240px; }
.tbl.dt .errorlist { padding: 0 8px 4px; }
.tbl.dt tr.dt-new { background: var(--on-bg); }
.tbl.dt tr.dt-dirty { background: var(--warn-bg); }
.tbl.dt tr.dt-err { background: var(--danger-bg); }
.tbl.dt tr.dt-off td:not(.dt-actions) { opacity: .62; }
.tbl.dt .town-pick { min-width: 170px; }
.dt-old { color: var(--muted); text-decoration: line-through; }
.dt-newval { font-weight: 600; }
@media (max-width: 760px) {
  .tbl.dt thead { display: none; }
  .tbl.dt, .tbl.dt tbody, .tbl.dt tr, .tbl.dt td { display: block; width: 100%; }
  .tbl.dt tr { border-bottom: 2px solid var(--border); padding: 6px 4px; }
  .tbl.dt td { border: none; display: grid; grid-template-columns: 38% 1fr; align-items: center; gap: 6px; }
  .tbl.dt td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .4px; }
  .tbl.dt td.dt-actions::before { content: ""; }
  .tbl.dt td.dt-actions { position: static; box-shadow: none; background: transparent; }
  .tbl.dt td.num { text-align: left; }
  .tbl.dt td.dt-edit input:not([type=checkbox]), .tbl.dt td.dt-edit select, .tbl.dt td.dt-edit textarea { border-color: var(--border); }
}


/* =====================================================================================================
   GLASS (M13) — shared parts restyled to the option 4 board. Order matters: base rules, then phone,
   then the no-blur fallbacks, then print. Do not put theme overrides after the fallbacks.
   ===================================================================================================== */
html { background: var(--base); color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
body { background: transparent; }
/* The glow: one fixed layer behind everything (cheaper than background-attachment:fixed, works on iOS). */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 640px at 8% -6%, var(--blob2), transparent 62%),
              radial-gradient(760px 520px at 92% 8%, var(--blob1), transparent 60%),
              radial-gradient(900px 700px at 62% 108%, var(--blob3), transparent 62%), var(--base); }
::selection { background: rgba(47,210,203,.35); }

/* Icons */
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.btn .ic { width: 16px; height: 16px; }
.btn-sm .ic { width: 14px; height: 14px; }
.t-sub .ic, .badge .ic { width: 13px; height: 13px; vertical-align: -2px; }
.empty .big .ic { width: 36px; height: 36px; color: var(--muted-2); stroke-width: 1.5; }
:root[data-theme="dark"] .th-light, :root:not([data-theme="dark"]) .th-dark { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.card-head h3 .ic, .flash > .ic { width: 17px; height: 17px; vertical-align: -3px; }
.cal-chip .cc-ico { width: 12px; height: 12px; flex-shrink: 0; }
.num-pin span .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.leaflet-popup-content .ic, .map-fallback .ic { width: 14px; height: 14px; }
a .ic { vertical-align: -3px; }

/* Keyboard focus: always visible, aqua ring */
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chrome = side menu + top header (+ phone bars). The ONLY surfaces that blur, and only in dark (--blur). */
.chrome { background: var(--chrome); border: 1px solid var(--chrome-bd);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }

/* Shell: floating side menu and header */
.shell { gap: 16px; padding: 14px 14px 0; }
.sidebar { top: 14px; height: calc(100vh - 28px); border-radius: 24px; overflow: hidden; }
.sidebar-brand { padding: 20px 22px 12px; }
.nav { padding: 4px 10px 10px; gap: 1px; }
.nav-section { font-size: 11px; letter-spacing: .08em; color: var(--muted-2); padding: 14px 12px 5px; }
.nav-item { color: var(--side-ink); border-radius: 12px; min-height: 36px; padding: 7px 12px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item .ic { width: 18px; height: 18px; }
.sidebar-foot { border-top: 1px solid var(--line); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 9px;
  background: var(--surface-2); border: 1px solid var(--card-bd); color: var(--text); font-weight: 700; font-size: 13px; }
.theme-toggle .ic { width: 16px; height: 16px; }
.avatar { background: var(--accent); }
.topbar { top: 0; border-radius: 20px; border: 1px solid var(--chrome-bd); padding: 10px 12px 10px 22px; min-height: 62px; }
.crumb { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.view { padding: 22px 6px 32px; }
.icon-btn { display: inline-grid; place-items: center; color: var(--text); }
.icon-btn.menu-btn { display: none; }
.icon-btn .ic { width: 20px; height: 20px; }
.bell { width: 42px; height: 42px; padding: 0; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--card-bd); }
.bell-count { top: -5px; right: -5px; }
.section-title h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }

/* Cards: see-through in dark (no blur on cards — too many layers), solid white in light */
.card { background: var(--card); border-color: var(--card-bd); box-shadow: var(--card-hi), var(--card-sh); }
.card-head { border-bottom-color: var(--line); padding: 16px 18px; }
.card-head h3 { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.kpi { padding: 18px 18px 16px; }
.kpi .k-ico { width: 38px; height: 38px; border-radius: 50%; }
.kpi .k-ico .ic { width: 18px; height: 18px; }
.kpi .k-label { color: var(--muted); font-weight: 700; font-size: 13px; }
.kpi .k-val { font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { color: var(--muted-2); font-weight: 600; }

/* Buttons */
.btn { border-radius: var(--radius-sm); font-weight: 700; }
/* plain buttons only: primary (aqua) and ghost (transparent) keep their own fills in both modes */
.btn:not(.btn-primary):not(.btn-ghost) { border-color: var(--card-bd); background: var(--surface); }
:root[data-theme="dark"] .btn:not(.btn-primary):not(.btn-ghost) { background: var(--surface-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }

/* Fields */
input, select, textarea { background: var(--field); border-color: var(--field-bd); border-radius: var(--radius-sm); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.search { background: var(--field); }
select option, select optgroup { background: var(--surface); color: var(--text); }
::placeholder { color: var(--muted-2); opacity: 1; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.auth-form input { background: var(--field); }

/* Tables */
.tbl th { color: var(--muted); border-bottom-color: var(--line); letter-spacing: .06em; font-size: 11px; }
.tbl td { border-bottom-color: var(--line); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tfoot td { border-top-color: var(--card-bd); }
.tbl.dt td.dt-actions, .tbl.dt th:last-child { background: var(--surface); }
.tbl.dt tr.dt-new td.dt-actions { background: linear-gradient(var(--on-bg), var(--on-bg)), var(--surface); }
.tbl.dt tr.dt-dirty td.dt-actions { background: linear-gradient(var(--warn-bg), var(--warn-bg)), var(--surface); }
.tbl.dt tr.dt-err td.dt-actions { background: linear-gradient(var(--danger-bg), var(--danger-bg)), var(--surface); }

/* Status labels */
.badge { font-weight: 800; padding: 3px 10px; color: var(--muted); }
/* dark: the alarm label is a solid coral pill with dark ink (as on the board) — a soft one cannot reach 4.5:1 on glass */
:root[data-theme="dark"] .badge.danger { background: #ff8a80; color: #2b0b09; }

/* Filters / tabs: the selected one is an aqua pill, like the POS categories on the board */
.pill-tabs { border-radius: 14px; border-color: var(--card-bd); padding: 4px; }
.pill-tabs button, .pill-tabs a { border-radius: 10px; }
.pill-tabs button.active, .pill-tabs a.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 800; }
/* M16: scroll hint, the edge with more tabs fades out (classes set by app.js) */
.pill-tabs.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.pill-tabs.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); }
.pill-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); }

/* Pager, flash messages */
.pager .btn[disabled], .pager .btn.disabled { opacity: .45; }
.flash { border-radius: var(--radius-sm); border: 1px solid transparent; }
.flash.error { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

/* Pop-ups: always SOLID (readability over content); dimmed backdrop, no blur */
.modal { background: var(--surface); border: 1px solid var(--card-bd); border-radius: 22px; }
.modal-head, .modal-foot { border-color: var(--line); }
.notif-pop { background: var(--surface); }
.notif-item { border-bottom-color: var(--line); }
.notif-item .n-ico { color: var(--muted); display: grid; place-items: center; }
.town-results, .map-note { background: var(--surface); border-color: var(--card-bd); }
.toast { border-radius: 14px; }

/* POS */
.prod-card { background: var(--surface); border-color: var(--card-bd); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,27,51,.05); }
:root[data-theme="dark"] .prod-card { background: var(--surface-2); box-shadow: none; }
.prod-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(47,210,203,.18); }
.prod-card .p-cat .ic { width: 12px; height: 12px; vertical-align: -1px; }
.qty { border-color: var(--card-bd); border-radius: 10px; }
.qty button { background: var(--surface-2); color: var(--text); display: inline-grid; place-items: center; }
.qty button .ic { width: 14px; height: 14px; }
.qty input { background: transparent; }
.cart-line { border-bottom-color: var(--line); }
.totals .t-line.grand { border-top-color: var(--line); }
.pos-mbar .ic { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }

/* Lists, kanban, calendar, reminders */
.kcol { background: var(--surface-2); border-color: var(--card-bd); }
.kcard { background: var(--surface); border-color: var(--card-bd); }
:root[data-theme="dark"] .kcard { background: rgba(255,255,255,.06); box-shadow: none; }
.cal-grid { box-shadow: var(--card-sh); }
.cal-dow { background: var(--surface); }
:root[data-theme="dark"] .cal-dow { background: #0d1527; }
.rem, .stop, .cal-ag-day { border-bottom-color: var(--line); }
.rem-ico { border-radius: 50%; }
.rem-ico .ic { width: 18px; height: 18px; }
.rem-ico.reorder { color: var(--warn); }
.rem-ico.manual { background: var(--on-bg); color: var(--on-ink); }
.stop-num .ic { width: 15px; height: 15px; stroke-width: 2.5; }
.progress > span { background: linear-gradient(90deg, #2152b8, #2fd2cb); }
.timeline .ti::before { background: var(--line); }
.timeline .ti .tdot { background: var(--accent); }
.timeline .ti .ic { width: 15px; height: 15px; color: var(--muted); margin-right: 4px; }

/* Login, 403 */
.auth-screen { background: transparent; }
.auth-card { background: var(--card); border-color: var(--card-bd); box-shadow: var(--card-hi), var(--shadow-lg); border-radius: 24px; }
.auth-foot { color: var(--muted-2); }
.auth-error { border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }

/* Phones (layout beyond "not broken" is M14) */
@media (max-width: 760px) {
  /* cards a touch more opaque and secondary text brighter for outdoor reading */
  :root { --chrome: rgba(255,255,255,.96); }
  :root[data-theme="dark"] { --chrome: rgba(10,18,36,.92);
    --card: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.065)); }
  .shell { padding: 0; gap: 0; }
  .sidebar { top: 0; left: 0; height: 100vh; border-radius: 0 24px 24px 0; border-left: 0; }
  .topbar { border-radius: 0; border-width: 0 0 1px; padding: 8px 10px 8px 6px; min-height: 58px; }
  .view { padding: 16px 14px 28px; }
  .bell { width: 40px; height: 40px; }
  .icon-btn.menu-btn { display: inline-grid; width: 44px; height: 44px; }
}

/* ---- M14 phone layout: bottom bar, list cards, POS cart bar, filters. Same 760px line as the side menu. ---- */
.tabbar { display: none; }
.f-w { width: var(--w, auto); }   /* filter selects: desktop width from the template, phone width below */
@media (max-width: 760px) {
  /* Floating bottom bar (board: phone tabs). Built from the user's menu, see core/menu.py tabbar_for. */
  .tabbar { display: flex; gap: 2px; position: fixed; z-index: 50; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)); height: 66px; padding: 6px; border-radius: 24px;
    box-shadow: 0 12px 30px rgba(5,10,22,.22); }
  .tab { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 0; border: 0; border-radius: 18px; background: none; color: var(--muted); font: inherit; font-size: 11.5px;
    font-weight: 700; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: background-color .15s, color .15s, transform .1s; }
  .tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab .ic { width: 21px; height: 21px; }
  .tab:active { transform: scale(.96); }
  .tab.on { background: var(--on-bg); color: var(--text); }
  .tab.on .ic { color: var(--on-ink); }
  .tab-sell { gap: 2px; }
  .tab-sell.on { background: none; }
  .tab-sell-dot { width: 40px; height: 40px; margin-top: -4px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px rgba(47,210,203,.40); }
  .tab-sell .tab-sell-dot .ic, .tab-sell.on .tab-sell-dot .ic { width: 20px; height: 20px; color: var(--accent-ink); stroke-width: 2; }
  .tab-sell.on .tab-sell-dot { box-shadow: 0 0 0 3px var(--base), 0 0 0 5px var(--accent); }
  /* scrim (board): content fades out under the floating bars instead of peeking through the gaps */
  .shell:has(.tabbar)::after { content: ""; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; pointer-events: none;
    height: calc(92px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--base) 40%); }
  .shell:has(#pos-mbar:not(.hidden))::after { height: calc(166px + env(safe-area-inset-bottom, 0px)); }
  /* room under every page so the bar never covers the last row, a form button or the pager */
  .view { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  #toast-root { left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: none; }

  /* POS: the cart bar sits above the bottom bar (board: mbar). Solid colours: it floats over the products. */
  #pos-mbar-wrap { display: block; position: fixed; z-index: 49; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .pos { padding-bottom: 76px; }
  .pos-mbar { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 8px 0 4px; border-radius: 22px; color: #fff;
    background: linear-gradient(140deg, #0c6c76, #1a3a86); border: 1px solid rgba(255,255,255,.18); box-shadow: 0 12px 30px rgba(5,10,22,.35); }
  .pos-mbar.hidden { display: none; }
  .pm-cart { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border: 0;
    border-radius: 16px; background: none; color: #fff; font: inherit; text-align: left; cursor: pointer; }
  .pm-cart .ic { width: 20px; height: 20px; flex: none; }
  .pm-cart > span { min-width: 0; }
  .pm-cart b { display: block; font-size: 15px; font-weight: 800; }
  .pm-cart small { display: block; color: #dbe9f6; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pm-charge { flex: none; height: 48px; padding: 0 16px; border: 0; border-radius: 15px; background: var(--accent); color: var(--accent-ink);
    font: inherit; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
  .pm-charge:disabled { opacity: .6; }

  /* Main lists as cards (customers, invoices, quotations, jobs, products, pending payments). Same cells as the
     table row: c-title / c-sub on the left, c-end / c-end2 on the right, every [data-label] cell a labelled line. */
  .card.m-cards { background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .m-cards .tbl, .m-cards tbody { display: block; }
  .m-cards thead { display: none; }
  .m-cards tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
    margin-bottom: 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--card-bd); border-radius: 18px;
    box-shadow: var(--card-hi), var(--card-sh); }
  .m-cards tbody tr:hover, .m-cards tbody tr:active { background: var(--card); border-color: var(--accent); }
  .m-cards td { display: block; min-width: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  .m-cards td.c-title { grid-column: 1; grid-row: 1; font-size: 15px; }
  .m-cards td.c-sub { grid-column: 1; grid-row: 2; margin-bottom: 4px; }
  .m-cards td.c-end { grid-column: 2; grid-row: 1; text-align: right; }
  .m-cards td.c-end2 { grid-column: 2; grid-row: 2; text-align: right; }
  .m-cards td[data-label] { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap;
    gap: 4px 6px; text-align: right; font-size: 13px; }
  .m-cards td[data-label]::before { content: attr(data-label); margin-right: auto; color: var(--muted); font-weight: 600; font-size: 12.5px; }
  .m-cards td.empty { grid-column: 1 / -1; }
  .m-cards .c-title .avatar { flex: none; }

  /* Filters: two per line instead of fixed desktop widths */
  .list-head .f-w { flex: 1 1 150px; width: auto; min-width: 0; }
  .card-head { flex-wrap: wrap; }
  .card-head > form.row { flex: 1 1 100%; margin-left: 0 !important; }
  .card-head > form.row .f-w { flex: 1 1 0; width: auto; min-width: 0; }
  /* page title + several buttons: buttons wrap under the title instead of running off the screen */
  .section-title { flex-wrap: wrap; row-gap: 10px; }
  .section-title h2 { min-width: 0; overflow-wrap: anywhere; }
  /* one-column detail pages: a wide field or table inside a column must not widen the page */
  .detail-grid > * { min-width: 0; }
}

/* ---- M15 dashboard (board: big numbers, highlighted sales card, 14-day line, job list, bottom panels) ---- */
.dash-hello { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px 24px; margin: 4px 0 18px; }
.dh-text { flex: 1 1 280px; min-width: 0; }
.dh-text h2 { margin: 4px 0 2px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.dh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-gap { margin-top: 16px; }
.dash-gap > *, .dash-kpis > * { min-width: 0; }
.dash-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.kpi { display: flex; flex-direction: column; }
.kpi .k-label { margin-top: 2px; }
.kpi .k-val { overflow-wrap: anywhere; }
.kpi .k-link { margin-top: 8px; font-size: 12.5px; font-weight: 700; text-decoration: none; align-self: flex-start; }
.kpi .k-link:hover { text-decoration: underline; }
.kpi .k-ico { background: var(--on-bg); color: var(--on-ink); flex: none; }
.kpi-warn .k-val { color: var(--warn); }
.kpi-hl { background: var(--hero); border-color: rgba(255,255,255,.16); color: #fff; }
.kpi-hl .k-label, .kpi-hl .k-sub { color: #e3f1f6; }
.kpi-hl .k-ico { background: rgba(255,255,255,.16); color: #fff; }
.kpi-hl .k-link { color: #fff; }
:root[data-theme="dark"] .kpi-hl { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 40px rgba(12,108,118,.30); }

.chart-card .card-pad { padding-top: 14px; }
.ch-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.ch-val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ch-plot { position: relative; height: 196px; margin: 22px 0 8px; }
.ch-box { position: absolute; inset: 0 0 0 56px; }   /* plot area; the left gutter holds the scale labels */
.ch-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ch-line { fill: none; stroke: var(--chart-line); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-stop-a { stop-color: var(--chart-line); stop-opacity: .26; }
.ch-stop-b { stop-color: var(--chart-line); stop-opacity: 0; }
.ch-grid { position: absolute; left: 56px; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.ch-grid span { position: absolute; left: -56px; width: 48px; top: -8px; text-align: right; font-size: 11px; font-weight: 600; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.ch-dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--chart-line); }
.ch-dot.today { width: 12px; height: 12px; margin: -6px 0 0 -6px; border: 2.5px solid var(--surface); box-shadow: 0 0 0 1.5px var(--chart-line); }
.ch-tag { position: absolute; right: 0; transform: translateY(calc(-100% - 10px)); padding: 3px 9px; border-radius: 8px; white-space: nowrap;
  background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ch-empty { position: absolute; left: 0; right: 0; top: 38%; margin: 0; text-align: center; }
.ch-axis { display: flex; justify-content: space-between; margin-left: 56px; }
.ch-axis span { width: 0; display: flex; justify-content: center; white-space: nowrap; font-size: 11.5px; font-weight: 600; color: var(--muted-2);
  font-variant-numeric: tabular-nums; }
.ch-axis span.today { color: var(--text); font-weight: 800; }

.jlist .jl-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 18px;
  border-bottom: 1px solid var(--line); }
.jlist .jl-row:last-child { border-bottom: 0; }
.jl-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--on-bg); color: var(--on-ink);
  font-size: 12px; font-weight: 800; }
.jl-av .ic { width: 16px; height: 16px; }
.jl-av.tone-warn { background: var(--warn-bg); color: var(--warn); }
.jl-main { min-width: 0; }
.jl-main .t-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jl-end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; white-space: nowrap; }
.jlist > .empty { margin: 0; padding: 22px 18px; }
@media (max-width: 1000px) { .dash-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  /* board phone: the four numbers 2 x 2 */
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-kpis .kpi { padding: 14px 14px 12px; }
  .dash-kpis .kpi .k-val { font-size: 21px; margin-top: 6px; }
  .dash-kpis .kpi .k-ico { width: 30px; height: 30px; }
  .dash-kpis .kpi .k-ico .ic { width: 15px; height: 15px; }
  .dash-kpis .kpi .k-label { font-size: 12px; }
  .dash-kpis .kpi .k-sub { font-size: 11.5px; }
  .dash-gap { margin-top: 12px; }
  .dash-hello { margin: 0 0 14px; }
  .dh-text h2 { font-size: 20px; }
  .dh-co { display: none; }
  .dh-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .dh-actions .btn { justify-content: center; }
  .ch-box { left: 44px; }
  .ch-grid { left: 44px; }
  .ch-grid span { left: -44px; width: 38px; font-size: 10.5px; }
  .ch-axis { margin-left: 44px; }
  .ch-plot { height: 150px; }
  .ch-val { font-size: 24px; }
  .ch-axis span { font-size: 10.5px; }
  .jlist .jl-row { padding: 12px 14px; gap: 10px; }
}

/* POS desktop (two columns): the cart never grows past the screen, so Charge is always visible; the item list
   scrolls inside it instead (Kai M15 review: Charge was cut off at 1440x900 with 3+ items). */
@media (min-width: 1001px) {
  .cart { display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
  .cart > * { flex: none; }
  .cart > .cart-items { flex: 1 1 auto; min-height: 72px; max-height: none; }
  /* M16: compact cart lines + totals so ~3 lines show at 1366x768 (was ~1.3): name/code/badges on top, then
     qty | unit price + disc | stock + remove on one row. The per-line "Walk-in price" note repeats the header's
     price list, so it is hidden here (the "restore price" button of an edited line stays). */
  .pos .cart-line { grid-template-columns: auto 1fr auto; grid-template-areas: "name name price" "qty edit act";
    gap: 4px 10px; padding: 7px 0; align-items: end; }
  .pos .cart-line > .cl-name { grid-area: name; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; align-self: start; }
  .pos .cart-line .cl-title { flex: 0 0 100%; line-height: 1.3; }
  .pos .cart-line .cl-name .badge { font-size: 10.5px; padding: 1px 7px; }
  .pos .cart-line > .cl-price { grid-area: price; align-self: start; }
  .pos .cart-line > .qty { grid-area: qty; }
  .pos .cart-line > .cl-edit { grid-area: edit; grid-column: auto; min-width: 0; gap: 4px 6px; }
  .pos .cart-line > .cl-edit input { width: 70px; }
  .pos .cart-line > .cl-edit input[data-disc] { width: 50px !important; }
  .pos .cart-line > .cl-edit .cl-note { display: none; }
  .pos .cart-line > .row { grid-area: act; flex-direction: column; align-items: flex-end; gap: 0; }
  .pos .cart-line > .row .t-sub { margin: 0 !important; font-size: 11px; white-space: nowrap; }
  .pos .cart-line > .row .btn { padding: 2px 6px; }
  .pos .cart-line > .cl-rem { grid-column: 1 / -1; }
  .pos #cart-panel.card-pad { padding: 14px 16px; }
  .pos .totals { padding-top: 6px; }
  .pos .totals .t-line { padding: 2px 0; }
  .pos .totals .t-grand { margin-top: 6px; padding: 8px 14px 9px; }
  .pos .totals .t-grand .t-line.grand span:last-child { font-size: 23px; }
  .pos #checkout-btn { margin-top: 10px !important; }
}
/* POS: LBP total under the USD total (board), display only */
.totals .t-grand { margin-top: 10px; padding: 12px 16px 13px; border-radius: 16px; background: var(--hero); color: #fff;
  border: 1px solid rgba(255,255,255,.16); }
.totals .t-grand .t-line.grand { color: #fff; border-top: 0; margin-top: 0; padding: 0; align-items: baseline; font-size: 15px; }
.totals .t-grand .t-line.grand span:last-child { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.totals .t-lbp { display: flex; justify-content: flex-end; margin-top: 2px; color: #e3f1f6; font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .pm-cart small.pm-lbp { color: #fff; font-variant-numeric: tabular-nums; } .pm-cart small[hidden] { display: none; } }

/* ---- No-blur fallback: devices that cannot blur, "reduce transparency", or the #noblur preview.
   Everything turns solid with the same colours. Placed AFTER the phone block on purpose so it wins there too. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --chrome: #ffffff; }
  :root[data-theme="dark"] { --card: #121c33; --chrome: #0c1528; --surface-2: #1a2640; --blur: none; }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --chrome: #ffffff; }
  :root[data-theme="dark"] { --card: #121c33; --chrome: #0c1528; --surface-2: #1a2640; --blur: none; }
  .chrome { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
html.noblur { --chrome: #ffffff; }
html.noblur[data-theme="dark"] { --card: #121c33; --chrome: #0c1528; --surface-2: #1a2640; --blur: none; }
html.noblur .chrome { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Print (last on purpose): paper is always the light look, whatever the screen theme. */
@media print {
  :root, :root[data-theme="dark"] {
    --brand: #035e5c; --teal: #035e5c; --bg: #fff; --base: #fff; --surface: #fff; --surface-2: #f4f7fb; --card: #fff;
    --card-bd: #dfe6ef; --card-hi: 0 0 #0000; --card-sh: none; --line: #e3e9f1; --border: #dfe6ef; --field: #fff; --field-bd: #c9d3e0;
    --text: #0f1b33; --muted: #45526b; --muted-2: #4f5b72; --on-bg: #dff5f4; --on-ink: #05605f;
    --ok: #0f6e48; --ok-bg: #dcf3e8; --warn: #8f5200; --warn-bg: #fdefd6; --danger: #b3302a; --danger-bg: #fde6e3;
    --info: #2152b8; --info-bg: #e3ebfb; --blur: none; --logo: var(--logo-navy); color-scheme: light; }
  html, body { background: #fff !important; }
  body::before { display: none; }
  .chrome { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .shell { padding: 0; }
  .tabbar, #pos-mbar-wrap { display: none !important; }
  .shell::after { display: none !important; }
  .card { box-shadow: none; }
  /* the few dark-only fixed colours, back to the light look on paper */
  .cal-dow, :root[data-theme="dark"] .cal-dow { background: #fff; }
  :root[data-theme="dark"] .badge.danger { background: var(--danger-bg); color: var(--danger); }
  .kcard, :root[data-theme="dark"] .kcard { background: #fff; box-shadow: none; }
}
