/* IPL Retail admin — design system */

:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* brand (from the IPL logo tiles) */
  --rose: #e8285c;
  --rose-strong: #c81848;
  --amber: #f2a516;
  --sky: #109fe0;
  --green: #12a150;
  --violet: #6d5ae6;

  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-hover: #f1f3f8;
  --border: #e6e8ef;
  --border-strong: #d5d9e3;
  --text: #121826;
  --text-2: #475069;
  --muted: #7a8399;

  --primary: var(--rose);
  --primary-hover: var(--rose-strong);
  --primary-soft: #fde8ee;
  --on-primary: #ffffff;

  --success: var(--green);
  --success-soft: #e3f6eb;
  --warning: #b7700a;
  --warning-soft: #fdf2dc;
  --danger: #d92d3a;
  --danger-soft: #fde7e9;
  --info: var(--sky);
  --info-soft: #e1f3fc;
  --violet-soft: #ece9fd;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .22);
  --ring: 0 0 0 3px rgba(232, 40, 92, .22);

  --sidebar-w: 248px;
  --topbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017;
    --surface: #151a23;
    --surface-2: #1a202b;
    --surface-hover: #1f2632;
    --border: #262e3c;
    --border-strong: #333d4e;
    --text: #e9edf5;
    --text-2: #b4bccc;
    --muted: #8590a6;
    --primary-soft: #3a1622;
    --success-soft: #11301f;
    --warning: #f2b544;
    --warning-soft: #33280f;
    --danger: #f2626d;
    --danger-soft: #3a1619;
    --info-soft: #0f2a3a;
    --violet-soft: #241f45;
    --shadow-sm: none;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #151a23;
  --surface-2: #1a202b;
  --surface-hover: #1f2632;
  --border: #262e3c;
  --border-strong: #333d4e;
  --text: #e9edf5;
  --text-2: #b4bccc;
  --muted: #8590a6;
  --primary-soft: #3a1622;
  --success-soft: #11301f;
  --warning: #f2b544;
  --warning-soft: #33280f;
  --danger: #f2626d;
  --danger-soft: #3a1619;
  --info-soft: #0f2a3a;
  --violet-soft: #241f45;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.25; letter-spacing: -.01em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform .2s ease;
  height: 100vh; height: 100dvh; /* dvh: the visible height on phones, under the browser bars */
}
.sidebar-brand { flex: none; height: var(--topbar-h); display: flex; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--border); }
.sidebar-brand .logo-chip img { height: 30px; width: auto; }
.logo-chip { background: #fff; border-radius: 8px; padding: 4px 8px; display: inline-flex; }
.brand-dash { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--text); background: var(--surface-hover); text-decoration: none; }
.brand-dash:hover, .brand-dash:focus-visible { background: var(--primary-soft); color: var(--primary); }
.brand-dash.active { background: var(--primary); color: #fff; }
.nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
       flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); }
.nav-link .badge { margin-left: auto; }
.nav-link.nav-sub { padding: 6px 12px 6px 40px; font-size: 13px; gap: 8px; }
.nav-subhead { padding: 10px 12px 2px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #8a93a3); }
/* a heading with nothing under it for this login (its links are role-filtered) stays hidden */
.nav-subhead:has(+ .nav-subhead), .nav-subhead:last-child { display: none; }
.sidebar-foot { margin-top: auto; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex: none; }
.sidebar-foot .version { font-size: 12px; color: var(--muted); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  /* solid, with a clear edge: the page no longer shows through it when scrolling (owner, 11 Nov 26) */
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
}
:root[data-theme="dark"] .topbar { box-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { box-shadow: 0 2px 14px rgba(0, 0, 0, .45); } }
.topbar-title { font-size: 15px; font-weight: 600; white-space: nowrap; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* tablets on their side and small laptops (menu pinned open): the rep's Add Order / Add RMA buttons, the clock and
   the page name together ran ~100px past the screen edge (owner's photo, 23 Nov 26). The clock gives way first. */
@media (max-width: 1279px) { .rep-quick ~ .kbd-clock { display: none; } }
@media (min-width: 1024px) and (max-width: 1279px) { .topbar { padding: 0 20px; gap: 8px; } .top-search { margin: 0 4px; }
  .topbar:has(.rep-quick) .topbar-title { display: none; } }  /* the page shows its own name just below */
.topbar-spacer { flex: 1; }
.rep-quick { display: flex; gap: 6px; flex-shrink: 0; }
.rep-quick .btn { white-space: nowrap; }
@media (max-width: 600px) { .rep-quick .btn { padding: 4px 8px; font-size: 13px; } }
/* small phones: the two buttons pushed the profile picture off the screen on every rep page (browser check,
   22 Nov 26); without their little icons everything fits */
@media (max-width: 430px) { .rep-quick { gap: 4px; } .rep-quick .btn { padding: 4px 7px; } .rep-quick .btn svg { display: none; } }
/* My day (owner, 24 Nov 26): on small phones just the calendar icon, so the profile picture still fits */
@media (max-width: 1279px) { .rep-quick :is(.rq-day, .rq-pick) span { display: none; } }
@media (max-width: 430px) { .rep-quick .rq-add { display: none; } .rep-quick :is(.rq-day, .rq-pick) svg { display: inline-block; } .rep-quick :is(.rq-day, .rq-pick) { padding: 4px 6px; } }
.topbar .menu-toggle { display: none; }
.content { padding: 28px; width: 100%; max-width: 1440px; margin: 0 auto; flex: 1; }
.footer { padding: 18px 28px; color: var(--muted); font-size: 12px; text-align: center; }
.scrim { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 14, 22, .45); }
  html:has(.shell.nav-open), body:has(.shell.nav-open) { overflow: hidden; } /* the page behind stays still while the menu scrolls */
  .main { margin-left: 0; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }
}
.show-mobile { display: none; }
.menu-btn { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; }
.dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select[multiple] { height: auto; min-height: 140px; padding: 6px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.field-error { color: var(--danger); font-size: 12.5px; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group .icon-btn { position: absolute; right: 2px; top: 1px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card-title { font-size: 15px; font-weight: 650; }
.card-body { padding: 18px 20px 20px; }
.card-head .spacer { flex: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title { font-size: 26px; font-weight: 700; }
.page-sub { color: var(--muted); margin-top: 4px; }
.ord-mkt-no { color: var(--muted); font-size: 13.5px; margin: 2px 0; }  /* marketplace order page: the marketplace's own number (owner, 20 Nov 26) */

.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 1199px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr 1fr; } .grid-3 > .span-2 { grid-column: span 2; } }
@media (max-width: 719px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); } .span-2, .grid-3 > .span-2 { grid-column: auto; } }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; font-size: 12px; font-weight: 650;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge-primary { background: var(--primary); color: #fff; border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
/* Amazon Easy Ship orders (owner, 24 Nov 26) */
.badge-easyship { background: #ff9900; color: #111; border-color: transparent; font-weight: 600; }

/* ---------- stat cards ---------- */
.stat { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { color: var(--muted); font-weight: 600; font-size: 13px; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.tone-rose { background: var(--primary-soft); color: var(--rose); }
.tone-sky { background: var(--info-soft); color: var(--sky); }
.tone-amber { background: var(--warning-soft); color: var(--amber); }
.tone-green { background: var(--success-soft); color: var(--green); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.trend-up { background: var(--success-soft); color: var(--success); }
.trend-down { background: var(--danger-soft); color: var(--danger); }

/* my tasks trio */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trio-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.trio-item .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.trio-item .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin-top: 2px; }
.trio-item.is-alert .v { color: var(--danger); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; }
.list-row .sub { font-size: 12.5px; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed .marker { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }
.feed .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.feed time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* work queue tiles */
.queue { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.queue-head { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.queue-head .stat-icon { width: 32px; height: 32px; border-radius: 9px; }
.queue-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.queue-items li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.queue-items li.alert { color: var(--danger); font-weight: 600; }
.queue-clear { display: flex; align-items: center; gap: 8px; color: var(--success); font-size: 13px; font-weight: 600; }

/* sales compare bars */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar-track { height: 10px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; }

/* avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.avatar-sm { width: 28px; height: 28px; font-size: 11.5px; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

/* ---------- dropdown ---------- */
.dropdown { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
}
.dropdown.open .menu { display: block; }
.menu-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; text-decoration: none; color: var(--text-2); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-hover); color: var(--text); }
.menu-wide { min-width: 320px; }
@media (max-width: 480px) { .menu-wide { min-width: 0; width: calc(100vw - 32px); right: -60px; } }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.user-chip .name { font-weight: 600; font-size: 13px; }

/* ---------- dialog ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal-lg { width: min(860px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 14, 22, .5); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; flex: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
/* Phones: footer buttons wrap and stretch, so none slides off the left edge (owner, 15 Nov 26: Test mode pop-up). */
@media (max-width: 480px) { .modal-foot > .btn, .modal-foot > form > .btn { flex: 1 1 auto; white-space: normal; justify-content: center; } }

/* segmented choice */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1px solid var(--border-strong); border-radius: 12px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.segmented input:checked + label.yes { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.segmented input:checked + label.no { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.segmented input:focus-visible + label { box-shadow: var(--ring); }

/* ---------- alerts & toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-weight: 500; margin-bottom: 16px; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: var(--radius); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .2s ease; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .stat-icon { margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 16px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- quick tasks board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; align-items: start; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.list-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px 16px; }
.list-card-head .who { flex: 1; min-width: 0; }
.list-card-head .who .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-card-head .who .meta { font-size: 12px; color: var(--muted); }
/* Add-task row: the name takes the room; the due date is a small calendar chip (the native picker sits on top of it,
   so it opens on a tap on iPad/iPhone and by click elsewhere). */
.add-task { display: flex; gap: 6px; padding: 0 12px 10px; align-items: center; }
.add-task .add-task-name { flex: 1 1 auto; min-width: 0; width: auto; height: 36px; font-size: 14px; border-radius: 8px; }
.add-task .add-task-go { flex: none; width: 36px; height: 36px; padding: 0; justify-content: center; }
.due-pick { position: relative; flex: none; display: inline-flex; align-items: center; gap: 4px; height: 36px; min-width: 36px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.due-pick:hover, .due-pick:focus-within { border-color: var(--border-strong); color: var(--text); }
.due-pick.has-date { color: var(--primary); border-color: currentColor; }
.due-pick input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.due-pick-text:empty { display: none; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 2px; }
.task-meta .due { margin-top: 0; }
.task .from { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.qt-hint { font-size: 12px; margin-top: 4px; }
.qt-history-filter .input { flex: 1 1 200px; }
.qt-history { padding: 4px 10px 10px; }
.qt-history-day { list-style: none; padding: 14px 8px 4px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
a.done-toggle { text-decoration: none; }
/* View as (super admins): the switcher in the top bar and the banner on every page */
.view-as { display: flex; align-items: center; gap: 6px; margin-right: 6px; }
/* Switch view: one login, several roles (apps/accounts/custom_roles.views_for) */
.work-view { display: flex; align-items: center; gap: 6px; margin-right: 8px; }
.work-view-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.work-view-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--surface-2, var(--surface)); }
.work-view-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.work-view-btn:hover { color: var(--text); }
.work-view-btn.on { background: var(--primary); color: #fff; }
.work-view-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
@media (max-width: 600px) { .work-view-btn { padding: 5px 9px; font-size: 12px; max-width: 110px; } }
.view-as-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.view-as .select { height: 34px; width: auto; max-width: 180px; font-size: 13px; padding-top: 0; padding-bottom: 0; }
.view-as-banner { align-items: center; flex-wrap: wrap; }
.view-as-banner .grow { flex: 1 1 260px; }
@media (max-width: 640px) {
  .view-as .select { max-width: 104px; }
  .view-as-label { display: none; }
  /* phones: the page name gives way (one line, cut short) so the buttons on the right always fit */
  .topbar-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar { gap: 4px; }
}
.kbd-clock { white-space: nowrap; }
@media (max-width: 1100px) { .view-as ~ .kbd-clock { display: none; } }
/* Quick task alerts in the bell menu */
.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; text-decoration: none; color: inherit; }
.alert-row:hover { background: var(--surface-hover); }
.alert-row .title { font-size: 13px; overflow-wrap: anywhere; }
.alert-row .sub { font-size: 11.5px; color: var(--muted); }
.menu-section { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.menu-section button { border: 0; background: none; color: var(--primary); font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; }
.tasks { list-style: none; margin: 0; padding: 4px 6px 8px; }
.task { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 9px; }
.task:hover { background: var(--surface-hover); }
.task .check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; transition: all .15s; }
.task .check:hover { border-color: var(--success); color: var(--success); }
.task.done .check { background: var(--success); border-color: var(--success); color: #fff; }
.task .body { flex: 1; min-width: 0; }
.task .text { overflow-wrap: anywhere; }
.task.done .text { color: var(--muted); text-decoration: line-through; }
.task .due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.task .due.overdue { color: var(--danger); font-weight: 600; }
.task .actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.task:hover .actions, .task:focus-within .actions { opacity: 1; }
@media (hover: none) { .task .actions { opacity: 1; } }
.done-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.done-toggle .icon { transition: transform .15s; }
.done-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.list-empty { padding: 6px 16px 14px; font-size: 13px; color: var(--muted); }
.new-list-card { border: 2px dashed var(--border-strong); background: transparent; box-shadow: none; }
.new-list-card .card-body { display: flex; flex-direction: column; gap: 10px; }
.is-leaving { animation: leave .25s ease forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(8px); } }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(1200px 600px at -10% -20%, rgba(255, 255, 255, .16), transparent 60%),
    radial-gradient(800px 500px at 120% 120%, rgba(16, 159, 224, .55), transparent 60%),
    linear-gradient(135deg, #e8285c 0%, #b51a63 45%, #3b2a8f 100%);
}
.auth-art .art-logo { display: inline-block; background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.auth-art .art-logo img { display: block; width: 132px; height: auto; }
.auth-logos { margin-top: 32px; max-width: 560px; }
.auth-logos .label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .9; margin-bottom: 12px; }
.auth-track { overflow: hidden; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); padding: 12px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.auth-run { display: flex; gap: 12px; width: max-content; padding-left: 12px; animation: auth-run 40s linear infinite; }
.auth-track:hover .auth-run { animation-play-state: paused; }
.auth-run .lg { display: grid; place-items: center; height: 64px; min-width: 110px; padding: 8px 16px; background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.auth-run img { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
@keyframes auth-run { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .auth-run { animation: none; flex-wrap: wrap; width: auto; padding: 0 12px; } .auth-track { mask-image: none; -webkit-mask-image: none; } }
.auth-art .tiles { display: grid; grid-template-columns: repeat(3, 64px); gap: 12px; }
/* customer sign-in: the sign-up box and the brand strip under the form (the strip shows where the side panel is hidden) */
.auth-join { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border, #d0d5dd); border-radius: 14px; background: var(--surface-2, #f8fafc); display: grid; gap: 8px; }
.auth-join b { font-size: 15px; } .auth-join > span { color: var(--text-muted, #475467); font-size: 13.5px; line-height: 1.45; }
.auth-join .btn { margin-top: 4px; }
.auth-site { display: inline-block; font-size: 13px; font-weight: 600; color: var(--text-muted, #475467); text-decoration: none; }
.auth-site:hover { color: var(--text, #101828); text-decoration: underline; }
.auth-logos-bottom { display: none; margin-top: 22px; max-width: none; }
.auth-logos-bottom .label { color: var(--text-muted, #475467); }
.auth-logos-bottom .auth-track { background: #f3f4f6; border-color: #e5e7eb; }
.auth-logos-bottom .auth-run .lg { box-shadow: 0 2px 8px rgba(16, 24, 40, .08); border: 1px solid #eef0f3; }
@media (max-width: 899px) { .auth-logos-bottom { display: block; } }
.auth-art .tiles span { height: 64px; border-radius: 16px; background: rgba(255, 255, 255, .14); backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, .22); }
.auth-art .tiles span:nth-child(2) { background: rgba(242, 165, 22, .85); }
.auth-art .tiles span:nth-child(3) { background: rgba(16, 159, 224, .85); }
.auth-art h1 { font-size: 40px; font-weight: 750; max-width: 520px; letter-spacing: -.02em; }
.auth-art p { font-size: 16px; opacity: .85; max-width: 460px; margin: 14px 0 0; }
.auth-art .foot { font-size: 13px; opacity: .7; }
.auth-tagline { margin-top: 26px; display: inline-block; padding: 8px 16px; border-radius: 12px; background: rgba(255, 255, 255, .95); color: #b51a63; font-size: 18px; font-weight: 750; transition: opacity .4s; }
.auth-tagline.out { opacity: 0; }
.auth-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 132px)); gap: 12px; margin-top: 32px; }
.auth-photos figure { margin: 0; aspect-ratio: 1; border-radius: 16px; background: #fff; padding: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.auth-photos img { max-width: 100%; max-height: 100%; object-fit: contain; }
.auth-brands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; max-width: 520px; align-items: center; }
.auth-brands .label { width: 100%; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.auth-brands .chip { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); }
@media (max-height: 760px) { .auth-photos { grid-template-columns: repeat(6, minmax(0, 72px)); } .auth-art h1 { font-size: 32px; } }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo-chip { margin-bottom: 32px; }
.auth-card .logo-chip img { height: 40px; width: auto; }
.auth-card h2 { font-size: 26px; font-weight: 700; }
.auth-card .lead { color: var(--muted); margin: 6px 0 28px; }
.otp-input { height: 56px; font-size: 26px; text-align: center; letter-spacing: .5em; font-weight: 700; font-variant-numeric: tabular-nums; }
.auth-links { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-links a { color: var(--primary); font-weight: 600; text-decoration: none; }
@media (max-width: 899px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-panel, .auth-card { min-width: 0; } .auth-art { display: none; } .auth-panel { padding: 32px 16px; } }

.kbd-clock { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.sync-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; }
.sync-row .grow { flex: 1; min-width: 0; }
.sync-row .title { font-weight: 600; font-size: 13px; }
.sync-row .sub { font-size: 12px; color: var(--muted); }
.users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.user-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.user-tile .grow { flex: 1; min-width: 0; }
.user-tile .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-tile .sub { font-size: 12px; color: var(--muted); }
button.user-tile { font: inherit; color: inherit; text-align: left; width: 100%; }
.user-tile.is-link { cursor: pointer; }
.user-tile.is-link:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.activity-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.activity-head .grow { flex: 1; min-width: 140px; }
.activity-head .name { font-weight: 700; font-size: 16px; }
.activity-head .sub { font-size: 12.5px; }
.activity-ranges { display: flex; gap: 6px; }
.activity-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.activity-stats > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.activity-stats .k { font-size: 12px; color: var(--muted); }
.activity-stats .v { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 4px; }
.activity-days { display: grid; gap: 4px; }
.activity-day { display: grid; grid-template-columns: 96px 1fr 64px 150px; align-items: center; gap: 10px; font-size: 13px; }
.activity-day.is-empty .d { color: var(--muted); }
.activity-day .bar { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.activity-day .bar span { display: block; height: 100%; background: var(--success); }
.activity-day .t { text-align: right; font-weight: 600; }
.activity-day .w { font-size: 12px; }
.activity-note { font-size: 12px; margin-top: 14px; }
.ip-place { white-space: nowrap; }
.ip-place .flag { margin-right: 6px; }
.ip-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.geo-credit { font-size: 11.5px; margin: 6px 0 0; }
.geo-credit a { color: inherit; }
.travel-facts { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 14px; }
.travel-facts dt { color: var(--muted); }
.travel-facts dd { margin: 0; font-weight: 600; }
.travel-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.access-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.access-box .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.access-box .row + .row { margin-top: 10px; }
.access-box .k { font-size: 12px; color: var(--muted); min-width: 120px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 12.5px; font-weight: 600; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--danger); }
.access-box select { height: 30px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 0 8px; }
@media (max-width: 640px) { .activity-day { grid-template-columns: 84px 1fr 56px; } .activity-day .w { display: none; } }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 10px; }
.section-title:first-child { margin-top: 0; }

/* ---------- data tables ---------- */
.table-wrap { overflow-x: auto; position: relative; } /* position: keeps hidden screen-reader labels (sr-only) inside the scroll box, so a wide table never widens the whole page on a phone */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-hover); }
.table .r { text-align: right; }
.table a.row-link { color: var(--text); font-weight: 650; text-decoration: none; }
.table a.row-link:hover { color: var(--primary); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input, .toolbar .select { height: 36px; width: auto; }
.toolbar .search { position: relative; flex: 1 1 240px; min-width: 200px; }
.toolbar .search .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.toolbar .search .input { width: 100%; padding-left: 34px; }
.tabs { display: flex; gap: 4px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; width: fit-content; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 8px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 13.5px; display: inline-flex; gap: 8px; align-items: center; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new { background: var(--info-soft); color: var(--info); border-color: transparent; }
.status-quote { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.status-pick, .status-pack { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.status-dispatched { background: var(--success-soft); color: var(--success); border-color: transparent; }
.status-cancelled, .status-on-hold { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.status-new-backorder { background: var(--warning-soft); color: var(--warning); border-color: transparent; }

/* ---------- order page ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.address { font-size: 13.5px; line-height: 1.6; }
.totals { margin-left: auto; width: min(320px, 100%); display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14px; }
.totals .grand { font-size: 18px; font-weight: 750; border-top: 1px solid var(--border); padding-top: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--border); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li:last-child { border-left-color: transparent; }
.timeline time { display: block; font-size: 12px; color: var(--muted); }
.trail li.trail-status::before { background: var(--violet); }
.trail li.trail-warehouse::before { background: var(--amber); }
.trail li.trail-dispatch::before { background: var(--green); }
.trail li.trail-edit::before { background: var(--sky); }
.trail li.trail-link::before { background: var(--rose); }
.trail li.trail-start::before { background: var(--text); }

/* ---------- order builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
/* builder: search pinned under the top bar; suggestion cards (16 Nov 26) */
.builder-search-pin { position: sticky; top: var(--topbar-h); z-index: 6; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.builder-search-pin .input { font-size: 16px; }
.builder-suggest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.builder-suggest-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.builder-suggest-card.in-cart { border-color: var(--success, #16a34a); background: var(--surface-2); }
.builder-suggest-card .badge { align-self: flex-start; }
.builder-suggest-card .btn { margin-top: auto; }
.builder-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto; }
@media (max-width: 1199px) { .builder { grid-template-columns: 1fr; } .builder-side { position: static; max-height: none; } }
.catalogue-group { margin-top: 18px; }
.catalogue-group > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.product-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.product-row.in-cart { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.product-row.is-backorder { background: color-mix(in srgb, var(--warning-soft) 55%, var(--surface)); }
.product-row .pname { font-weight: 600; overflow-wrap: anywhere; }
.product-row .pmeta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.product-row .pprice { text-align: right; white-space: nowrap; }
.product-row .pprice strong { display: block; font-size: 15px; }
.product-row .pprice s { color: var(--muted); font-size: 12px; }
.stock-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.stock-low { background: var(--danger); } .stock-medium { background: var(--amber); } .stock-high { background: var(--success); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty button { width: 32px; height: 34px; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.qty button:hover { background: var(--surface-hover); }
.qty input { width: 54px; height: 34px; border: 0; text-align: center; font-weight: 650; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: none; }
@media (max-width: 640px) { .product-row { grid-template-columns: 40px minmax(0, 1fr); } .product-row .pprice { text-align: left; } .product-row .pprice, .product-row .qty { grid-column: 2; } }
.cart-lines { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; }
.cart-lines li { display: flex; gap: 10px; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.cart-lines li:first-child { border-top: 0; }
.cart-lines .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-lines li { align-items: center; }
.cart-lines .nm { flex: 1; }
.cart-thumb { flex: none; width: 36px; height: 36px; border-radius: 6px; object-fit: contain; background: var(--surface-2, #f4f5f7); border: 1px solid var(--border); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.chip-promo { background: var(--primary-soft); color: var(--primary); }
.chip-gst { background: var(--info-soft); color: var(--info); }
.chip-back { background: var(--warning-soft); color: var(--warning); }
.chip-disc { background: var(--success-soft); color: var(--success); }
.action-stack { display: flex; flex-direction: column; gap: 8px; }
details.panel > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
details.panel > summary::-webkit-details-marker { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 10px; }
.form-grid .input { height: 36px; }

.customer-grid { grid-template-columns: 2fr 1fr; }
@media (max-width: 640px) { .form-grid, .customer-grid { grid-template-columns: 1fr; } }

/* signature pad */
.sig-pad { width: 100%; height: 150px; border: 1px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); }
.sig-img { max-width: 220px; max-height: 80px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px; display: block; margin-top: 4px; }

/* broadcast */
.message-body { white-space: pre-line; line-height: 1.6; }

/* rebates */
.table tr.sub-row td { font-size: 12.5px; padding-top: 4px; padding-bottom: 4px; background: var(--surface-2); }

/* inventory */
.add-po { display: flex; gap: 6px; align-items: center; margin: 0; }
.add-po .select { width: auto; min-width: 110px; }
tr.group-head td { background: var(--surface-2); font-size: 13px; }
.po-fields { display: grid; gap: 6px; }
.po-field { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: center; margin: 0; }
.po-field .label { margin: 0; }
.check-row { display: grid; grid-template-columns: 1fr 180px; gap: 8px; align-items: center; margin-bottom: 6px; }
.check-ai { grid-column: 1 / -1; font-size: 12.5px; margin: -2px 0 4px 26px; color: var(--muted); }
.check-ai-ok { color: var(--success); }
.check-ai-warn { color: var(--warning); font-weight: 600; }
.check-ai-hint { color: var(--primary); }
.check-ai-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px;
  font-size: 12.5px; color: var(--muted); }
.check-ai-box { flex-basis: 100%; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--text);
  font-size: 13px; }
.check-ai-box ul { margin: 4px 0 0; padding-left: 18px; }
.ship-history { margin-top: 20px; }
.ship-history-note { font-size: 12.5px; margin: 2px 0 12px; }
.ship-history .timeline, .po-history { max-height: 520px; overflow-y: auto; }
.ship-history .timeline li { font-size: 13.5px; overflow-wrap: anywhere; }
.ship-history-where { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.owing-totals { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 16px; }
.owing-total { padding: 14px 16px; display: grid; gap: 4px; }
.owing-total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.owing-late { color: var(--danger); font-weight: 600; }
.owing-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.owing-note { font-size: 12.5px; margin-top: 10px; }
/* Report a problem (apps/devtasks/reports.py) */
.pr-title { margin: 12px 0 4px; }
.pr-sub { margin: 0 0 16px; }
.pr-text { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; }
.pr-hint { display: block; margin-top: 4px; font-size: 12.5px; overflow-wrap: anywhere; }
.pr-back { margin: 12px 0 0; font-size: 14px; text-align: center; }
.pr-mine { margin: 22px 0 8px; font-size: 15px; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pr-list li { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; }
.pr-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.pr-note { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.pr-counts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pr-card { margin-bottom: 14px; }
.pr-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pr-page { font-size: 12.5px; margin-top: 6px; overflow-wrap: anywhere; }
.pr-pic { display: block; max-width: min(520px, 100%); max-height: 360px; margin-top: 10px; border-radius: 10px; border: 1px solid var(--border); }
.pr-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pr-reply { flex: 1 1 240px; min-width: 0; }
.check-skipped { margin-top: 10px; font-size: 13px; color: var(--muted); }
.check-skipped summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.check-skipped ul { margin: 4px 0 6px; padding-left: 18px; }
.check-skipped p { margin: 0; font-size: 12.5px; }
.complete-box { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.note-item { padding: 10px 0; border-top: 1px solid var(--border); }
.table input.r { text-align: right; }
@media (max-width: 640px) { .po-field { grid-template-columns: 1fr auto; } .po-field .label { grid-column: 1 / -1; } .check-row { grid-template-columns: 1fr; } }

/* runs */
.input-xs { height: 32px; padding: 0 8px; font-size: 13px; }
.cal { overflow: hidden; }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 96px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7) { border-right: 0; }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-date { color: var(--muted); }
.cal-day.weekend { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.cal-day.today .cal-date { background: var(--primary); color: #fff; border-radius: 999px; width: 22px; text-align: center; }
.cal-date { font-size: 12px; font-weight: 650; }
.cal-run { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 6px; background: var(--info-soft); color: var(--info); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-run span { font-weight: 500; opacity: .8; }
.cal-run.done { background: var(--success-soft); color: var(--success); }
.cal-run.clash { background: var(--danger-soft); color: var(--danger); }
.cal-run.calling { background: var(--surface-2); color: var(--text-2); border: 1px dashed var(--border); }
.cal-day.holiday { background: var(--warning-soft); }
.cal-hol { font-size: 11px; color: var(--warning); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-hol.work { color: var(--success); }
.rc-legend .cal-hol.work { background: var(--success-soft); }
.rc-legend .cal-hol { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--warning-soft); }
.rh-add { margin-bottom: 16px; }
.rh-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.rc-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rc-fix { margin-bottom: 16px; border-color: var(--danger); }
.rc-fix .table-wrap { margin: 10px 0 12px; }
.rc-legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rc-legend .cal-run { display: inline-block; }
.rc-move { margin-top: 20px; }
.rc-move-table { margin-top: 10px; }
.rc-move-form { display: flex; gap: 6px; }
.rc-date { width: 150px; }
@media (max-width: 720px) { .cal-day { min-height: 64px; padding: 3px; } .cal-run span { display: none; } }

/* sales leads */
.pill-row { gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text-2); font-size: 13px; font-weight: 600; background: var(--surface); }
.pill .num { color: var(--muted); font-weight: 650; }
.pill.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pill.active .num { color: inherit; opacity: .85; }
.pill-late { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 4px; margin: 4px 0 16px; }
.fieldset legend { font-size: 13px; font-weight: 650; padding: 0 6px; color: var(--text-2); }

/* favourites */
.check-list { list-style: none; padding: 0; margin: 0 0 14px; font-size: 13px; display: grid; gap: 3px; }
.check-list li::before { content: "✓ "; color: var(--success); }
.check-list li.bad { color: var(--danger); }
.check-list li.bad::before { content: "✕ "; }

/* pick & pack */
.pp-board tbody.group + tbody.group tr:first-child td { border-top: 2px solid var(--border-strong); }
.pp-board td[rowspan] { vertical-align: top; background: var(--surface); }
.pp-board tr.row-paid td:not([rowspan]), .pp-board tbody.all-paid td[rowspan] { background: var(--success-soft); }
/* Pick & pack on an iPad (owner, 19 Nov 26): no cut-off columns; rep + date go under the order number, picker list fits */
.pp-board .pp-narrow { display: none; }
.pp-board .select-sm { min-width: 150px; }
.pp-board td:first-child .row-link { white-space: nowrap; }
.pp-board td:nth-child(2) .row-link { overflow-wrap: anywhere; }
@media (max-width: 1280px) {
  .pp-board .pp-wide { display: none; }
  .pp-board .pp-narrow { display: block; }
  .pp-board th, .pp-board td { padding-left: 10px; padding-right: 10px; }
  .pp-board .select-sm { min-width: 145px; }
}
.table tr.row-late td { background: var(--warning-soft); }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions-cell form { margin: 0; }
.inline-form { margin: 0; }
.select-sm { height: 32px; font-size: 13px; padding: 0 28px 0 8px; min-width: 140px; }
.workload { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; color: #fff; background: var(--load, var(--success)); }
.priority { color: var(--muted); }
.priority.on { color: var(--warning); background: var(--warning-soft); }
.tick { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 6px 0; cursor: pointer; }
.qa-dup-choice { border: 0; padding: 0; margin: 0; }
.actions-cell .tick { margin: 0; font-size: 12.5px; color: var(--text-2); }
.doc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.parcel-head, .parcel-row { display: grid; grid-template-columns: 1.2fr repeat(4, .8fr) 2fr 32px; gap: 6px; align-items: center; }
.parcel-head { font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.parcel-row { margin-bottom: 6px; }
.parcel-row .input, .parcel-row .select { height: 34px; padding: 0 8px; }
.amend-row { display: grid; grid-template-columns: 110px 1fr 90px; gap: 6px; margin-bottom: 6px; }
.amend-row .input, .amend-row .select { height: 34px; }
.parcel-ticks { display: grid; gap: 2px; }
.alert-info-soft { background: var(--info-soft); color: var(--info); }
.card-foot { padding: 10px 16px; margin: 0; font-size: 12.5px; }
.icon-xs { width: 12px; height: 12px; }
@media (max-width: 720px) {
  .parcel-head { display: none; }
  .parcel-row { grid-template-columns: 1fr 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
}

/* reports: tick-box filter dropdown */
.pick { position: relative; }
.pick > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-width: 150px; justify-content: space-between; }
.pick > summary::-webkit-details-marker { display: none; }
.pick[open] > .menu { display: block; left: 0; right: auto; max-height: 320px; overflow: auto; }
.pick .tick { margin: 0; padding: 6px 8px; border-radius: 6px; }
.pick .tick:hover { background: var(--surface-hover); }

/* accessibility: skip link (visible when focused), honour reduced-motion settings */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 1000; padding: 10px 14px; border-radius: 8px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* maps */
.map { height: 460px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 0; }
@media (max-width: 640px) { .map { height: 340px; } }
.map-dot span { display: block; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.map-google-btn { display: block; background: #fff; padding: 4px 10px; font-size: 12px; font-weight: 600; color: #1f2937 !important; text-decoration: none; }
.map-google-btn:hover { background: #f3f4f6; }
.map-car { background: none; border: 0; }
.map-car svg { position: absolute; left: 3px; top: 3px; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); transition: transform .3s; }
.map-car-ring { position: absolute; inset: 0; border-radius: 50%; border: 2.5px solid; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.leaflet-tooltip.map-car-label { background: none; border: 0; box-shadow: none; padding: 0; }
.map-car-tag { display: inline-flex; flex-direction: column; align-items: center; color: #fff; border: 1.5px solid #fff; border-radius: 7px;
  padding: 1px 6px 2px; line-height: 1.15; box-shadow: 0 1px 4px rgba(0,0,0,.35); white-space: nowrap; }
.map-car-tag b { font-size: 11.5px; font-weight: 800; letter-spacing: .3px; }
.map-car-tag span { font-size: 10.5px; font-weight: 600; opacity: .95; }
.leaflet-tooltip.map-car-label::before { display: none; }
/* customer card on any map (static/js/maps.js IPLCard) */
.map-card { font-size: 13px; line-height: 1.5; min-width: 200px; }
.map-card > b { display: block; font-size: 14px; margin-bottom: 2px; }
.map-card-k { display: inline-block; min-width: 72px; color: var(--muted); font-size: 12px; }
.map-card-extra { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border, #e5e7eb); color: var(--muted); font-size: 12px; }
.map-card-links { margin-top: 6px; font-weight: 600; }
.map-num { background: none; border: 0; }
.map-num span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.trip-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .trip-layout { grid-template-columns: 1fr; } }
.trip-layout .map { height: 560px; }
@media (max-width: 640px) { .trip-layout .map { height: 360px; } }
.trip-timeline { list-style: none; margin: 0; padding: 4px 16px 16px; max-height: 620px; overflow-y: auto; }
.trip-timeline li { position: relative; display: flex; gap: 12px; padding: 8px 8px 8px 0; border-radius: 8px; }
.trip-timeline li::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.trip-timeline li:first-child::before { top: 50%; }
.trip-timeline li:last-child::before { bottom: 50%; }
.trip-timeline [data-focus] { cursor: pointer; }
.trip-timeline [data-focus]:hover, .trip-timeline .on { background: var(--surface-2); }
.trip-timeline .tl-dot { position: relative; z-index: 1; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface); margin-top: 1px; }
.trip-timeline .tl-line { background: #2563eb; width: 12px; height: 12px; margin: 5px; border: 0; }
.trip-timeline .tl-num { background: #f59e0b; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border-width: 0; }
.trip-timeline .tl-time { margin-left: 6px; font-size: 12px; font-weight: 650; color: #b45309; background: #fef3c7; border-radius: 999px; padding: 1px 8px; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ---------------------------------------------------------------- store visits */
.alert-warning { background: var(--warning-soft); color: var(--warning); }
button.pill { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
button.pill:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.visit-start-row { display: flex; gap: 10px; flex-wrap: wrap; }
.visit-start-row .input { flex: 1 1 260px; }
.visit-row { text-decoration: none; color: inherit; padding: 12px 20px; }
.visit-row:hover { background: var(--surface-2); }
.visit-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.visit-row-side { text-align: right; display: flex; flex-direction: column; font-size: 13.5px; }
.visit-order-chip { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.visit-snapshot { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.snap { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; margin: 0; }
.snap-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.snap-value-sm { font-size: 16px; }
.snap-danger { border-color: var(--danger); }
.snap-danger .snap-value { color: var(--danger); }
.last-order > summary, .suggest-box > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.last-order > summary::-webkit-details-marker, .suggest-box > summary::-webkit-details-marker { display: none; }
.last-order[open] > summary .icon, .suggest-box[open] > summary .icon { transform: rotate(180deg); }
.visit-nudges .alert { margin-bottom: 8px; }
.suggest-groups { display: flex; flex-direction: column; gap: 4px; padding: 0 16px 12px; }
.suggest-count { display: inline; margin-left: 6px; }
.suggest-group-title { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); padding: 10px 0 4px; }
.suggest-group-title span { font-weight: 500; margin-left: 4px; }
/* each suggestion group folds (24 Nov 26) */
.suggest-group > summary.suggest-group-title { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px;
  padding: 10px 0; border-top: 1px solid var(--border); }
.suggest-group:first-child > summary.suggest-group-title { border-top: 0; }
.suggest-group > summary::-webkit-details-marker { display: none; }
.suggest-group > summary .icon { margin-left: auto; transition: transform .15s; }
.suggest-group[open] > summary .icon { transform: rotate(180deg); }
.suggest-group[open] > summary.suggest-group-title { padding-bottom: 4px; }
/* one product per row, like a spreadsheet (owner, 19 Nov 26): picture | name + SKU | price | why | Add */
.suggest-row { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.suggest-card { display: grid; grid-template-columns: 36px minmax(0, 2fr) 64px minmax(0, 3fr) auto; align-items: center; gap: 10px; padding: 4px 10px; min-height: 44px; border-top: 1px solid var(--border); background: var(--surface); }
.suggest-card:first-child { border-top: 0; }
.suggest-card:nth-child(even) { background: var(--surface-2); }
.suggest-card.in-cart { box-shadow: inset 3px 0 0 var(--primary); }
.suggest-img { display: block; width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--border); }
.suggest-main { min-width: 0; }
.suggest-main .cell-sub { font-size: 11.5px; }
.suggest-name { font-weight: 600; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-price { font-size: 13px; text-align: right; }
.suggest-why { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.suggest-card .btn { white-space: nowrap; }
.suggest-price-sm { display: none; }
.last-line { display: flex; align-items: center; gap: 10px; }
.last-img { width: 36px; height: 36px; }
.visit-filters { display: flex; flex-direction: column; gap: 10px; }
.visit-copy-id { margin: 0; }
.visit-copy-row { display: flex; gap: 8px; }
.visit-copy-row .input { flex: 1; min-width: 0; text-transform: uppercase; }
.pill-row.cat-row { display: flex; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cat-row .pill, .pill-row .pill { white-space: nowrap; }
.pill-row { display: flex; flex-wrap: wrap; }
.product-row .pwhy { font-size: 12px; color: var(--primary); margin-top: 3px; }
.chip-last { background: var(--success-soft); color: var(--success); }
.survey { display: flex; flex-direction: column; gap: 14px; }
.survey-q { border: 0; padding: 0; margin: 0; }
.survey-q legend { margin-bottom: 6px; }
.survey-help { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.survey-help summary { cursor: pointer; font-weight: 600; }
.survey-help ul { margin: 6px 0 0; padding-left: 18px; }
.survey-help li { margin-bottom: 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }
.photo-tile { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: block; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.photo-tile.uploading { opacity: .5; }
.visit-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin: 0 -4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -6px 20px rgba(10, 14, 22, .08); }
.visit-bar strong { font-size: 18px; display: block; }
.visit-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.no-order summary { list-style: none; }
.no-order[open] { flex-basis: 100%; }
.preview-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.preview-line .preview-thumb { flex: 0 0 48px; width: 48px; height: 48px; }
.preview-line .preview-name { flex: 1; min-width: 0; }
/* order page: merged orders notes (apps/orders/merge.py, 20 Nov 26) */
.merge-note { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.merge-note .grow { flex: 1; min-width: 0; }
/* order page: status as one control, saved after a confirmation popup (static/js/order_status.js, 18 Nov 26) */
.status-pick { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); overflow: hidden; }
.status-pick label { padding: 0 4px 0 12px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status-pick .select { height: 36px; width: auto; border: 0; background-color: transparent; font-weight: 600; box-shadow: none; }
/* product picture popup (static/js/picture_viewer.js, 17 Nov 26) */
.visit-catalogue img.thumb, #preview-lines img.thumb, .suggest-card img, .last-order img.thumb { cursor: zoom-in; }
dialog.pic-viewer { width: min(820px, calc(100vw - 24px)); }
.pic-viewer .modal-head { padding: 12px 16px; }
.pic-stage { position: relative; display: flex; align-items: center; justify-content: center; background: #fff;
  height: min(70vh, 640px); }
.pic-stage img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pan-y; user-select: none; }
.pic-stage img.pic-broken { visibility: hidden; }
.pic-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: rgba(15, 23, 42, .55); color: #fff; touch-action: manipulation; }
.pic-nav:hover { background: rgba(15, 23, 42, .75); }
.pic-prev { left: 10px; }
.pic-next { right: 10px; }
.pic-strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; }
.pic-strip:empty { display: none; }
.pic-strip button { flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid var(--border); border-radius: 8px;
  background: #fff; overflow: hidden; cursor: pointer; }
.pic-strip button.active { border-color: var(--primary); }
.pic-strip img { width: 100%; height: 100%; object-fit: contain; }
.kv-list { display: flex; flex-direction: column; gap: 8px; }
.score-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; min-width: 60px; }
.score-bar span { display: block; height: 100%; background: var(--primary); }
@media (max-width: 640px) {
  .visit-snapshot { grid-template-columns: 1fr 1fr; }
  .product-row { grid-template-columns: 40px minmax(0, 1fr); }
  .product-row .pprice { grid-column: 2; text-align: left; }
  .product-row .qty { grid-column: 1 / -1; justify-self: end; }
}
.pay-check { border: 1px solid var(--warning); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0 0; background: color-mix(in srgb, var(--warning-soft) 45%, var(--surface)); }
.pay-check legend { padding: 0 6px; }
.pack-hint { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.product-row .pinner { font-size: 12px; color: var(--warning); margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.email-opt { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.email-opt input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success, #1f8a4c); }

/* Promotional catalogue */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-text { font-size: 12.5px; font-weight: 650; color: var(--muted); min-width: 52px; }
.switch-text::after { content: attr(data-off); }
.switch input:checked ~ .switch-text { color: var(--success); }
.switch input:checked ~ .switch-text::after { content: attr(data-on); }
.promo-switches .list-row { padding: 10px 0; }
.promo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.promo-actions .btn { justify-content: flex-start; height: auto; min-height: 40px; padding-top: 8px; padding-bottom: 8px; white-space: normal; text-align: left; }
.promo-actions .btn[hidden] { display: none; }
.promo-frame { width: 100%; height: 62vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.promo-copy-text { white-space: pre-wrap; font: 13.5px/1.5 ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0; user-select: all; }
dialog.promo-dialog { width: min(1100px, calc(100vw - 32px)); }
.promo-banner { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 6px; }
.promo-banner img { display: block; width: 100%; height: auto; max-height: 180px; object-fit: contain; }
.promo-swatches { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.promo-swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.promo-wire { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); max-width: 300px; }
.promo-wire img { display: block; width: 100%; }
.promo-wire-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px; }
.promo-wire-cards span { height: 34px; border-radius: 4px; background: #f8f8f8; }
.promo-chip { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); vertical-align: -2px; }
.promo-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--success); vertical-align: 2px; }
.promo-cats { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; counter-reset: cat; }
.promo-cats li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: var(--surface); break-inside: avoid; cursor: grab; counter-increment: cat; }
.promo-cats li::before { content: counter(cat) "."; color: var(--muted); font-size: 12.5px; min-width: 22px; }
.promo-cats li.dragging { opacity: .5; }
.promo-cats .grow { flex: 1; }
.promo-cats .icon-btn { width: 28px; height: 28px; font-size: 10px; }
.promo-grip { color: var(--muted); letter-spacing: -2px; }
@media (max-width: 719px) { .promo-cats { columns: 1; } .promo-actions { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- collapsible side-menu groups */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group > summary.nav-label { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; border-radius: 8px; user-select: none; }
.nav-group > summary.nav-label::-webkit-details-marker { display: none; }
.nav-group > summary.nav-label:hover { color: var(--text); background: var(--surface-hover); }
.nav-group > summary.nav-label:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.nav-chevron { transition: transform .15s ease; flex: none; }
.nav-group:not([open]) .nav-chevron { transform: rotate(-90deg); }
/* a closed group with something due (badge inside) shows a dot */
.nav-group:not([open]):has(.badge) > summary.nav-label::after { content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning); margin-left: auto; margin-right: 6px; }
.nav-group:not([open]):has(.badge) > summary .nav-chevron { margin-left: 0; }
@media (prefers-reduced-motion: reduce) { .nav-chevron { transition: none; } }

/* ---- order payments and the admin order editor ---- */
.pay-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pay-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.pay-summary strong { font-size: 17px; }
.pay-due { color: var(--danger); }
.pay-credit { color: var(--success, #15803d); }
.pay-note { font-size: 12.5px; margin: 10px 0 0; display: flex; gap: 6px; align-items: center; }
.pay-form { margin-top: 16px; display: grid; gap: 12px; justify-items: start; }
.pay-form .segmented { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 560px; }
/* phones: the three payment methods share the width (a 130px minimum made the form wider than the phone, 14 Nov 26) */
.pay-form .segmented label { min-width: 0; padding: 0 6px; text-align: center; line-height: 1.15; }
@media (max-width: 420px) { .pay-form .segmented label { font-size: 13px; gap: 4px; } }
.pay-form .segmented input:checked + label { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.pay-grid { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pay-grid .field { margin: 0; }
.pay-pending { display: grid; gap: 8px; margin-top: 14px; }.pay-pending-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--border-strong); }
.credit-apply { display: flex; gap: 6px; align-items: center; }
.credit-apply .input { width: 110px; height: 34px; }
tr.voided td { color: var(--muted); }
tr.voided td.num { text-decoration: line-through; }
.void-box { display: inline-block; text-align: left; }
.void-box > summary { list-style: none; }
.void-box > summary::-webkit-details-marker { display: none; }
.void-box[open] form { display: flex; gap: 6px; margin-top: 6px; min-width: 300px; }
.edit-lines .qty-input { width: 80px; text-align: right; }
.edit-lines .disc-input { width: 76px; text-align: right; }
.edit-lines tr.removed td { opacity: .45; }
.edit-lines tr.removed td .pname { text-decoration: line-through; }
.edit-lines .disc-changed { border-color: var(--warning, #d97706); }
.sku-results { border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; max-height: 320px; overflow-y: auto; }
.sku-results:empty { display: none; }
.sku-results button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.sku-results button:hover, .sku-results button:focus-visible { background: var(--surface-2, var(--bg)); }
.sku-results button[disabled] { cursor: default; opacity: .55; }
.edit-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.order-discount-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
@media (max-width: 1100px) { .edit-admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .pay-summary, .pay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* Marketing email */
.mk-layout { align-items: start; }
.mk-ai { margin-top: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px 14px; background: var(--surface-2); }
.mk-ai summary { cursor: pointer; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.mk-chips .chip { border: 0; cursor: pointer; }
.mk-checks { max-height: 170px; overflow: auto; display: grid; gap: 2px; font-size: 13px; }
.mk-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: #f3f5f9; }
.mk-progress { margin-top: 14px; }
.mk-bar { height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-bottom: 6px; }
.mk-bar span { display: block; height: 100%; background: var(--success); transition: width .3s; }
[data-kind-only][hidden] { display: none; }
[data-kind-not][hidden] { display: none; }
.mk-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; padding: 0; list-style: none; counter-reset: mk; font-size: 13px; color: var(--text-2); }
.mk-steps li { counter-increment: mk; display: flex; align-items: center; gap: 6px; }
.mk-steps li::before { content: counter(mk); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 11.5px; font-weight: 700; }
.mk-row { display: flex; gap: 8px; align-items: center; }
.mk-row .input { flex: 1; min-width: 0; }
.mk-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2); }
.mk-tools + .mk-body { border-top-left-radius: 0; border-top-right-radius: 0; }
.mk-body { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13.5px; line-height: 1.55; }
.mk-claude { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; font-weight: 650; }
.mk-help { margin-top: 8px; font-size: 13px; }
.mk-help summary { cursor: pointer; }
.mk-help ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.mk-ideas { display: grid; gap: 6px; margin-top: 8px; }
.mk-ideas[hidden] { display: none; }
.mk-ideas button { display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.mk-ideas button:hover { border-color: var(--primary); }
.mk-ideas span { font-size: 13px; color: var(--text-2); }
.mk-ideas small { font-size: 12px; color: var(--muted); }
.mk-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mk-pick { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 12.5px; max-width: 100%; }
.mk-pick img { width: 24px; height: 24px; object-fit: contain; border-radius: 50%; background: #fff; }
.mk-pick > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.mk-pick button { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.mk-found { display: grid; gap: 4px; max-height: 300px; overflow: auto; margin-top: 8px; }
.mk-prod { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.mk-prod:hover:not(:disabled) { border-color: var(--primary); }
.mk-prod:disabled { opacity: .6; cursor: default; }
.mk-prod small { display: block; color: var(--muted); font-size: 12px; }
.mk-prod-img { width: 40px; height: 40px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; }
.mk-prod-img img { max-width: 100%; max-height: 100%; }
.mk-prod-add { font-weight: 650; color: var(--primary); white-space: nowrap; }
.mk-skus-raw { margin: 8px 0 4px; font-size: 13px; }
.mk-skus-raw summary { cursor: pointer; }
.mk-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.mk-seg button { border: 0; background: none; padding: 4px 12px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.mk-seg button.on { background: var(--primary); color: #fff; }
.mk-frame-wrap { display: flex; justify-content: center; }
.mk-frame-wrap.phone .mk-frame { width: 390px; max-width: 100%; height: 720px; border-radius: 22px; border-width: 8px; border-color: #1b2433; }
.mk-check-out ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.mk-check-out li.fix { color: var(--danger); }
.mk-check-out .ok { margin: 10px 0 0; color: var(--success); font-weight: 650; }
.mk-review { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.mk-score { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12.5px; }
.mk-score.sgood { background: var(--success-soft, #e7f6ec); color: var(--success); }
.mk-score.sok { background: var(--warning-soft); color: var(--amber); }
.mk-score.slow { background: var(--danger-soft, #fde8e8); color: var(--danger); }
dialog.mk-pic { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.mk-pic::backdrop { background: rgba(10, 14, 22, .5); }
.mk-pic-body { padding: 20px; }
.mk-upload { cursor: pointer; }
.mk-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 240px; overflow: auto; margin-top: 6px; }
.mk-library button { aspect-ratio: 1; padding: 0; border: 2px solid var(--border); border-radius: 8px; background: var(--surface-2); overflow: hidden; cursor: pointer; }
.mk-library button.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.mk-library img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .mk-claude > span { width: 100%; } .mk-pick > span { max-width: 180px; } }
.mk-results { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; text-align: center; }
.mk-results > div { padding: 10px 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.mk-results .num { font-size: 20px; font-weight: 700; }
.mk-results .muted { font-size: 12px; }
.mk-pct { font-size: 12px; font-weight: 650; color: var(--text-2); }
@media (max-width: 640px) { .mk-results { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mk-later { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.mk-sched { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mk-sched > div { flex: 1; min-width: 220px; }
.mk-override { margin-top: 4px; font-size: 13px; }
.mk-approve { margin-bottom: 16px; border-color: var(--warning); }
.mk-approve-row { display: grid; gap: 12px; }
.mk-now { margin-top: 12px; font-size: 13px; }
.mk-now summary { cursor: pointer; }
.mk-plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mk-plan a { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; }
.mk-plan a:hover { border-color: var(--primary); }
.mk-plan li.urgent a { border-color: var(--danger); }
.mk-plan-when { font-weight: 650; font-size: 13px; }
@media (max-width: 640px) { .mk-plan a { grid-template-columns: 1fr auto; } .mk-plan-when { grid-column: 1 / -1; } }
.mail-notice { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mail-notice .grow { flex: 1; min-width: 240px; }
.mail-notice p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }

/* ---- visit start: what's happening at this visit ---- */
.intent-choice { display: grid; gap: 10px; margin-top: 18px; }
.intent-choice[hidden] { display: none; }
.intent-btn { display: flex; gap: 14px; align-items: center; width: 100%; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.intent-btn strong { display: block; font-size: 15.5px; }
.intent-btn:hover { border-color: var(--primary); }
.intent-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.intent-order { border-color: color-mix(in srgb, var(--success) 45%, var(--border-strong)); }
.next-visit-field .pill-row { display: flex; flex-wrap: wrap; margin-top: 8px; }
.next-visit-field .pill[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.next-visit-field .next-note-label { display: block; margin-top: 12px; }
.visit-reminders .vr-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--border); }
.visit-reminders .vr-row:first-child { border-top: 0; }
.visit-reminders .vr-when { flex: 0 0 auto; }
.visit-reminders .vr-note { flex: 1 1 auto; white-space: pre-wrap; }
.visit-reminders .vr-foot { font-size: 12.5px; margin: 6px 0 0; }
.no-order-form .outcome-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.no-order-form .outcome-pills input { position: absolute; opacity: 0; pointer-events: none; }
.no-order-form .outcome-pills label { padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.no-order-form .outcome-pills input:checked + label { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.no-order-form .outcome-pills input:focus-visible + label { box-shadow: var(--ring); }
.no-order-form fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.intent-btn .stat-icon { flex: none; }
.visit-start .segmented input:checked + label { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }

/* ---- quick tasks: views, people picker, shared tasks ---- */
.qt-views { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.qt-crumb { margin: 0 0 12px; font-size: 14px; }
.bg-sec { margin-top: 16px; }
.qt-sum { margin-bottom: 12px; }
.qt-downloads { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.ud-rates > summary { list-style: none; cursor: pointer; }
.ud-rates > summary::-webkit-details-marker { display: none; }
.ud-rates[open] > summary { margin-bottom: 12px; }
.stat-value.stat-link { font-size: 15px; }
.qt-crumb a { display: inline-flex; align-items: center; gap: 2px; }
.cell-sub.qt-inline { display: inline; }
.qt-people-field { border: 0; padding: 0; margin: 0 0 14px; }
.qt-people-search { margin-bottom: 8px; }
.qt-people { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.qt-person { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; }
.qt-person[hidden] { display: none; }
.qt-person:has(input:checked) { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); font-weight: 600; }
.qt-person input { width: 16px; height: 16px; accent-color: var(--primary); }
.task-meta .shared { display: inline-flex; align-items: center; gap: 4px; }
.list-card-me { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.qt-all-done { margin-top: 16px; padding: 12px 16px; border: 1px dashed var(--border-strong); border-radius: 12px; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qt-all-done a { color: var(--text-2); text-decoration: none; font-weight: 600; }
.qt-all-done a:hover { text-decoration: underline; }

/* ---- order types (apps/orders/kinds.py) ---- */
.order-kind { font-weight: 700; letter-spacing: .02em; }
.kind-sro { background: var(--info-soft); color: var(--info); }
.kind-dbo { background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }
.kind-dco { background: var(--success-soft); color: var(--success); }
.kind-mkt { background: var(--warning-soft); color: var(--warning); }

/* Categories: Parent › Child › Subchild tree (templates/products/categories.html) */
.cat-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cat-stat { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.cat-stat.warn { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-root { padding: 6px 10px 12px; }
.cat-tree .cat-tree { margin-left: 22px; border-left: 2px solid var(--border); padding-left: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 9px; }
.cat-row:hover { background: var(--surface-hover); }
.cat-toggle, .cat-toggle-space { flex: none; width: 26px; height: 26px; }
.cat-toggle { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; display: grid; place-items: center; padding: 0; }
.cat-toggle .icon { transition: transform .15s; }
.cat-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.cat-main { flex: 1; min-width: 0; }
.cat-name { font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.depth-1 > .cat-row .cat-name { font-size: 15px; }
.depth-3 > .cat-row .cat-name { font-weight: 500; }
.cat-node.is-off > .cat-row { opacity: .6; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; justify-content: flex-end; }
.cat-actions form { display: inline; }
.badge.layer-1 { background: var(--primary); color: #fff; border-color: transparent; }
.badge.layer-2 { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.layer-3 { background: var(--surface-2); color: var(--text-2); }
.form-actions { display: flex; gap: 8px; align-items: flex-end; }
@media (max-width: 700px) { .cat-row { flex-wrap: wrap; } .cat-actions { width: 100%; justify-content: flex-start; padding-left: 34px; } }


/* ---- customer account & statement (apps/customers/account.py) ---- */
.acct-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.acct-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.acct-form { display: grid; gap: 8px; align-content: start; }
.acct-form .btn { justify-self: start; }
.acct-statement tr.acct-carried td, .acct-statement tr.acct-closing td { background: var(--surface-2); }
.acct-statement tr.acct-opening td { font-weight: 600; }
.list-row.voided .title, .list-row.voided .sub { color: var(--muted); text-decoration: line-through; }
@media (max-width: 900px) { .acct-summary, .acct-actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .acct-summary, .acct-actions { grid-template-columns: 1fr; } }

/* ---- rebates and incentives by category (apps/commissions) ---- */
.rate-card tr.has-own td { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.rate-card tr.depth-1 td { border-top: 1px solid var(--border-strong); }
tr.row-unpaid td { background: color-mix(in srgb, var(--warning-soft) 45%, var(--surface)); }

/* ---- buying groups (apps/buyinggroups) ---- */
.bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: 1; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.bar > span.done { background: var(--success); }
.bg-targets { display: grid; gap: 14px; }
.bg-target-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13.5px; }
.bg-months { display: grid; gap: 8px; }
.bg-month { display: grid; grid-template-columns: 80px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.bg-month .num { text-align: right; }
.portal-shell { max-width: 1180px; margin: 0 auto; padding: 18px 20px 40px; }
.portal-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.portal-top .grow { flex: 1; }
.preview-banner { background: var(--warning-soft); color: var(--warning); padding: 8px 20px; font-size: 13px; font-weight: 600; }
.bg-item-row.awaiting td { background: color-mix(in srgb, var(--warning-soft) 45%, var(--surface)); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment-list li { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.comment-list li.from-group { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }

/* Products: list and form (templates/products/) */
.product-form { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.product-form .card { margin: 0; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.input-static { display: flex; align-items: center; background: var(--surface-2); font-family: ui-monospace, monospace; }
.product-thumb { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.section-label { font-size: 13px; font-weight: 700; margin: 4px 0 4px; }
.table-compact td, .table-compact th { padding-top: 6px; padding-bottom: 6px; }
.table-compact .input-xs { width: 84px; }
.select-xs { height: 30px; font-size: 12.5px; padding-top: 0; padding-bottom: 0; width: auto; }
.qp-deactivate { display: inline-flex; gap: 4px; align-items: center; }
.sticky-save { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); z-index: 2; }
.check-line { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; }
.form-grid textarea.input { height: auto; }
.image-picker { display: flex; gap: 16px; align-items: flex-start; }
.product-thumb-empty { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.margin-chips { display: flex; gap: 6px; align-items: center; min-height: 38px; }
.product-cell { display: flex; gap: 10px; align-items: center; }
.product-mini { width: 40px; height: 40px; flex: none; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.product-mini-empty { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.product-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.product-photo { margin: 0; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; background: #fff; }
.product-photo img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.product-photo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.product-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-stats .card { margin: 0; }
.product-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.product-details .card { margin: 0; }
.product-description { white-space: pre-line; font-size: 13.5px; color: var(--text); max-height: 260px; overflow: auto; }
.attention-list { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 900px) { .product-hero, .product-details { grid-template-columns: 1fr; } .product-photo { max-width: 260px; } }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.products-table td:first-child { min-width: 240px; }
.products-table td:nth-child(2) { max-width: 180px; }
.products-table .actions-cell { white-space: nowrap; }
.products-table .row-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.products-table .cat-leaf { display: block; font-size: 13px; font-weight: 500; }

/* ---------- freight auto-booking (Request tab) ---------- */
.freight-settings { border-bottom: 1px solid var(--border); padding: 12px 16px; }
.freight-settings summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; }
.freight-settings-body { padding-top: 12px; }
.freight-settings .badge, .freight-panel .badge { white-space: nowrap; }
.freight-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.freight-form .field { margin: 0; width: 190px; }
.freight-form .check { display: flex; gap: 8px; align-items: center; width: 100%; font-weight: 600; }
.freight-panel { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; background: var(--surface-2); }
.freight-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.freight-figures .k { display: block; font-size: 12px; color: var(--muted); }
.freight-figures .v { font-weight: 700; font-size: 16px; }
.freight-msg { margin: 10px 0 4px; font-weight: 600; color: var(--warning); }
.freight-msg.is-ok { color: var(--success); }

/* ---------- data review (go-live) ---------- */
.review-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.review-card { padding: 16px 18px; }
.review-card-head { display: flex; align-items: baseline; justify-content: space-between; }
.review-card-head h2 { margin: 0; font-size: 17px; }
.review-pct { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.review-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); margin: 10px 0 12px; }
.review-bar .s3 { background: var(--success); } .review-bar .s2 { background: var(--info); } .review-bar .s1 { background: var(--warning); }
.review-stages { display: grid; gap: 6px; }
.review-stages a { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.review-stages a strong { margin-left: auto; }
.review-stages .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.review-stages .dot.s1 { background: var(--warning); } .review-stages .dot.s2 { background: var(--info); } .review-stages .dot.s3 { background: var(--success); }
.status.review-s1 { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.status.review-s2 { background: var(--info-soft); color: var(--info); border-color: transparent; }
.status.review-s3 { background: var(--success-soft); color: var(--success); border-color: transparent; }
.review-note { color: var(--warning); }
.review-checks { min-width: 220px; }
.review-checks .badge { white-space: nowrap; margin: 0 2px 4px 0; }
.review-bulk { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.review-bulk .check { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; }

/* ---- freight overview, flow and costs (apps/freight) ---- */
.fr-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.fr-flow { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding: 12px; }
.fr-stage { flex: 1 0 118px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface); }
.fr-stage:hover { border-color: var(--primary); }
.fr-stage-on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.fr-stage-warn { background: color-mix(in srgb, var(--warning-soft) 55%, var(--surface)); }
.fr-stage-n { font-size: 22px; font-weight: 750; }
.fr-stage-label { font-weight: 650; font-size: 13px; }
.fr-arrow { align-self: center; color: var(--muted); font-size: 20px; }
.fr-share { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.fr-share > span { display: block; height: 100%; background: var(--primary); }
.fr-month { grid-template-columns: 80px 1fr 90px 50px; }
@media (max-width: 1000px) { .fr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Customer emails tab: tick-box columns */
.table th.c, .table td.c { text-align: center; }
.table tr.row-new td { background: var(--surface-2); }

/* Freight → Courier keys */
.keys-card { margin-bottom: 16px; scroll-margin-top: 80px; }
.keys-card .card-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 16px; margin-bottom: 12px; }

/* customer statement (Xero layout) */
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.xst-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.xst-tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.xst-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--text-2); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.xst-tab:hover { color: var(--text); }
.xst-tab.active { color: var(--text); border-bottom-color: var(--primary); }
.xst-menu { position: relative; }
.xst-menu summary { list-style: none; }
.xst-menu summary::-webkit-details-marker { display: none; }
.xst-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.18)); padding: 4px; }
.xst-menu-list a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.xst-menu-list a:hover { background: var(--surface-hover); }
.xst-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.xst-range .field { margin-bottom: 0; }
.xst-range .label { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.xst-source { font-size: 12.5px; margin: 8px 0 0; }
.xst-title { font-size: 15px; margin: 22px 0 10px; }
.xst-title span { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 6px; }
.xst-table th { text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.xst-table td.muted { color: var(--muted); }
.xst-table td.num, .xst-table th { white-space: nowrap; }
.xst-total td { background: var(--surface-2); }
.xst-alloc td { font-size: 13px; padding-top: 2px; padding-bottom: 6px; border-top: 0; }
.xst-foot { font-size: 12px; font-style: italic; margin: 6px 0 0; }
@media (max-width: 640px) { .xst-head .spacer { display: none; } .xst-range .field, .xst-range .btn { flex: 1 1 100%; } .xst-range .input, .xst-range .select { width: 100%; } }
.xst-monthly { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; font-size: 13px; }
.xst-monthly .grow { flex: 1; }
.xst-monthly.on { border-color: var(--success); background: var(--success-soft); }

/* Dashboard: fixed tasks & alerts band, then each person's widgets (apps/dashboard/widgets.py) */
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-top { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 3fr); gap: 20px; margin-bottom: 20px; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.widget-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; grid-auto-flow: row dense; }
.widget-grid > .w-sm { grid-column: span 1; }
/* "My contact QR code" widget (apps/signatures/card.py) */
.qr-card { text-align: center; padding: 14px 16px; }
.qr-card .qr-code svg { width: 150px; height: 150px; border-radius: 8px; margin: 8px auto 6px; display: block; }
.qr-card .qr-name { font-weight: 700; }
.widget-grid > .w-md { grid-column: span 2; }
.widget-picker { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.widget-picker li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }
.widget-picker label { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.widget-picker label input { margin-top: 3px; }
.widget-picker label span { display: flex; flex-direction: column; min-width: 0; }
.widget-picker small { color: var(--text-2); font-size: 12.5px; }
.widget-picker .move { display: flex; gap: 2px; }
@media (max-width: 1199px) { .dash-top { grid-template-columns: 1fr; } .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 719px) { .widget-grid { grid-template-columns: 1fr; } .widget-grid > .w-md, .widget-grid > .w-sm { grid-column: auto; } }

/* Files (apps/files) */
.fx-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.fx-side { position: sticky; top: 12px; display: grid; gap: 12px; background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 10px; }
.fx-nav { display: grid; gap: 2px; }
.fx-nav a { display: flex; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 7px; color: inherit; text-decoration: none; font-size: 14px; }
.fx-nav a:hover { background: var(--surface-2, #f3f4f6); }
.fx-nav a.active { background: var(--primary-soft, #e8f1fb); font-weight: 600; }
.fx-store { display: grid; gap: 4px; font-size: 12.5px; color: var(--text-2, #6b7280); }
.fx-store-row { display: flex; justify-content: space-between; gap: 8px; }
.fx-bar { height: 6px; border-radius: 4px; background: var(--surface-2, #eef0f3); overflow: hidden; margin-bottom: 6px; }
.fx-bar span { display: block; height: 100%; background: var(--primary, #1f6feb); }
.fx-search { display: flex; gap: 6px; }
.fx-search .input { min-width: 0; }
.fx-main { min-width: 0; }
.fx-main .table-wrap { position: relative; } /* keeps hidden screen-reader labels inside the scroll box on phones */
.fx-crumbs { font-size: 13px; color: var(--text-2, #6b7280); margin-bottom: 6px; overflow-wrap: anywhere; }
.fx-crumbs a { color: inherit; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.fx-tile { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; color: inherit; text-decoration: none; min-width: 0; }
.fx-tile:hover { border-color: var(--primary, #1f6feb); background: var(--surface-2, #f8fafc); }
.fx-tile-icon { color: var(--primary, #1f6feb); }
.fx-tile-name { font-weight: 600; overflow-wrap: anywhere; }
.fx-tile-sub { font-size: 12.5px; color: var(--text-2, #6b7280); }
.fx-access-note { white-space: normal; min-width: 200px; max-width: 320px; }
.fx-tile-wrap { position: relative; min-width: 0; display: grid; }
.fx-tile-wrap > .fx-access { position: absolute; top: 6px; right: 6px; }
.fx-tile-wrap > .fx-access > summary { padding: 4px 6px; list-style: none; }
.fx-tile-wrap > .fx-access > summary::-webkit-details-marker { display: none; }
.fx-tile-wrap > .fx-access .fx-pop-body { right: 0; left: auto; min-width: 240px; z-index: 20; }
.fx-tile-wrap > .fx-access .tick { display: flex; gap: 6px; align-items: center; margin: 3px 0; font-size: 13px; }
.fx-pop { position: relative; }
.fx-pop > summary { list-style: none; cursor: pointer; }
.fx-pop > summary::-webkit-details-marker { display: none; }
.fx-pop-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, 86vw); background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.fx-drop.over { outline: 2px dashed var(--primary, #1f6feb); outline-offset: -4px; }
.fx-drop input[type=file] { max-width: 100%; }
.fx-preview { padding: 10px; text-align: center; }
.fx-preview img, .fx-preview video { max-width: 100%; max-height: 70vh; border-radius: 6px; }
.fx-preview iframe { width: 100%; height: 75vh; border: 0; }
.fx-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 8px; }
@media (max-width: 899px) { .fx-layout { grid-template-columns: 1fr; } .fx-side { position: static; } }
.fx-token { font-family: ui-monospace, Consolas, monospace; font-size: 15px; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.fx-steps ol { padding-left: 20px; margin-top: 0; display: grid; gap: 8px; }

/* Dashboard search box (apps/dashboard/search.py): small, results drop down as you type */
.dash-search { position: relative; flex: 1 1 260px; max-width: 360px; margin: 0; }
.dash-search .input { width: 100%; padding-left: 32px; height: 36px; }
.dash-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.dash-search-box { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; min-width: 300px; max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px 0; }
.dash-search-box .ds-group { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dash-search-box a, .dash-search-box .ds-item { display: block; padding: 6px 12px; color: inherit; text-decoration: none; font-size: 13.5px; }
.dash-search-box a:hover, .dash-search-box a.active { background: var(--surface-2, #eef1f4); }
.dash-search-box small { display: block; color: var(--muted); font-size: 12px; }
.dash-search-box .ds-more { border-top: 1px solid var(--border); margin-top: 4px; font-weight: 600; }
@media (max-width: 640px) { .dash-search { max-width: none; flex-basis: 100%; } }
.top-search { flex: 0 1 340px; margin: 0 12px; }
.top-search .dash-search-box { min-width: 340px; }
.top-search-icon { display: none; }
@media (max-width: 719px) { .top-search { display: none; } .top-search-icon { display: inline-flex; } }

/* ---- order page views, freight, documents, take payment (9 Nov 26) ---- */
.view-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; grid-template-columns: none; }
.view-switch a { padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.view-switch a.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.order-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.order-strip a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; text-decoration: none; }
.order-strip a:hover { border-color: var(--primary); }
.order-strip strong { font-size: 17px; }
.order-boxes { align-items: start; }
.freight-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.freight-figs > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.freight-edit > summary { list-style: none; display: inline-flex; }
.freight-edit > summary::-webkit-details-marker { display: none; }
.freight-form { display: grid; gap: 10px; margin-top: 10px; justify-items: start; }
.freight-form .segmented { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.freight-form .segmented label { height: 40px; font-size: 13px; text-align: center; padding: 0 6px; }
.freight-form .segmented input:checked + label { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.freight-form .pay-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-list .list-row { flex-wrap: wrap; gap: 8px; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.collect-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--border-strong); border-radius: 6px; font: 600 12px/1.6 ui-monospace, monospace; text-align: center; }
/* Sales rep and warehouse views: big touch targets for the iPad */
.view-rep .btn, .view-warehouse .btn { min-height: 48px; padding-left: 18px; padding-right: 18px; font-size: 15px; }
.view-rep .btn-sm, .view-warehouse .btn-sm { min-height: 44px; }
.view-rep .table td, .view-warehouse .table td { padding-top: 14px; padding-bottom: 14px; font-size: 15px; }
.view-rep .table td.num, .view-warehouse .table td.num { font-size: 18px; font-weight: 700; }
.view-rep .view-switch a, .view-warehouse .view-switch a { padding: 10px 18px; font-size: 14px; }
@media (max-width: 760px) {
  .collect-grid, .freight-form .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .freight-form .segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ship-choice { display: grid; gap: 8px; }
.ship-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.ship-opt:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.ship-opt input { margin-top: 3px; }

/* Side menu a little bigger on desktop screens (owner, 9 Nov 26: "side menu text font little bigger on windows desktop") */
@media (min-width: 1024px) and (hover: hover) {
  .nav-link { font-size: 15.5px; padding: 9px 12px; }
  .nav-label, .nav-group > summary.nav-label { font-size: 12.5px; }
  .nav-link .icon { width: 19px; height: 19px; }
}

/* product pictures & video (templates/products/view.html, 9 Nov 26) */
.product-photo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.product-photo-card .product-photo { border: 0; border-radius: 0; box-shadow: none; }
.product-photo-card .product-photo { position: relative; }
/* pin the link to the square box: Safari/iPad would not size height:100% from aspect-ratio, so tall pictures got cut off */
.product-photo-card .product-photo a { position: absolute; inset: 0; display: block; }
@media (max-width: 900px) {
  /* one column (tablet/phone): the white photo area fills the card width (no empty dark space beside it); picture centred */
  .product-photo-card .product-photo { width: 100%; max-width: none; aspect-ratio: auto; height: min(420px, 90vw); }
  .product-photo-card .pg-strip { justify-content: center; }
}
.pg-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.pg-thumb { flex: 0 0 48px; height: 48px; padding: 2px; border: 2px solid transparent; border-radius: 8px; background: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-2); font-size: 10.5px; text-decoration: none; }
.pg-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pg-thumb.is-on { border-color: var(--primary); }
.pg-video { background: var(--surface-2); border-color: var(--border); }
.pg-grid { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pg-item { position: relative; border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.pg-item > a { display: block; aspect-ratio: 1; }
.pg-item img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pg-badge { position: absolute; top: 6px; left: 6px; }
.pg-actions { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 4px; border-top: 1px solid var(--border); background: var(--surface); }
.pg-actions form:only-child { margin-left: auto; }
.pg-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pg-link { display: flex; gap: 6px; flex: 1 1 280px; min-width: 0; }
.pg-link .input { flex: 1 1 auto; min-width: 0; }
.pg-video-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pg-player { position: relative; width: 100%; max-width: 560px; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; }
.pg-player iframe, .pg-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Tiles in a .stat-grid (Fleet, Expenses, Attendance, rep scorecard): a grid of small cards. The rule had only existed
   in the customer shop's stylesheet, so these admin pages showed the tiles as a column of underlined links (9 Nov 26). */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-grid > .stat:not(.card) { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.stat-grid > a.stat:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.stat-grid > .stat .stat-value { font-size: 28px; }

/* Dashboard chart widgets (apps/dashboard/charts.py, 9 Nov 26) */
.widget-grid > .w-lg { grid-column: 1 / -1; }
.dc-card .card-body { padding-top: 4px; }
.dc-note { font-size: 12px; margin: 8px 0 0; }
@media (max-width: 719px) { .widget-grid > .w-lg { grid-column: auto; } }

/* Customer overview widget: Super Admins and Admins (apps/dashboard/customer_overview.py, 14 Nov 26) */
.co-card .card-head { display: flex; align-items: center; gap: 10px; }
.co-card .co-open { margin-left: auto; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.co-fig { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: inherit; text-decoration: none; min-width: 0; }
.co-num { font-size: 20px; font-weight: 600; }
.co-lbl { font-size: 12px; color: var(--muted); }
.co-warn .co-num { color: var(--rose, #e11d48); }
a.co-link:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.co-seg { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); border-left-width: 4px; }
.co-seg + .co-seg { margin-top: 14px; }
.co-seg.is-b2b { border-left-color: var(--violet); background: color-mix(in srgb, var(--violet) 5%, transparent); }
.co-seg.is-retail { border-left-color: var(--sky); background: color-mix(in srgb, var(--sky) 5%, transparent); }
.co-seg.is-b2b .co-seg-title .badge { background: var(--violet); color: #fff; border-color: transparent; }
.co-seg.is-retail .co-seg-title .badge { background: var(--sky); color: #fff; border-color: transparent; }
.co-seg-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.co-states { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; font-size: 13px; }

/* Jordan's nudge for overdue approvals on the dashboard (apps/approvals, 9 Nov 26) */
.dash-jordan-nudge { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-lg);
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); text-decoration: none; }
.dash-jordan-nudge img { border-radius: 50%; flex: 0 0 auto; }
.dash-jordan-nudge:hover { border-color: var(--danger); }
.dash-nudge-item { display: inline-block; margin: 2px 8px 0 0; font-size: 12.5px; color: var(--text-2); }
.dash-nudge-item::before { content: "• "; color: var(--danger); }

/* Dashboard top band, redesigned 9 Nov 26: "my" numbers in one row, then work queues that link to their pages */
.dash-top2 { display: grid; gap: 16px; margin-bottom: 20px; }
.dash-mine { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mine-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); color: inherit; text-decoration: none; min-width: 0; }
.mine-tile:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.mine-tile .stat-icon { grid-row: 1 / 3; width: 38px; height: 38px; }
.mine-n { font-size: 24px; font-weight: 800; line-height: 1.1; }
.mine-k { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-tile.is-late { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.mine-tile.is-late .mine-n, .mine-tile .mine-k b { color: var(--danger); }
.wq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 22px; }
.wq-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wq-group .queue-head { margin-bottom: 4px; }
.wq-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px;
  border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.wq-row:hover { background: var(--surface-hover); color: var(--text); }
/* 5 tiles: 3 on top + 2 wider below on tablets, 2 a row with the last full width on phones, so no empty gap */
@media (max-width: 1100px) { .dash-mine { grid-template-columns: repeat(6, minmax(0, 1fr)); } .dash-mine > .mine-tile { grid-column: span 2; }
  .dash-mine > .mine-tile:nth-child(n+4) { grid-column: span 3; } }
@media (max-width: 640px) { .dash-mine { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-mine > .mine-tile,
  .dash-mine > .mine-tile:nth-child(n+4) { grid-column: auto; } .dash-mine > .mine-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .mine-k { white-space: normal; } }
.fx-access-grid th.c, .fx-access-grid td.c { text-align: center; }
.fx-access-grid th { font-size: 12px; vertical-align: bottom; }

/* ---------- Computer activity (staff work tracker): one calm look for the whole section ---------- */
.cw-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cw-row .input, .cw-row .select { width: auto; }
.cw-stack { display: flex; flex-direction: column; gap: 16px; }
.cw-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cw-head-actions .input { height: 32px; }

/* lists: padded rows with dividers */
.cw-list { list-style: none; margin: 0; padding: 0; }
.cw-list > li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.cw-list > li:first-child { border-top: 0; padding-top: 0; }
.cw-list > li:last-child { padding-bottom: 0; }
.cw-list .grow { flex: 1; min-width: 0; }
.cw-list .title { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cw-list .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-list .sub.wrap { white-space: normal; }
.cw-list .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cw-scroll { max-height: 420px; overflow-y: auto; }

/* small neutral tags; colour only where it means something */
.cw-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.cw-tag.bad { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.cw-tag.ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.cw-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); display: inline-block; }
.cw-dot.active { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.cw-dot.idle { background: var(--warning); }
.cw-dot.bad { background: var(--danger); }

/* numbers */
.cw-time { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cw-num { font-variant-numeric: tabular-nums; }
.cw-low { color: var(--danger); }
.cw-meter { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cw-meter .track { width: 64px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; flex: none; }
.cw-meter .fill { display: block; height: 100%; background: var(--text-2); border-radius: inherit; }
.cw-meter.low .fill { background: var(--danger); }

/* stat cards */
.cw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cw-stat { padding: 16px 18px; }
.cw-stat .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cw-stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-top: 6px; font-variant-numeric: tabular-nums; }
.cw-stat .foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* live cards */
.cw-live { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cw-card { display: block; text-decoration: none; color: inherit; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.cw-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.cw-shot { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border); }
.cw-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-shot .empty-note { font-size: 12px; color: var(--muted); }
.cw-over { position: absolute; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600;
  background: rgba(15, 23, 42, .72); color: #fff; }
.cw-over.tl { left: 8px; bottom: 8px; }
.cw-over.tr { right: 8px; top: 8px; }
.cw-over.bad { background: var(--danger); }
.cw-card-body { padding: 12px 14px 14px; }
.cw-card-name { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.cw-card-name .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-card-name .flags { margin-left: auto; display: flex; gap: 4px; }
.cw-doing { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-doing .not { color: var(--danger); }
.cw-card-foot { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.cw-card-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }
.cw-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; align-items: center; }
.cw-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* setting rows */
.cw-setting { display: flex; gap: 16px; align-items: center; }
.cw-setting .grow { flex: 1; min-width: 0; }
.cw-setting .desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.cw-note { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 12px 0 0; }
.cw-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--danger); background: var(--danger-soft); color: var(--text); }
.cw-banner .grow { flex: 1; min-width: 200px; }

/* apps rows on a person's page */
.cw-marks { display: flex; gap: 4px; flex-wrap: nowrap; justify-content: flex-end; min-width: 168px; }
.cw-danger { color: var(--danger); }

/* hour chart */
.cw-hours { display: flex; align-items: flex-end; gap: 3px; height: 120px; min-width: 560px; }
.cw-hours .h { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; border-radius: 3px; overflow: hidden; }
.cw-hours .work { background: var(--success); }
.cw-hours .other { background: color-mix(in srgb, var(--text-2) 45%, transparent); }
.cw-hours .idle { background: var(--surface-2); border-top: 1px solid var(--border); }
.cw-hour-labels { display: flex; gap: 3px; min-width: 560px; font-size: 10px; color: var(--muted); margin-top: 4px; }
.cw-hour-labels div { flex: 1; text-align: center; }
.cw-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* screenshots */
.cw-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cw-shots a { display: block; color: inherit; text-decoration: none; }
.cw-shots img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.cw-shots .t { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }
.cw-shots.one { grid-template-columns: minmax(0, 420px); }

/* My computer: install steps */
.cw-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.cw-steps > li { counter-increment: s; position: relative; padding: 0 0 14px 40px; line-height: 1.55; }
.cw-steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.cw-steps ul { margin: 4px 0 0; padding-left: 18px; }
.cw-safe { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 18px; font-size: 13.5px; line-height: 1.55; }
.cw-safe .icon { color: var(--success); flex: none; margin-top: 2px; }
.cw-details { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.cw-details summary { cursor: pointer; font-weight: 600; }
.cw-details ul { padding-left: 18px; line-height: 1.7; margin: 8px 0 0; }

.cw-off { position: relative; }
.cw-off > summary { list-style: none; }
.cw-off > summary::-webkit-details-marker { display: none; }
.cw-off[open] > form { position: absolute; right: 0; top: 100%; z-index: 5; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); flex-wrap: nowrap; }

@media (max-width: 1099px) { .cw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cw-stats { gap: 10px; }
  .cw-stat { padding: 12px 14px; }
  .cw-stat .value { font-size: 21px; }
  .cw-list > li { flex-wrap: wrap; }
  .cw-marks { min-width: 0; }
  .cw-setting { flex-wrap: wrap; }
  .cw-live { grid-template-columns: 1fr; }
}

/* Super Admin Test mode switch (apps/accounts/role_views.test_mode) */
.test-mode-form { margin: 0 6px 0 0; }
.test-mode-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--muted, #6b7280);
  border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.test-mode-btn.on { background: #f59e0b; border-color: #d97706; color: #111; font-weight: 700; }
.test-mode-bar { background: #fef3c7; color: #78350f; border-bottom: 1px solid #f59e0b; padding: 8px 16px; font-size: 13px; }

/* world clock in the top bar (Australia, India, China) */
.world-clock { gap: 8px; }
.world-clock > span { white-space: nowrap; }
.world-clock b { font-size: 10.5px; font-weight: 700; color: var(--muted, #8a93a3); letter-spacing: .04em; }

/* Order screen on iPad and phones (owner, 12 Nov 26: the sideways scroller is hard to use on iPad).
   Touch screens get no sideways scrolling: suggestions wrap into a grid (first 6, then "Show all"),
   categories wrap onto more lines, and buttons are finger-sized. Desktop with a mouse keeps the rows. */
.suggest-more { display: none; }
.cat-pick { display: none; }
@media (hover: none), (pointer: coarse), (max-width: 1023px) {
  .suggest-group:not(.open) .suggest-card:nth-child(n+7) { display: none; }
  .suggest-more { display: inline-flex; align-self: flex-start; margin-top: 6px; min-height: 44px; }
  .suggest-card .btn { min-height: 44px; }
  .pill-row.cat-row { flex-wrap: wrap; overflow: visible; }
  .pill-row .pill { min-height: 40px; }
}
@media (max-width: 640px) {
  /* phone: picture | name + SKU + why | price + Add */
  .suggest-card { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "img main add" "img why add"; row-gap: 2px; padding: 6px 8px; }
  .suggest-img { grid-area: img; } .suggest-main { grid-area: main; } .suggest-why { grid-area: why; } .suggest-card .btn { grid-area: add; }
  .suggest-price { display: none; }
  .suggest-price-sm { display: inline; }
}

/* ================= Order screen: one page, three layouts (owner, 12 Nov 26) =================
   Windows / desktop (wide screen with a mouse): the order sits in a panel on the right, keyboard keys work.
   iPad (touch, or a narrower window): menu tucked behind the menu button, compact customer figures, product tiles,
   big quantity buttons, and the order slides in from the right ("View order").
   Phone: one column, the order opens full screen. No sideways scrolling anywhere on touch. */
.order-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .2s ease; }
.order-panel.open { transform: none; }
.op-scrim { display: none; }
.op-scrim.open { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 14, 22, .45); }
html:has(.order-panel.open), body:has(.order-panel.open) { overflow: hidden; }
.op-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.op-head strong { font-size: 16px; }
.op-lines { flex: 1; overflow-y: auto; padding: 6px 16px; -webkit-overflow-scrolling: touch; }
.op-line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.op-line .op-name { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.op-line .qty { grid-column: 2; justify-self: start; }
.op-line .op-amt { grid-column: 3; grid-row: 1 / span 2; text-align: right; font-weight: 650; white-space: nowrap; }
.op-line.op-back .op-name::after { content: " · back order"; color: var(--warning); font-weight: 500; font-size: 12px; }
/* out-of-stock lines: a back order, not in the order total (owner, 22 Nov 26) */
.back-head { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 4px; padding: 8px 10px; border-radius: 8px;
  background: var(--warning-soft); color: var(--warning); font-size: 13px; }
.back-head span { color: var(--text-2); }
.op-line.op-back .op-amt s, .preview-line.is-back s, .cart-lines .is-back s { color: var(--text-3, var(--text-2)); font-weight: 400; }
.preview-line.is-back { opacity: .85; }
.backorder-note { font-size: 12.5px; margin: 10px 0 0; }
.op-foot { border-top: 1px solid var(--border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.op-total { display: flex; justify-content: space-between; align-items: baseline; }
/* order summary (products, units, categories) and discount notes for audit (owner, 23 Nov 26) */
.order-sum { border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.order-sum summary { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 10px; cursor: pointer; color: var(--text-2); }
.order-sum summary strong { color: var(--text); }
.order-sum-cats { list-style: none; margin: 0; padding: 0 10px 6px; max-height: 180px; overflow: auto; }
.order-sum-cats li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 4px 0;
  border-top: 1px solid var(--border); }
.order-sum-cats li span:first-child { overflow-wrap: anywhere; }
.order-sum-disc { display: flex; justify-content: space-between; padding: 6px 10px 8px; border-top: 1px solid var(--border); }
#preview-summary .order-sum, .builder-sum .order-sum { margin: 10px 0 0; }
.disc-note { color: var(--green, #15803d); font-weight: 500; }
.disc-note.is-none { color: var(--text-2); font-weight: 400; }
.cart-lines .nm .disc-note { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.op-total strong { font-size: 20px; }
.op-keys { display: none; margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.op-keys kbd { font: 600 11px/1 ui-monospace, Consolas, monospace; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 4px; background: var(--surface-2); }
.visit-bar-btns { display: flex; gap: 8px; }

/* Windows / desktop: order docked on the right, always visible */
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  body:has(.order-panel) .main { padding-right: 340px; }
  .order-panel { top: var(--topbar-h); width: 340px; transform: none; box-shadow: none; z-index: 20; }
  .op-close, .op-scrim, .op-scrim.open { display: none; }
  html:has(.order-panel.open), body:has(.order-panel.open) { overflow: auto; }
  .op-keys { display: block; }
  .visit-bar { display: none; }
}

/* iPad and other touch screens: the menu tucks away behind the menu button */
@media (pointer: coarse) and (max-width: 1400px) {
  body:has(.order-panel) .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body:has(.order-panel) .shell.nav-open .sidebar { transform: none; }
  body:has(.order-panel) .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 14, 22, .45); }
  body:has(.order-panel) .main { margin-left: 0; }
  body:has(.order-panel) .topbar .menu-toggle { display: inline-flex; }
}
/* touch screens and narrower windows: compact customer figures, finger-sized buttons */
@media (pointer: coarse), (max-width: 1199px) {
  .visit-snapshot { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .visit-snapshot .snap { padding: 8px 10px; gap: 2px; }
  .visit-snapshot .snap-value { font-size: 17px; }
  .visit-snapshot .snap-value-sm { font-size: 14px; }
  .visit-snapshot .snap .cell-sub { display: none; }
  .qty button { width: 48px; height: 46px; }
  .qty input { width: 64px; height: 46px; font-size: 17px; }
  .visit-bar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .visit-bar .btn { min-height: 46px; }
  #cat-search, #cat-pick { min-height: 46px; font-size: 16px; } /* 16px: iPad / iPhone Safari doesn't zoom in */
  .pill-row.cat-row { display: none; }  /* touch: one Category picker instead of 25 buttons */
  .cat-pick { display: block; }
}
/* Products as tiles: only when the rep picks Tiles (List is the default, 19 Nov 26; static/css/order_list.css) */
.visit-catalogue.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.visit-catalogue.tiles .product-row { margin: 0; grid-template-columns: 56px minmax(0, 1fr); align-content: start; }
.visit-catalogue.tiles .product-row .thumb { width: 56px; height: 56px; }
.visit-catalogue.tiles .product-row .pprice { grid-column: 1 / -1; text-align: left; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.visit-catalogue.tiles .product-row .pprice strong { display: inline; font-size: 17px; }
.visit-catalogue.tiles .product-row .qty { grid-column: 1 / -1; display: flex; width: 100%; }
.visit-catalogue.tiles .product-row .qty input { flex: 1; }
/* Phone: one column, the order opens full screen */
@media (max-width: 640px) {
  .visit-snapshot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-panel { width: 100vw; border-left: 0; }
  .visit-bar-btns .btn { padding: 0 12px; }
  .product-row .qty { display: flex; width: 100%; }
  .product-row .qty input { flex: 1; }
}
@media (max-width: 640px) { .visit-bar .hide-phone { display: none; } }
/* order screen: Scan button beside the product search (owner, 13 Nov 26) */
.cat-search-row { display: flex; gap: 8px; align-items: center; }
/* the visit order screen's search: first in Products and pinned under the top bar while the list scrolls */
.cat-search-pin { position: sticky; top: var(--topbar-h); z-index: 6; background: var(--surface); padding: 12px 20px 10px;
  border-bottom: 1px solid var(--border); }
.cat-search-pin .input { height: 44px; font-size: 16px; }
#order-section { scroll-margin-top: var(--topbar-h); }
.cat-search-row .input { flex: 1; min-width: 0; }
.cat-search-row .cat-scan { flex: none; }
@media (min-width: 1200px) and (hover: hover) and (pointer: fine) { .cat-search-row .cat-scan { display: none; } }

/* dashboard clock in the page header (owner, 13 Nov 26: "Move Clock bigger and better design") */
.dash-clock { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 auto; }
.dc-zone { min-width: 132px; padding: 10px 16px 9px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.dc-main { min-width: 176px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary, #4f46e5) 9%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--primary, #4f46e5) 25%, var(--border)); }
.dc-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted, #8a93a3); }
.dc-label b { font-size: 10.5px; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2, #f1f5f9); color: var(--text-2); }
.dc-time { margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.dc-main .dc-time { font-size: 32px; color: var(--primary, #4f46e5); }
.dc-time small { font-size: .5em; font-weight: 600; color: var(--muted, #8a93a3); }
.dc-time .dc-ap { margin-left: 4px; }
.dc-day { font-size: 12px; color: var(--muted, #8a93a3); }
.dc-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-left: auto; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dc-closed .dc-dot { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, .18); }
.page-head:has(.dash-clock) { align-items: center; }
@media (max-width: 760px) {
  .dash-clock { width: 100%; gap: 8px; flex-wrap: nowrap; }
  .dc-zone, .dc-main { min-width: 0; flex: 1; padding: 8px 10px; }
  .dc-time, .dc-main .dc-time { font-size: 19px; }
  .dc-time .dc-sec { display: none; }
}

/* customer sign-in with a one-time code (templates/shop/code.html) */
.code-title { margin: 12px 0 4px; }
.code-lead { margin: 0 0 16px; }
.code-digits { font-size: 22px; letter-spacing: 6px; text-align: center; }
.code-buttons { display: grid; gap: 8px; }
.code-buttons .btn { width: 100%; }
.code-small { margin: 8px 0 0; font-size: 13px; }
.code-note { margin-top: 14px; font-size: 13px; }
.code-back { margin-top: 12px; }

/* A whole card that is a link (Dashboard "AI spend" box) */
a.card-link { text-decoration: none; color: inherit; }
a.card-link:hover { border-color: var(--border-strong); }

/* Warehouse load (apps/picking/load.py): Normal / Medium / Busy */
.workload.load-normal { background: #008000; }
.workload.load-medium { background: #c98f00; }
.workload.load-busy { background: #cc0000; }
.workload-line { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.stat-value.load-normal { color: #008000; }
.stat-value.load-medium { color: #c98f00; }
.stat-value.load-busy { color: #cc0000; }
/* Info tips (static/js/app.js, apps/core/glossary.py) */
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 5px;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface, #fff); color: var(--muted);
  font: italic 700 11px/1 Georgia, serif; cursor: pointer; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.info-tip:hover, .info-tip:focus-visible { color: var(--primary, #e11d48); border-color: currentColor; outline: none; }
.info-pop { position: absolute; z-index: 1000; padding: 10px 12px; border-radius: 10px; background: #111827; color: #fff;
  font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }

/* One login window (static/js/app.js IPL.steps, owner 14 Nov 26): "Step 2 of 4" and dots on top of each step */
.ls-bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--surface-2, #f5f7fa);
  border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--muted, #667085); }
.ls-count { font-weight: 600; color: var(--text, #141a22); white-space: nowrap; }
.ls-dots { display: flex; gap: 5px; }
.ls-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border, #d0d5dd); }
.ls-dot.is-done { background: var(--success, #12a150); }
.ls-dot.is-on { background: var(--primary, #e8285c); width: 20px; border-radius: 4px; }
.ls-label { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-step { max-width: 520px; width: calc(100vw - 24px); }
.ls-step.rn-step .rn-foot { display: flex; gap: 8px; margin-top: 12px; }
html.ls-running dialog[open]::backdrop { transition: none; }

/* Data migration -> Orders: Neto vs ERP (templates/maropost/order_compare.html, 14 Nov 26) */
.oc-note { margin: 0 0 12px; }
.oc-tiles { margin-bottom: 16px; }
.oc-card { margin-bottom: 16px; }
.oc-filters { padding: 0 16px 12px; flex-wrap: wrap; }
.oc-ok { color: var(--success); }
.oc-more { padding: 0 16px 12px; }

/* Downloads & report log (templates/accounts/downloads_*.html, 14 Nov 26) */
.dl-card { margin-bottom: 16px; }
.dl-actions { justify-content: flex-end; gap: 6px; }
.dl-actions form { display: inline; }
.dl-filters { padding: 0 16px 12px; flex-wrap: wrap; }
.dl-more { padding: 0 16px 12px; }
.dl-switch { padding: 12px 16px; flex-wrap: wrap; }
.dl-rows { width: 110px; }
.load-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.load-days li { display: grid; gap: 4px; }
.load-days .workload { margin-left: 0; justify-self: start; }
.load-day-line { font-size: 13px; }
.load-days-note { margin: 12px 0 0; font-size: 12px; }

/* Warehouse clock in / out with a live photo (templates/picking/punch.html, apps/people/punch.py) */
.punch-wrap { max-width: 520px; margin: 0 auto; }
.punch-card .card-body { text-align: center; padding: 24px 18px; display: grid; gap: 12px; }
.punch-form { display: grid; gap: 12px; }
.punch-camera { position: relative; border-radius: 16px; overflow: hidden; background: #111; aspect-ratio: 3 / 4; max-height: 60vh; margin: 0 auto; width: 100%; }
.punch-camera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.punch-status { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 10px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; }
.punch-go { min-height: 56px; font-size: 17px; }
.punch-hidden { display: none !important; }
.punch-note { margin: 0; font-size: 13px; }
.punch-only { margin: 0; }
.punch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); font-size: 14px; }
.punch-bar form { margin: 0; }
.punch-bar .spacer { flex: 1; }
.punch-bar.on-break { border-color: var(--warning); background: var(--warning-soft); }
.att-photo { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); vertical-align: middle; }
/* Activity log (templates/accounts/activity_log.html, 14 Nov 26; made easier the same day) */
.act-search { padding: 16px; margin-bottom: 12px; display: grid; gap: 10px; }
.act-bar { display: flex; gap: 8px; align-items: center; }
.act-bar-icon { color: var(--muted); display: inline-flex; }
.act-q { flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px; }
.act-examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.act-example { padding: 3px 10px; border-radius: 999px; background: var(--surface-hover); color: var(--text); text-decoration: none; }
.act-example:hover { background: var(--border); }
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13.5px; }
.act-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.act-more-filters summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.act-filters { flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.act-filters label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.act-understood { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 12px;
  border-radius: var(--radius-lg); background: var(--surface-hover); font-size: 14px; }
.act-clear { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.act-day { margin-bottom: 12px; overflow: hidden; }
.act-day-head { padding: 10px 16px; font-weight: 600; border-bottom: 1px solid var(--border); background: var(--surface-hover); }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-item { display: grid; grid-template-columns: 64px 28px 1fr; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); align-items: start; }
.act-item:last-child { border-bottom: 0; }
.act-time { color: var(--muted); font-size: 13px; padding-top: 2px; white-space: nowrap; }
.act-icon { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--surface-hover); color: var(--muted); }
.act-good .act-icon { background: var(--success-soft, #e7f6ec); color: var(--success); }
.act-bad .act-icon { background: var(--danger-soft); color: var(--danger); }
.act-warn .act-icon { background: var(--warning-soft, #fff4dd); color: var(--warning, #b7791f); }
.act-info .act-icon { background: var(--info-soft, #e8f1fd); color: var(--info, #2b6cb0); }
.act-sentence { font-size: 14.5px; line-height: 1.4; }
.act-sentence a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); }
.act-changes { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.act-field { color: var(--muted); }
.act-old { text-decoration: line-through; color: var(--muted); }
.act-tech summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 4px; width: max-content; }
.act-dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 12.5px; word-break: break-word; }
.act-dl dt { color: var(--muted); }
.act-dl dd { margin: 0; }
.act-empty { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 32px 16px; }
.act-more, .act-jordan { margin: 4px 0 16px; font-size: 13px; }
@media (max-width: 600px) {
  .act-item { grid-template-columns: 26px 1fr; row-gap: 2px; }
  .act-icon { grid-column: 1; grid-row: 1 / span 2; }
  .act-time { grid-column: 2; grid-row: 1; font-size: 12px; padding-top: 0; }
  .act-body { grid-column: 2; grid-row: 2; }
}

/* Phones and tablets, iPhone included (owner, 14 Nov 26: "Login screen UI fix as per new iphone ... check other pages"):
   - iPhones zoom the whole page in when a text box with letters under 16px is tapped, and the page then sits
     sideways. On touch screens every text box, list and note box uses 16px (all forms, not only sign-in).
   - Sign-in pages use the screen's visible height (dvh: under the browser bars), and on short, wide screens (a phone
     held sideways, a folding phone opened) the picture side is left out and the form is compact, so the Sign in
     button stays on the screen without scrolling. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]),
  select, textarea { font-size: 16px !important; }
}
.auth { min-height: 100vh; min-height: 100dvh; }
@media (max-height: 540px) and (orientation: landscape) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-panel { align-items: flex-start; padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); }
  .auth-card { max-width: 520px; }
  .auth-card .logo-chip { margin-bottom: 10px; }
  .auth-card .logo-chip img { height: 28px; }
  .auth-card h2, .auth-card h1 { font-size: 22px; }
  .auth-card .lead { margin: 2px 0 12px; }
  .auth-card form:has(> .field + .field) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
  .auth-card form:has(> .field + .field) > :not(.field) { grid-column: 1 / -1; }
  .auth-card form:has(> .field + .field) > .field:nth-of-type(n+3) { grid-column: 1 / -1; }
}
/* very narrow screens (a folding phone's outside screen, small phones): a long button label wraps instead of
   widening the page, and the top bar leaves out "View as" (Super Admins use it on a wider screen) */
@media (max-width: 400px) {
  .btn-block { white-space: normal; height: auto !important; min-height: 44px; padding-top: 8px; padding-bottom: 8px; line-height: 1.25; text-align: center; }
}
@media (max-width: 359px) {
  .topbar .view-as { display: none; }
}

/* Staff sign-in, Google first (templates/auth/login.html, owner 14 Nov 26: "show google as preferred so clean view page") */
.signin-btn { height: 46px; }
.pw-form .signin-btn { margin-top: 8px; }
.signin-forgot { margin: 8px 0 0; font-size: 13px; text-align: right; }
.google-main { height: 52px; gap: 10px; font-size: 16px; font-weight: 650; border-width: 1.5px; }
.google-main svg { width: 20px; height: 20px; }
.pk-box { margin-top: 12px; }
.pw-more { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.pw-more > summary { cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; padding: 6px 0; }
.pw-more > summary::-webkit-details-marker { display: none; }
.pw-more > summary::after { content: " ▾"; }
.pw-more[open] > summary { margin-bottom: 10px; }
.pw-more[open] > summary::after { content: " ▴"; }
/* the other ways in: one quiet row of two small buttons (owner: the two boxes at the bottom looked bad) */
.signin-alt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 22px; }
.signin-alt-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.signin-alt-label::before, .signin-alt-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.signin-alt-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; text-decoration: none; text-align: center; }
.signin-alt-btn:hover { border-color: var(--border-strong); background: var(--surface-hover); color: var(--text); }
/* Each way of signing in has its own colour (owner, 14 Nov 26: "All login buttons as separate colour"):
   Google blue, Face ID black, email + password IPL navy (staff) / pink (customers), warehouse PIN amber. */
.btn.google-main { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.btn.google-main:hover { background: #1765cc; border-color: #1765cc; color: #fff; }
.google-main svg { background: #fff; border-radius: 6px; padding: 4px; width: 28px; height: 28px; box-sizing: border-box; }
.btn.faceid-btn { background: #111827; border-color: #111827; color: #fff; }
.btn.faceid-btn:hover { background: #000; border-color: #000; color: #fff; }
.btn.pin-btn { background: #f2a516; border-color: #e09a12; color: #2b1d00; font-weight: 650; gap: 8px; }
.btn.pin-btn:hover { background: #e09a12; color: #2b1d00; }
.pw-hint { margin: 0 0 10px; font-size: 13px; color: var(--text-2); text-align: center; }
/* customer sign-in: one small office footer for IPL staff, so the two sign-ins aren't confused */
.office-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin-top: 28px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.office-foot-label { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.office-foot a { color: #1d4fa3; font-weight: 600; text-decoration: none; }
.shop-login-hint { margin: -6px 0 12px; font-size: 13px; }
.office-foot a:hover { text-decoration: underline; }
.signin-alt .pin-btn { grid-column: 1 / -1; }

/* Team performance: warehouse managers' scorecards (apps/picking/performance.manager_cards) */
.mgr-section { margin-bottom: 20px; }
.mgr-note { font-size: 12.5px; margin: 0 0 12px; }
.mgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mgr-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.mgr-name { font-size: 15px; margin: 0 0 8px; }
.mgr-list { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 13px; }
.mgr-list dt { color: var(--muted); }
.mgr-list dd { margin: 0; text-align: right; }

/* Settings -> SMS -> Where texts are used: the Live switch beside each area (15 Nov 26) */
.sms-live-form { display: inline; margin-left: 6px; }
/* IPL Chat set-up guide (templates/staffchat/setup.html, _setup_popup.html, setup_team.html) */
.cs-wrap { max-width: 860px; }
.cs-progress { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; }
.cs-dot { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 12.5px; cursor: pointer; min-height: 32px; }
.cs-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-weight: 700; }
.cs-dot.is-past .cs-num { background: #008000; color: #fff; }
.cs-dot.is-on { border-color: #109fe0; }
.cs-dot.is-on .cs-num { background: #109fe0; color: #fff; }
.cs-step { margin-bottom: 14px; }
.cs-h { display: flex; align-items: center; gap: 8px; font-size: 19px; margin: 0 0 10px; }
.cs-list { margin: 8px 0; padding-left: 20px; line-height: 1.55; }
.cs-list li { margin-bottom: 6px; }
.cs-note { display: flex; gap: 8px; align-items: flex-start; background: #fff7e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 10px 12px; margin: 12px 0 0; }
.cs-small { font-size: 12.5px; }
.cs-big { min-height: 44px; margin: 6px 0 12px; }
.cs-tabs { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; }
.cs-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 14px; min-height: 36px; cursor: pointer; }
.cs-tab.is-on { background: #109fe0; border-color: #109fe0; color: #fff; }
.cs-push { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 8px 0 12px; }
.cs-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cs-tile { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; font-size: 13px; }
.cs-check { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); min-height: 44px; }
.cs-check input { width: 20px; height: 20px; }
.cs-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-later { margin: 0; }
.cs-pop { max-width: 480px; }
.cs-pop-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cs-pop-title { margin: 0; }
.cs-pop-text { margin: 0 0 6px; line-height: 1.5; }
.cs-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cs-pop-foot form { margin: 0; }
.cs-stats { margin-bottom: 16px; }
.cs-stat { font-size: 24px; font-weight: 800; }
.cs-stat-link { display: inline-block; margin-top: 6px; font-weight: 600; }
.cs-bad { color: #cc0000; }
.cs-table-body { padding: 12px 0 0; }
@media (max-width: 600px) { .cs-lbl { display: none; } .cs-dot { padding-right: 4px; } }

/* Dashboard: Find a feature (templates/dashboard.html, static/js/feature_search.js) */
.feature-search { position: relative; margin: 0 0 16px; max-width: 640px; }
.feature-search .input { width: 100%; padding-left: 38px; height: 44px; font-size: 15px; border-radius: 12px; }
.feature-search .fs-icon { position: absolute; left: 13px; top: 13px; color: var(--muted); display: flex; }
.fs-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
  max-height: 60vh; overflow: auto; }
.fs-results a { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.fs-results a:hover, .fs-results a.fs-on { background: var(--primary-soft); }
.fs-results .fs-name { font-weight: 600; }
.fs-results .fs-where { font-size: 12px; color: var(--muted); }
.fs-results .fs-none { padding: 10px; color: var(--muted); font-size: 13.5px; }

/* Launch packs: Recently added products (templates/products/launch_list.html) */
.lp-recent-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.lp-recent-head .card-title { margin: 0; }
.lp-tabs { margin-bottom: 14px; }

/* Customers -> Move customers (templates/customers/move_reps.html) */
.mv-card { margin-bottom: 16px; }
.mv-form { display: grid; gap: 12px; }
.mv-reps { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.mv-reps .field { flex: 1 1 240px; margin: 0; }
.mv-reps .mv-state { flex: 0 1 180px; }
.mv-arrow { font-size: 22px; color: var(--muted); padding-bottom: 6px; }
.mv-scope { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.mv-note { margin: 0; }
.mv-toolbar { margin: 6px 0; }
.mv-count { font-size: 13px; }
.mv-empty { padding: 20px; }
.mv-pick summary { cursor: pointer; font-weight: 600; }
.mv-list { max-height: 320px; overflow: auto; display: grid; gap: 4px; margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.mv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-bottom: 12px; }
.mv-tiles div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.mv-tiles b { font-size: 22px; }
.mv-tiles span { font-size: 12.5px; color: var(--text-2); }
.mv-notes { margin: 0 0 12px; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 4px; }

/* Confirm with a text code: the owner's extra layer (templates/accounts/owner_sms.html) */
.osms-card { max-width: 520px; margin: 24px auto; padding: 24px; display: grid; gap: 12px; }
.osms-title { display: flex; gap: 8px; align-items: center; font-size: 22px; margin: 0; }
.osms-what, .osms-sent, .osms-note { margin: 0; }
.osms-form { display: grid; gap: 12px; }
.osms-code { font-size: 22px; letter-spacing: .3em; max-width: 220px; }
.osms-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* free delivery bar (16 Nov 26): how much more for free courier delivery */
.free-bar { margin: 8px 0; font-size: 13px; }
.free-bar-text { margin-bottom: 5px; font-weight: 600; }
.free-bar-track { height: 8px; border-radius: 999px; background: var(--surface-hover, #eef1f6); overflow: hidden; }
.free-bar-track i { display: block; height: 100%; width: 0; background: #d97706; border-radius: inherit; transition: width .3s; }
.free-bar.done .free-bar-text { color: #15803d; }
.free-bar.done .free-bar-track i { background: #16a34a; }
.free-bar-mini { margin: 3px 0 0; font-size: 11.5px; min-width: 130px; }
.free-bar-mini .free-bar-track { height: 5px; }
.free-bar-mini .free-bar-text { margin: 2px 0 0; font-weight: 600; }
/* Repeat last order (16 Nov 26) */
.repeat-last { align-self: flex-start; display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.repeat-last .cell-sub { display: inline; }
/* Goes well with (16 Nov 26): a strip under a product just added */
.together { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; margin: -2px 0 8px;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: 13px; }
.together-title { font-weight: 650; margin-right: 4px; }
.together .btn { max-width: 100%; white-space: normal; text-align: left; }
/* inside the product's card (store visit, 17 Nov 26): across the whole card, so the grid around it doesn't move */
.product-row > .together { grid-column: 1 / -1; margin: 2px 0 0; }
/* fast taps on + / - on an iPad: no double-tap zoom, no delay */
.qty button, .qty input, .together .btn { touch-action: manipulation; }

/* Factory login: manufacturer declarations to sign (16 Nov 26) */
.decl-card { margin-top: 16px; }
.decl-help { margin: 0; padding-top: 0; font-size: 13px; }
.decl-upload { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.decl-list-title { margin: 18px 0 6px; }
.decl-none { margin: 0; }

/* Inventory -> Partners -> Factories (templates/shipdocs/partners.html) */
.fac-grid { margin-top: 16px; align-items: start; }
.fac-note { padding: 0 16px; font-size: 13px; }
/* the factory list: rows inside the card's padding, search + filter, the chosen one marked (24 Nov 26) */
.fac-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 16px 10px; }
.fac-search { flex: 1 1 200px; min-width: 0; height: 36px; }
.fac-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fac-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.fac-chip b { font-weight: 700; color: var(--muted); }
.fac-chip.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.fac-chip.is-on b { color: var(--primary); }
.fac-list { padding: 0 0 6px; }
.fac-list .fac-row { padding: 12px 16px; cursor: pointer; }
.fac-list .fac-row:first-child { padding-top: 12px; }
.fac-list .fac-row[hidden] { display: none; }
.fac-list .fac-row:hover { background: var(--surface-2); }
.fac-list .fac-row.is-on { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.fac-list .fac-row .row-link { text-decoration: none; color: var(--text); }
.fac-list .fac-row .sub { margin-top: 2px; overflow-wrap: anywhere; }
.fac-go { color: var(--muted); flex: none; }
.fac-none { padding: 6px 16px 14px; margin: 0; }
.fac-empty { text-align: center; padding: 40px 20px; }
.fac-empty .icon { width: 32px; height: 32px; color: var(--muted); }
@media (max-width: 899px) { .fac-empty { display: none; } }  /* phones: the list is enough until a factory is chosen */
@media (min-width: 900px) { .fac-grid > div:last-child { position: sticky; top: 76px; } }
.fac-title { margin-bottom: 10px; }
.fac-pos { margin-top: 16px; }

/* Inventory -> Partners -> Factories: factory logins waiting for the owner (apps/shipdocs/factory_logins.py) */
.fac-requests { margin-top: 16px; }
.fac-decide { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fac-note-flat { font-size: 13px; margin: 0 0 8px; }

/* Pick n Pack -> Printers: printer offline alerts (apps/picking/printer_watch.py) */
.pw-card { margin-bottom: 16px; }
.pw-note { margin: 0 0 10px; font-size: 13px; }
.pw-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.pw-row .field { min-width: 200px; margin: 0; }
.pw-warn { margin: 10px 0 0; font-size: 13px; color: var(--warning); font-weight: 600; }

/* Domestic / International supplier tag (config/jinja2.py supplier_tag, owner 17 Nov 26) */
.sup-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; }
.sup-tag-dom { background: var(--success-soft); color: var(--success); }
.sup-tag-intl { background: var(--info-soft); color: var(--info); }

/* Shipment documents: samples and the telex release (apps/shipdocs/samples_telex.py, owner 17 Nov 26) */
.ps-sample { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.sd-telex-title { margin: 10px 0 2px; }
.sd-telex-note { font-size: 12.5px; margin: 0 0 6px; }
.sd-telex-form, .tx-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tx-card { margin-bottom: 16px; }
.tx-please_release { border-color: var(--warning); }
.tx-confirmed { border-color: var(--success); }

/* PO wood check (owner, 17 Nov 26) */
.wood-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.wood-q { font-size: 13px; }
.wood-hint { display: block; width: 100%; font-size: 12.5px; color: var(--muted, #64748b); }
.wood-hint.is-likely { color: #b45309; font-weight: 600; }
.wood-hint .icon-sm { vertical-align: -2px; }
.wood-form { display: inline-flex; gap: 6px; margin-right: 6px; }
.pu-stage { min-width: 140px; }

/* Shipment page as a flow (owner, 17 Nov 26; templates/inventory/shipment.html) */
.sf-head { align-items: flex-start; }
.sf-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted, #64748b); text-decoration: none; margin-bottom: 4px; }
.sf-name { color: var(--muted, #64748b); font-weight: 500; }
.sf-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.sf-actions { display: flex; gap: 8px; align-items: center; }
.sf-menu { position: relative; }
.sf-menu > summary { list-style: none; cursor: pointer; }
.sf-menu > summary::-webkit-details-marker { display: none; }
.sf-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); padding: 6px; display: grid; }
.sf-menu-list a { padding: 9px 12px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.sf-menu-list a:hover { background: var(--surface-2, #f1f5f9); }
.sf-steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sf-step a { display: flex; gap: 10px; align-items: flex-start; height: 100%; padding: 12px; border-radius: 12px; text-decoration: none; color: inherit;
  background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0); }
.sf-dot, .sf-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--surface-2, #f1f5f9); color: var(--muted, #64748b); }
.sf-step-text { display: grid; gap: 2px; min-width: 0; }
.sf-step-title { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.sf-step-detail { font-size: 12px; color: var(--muted, #64748b); overflow-wrap: anywhere; }
.sf-done .sf-dot, .sf-num.sf-done { background: #16a34a; color: #fff; }
.sf-now a { border-color: var(--primary, #d6365f); box-shadow: 0 0 0 1px var(--primary, #d6365f) inset; }
.sf-now .sf-dot, .sf-num.sf-now { background: var(--primary, #d6365f); color: #fff; }
.sf-next { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; border-radius: 12px;
  background: color-mix(in srgb, var(--primary, #d6365f) 8%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--primary, #d6365f) 30%, transparent); }
.sf-next-label { font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; color: var(--primary, #d6365f); }
.sf-next-text { flex: 1 1 260px; }
.sf-card { margin-bottom: 18px; scroll-margin-top: 80px; }
.sf-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sf-card-head-wrap { padding-bottom: 0; }
.sf-title { font-size: 18px; font-weight: 700; margin: 0; }
.sf-help { font-size: 13px; color: var(--muted, #64748b); margin: 0 0 12px; }
.sf-help-pad { padding: 0 20px; }
/* A product's picture next to its SKU on receiving (templates/inventory/_line_pic.html; owner, 19 Nov 26) */
.rc-sku { display: inline-flex; align-items: center; gap: 8px; }
.rc-thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--border); background: #fff; padding: 2px;
  cursor: zoom-in; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.rc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.rc-thumb:hover { border-color: var(--primary); }
.rc-thumb-none { cursor: default; color: var(--muted); background: var(--surface-2); }
.sf-sub-title { font-weight: 600; margin: 16px 0 8px; }
.sf-fw { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.sf-fw .field { margin: 0; }
.sf-fw-contact { display: block; font-size: 12.5px; color: var(--muted, #64748b); margin-top: 4px; }
.sf-fw-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.sf-more { margin-top: 14px; }
.sf-more > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 6px 0; }
.sf-rates { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
.sf-rates .field { margin: 0; }
.sf-docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.sf-doc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border, #e2e8f0); }
.sf-doc-dot { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid currentColor; }
.sf-doc-ok { color: #15803d; }
.sf-doc-ok .sf-doc-dot { background: #16a34a; border-color: #16a34a; color: #fff; }
.sf-doc-wait { color: #b45309; }
.sf-doc-miss { color: #b91c1c; }
.sf-doc-name { flex: 1 1 auto; color: var(--text, #0f172a); font-weight: 600; font-size: 13.5px; display: grid; }
.sf-doc-sub { font-weight: 400; font-size: 12px; color: var(--muted, #64748b); }
/* a line's own upload button (owner, 24 Nov 26: "add upload icon") */
.sf-doc-up { margin: 0; flex: 0 0 auto; }
.sf-doc-up-btn { position: relative; cursor: pointer; padding: 6px; color: var(--primary, #2563eb); }
.sf-doc-up-btn:focus-within { outline: 2px solid var(--primary, #2563eb); outline-offset: 2px; }
.sf-doc-up-btn.is-busy { opacity: .5; pointer-events: none; }
.sf-doc-up-file { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.sf-goods { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.sf-upload { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2, #f8fafc); }
.sf-upload-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sf-upload-who { font-size: 12px; color: var(--muted, #64748b); }
.sf-upload-line { font-size: 12.5px; margin: 6px 0 0; }
.sf-upload-alert { margin: 6px 0 0; }
.sf-upload-alert ul { margin: 4px 0 0 18px; }
.sf-upload-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sf-review { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.sf-review .input { flex: 1 1 200px; }
.sf-review .select { width: auto; }
.sf-upload-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.sf-upload-form input[type=file] { max-width: 300px; }
.sf-upload-form .select { width: auto; }
.sf-amount { display: flex; gap: 6px; }
.sf-amount .select { width: auto; }
.sf-track-auto { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #f8fafc); margin-bottom: 12px; }
.sf-error { color: var(--danger, #b91c1c); }
.sf-got-col { width: 130px; }
.sf-skipped { font-size: 12.5px; margin: 10px 0 0; }
.sf-inline { margin-top: 10px; }
.sf-complete { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2, #f8fafc); }
.sf-complete form { margin: 0; }
@media (max-width: 1100px) { .sf-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sf-actions { width: 100%; } }
.sf-card-head .spacer { flex: 1 1 auto; }
.sf-card .sd-telex-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sf-upload-form .input:not([type=file]) { flex: 1 1 160px; width: auto; }
.sf-flow-badge { font-weight: 600; }
/* Supplier ID (owner, 17 Nov 26): SCN0007 beside the supplier's name */
.sup-code { display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2, #f1f5f9); color: var(--muted, #475569); vertical-align: middle; font-variant-numeric: tabular-nums; }
.fac-code-hint { font-size: 12.5px; font-weight: 400; }
.np-new { padding: 12px; border-radius: 10px; background: var(--surface-2, #f8fafc); }
.np-mode { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--surface-2, #f1f5f9); }
.np-mode-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.np-mode-opt:has(input:checked) { background: var(--surface, #fff); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); color: var(--primary, #d6365f); }
.np-mode-opt input { accent-color: var(--primary, #d6365f); }
/* Supplier checklist, product by product (templates/inventory/po_checklist_grid.html) */
.pcg-summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.pcg-legend { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; margin-left: 8px; }
.pcg-chip, .pcg-cell { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pcg-ok { background: color-mix(in srgb, var(--success, #16a34a) 14%, transparent); color: var(--success, #15803d); }
.pcg-bad { background: color-mix(in srgb, var(--warning, #b45309) 14%, transparent); color: var(--warning, #b45309); }
.pcg-off { background: var(--surface-2, #f1f5f9); color: var(--muted, #64748b); font-weight: 500; }
.pcg-wrap { max-height: 75vh; }
.pcg-table th { white-space: nowrap; position: sticky; top: 0; z-index: 2; background: var(--surface-2, #f8fafc); }
.pcg-sticky { position: sticky; left: 0; z-index: 1; background: var(--surface, #fff); min-width: 180px; }
.pcg-table th.pcg-sticky { z-index: 3; background: var(--surface-2, #f8fafc); }
.pcg-foot { font-size: 12.5px; margin-top: 8px; }
.pcg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Rebates / Incentives by quarter: one card per quarter (owner, 18 Nov 26: "Ui not good" on the iPad) */
.qc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; margin: 0 0 12px; }
.qc-legend { font-size: 12.5px; }
.qc { margin-bottom: 14px; padding-bottom: 6px; }
.qc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.qc-title { white-space: nowrap; font-size: 16px; }
.qc-title .badge { margin-left: 6px; }
.qc-dates { white-space: nowrap; }
.qc-right { display: flex; align-items: center; gap: 10px; }
.qc-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; padding: 14px 20px 6px; }
.qc-label { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.qc-value { font-family: var(--font-display); font-size: 20px; font-weight: 700; white-space: nowrap; }
.qc-table th, .qc-table td { white-space: nowrap; }
.qc-empty { padding: 10px 20px 12px; margin: 0; }

/* A buying group's rebate steps (templates/commissions/_steps.html, owner 18 Nov 26) */
.rs { margin-bottom: 16px; }
.rs-alert { margin: 12px 20px 0; }
.rs-approve { flex-wrap: wrap; gap: 8px; align-items: center; }
.rs-approve > span { flex: 1 1 260px; }
.rap-intro { margin: 0 0 12px; }
.rap-row { gap: 8px; flex-wrap: wrap; }
.rs-steps { list-style: none; margin: 0; padding: 14px 20px 4px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.rs-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.rs-step.is-current { border-color: var(--primary); }
.rs-dot { flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2, #eef0f4); color: var(--muted); }
.rs-step.is-done .rs-dot { background: var(--success-soft); color: var(--success); }
.rs-step.is-current .rs-dot { background: var(--primary); color: var(--on-primary, #fff); }
.rs-body { min-width: 0; }
.rs-name { font-weight: 650; }
.rs-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; padding: 10px 20px; }
.rs-form { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.rs-form summary, .rs-history summary { cursor: pointer; font-weight: 600; }
.rs-form form { display: grid; gap: 8px; margin-top: 8px; }
.rs-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rs-history { padding: 4px 20px 8px; }
.rs-undone .title, .rs-undone .sub { text-decoration: line-through; color: var(--muted); }
.rs-undo { display: flex; gap: 6px; align-items: center; }
.rs-undo .input { width: 140px; }
.rs-portal { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 20px 16px; font-size: 13px; }
.rs-group-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.rs-group-actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rb-quarters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
/* carton recorded on arrival, Receive tables (templates/inventory/_carton_arrival.html) */
.ca-cell { display: grid; gap: 2px; }
.ca-row { display: flex; gap: 4px; flex-wrap: wrap; }
.ca-n { width: 64px; }

/* Competitors: login boxes show only while "Prices need a login" is ticked (no script needed) */
.cp-form .cp-login { display: none; }
.cp-form:has(input[name="needs_login"]:checked) .cp-login { display: grid; }

/* Rebate / incentive list: filters, totals, rate tag and the calculation pop-up (templates/commissions/party.html, 18 Nov 26) */
.pl-own { margin-bottom: 16px; }
.pl-tools { margin-bottom: 16px; padding: 14px 16px; display: grid; gap: 12px; }
.pl-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pl-domestic { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pl-domestic select { max-width: 100%; }
.pl-filters .input { flex: 1 1 220px; }
.pl-filters .select { flex: 0 1 190px; }
.pl-check { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.pl-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pl-totals > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pl-totals .muted { font-size: 12px; }
.pl-cats summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.pl-sm-sum { margin-bottom: 12px; }
.pl-sm-title { font-size: 14px; font-weight: 600; margin: 4px 0 6px; }
.pl-cats .table-wrap { margin-top: 8px; }
.pl-odd td { color: var(--danger); }
.pl-pick { width: 36px; }
.pl-rate { width: 34px; text-align: center; }
.pl-mix { border: 0; background: var(--warning-soft, #fff4d6); color: var(--warning, #b7791f); border-radius: 6px; padding: 3px 4px; cursor: pointer; line-height: 0; }
.pl-same { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.pl-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
.pl-sort:hover { text-decoration: underline; }
th[aria-sort="ascending"] .pl-sort::after { content: " ▲"; font-size: 10px; }
th[aria-sort="descending"] .pl-sort::after { content: " ▼"; font-size: 10px; }
.hw-body { max-height: 70vh; }
.hw-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.hw-ref { font-weight: 700; font-size: 16px; }
.hw-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.hw-table tfoot th { font-weight: 600; }
.hw-sub th { background: var(--surface-2); font-weight: 500; }
.hw-sub .cell-sub { font-weight: 400; }
.hw-total th { border-top: 2px solid var(--border); font-size: 15px; }
.hw-page { margin-bottom: 16px; }
.pl-day { white-space: nowrap; }
.pl-gid { white-space: nowrap; color: var(--muted); }
.pl-sm { font-size: 11px; padding: 1px 6px; vertical-align: 1px; }
.pl-sm-mso { background: var(--info-soft, #e0ecff); color: var(--info, #1d4ed8); }
.ps-line { font-size: 13px; color: var(--muted); margin-top: 4px; }
/* Rebates: UCB stores with no UCB ID, free sample accounts (templates/commissions/pending.html, 18 Nov 26) */
.nl { margin-top: 16px; }
.nl-intro { margin: 0; padding: 0 20px 12px; font-size: 13px; }
.nl-form { display: inline-flex; gap: 6px; align-items: center; margin: 2px 6px 2px 0; }
.nl-form .input { width: 110px; }
.nl-off { margin-top: 16px; padding: 12px 16px; }
.nl-off summary { cursor: pointer; font-weight: 600; }

/* Account tab: credit limit (owner, 18 Nov 26: staff mixed up credit we owe with the credit limit) */
.limit-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.limit-bar { height: 8px; border-radius: 999px; background: var(--surface-2, #eef0f3); overflow: hidden; margin: 14px 0 6px; }
.limit-bar span { display: block; height: 100%; background: var(--success, #15803d); border-radius: 999px; }
.limit-bar span.near { background: var(--warning, #b45309); }
.limit-bar span.over { background: var(--danger, #b91c1c); }
.limit-sum { font-size: 12.5px; margin: 6px 0 0; }
.limit-card.limit-over { border-color: var(--danger, #b91c1c); }
.limit-history { margin-top: 10px; }
.limit-history summary { cursor: pointer; font-size: 13px; }

/* Buying group logos (apps/buyinggroups/logos.py, 18 Nov 26) */
.bg-logo { height: 34px; width: auto; max-width: 160px; object-fit: contain; }
.bg-logo-x { color: var(--muted, #6b7280); font-size: 18px; }
.bg-logo-card { margin-bottom: 16px; padding: 10px 16px; }
.bg-logo-card summary { display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; }
.bg-logo-body { display: grid; gap: 8px; margin-top: 10px; }
.bg-logo-form { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.credit-list { padding: 4px 16px 14px; }
.credit-list .list-row { align-items: flex-start; }
.credit-left { text-align: right; white-space: nowrap; }
.credit-left .cell-sub { display: block; }

/* customer profile: the Shop login popup shows the card without its page gap */
.cp-shop-login > .card { margin-top: 0 !important; box-shadow: none; border: 0; }

/* menu badge pushed to the right (Work phones & iPads, templates/base.html) */
.nav-badge-end { margin-left: auto; }

/* Team inboxes: teams and mailboxes on the side (owner, 18 Nov 26) */
.ti-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
.ti-side { padding: 8px; position: sticky; top: 70px; }
.ti-side-head { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b7280); padding: 10px 10px 4px; }
.ti-side-link { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.ti-side-link .num { margin-left: auto; font-size: 12.5px; color: var(--muted, #6b7280); }
.ti-side-link .num.ti-warn { color: #b45309; font-weight: 700; }
.ti-side-link:hover { background: var(--hover, rgba(0, 0, 0, .04)); }
.ti-side-link.on { background: var(--primary-soft, rgba(225, 29, 72, .1)); font-weight: 700; }
@media (max-width: 800px) {
  .ti-layout { grid-template-columns: 1fr; }
  .ti-side { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .ti-side-head { width: 100%; padding-top: 4px; }
}

/* Team inboxes: small dashboard, who's answering, AI draft (owner, 18 Nov 26) */
.ti-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.ti-stat { background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ti-stat-n { font-size: 22px; font-weight: 700; line-height: 1.2; }
.ti-stat-l { font-size: 12.5px; color: var(--muted, #6b7280); }
.ti-stat-bad .ti-stat-n { color: #b91c1c; }
.ti-people { margin-bottom: 12px; }
.ti-people summary { padding: 12px 16px; cursor: pointer; }
.ti-late { color: #b91c1c; font-weight: 700; }
.ti-working, .ti-wait { margin-top: 4px; display: inline-flex; gap: 4px; align-items: center; }
.ti-wait { background: #fef3c7; color: #92400e; }
.ti-ai { margin-bottom: 12px; }
.ti-ai-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ti-ai-head form { margin-left: auto; }
.ti-ai-note { margin: 8px 0 0; font-size: 13.5px; }
/* Account summary: one card, two rows (owner, 18 Nov 26: "why we kept too many boxes") */
.acct-overview.limit-over { border-color: var(--danger, #b91c1c); }
.acct-row { display: grid; grid-template-columns: 170px repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; padding: 10px 0; }
.acct-row + .acct-row, .limit-bar + .acct-row { border-top: 1px solid var(--border); }
.acct-row-label { font-weight: 600; display: flex; flex-direction: column; }
.acct-fig { display: flex; flex-direction: column; gap: 2px; }
.acct-fig strong { font-size: 22px; font-family: var(--font-display); letter-spacing: -.01em; }
@media (max-width: 720px) { .acct-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .acct-row-label { grid-column: 1 / -1; } }
.acct-change-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-change-form .select, .acct-change-form .input { width: auto; flex: 0 1 200px; }
.acct-change-form .acct-why { flex: 1 1 220px; }
/* Rebates -> Settings (19 Nov 26) */
.rs-form { display: grid; gap: 16px; max-width: 760px; }
.rs-group { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; display: grid; gap: 10px; }
.rs-group legend { font-weight: 600; padding: 0 6px; }
.rs-option { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.rs-option input { margin-top: 4px; }
.rs-note { margin-top: 12px; }
/* UCB members: "Not our customer" next to Link (owner, 19 Nov 26) */
.ucb-notours { margin-top: 4px; }

/* product edit + product page: prices, with the old Neto price groups in a read-only popup (owner, 19 Nov 26) */
.pg-body { padding-top: 0; }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pg-note { margin: 0 0 8px; font-size: 13px; }
.pg-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pg-switch { display: flex; align-items: center; gap: 8px; margin: 0; }
tr.pg-child td:first-child { padding-left: 28px; }
/* Complete shipment: two choices (add to stock / already in Neto) */
.complete-choice { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.complete-neto { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, #e5e7eb); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.complete-neto-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.complete-neto-form .field { flex: 1 1 260px; margin: 0; }
.complete-neto-form .input { width: 100%; }
.complete-neto-why { margin: 4px 0 0; overflow-wrap: anywhere; }
@media (max-width: 640px) { .complete-neto-form .btn { flex: 1 1 100%; min-width: 0; white-space: normal; height: auto; min-height: 38px; padding-top: 8px; padding-bottom: 8px; text-align: center; } }

/* store visit: the order steps as a pipe (owner, 19 Nov 26): Products -> Stands -> Survey -> Photos -> Preview */
.visit-steps { display: flex; gap: 0; margin: 0 0 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow-x: auto; }
.vs-step { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px 10px 30px; position: relative;
  background: none; border: 0; border-right: 1px solid var(--border); color: var(--text-2); text-decoration: none; font: inherit; text-align: left; cursor: pointer; }
.vs-step:last-child { border-right: 0; }
.vs-step:hover { background: var(--surface-2); }
.vs-dot { position: absolute; left: 8px; top: 11px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong);
  font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.vs-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.vs-state { font-size: 12px; color: var(--muted); min-height: 14px; }
.vs-step.done .vs-dot { background: var(--success); border-color: var(--success); color: #fff; }
.vs-step.done .vs-state { color: var(--success); }
.vs-step.current { background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--primary); }
.vs-step.current .vs-dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.vs-step.current .vs-state { color: var(--primary); font-weight: 600; }
.step-flash { animation: step-flash 1.6s ease-out 1; }
@keyframes step-flash { 0% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .step-flash { animation: none; outline: 2px solid var(--primary); } }
@media (max-width: 600px) {
  .vs-step { min-width: 92px; padding: 8px 8px 8px 26px; }
  .vs-dot { left: 5px; top: 9px; }
  .vs-name { font-size: 12.5px; white-space: nowrap; }
}

/* product page: stock in and out, last 90 days, and upcoming (apps/products/stocklog.py, 19 Nov 26) */
.stock-log { margin: 16px 0; }
.stock-log-link { color: inherit; text-decoration: none; }
.stock-log-link:hover { text-decoration: underline; }
.stock-plus { color: var(--success); font-weight: 600; }
.stock-minus { color: var(--danger); font-weight: 600; }
.stock-log-note { margin: 0 0 12px; }
.stock-log-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stock-log-sum { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.stock-log-h { font-size: 14px; margin: 16px 0 8px; }
.stock-log-rows { max-height: 420px; overflow-y: auto; }
.stock-log-uncounted td { color: var(--muted); }
.stock-log-start td { background: var(--surface-2, #f4f6fb); font-weight: 600; border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); }
.stock-log-old td:first-child { color: var(--muted); }
/* New order: store pick list under the Store box (templates/visits/index.html, static/js/visit_start.js) */
.store-pick { position: relative; }
.store-sugg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.store-sugg li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-height: 44px; border-radius: 8px; cursor: pointer; }
.store-sugg li span { font-size: 12.5px; color: var(--text-2); }
.store-sugg li:hover, .store-sugg li.on { background: var(--surface-2); }
.store-sugg li.store-sugg-none { cursor: default; color: var(--text-2); }

/* order / visit page header (owner, 19 Nov 26): addresses under the name, actions float on the right */
.visit-head { margin-bottom: 20px; }
.visit-back { margin-bottom: 8px; }
.visit-icn { font-size: .6em; vertical-align: middle; }
.visit-addr { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.visit-addr-card { margin: 0; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.visit-addr-card .stat-label { display: flex; align-items: center; gap: 6px; }
.visit-addr-lines { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.visit-addr-lines div:first-child { font-weight: 600; }
.visit-dock { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 7; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 16px; margin: 0 0 16px; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(10, 14, 22, .10); }
.visit-dock .visit-order-chip { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.visit-dock-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.visit-dock-no { font-size: 15px; }
.visit-dock-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.content:has(.visit-dock) .cat-search-pin { top: calc(var(--topbar-h) + 64px); }
@media (max-width: 760px) {
  .visit-dock { padding: 8px 10px; }
  .visit-dock-btns { width: 100%; margin-left: 0; }
  .visit-dock-btns .btn { flex: 1 1 auto; justify-content: center; }
  .content:has(.visit-dock) .cat-search-pin { top: var(--topbar-h); }
  .visit-dock { position: static; }
}

/* Product page folding sections (static/js/product_fold.js, owner 19 Nov 26) */
.fold-bar { display: flex; gap: 8px; justify-content: flex-end; margin: 0 0 12px; }
.fold > .fold-head { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fold > .fold-head .fold-btn { margin-left: auto; }
.fold-mark { margin-left: 8px; font-size: 12px; vertical-align: middle; }
.fold.is-folded > :not(.fold-head):not(dialog) { display: none; }
.fold.is-folded { padding-bottom: 0; }
.fold.is-folded > .fold-head { border-bottom: 0; margin-bottom: 0; }
/* Webstore → Product sorting → Category order (19 Nov 26) */
.cat-order-form { margin-top: 10px; }
.cat-order-form .btn-primary { margin-top: 10px; }
.cat-order-num { width: 90px; }
.cat-order-parent td { background: var(--surface-2, #f6f7f9); }
.cat-order-child { padding-left: 28px !important; }

/* Products → Slow stock deals (19 Nov 26) */
.ss-gap { margin-top: 14px; }
.ss-decide { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ss-pct { width: 70px; }
/* website promo card set-up page (templates/shop/card_setup.html, owner 19 Nov 26) */
.card-setup-title { margin: 12px 0 4px; }
.card-setup-lead { margin: 0 0 16px; }
.card-setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-setup-tick { margin: 4px 0 14px; font-size: 14px; }
.card-setup-code { margin: 12px 0 0; font-size: 13px; text-align: center; }
@media (max-width: 480px) { .card-setup-row { grid-template-columns: 1fr; } }
/* retail checkout in the shop cart (templates/shop/cart.html, owner 19 Nov 26) */
.sc-retail-lead { margin: 0 0 12px; }
.sc-promo { max-width: 320px; }
.sc-promo-hint { margin: 4px 0 0; font-size: 12.5px; }

/* Inventory → Stocktake: below-zero count box (20 Nov 26) */
.st-neg { margin-bottom: 16px; border-color: var(--warning, #f59e0b); }
.st-neg-body { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Team inboxes: email types and the sorting that learns from staff (owner, 20 Nov 26) */
.ti-learn-note { margin-bottom: 10px; }
.ti-kind { background: #ede9fe; color: #5b21b6; }
.ti-quick { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ti-quick .select { max-width: 150px; }
.ti-quick .cell-sub { width: 100%; }
.ti-hint { font-size: 12.5px; }
.ti-sec { margin-top: 22px; }
.ti-sortform { display: grid; gap: 12px; }
.ti-modes { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.ti-sec-card { margin-top: 12px; }
.ti-acc { margin: 6px 0 10px; }

/* Team inboxes: internal notes (owner, 20 Nov 26: "so anyone can continue") */
.ti-notes { margin-bottom: 12px; background: #fffbeb; border-color: #fde68a; }
.ti-notes-sub { font-size: 12.5px; font-weight: 400; margin-left: 6px; }
.ti-note { border-top: 1px solid #fde68a; padding: 8px 0; }
.ti-note-head { font-size: 13px; }
.ti-note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 2px; }
.ti-notes-empty { font-size: 13.5px; margin: 6px 0; }
.ti-note-form { display: grid; gap: 6px; margin-top: 8px; justify-items: start; }
.ti-note-form .textarea { width: 100%; }
/* Visit reminders on the customer page (owner, 20 Nov 26) */
.visit-rem-card { margin-top: 16px; }
.visit-rem-card .vr-row form { margin-left: auto; }
.visit-rem-card .vr-empty { margin: 0 0 10px; font-size: 13px; }
.vr-add { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.vr-add .field { margin: 0; }
.vr-add .vr-add-note { flex: 1 1 240px; }

/* Freight overview: made-up bookings (templates/freight/_dummy.html) */
.fr-dummy { margin-bottom: 16px; }
.fr-dummy .table-wrap { margin: 10px 0; }
.fr-dummy-go { margin-top: 10px; }

/* Freight -> Bookings (owner, 20 Nov 26) */
.freight-bk-stats { margin: 12px 0 16px; }

/* a select only as wide as its text (order screen category picker, 20 Nov 26) */
.select.select-auto { width: auto; max-width: 260px; }
.fr-fresh { margin-top: 12px; }
.fr-fresh form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fr-fresh .table-wrap { margin-top: 10px; }

/* pick screen: a display stand in several boxes, pick every box (owner, 20 Nov 26) */
.pk-parts { margin: 10px 0; padding: 10px 12px; border: 2px solid var(--warning, #d97706); border-radius: 10px;
            background: color-mix(in srgb, var(--warning, #d97706) 10%, var(--surface)); }
.pk-parts-head { font-weight: 800; font-size: 16px; display: flex; gap: 6px; align-items: center; }
.pk-parts-list { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }
.rq-flow { margin-bottom: 16px; }
.fr-track-status { display: block; }
.bk-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 10px; }
.bk-boxes { margin-bottom: 12px; }
.bk-boxes summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.bk-boxes-table .input, .bk-boxes-table .select { min-width: 64px; }
.bk-hint { font-size: 12.5px; margin: 6px 0 8px; }
.pp-booked { margin: 12px 0; }
.pp-booked > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-booked-empty { padding: 0 16px 12px; margin: 0; }

/* Settings -> User roles (simplified 23 Nov 26: one roles list, a New role button, the editor in three steps) */
.ur-new { position: relative; }
.ur-new > summary { list-style: none; cursor: pointer; }
.ur-new > summary::-webkit-details-marker { display: none; }
.ur-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; padding: 10px; display: grid; gap: 2px; min-width: 240px; }
.ur-menu a { padding: 8px 10px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.ur-menu a:hover, .ur-menu a:focus-visible { background: var(--surface-2); }
.ur-list h3 { font-size: 14.5px; margin: 0; font-weight: 650; }
.ur-offrow td { opacity: .6; }
.ur-ready { margin-top: 16px; }
.ur-ready > summary { list-style: none; }
.ur-ready > summary::-webkit-details-marker { display: none; }
.ur-show { margin-left: auto; }
.ur-ready[open] .ur-show { display: none; }
.ur-ready > summary { cursor: pointer; padding: 14px 16px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ur-editor { display: grid; gap: 14px; }
.ur-title { font-size: 18px; margin: 4px 0 0; }
.ur-step { padding: 16px 18px; }
.ur-step h3 { font-size: 15.5px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.ur-step > p { margin: 0 0 12px; }
.ur-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary, #2563eb); color: #fff; font-size: 13px; }
.ur-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ur-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ur-mod { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 0; min-width: 0; }
.ur-mod legend { font-weight: 650; padding: 0 6px; }
.ur-mod .ur-all { font-size: 12px; margin-left: 6px; }
.ur-sec { display: flex; gap: 8px; align-items: center; padding: 6px 0; font-size: 14px; cursor: pointer; }
.ur-sec.off { opacity: .4; cursor: not-allowed; }
.ur-subs { margin: 0 0 6px 26px; font-size: 12.5px; }
.ur-subs > summary { cursor: pointer; color: var(--muted); }
.ur-sub { display: flex; gap: 6px; align-items: center; padding: 2px 0 2px 10px; color: var(--text-2); border-left: 2px solid var(--border); cursor: pointer; }
.ur-tick { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; cursor: pointer; }
.ur-tick small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ur-note { font-size: 12.5px; margin: 4px 0 0; }
.ur-save { padding: 16px 18px; display: grid; gap: 12px; }
.ur-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ur-switch { margin-top: 14px; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px) auto; align-items: center; }
.ur-switch p { margin: 2px 0 0; font-size: 12.5px; }
@media (max-width: 640px) { .ur-switch { grid-template-columns: 1fr; } }
.ur-intro p { margin: 0; }
.ur-assign { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ur-assign .select { width: 240px; max-width: 100%; }
.ur-assign .input { min-width: 140px; flex: 1 1 160px; }
.ur-commit { display: flex; gap: 8px; flex: 1 1 260px; align-items: center; }
.ur-commit[hidden] { display: none; }
/* People tab: All / per-team filter, one card per team (owner, 23 Nov 26) */
.ur-people-bar { justify-content: space-between; }
.ur-people-bar .search { flex: 0 1 260px; min-width: 180px; }
.ur-people-bar .search .input { width: 100%; }
.ur-who { display: flex; flex-wrap: wrap; gap: 6px; }
.ur-who-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.ur-who-chip span { color: var(--muted); font-weight: 500; }
.ur-who-chip:hover { border-color: var(--primary); }
.ur-who-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.ur-who-chip.active span { color: rgba(255, 255, 255, .8); }
.ur-people-help { margin: 0; padding: 10px 16px; font-size: 13px; }
.ur-group { margin-top: 16px; }
.ur-group-head { padding-bottom: 12px; }
.ur-group[hidden] { display: none; }
.ur-count { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 6px; border-radius: 11px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; vertical-align: middle; }
.ur-people th:first-child, .ur-people td:first-child { width: 36%; }
.ur-name { font-weight: 600; }
.ur-warn { color: var(--danger); }
.ur-none { margin: 16px 4px; }
.ur-disc { grid-template-columns: minmax(0, 1fr) 200px; align-items: center; cursor: default; }
.ur-disc[hidden] { display: none; }
.ur-disc .select { width: 100%; }
.cp-disc-view { padding: 0 16px; margin: 8px 0 0; }
@media (max-width: 640px) { .ur-disc { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .ur-people thead { display: none; }
  .ur-people tr, .ur-people td { display: block; width: auto; }
  .ur-people td:first-child { width: auto; padding-bottom: 4px; border-bottom: 0; }
  .ur-assign .select { width: 100%; }
  .ur-people-bar .search { flex: 1 1 100%; }
}
.ur-extra { margin-top: 8px; font-size: 12.5px; }
.ur-extra > summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.ur-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.ur-off { font-size: 12px; }
/* Customer page -> Edit contact details (owner, 23 Nov 26) */
.cp-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cp-contact-h { font-size: 14.5px; margin: 18px 0 8px; }
.cp-contact-note { font-size: 12.5px; margin: 14px 0; }
.fr-couriers .list-row { align-items: flex-start; }
.fr-couriers .badge { flex-shrink: 0; white-space: nowrap; }
/* a long courier status wraps inside its badge instead of pushing the card (and the page) wider */
.fr-couriers .badge { flex-shrink: 1; min-width: 0; max-width: 55%; height: auto; min-height: 22px; padding: 3px 8px; border-radius: 11px;
  white-space: normal; overflow-wrap: anywhere; text-align: center; line-height: 1.3; }
.fr-env { font-size: 11.5px; overflow-wrap: anywhere; }
.fr-couriers-note { font-size: 12.5px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.bk-join { padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 10px; }
.bk-join-title { font-weight: 600; margin-bottom: 2px; }
.bk-join-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }

/* Warehouse dashboard boxes (apps/dashboard/floor.py, owner 20 Nov 26) */
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.flow-step { display: grid; gap: 2px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.flow-step:hover { background: var(--surface-hover); }
.flow-label { font-size: 13px; font-weight: 600; }
.flow-n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.flow-foot { font-size: 12px; color: var(--muted); }
.flow-new { border-top: 4px solid var(--sky); }
.flow-picking { border-top: 4px solid var(--violet, var(--primary)); }
.flow-packed { border-top: 4px solid var(--amber); }
.flow-hold { border-top: 4px solid var(--rose); }
.flow-dispatched { border-top: 4px solid var(--emerald, var(--success)); }
@media (max-width: 700px) { .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pick-now { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 420px; overflow: auto; }
.pick-now li { display: grid; gap: 6px; }
.pick-now-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pick-now-top .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-now-who { font-weight: 600; white-space: nowrap; }
.pick-now-foot { font-size: 12px; color: var(--muted); }
.pick-now-held .pick-now-foot { color: var(--rose); }
.pick-now-fill { background: var(--sky); }
.pick-now-fill.pct-0 { width: 2%; } .pick-now-fill.pct-10 { width: 10%; } .pick-now-fill.pct-20 { width: 20%; }
.pick-now-fill.pct-30 { width: 30%; } .pick-now-fill.pct-40 { width: 40%; } .pick-now-fill.pct-50 { width: 50%; }
.pick-now-fill.pct-60 { width: 60%; } .pick-now-fill.pct-70 { width: 70%; } .pick-now-fill.pct-80 { width: 80%; }
.pick-now-fill.pct-90 { width: 90%; } .pick-now-fill.pct-100 { width: 100%; }
.marker-amber { background: var(--amber); }

/* The warehouse login's menu (owner, 20 Nov 26): Workspace, Warehouse, Orders, Customers, Freight, Communication.
   Other groups are left out of its menu (their pages still open from links). */
.nav-warehouse > .nav-group { order: 50; }
.nav-warehouse > .nav-group[data-nav-group="workspace"] { order: 1; }
.nav-warehouse > .nav-group[data-nav-group="warehouse"] { order: 2; }
.nav-warehouse > .nav-group[data-nav-group="orders"] { order: 3; }
.nav-warehouse > .nav-group[data-nav-group="customers"] { order: 4; }
.nav-warehouse > .nav-group[data-nav-group="freight"] { order: 5; }
.nav-warehouse > .nav-group[data-nav-group="email"] { order: 6; }
.nav-warehouse > .nav-group:not([data-nav-group="workspace"]):not([data-nav-group="warehouse"]):not([data-nav-group="orders"]):not([data-nav-group="customers"]):not([data-nav-group="freight"]):not([data-nav-group="email"]) { display: none; }
.fr-manage { margin-top: 4px; }

/* Orders list (owner, 20 Nov 26: status tabs outside, "Make UI Better") */
.status-tabs { width: 100%; max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.status-tabs .tab { white-space: nowrap; flex: 0 0 auto; }
.status-tabs .tab .badge { font-weight: 600; }
.status-tabs .tab.active .badge { background: var(--primary); color: #fff; border-color: transparent; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.st-new { background: var(--info); }
.st-quote { background: var(--violet); }
.st-pick, .st-pack, .st-new-backorder { background: var(--warning); }
.st-picking, .st-packed { background: var(--warning); }
.st-draft { background: var(--muted); }
.st-hold { background: var(--danger); }
.st-dispatched { background: var(--success); }
.st-cancelled, .st-on-hold { background: var(--danger); }
.st-all { background: var(--text-2); }
/* Orders -> Delivery updates and its sub-tabs (owner, 24 Nov 26) */
.st-delivery, .st-transit { background: var(--info); }
.st-attention { background: var(--danger); }
.st-pickup { background: var(--warning); }
.st-onboard { background: var(--violet); }
.st-delivered { background: var(--success); }
.orders-list .toolbar { flex-wrap: wrap; }
.orders-list .toolbar { gap: 8px; }
.orders-list .toolbar .search { flex: 1 1 200px; min-width: 180px; }
.orders-list .toolbar .select { flex: 0 1 auto; min-width: 100px; max-width: 160px; }
.orders-list .toolbar input[type="date"] { flex: 0 0 128px; width: 128px; padding-left: 8px; padding-right: 4px; }
.orders-list .toolbar .tb-apply { width: 36px; padding: 0; justify-content: center; }
.tb-btn { height: 36px; }
.orders-list .table td { padding-top: 9px; padding-bottom: 9px; }
.orders-list .table td.placed { white-space: nowrap; }
.orders-list .ord-wh-now { color: var(--primary); font-weight: 600; }  /* who has it in the warehouse now (owner, 24 Nov 26) */
.orders-list .cust-user { font-size: 12px; white-space: nowrap; }
.orders-list tr[data-row-href] { cursor: pointer; transition: background .12s; }
.orders-list tr[data-row-href]:hover td { background: var(--surface-2); }

/* Order page: sales manager delivery waiting for pickup (owner, 20 Nov 26) */
.rep-pickup { margin-bottom: 20px; }
.rep-pickup-note { margin: 0 0 10px; font-size: 13px; }
.pod-dispatch-note { margin: 0 0 10px; }
.pc-finish-note { margin: 8px 0 0; font-size: 13px; text-align: center; }


/* Settings -> Pop-ups & alerts (templates/popups/index.html) */
.popup-settings { display: grid; gap: 16px; }
.ps-group { padding: 0; overflow: hidden; }
.ps-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ps-head h2 { margin: 0; font-size: 15px; }
.ps-head .muted { font-size: 13px; }
.ps-row { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px 24px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.ps-row:last-child { border-bottom: 0; }
.ps-main { display: flex; gap: 12px; align-items: flex-start; }
.ps-main .switch { margin-top: 1px; }
.ps-text { display: grid; gap: 2px; min-width: 0; }
.ps-text strong { font-size: 14px; }
.ps-what { font-size: 12.5px; color: var(--muted); }
.ps-changed { font-size: 11.5px; color: var(--muted); opacity: .8; }
.ps-opts { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.ps-field { display: grid; gap: 4px; }
.ps-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ps-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-chip { position: relative; cursor: pointer; }
.ps-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ps-chip span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.ps-chip input:checked + span { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-color: var(--primary); color: var(--primary); }
.ps-chip input:checked + span::before { content: "\2713"; font-weight: 700; margin-right: 4px; }
.ps-chip input:focus-visible + span { box-shadow: var(--ring); }
.ps-freq { width: 160px; }
.ps-fixed { display: inline-block; width: 160px; padding: 7px 0; font-size: 13px; color: var(--muted); }
.ps-off .ps-text strong { color: var(--muted); }
.ps-off .ps-opts { opacity: .4; }
.ps-save { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.ps-save .muted { font-size: 12.5px; }
.ps-save .btn { margin-right: 64px; }  /* clear of the Jordan chat bubble */
@media (max-width: 900px) {
  .ps-row { grid-template-columns: 1fr; }
  .ps-opts { padding-left: 50px; }
}
@media (max-width: 520px) {
  .ps-opts { padding-left: 0; gap: 12px; }
  .ps-field, .ps-freq, .ps-fixed { width: 100%; }
}

/* Order edit page (templates/orders/edit_admin.html; owner 21 Nov 26: details, items, totals, Save at the bottom) */
.oe { display: grid; gap: 16px; }
.oe > * { min-width: 0; }  /* the items table scrolls inside its card on a phone, not the page */
.oe-back { margin-bottom: 8px; }
.oe-title { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.oe-step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 750; margin-right: 6px; }
.oe-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.oe-details .oe-notes { grid-column: 1 / -1; margin-bottom: 0; }
.oe-hint { font-size: 12.5px; }
.oe .oe-search { max-width: none; flex: 1; }
.oe-prod { display: flex; gap: 12px; align-items: center; }
.edit-lines th.c, .edit-lines td.c { text-align: center; }
.oe-sample { display: inline-flex; padding: 6px; cursor: pointer; }
.oe-sample input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.edit-lines tr.is-sample td { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.chip-sample { background: var(--primary-soft); color: var(--primary); }
.sku-results .sku-result { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.sku-results .sku-result .grow { flex: 1; min-width: 0; }
.sku-results .sku-result button { display: inline-flex; width: auto; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 8px; flex: none; }
.sku-results .sku-result .btn-ghost { border-color: transparent; color: var(--primary); }
.sku-results .sku-note { padding: 8px 12px; margin: 0; }
.oe-totals { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.oe-totals .oe-discount { flex: 1 1 320px; margin-bottom: 0; }
.oe-totals .totals { flex: 0 0 300px; }
.oe-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.07); }
.oe-bar-sum { flex: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.oe-bar-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.oe-bar-sum strong { font-size: 18px; }
.oe-bar-sum .muted { font-size: 12.5px; }
.oe-bar #save-order { margin-right: 64px; }  /* clear of the Jordan chat bubble */
.oe-payments { margin-top: 28px; }
@media (max-width: 900px) { .oe-details { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .oe-details { grid-template-columns: 1fr; }
  .oe-totals .totals { flex: 1 1 100%; }
  .oe-bar { flex-wrap: wrap; }
  .oe-bar-sum { flex: 1 1 100%; }
  .oe-bar .btn { flex: 1; }
  .oe-bar #save-order { margin-right: 64px; }
}

/* Free samples report (templates/reports/free_samples.html) */
/* Free samples report (owner, 21 Nov 26: "Fix UI"): filter bar, stat cards, group-by tabs, share bars */
.fs-head .page-sub { max-width: 680px; }
.fs-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; margin-bottom: 16px; }
.fs-f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 650; color: var(--muted); }
.fs-f .input, .fs-f .select { height: 38px; width: 160px; }
.fs-f-wide .select { width: 220px; }
.fs-filter .btn { height: 38px; }
.fs-range { margin-left: auto; align-self: center; font-size: 13px; }
.fs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.fs-stats .stat { gap: 10px; padding: 18px 20px; }
.fs-stats .stat-value { font-size: 26px; }
.fs-stats .stat-foot { min-height: 16px; }
.fs-card-head { flex-wrap: wrap; gap: 10px; }
.fs-by { margin: 0 0 0 auto; padding: 4px; }
.fs-by .tab { padding: 5px 12px; font-size: 13px; }
.fs-share-h { width: 26%; }
.fs-share { display: flex; align-items: center; gap: 10px; }
.fs-share .num { font-size: 12.5px; min-width: 34px; }
.fs-bar { flex: 1; height: 8px; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; appearance: none; }
.fs-bar::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.fs-bar::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.fs-bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.fs-table tfoot th { font-weight: 700; border-top: 1px solid var(--border); }
.empty .stat-icon .icon { width: 24px; height: 24px; }
.fs-detail { margin-top: 16px; }
@media (max-width: 640px) {
  .fs-f, .fs-f .input, .fs-f .select, .fs-f-wide .select { width: 100%; }
  .fs-filter .btn { width: 100%; }
  .fs-range { margin-left: 0; }
  .fs-by { margin-left: 0; }
  .fs-share-h, .fs-share { display: none; }
}

/* Free samples box on the order page and "Asked by" on the edit page (owner, 21 Nov 26: "so we keep track") */
.fs-order { margin-bottom: 20px; }
.fs-order-who { font-size: 13px; }
.oe-asked { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.oe-asked .input { height: 30px; font-size: 13px; max-width: 260px; }

/* Store visit: Save as draft with the manager's signature (templates/visits/visit.html; owner, 21 Nov 26) */
.draft-sig { height: 140px; }
.draft-sign-note { margin: 0 0 12px; font-size: 13.5px; }
.draft-signed-box { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.draft-signed-box img { width: 180px; max-width: 45%; height: 80px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.draft-signed-box .cell-sub { display: block; margin-bottom: 6px; }
.op-line .preview-thumb { width: 40px; height: 40px; grid-column: 1; grid-row: 1 / span 2; }
.op-line .op-name { grid-column: 2; }  /* product picture in the visit's order panel (owner, 21 Nov 26) */
/* Draft orders: autosave note under the buttons (templates/orders/builder.html; owner, 21 Nov 26) */
.autosave-state { margin: 4px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.autosave-state.is-bad { color: var(--danger); }

/* Order payments: two steps (owner, 21 Nov 26) and date box kept inside its column (iPad Safari draws it wider) */
.pay-step-title { margin-top: 18px; }
.pay-actions { display: flex; gap: 10px; }
.pay-grid .input, .pay-grid .select { min-width: 0; width: 100%; max-width: 100%; }
.pay-grid input[type="date"] { display: block; -webkit-appearance: none; appearance: none; text-align: left; }

/* Aged receivables: More filters (owner, 21 Nov 26) */
.ar-more { flex: 1 1 100%; }
.ar-more > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.ar-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 8px; }
.ar-field { display: flex; flex-direction: column; gap: 4px; }
.ar-more-btns { display: flex; gap: 8px; margin-top: 10px; }
/* Pick board: marketplace orders, one card each, headed by the buyer with a small marketplace tag (owner, 21 Nov 26) */
.pp-market { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 11.5px; font-weight: 650; vertical-align: middle; }
/* Freight -> Booking history (owner, 21 Nov 26) */
.freight-hist-filter { flex-wrap: wrap; gap: 8px; }
.freight-hist-filter .input[type="search"] { min-width: 240px; }
.freight-hist-range { margin-left: auto; font-size: 12.5px; }
/* Product page + edit page: side index of the sections (static/js/product_index.js; owner, 21 Nov 26) */
.has-pidx .pidx-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.pidx-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* one even 16px gap between every block (some cards had their own margins, some none: Where it's sold touched Sourcing) */
.pidx-main > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.pidx-main section.card { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.pidx { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px 8px; }
.pidx-head { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; }
.pidx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pidx-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; border-left: 3px solid transparent;
  color: var(--text-2); font-size: 13.5px; font-weight: 600; text-decoration: none; line-height: 1.25; }
.pidx-link:hover { background: var(--surface-2); color: var(--text); }
.pidx-link.is-on { background: var(--primary-soft); color: var(--primary); border-left-color: var(--primary); }
.pidx-link:focus-visible { outline: none; box-shadow: var(--ring); }
.pidx-dot { flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--warning); }
/* narrower screens: the index becomes a strip of buttons under the top bar that scrolls sideways */
@media (max-width: 1100px) {
  .has-pidx .pidx-layout { display: block; }
  .pidx { top: var(--topbar-h); z-index: 5; max-height: none; margin: 0 0 16px; padding: 8px; border-radius: 12px; }
  .pidx-head { display: none; }
  .pidx-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .pidx-list::-webkit-scrollbar { display: none; }
  .pidx-link { white-space: nowrap; border-left: 0; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
  .pidx-link.is-on { background: var(--primary); color: #fff; }
  .pidx-link.is-on .pidx-dot { background: #fff; }
  .pidx-main section.card { scroll-margin-top: calc(var(--topbar-h) + 72px); }
}
/* product page: a form row inside a card body (Sourcing, On sale or switched off) sits flush, no toolbar border */
.pidx-main .card-body > .toolbar { padding: 0; margin-bottom: 12px; border-bottom: 0; }

/* printer offline: one small line (owner, 21 Nov 26: "printer message too big"); static/js/direct_print.js */
#print-alert.print-alert-small { padding: 6px 12px; font-size: 0.85rem; line-height: 1.3; border-radius: 8px; }
.ask-change-note { margin-top: 0; } /* orders/view.html Ask to change */

/* Order page: shelf price labels (apps/picking/pricelabels.py) */
.pl-card { margin-bottom: 20px; border-left: 4px solid var(--warning, #f59e0b); }
.pl-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pl-text { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Product page: shelf price label (apps/picking/pricelabels.py) */
.pl-product { margin-bottom: 16px; }
.pl-form { display: grid; gap: 12px; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.pl-grid .pl-wide { grid-column: 1 / -1; }
.pl-money { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; }
.pl-money .input { font-size: 20px; font-weight: 700; max-width: 140px; }
.pl-copies { max-width: 90px; }
.pl-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pl-hint { font-size: 12.5px; }
@media (min-width: 760px) { .pl-grid .pl-wide { grid-column: span 2; } }
.pl-preview { padding: 0 20px 16px; }
.pl-preview summary { cursor: pointer; font-weight: 600; display: flex; gap: 6px; align-items: center; padding: 4px 0 8px; }
.pl-preview img { display: block; width: 100%; max-width: 520px; border: 1px solid var(--border); border-radius: 6px; background: #fff; margin-bottom: 8px; }

/* apps/accounts/app_only.py: the notice before staff phones and tablets must use the IPL apps */
.app-only-notice { align-items: center; flex-wrap: wrap; }
.app-only-notice .grow { flex: 1; min-width: 0; }
/* credit days (runs) */
.cd-settle > summary { list-style: none; cursor: pointer; }
.cd-settle[open] .rh-form { margin-top: 8px; }
.rh-credit span:last-child { display: flex; gap: 6px; align-items: center; min-height: 38px; }

/* Customer page -> Settings: brands this customer can't buy (owner, 22 Nov 26: the wall of tick boxes was unclear) */
.hb-now { margin: 4px 0 8px; font-size: 14px; }
.hb-box > summary { list-style: none; display: inline-flex; cursor: pointer; }
.hb-box > summary::-webkit-details-marker { display: none; }
.hb-box[open] { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface-2, #f7f8fb); }
.hb-help { display: block; margin: 10px 0; max-width: 760px; }
.hb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.hb-tools .input { max-width: 240px; }
.hb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 14px; max-height: 320px; overflow-y: auto;
  background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.hb-item { margin: 0; padding: 4px 0; }
.hb-item:has(input:checked) .hb-name { font-weight: 700; color: var(--danger, #c81e4a); text-decoration: line-through; }
.hb-none { margin: 8px 0 0; }
.hb-item[hidden] { display: none; }

/* Settings -> Cost access: customer discounts and price level (22 Nov 26) */
.da-intro { margin-top: 0; }
.da-add { margin-top: 10px; }
.da-reason { flex: 1 1 240px; }
.da-log { margin-top: 8px; }

/* New B2B customer: the owner's other store + AI check (owner, 23 Nov 26; templates/leads/_other_store.html) */
.other-store { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 10px; background: var(--surface-2, #f8fafc); }
.other-store [hidden] { display: none !important; }
.other-store .os-answers { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 4px; }
.other-store .os-pick { display: flex; flex-direction: column; gap: 4px; max-width: 520px; }
.other-store .os-info { margin-top: 6px; font-size: 13.5px; }
.other-store .os-list { margin: 4px 0 0 18px; padding: 0; }
.other-store .os-warn { color: var(--warning); font-weight: 600; }
.other-store .os-ai-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.other-store .os-ai-out { border-top: 1px dashed var(--border, #e5e7eb); padding-top: 10px; font-size: 13.5px;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.other-store .os-ai-head { display: flex; gap: 8px; align-items: center; }
.other-store .os-ai-summary { margin: 0; }
.other-store .os-ai-warn { color: var(--warning); }
.other-store .os-conf-high { background: var(--success-soft); color: var(--success); }
.other-store .os-conf-medium { background: var(--warning-soft); color: var(--warning); }
.other-store .os-conf-low { background: var(--surface-hover); }
.other-store .os-cands-title { font-weight: 600; margin-top: 4px; }
.other-store .os-cands { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.other-store .os-cands li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: var(--surface, #fff); }
.other-store .os-cands li .btn { margin-left: auto; }

/* Books -> Bank reconcile: old accounts folded away (owner, 23 Nov 26 "only active now") */
.bank-old { margin-top: 18px; }
.bank-old summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.books-uploads { margin-top: 16px; }
.books-uploads summary { cursor: pointer; list-style: revert; }

/* Books: the bank each line came through, next to its amount (owner, 23 Nov 26 "Add source logo next to payment") */
.rc-amt-row { display: inline-flex; align-items: center; gap: 8px; }
.src-logo { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px;
  border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; color: #fff; line-height: 1; }
.src-logo-airwallex { background: #ff4f1f; }
.src-logo-nab { background: #000; color: #fff; box-shadow: inset 0 -3px 0 #c8102e; }
.src-logo-westpac { background: #d5002b; }
.src-logo-amex { background: #016fd0; }
.src-logo-cba { background: #ffcc00; color: #000; }
.src-logo-anz { background: #007dba; }
.src-logo-xero { background: #13b5ea; border-radius: 50%; min-width: 22px; padding: 0; }
.src-logo-file { background: var(--muted-bg, #e5e7eb); color: var(--text, #111); }
/* small helpers used in place of inline styles (23 Nov 26) */
.u-m0 { margin: 0; }
.u-fs13 { font-size: 13px; }
.u-nowrap { white-space: nowrap; }
.u-w200 { width: 200px; max-width: 100%; }
.bank-feed-link { margin-top: 16px; font-size: 13px; }

/* Order page: line-by-line discount review for admins (owner, 23 Nov 26) */
.line-disc .cell-sub { display: block; }
.line-disc .line-disc-differs { display: inline-block; margin-top: 4px; white-space: nowrap; }
.line-disc-review { margin: 10px 0 0; font-size: 13px; color: var(--muted, #64748b); }
.line-disc-review.is-differ { color: #b45309; }
.line-disc-differs { background: #fff7ed; color: #9a3412; }
:root[data-theme="dark"] .line-disc-differs { background: rgba(249, 115, 22, .18); color: #fdba74; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .line-disc-differs { background: rgba(249, 115, 22, .18); color: #fdba74; } }

/* Fleet -> Invoices: note above the Bills to pay list (23 Nov 26) */
.fl-bills-note { margin: 0; padding: 0 16px 10px; }
/* Documents step grouped by factory (apps/shipdocs/perfactory.py, owner 23 Nov 26) */
.sf-doc-group { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border, #e5e7eb); }
.sf-doc-group-name { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
/* Books: invoice / receipt on a bank line (owner, 23 Nov 26) */
.bank-attach { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0 14px; }
.bank-attach-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.bank-attach-form .label { width: 100%; margin: 0; }
.bank-attach-form .input { max-width: 280px; }
.bank-clip { color: var(--muted, #6b7280); }
/* Books: customer payment from a bank line, totals and the extra (owner, 23 Nov 26) */
.paycust-sum { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2, #f5f6f8); }
.paycust-sum > div { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.paycust-sum strong { font-size: 15px; }
.paycust-over { color: var(--danger, #dc2626); }
.paycust-extra { border: 0; padding: 0; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
[data-confirm-text] { white-space: pre-line; }   /* a confirm can list several lines (bank_paycustomer.js) */
/* A payment Xero has (owner, 23 Nov 26: "Payments sent to xero show xero logo as well so we know its synced") */
.xero-mark { width: 16px; height: 16px; vertical-align: middle; margin-left: 4px; }   /* Xero's own logo (Simple Icons) */
.src-logo-img { width: 20px; height: 20px; flex: none; }
/* Reconcile all accounts: type, search, select on each line; notes for discussion (owner, 23 Nov 26) */
.rc-flow { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rc-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rc-inline .input { flex: 1 1 180px; min-width: 0; }
.rc-inline .rc-tax { flex: 0 1 170px; }
.rc-ignore summary, .rc-notes summary { cursor: pointer; text-decoration: underline; font-size: 13px; }
.rc-ignore { display: inline-block; }
.rc-notes { margin-top: 8px; font-size: 13px; }
.rc-note { padding: 6px 0; border-bottom: 1px solid var(--border, #e5e7eb); }
.rc-notes .rc-inline { margin-top: 6px; }

/* Customer page: Sign-up tab (owner, 23 Nov 26) */
.su-form { margin-bottom: 16px; }
.su-form .card-head { flex-wrap: wrap; gap: 8px; }
.su-empty { margin: 0; }
.su-dates { margin: 0 0 12px; }
.su-head { font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.su-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.su-files a { display: inline-flex; align-items: center; gap: 6px; }
.su-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; }
.su-matched { background: #eff6ff; color: #1d4ed8; }
:root[data-theme="dark"] .su-matched { background: rgba(59, 130, 246, .18); color: #93c5fd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .su-matched { background: rgba(59, 130, 246, .18); color: #93c5fd; } }
.rc-row { transition: opacity .3s ease, transform .3s ease; }
.rc-row.rc-gone { opacity: 0; transform: translateX(24px); }
/* Reconcile: customer payment on the line (owner, 23 Nov 26) */
.rc-cust { margin-top: 8px; padding: 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; font-size: 13px; }
.rc-cust-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-cust table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.rc-cust td, .rc-cust th { padding: 4px 6px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; }
.rc-cust td.r, .rc-cust th.r { text-align: right; }
.rc-cust input.num { max-width: 110px; text-align: right; }
.rc-cust-sum { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; }
.rc-cust-sum strong { font-variant-numeric: tabular-nums; }
.rc-refund-short { opacity: .55; }  /* a credit with less left than the money out */
.rc-cust-extra { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
/* Reconcile: the line's other actions as one tidy row of small buttons (owner, 23 Nov 26 "Fix better UI") */
.rc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border, #e5e7eb); }
.rc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px; background: var(--card, #fff); color: var(--text, #1f2937); font-size: 12.5px; line-height: 1.4;
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.rc-chip:hover { border-color: var(--primary, #e11d48); color: var(--primary, #e11d48); }
.rc-chip .badge { padding: 0 6px; font-size: 11px; }
.rc-chip-more { margin-left: auto; border-color: transparent; }
.rc-pop { display: contents; }
.rc-pop > summary { list-style: none; }
.rc-pop > summary::-webkit-details-marker { display: none; }
.rc-pop[open] > summary { border-color: var(--primary, #e11d48); color: var(--primary, #e11d48); }
.rc-pop-body { order: 99; flex-basis: 100%; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f5f6f8); }
/* Reconcile: the bank's logo at the foot of each line (owner, 23 Nov 26) */
.rc-source { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; }
.rc-bank-logo { height: 12px; width: auto; display: block; }
.rc-bank-logo-amex { height: 16px; }

/* Draft orders list: Delete next to Open (23 Nov 26) */
.dr-del { display: inline-block; margin: 0 0 0 4px; }
.dr-quote { margin-left: 4px; }
.dr-del-btn { color: var(--danger, #dc2626); }
.rc-already { display: flex; flex-direction: column; gap: 6px; }
.rc-already form { display: flex; gap: 6px; }
/* Reconcile: the customer search folds away when the money doesn't look like a customer's (owner, 23 Nov 26) */
.rc-custbox > summary { list-style: none; width: fit-content; }
.rc-custbox > summary::-webkit-details-marker { display: none; }
.rc-custbox[open] > summary { display: none; }
.rc-custbox { display: flex; flex-direction: column; gap: 6px; }
.rc-pickpay { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border, #e5e7eb); }
/* Reconcile: Matched already panel and the statement pop-up (owner, 23 Nov 26 "better UI and explanation, statement view") */
.rc-already { gap: 8px; }
.rc-already-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rc-already-why { margin: 0; color: var(--text-muted, #4b5563); line-height: 1.5; }
.rc-already-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-already-table th, .rc-already-table td { padding: 5px 6px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; }
.rc-already-table .r { text-align: right; }
.rc-already-table tfoot td { border-bottom: 0; }
.rc-already-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-stmt { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.rc-stmt::backdrop { background: rgba(15, 23, 42, .45); }
.rc-stmt-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; max-height: calc(100vh - 48px); }
.rc-stmt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rc-stmt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.rc-stmt-tiles > div { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f5f6f8); font-size: 12.5px; }
.rc-stmt-tiles strong { font-size: 15px; }
.rc-stmt-scroll { overflow: auto; min-height: 0; flex: 1; }
.rc-stmt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-stmt-table th, .rc-stmt-table td { padding: 6px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; vertical-align: top; }
.rc-stmt-table .r { text-align: right; white-space: nowrap; }
.rc-stmt-pay td { background: rgba(22, 163, 74, .06); }
.rc-stmt-foot { display: flex; justify-content: flex-end; }
.rc-inline .rc-contact { flex: 0 1 170px; }   /* From / To name on the line's Save row (owner, 23 Nov 26) */
.rc-addsite { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.rc-addsite .input { flex: 1 1 220px; }
.rc-addsite .rc-cust-list { flex-basis: 100%; }
/* Reconcile: one box to settle a deposit (statement payments + open invoices + sites) (owner, 23 Nov 26) */
.rc-settle { display: flex; flex-direction: column; gap: 10px; }
.rc-settle-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rc-settle-sec table { width: 100%; border-collapse: collapse; }
.rc-settle-title { font-weight: 600; margin-bottom: 4px; }
/* Reconcile: Xero's four tabs on each line (owner, 23 Nov 26) */
.rc-tabbar { display: flex; gap: 2px; border-bottom: 1px solid var(--border, #e5e7eb); margin-bottom: 10px; }
.rc-tab { border: 0; background: none; padding: 6px 12px; font-size: 13px; color: var(--text-muted, #6b7280); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rc-tab.on { color: var(--text, #111827); font-weight: 600; border-bottom-color: var(--primary, #e11d48); }
.rc-pane { display: flex; flex-direction: column; gap: 8px; }
.rc-sugg { display: flex; gap: 10px; align-items: flex-start; }
.rc-sugg-text { flex: 1; }
.rc-find-title { font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.rc-create { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.rc-field { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--text-muted, #6b7280); flex: 1 1 140px; }
.rc-field-wide { flex: 2 1 220px; }
.rc-more { align-self: flex-end; font-size: 12.5px; margin-top: 6px; display: inline-flex; align-items: center; gap: 2px; }
.rc-adjust { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px 22px; }
.rc-adjust .input { flex: 1 1 200px; }
/* Reconcile: type-and-pick account pop-up grouped by head (owner, 23 Nov 26) */
.rc-acc-wrap { position: relative; }
.rc-acc-pop { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin-top: 2px; max-height: 300px; overflow: auto;
  background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.rc-acc-head { position: sticky; top: 0; padding: 5px 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted, #6b7280); background: var(--surface-2, #f5f6f8); }
.rc-acc-head em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--success, #15803d); }
.rc-acc-opt { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; font-size: 13px; color: var(--text, #111827); cursor: pointer; }
.rc-acc-opt:hover, .rc-acc-opt.on { background: rgba(225, 29, 72, .08); }
.rc-acc-opt b { font-variant-numeric: tabular-nums; margin-right: 6px; }
.rc-acc-none { padding: 8px 10px; font-size: 12.5px; color: var(--text-muted, #6b7280); }
.rc-warn { flex-basis: 100%; padding: 6px 10px; border-radius: 6px; background: #fff7ed; color: #9a3412; font-size: 12.5px; }
/* Reconcile: To do / Reconciled switch and the reconciled list (owner, 23 Nov 26) */
.rc-views { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 10px; border-radius: 10px; background: var(--surface-2, #f1f2f5); }
.rc-view { padding: 6px 14px; border-radius: 8px; font-size: 13.5px; color: var(--text-muted, #6b7280); text-decoration: none; }
.rc-view.on { background: var(--card, #fff); color: var(--text, #111827); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.rc-done td { vertical-align: top; }
.rc-done-desc { overflow-wrap: anywhere; }
.rc-done .rc-in { color: var(--success, #15803d); }
.rc-edit { display: inline; }
.rc-acc-tab { display: inline-flex; align-items: center; gap: 6px; }
.rc-tab-logo { height: 12px; width: auto; }
.rc-tab-logo.rc-bank-logo-amex { height: 16px; }

/* Reconcile: Find & select invoices of any customer, and a remittance's invoices (23 Nov 26) */
.rc-anyinv .rc-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 6px; }
.rc-anyinv .rc-inline .input { flex: 1 1 200px; }
.rc-anyinv .rc-inline .rc-anyinv-amt { flex: 0 1 120px; }
.rc-remit-list { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; }
.rc-remit-list .text-danger { font-weight: 500; }

/* Reconcile, all accounts (books/bank_all.html): one card per bank line beside what to do with it (owner, 24 Nov 26: "Ui can be better") */
.rcb-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.rcb-search { margin: 0; flex: 2 1 220px; }
.rcb-check { display: flex; gap: 6px; align-items: center; font-size: 13.5px; }
.rcb-bulk { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 14px 0 6px; }
.rcb-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.rcb-list .rc-row { display: grid; grid-template-columns: minmax(0, 5fr) 24px minmax(0, 6fr); gap: 8px; align-items: stretch; }
.rcb-list .rc-line, .rcb-list .rc-do { background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 14px 16px; }
.rcb-list .rc-line { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.rcb-day { font-size: 12.5px; font-weight: 600; color: var(--text-muted, #6b7280); }
.rcb-amt { white-space: nowrap; }
.rcb-amt .num { font-size: 18px; font-weight: 700; color: var(--text, #111827); }
.rcb-amt.in .num { color: var(--success, #15803d); }
.rcb-dir { font-size: 12px; color: var(--text-muted, #6b7280); margin-right: 2px; }
.rcb-payee { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.rcb-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-muted, #6b7280); }
.rcb-hold { padding: 0 7px; border-radius: 999px; background: var(--warning-soft, #fef3c7); color: var(--text, #111827); }
.rcb-list .rc-source { gap: 8px; }
.rcb-acct { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2, #f3f4f6); color: var(--text, #111827); }
.rcb-src { font-size: 12px; color: var(--text-muted, #6b7280); }
.rcb-list .rc-arrow { display: flex; align-items: center; justify-content: center; color: var(--text-muted, #94a3b8); font-size: 18px; }
.rcb-list .rc-small { font-size: 12.5px; }
.rcb-list .rc-tick { margin-top: 4px; }
.rcb-list .rc-create .rc-field, .rcb-list .rc-create .rc-field-wide { flex: 1 1 190px; }
.rc-done .rc-small { font-size: 12.5px; }
@media (max-width: 820px) { .rcb-list .rc-row { grid-template-columns: 1fr; } .rcb-list .rc-arrow { display: none; } }

/* Phone width fixes (24 Nov 26): pages must never scroll sideways on a 375px phone */
.modal-foot-flush { margin: 0 -20px -20px; } /* a modal's last footer, flush with the modal edges (was an inline style) */
.es-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; } /* Settings → Email sending: staff alerts card */
.fx-settings-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; } /* Files: folder settings card */
.toolbar .select, .toolbar input[type=file] { max-width: 100%; } /* a select with long option names shrinks to the row */
code { overflow-wrap: anywhere; } /* long addresses (URLs, scopes) break instead of widening the page */
@media (max-width: 719px) { .card-head { flex-wrap: wrap; } }

/* Lock screen in the IPL apps with Face ID / fingerprint set up: the PIN is a fallback, folded away (24 Nov 26) */
.lock-alt { margin-top: 12px; }
.lock-alt > summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; padding: 8px 0; list-style: none; }
.lock-alt > summary::-webkit-details-marker { display: none; }
.lock-alt > summary:hover { color: var(--text); }

/* a button while its order is being sent (rep order screen, 24 Nov 26) */
.btn.is-sending { opacity: 1; pointer-events: none; cursor: progress; }
.btn-spin { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: btn-spin .7s linear infinite; vertical-align: -2px; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spin { animation-duration: 2s; } }

/* Team inbox: Metro new-site email panel (templates/teaminbox/_metro.html) */
.tim { margin-bottom: 12px; border-left: 4px solid var(--primary, #1d4ed8); }
.tim-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tim-sub { margin: 4px 0 8px; font-size: 13px; }
.tim-steps { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
.tim-steps.tim-done { list-style: none; padding-left: 0; }
.tim-steps.tim-done li { display: flex; gap: 6px; align-items: flex-start; }
.tim-steps.tim-done li .icon-sm { color: var(--success, #15803d); flex: none; margin-top: 3px; }
.tim-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; }
.tim-fields label { font-size: 12.5px; display: grid; gap: 3px; }
.tim-hint { font-size: 12.5px; }
.tim-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tim-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 12px; margin: 0; font-size: 13px; }
.tim-facts dt { color: var(--muted, #6b7280); font-size: 12px; }
.tim-facts dd { margin: 0; overflow-wrap: anywhere; }

/* Team inbox: How we handle emails (templates/teaminbox/handling.html) */
.tih-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tih-card { margin-bottom: 12px; }
.tih-off { opacity: .7; }
.tih-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tih-name { font-size: 17px; margin: 0 0 4px; display: flex; align-items: center; gap: 6px; }
.tih-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.tih-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 10px; }
@media (max-width: 900px) { .tih-grid { grid-template-columns: 1fr; } }
.tih-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #6b7280); margin: 0 0 4px; }
.tih-text { font-size: 13.5px; margin: 0 0 10px; }
.tih-steps { margin: 0 0 10px; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.tih-instr { white-space: pre-line; font-size: 13.5px; line-height: 1.55; background: var(--surface-2, #f8fafc); border-radius: 8px; padding: 10px 12px; }
.tih-by { font-size: 12px; margin: 6px 0 0; }
.tih-edit { margin-top: 10px; }
.tih-edit summary { cursor: pointer; font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.tih-form { display: grid; gap: 8px; margin-top: 8px; }
.tih-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tih-fields label, .tih-wide { font-size: 12.5px; display: grid; gap: 3px; }
.tih-del { margin-top: 6px; }
.tih-onmail { margin-bottom: 12px; border-left: 4px solid var(--warning, #d97706); }
.tim-unsure { margin: 0 0 10px; }

/* New order: the orders in progress hide once a store is chosen (24 Nov 26) */
.visit-progress[hidden] { display: none; }

/* Arrange menu: each person's own order of the side menu (static/js/menu_order.js, apps/accounts/menu_order.py) */
.menu-arrange-bar { display: flex; align-items: center; gap: 8px; padding: 6px 4px 8px; flex-wrap: wrap; }
.menu-arrange-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 2px;
  color: var(--muted, #6b7280); font-size: 12.5px; cursor: pointer; }
.menu-arrange-btn:hover { color: var(--text, #111827); }
.menu-arrange-actions { display: inline-flex; gap: 6px; }
.menu-arrange-actions[hidden], .menu-arrange-btn[hidden] { display: none; }
.nav-arranging details[data-nav-group] > summary { cursor: default; outline: 1px dashed var(--border, #d1d5db); outline-offset: -2px; border-radius: 8px; }
.menu-move { display: inline-flex; gap: 4px; margin-left: auto; }
.menu-move-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border, #d1d5db); background: var(--surface, #fff);
  font-size: 15px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; color: var(--text, #111827); }
.menu-move-btn:hover { background: var(--hover, #f3f4f6); }
.acct-change-form .acct-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.acct-change-form .acct-field .input, .acct-change-form .acct-field .select { flex: 0 1 auto; }

/* Inside the IPL apps (the ipl_app cookie: html.ipl-app, viewport-fit=cover) the page reaches the top of the screen:
   keep clear of the iPhone / iPad status bar (time, Wi-Fi, battery) and the notch (owner, 24 Nov 26: "Date other things
   overlapping on IOS app"). On Android and in browsers the insets are 0, so nothing moves. */
html.ipl-app { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
html.ipl-app body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); z-index: 2147483001;
  background: var(--surface, #fff); pointer-events: none; }
html.ipl-app .topbar, html.ipl-app .shop-top { top: env(safe-area-inset-top); }
html.ipl-app .sidebar { top: env(safe-area-inset-top); left: env(safe-area-inset-left); height: calc(100vh - env(safe-area-inset-top));
  height: calc(100dvh - env(safe-area-inset-top)); }

/* sign-up: Edit details box at the 1st and 2nd checks (owner, 24 Nov 26) */
.signup-edit { margin-top: 20px; }
.signup-edit > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.signup-edit > summary::-webkit-details-marker { display: none; }
.signup-edit[open] > summary { border-bottom: 1px solid var(--border, #e5e7eb); }

/* a website Quote still with its sales manager (apps/orders/webreview.py, 24 Nov 26) */
.badge.rep-wait, .chip.rep-wait { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  background: var(--warning-soft, #fef3c7); color: var(--warning-strong, #92400e); border: 1px solid transparent; }
.badge.rep-wait + .cell-sub { white-space: nowrap; }
.menu-arrange-note { flex-basis: 100%; font-size: 12px; color: var(--danger, #b4123e); }
.visit-missing ul { margin: 6px 0; padding-left: 18px; } .visit-missing li { margin: 4px 0; } .visit-missing .btn { margin-left: 6px; }

/* Take a payment: customer credit first (owner, 24 Nov 26) */
.tp-credit-note { margin: 0 0 10px; }
.tp-credit-only { padding: 10px 12px; border: 1px solid var(--primary); border-radius: 10px; background: var(--primary-soft); margin-bottom: 12px; }
.tp-credit-only[hidden] { display: none; }
.tp-credit-only .btn { width: 100%; margin-top: 8px; }
.sp-pay-credit { font-size: 13px; margin: 6px 0 0; }
.pay-credit-first { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-bottom: 6px; }
.pay-credit-first > div { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.pay-credit-first strong { font-size: 16px; }
.pay-credit-note { font-size: 12px; margin: 0 0 10px; }
@media (max-width: 640px) { .tp-table th:nth-child(3), .tp-table td:nth-child(3) { display: none; } }
/* Customer credit limit (owner, 24 Nov 26) */
.cl-view { margin: 4px 0 2px; font-weight: 700; font-size: 15px; }
.cl-why-needed { border-color: var(--warning, #d97706); }
/* Money recorded by hand: one flow on the order page and Take a payment -> By hand (templates/payments/_by_hand.html,
   owner 24 Nov 26) */
.ph { width: 100%; min-width: 0; display: grid; gap: 12px; }
.ph .segmented { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; max-width: 560px; }
.ph .segmented label { min-width: 0; padding: 0 6px; text-align: center; line-height: 1.15; }
.ph .segmented input:checked + label { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
@media (max-width: 420px) { .ph .segmented label { font-size: 13px; gap: 4px; } }
.ph-grid .ph-bank { grid-column: 1 / -1; }
.ph-grid .field[hidden] { display: none; }
.tp-pane .ph-grid { grid-template-columns: minmax(0, 1fr); }
.ph-title { margin-top: 0; }
.ph-alloc { padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: var(--surface-2, #f9fafb); min-width: 0; }
.ph-alloc-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.ph-alloc-title .muted { font-weight: 400; font-size: 12px; }
.ph-table-wrap { max-height: 320px; overflow: auto; }
.ph-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ph-table th, .ph-table td { padding: 4px 6px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; vertical-align: middle; }
.ph-table th { font-size: 12px; color: var(--text-2); font-weight: 600; }
.ph-table .r { text-align: right; }
.ph-table .ph-tick-col { width: 28px; }
.ph-table .ph-inv .badge { margin-left: 4px; }
.ph-table .cell-sub { display: block; }
.ph-amt { width: 96px; max-width: 100%; text-align: right; }
.ph-sum { margin-top: 8px; font-size: 13px; font-weight: 600; }
.ph-sum.is-bad { color: var(--danger, #b91c1c); }
.ph-extra { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-size: 13px; }
.ph-extra[hidden] { display: none; }
.tp-pane .ph .pay-actions .ph-submit { width: 100%; justify-content: center; }
@media (max-width: 420px) { .ph-amt { width: 78px; } .ph-table th, .ph-table td { padding: 4px 3px; } }

/* Money by hand, cleaner (owner, 24 Nov 26: "UI is very bad"): the layout follows the box's own width (narrow side panel
   on Take a payment, wide on the order page), a proper summary box and a clear credit choice */
.ph { container-type: inline-size; gap: 14px; }
.ph .segmented.ph-methods { display: grid; grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; max-width: none; }
.ph .ph-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.ph .ph-grid .field { margin: 0; min-width: 0; }
.ph .ph-grid .ph-bank, .ph .ph-grid .field:has([name="note"]) { grid-column: 1 / -1; }
.ph .ph-grid .input, .ph .ph-grid .select { width: 100%; min-width: 0; }
.ph .ph-bank .cell-sub { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--text-muted, #6b7280); }
@container (min-width: 720px) {
  .ph .ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ph .ph-grid .ph-bank { grid-column: span 2; }
  .ph .ph-grid .field:has([name="note"]) { grid-column: auto; }
}
.ph .ph-alloc { background: var(--card, #fff); padding: 12px; }
.ph .ph-alloc-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 8px; }
.ph .ph-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted, #6b7280); padding: 6px; }
.ph .ph-table td { padding: 8px 6px; }
.ph .ph-table tr:last-child td { border-bottom: 0; }
.ph .ph-amt { width: 110px; }
.ph .ph-sum { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: var(--surface-2, #f9fafb);
  font-size: 13px; font-weight: 400; display: grid; gap: 2px; }
.ph .ph-sum:empty { display: none; }
.ph .ph-sum-row { display: flex; justify-content: space-between; gap: 12px; }
.ph .ph-sum-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph .ph-sum-row.head { font-weight: 600; padding-bottom: 4px; border-bottom: 1px dashed var(--border, #e5e7eb); margin-bottom: 2px; }
.ph .ph-sum-row:not(.head):not(.total) span { color: var(--text-muted, #6b7280); padding-left: 10px; }
.ph .ph-sum-row.total { font-weight: 600; padding-top: 4px; border-top: 1px solid var(--border, #e5e7eb); margin-top: 2px; }
.ph .ph-sum-msg { color: var(--text-muted, #6b7280); }
.ph .ph-sum.is-bad { border-color: var(--danger, #b91c1c); }
.ph .ph-sum.is-bad .ph-sum-msg { color: var(--danger, #b91c1c); font-weight: 600; }
.ph .ph-extra { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--success-soft, #ecfdf5); font-weight: 500; }
.ph .pay-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
@container (max-width: 520px) { .ph .pay-actions .ph-submit { flex: 1; justify-content: center; } }

/* Reconciliation report (apps/receivables/recon.py, owner 24 Nov 26) */
.rr-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rr-filter .field { margin: 0; min-width: 140px; }
.rr-filter .rr-q { flex: 1 1 220px; }
.rr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 14px 0; }
.rr-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  background: var(--card, #fff); color: inherit; text-decoration: none; border-left-width: 4px; }
.rr-tile .k { font-size: 12px; color: var(--text-muted, #6b7280); }
.rr-tile .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rr-tile.on { box-shadow: 0 0 0 2px var(--primary, #e11d48); }
.rr-tile.rr-matched, .rr-badge.rr-matched { border-left-color: var(--success, #15803d); }
.rr-tile.rr-waiting, .rr-badge.rr-waiting { border-left-color: var(--warning, #d97706); }
.rr-tile.rr-unmatched, .rr-badge.rr-unmatched { border-left-color: var(--danger, #b91c1c); }
.rr-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2, #f3f4f6);
  border-left: 3px solid var(--border, #e5e7eb); }
.rr-badge.rr-matched { background: var(--success-soft, #ecfdf5); }
.rr-badge.rr-waiting { background: var(--warning-soft, #fef3c7); }
.rr-badge.rr-unmatched { background: var(--danger-soft, #fee2e2); }
@media (max-width: 640px) { .rr-table th:nth-child(7), .rr-table td:nth-child(7) { display: none; } }

/* Xero Check page, section 3 (24 Nov 26) */
.xr-sec { margin-top: 16px; }
.xr-note { padding: 0 16px; font-size: 13px; }
