:root {
  color-scheme: dark;      /* native controls (selects, checkboxes, scrollbars) render dark */
  /* Mantis dark — charcoal + red, matching the storefront (mantis.uk) */
  --bg: #1b1a1a;            /* page — near black */
  --surface: #262525;      /* cards / panels */
  --surface-2: #201f1f;    /* recessed panels */
  --ink: #f4f3f3;          /* primary text */
  --ink-2: #a6a3a3;        /* muted text */
  --ink-3: #726f6f;        /* faint text */
  --line: #383636;         /* borders */
  --line-2: #2d2c2c;       /* subtle dividers */
  --accent: #ff2e2e;       /* Mantis red */
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 46, 46, .15);
  --accent-hover: #ff4a4a;
  --green: #35c26e;
  --amber: #e0a92e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .65);
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Tilt Warp", "Barlow", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-weight: 700; }
.hidden { display: none !important; }

/* ───────── Top bar ───────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 22px;
  background: rgba(20, 19, 19, .82);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand { cursor: pointer; }
.brand-logos { display: inline-flex; align-items: center; }
.brand-logo { height: 25px; width: auto; display: block; filter: invert(1) brightness(1.9); }
.logo-sep { width: 1px; height: 18px; background: var(--line); margin: 0 12px; }
.brand-divider { width: 1px; height: 20px; background: var(--line); }
.brand-sub { color: var(--ink-2); font-weight: 500; font-size: 15px; }
.userbar { display: flex; align-items: center; gap: 14px; }
.nav { display: flex; gap: 2px; }
.nav-link {
  background: none; border: 0; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--ink-3); cursor: pointer; padding: 6px 12px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-link { text-transform: uppercase; letter-spacing: .04em; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: #fff; background: rgba(255, 255, 255, .06); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.who { color: var(--ink-2); font-size: 14px; }

/* ───────── Buttons / inputs ───────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 980px; padding: 11px 22px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .12s var(--ease), background .2s var(--ease), opacity .2s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-primary.is-busy { pointer-events: none; }
#submit { background: var(--accent); }
#submit:hover { background: var(--accent-hover); }
.btn-block { width: 100%; }
.order-terms { font-size: 12.5px; line-height: 1.45; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 0 0 12px; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 980px; padding: 10px 22px;
  font: inherit; font-weight: 600; cursor: pointer; margin-top: 8px;
  transition: background .15s, border-color .15s;
}
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost {
  background: none; border: 0; color: var(--ink-2);
  font: inherit; font-weight: 500; cursor: pointer; padding: 6px 8px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.btn-ghost:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }

input, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 44px; }
input[type="checkbox"], input[type="radio"], select { accent-color: var(--accent); }

/* Drop-ship address in the order panel */
.dropship-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; margin: 2px 0 10px; }
.dropship-toggle input { width: auto; margin: 0; cursor: pointer; }
.dropship-fields { display: grid; gap: 6px; margin-bottom: 12px; }
.dropship-fields input { padding: 9px 12px; }

.field { display: block; text-align: left; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px 2px; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Views ───────── */
.view { animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ───────── Login ───────── */
.login-view {
  min-height: calc(100vh - 56px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; gap: 20px;
}
.login-card {
  width: 100%; max-width: 400px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: 40px 34px;
}
.login-card h1 { margin: 0 0 8px; font-size: 27px; }
.sub { color: var(--ink-2); margin: 0 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 16px; }
.form-msg { min-height: 20px; font-size: 13.5px; margin: 14px 0 0; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--accent); }
.hint { color: var(--ink-3); font-size: 13px; margin: 16px 0 20px; }
.pw-sep { position: relative; text-align: center; margin: 22px 0 16px; }
.pw-sep::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
.pw-sep span { position: relative; background: var(--surface); padding: 0 12px; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
#pw-login .field { margin-bottom: 12px; }
.legal { color: var(--ink-3); font-size: 12px; }

.sent-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  display: grid; place-items: center; font-size: 28px;
  background: var(--accent-soft); color: var(--accent); border-radius: 50%;
  animation: pop .4s var(--ease);
}
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────── App layout ───────── */
#app { max-width: 1240px; margin: 0 auto; padding: 24px 22px 60px; }
.app-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 24px;
  align-items: start;
}
/* View-only logins have no basket panel. Keep the catalogue at its normal
   width (rather than stretching edge-to-edge) and centre it on the page. */
.app-grid.view-only { grid-template-columns: minmax(0, 820px); justify-content: center; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.search-wrap { position: relative; flex: 1; }
.search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 17px; pointer-events: none;
}
.search-wrap input { padding-left: 38px; padding-right: 36px; height: 44px; border-radius: 12px; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: var(--line); color: var(--ink-2); cursor: pointer; font-size: 11px;
  display: grid; place-items: center;
}
.search-clear:hover { background: #d8d8dc; }
.result-count { color: var(--ink-3); font-size: 13.5px; white-space: nowrap; }
.download-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 980px; transition: background .15s, border-color .15s;
}
.download-btn:hover { background: var(--surface-2); border-color: #d8d8dc; }
.download-btn span { color: var(--accent); font-size: 15px; }

/* Brand toggle (catalogue) */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.brand-bar { display: inline-flex; gap: 2px; background: var(--line-2); border-radius: 980px; padding: 3px; }
.cat-toggles { display: flex; align-items: center; gap: 16px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.cost-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.cost-toggle input { width: auto; margin: 0; cursor: pointer; }
.brand-link { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink-2); padding: 7px 18px; border-radius: 980px; cursor: pointer; transition: background .15s, color .15s; }
.brand-link.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Brand access segment (admin dealer card) */
.dc-brands { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dc-order-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.dc-order-toggle input { width: auto; margin: 0; cursor: pointer; }
.dc-viewonly { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); background: rgba(47,111,237,.1); padding: 2px 8px; border-radius: 980px; }
.dc-usa-badge { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #1a9e57; background: rgba(26,158,87,.1); padding: 2px 8px; border-radius: 980px; }
.dc-brands-label { color: var(--ink-3); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.brand-seg { display: inline-flex; gap: 2px; background: var(--line-2); border-radius: 980px; padding: 3px; }
.brand-seg button { border: 0; background: none; font: inherit; font-weight: 600; font-size: 12.5px; color: var(--ink-2); padding: 5px 12px; border-radius: 980px; cursor: pointer; }
.brand-seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Category filter chips */
.category-bar {
  display: flex; gap: 8px; margin-bottom: 14px;
  overflow-x: auto; padding-bottom: 2px; scrollbar-width: none;
  /* Fade the right edge to hint there are more categories to scroll to. */
  -webkit-mask-image: linear-gradient(to right, #000 92%, transparent);
  mask-image: linear-gradient(to right, #000 92%, transparent);
}
.category-bar::-webkit-scrollbar { display: none; }
.category-bar:empty { display: none; }
.catalogue-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.ctrl-spacer { flex: 1 1 auto; }
.ctrl-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.ctrl-toggle input { width: auto; margin: 0; cursor: pointer; }
.ctrl-select { width: auto; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.admin-order-filter { display: inline-flex; gap: 2px; background: var(--line-2); border-radius: 980px; padding: 3px; margin-bottom: 14px; }
.ao-filter { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 6px 16px; border-radius: 980px; cursor: pointer; }
.ao-filter.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.chip {
  flex: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  white-space: nowrap; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 980px;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Stock panel */
.stock-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden;
}
/* Fixed layout so long real-world part codes/names can't blow the table wider
   than its panel (which would clip the Price/Add columns under overflow:hidden). */
table.stock { width: 100%; border-collapse: collapse; table-layout: fixed; }
.stock thead th:nth-child(2) { width: 172px; }  /* Stock (fits "Assembled to order") */
.stock thead th:nth-child(3) { width: 118px; }  /* Price */
.stock thead th:nth-child(4) { width: 78px; }   /* Add */
.stock .stock-cell { white-space: nowrap; }
.stock td.price { white-space: nowrap; }
.stock .name { overflow-wrap: anywhere; }
.item-cell { display: flex; align-items: center; gap: 12px; }
.item-text { min-width: 0; }
.stock-thumb { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); flex: none; cursor: zoom-in; padding: 2px; }
.img-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; cursor: zoom-out; }
.img-lightbox-inner { background: #fff; border-radius: 14px; padding: 16px; max-width: 90vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.img-lightbox-inner img { max-width: min(520px, 80vw); max-height: 70vh; object-fit: contain; }
.img-lightbox-name { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); text-align: center; }
.submeta { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.stock thead th {
  text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.stock th.num, .stock td.num { text-align: right; }
.stock th.act, .stock td.act { text-align: right; width: 96px; }
.stock tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.stock tbody tr:last-child td { border-bottom: 0; }
.stock tbody tr { transition: background .12s; }
.stock tbody tr:hover { background: var(--surface-2); }
.code { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.name { font-weight: 500; }
.new-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--accent); padding: 2px 6px; border-radius: 5px; margin-right: 7px; vertical-align: 1px; }
.cat { color: var(--ink-3); font-size: 13px; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.25; }
.rrp { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); }
.lbl-na { color: var(--ink-3); font-size: 12px; }

.stock-badge { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.notify-btn { margin-left: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 980px; cursor: pointer; font-size: 12px; line-height: 1; padding: 4px 6px; filter: grayscale(1); opacity: .6; transition: opacity .15s, filter .15s, border-color .15s; vertical-align: middle; }
.notify-btn:hover { opacity: 1; filter: grayscale(.3); border-color: var(--accent); }
.notify-btn.on { filter: none; opacity: 1; border-color: var(--green); background: rgba(26,158,87,.1); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.in { background: var(--green); }
.dot.low { background: var(--amber); }
.dot.out { background: var(--ink-3); }
.dot.assembled { background: var(--accent); }
.stock-badge.out { color: var(--ink-3); }
.stock-badge.low { color: var(--amber); }
.stock-badge.assembled { color: var(--accent); }
.lbl-low { color: var(--amber); font-size: 12px; }

.add-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--accent);
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  padding: 7px 15px; border-radius: 980px;
  transition: background .15s, border-color .15s, transform .1s;
}
.add-btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.add-btn:active { transform: scale(.95); }

/* Skeleton */
.skeleton-row { display: flex; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.sk { height: 14px; border-radius: 6px; background: linear-gradient(90deg, #2a2929 25%, #363434 50%, #2a2929 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Empty / error states */
.state { text-align: center; padding: 64px 24px; }
.state-emoji { font-size: 34px; margin-bottom: 12px; }
.state h3 { margin: 0 0 6px; font-size: 17px; }
.state p { color: var(--ink-2); margin: 0 0 18px; }

/* ───────── Order / basket ───────── */
.order {
  position: sticky; top: 80px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden;
  display: flex; flex-direction: column; max-height: calc(100vh - 104px);
}
.order-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 0; }
.order-head h2 { margin: 0; font-size: 18px; }
.pill {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 980px;
  background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 600;
  display: inline-grid; place-items: center;
}
.order-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px; }
.order-empty { text-align: center; color: var(--ink-3); padding: 26px 8px; }
.order-empty .state-emoji { font-size: 28px; margin-bottom: 8px; }
/* Drag-and-drop a CSV/Excel order onto the panel. */
.order.drop-active { border-color: var(--accent); }
.order.drop-active::after {
  content: "Drop your CSV / Excel order to add it";
  position: absolute; inset: 0; z-index: 5; padding: 20px; text-align: center;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 19, 19, .92); color: var(--accent); font-weight: 700; font-size: 15px;
  border: 2px dashed var(--accent); border-radius: var(--r-md); pointer-events: none;
}

.bline { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); animation: fade .25s var(--ease); }
.bline:first-child { padding-top: 2px; }
.bline:last-child { border-bottom: 0; }
.bline-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bline-thumb { display: none; width: 40px; height: 40px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; flex: none; cursor: zoom-in; padding: 2px; }
.bline-thumb.loaded { display: block; }
.bline-r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bline-name { font-weight: 500; }
.bline-code { color: var(--ink-3); font-size: 12.5px; }
.bline-total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bline-ctl { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 980px; overflow: hidden; }
.stepper button { width: 26px; height: 26px; border: 0; background: var(--surface); color: var(--ink); font-size: 15px; cursor: pointer; transition: background .12s; }
.stepper button:hover { background: var(--line-2); }
.stepper input { width: 38px; height: 26px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; padding: 0; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.stepper input:focus { box-shadow: none; }
.bline-x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 13px; padding: 4px; border-radius: 6px; }
.bline-x:hover { color: var(--accent); }

.order-foot { flex: 0 0 auto; padding: 4px 18px 18px; border-top: 1px solid var(--line-2); }
.total-row { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 0 2px; }
.total-row strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.total-note { color: var(--ink-3); font-size: 12px; margin: 0 0 14px; }
.account-note { font-size: 12px; color: var(--ink-2); background: var(--line-2); border-radius: 10px; padding: 8px 10px; margin: 0 0 12px; }
.account-note.over { background: rgba(74,138,201,.1); color: var(--accent); }
.account-over { display: inline-block; margin-top: 3px; font-weight: 600; color: var(--accent); }

/* ── Quick order & saved lists modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-x { border: 0; background: none; font-size: 17px; color: var(--ink-3); cursor: pointer; padding: 4px 9px; border-radius: 8px; }
.modal-x:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.qm-section { margin-bottom: 22px; }
.qm-section:last-child { margin-bottom: 0; }
.qm-section h3 { margin: 0 0 6px; font-size: 15px; }
.qm-hint { color: var(--ink-2); font-size: 13px; margin: 0 0 10px; }
.qm-hint code { background: var(--line-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }
#quick-text { width: 100%; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#quick-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qm-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.qm-row .btn-primary { width: auto; }
.qm-lists-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.qm-lists-head .btn-secondary { width: auto; padding: 8px 14px; font-size: 13px; }
.saved-list { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.sl-info { display: flex; flex-direction: column; min-width: 0; }
.sl-name { font-weight: 600; font-size: 14px; }
.sl-count { color: var(--ink-3); font-size: 12px; }
.sl-actions { display: flex; align-items: center; gap: 6px; }
.sl-load { background: var(--accent); color: #fff; border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 16px; cursor: pointer; }
.sl-del { background: none; border: 1px solid var(--line); border-radius: 980px; color: var(--ink-3); cursor: pointer; font-size: 12px; padding: 6px 9px; }
.sl-del:hover { border-color: var(--accent); color: var(--accent); }
.order-foot textarea { margin-bottom: 12px; }

/* Success state */
.success { text-align: center; padding: 24px 10px 12px; animation: fade .3s var(--ease); }
.success-check { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 30px; animation: pop .4s var(--ease); }
.success h3 { margin: 0 0 6px; font-size: 19px; }
.success .ref { font-variant-numeric: tabular-nums; font-weight: 600; }
.success p { color: var(--ink-2); margin: 0 0 20px; }

/* ───────── Previous orders ───────── */
/* ── Home / welcome ── */
.home-view { max-width: 860px; margin: 0 auto; }
.home-head { margin-bottom: 22px; }
.home-head h1 { font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.02em; margin: 0 0 4px; }
.home-sub { color: var(--ink-2); margin: 0; }
.home-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.home-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 16px; }
.hk-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.hk-value { font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hk-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.hk-up { color: var(--green); } .hk-down { color: var(--accent); } .hk-flat { color: var(--ink-3); }
.home-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 18px; margin-bottom: 18px; }
.home-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.home-card-head h3 { margin: 0; font-size: 15px; }
.hc-legend { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.hc-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.hc-key.this { background: var(--accent); } .hc-key.last { background: var(--line); }
.home-card { position: relative; }
.home-chart { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.hc-col { cursor: default; }
.hc-tip { position: absolute; z-index: 5; transform: translate(-50%, calc(-100% - 12px)); background: #050505; color: #fff; border: 1px solid var(--line); font-size: 12px; line-height: 1.5; padding: 8px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.hc-tip strong { display: block; margin-bottom: 2px; }
.hct-row { display: flex; align-items: center; gap: 6px; }
.hc-tip .hc-key { width: 8px; height: 8px; }
.hc-tip .hc-key.last { background: #cfcfd4; }
.hc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.hc-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.hc-bar { width: 42%; border-radius: 3px 3px 0 0; min-height: 1px; }
.hc-bar.this { background: var(--accent); } .hc-bar.last { background: var(--line-2); border: 1px solid var(--line); }
.hc-ml { font-size: 11px; color: var(--ink-3); }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.home-actions .btn-primary, .home-actions .btn-secondary { width: auto; padding: 11px 20px; text-decoration: none; display: inline-flex; align-items: center; }
/* Admin home: equal size (width + height) action buttons.
   margin-top:0 drops the secondary's stacked-layout margin; the transparent
   border matches the secondary's 1px border so all three boxes are identical. */
.admin-actions { max-width: 580px; align-items: stretch; }
.admin-actions .btn-primary, .admin-actions .btn-secondary { flex: 1 1 0; min-width: 0; justify-content: center; margin-top: 0; }
.admin-actions .btn-primary { border: 1px solid transparent; }
@media (max-width: 640px) { .home-kpis { grid-template-columns: repeat(2, 1fr); } }

.orders-view { max-width: 780px; margin: 0 auto; }
.orders-title { font-size: 22px; margin: 4px 0 20px; }
.order-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 16px 18px; margin-bottom: 14px;
}
.oc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.oc-ref { font-weight: 700; font-variant-numeric: tabular-nums; }
.oc-date { color: var(--ink-3); font-size: 13px; }
.oc-total { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }
.oc-meta { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 0; }
.oc-lines { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line-2); }
.oc-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.oc-lines .q { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.oc-lines .lt { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.oc-actions { margin-top: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.oc-admin-actions { display: flex; gap: 8px; align-items: center; }
.oc-notify { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; margin-right: 2px; }
.oc-notify input { width: auto; margin: 0; cursor: pointer; }
.oc-complete { background: var(--green); color: #fff; border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.oc-complete:hover { filter: brightness(.95); }
.oc-delete { background: none; color: var(--accent); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.oc-delete:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.oc-done { display: inline-block; font-size: 11px; font-weight: 700; color: var(--green); background: rgba(26,158,87,.12); padding: 3px 9px; border-radius: 980px; margin-left: 4px; }
.oc-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 980px; margin-left: 6px; vertical-align: 1px; }
.oc-status.done { color: var(--green); background: rgba(26,158,87,.12); }
.oc-status.new { color: var(--accent); background: rgba(255,46,46,.12); }
.oc-status.paid { color: var(--green); background: rgba(26,158,87,.12); }
.oc-tracking { margin: 8px 0 0; font-size: 13.5px; color: var(--ink); }
.oc-tracking strong { font-variant-numeric: tabular-nums; }
.oc-track { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.oc-track-input { flex: 1; min-width: 180px; padding: 8px 12px; }
.oc-track-save { background: none; color: var(--ink); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.oc-track-save:hover { background: var(--surface-2); }
.order-card.done { opacity: .62; }
.order-card.done:hover { opacity: 1; }
.oc-toggle { background: none; border: 0; color: var(--ink-2); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.oc-toggle:hover { color: var(--ink); }
.reorder-btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 980px;
  font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 18px; cursor: pointer;
}
.reorder-btn:hover { background: var(--accent-hover); }
.notes-line { color: var(--ink-3); font-size: 13px; margin-top: 8px; font-style: italic; }

/* ───────── Pricing badge ───────── */
.pricing-badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 980px; white-space: nowrap; }
.pricing-badge.dealer { color: var(--green); background: rgba(26, 158, 87, .1); }
.pricing-badge.rrp { color: var(--ink-2); background: var(--line-2); }

/* ───────── Admin ───────── */
.admin-view { max-width: 820px; margin: 0 auto; }
/* Dashboard */
.dash-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.dash-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-sm); }
.dash-val { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.dash-label { color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.dash-card h3 { margin: 0 0 10px; font-size: 15px; }
.dash-hint { color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th { text-align: left; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dash-table td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-sub { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; }
@media (max-width: 720px) { .dash-tiles { grid-template-columns: repeat(2, 1fr); } .dash-grid { grid-template-columns: 1fr; } }
.admin-sub { color: var(--ink-2); margin: 0 0 20px; font-size: 14px; }
/* Access requests */
.req-head { font-weight: 700; font-size: 15px; margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.req-count { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 980px; }
.req-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: rgba(74, 138, 201, .06); border: 1px solid rgba(74, 138, 201, .25); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; }
.req-company { font-weight: 600; }
.req-meta { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.req-note { color: var(--ink-2); font-size: 13px; margin-top: 6px; font-style: italic; }
.req-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-notify { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.req-notify input { width: auto; margin: 0; }
.req-approve, .req-accept { background: var(--green); color: #fff; border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 8px 16px; cursor: pointer; }
.req-approve:hover, .req-accept:hover { filter: brightness(1.08); }
.req-decline { background: none; color: var(--accent); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.req-forward-btn { background: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.req-review-btn { background: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.req-review-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.req-review { flex-basis: 100%; margin-top: 10px; padding-top: 12px; border-top: 1px dashed rgba(74,138,201,.3); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.rv-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 5px 0; font-size: 13.5px; align-items: baseline; }
.rv-row.full { grid-column: 1 / -1; }
.rv-l { color: var(--ink-3); font-weight: 600; }
.rv-v { color: var(--ink); }
.rv-v.blank { color: var(--ink-3); }
@media (max-width: 720px) { .req-review { grid-template-columns: 1fr; } .rv-row { grid-template-columns: 130px 1fr; } }
.req-info { flex: 1 1 260px; min-width: 0; }
.req-brand { font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; vertical-align: 2px; margin-left: 4px; color: #fff; }
.req-brand { background: var(--accent); }
.req-brand.spn { background: #7c5cff; }

/* Admin home dashboard */
.admin-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ah-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 18px 16px; cursor: pointer; transition: border-color .15s, transform .1s; box-shadow: var(--shadow-sm); }
.ah-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.ah-card.hot { border-color: var(--accent); }
.ah-num { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.ah-card.hot .ah-num { color: var(--accent); }
.ah-lab { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.req-details { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; margin-top: 8px; }
.req-d { font-size: 12.5px; color: var(--ink); min-width: 0; }
.req-d span { color: var(--ink-3); margin-right: 5px; }
.req-forward { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(74,138,201,.3); }
.req-forward select, .req-forward input { width: auto; flex: 1 1 180px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; }
.req-forward-send { background: var(--accent); color: #fff; border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 8px 18px; cursor: pointer; }
.imp-email { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.imp-region { color: var(--ink-3); font-weight: 400; font-size: 12px; background: var(--line-2); padding: 1px 8px; border-radius: 980px; margin-left: 4px; }
.field-label .opt { color: var(--ink-3); font-weight: 400; }
.admin-subnav { display: inline-flex; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 980px; padding: 3px; margin-bottom: 22px; }
.sub-link { border: 0; background: none; font: inherit; font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); padding: 7px 18px; border-radius: 980px; cursor: pointer; transition: background .15s, color .15s; }
.sub-link:hover { color: var(--ink); }
.sub-link.active { background: var(--accent); color: #fff; box-shadow: none; }
.admin-orders-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.admin-order-search { flex: 1; max-width: 420px; }
.admin-order-search input { padding-left: 38px; height: 42px; border-radius: 12px; }
.oc-dealer { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.oc-code { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.dealer-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 12px; }
.dealer-card.new { border-color: rgba(26,158,87,.45); background: rgba(26,158,87,.06); box-shadow: 0 0 0 1px rgba(26,158,87,.15); }
.dc-new-badge { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--green); padding: 2px 7px; border-radius: 6px; margin-left: 7px; vertical-align: 1px; }
.dealer-activity-summary { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 2px 2px 12px; }
.dot-online { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(26,158,87,.18); }
.dc-online { font-size: 12px; font-weight: 600; color: var(--green); margin-left: 6px; white-space: nowrap; }
.dc-online .dot-online { margin-right: 3px; vertical-align: 1px; }
.dc-lastseen { font-size: 12px; color: var(--ink-3); margin-left: 6px; white-space: nowrap; }
.dc-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dc-email { font-weight: 600; }
.dc-assign { margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dc-cust { font-size: 14px; }
.dc-no { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dc-none { color: var(--ink-3); font-size: 14px; }
.dc-actions { display: flex; gap: 8px; align-items: center; }
.dc-toggle { background: var(--accent); color: #fff; border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 8px 16px; cursor: pointer; }
.dc-toggle:hover { background: var(--accent-hover); }
.dc-del { background: none; color: var(--accent); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.dc-actas { background: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.dc-actas:hover { border-color: var(--accent); color: var(--accent); }
/* Rep "acting as" banner */
.impersonate-bar { background: var(--amber); color: #fff; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 16px; font-size: 13px; font-weight: 600; text-align: center; }
.impersonate-bar.hidden { display: none; }
.impersonate-bar button { background: rgba(255,255,255,.22); color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 980px; font: inherit; font-weight: 600; font-size: 12px; padding: 5px 13px; cursor: pointer; flex: 0 0 auto; }
.impersonate-bar button:hover { background: rgba(255,255,255,.32); }
.dc-del:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.dc-suggest { background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; cursor: pointer; }

.pl-badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--ink-2); background: var(--line-2); padding: 3px 9px; border-radius: 980px; white-space: nowrap; }
.pl-badge.sm { font-size: 10px; padding: 2px 7px; }
.pl-none { font-size: 12px; color: var(--ink-3); }

.dc-picker { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.dc-search { margin-bottom: 10px; }
.dc-results { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.cust-result { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; font: inherit; transition: background .12s, border-color .12s; }
.cust-result:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.cr-name { font-weight: 600; font-size: 14px; }
.cr-meta { grid-column: 1; color: var(--ink-3); font-size: 12.5px; }
.cr-lists { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 240px; }
.dc-remove { margin-top: 10px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 500; font-size: 13px; cursor: pointer; padding: 0; }

/* ───────── Admin: Team ───────── */
.team-add { display: flex; gap: 10px; margin-bottom: 18px; max-width: 480px; align-items: center; }
.team-add input { flex: 1; }
#admin-dealers .team-add { max-width: 640px; }
#admin-importers .team-add { max-width: 720px; flex-wrap: wrap; }
.req-nextsteps { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(74,138,201,.3); }
.req-nextsteps select { flex: 0 1 200px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 13px; }
.req-ns-label { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.req-nextsteps-btn { background: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; cursor: pointer; }
.req-nextsteps-btn:hover { border-color: var(--green); color: var(--green); }
.req-ns-send { background: var(--green); color: #fff; border: 0; border-radius: 980px; font: inherit; font-weight: 600; font-size: 13px; padding: 8px 18px; cursor: pointer; }
.notify-toggle { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.notify-toggle input { flex: none; width: auto; margin: 0; }
.team-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.team-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.team-row:last-child { border-bottom: 0; }
.team-email { font-size: 14px; }
.team-you { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.team-right { display: flex; align-items: center; gap: 12px; }
.team-src { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 980px; }
.team-src.config { color: var(--ink-3); background: var(--line-2); }
.team-src.added { color: var(--green); background: rgba(26,158,87,.12); }
.team-remove { background: none; color: var(--accent); border: 1px solid var(--line); border-radius: 980px; font: inherit; font-weight: 600; font-size: 12.5px; padding: 5px 12px; cursor: pointer; }
.team-remove:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

/* ───────── Toasts ───────── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; }
/* Mobile-only floating shortcut to the order. */
.cart-bar { display: none; }
@media (max-width: 860px) {
  /* Toasts to the top so they never cover the order at the page bottom. */
  .toasts { bottom: auto; top: 64px; width: calc(100% - 32px); }
  /* The order lives at the bottom on phones — a floating bar keeps it one tap away. */
  .cart-bar.cart-bar--show { display: flex; }
  .cart-bar {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
    align-items: center; gap: 12px;
    background: var(--accent); color: #fff; border: 0; border-radius: 14px;
    padding: 14px 18px; font: inherit; font-weight: 600; font-size: 15px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .24); cursor: pointer;
  }
  .cart-bar-total { margin-left: auto; font-variant-numeric: tabular-nums; }
  .cart-bar-cta { font-weight: 700; white-space: nowrap; }
}
.toast {
  background: #050505; color: #fff; border: 1px solid var(--line); padding: 11px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .3s var(--ease);
}
.toast.leaving { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ───────── Responsive ───────── */
@media (max-width: 860px) {
  /* minmax(0,1fr) lets the column shrink below content width so long product
     names wrap instead of stretching the whole page (fixes side-scrolling). */
  .app-grid { grid-template-columns: minmax(0, 1fr); }
  .catalogue { min-width: 0; }
  .toolbar .search-wrap { flex-basis: 100%; }
  /* Catalogue first on small screens — browse, then review the order below. */
  .order { position: static; max-height: none; }
  .order-body { overflow: visible; }
  .catalogue { order: 1; }
  .order { order: 2; }
  /* Tidy the cramped header on phones so it fits without side-scrolling. */
  .brand-sub, .who, .brand-divider { display: none; }
  .topbar { padding: 6px 12px; gap: 8px; height: auto; min-height: 52px; flex-wrap: wrap; }
  .brand { gap: 8px; min-width: 0; }
  .brand-logo { height: 17px; }
  .userbar { gap: 6px; min-width: 0; }
  .nav { gap: 0; }
  .nav-link { padding: 6px 8px; font-size: 13px; }
  #logout { padding: 6px 8px; font-size: 13px; }
  #app { padding: 16px 14px 48px; overflow-x: hidden; } /* guard against stray content overflow */

  /* Reflow each stock row into a stacked card — a dense table doesn't fit. */
  .stock, .stock tbody, .stock tbody tr, .stock tbody td { display: block; }
  .stock thead { display: none; }
  .stock tbody tr { position: relative; padding: 14px 15px; }
  .stock tbody tr:hover { background: none; }
  .stock tbody td { padding: 0; border: 0; }
  .stock td.item { padding-right: 74px; }
  .stock td.num { display: inline-block; margin-top: 10px; }
  .stock td.price { margin-left: 20px; }
  .stock td.act { position: absolute; top: 14px; right: 15px; width: auto; }

  /* Toolbar buttons wrap below the search on phones. */
  .toolbar { flex-wrap: wrap; }
  /* Stack the catalogue controls so long dropdown options don't overflow. */
  .catalogue-controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .catalogue-controls .ctrl-spacer { display: none; }
  .catalogue-controls .ctrl-select { width: 100%; }
  /* Admin sub-tabs and order toolbar scroll/wrap instead of overflowing. */
  .admin-subnav { max-width: 100%; overflow-x: auto; }
  .admin-orders-toolbar { flex-wrap: wrap; }
  .admin-order-search { max-width: none; }
}

/* ═════════ Mantis brand accents (dark re-skin) ═════════ */
/* Signature red rule across the very top */
.topbar { border-top: 3px solid var(--accent); }
/* Brand lockup — technical, tracked sub-label like the storefront nav */
.brand-sub { text-transform: uppercase; letter-spacing: .10em; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.brand-divider { height: 16px; }
/* Home: hero greeting with a short red underscore */
.home-head { position: relative; }
.home-head::before { content: ''; display: block; width: 46px; height: 3px; background: var(--accent); border-radius: 2px; margin-bottom: 18px; }
#home-greeting { text-transform: uppercase; font-family: var(--font); font-weight: 800; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.015em; line-height: 1.02; }
/* Uppercase technical column/section labels */
.stock thead th, .dash-table thead th, .adm-tab, .toolbar .result-count { text-transform: uppercase; letter-spacing: .06em; }
.stock thead th, .dash-table thead th { font-size: 11px; color: var(--ink-3); font-weight: 600; }
/* Product thumbnails read as clean tiles on dark */
.stock-thumb, .bline-thumb { background: #f2f2f2; }
/* Login card: subtle red top edge to match the header */
.login-card { border-top: 2px solid var(--accent); }

/* Pay-now (prepay orders) */
.oc-pay { display: inline-flex; align-items: center; text-decoration: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 980px; margin-right: auto; }
.oc-pay:hover { background: var(--accent-hover); }
.pay-now { text-decoration: none; margin: 4px 0 10px; }
