/* KodMetrik B2B — application styles (admin, dealer portal, auth, super admin) */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo.woff2") format("woff2-variations"), url("../fonts/archivo.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2215;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-ext.woff2") format("woff2-variations"), url("../fonts/archivo-ext.woff2") format("woff2");
  unicode-range: U+0100-0101, U+0112-0113, U+011E-011F, U+012A-012B, U+0130-0131, U+0141-0142, U+014C-014D, U+015E-015F, U+016A-016B, U+20BA;
}

/* ---------------------------------------------------------------- tokens */
:root {
  --brand: #2448f0;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, #ffffff);
  --brand-soft-2: color-mix(in srgb, var(--brand) 17%, #ffffff);
  --brand-strong: color-mix(in srgb, var(--brand) 84%, #000000);
  --brand-text: color-mix(in srgb, var(--brand) 84%, #0b1020);
  --firm: var(--brand);

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef1f7;
  --ink: #0f1630;
  --ink-2: #3a4361;
  --muted: #5b6584;
  --faint: #8f98b3;
  --line: #e4e8f1;
  --line-2: #eef1f7;
  --line-strong: #d3d9e6;
  --overlay: rgba(15, 22, 48, 0.46);

  --blue: #2448f0;
  --blue-ink: #1b36c4;
  --blue-soft: #e9edff;
  --tape: #ffb938;
  --tape-ink: #7a4e00;
  --tape-soft: #fff4da;
  --success: #0a7d57;
  --success-bright: #14a874;
  --success-soft: #e1f5ec;
  --warning: #a86a00;
  --warning-soft: #fff4da;
  --danger: #c9362c;
  --danger-bright: #ef5a4c;
  --danger-soft: #fdebe9;
  --violet: #6e4ff0;
  --violet-soft: #efebff;
  --sky: #06779a;
  --sky-bright: #12a4cc;
  --sky-soft: #e0f3f8;
  --info: var(--brand);
  --info-soft: var(--brand-soft);
  --neutral: #3a4361;
  --neutral-soft: #eef1f7;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display-stretch: 115%;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 22, 48, 0.05);
  --shadow-md: 0 1px 2px rgba(15, 22, 48, 0.04), 0 14px 30px -22px rgba(15, 22, 48, 0.4);
  --shadow-lg: 0 24px 50px -20px rgba(15, 22, 48, 0.45), 0 4px 12px rgba(15, 22, 48, 0.06);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);

  --sidebar-w: 248px;
  --topbar-h: 72px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

/* Admin and platform screens use the product palette; the firm's own colour marks its logo and the dealer portal. */
body.admin {
  --brand: #2448f0;
  --brand-ink: #ffffff;
  --brand-soft: #e9edff;
  --brand-soft-2: #dbe2ff;
  --brand-strong: #1c3bdb;
  --brand-text: #1b36c4;
  --ring: 0 0 0 4px rgba(36, 72, 240, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --surface: #121a30;
    --surface-2: #161f38;
    --surface-3: #1d2742;
    --ink: #e9edf8;
    --ink-2: #c2c9dc;
    --muted: #8f98b3;
    --faint: #67708c;
    --line: #232d4a;
    --line-2: #1d2742;
    --line-strong: #313c5e;
    --overlay: rgba(0, 0, 0, 0.6);
    --brand-soft: color-mix(in srgb, var(--brand) 20%, #121a30);
    --brand-soft-2: color-mix(in srgb, var(--brand) 30%, #121a30);
    --brand-text: color-mix(in srgb, var(--brand) 50%, #ffffff);
    --blue-soft: #1b2756;
    --blue-ink: #9fb2ff;
    --tape-soft: #3a2c10;
    --tape-ink: #ffcf73;
    --success: #34c690;
    --success-soft: #10291f;
    --warning: #f0b14c;
    --warning-soft: #33260f;
    --danger: #f06a72;
    --danger-soft: #361a1e;
    --violet: #a491f2;
    --violet-soft: #241e3d;
    --sky: #5cc7e6;
    --sky-soft: #0f2a33;
    --neutral: #c2c9dc;
    --neutral-soft: #1d2742;
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 30px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) body.admin { --brand-soft: #1b2756; --brand-soft-2: #23306a; --brand-text: #9fb2ff; }
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a30;
  --surface-2: #161f38;
  --surface-3: #1d2742;
  --ink: #e9edf8;
  --ink-2: #c2c9dc;
  --muted: #8f98b3;
  --faint: #67708c;
  --line: #232d4a;
  --line-2: #1d2742;
  --line-strong: #313c5e;
  --overlay: rgba(0, 0, 0, 0.6);
  --brand-soft: color-mix(in srgb, var(--brand) 20%, #121a30);
  --brand-soft-2: color-mix(in srgb, var(--brand) 30%, #121a30);
  --brand-text: color-mix(in srgb, var(--brand) 50%, #ffffff);
  --blue-soft: #1b2756;
  --blue-ink: #9fb2ff;
  --tape-soft: #3a2c10;
  --tape-ink: #ffcf73;
  --success: #34c690;
  --success-soft: #10291f;
  --warning: #f0b14c;
  --warning-soft: #33260f;
  --danger: #f06a72;
  --danger-soft: #361a1e;
  --violet: #a491f2;
  --violet-soft: #241e3d;
  --sky: #5cc7e6;
  --sky-soft: #0f2a33;
  --neutral: #c2c9dc;
  --neutral-soft: #1d2742;
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 30px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
:root[data-theme="dark"] body.admin { --brand-soft: #1b2756; --brand-soft-2: #23306a; --brand-text: #9fb2ff; }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
svg.icon { display: inline-block; flex: none; vertical-align: middle; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.25; font-weight: 750; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
small, .small { font-size: 12.5px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
kbd {
  padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 11.5px;
}
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; background: var(--ink); color: #fff; border-radius: var(--r); }
.skip-link:focus { top: 12px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ink-2 { color: var(--ink-2); }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.display { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 800; letter-spacing: -0.02em; }

/* ---------------------------------------------------------------- layout helpers */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-sm { display: flex; align-items: center; gap: 6px; }
.row-wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.split-wide { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: calc(var(--topbar-h) + 16px); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
@media (max-width: 1100px) {
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--r);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 650; font-size: 14px; line-height: 1;
  white-space: nowrap; cursor: pointer; user-select: none;
  text-decoration: none !important;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.08s var(--ease), color 0.15s var(--ease);
}
.btn:hover { --btn-bd: var(--line-strong); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn .icon { width: 17px; height: 17px; margin: 0 -1px; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: var(--brand-ink); --btn-bd: var(--brand); box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--brand) 85%, transparent); }
.btn-primary:hover { --btn-bg: var(--brand-strong); --btn-bd: var(--brand-strong); }
.btn-dark { --btn-bg: var(--ink); --btn-fg: var(--surface); --btn-bd: var(--ink); }
.btn-dark:hover { --btn-bg: var(--ink-2); --btn-bd: var(--ink-2); }
.btn-success { --btn-bg: var(--success); --btn-fg: #fff; --btn-bd: var(--success); }
.btn-success:hover { --btn-bg: color-mix(in srgb, var(--success) 86%, #000); --btn-bd: color-mix(in srgb, var(--success) 86%, #000); }
.btn-success-soft { --btn-bg: var(--success-soft); --btn-fg: var(--success); --btn-bd: transparent; }
.btn-success-soft:hover { --btn-bg: color-mix(in srgb, var(--success-soft) 80%, var(--success)); --btn-bd: transparent; }
.btn-danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-bd: color-mix(in srgb, var(--danger) 26%, var(--line)); }
.btn-danger:hover { --btn-bg: var(--danger-soft); --btn-bd: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-danger-solid { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn-danger-solid:hover { --btn-bg: color-mix(in srgb, var(--danger) 86%, #000); --btn-bd: color-mix(in srgb, var(--danger) 86%, #000); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; color: var(--ink-2); }
.btn-ghost:hover { --btn-bg: var(--surface-3); --btn-bd: transparent; color: var(--ink); }
.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand-text); --btn-bd: transparent; }
.btn-soft:hover { --btn-bg: var(--brand-soft-2); --btn-bd: transparent; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-xs .icon { width: 14px; height: 14px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 15.5px; font-weight: 700; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-icon.btn-xs { width: 28px; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: spin 0.7s linear infinite;
}
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-text); font-weight: 650; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-muted { color: var(--muted); }
.lnk { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--brand-text); text-decoration: none !important; }
.lnk:hover { color: var(--ink); }
.lnk .icon { width: 15px; height: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2, .form-grid-3 .span-3 { grid-column: 1 / -1; }
.form-grid-3 .span-2 { grid-column: span 2; }
@media (max-width: 720px) {
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid-3 .span-2 { grid-column: auto; }
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.label .opt { font-weight: 500; color: var(--faint); }
.hint { font-size: 12.5px; color: var(--muted); }
.field-error { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-width: 0;
  height: 42px; padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  font: inherit; font-size: 14.5px; font-weight: 500;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--faint)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--muted); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23687084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select[multiple].select { height: auto; min-height: 96px; padding: 6px; background-image: none; }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid { border-color: var(--danger); }
.input-sm { height: 34px; font-size: 13.5px; padding: 0 11px; border-radius: 10px; }
.select.input-sm { padding-right: 30px; }
.input-lg { height: 50px; font-size: 15px; border-radius: 14px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > :first-child { border-top-left-radius: var(--r); border-bottom-left-radius: var(--r); }
.input-group > :last-child { border-top-right-radius: var(--r); border-bottom-right-radius: var(--r); }
.input-group > * + * { margin-left: -1px; }
.input-addon {
  display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--muted); font-size: 13.5px; white-space: nowrap;
}
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; width: 18px; height: 18px; }
.input-icon > .input { padding-left: 38px; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; color: var(--ink); line-height: 1.4; }
.check input { margin: 0; margin-top: 1px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.check .check-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; position: relative; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.18s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.choice-cards { display: grid; gap: 10px; }
.choice {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--faint); }
.choice input { margin-top: 2px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--brand); box-shadow: var(--ring); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.choice-title { font-weight: 750; }
.choice-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.form-section { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; padding: 24px 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; padding-top: 4px; }
.form-section-head h3 { font-size: 15.5px; font-weight: 750; }
.form-section-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
@media (max-width: 900px) { .form-section { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

/* segmented control */
.segmented { display: inline-flex; padding: 4px; gap: 2px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.segmented a, .segmented button, .segmented label {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px;
  font-weight: 650; font-size: 13.5px; color: var(--muted); border: 0; background: none; cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented a:hover, .segmented button:hover, .segmented label:hover { color: var(--ink); }
.segmented .is-active, .segmented label:has(input:checked) { background: var(--ink); color: var(--surface); }
.segmented .icon { width: 16px; height: 16px; }
.segmented-soft { background: color-mix(in srgb, var(--surface-3) 70%, var(--line-strong)); border-color: transparent; border-radius: 12px; }
.segmented-soft .is-active, .segmented-soft label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 22, 48, 0.08), 0 4px 10px -6px rgba(15, 22, 48, 0.3); }

/* quantity stepper */
.stepper {
  display: inline-flex; align-items: stretch; height: 40px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface); overflow: hidden;
}
.stepper button {
  width: 38px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
}
.stepper button:hover { background: var(--surface-2); color: var(--ink); }
.stepper button:active { background: var(--surface-3); }
.stepper input {
  width: 56px; border: 0;
  text-align: center; font: inherit; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); background: transparent;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: var(--brand-soft); }
.stepper-sm { height: 34px; border-radius: 10px; }
.stepper-sm button { width: 30px; }
.stepper-sm input { width: 52px; font-size: 13px; }

/* ---------------------------------------------------------------- cards & panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 16.5px; font-weight: 750; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 550; margin-top: 2px; }
.card-head + .card-body { padding-top: 0; }
.card-head + .table-wrap .table thead th, .card-head + .table thead th, .card-head + .toolbar, .card-head + .list .list-item:first-child,
.card-head + .divider-list > :first-child, .card-head + .filters-applied { border-top: 1px solid var(--line-2); }
.card-body { padding: 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.card-flush .card-body { padding: 0; }
.panel { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px; }
.divider-list > * + * { border-top: 1px solid var(--line-2); }

/* tone tiles: small coloured squares carrying an icon */
.ti { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; background: var(--surface-3); color: var(--ink-2); }
.ti .icon { width: 16px; height: 16px; }
.ti-md { width: 36px; height: 36px; border-radius: 11px; }
.ti-md .icon { width: 18px; height: 18px; }
.ti-lg { width: 46px; height: 46px; border-radius: 14px; }
.ti-lg .icon { width: 22px; height: 22px; }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-brand, .t-firm { background: var(--brand-soft); color: var(--brand-text); }
.t-tape { background: var(--tape-soft); color: #b57400; }
.t-mint { background: var(--success-soft); color: var(--success); }
.t-violet { background: var(--violet-soft); color: var(--violet); }
.t-coral { background: var(--danger-soft); color: var(--danger); }
.t-sky { background: var(--sky-soft); color: var(--sky); }
.t-gray { background: var(--surface-3); color: var(--ink-2); }
.icon-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick, .tone-pick { position: relative; cursor: pointer; }
.icon-pick input, .tone-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick .ti { width: 38px; height: 38px; border-radius: 11px; border: 1.5px solid transparent; transition: border-color 0.15s, background 0.15s; }
.icon-pick .ti .icon { width: 18px; height: 18px; }
.icon-pick:hover .ti { border-color: var(--line-strong); }
.icon-pick input:checked + .ti { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand); }
.icon-pick input:focus-visible + .ti, .tone-pick input:focus-visible + .tone-swatch { box-shadow: var(--ring); }
.tone-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tone-pick { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.tone-pick:hover { border-color: var(--line-strong); }
.tone-pick:has(input:checked) { border-color: var(--brand); color: var(--ink); box-shadow: var(--ring); }
.tone-swatch { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; }
.tone-auto { background: var(--surface-3); color: var(--muted); }
:root[data-theme="dark"] .t-tape { color: var(--tape); }

/* key-value lists */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13.5px; }
.kv-row + .kv-row { border-top: 1px dashed var(--line-2); }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.kv-row.total { border-top: 1px solid var(--line-strong) !important; padding-top: 12px; margin-top: 4px; font-size: 16px; }
.kv-row.total .k { color: var(--ink); font-weight: 700; }
.kv-row.total .v { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 800; font-size: 20px; }

/* ---------------------------------------------------------------- chips, badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 8px; font-size: 12.5px; font-weight: 700; white-space: nowrap; line-height: 1;
  background: var(--neutral-soft); color: var(--neutral);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.8; flex: none; }
.chip-plain::before, .chip.nodot::before { display: none; }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warning { background: var(--tape-soft); color: var(--tape-ink); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info, .chip-brand { background: var(--brand-soft); color: var(--brand-text); }
.chip-blue { background: var(--blue-soft); color: var(--blue-ink); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-sky { background: var(--sky-soft); color: var(--sky); }
.chip-tape { background: var(--tape-soft); color: var(--tape-ink); }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 8px;
  font-size: 11.5px; font-weight: 750; background: var(--danger); color: #fff; font-variant-numeric: tabular-nums;
}
.badge-brand { background: var(--brand); color: var(--brand-ink); }
.badge-muted, .badge-soft { background: var(--surface-3); color: var(--ink-2); }
.badge-danger { background: var(--danger); color: #fff; }
.badge-tape { background: var(--tape); color: var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); }
.dot-success { background: var(--success-bright); }
.dot-danger { background: var(--danger-bright); }
.dot-warning { background: var(--tape); }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 550; line-height: 1.45; border: 1px solid transparent; }
.alert > .icon { margin-top: 1px; flex: none; }
.alert-title { font-weight: 700; }
.alert p + p { margin-top: 4px; }
.alert-info { background: var(--brand-soft); color: var(--brand-text); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--tape-soft); color: var(--tape-ink); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-neutral { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.alert .alert-body { flex: 1; min-width: 0; color: var(--ink); }
.alert .alert-body .muted { color: var(--ink-2); }

/* ---------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
.table th:first-child { padding-left: 20px; }
.table th:last-child { padding-right: 20px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table td:first-child { padding-left: 20px; }
.table td:last-child { padding-right: 20px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-link { cursor: pointer; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .sel { width: 1%; padding-right: 0; }
.table .cell-title { font-weight: 700; color: var(--ink); }
.table .cell-sub { color: var(--muted); font-size: 12.5px; font-weight: 550; margin-top: 2px; }
.table a.cell-title:hover { color: var(--brand-text); }
.table tfoot td { background: var(--surface-2); font-weight: 750; border-top: 1px solid var(--line-2); border-bottom: 0; }
.table-compact td { padding-top: 8px; padding-bottom: 8px; }
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; }
.table-card .table th:first-child { border-top-left-radius: 0; }
@media (max-width: 720px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .table-stack tbody tr:last-child { border-bottom: 0; }
  .table-stack td { border: 0; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; }
  .table-stack td.primary { display: block; text-align: left; padding-bottom: 6px !important; }
  .table-stack td.primary::before { display: none; }
  .table-stack td.actions { justify-content: flex-start; padding-top: 8px !important; }
  .table-stack td.sel { display: none; }
}

/* toolbar above tables */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar .input-icon { flex: 1 1 260px; max-width: 380px; }
.toolbar .select, .toolbar .input { height: 38px; }
.toolbar .spacer { flex: 1; }
.filters-applied { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 10px; background: var(--ink); border: 0; font-size: 13px; font-weight: 650; color: var(--surface); }
.filter-pill a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: color-mix(in srgb, var(--surface) 75%, transparent); }
.filter-pill a:hover { background: color-mix(in srgb, var(--surface) 16%, transparent); color: var(--surface); text-decoration: none; }
.bulkbar {
  position: sticky; bottom: calc(16px + var(--safe-b)); z-index: 20; display: flex; align-items: center; gap: 10px;
  margin: 12px auto 0; width: max-content; max-width: calc(100% - 24px); padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13.5px;
}
.bulkbar .btn { --btn-bg: transparent; --btn-fg: var(--surface); --btn-bd: color-mix(in srgb, var(--surface) 30%, transparent); box-shadow: none; }
.bulkbar .btn:hover { --btn-bg: color-mix(in srgb, var(--surface) 12%, transparent); }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); font-weight: 600; }
.pager-links { display: flex; gap: 4px; }
.pager-links a, .pager-links span {
  display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px;
  font-weight: 700; color: var(--ink-2); text-decoration: none;
}
.pager-links a:hover { background: var(--surface-3); }
.pager-links .is-active { background: var(--ink); color: var(--surface); }
.pager-links .is-disabled { color: var(--faint); }

/* ---------------------------------------------------------------- page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head-main { min-width: 0; }
.page-title { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.page-sub { color: var(--muted); margin-top: 6px; font-size: 15px; font-weight: 550; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); font-weight: 650; }
.crumbs a:hover { color: var(--ink); }
.crumbs .icon { width: 14px; height: 14px; color: var(--faint); }
.section-title { font-family: var(--font-display); font-stretch: 112%; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title .muted { font-family: var(--font); font-stretch: 100%; font-weight: 550; font-size: 13.5px; letter-spacing: 0; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px 12px;
  font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; border: 0; background: none; cursor: pointer; text-decoration: none !important;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .is-active { color: var(--brand-text); font-weight: 750; }
.tabs .is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--brand); }
.tabs .badge { height: 18px; min-width: 18px; font-size: 11px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
.stat { padding: 20px 22px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line-2); }
.stat-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13.5px; font-weight: 650; }
.stat-label > .icon { width: 16px; height: 16px; color: var(--faint); }
.stat-label .ti { width: 30px; height: 30px; }
.stat-value { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-top: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value small { font-family: var(--font); font-stretch: 100%; font-size: 13px; font-weight: 650; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.stat-foot { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.delta-up { color: var(--success); font-weight: 700; }
.delta-down { color: var(--danger); font-weight: 700; }
a.stat { color: inherit; text-decoration: none; transition: background 0.12s; }
a.stat:hover { background: var(--surface-2); }
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 520px) {
  .stat { padding: 14px 16px; }
  .stat-value { font-size: 22px; }
}

/* credit meter: used vs available limit */
.meter { position: relative; height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand); transition: width 0.4s var(--ease); }
.meter > span.is-warn { background: var(--tape); }
.meter > span.is-over { background: var(--danger); }
.meter-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 8px; }
.meter-legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; gap: 6px; }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 8px; }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-title { font-weight: 750; font-size: 16px; }
.empty-text { color: var(--muted); max-width: 420px; font-size: 13.5px; }
.empty .btn { margin-top: 12px; }

/* list items */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none !important; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-sub { color: var(--muted); font-size: 12.5px; font-weight: 550; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-end { text-align: right; flex: none; }
.icon-tile { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; }
.icon-tile .icon { width: 18px; height: 18px; }
.icon-tile.brand { background: var(--brand-soft); color: var(--brand-text); }
.icon-tile.success { background: var(--success-soft); color: var(--success); }
.icon-tile.warning { background: var(--tape-soft); color: #b57400; }
.icon-tile.violet { background: var(--violet-soft); color: var(--violet); }
.icon-tile.sky { background: var(--sky-soft); color: var(--sky); }
.icon-tile.blue { background: var(--blue-soft); color: var(--blue); }
.icon-tile.danger { background: var(--danger-soft); color: var(--danger); }

/* avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); font-weight: 800; font-size: 12.5px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li.is-done::before { background: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.is-done .tl-dot { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 3px var(--surface); }
.timeline li.is-current .tl-dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline .tl-title { font-weight: 700; }
.timeline .tl-meta { font-size: 12.5px; color: var(--muted); }
.timeline .tl-note { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* progress steps (horizontal) */
.steps { display: flex; gap: 8px; counter-reset: step; }
.steps li { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--surface-3); }
.steps li.is-done::before, .steps li.is-current::before { background: var(--brand); }
.steps li.is-current { color: var(--ink); }
.steps { padding: 0; margin: 0; }

/* skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------------------------------------------------------------- dropdown */
.dropdown { position: relative; display: inline-flex; }
.menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; min-width: 220px; max-width: 320px;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px) scale(0.98); transform-origin: top right; pointer-events: none;
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
}
.menu.menu-left { right: auto; left: 0; transform-origin: top left; }
.menu.menu-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.dropdown.is-open > .menu { opacity: 1; transform: none; pointer-events: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; background: none;
  color: var(--ink); font-weight: 600; font-size: 13.5px; text-align: left; cursor: pointer; text-decoration: none !important;
}
.menu-item .icon { width: 17px; height: 17px; color: var(--muted); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .icon { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-label { padding: 8px 10px 4px; font-size: 12px; color: var(--faint); font-weight: 650; }
.menu-head { padding: 10px; border-bottom: 1px solid var(--line); margin: -6px -6px 6px; }

/* ---------------------------------------------------------------- dialogs (modal + bottom sheet) */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal.modal-lg { width: min(840px, calc(100vw - 32px)); }
dialog.modal.modal-sm { width: min(420px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in 0.18s var(--ease); display: flex; flex-direction: column; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 4px 20px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.modal-handle { display: none; }
@media (max-width: 720px) {
  dialog.modal, dialog.modal.modal-lg, dialog.modal.modal-sm {
    width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0;
    padding-bottom: var(--safe-b);
  }
  dialog.modal[open] { animation: sheet-in 0.24s var(--ease); }
  .modal-handle { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
}
@keyframes sheet-in { from { transform: translateY(40%); opacity: 0.6; } }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 200; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 420px;
  padding: 12px 16px 12px 12px; border-radius: 16px; background: #0f1630; color: #fff; box-shadow: 0 24px 50px -20px rgba(15, 22, 48, 0.6);
  font-weight: 650; font-size: 14px; line-height: 1.4; animation: toast-in 0.3s var(--ease);
}
.toast > .icon { flex: none; width: 28px; height: 28px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); }
.toast.success > .icon { background: rgba(20, 168, 116, 0.25); }
.toast.success .icon { color: #7fe0bc; }
.toast.error .icon { color: #ff8a92; }
.toast.warning .icon { color: var(--tape); }
.toast.is-leaving { animation: toast-out 0.18s var(--ease) forwards; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* top progress bar for shell navigation */
.nav-progress { position: fixed; z-index: 300; top: 0; left: 0; height: 2px; width: 0; background: var(--brand); box-shadow: 0 0 8px var(--brand); transition: width 0.3s var(--ease), opacity 0.3s; opacity: 0; }
.nav-progress.is-active { opacity: 1; }

/* ---------------------------------------------------------------- admin shell */
.shell {
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh;
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar-w) - 1px), var(--line) calc(var(--sidebar-w) - 1px), var(--line) var(--sidebar-w), transparent var(--sidebar-w));
}
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px 14px; background: var(--surface); border-right: 1px solid var(--line); z-index: 40;
}
.sidebar-head { display: flex; align-items: center; gap: 11px; padding: 4px 6px; }
.tenant-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; overflow: hidden;
  background: var(--firm); color: var(--firm-ink, #fff); font-family: var(--font-display); font-stretch: 110%; font-weight: 800; font-size: 14px;
}
.tenant-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.tenant-name { font-weight: 750; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-sub { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tenant-sub .icon { width: 12px; height: 12px; color: var(--success-bright); flex: none; }
.trial-pill {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--tape-soft);
  color: var(--tape-ink); font-size: 12.5px; font-weight: 650; line-height: 1.35; text-decoration: none !important;
}
.trial-pill:hover { color: var(--tape-ink); background: color-mix(in srgb, var(--tape-soft) 82%, var(--tape)); }
.trial-pill b { display: block; color: var(--ink); font-size: 13px; }
.trial-pill > .icon { width: 18px; height: 18px; color: #b57400; flex: none; }
.trial-pill .meter { display: block; height: 5px; margin-top: 6px; background: color-mix(in srgb, var(--tape) 22%, transparent); }
.trial-pill .meter > span { background: #e59a00; }
.sidebar-nav { flex: 1; overflow-y: auto; margin: 0 -6px; padding: 0 6px 12px; scrollbar-width: thin; display: grid; align-content: start; gap: 2px; }
.nav-group { display: grid; gap: 2px; }
.nav-group + .nav-group { margin-top: 0; }
.nav-group-title { padding: 10px 10px 4px; font-size: 12px; font-weight: 700; color: var(--faint); }
.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 10px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 14.5px; text-decoration: none !important; position: relative;
}
.nav-item > .icon { width: 18px; height: 18px; color: var(--muted); }
.nav-item .ti { width: 28px; height: 28px; border-radius: 9px; }
.nav-item .ti .icon { width: 16px; height: 16px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active { background: var(--brand-soft); color: var(--ink); font-weight: 700; }
.nav-item.is-active > .icon { color: var(--brand); }
.nav-item .badge { margin-left: auto; }
.nav-item .lock { margin-left: auto; width: 15px; height: 15px; color: var(--faint); }
.nav-item.is-locked { color: var(--faint); }
.nav-item.is-locked .ti { filter: grayscale(1); opacity: 0.6; }
.sidebar-foot { display: grid; gap: 8px; }
.portal-link {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-strong);
  color: var(--ink); text-decoration: none !important; font-weight: 650; font-size: 13.5px; line-height: 1.3;
}
.portal-link:hover { border-color: var(--firm); color: var(--ink); }
.portal-link small { display: block; color: var(--muted); font-weight: 550; font-size: 12px; }
.portal-link .ti { background: color-mix(in srgb, var(--firm) 12%, var(--surface)); color: var(--firm); }
.me { display: flex; align-items: center; gap: 4px; padding: 2px 0 0; }
.me-menu { flex: 1; min-width: 0; }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 6px 8px; border: 0; border-radius: 12px; background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.me-btn:hover, .me-btn[aria-expanded="true"] { background: var(--surface-2); }
.me .avatar { width: 36px; height: 36px; font-size: 13px; background: var(--violet-soft); color: var(--violet); }
.me-text { min-width: 0; flex: 1; line-height: 1.25; }
.me-text b { display: block; font-size: 14px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .icon-btn { width: 34px; height: 34px; border-radius: 10px; color: var(--muted); flex: none; }
.me .icon-btn .icon { width: 18px; height: 18px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; min-height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 14px 32px; background: color-mix(in srgb, var(--surface-2) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: none; font-weight: 750; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger {
  display: flex; align-items: center; gap: 10px; flex: 1 1 280px; max-width: 560px; height: 44px; padding: 0 10px 0 14px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface); color: #99a1ba; cursor: pointer; font-size: 14.5px; font-weight: 500; text-align: left;
}
.search-trigger:hover { border-color: var(--line-strong); }
.search-trigger .icon { color: var(--faint); }
.search-trigger kbd { margin-left: auto; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar-date { font-size: 13.5px; font-weight: 650; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: none;
  color: var(--ink-2); cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn .badge { position: absolute; top: 2px; right: 0; height: 18px; min-width: 18px; font-size: 10.5px; padding: 0 4px; border: 2px solid var(--surface); box-sizing: content-box; border-radius: 9px; }
.icon-btn-bordered { width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); }
.icon-dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger-bright); border: 2px solid var(--surface); box-sizing: content-box; }
.icon-btn-bordered:hover { background: var(--surface); border-color: var(--line-strong); }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 0; background: none; cursor: pointer; }
.user-btn:hover { background: var(--surface-3); }
.user-btn .user-name { font-weight: 650; font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { padding: 28px 32px 48px; width: 100%; max-width: 1400px; margin: 0 auto; outline: none; }
.page-narrow { max-width: 880px; }
.banner {
  display: flex; align-items: center; gap: 12px; margin: 14px 32px 0; padding: 11px 14px; border-radius: 14px; font-size: 13.5px;
  font-weight: 650; border: 1px solid transparent;
}
.banner .icon { flex: none; }
.banner .btn { margin-left: auto; }
.banner-info { background: var(--brand-soft); color: var(--brand-text); }
.banner-warning { background: var(--tape-soft); color: var(--tape-ink); }
.banner-danger { background: var(--danger-soft); color: var(--danger); }
.banner-dark { background: var(--ink); color: var(--surface); }
.banner-dark .btn { --btn-bg: transparent; --btn-fg: var(--surface); --btn-bd: color-mix(in srgb, var(--surface) 35%, transparent); box-shadow: none; }

.sidebar-backdrop { display: none; }
.tabbar { display: none; }
.mobile-only { display: none !important; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%);
    transition: transform 0.24s var(--ease); box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: var(--overlay); }
  .topbar { padding: 8px 12px; min-height: 60px; }
  .topbar-title { display: block; }
  .topbar-date { display: none; }
  .search-trigger { flex: none; width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; background: none; color: var(--ink-2); }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger .icon { width: 20px; height: 20px; }
  .user-btn .user-name { display: none; }
  .page { padding: 16px 16px calc(var(--tabbar-h) + 32px + var(--safe-b)); }
  .banner { margin: 10px 16px 0; }
  .sidebar { padding-top: 14px; }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  .page-title { font-size: 25px; }
  .page-head { margin-bottom: 16px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line);
  }
  .tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none !important; border: 0; background: none; cursor: pointer;
  }
  .tab .icon { width: 22px; height: 22px; }
  .tab.is-active { color: var(--brand-text); }
  .tab.is-active .icon { color: var(--brand); }
  .tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: 10.5px; padding: 0 4px; }
}

/* ---------------------------------------------------------------- dealer portal */
.dealer .d-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.d-promo { background: var(--tape-soft); color: var(--tape-ink); font-size: 13.5px; font-weight: 600; }
.d-promo-in { max-width: 1320px; margin: 0 auto; padding: 9px 28px; display: flex; align-items: center; gap: 10px; }
.d-promo-in > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-promo b { color: var(--ink); font-weight: 750; }
.d-promo .icon { width: 16px; height: 16px; color: #b57400; flex: none; }
.d-promo a { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 750; color: var(--tape-ink); white-space: nowrap; text-decoration: none !important; }
.d-promo a:hover { color: var(--ink); }
.d-bar { display: flex; align-items: center; gap: 20px; max-width: 1320px; margin: 0 auto; padding: 16px 28px; }
.d-logo { display: flex; align-items: center; gap: 11px; text-decoration: none !important; color: var(--ink); flex: none; max-width: 260px; }
.d-logo:hover { color: var(--ink); }
.d-logo img { max-height: 44px; max-width: 190px; object-fit: contain; }
.d-logo .tenant-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.d-logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.d-logo .tenant-name { font-size: 16px; font-weight: 800; }
.d-logo-text small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.d-search { flex: 1 1 320px; position: relative; min-width: 0; }
.d-search .input { height: 50px; padding: 0 92px 0 46px; border-radius: 15px; background: #f1f4f7; border: 1.5px solid transparent; font-size: 15px; }
.d-search .input:hover { border-color: transparent; }
.d-search .input:focus { background: var(--surface); border-color: var(--brand); box-shadow: var(--ring); }
:root[data-theme="dark"] .d-search .input { background: var(--surface-2); }
.d-search > .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 19px; height: 19px; pointer-events: none; }
.d-search-key { position: absolute; right: 52px; top: 50%; transform: translateY(-50%); background: var(--surface); }
.d-search .scan-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.d-search .scan-btn:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); color: var(--brand-text); }
.d-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.d-chip {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px 0 8px; border-radius: 15px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none !important; white-space: nowrap;
}
.d-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.d-chip small, .cart-total small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 650; line-height: 1.2; }
.d-chip b, .cart-total b { display: block; font-size: 15px; font-weight: 800; line-height: 1.25; font-variant-numeric: tabular-nums; }
.d-actions .icon-btn-bordered { width: 50px; height: 50px; border-radius: 15px; }
.cart-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px 0 8px; border-radius: 15px;
  background: var(--brand); color: var(--brand-ink); text-decoration: none !important; white-space: nowrap; transition: background 0.15s;
}
.cart-btn:hover { background: var(--brand-strong); color: var(--brand-ink); }
.cart-btn .cart-total small { color: color-mix(in srgb, var(--brand-ink) 78%, transparent); }
.cart-ic { position: relative; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--brand-ink) 16%, transparent); display: grid; place-items: center; }
.cart-btn .badge { position: absolute; top: -7px; right: -7px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px; background: var(--tape); color: #0f1630; border: 2px solid var(--brand); }
.d-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 0; background: none; border-radius: 14px; cursor: pointer; text-align: left; color: var(--ink); }
.d-user:hover { background: var(--surface-2); }
.d-user .avatar { width: 40px; height: 40px; font-size: 13.5px; }
.d-user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.d-user-text b { font-size: 14px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.d-user-text small { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.d-user > .icon { width: 16px; height: 16px; color: var(--faint); }
.d-user .avatar { position: relative; background: var(--violet-soft); color: var(--violet); font-weight: 800; }
.d-user .avatar .icon-dot { top: -1px; right: -1px; }
.d-me { display: flex; align-items: center; gap: 2px; }
.d-me .icon-btn { width: 38px; height: 38px; border-radius: 11px; color: var(--muted); }
.d-me .icon-btn .icon { width: 18px; height: 18px; }
.d-nav { border-top: 1px solid var(--line-2); }
.d-nav-in { display: flex; gap: 2px; max-width: 1320px; margin: 0 auto; padding: 0 18px; overflow-x: auto; scrollbar-width: none; }
.d-nav-in::-webkit-scrollbar { display: none; }
.d-nav a {
  display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 12px; font-weight: 650; font-size: 14.5px; color: var(--ink-2);
  text-decoration: none !important; position: relative; white-space: nowrap; border-bottom: 2.5px solid transparent;
}
.d-nav a .icon { width: 17px; height: 17px; }
.d-nav a:hover { color: var(--ink); }
.d-nav a.is-active { color: var(--brand-text); border-bottom-color: var(--brand); font-weight: 750; }
.d-nav a.push { margin-left: auto; }
.tag-coral { background: var(--danger-soft); color: var(--danger); font-size: 11px; font-weight: 800; height: 18px; padding: 0 6px; border-radius: 6px; }
.dealer .page { max-width: 1320px; padding: 28px 28px 56px; }
.d-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.d-footer-inner { max-width: 1320px; margin: 0 auto; padding: 18px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: var(--muted); font-size: 13px; font-weight: 600; }
.d-footer-inner > a, .d-footer-inner > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.d-footer-inner a { color: var(--muted); }
.d-footer-inner a:hover { color: var(--ink); }
.d-footer-inner .icon { width: 15px; height: 15px; }
.d-footer-end { margin-left: auto; gap: 16px !important; }
.powered { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 13px; }
.powered a:hover { color: var(--ink); }
@media (max-width: 1180px) {
  .d-user-text { display: none; }
  .d-user > .icon { display: none; }
}
@media (max-width: 1024px) {
  .d-promo-in { padding: 8px 16px; }
  .d-promo-end { display: none; }
  .d-bar { padding: 10px 12px; gap: 10px; }
  .d-logo-text, .d-logo .tenant-name { display: none; }
  .d-logo img { max-height: 34px; max-width: 110px; }
  .d-logo .tenant-mark { width: 38px; height: 38px; }
  .d-search .input { height: 42px; font-size: 15px; padding-right: 52px; border-radius: 13px; }
  .d-search .scan-btn { width: 34px; height: 34px; }
  .d-nav { display: none; }
  .cart-btn { height: 42px; padding: 0 4px; border-radius: 13px; }
  .cart-btn .cart-total { display: none; }
  .dealer .page { padding: 16px 16px 40px; }
  .d-footer-inner { padding: 16px 16px calc(var(--tabbar-h) + 24px + var(--safe-b)); }
  .d-footer-end { margin-left: 0; }
}

/* product grid & cards */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 14px; }
.p-card {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
}
.p-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.p-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.p-media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; mix-blend-mode: multiply; }
:root[data-theme="dark"] .p-media img { mix-blend-mode: normal; }
.p-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--faint); }
.p-placeholder .ph-sku { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 0.02em; color: var(--muted); margin-top: 6px; }
.p-flags { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.p-fav { position: absolute; top: 6px; right: 6px; }
.p-fav.is-on .icon { color: var(--danger); fill: var(--danger); }
.p-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-sku { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.p-name { font-weight: 650; font-size: 14px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; text-decoration: none !important; }
.p-name:hover { color: var(--brand-text); }
.p-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.p-net { font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.p-list { font-size: 12.5px; color: var(--faint); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.p-vat { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.p-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.p-actions { display: flex; gap: 8px; margin-top: 8px; }
.p-actions .stepper { flex: 1; height: 38px; }
.p-actions .stepper input { width: 100%; flex: 1; }
.p-actions .btn { flex: none; }
.p-pack { font-size: 12px; color: var(--muted); }
.product-list .p-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 140px 150px 170px; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.product-list .p-row:first-child { border-top: 0; }
.p-thumb { width: 64px; height: 64px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); }
.p-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.p-thumb-sm { width: 44px; height: 44px; border-radius: 8px; }
@media (max-width: 900px) {
  .product-list .p-row { grid-template-columns: 56px minmax(0, 1fr); }
  .product-list .p-row > .p-col-extra { grid-column: 2; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .p-body { padding: 10px 10px 12px; }
  .p-net { font-size: 16.5px; }
  .p-actions { flex-direction: column; }
  .p-actions .btn { width: 100%; }
}

/* catalogue layout */
.catalog { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px; align-items: start; }
.facets { position: sticky; top: 128px; max-height: calc(100dvh - 148px); overflow-y: auto; scrollbar-width: thin; }
.facet + .facet { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.facet-title { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.cat-tree a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; text-decoration: none !important; }
.cat-tree a:hover { background: var(--surface-3); color: var(--ink); }
.cat-tree a.is-active { background: var(--brand-soft); color: var(--brand-text); }
.cat-tree .cat-children { padding-left: 12px; }
.cat-count { color: var(--faint); font-weight: 600; font-size: 12px; }
.facet .check { font-size: 13.5px; padding: 3px 0; }
@media (max-width: 1024px) {
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .facets { display: none; }
}

/* order slip: cart summary & order totals */
.slip {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-md);
}
.slip::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 4px; border-radius: 0 0 4px 4px; background: var(--tape);
}
.slip-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 750; font-size: 15px; margin-bottom: 10px; }
.slip-perf { height: 1px; margin: 14px -20px; background-image: linear-gradient(90deg, var(--line-strong) 50%, transparent 50%); background-size: 10px 1px; }
.slip-barcode { height: 30px; margin-top: 16px; opacity: 0.8; background-image: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px); border-radius: 2px; }

/* cart lines */
.cart-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: start; }
.cart-line:first-child { border-top: 0; }
.cart-line .cl-name { font-weight: 650; }
.cart-line .cl-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cart-line .cl-steps { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cart-line .cl-controls { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cart-line .cl-total { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-line .cl-unit { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.cart-line.has-problem { background: color-mix(in srgb, var(--danger-soft) 45%, transparent); }
.sticky-checkout { display: none; }
@media (max-width: 1024px) {
  .sticky-checkout {
    display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; z-index: 44;
    bottom: calc(var(--tabbar-h) + var(--safe-b)); padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -12px rgba(16, 24, 40, 0.18);
  }
  .sticky-checkout .total { font-family: var(--font-display); font-weight: 650; font-size: 18px; font-variant-numeric: tabular-nums; }
  .sticky-checkout .btn { margin-left: auto; }
  .cart-line { padding: 14px 16px; grid-template-columns: 52px minmax(0, 1fr); }
  .cart-line .cl-total { grid-column: 2; text-align: left; }
}

/* quick order grid */
.qo-table td { padding-top: 8px; padding-bottom: 8px; }
.qo-table .input { height: 36px; }
.qo-status { font-size: 12.5px; }
.autocomplete { position: relative; }
.ac-list {
  position: absolute; z-index: 70; top: calc(100% + 4px); left: 0; right: 0; max-height: 360px; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.ac-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.ac-item.is-active, .ac-item:hover { background: var(--surface-2); }
.ac-item .ac-title { font-weight: 650; font-size: 13.5px; }
.ac-item .ac-sub { font-size: 12px; color: var(--muted); }
.ac-item .ac-end { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.ac-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* banners / hero in dealer home */
.promo { position: relative; display: flex; align-items: flex-end; min-height: 180px; padding: 24px; border-radius: var(--r-xl); overflow: hidden; color: #fff; background: var(--brand); text-decoration: none !important; }
.promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.promo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.55)); }
.promo-body { position: relative; z-index: 1; }
.promo-title { font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.promo-sub { opacity: 0.88; margin-top: 4px; }
.account-card { padding: 20px; border-radius: var(--r-xl); background: var(--ink); color: var(--surface); }
.account-card .muted { color: color-mix(in srgb, var(--surface) 62%, transparent); }
.account-card .meter { background: color-mix(in srgb, var(--surface) 16%, transparent); }
.account-card .meter-legend { color: color-mix(in srgb, var(--surface) 62%, transparent); }
.account-card .meter-legend strong { color: var(--surface); }
.account-big { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.account-card .btn { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--surface); }
.account-card .btn-ghost { --btn-bg: transparent; --btn-fg: var(--surface); --btn-bd: color-mix(in srgb, var(--surface) 30%, transparent); }

/* ---------------------------------------------------------------- auth screens */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-main { display: flex; flex-direction: column; padding: 32px clamp(20px, 6vw, 72px); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-form-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 400px; margin: 40px auto; }
.auth-title { font-family: var(--font-display); font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.auth-sub { color: var(--muted); margin-top: 8px; font-size: 14.5px; }
.auth-foot { font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.auth-aside {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 40px clamp(24px, 4vw, 56px);
  background: var(--brand); color: var(--brand-ink); overflow: hidden;
}
.auth-aside::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, #fff 20%, transparent), transparent 65%);
}
.auth-aside > * { position: relative; }
.auth-quote { font-family: var(--font-display); font-size: clamp(24px, 2.4vw, 34px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; max-width: 520px; }
.auth-points { display: grid; gap: 14px; margin-top: 28px; max-width: 460px; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.auth-point .icon { flex: none; margin-top: 1px; opacity: 0.9; }
.auth-aside .slip { color: var(--ink); max-width: 420px; transform: rotate(-1.5deg); }
.otp-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-inputs input { height: 54px; text-align: center; font-size: 22px; font-weight: 700; font-family: var(--font-display); border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); }
.otp-inputs input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .auth-form-wrap { margin: 24px auto; }
}

/* ---------------------------------------------------------------- misc */
.copy-field { display: flex; gap: 6px; }
.copy-field .input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.code-block { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); }
.color-input { display: flex; gap: 8px; align-items: center; }
.color-input input[type="color"] { width: 44px; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r); padding: 3px; background: var(--surface); cursor: pointer; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.dropzone input { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .thumb-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.thumb .thumb-badge { position: absolute; left: 4px; bottom: 4px; }
.chart { width: 100%; height: 240px; position: relative; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .series-line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: color-mix(in srgb, var(--brand) 12%, transparent); }
.chart .bar { fill: var(--brand); }
.chart .bar-2 { fill: var(--tape); }
.chart .hover-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 12px; font-weight: 600; white-space: nowrap; transform: translate(-50%, -120%); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.hbar .hbar-track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-bottom: 8px; }
.hbar .hbar-track span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.cmdk-input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; height: 56px; padding: 0 20px 0 48px; font-size: 16px; background: transparent; }
.cmdk-input:focus { box-shadow: none; border-color: var(--line); }
.cmdk-results { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 12px; color: var(--faint); font-weight: 650; padding: 10px 10px 4px; }
.prose { line-height: 1.65; color: var(--ink-2); }
.prose p + p { margin-top: 12px; }
.prose h2, .prose h3 { margin: 20px 0 8px; color: var(--ink); }
.prose ul, .prose ol { padding-left: 20px; }
.legal { max-width: 780px; }
.legal h1 { font-family: var(--font-display); font-size: 28px; margin-bottom: 8px; }
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .tabbar, .d-header, .d-footer, .page-actions, .banner, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .table-card { border-color: #ddd; }
  .print-only { display: block; }
}
@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; }
}
.icon.spin { animation: spin 1s linear infinite; }
.slip.sticky { position: sticky; }
@media (max-width: 1100px) { .slip.sticky { position: relative; top: auto; } }
