/* 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; }
.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; }
.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;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-spacer { flex: 1; }
.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; }
}

/* ---------- 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; }

.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: 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; }

/* ---------- 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; 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); }

/* 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; }
.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: 120px; } }
.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 .tiles { display: grid; grid-template-columns: repeat(3, 64px); gap: 12px; }
.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: 1fr; } .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; }
.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-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; }
.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; }
.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); }
@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]) { background: var(--success-soft); }
.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; }
.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; }
.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 { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.last-order > summary::-webkit-details-marker { display: none; }
.last-order[open] > summary .icon { transform: rotate(180deg); }
.visit-nudges .alert { margin-bottom: 8px; }
.suggest-groups { display: flex; flex-direction: column; gap: 6px; }
.suggest-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.suggest-card { flex: 0 0 220px; scroll-snap-align: start; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.suggest-card.in-cart { border-color: var(--primary); }
.suggest-name { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.suggest-why { font-size: 12.5px; color: var(--text-2); flex: 1; }
.visit-filters { display: flex; flex-direction: column; gap: 10px; }
.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; }
.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; }
.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; }
  .suggest-card { flex-basis: 190px; }
}
.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); }

/* 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(130px, 1fr)); width: 100%; max-width: 560px; }
.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; }
.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); }
.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-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-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; }
.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-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-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%; } }

/* ---- 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 a { display: block; width: 100%; height: 100%; }
.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; } }

/* 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); }
@media (max-width: 1100px) { .dash-mine { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .dash-mine { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mine-k { white-space: normal; } }
