/* ==========================================================================
   Fondz back-office design system
   Everything is a CSS variable: colours, radii, shadows, spacing.
   Bootstrap 5.3 variables are overridden at the bottom of the token block.
   Light is the default; dark applies via [data-bs-theme="dark"] on <html>.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&display=swap');

/* Numbers and amounts use Space Grotesk everywhere, with no markup: this family only claims digits, the naira sign and the minus sign,
   so any text that contains them picks those characters from here and everything else from the body font. */
@font-face {
  font-family: "Fondz Num";
  src: url("fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0030-0039, U+2212;
}
@font-face {
  font-family: "Fondz Num";
  src: url("fonts/space-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+20A6;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --brand: #825de6;
  --brand-hover: #6336e3;
  --brand-ink: #5a31cc;            /* brand-coloured TEXT on white / tints: 6.6:1 */
  --brand-tint: #f1ecfd;
  --brand-tint-2: #e6dcfb;
  --on-brand: #ffffff;

  /* Neutrals */
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-2: #faf9fc;
  --border: #e7e5ee;
  --border-strong: #d4d1df;
  --text: #17151f;
  --text-2: #4b4858;               /* 8.9:1 on white */
  --text-3: #6b6879;               /* 5.4:1 on white */
  --sidebar-bg: #0e0d13;
  --sidebar-2: #17161e;
  --sidebar-text: #b9b6c6;
  --sidebar-text-strong: #ffffff;
  --sidebar-line: rgba(255, 255, 255, .08);

  /* Status (soft tints + dark readable ink) */
  --ok: #17803d;      --ok-tint: #e6f5ec;
  --warn: #9a5b00;    --warn-tint: #fdf1db;
  --bad: #b42318;     --bad-tint: #fdeceb;
  --info: var(--brand); --info-tint: var(--brand-tint);   /* no blue anywhere: information uses the brand colour */

  /* Custom */
  .offcanvas-title { font-family: var(--header-font); font-size: 1rem !important; }

  /* Gallery Modal */
  #fz-gal-modal .modal-dialog { --bs-modal-width: 460px; }
  #fz-gal-modal .modal-content { border-radius: var(--r-lg); }
  /* #fz-gal-modal .modal-body { padding: var(--sp-4); } */
  /* #fz-gal-modal .modal-footer { padding: var(--sp-4); } */
  #fz-gal-modal .modal-header { font-size: var(--fs-base); }

  /* Radii */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  /* --r-pill: 999px; */
  --r-pill: 4px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(23, 21, 31, .05), 0 1px 1px rgba(23, 21, 31, .03);
  --shadow-2: 0 4px 14px rgba(23, 21, 31, .07), 0 1px 3px rgba(23, 21, 31, .05);
  --shadow-3: 0 16px 40px rgba(23, 21, 31, .14), 0 4px 10px rgba(23, 21, 31, .06);
  --ring: 0 0 0 3px rgba(130, 93, 230, .28);

  /* 8px spacing scale */
  --sp-half: 4px;
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;

  /* Layout */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --bottomnav-h: 64px;
  --touch: 44px;

  /* --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; */
  --font: "Figtree", sans-serif;
   --header-font: "Space Grotesk", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* ---- Bootstrap overrides ---- */
  --bs-body-font-family: var(--font);
  --fs-base: .85rem;     /* ALL body text and buttons: inputs, nav, menus, tables, dialogs */
  --fs-input: .8rem;
  --fs-sm: .78rem;      /* secondary text, helper text, labels */
  --fs-xs: .7rem;       /* micro: kickers, badges, captions */
  --bs-body-font-size: .85rem;
  --bs-btn-font-size: .85rem;
  --bs-dropdown-font-size: .85rem;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-border-radius: var(--r-sm);
  --bs-border-radius-lg: var(--r-md);
  --bs-border-radius-xl: var(--r-lg);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 130, 93, 230;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 130, 93, 230;           /* Bootstrap paints links from the -rgb value, which was left at its default blue */
  --bs-link-hover-color: var(--brand-hover);
  --bs-link-hover-color-rgb: 99, 54, 227;
  --bs-secondary-color: var(--text-3);
  --bs-tertiary-bg: var(--surface-2);
  --bs-emphasis-color: var(--text);
  --bs-focus-ring-color: rgba(130, 93, 230, .28);
}

[data-bs-theme="dark"] {
  --bs-primary-rgb: 143, 109, 240; --bs-link-color-rgb: 143, 109, 240; --bs-link-hover-color-rgb: 165, 138, 245;
  --brand: #8f6df0;
  --brand-hover: #a58af5;
  --brand-ink: #c3b0f8;
  --brand-tint: #25203a;
  --brand-tint-2: #322a52;
  --on-brand: #ffffff;
  --bg: #0b0a10;
  --surface: #15141c;
  --surface-2: #1b1a24;
  --border: #272633;
  --border-strong: #38364a;
  --text: #f1f0f6;
  --text-2: #c4c1d2;
  --text-3: #9d9aad;
  --sidebar-bg: #08070c;
  --sidebar-2: #12111a;
  --ok: #54d08a;   --ok-tint: #12281c;
  --warn: #f2b84b; --warn-tint: #2e2310;
  --bad: #ff8a80;  --bad-tint: #321616;
  --info: var(--brand); --info-tint: var(--brand-tint);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, .6);
  --ring: 0 0 0 3px rgba(165, 138, 245, .35);
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font); color: var(--text); font-weight: 650; letter-spacing: -.015em; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--brand-tint-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.num, .money, td.num, th.num { font-family: var(--header-font); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.money { font-weight: 600; white-space: nowrap; }
.text-3 { color: var(--text-3) !important; }
.text-2 { color: var(--text-2) !important; }
.text-brand { color: var(--brand-ink) !important; }
.visually-hidden-focusable:focus { z-index: 2000; }
.skip-link {
  position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand);
  padding: 8px 16px; border-radius: var(--r-sm); z-index: 3000;
}
.skip-link:focus { left: 8px; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; z-index: 1030;
  transition: width .22s var(--ease);
  border-right: 1px solid var(--sidebar-line);
}
.sidebar-head { padding: var(--sp-2); display: flex; align-items: center; gap: 12px; height: var(--topbar-h); flex: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; flex: none; object-fit: cover; display: block; }
.brand-word { color: #fff; font-weight: 750; font-size: 1rem; letter-spacing: -.03em; }
.brand-word span { color: #b9a2f5; }

.store-switch { padding: 0 var(--sp-2) var(--sp-1); flex: none; }
.store-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; min-height: var(--touch);
  background: var(--sidebar-2); border: 1px solid var(--sidebar-line); color: #fff;
  padding: 8px 12px; border-radius: var(--r-md); cursor: pointer;
}
.store-btn:hover { border-color: rgba(255, 255, 255, .2); }
.store-avatar {
  width: 28px; height: 28px; border-radius: 8px; background: #2a2540; color: #d9ccfb;
  display: grid; place-items: center; flex: none; font-size: var(--fs-sm); font-weight: 700;
}
.store-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: var(--fs-base); }
.store-sub { display: block; font-size: var(--fs-xs); color: var(--sidebar-text); font-weight: 450; }
.store-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--border); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--brand-tint); --bs-dropdown-link-hover-color: var(--text); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 8px; min-width: 232px; }
.store-menu, .dropdown-menu { font-size: var(--fs-base); }
.dropdown-item { font-size: var(--fs-base); }
.input-group-text { font-size: var(--fs-base); }
.store-menu .dropdown-item { border-radius: var(--r-sm); padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-height: var(--touch); }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: var(--sp-1) var(--sp-1) var(--sp-3); scrollbar-width: thin; scrollbar-color: #2d2b3a transparent; }
.nav-group { margin-top: var(--sp-2); }
.nav-label {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: 0; color: #7f7c90; font-size: .67rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  padding: 6px 12px; cursor: pointer; border-radius: var(--r-sm);
}
.nav-label:hover { color: #cfcbe0; }
.nav-label .bi { font-size: var(--fs-xs); transition: transform .2s var(--ease); }
.nav-label[aria-expanded="false"] .bi { transform: rotate(-90deg); }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; margin: 2px 0;
  color: var(--sidebar-text); border-radius: var(--r-sm); font-weight: 500; font-size: var(--fs-base); position: relative;
}
.nav-item .bi { font-size: 1rem; flex: none; width: 20px; text-align: center; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(130, 93, 230, .2); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-item .badge-dot { margin-left: auto; background: var(--brand); color: #fff; font-size: .67rem; border-radius: var(--r-pill); padding: 1px 7px; font-weight: 650; }
.nav-item .ai-chip { margin-left: auto; font-size: .62rem; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: var(--r-pill); background: rgba(185, 162, 245, .18); color: #cdbbfa; }

.sidebar-foot { padding: var(--sp-1) var(--sp-2) var(--sp-2); border-top: 1px solid var(--sidebar-line); flex: none; }
.sidebar-foot .nav-item { margin: 0; }

/* Collapsed rail (desktop) */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-word,
body.sidebar-collapsed .store-name, body.sidebar-collapsed .store-btn > .bi,
body.sidebar-collapsed .nav-item span.t, body.sidebar-collapsed .nav-item .badge-dot, body.sidebar-collapsed .nav-item .ai-chip,
body.sidebar-collapsed .nav-label span { display: none; }
body.sidebar-collapsed .nav-label { justify-content: center; padding: 4px 0; }
body.sidebar-collapsed .nav-label .bi { display: none; }
body.sidebar-collapsed .nav-group .collapse:not(.show) { display: block; }   /* keep icons visible in rail */
body.sidebar-collapsed .nav-item { justify-content: center; padding: 8px 0; }
body.sidebar-collapsed .store-btn { justify-content: center; padding: 8px 0; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); transition: margin-left .22s var(--ease); display: flex; flex-direction: column; min-height: 100vh; }
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3);
}
.icon-btn {
  width: var(--touch); height: var(--touch); border-radius: var(--r-md); border: 1px solid transparent;
  background: transparent; color: var(--text-2); display: inline-grid; place-items: center; position: relative; cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface); border-color: var(--border); color: var(--text); text-decoration: none; }
.icon-btn .bi { font-size: 1rem; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); border: 2px solid var(--bg); }

.search {
  flex: 1; max-width: 520px; position: relative;
}
.search .bi-search { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 44px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  padding: 0 64px 0 42px; color: var(--text); font-size: var(--fs-base); cursor: pointer;
}
.search input::placeholder { color: var(--text-3); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.topbar-spacer { flex: 1; }
.ask-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--r-md);
  background: var(--brand-tint); color: var(--brand-ink); border: 1px solid var(--brand-tint-2); font-weight: 600; font-size: var(--fs-base); cursor: pointer;
}
.ask-btn:hover { background: var(--brand-tint-2); }
.profile-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); min-height: var(--touch); cursor: pointer; color: var(--text); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar { overflow: hidden; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #b9a2f5, #825de6); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); flex: none; }

/* ---------- Page ---------- */
.page { padding: var(--sp-3); max-width: 1480px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.page-head h1 { font-size: 1.35rem; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.crumbs { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-3); }
.footer { padding: var(--sp-3); color: var(--text-3); font-size: var(--fs-xs); text-align: center; }
.footer a { color: var(--text-3); text-decoration: underline; }

/* ---------- Cards ---------- */
.card-f {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.card-f > .card-h { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.card-f > .card-h h2, .card-f > .card-h h3 { margin: 0; font-size: var(--fs-base); }
.card-f > .card-b { padding: var(--sp-3); }
.card-f > .card-b.tight { padding: var(--sp-2); }
.card-f > .card-b.flush { padding: 0; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.kpi { padding: var(--sp-2) var(--sp-3) var(--sp-2); display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.kpi-label { color: var(--text-3); font-size: var(--fs-xs); font-weight: 550; display: flex; align-items: center; gap: 8px; }
.kpi-label .bi { color: var(--brand-ink); background: var(--brand-tint); width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 9px; font-size: var(--fs-base); }
.kpi-value { font-family: var(--header-font); font-size: 1.65rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.trend { font-size: var(--fs-sm); font-weight: 650; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); }
.trend.up { color: var(--ok); background: var(--ok-tint); }
.trend.down { color: var(--bad); background: var(--bad-tint); }
.trend.flat { color: var(--text-3); background: var(--surface-2); }
.spark { width: 96px; height: 32px; flex: none; }
.spark path.line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark path.area { fill: var(--brand); opacity: .12; }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 650; padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; line-height: 1.4;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-tint); }
.pill.warn { color: var(--warn); background: var(--warn-tint); }
.pill.bad { color: var(--bad); background: var(--bad-tint); }
.pill.info { color: var(--info); background: var(--info-tint); }
.pill.mute { color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); }
.pill.brand { color: var(--brand-ink); background: var(--brand-tint); }

/* ---------- Buttons & forms ---------- */
.btn { font-family: var(--header-font); font-size: var(--fs-base); font-weight: 600; border-radius: var(--r-md); min-height: 40px; padding: 8px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn-lg { min-height: var(--touch); padding: 10px 20px; font-size: .85rem; }
.btn-sm { min-height: 34px; padding: 4px 12px; font-size: var(--fs-base); border-radius: var(--r-sm); }
.btn-brand { --bs-btn-color: var(--on-brand); --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover); --bs-btn-active-bg: var(--brand-hover); --bs-btn-active-border-color: var(--brand-hover); --bs-btn-active-color: #fff; --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); --bs-btn-disabled-color: #fff; box-shadow: 0 1px 2px rgba(99, 54, 227, .35); }
.btn-ghost { --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-strong); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-hover-color: var(--text); --bs-btn-active-bg: var(--brand-tint); --bs-btn-active-color: var(--text); --bs-btn-active-border-color: var(--brand); --bs-btn-disabled-color: var(--text-3); --bs-btn-disabled-bg: var(--surface-2); --bs-btn-disabled-border-color: var(--border); }
.btn-soft { --bs-btn-color: var(--brand-ink); --bs-btn-bg: var(--brand-tint); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--brand-tint-2); --bs-btn-hover-color: var(--brand-ink); --bs-btn-hover-border-color: transparent; --bs-btn-active-bg: var(--brand-tint-2); --bs-btn-active-color: var(--brand-ink); }
.btn-danger-soft { --bs-btn-color: var(--bad); --bs-btn-bg: var(--bad-tint); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--bad); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: transparent; }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn .spin { width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-control, .form-select {
  min-height: var(--touch); border-radius: var(--r-md); border-color: var(--border-strong); background-color: var(--surface); color: var(--text); font-size: var(--fs-input);
}
textarea.form-control { min-height: 96px; }
.form-control::placeholder { color: var(--text-3); opacity: 1; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: var(--ring); background-color: var(--surface); color: var(--text); }
.form-label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 6px; }
.form-text { color: var(--text-3); font-size: var(--fs-xs); margin-top: .35rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bad); }
.invalid-feedback { color: var(--bad); }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-2); border-radius: var(--r-md); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: var(--ring); border-color: var(--brand); }
.form-switch { padding-left: 3.1em; }
.form-switch .form-check-input { width: 2.5em; height: 1.4em; margin-left: -3.1em; }

/* Segmented */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: var(--fs-base); padding: 6px 14px; border-radius: 9px; min-height: 34px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on, .seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* Tabs (status filter) */
.tabs-f { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); padding: 0 var(--sp-2); }
.tabs-f::-webkit-scrollbar { display: none; }
.tabs-f button { border: 0; background: none; padding: 14px 12px; font-weight: 600; font-size: var(--fs-base); color: var(--text-3); position: relative; white-space: nowrap; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; min-height: var(--touch); }
.tabs-f button:hover { color: var(--text); }
.tabs-f button.on { color: var(--text); }
.tabs-f button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.tabs-f .count { font-size: var(--fs-xs); padding: 1px 7px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.tabs-f button.on .count { background: var(--brand-tint); border-color: transparent; color: var(--brand-ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.tbl th { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 12px var(--sp-2); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; position: sticky; top: 0; }
.tbl td { padding: 14px var(--sp-2); border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; }
.tbl .cell-main { font-weight: 600; }
.tbl .cell-sub { color: var(--text-3); font-size: var(--fs-xs); }
.thumb { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex: none; font-size: var(--fs-sm); }
/* Product card photo. ONE place sets its shape: --pc-ratio (width / height). The picture fills the box exactly, edge to edge, so the card's
   top corners are rounded by the picture itself (it used to sit 1-2px short of the top, and be taller than its own box). */
:root { --pc-ratio: 5 / 6; }
.pc-img { position: relative; display: block; aspect-ratio: var(--pc-ratio); overflow: hidden; line-height: 0; border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0; background: var(--surface-2); }
.thumb.lg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; font-size: 2rem; }
.thumb.lg img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); padding: var(--sp-2); border-bottom: 1px solid var(--border); }
.toolbar .search-lite { position: relative; flex: 1 1 220px; max-width: 360px; }
.toolbar .search-lite .bi { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.toolbar .search-lite input { padding-left: 40px; }
.toolbar .grow { flex: 1; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-2); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-sm); gap: var(--sp-1); flex-wrap: wrap; }

/* ---------- States ---------- */
.empty { text-align: center; padding: var(--sp-5) var(--sp-3); }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-tint); color: var(--brand-ink); display: grid; place-items: center; margin: 0 auto var(--sp-2); font-size: 1.4rem; }
.empty h3 { font-size: 1rem; margin-bottom: 4px; }
.empty p { color: var(--text-3); max-width: 38ch; margin: 0 auto var(--sp-2); }
.error-state { text-align: center; padding: var(--sp-4) var(--sp-3); }
.error-state .ico { width: 56px; height: 56px; border-radius: 18px; background: var(--bad-tint); color: var(--bad); display: grid; place-items: center; margin: 0 auto var(--sp-2); font-size: 1.4rem; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); color: transparent !important; user-select: none; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 7%, transparent), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; }
.sk-block { height: 220px; border-radius: var(--r-md); }
[hidden] { display: none !important; }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; right: var(--sp-2); bottom: var(--sp-2); z-index: 2000; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast-f { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-3); animation: toast-in .25s var(--ease); }
.toast-f.ok { border-left-color: var(--ok); } .toast-f.ok .bi { color: var(--ok); }
.toast-f.err { border-left-color: var(--bad); } .toast-f.err .bi { color: var(--bad); }
.toast-f.info .bi { color: var(--brand-ink); }
.toast-f .bi { font-size: 1rem; margin-top: 1px; }
.toast-f .tt { font-weight: 650; font-size: var(--fs-base); }
.toast-f .td { color: var(--text-2); font-size: var(--fs-sm); }
.toast-f .x { margin-left: auto; background: none; border: 0; color: var(--text-3); width: 28px; height: 28px; border-radius: 8px; flex: none; cursor: pointer; }
.toast-f.leaving { opacity: 0; transform: translateY(8px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ---------- Drawers / modals ---------- */
.offcanvas { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--text); --bs-offcanvas-border-color: var(--border); box-shadow: var(--shadow-3); }
.offcanvas-end { width: min(520px, 100vw); }
.offcanvas-header { border-bottom: 1px solid var(--border); padding: var(--sp-2) var(--sp-3); min-height: var(--topbar-h); }
.offcanvas-body { padding: var(--sp-3); }
.offcanvas-footer { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--border); display: flex; gap: var(--sp-1); background: var(--surface); }
.modal { --bs-modal-bg: var(--surface); --bs-modal-color: var(--text); --bs-modal-border-color: var(--border); --bs-modal-border-radius: var(--r-lg); --bs-modal-header-border-color: var(--border); --bs-modal-footer-border-color: var(--border); }
.modal-content { box-shadow: var(--shadow-3); }
.modal-header, .modal-footer { padding: var(--sp-2) var(--sp-3); }
.modal-body { padding: var(--sp-3); }
.btn-close { width: var(--touch); height: var(--touch); background-size: 12px; border-radius: var(--r-md); opacity: .7; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(1); }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px var(--sp-2); margin: 0; }
.dl dt { color: var(--text-3); font-weight: 550; font-size: var(--fs-sm); }
.dl dd { margin: 0; font-weight: 550; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--sp-2) 28px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.done::after { background: var(--brand); border-color: var(--brand); }
.timeline .tl-t { font-weight: 600; font-size: var(--fs-base); }
.timeline .tl-s { color: var(--text-3); font-size: var(--fs-xs); }

/* PIN boxes */
.pin { display: flex; gap: 12px; justify-content: center; }
.pin input { width: 56px; height: 64px; text-align: center; font-size: 1.4rem; font-weight: 700; border-radius: var(--r-md); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); caret-color: var(--brand); -webkit-text-security: disc; }
.pin input:focus { border-color: var(--brand); box-shadow: var(--ring); outline: none; }
.pin input.filled { border-color: var(--brand); background: var(--brand-tint); }
.pin.shake { animation: shake .35s; }
.pin.invalid input { border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Dashboard bits ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.grid-2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-1); }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text); background: var(--surface); min-height: 88px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.quick a:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-2); }
.quick .qi { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-tint); color: var(--brand-ink); display: grid; place-items: center; font-size: 1rem; }
.quick .ql { font-weight: 600; font-size: var(--fs-base); line-height: 1.2; }

.chart { width: 100%; height: 280px; display: block; touch-action: pan-y; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .area { fill: url(#revGrad); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .prev { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 4 5; }
.chart .hover-line { stroke: var(--brand); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hover-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; }
.chart-wrap { position: relative; }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); font-size: var(--fs-xs); box-shadow: var(--shadow-2); transform: translate(-50%, -110%); white-space: nowrap; z-index: 2; }
.chart-tip b { display: block; font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--brand); }
.legend i.p { background: var(--border-strong); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px var(--sp-3); border-bottom: 1px solid var(--border); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed .fi { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-tint); color: var(--brand-ink); }
.feed .fi.ok { background: var(--ok-tint); color: var(--ok); }
.feed .fi.warn { background: var(--warn-tint); color: var(--warn); }
.feed .fi.bad { background: var(--bad-tint); color: var(--bad); }
.feed .ft { font-weight: 600; font-size: var(--fs-base); }
.feed .fs { color: var(--text-3); font-size: var(--fs-xs); }
.feed .fm { margin-left: auto; text-align: right; flex: none; }

/* AI Action Center */
.ai-card { border-color: var(--brand-tint-2); background: linear-gradient(180deg, var(--brand-tint), var(--surface) 140px); }
.ai-badge { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-ink); background: var(--surface); border: 1px solid var(--brand-tint-2); border-radius: var(--r-pill); padding: 3px 10px; }
.insight { padding: var(--sp-2); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); display: flex; gap: 12px; }
.insight + .insight { margin-top: var(--sp-1); }
.insight .sev { width: 4px; border-radius: 4px; flex: none; background: var(--info); }
.insight.critical .sev { background: var(--bad); }
.insight.recommended .sev { background: var(--warn); }
.insight.opportunity .sev { background: var(--ok); }
.insight h4 { font-size: var(--fs-base); margin: 0 0 2px; }
.insight p { margin: 0 0 8px; color: var(--text-2); font-size: var(--fs-sm); }
.insight .ev { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.insight .ev span { font-size: var(--fs-sm); padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* Ask Fondz chat */
.chat { display: flex; flex-direction: column; gap: var(--sp-1); }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; font-size: var(--fs-base); }
.msg.user { align-self: flex-end; background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.bot .big { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; display: block; letter-spacing: -.02em; }
.chip { display: inline-flex; padding: 7px 12px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--fs-base); font-weight: 550; color: var(--text-2); cursor: pointer; min-height: 34px; align-items: center; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-tint); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Balance card */
.balance { background: linear-gradient(135deg, #2b1a63 0%, #4a2bb8 55%, #825de6 130%); color: #fff; border: 0; border-radius: var(--r-lg); padding: var(--sp-4); position: relative; overflow: hidden; box-shadow: var(--shadow-2); }
.balance::after { content: ""; position: absolute; width: 320px; height: 320px; right: -80px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%); }
.balance .lbl { color: rgba(255, 255, 255, .78); font-size: var(--fs-sm); font-weight: 550; }
.balance .amt { font-size: 2.6rem; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 4px 0 var(--sp-2); }
.balance .sub { display: flex; gap: var(--sp-4); flex-wrap: wrap; color: rgba(255, 255, 255, .85); font-size: var(--fs-sm); position: relative; z-index: 1; }
.balance .sub b { display: block; color: #fff; font-size: 1rem; font-variant-numeric: tabular-nums; }
.balance .btn-light { --bs-btn-color: #2b1a63; font-weight: 650; }
.balance .btn-outline-light { --bs-btn-border-color: rgba(255, 255, 255, .5); }

/* Products */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2); padding: var(--sp-2); }
.prod-card { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--surface); transition: box-shadow .15s, transform .15s, border-color .15s; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; color: inherit; }   /* a <button> centres its content vertically when the grid row stretches it taller than its content, which pushed the photo 1-2px down */
.prod-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); border-color: var(--border-strong); }
.prod-card .pc-b { padding: var(--sp-2); }
.prod-card .pc-n { font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 44px; gap: var(--sp-1); align-items: center; margin-bottom: var(--sp-1); }
.var-head { color: var(--text-3); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }

/* Invoice builder */
.builder { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.preview-stick { position: sticky; top: calc(var(--topbar-h) + var(--sp-2)); }
.paper { background: #fff; color: #17151f; border-radius: var(--r-md); border: 1px solid var(--border); box-shadow: var(--shadow-2); padding: var(--sp-4); font-size: var(--fs-sm); min-height: 540px; }
[data-bs-theme="dark"] .paper { border-color: transparent; }
.paper h5 { color: #17151f; margin: 0; }
.paper .p-muted { color: #6b6879; }
.paper table { width: 100%; border-collapse: collapse; margin: var(--sp-2) 0; }
.paper th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: #6b6879; padding: 8px 0; border-bottom: 1px solid #e7e5ee; }
.paper td { padding: 10px 0; border-bottom: 1px solid #f0eef5; vertical-align: top; }
.paper .t-r { text-align: right; font-variant-numeric: tabular-nums; }
.paper .tot { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.paper .tot.grand { border-top: 2px solid #17151f; margin-top: 8px; padding-top: 10px; font-weight: 750; font-size: 1rem; }
.paper .stamp { display: inline-block; background: #f1ecfd; color: #5a31cc; font-weight: 700; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-xs); letter-spacing: .05em; text-transform: uppercase; }
.item-row { display: grid; grid-template-columns: 1.6fr 72px 110px 44px; gap: var(--sp-1); margin-bottom: var(--sp-1); align-items: start; }

/* Settings / module extras */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.mini { padding: var(--sp-2) var(--sp-3); }
.mini .l { color: var(--text-3); font-size: var(--fs-xs); font-weight: 550; }
.mini .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--sp-4); text-align: center; background: var(--surface-2); cursor: pointer; color: var(--text-2); }
/* Every drop zone's text (prompt and hint) is the secondary size, app-wide: .dropzone (generic), .gal-drop (add/edit product), .photo-drop (booking photos, in pay.css) */
.dropzone, .dropzone small, .gal-drop, .gal-drop small { font-size: var(--fs-sm); }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-tint); }
.dropzone .bi { font-size: 1.7rem; color: var(--brand-ink); display: block; margin-bottom: 8px; }

/* Command palette */
.cmd .modal-dialog { margin-top: 12vh; }
.cmd .modal-content { overflow: hidden; }
.cmd-input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; min-height: 56px; padding: 0 var(--sp-3); font-size: var(--fs-base); box-shadow: none !important; }
.cmd-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.cmd-h { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 4px; }
.cmd-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); min-height: var(--touch); }
.cmd-item .bi { color: var(--text-3); width: 20px; text-align: center; }
.cmd-item:hover, .cmd-item.sel { background: var(--brand-tint); text-decoration: none; color: var(--text); }
.cmd-item.sel .bi { color: var(--brand-ink); }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-side { background: radial-gradient(900px 500px at 10% 0%, #5a31cc 0%, transparent 60%), radial-gradient(700px 500px at 100% 100%, #825de6 0%, transparent 55%), #14102a; color: #fff; padding: var(--sp-5); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; font-size: 2rem; max-width: 20ch; line-height: 1.15; letter-spacing: -.03em; }
.auth-side p { color: rgba(255, 255, 255, .8); max-width: 50ch; }
.auth-quote { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--r-lg); padding: var(--sp-3); backdrop-filter: blur(6px); max-width: 420px; }
.auth-main { display: flex; flex-direction: column; padding: var(--sp-4) var(--sp-3); }
.auth-form { width: min(420px, 100%); margin-block: auto; margin-inline: auto; }
.auth-form h1 { font-size: 1.35rem; }
/* Desktop: lock the split to the viewport so the purple panel stays put while the form scrolls */
@media (min-width: 992px) {
  .auth { height: 100vh; height: 100dvh; overflow: hidden; }
  .auth-side, .auth-main { min-height: 0; }
  .auth-main { overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- Mobile bottom nav ---------- */
.bottomnav { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: min(300px, 86vw); transition: transform .25s var(--ease); box-shadow: var(--shadow-3); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-collapsed .sidebar { width: min(300px, 86vw); }
  body.sidebar-collapsed .brand-word, body.sidebar-collapsed .store-name, body.sidebar-collapsed .nav-item span.t, body.sidebar-collapsed .nav-label span { display: revert; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 8px 12px; }
  .main, body.sidebar-collapsed .main { margin-left: 0; }
  .scrim { position: fixed; inset: 0; background: rgba(8, 7, 12, .55); z-index: 1025; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.sidebar-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--sp-2); }
  .search kbd, .ask-btn .t { display: none; }
  .ask-btn { padding: 0; width: var(--touch); justify-content: center; }
  .page { padding: var(--sp-2); padding-bottom: calc(var(--bottomnav-h) + var(--sp-3) + env(safe-area-inset-bottom)); }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2e, .builder, .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .preview-stick { position: static; }
  .profile-btn .pn { display: none; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1024;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px rgba(23, 21, 31, .06);
  }
  .bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--touch); color: var(--text-3); font-size: .67rem; font-weight: 600; background: none; border: 0; padding: 6px 0; text-decoration: none; }
  .bottomnav .bi { font-size: 1.2rem; }
  .bottomnav .on { color: var(--brand-ink); }
  .bottomnav .fab { position: relative; }
  .bottomnav .fab .bi { background: var(--brand); color: #fff; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; margin-top: -22px; box-shadow: 0 8px 18px rgba(99, 54, 227, .45); font-size: 1.4rem; }
  .toast-stack { bottom: calc(var(--bottomnav-h) + var(--sp-2) + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 1.35rem; }
  .var-row { grid-template-columns: 1fr 1fr; }
  .var-head { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px var(--sp-2); }
  .dl dd { margin-bottom: 8px; }
  .item-row { grid-template-columns: 1fr 64px; }
  .item-row .price, .item-row .rm { grid-column: auto; }
  .balance { padding: var(--sp-3); }
  .balance .amt { font-size: 2rem; }
  .pin input { width: 52px; height: 60px; }
}
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-1); }
.more-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: var(--sp-2) 6px; border-radius: var(--r-md); color: var(--text); font-size: var(--fs-sm); font-weight: 600; min-height: 84px; border: 1px solid var(--border); background: var(--surface); }
.more-grid a:hover { text-decoration: none; border-color: var(--brand); }
.more-grid .bi { font-size: 1.35rem; color: var(--brand-ink); }
.more-h { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin: var(--sp-2) 0 var(--sp-1); }
.offcanvas-bottom.more-sheet { height: 78vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 8px auto 0; }

@media (max-width: 575.98px) {
  .toolbar .search-lite { max-width: none; }
  .tbl .hide-sm, .tbl th.hide-sm { display: none; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) { .grid-2.wide { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
@media (min-width: 992px) and (max-width: 1279.98px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Small screens (phones) ---------- */
@media (max-width: 575.98px) {
  .topbar { gap: 4px; padding: 0 8px; }
  .topbar-spacer { display: none; }
  .search { min-width: 0; flex: 1 1 0; }
  .search input { padding-right: 12px; }
  .topbar [data-fz-theme] { display: none; }
  .profile-btn { padding: 3px; }
  .page { padding: 12px; padding-bottom: calc(var(--bottomnav-h) + var(--sp-3) + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: var(--sp-2); }
  .page-head .btn { flex: 1 1 auto; }

  .kpi-grid { gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-label { font-size: var(--fs-sm); gap: 6px; }
  .kpi-label .bi { width: 24px; height: 24px; font-size: var(--fs-xs); }
  .kpi-value { font-family: var(--header-font); font-size: 1rem; margin-top: 4px; }
  .kpi-foot { flex-wrap: wrap; gap: 4px; }
  .spark { width: 56px; height: 24px; }
  .trend { font-size: var(--fs-xs); padding: 2px 6px; }
  .mini { padding: 12px; }
  .mini .v { font-size: 1rem; }
  .kpi-strip { gap: 8px; }

  .card-f > .card-h { padding: 12px 16px; flex-wrap: wrap; }
  .card-f > .card-b { padding: 16px; }
  .tabs-f { padding: 0 8px; }
  .toolbar { padding: 12px; }
  .toolbar .form-select { flex: 1 1 140px; width: auto !important; }
  .toolbar .grow { display: none; }

  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
  .prod-card .pc-b { padding: 10px 12px; }
  .thumb.lg { font-size: 1.4rem; }

  .balance .amt { font-size: 1.85rem; }
  .balance .sub { gap: var(--sp-2); }
  .balance .btn { flex: 1 1 100%; }
  .offcanvas-end { width: 100vw; }
  .modal-dialog:not(.modal-sm) { margin: 8px; }
  .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; }
  .paper { padding: 20px; min-height: 0; }
  .auth-main { padding: 24px 16px; }
  .seg button { padding: 6px 10px; }
  .legend { display: none !important; }

  /* Tables become stacked cards: first cell is the title, the rest are labelled rows */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody { display: block; width: 100%; }
  .tbl.stack tbody tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .tbl.stack tbody tr:last-child { border-bottom: 0; }
  .tbl.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .tbl.stack td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .tbl.stack td[data-label]:not(:first-child)::before { content: attr(data-label); color: var(--text-3); font-size: var(--fs-sm); font-weight: 600; text-align: left; flex: none; }
  .tbl.stack td.num { text-align: right; }
  .tbl.stack td .row-actions, .tbl.stack td:last-child:has(.row-actions) { justify-content: flex-start; }
  .tbl.stack td:last-child:has(.row-actions) { display: block; text-align: left; padding-top: 8px; }
  .tbl.stack td[colspan] { display: block; }
  .tbl.stack td .d-flex { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .bottomnav, .toast-stack, .page-head .btn { display: none !important; }
  .main { margin: 0 !important; }
}

/* repeating line rows in forms (purchase orders, journal entries, statements) */
.fz-line .form-select, .fz-line .form-control { min-height: 40px; }
.fz-lines-rows .row > .col, .fz-lines-rows .row > [class*='col-'] { min-width: 0; }
@media (max-width: 575.98px) { .fz-line { padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md); } .fz-line > div { flex: 0 0 100%; max-width: 100%; } .fz-line > .col-auto { flex: 0 0 auto; max-width: none; margin-left: auto; } }

/* ---- add product: gallery, crop, chips, model-shot panel ---- */
.gal-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; padding: var(--sp-2); border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); text-align: center; cursor: pointer; }
.gal-drop .bi { font-size: 1.4rem; color: var(--brand-ink); }
.gal-drop small { font-size: var(--fs-sm); }
.gal-drop:hover, .gal-drop.over { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-tint); }
.gal-drop:focus-visible { outline: 0; box-shadow: var(--ring); }
.gal-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.gal-item { position: relative; aspect-ratio: 9 / 13; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); cursor: grab; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-item.drag { opacity: .4; } .gal-item.over { outline: 2px solid var(--brand); }
.gal-badge { position: absolute; left: 6px; top: 6px; background: var(--brand); color: var(--on-brand); font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: var(--r-pill); }
.gal-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.8rem; text-shadow: 0 1px 6px rgba(0,0,0,.5); pointer-events: none; }
.gal-tools { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: space-between; opacity: 0; transition: opacity .15s; }
.gal-item:hover .gal-tools, .gal-item:focus-within .gal-tools { opacity: 1; }
.gal-tools button, .gal-del { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(23,21,31,.72); color: #fff; font-size: var(--fs-xs); cursor: pointer; }
.gal-tools button:disabled { opacity: .35; cursor: default; }
.gal-del { position: absolute; right: 4px; top: 4px; background: var(--bad); }
@media (hover: none) { .gal-tools { opacity: 1; } }
.gal-stage { position: relative; width: 100%; background: #050505; border-radius: var(--r-md); overflow: hidden; touch-action: none; user-select: none; }
.gal-stage > img { position: absolute; max-width: none; pointer-events: none; }
.gal-box { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; outline: 0;
  background-image: linear-gradient(rgba(255,255,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.45) 1px, transparent 1px);
  background-size: 100% 33.333%, 33.333% 100%; background-position: 0 0, 0 0; background-repeat: repeat; }
.gal-box:focus-visible { box-shadow: 0 0 0 9999px rgba(0,0,0,.55), var(--ring); }
.gal-h { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid #111; touch-action: none; }
.gal-h::after { content: ""; position: absolute; inset: -10px; }
.gal-h-nw { left: 0; top: 0; cursor: nwse-resize; } .gal-h-n { left: 50%; top: 0; cursor: ns-resize; } .gal-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.gal-h-e { left: 100%; top: 50%; cursor: ew-resize; } .gal-h-se { left: 100%; top: 100%; cursor: nwse-resize; } .gal-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.gal-h-sw { left: 0; top: 100%; cursor: nesw-resize; } .gal-h-w { left: 0; top: 50%; cursor: ew-resize; }
.gal-poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.gal-poster { padding: 0; border: 2px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: none; cursor: pointer; line-height: 0; }
.gal-poster canvas { width: 100%; height: auto; display: block; }
.gal-poster.on { border-color: var(--brand); box-shadow: var(--ring); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); min-height: 46px; }
.chips:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; background: var(--brand-tint); color: var(--brand-ink); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 550; }
.tag-chip button { border: 0; background: none; color: inherit; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; }
.chip-input { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; color: var(--text); padding: 4px; }
.ap-badge { display: inline-block; background: var(--text); color: var(--surface); font-size: .65rem; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: var(--r-sm); }
.pose-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pose-row button { min-height: 40px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-weight: 550; font-size: var(--fs-base); cursor: pointer; }
.pose-row button.on { background: var(--text); color: var(--surface); border-color: var(--text); }
@media (max-width: 420px) { .pose-row { grid-template-columns: repeat(2, 1fr); } }
.ref-lib { display: flex; flex-wrap: wrap; gap: 10px; }
.ref-thumb { position: relative; width: 72px; height: 96px; padding: 0; border: 2px solid transparent; border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); cursor: pointer; }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb.on { border-color: var(--brand); box-shadow: var(--ring); }
.ref-thumb:focus-visible { outline: 0; box-shadow: var(--ring); }
.ref-del { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bad); color: #fff; font-size: var(--fs-sm); cursor: pointer; padding: 0; }
.ref-add { width: 72px; height: 96px; display: grid; place-items: center; border: 1.5px dashed var(--border-strong); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); font-size: 1.2rem; cursor: pointer; }
.ref-add:hover { border-color: var(--brand); color: var(--brand-ink); }
.ap-upsell { border-color: var(--brand-tint-2); }
.flex-none { flex: none; }

.ap-var { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2); margin-bottom: var(--sp-2); background: var(--surface); }
.ap-var-h { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-2); }
.ap-var-img { flex: none; width: 48px; height: 62px; padding: 0; overflow: hidden; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-3); display: grid; place-items: center; cursor: pointer; }
.ap-var-img:hover { border-color: var(--brand); }
.min-w-0 { min-width: 0; }

/* ---- product card: discount badge on the photo, struck-through original price ---- */
.pc-img { position: relative; }
.pc-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: var(--r-sm); background: #f2b705; color: #1d1600; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; line-height: 1.2; }
.pc-badge-sm { position: static; display: inline-block; padding: 2px 8px; }
.pc-was { color: var(--text-3); font-weight: 450; font-size: var(--fs-sm); }
/* ---- sign-in family pages (forgot / reset password, sign up): result icon and password strength guide ---- */
.auth-state { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; margin-bottom: var(--sp-3); background: var(--brand-tint); color: var(--brand-ink); }
.auth-state.ok { background: var(--ok-tint); color: var(--ok); }
.auth-state.bad { background: var(--bad-tint); color: var(--bad); }
.pw-meter { height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--bad); transition: width .2s var(--ease), background .2s; }
.pw-meter span[data-s="2"] { background: var(--warn, #b7791f); }
.pw-meter span[data-s="3"] { background: var(--ok); }
.pw-meter span[data-s="4"] { background: var(--ok); }
/* ---- sign-up and email code ---- */
.auth-form.wide { max-width: 600px; }
.tier-card { display: block; height: 100%; cursor: pointer; margin: 0; }
.tier-card input { position: absolute; opacity: 0; pointer-events: none; }
.tier-b { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: var(--sp-2); border: 1.5px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text-2); }
.tier-b strong { color: var(--text); }
.tier-b small { color: var(--text-3); font-size: var(--fs-sm); margin-top: auto; }
.tier-card:hover .tier-b { border-color: var(--brand); }
.tier-card input:checked + .tier-b { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand) inset; }
.tier-card input:focus-visible + .tier-b { box-shadow: var(--ring); }
.text-ok { color: var(--ok) !important; }
.text-bad { color: var(--bad) !important; }
.code-input { text-align: center; letter-spacing: .5em; font-size: 1.4rem; font-family: var(--header-font); font-weight: 600; padding-left: .5em; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { float: none; width: auto; padding: 0; }

/* ---- list rows: square product picture before a name, and the stock meter (as on Menyoo's inventory) ---- */
.thumb-sq { flex: none; width: 40px; height: 40px; border-radius: var(--r-md); overflow: hidden; background: var(--brand-tint); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; border: 1px solid var(--border); }
.thumb-sq img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stock-readout { min-width: 120px; }
.stock-readout > strong { display: block; font-weight: 650; }
.stock-track { display: block; width: 120px; max-width: 100%; height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.stock-track i { display: block; height: 100%; border-radius: 99px; }
.stock-track i.green { background: var(--ok); }
.stock-track i.amber { background: var(--warn, #c98720); }
.stock-track i.red { background: var(--bad); }

/* ---- sidebar plan card (Premium merchants), as on Menyoo ---- */
.plan-card { display: block; margin: var(--sp-2) 0 var(--sp-1); padding: 12px 14px; border-radius: var(--r-md); background: rgba(130, 93, 230, .16); border: 1px solid rgba(130, 93, 230, .38); color: var(--sidebar-text); text-decoration: none; }
.plan-card:hover { background: rgba(130, 93, 230, .24); color: var(--sidebar-text); }
.plan-card:focus-visible { outline: 0; box-shadow: var(--ring); }
.plan-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.plan-kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #cdbdf7; }
.plan-top .bi { color: #b9a2f5; }
.plan-text { display: block; font-size: var(--fs-sm); line-height: 1.45; }
.plan-text strong { color: #fff; font-weight: 700; }
.plan-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; font-size: var(--fs-sm); font-weight: 650; color: #cdbdf7; }
.plan-card.soon { background: rgba(242, 184, 75, .14); border-color: rgba(242, 184, 75, .45); }
.plan-card.soon .plan-kicker, .plan-card.soon .plan-top .bi, .plan-card.soon .plan-link { color: #f2c46b; }
body.sidebar-collapsed .plan-card { display: none; }

/* ---- onboarding / verification ---- */
.ob-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; list-style: none; margin: 0 0 var(--sp-3); padding: 0; counter-reset: ob; }
.ob-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-sm); min-width: 0; }
.ob-steps li span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-xs); background: var(--surface); border: 1px solid var(--border-strong); }
.ob-steps li b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-steps li.cur { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-ink); }
.ob-steps li.cur span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ob-steps li.done { color: var(--text-2); cursor: pointer; }
.ob-steps li.done span { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (max-width: 640px) { .ob-steps li b { display: none; } .ob-steps li { justify-content: center; padding: 8px 4px; } }
.ob-doc { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2); background: var(--surface); }
.ob-doc.bad { border-color: var(--bad); background: var(--bad-tint); }
.ob-alert { display: flex; gap: 10px; align-items: flex-start; margin-top: var(--sp-3); padding: 12px 14px; border-radius: var(--r-md); background: var(--bad-tint); color: var(--bad); }
.ob-alert[hidden] { display: none; }
.ob-sum { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2); margin-bottom: var(--sp-2); }
.ob-sum h3 { font-size: var(--fs-base); margin: 0 0 6px; }
.ob-row { display: flex; gap: 12px; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--border); }
.ob-row:first-of-type { border-top: 0; }
.ob-row span { color: var(--text-3); flex: none; }
.ob-row b { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.ob-timeline { display: flex; flex-wrap: wrap; gap: var(--sp-3); list-style: none; margin: 0; padding: 0; }
.ob-timeline li { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.ob-timeline li.done { color: var(--ok); font-weight: 600; }
.ob-timeline li.cur { color: var(--brand-ink); font-weight: 600; }
.ob-files { list-style: none; margin: 0; padding: 0; }
.ob-files li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.ob-files li small { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }

/* ---- payout account (bank search box and the looked-up name) ---- */
.cb { position: relative; }
.cb-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); }
.cb-list[hidden] { display: none; }
.cb-opt, .cb-empty { padding: 9px 12px; border-radius: var(--r-sm); font-size: var(--fs-base); }
.cb-opt { cursor: pointer; }
.cb-opt:hover, .cb-opt.on { background: var(--brand-tint); color: var(--brand-ink); }
.cb-empty { color: var(--text-3); }
.bk-name { min-height: var(--touch); display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-md); border: 1px dashed var(--border-strong); color: var(--text-3); font-size: var(--fs-base); }
.bk-name i { flex: none; }
.bk-name.ok { border-style: solid; border-color: var(--ok); background: var(--ok-tint); color: var(--ok); font-weight: 600; }
.bk-name.bad { border-style: solid; border-color: var(--bad); background: var(--bad-tint); color: var(--bad); align-items: flex-start; }

/* ---- try-on library: the credits card ---- */
.card-f.mini.credit { background: linear-gradient(135deg, #2b1a63 0%, #4a2bb8 60%, #825de6 130%); color: #fff; border: 0; }
.card-f.mini.credit .l { color: rgba(255, 255, 255, .78); }
.card-f.mini.credit .v { color: #fff; }

/* ---- create and edit store: the live preview, picture boxes, opening hours, status choice ---- */
.sf-preview { position: sticky; top: calc(var(--topbar-h) + 16px); --sf-accent: #825de6; }
.sf-logo { min-height: 56px; display: grid; place-items: center; margin-bottom: var(--sp-2); }
.sf-logo img { max-width: 70%; max-height: 72px; object-fit: contain; display: block; }
.sf-logo-ph { font-family: var(--header-font); font-weight: 700; letter-spacing: .5em; text-transform: uppercase; color: var(--text-3); font-size: 1rem; }
.sf-photo { aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; }
.sf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sf-photo-ph { display: grid; justify-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-sm); }
.sf-photo-ph .bi { font-size: 2rem; }
.sf-pv-name { font-family: var(--header-font); font-size: 1.2rem; text-align: center; margin: var(--sp-2) 0 2px; overflow-wrap: anywhere; }
.sf-pv-url { text-align: center; color: var(--text-2); font-size: var(--fs-base); overflow-wrap: anywhere; }
.sf-pv-url b { color: var(--sf-accent); }
.sf-pv-k { font-weight: 650; font-size: var(--fs-base); margin-top: var(--sp-1); }
.sf-pv-v { color: var(--text); margin: 2px 0 var(--sp-1); overflow-wrap: anywhere; white-space: pre-line; }
.sf-pv-v.ph { color: var(--text-3); }
.sf-drop strong { color: var(--text); font-size: var(--fs-base); }
.sf-meta { color: var(--text-3); font-size: var(--fs-sm); margin-top: 6px; min-height: 1em; overflow-wrap: anywhere; }
.sf-day { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.sf-day:first-child { border-top: 0; }
.sf-day-n { width: 100px; font-weight: 600; font-size: var(--fs-base); }
.sf-day .form-control { width: 130px; }
.sf-status { display: grid; gap: 8px; }
.sf-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; }
.sf-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.sf-opt input { margin-top: 4px; accent-color: var(--brand); }
.sf-opt span { display: grid; }
.sf-opt small { color: var(--text-3); font-size: var(--fs-sm); }
@media (max-width: 991.98px) { .sf-preview { position: static; } .sf-day-n { width: 100%; } }

/* ---- every modal: a small header and a small intro line ---- */
.modal .modal-title { font-size: .85rem !important; }
.modal-body > p.text-3 { font-size: var(--fs-sm) !important; }

/* ---- the bell: unread notifications ---- */
.feed li { position: relative; }
.feed li.unread { background: var(--brand-tint); }
.feed li.unread .ft::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: middle; }

/* ---- Fondz ERP is Premium only: the Access Denied screen and the lock marks in the menu ---- */
.erp-lock { position: relative; min-height: calc(100vh - var(--topbar-h) - 140px); }
.erp-ghost { filter: blur(7px); opacity: .55; pointer-events: none; user-select: none; }
.erp-ghost h1 { font-family: var(--header-font); font-size: 1.4rem; margin: 0 0 var(--sp-3); }
.erp-g-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-2); }
.erp-g-row span { height: 84px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.erp-g-card { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); padding: var(--sp-3); display: grid; gap: 14px; }
.erp-g-card i { display: block; height: 18px; border-radius: 6px; background: var(--surface-2); }
.erp-card { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: var(--sp-4); text-align: center; }
.erp-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink); display: inline-grid; place-items: center; font-size: 1.4rem; margin-bottom: var(--sp-1); }
.erp-kick { font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; font-weight: 650; color: var(--text-3); }
.erp-card h2 { font-family: var(--header-font); font-size: 1.2rem; margin: 6px 0 var(--sp-2); }
.erp-note { text-align: left; padding: 11px 14px; border-left: 4px solid var(--brand); background: var(--brand-tint); color: var(--brand-ink); border-radius: var(--r-sm); font-weight: 600; margin-bottom: var(--sp-2); }
.erp-card p { color: var(--text-2); margin-bottom: var(--sp-3); }
.erp-lock-ico { margin-left: auto; font-size: .72rem; color: var(--text-3); flex: none; }
body.sidebar-collapsed .erp-lock-ico { display: none; }
@media (max-width: 575.98px) { .erp-g-row { grid-template-columns: repeat(2, 1fr); } .erp-card { top: 40px; } }

/* ---- product card: the photo flips to the next photo on hover (the store page's effect). Photos only; touch screens keep the main photo ---- */
.pc-flip { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; opacity: 0; transform: scale(1); transition: opacity .5s ease, transform 2s cubic-bezier(0, 0, .44, 1.18); pointer-events: none; }
.pc-img .thumb.lg img { transition: opacity .5s ease; }
.pc-badge { z-index: 2; }
@media (hover: hover) {
  .prod-card:hover .pc-flip, .prod-card:focus-visible .pc-flip { opacity: 1; transform: scale(1.09); }
  .prod-card:hover .pc-img.has-flip .thumb.lg img, .prod-card:focus-visible .pc-img.has-flip .thumb.lg img { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .pc-flip { transition: opacity .2s ease; transform: none !important; } }

/* Order drawer: items with pictures, customer reviews */
.o-lines { list-style: none; margin: 0; padding: 0; }
.o-line { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.o-img { position: relative; flex: none; width: 56px; height: 68px; border-radius: var(--r-sm); background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.o-img img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.o-qty { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--text); color: var(--surface); font-size: .7rem; font-weight: 650; display: grid; place-items: center; }
.o-main { flex: 1; min-width: 0; }
.o-amt { flex: none; font-weight: 600; }
.o-review { margin-top: var(--sp-1); padding: var(--sp-1) var(--sp-2); background: var(--brand-tint); border-radius: var(--r-sm); font-size: var(--fs-sm); }
.o-review .stars { color: var(--warn, #d98a00); letter-spacing: 1px; }
.o-reply { margin-top: var(--sp-1); padding-left: var(--sp-2); border-left: 2px solid var(--brand); }

/* Order drawer: wider than the standard side panel, with its actions two to a row */
#ord-drawer.offcanvas-end { width: min(600px, 100vw); }
#ord-drawer-f { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1); }
#ord-drawer-f .btn { width: 100%; justify-content: center; white-space: nowrap; }
#ord-drawer-f:empty { display: none; }
@media (max-width: 480px) { #ord-drawer-f { grid-template-columns: 1fr; } }
