/* Webstore Console - design tokens, layout and components. No external fonts or assets (CSP: 'self'). */

:root {
  color-scheme: light;
  --bg: #f3f3f0;
  --surface: #fcfcfb;
  --surface-2: #f6f6f3;
  --surface-3: #ecebe6;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --axis: #898781;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --ring: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fc;
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --crit-ink: #b42828;
  --crit-soft: #fbeaea;
  --warn-soft: #fff5de;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 16px rgba(11, 11, 11, 0.06);
  --shadow-lg: 0 12px 40px rgba(11, 11, 11, 0.18);
  /* categorical series (validated, fixed order) */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  /* sequential blue */
  --q0: #e8f1fc; --q1: #b7d3f6; --q2: #86b6ef; --q3: #5598e7; --q4: #2a78d6; --q5: #1c5cab; --q6: #104281;
  --area: rgba(42, 120, 214, 0.10);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Din Next", "Cera", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  /* Arabic: system fonts only (the CSP allows self-hosted fonts; none are needed) */
  --font-ar: "Din Next", "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Naskh Arabic", "Geeza Pro", system-ui, sans-serif;
  --side: 236px;
  --side-right: 48px;  /* slim rail, like the framework's sub-menu */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f; --axis: #898781;
    --line: #2c2c2a; --line-strong: #383835; --ring: rgba(255, 255, 255, 0.10);
    --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: rgba(57, 135, 229, 0.16);
    --good-ink: #2fbf2f; --crit-ink: #ef7a7a; --crit-soft: rgba(208, 59, 59, 0.16); --warn-soft: rgba(250, 178, 25, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --q0: #1c2532; --q1: #184f95; --q2: #1c5cab; --q3: #256abf; --q4: #3987e5; --q5: #6da7ec; --q6: #b7d3f6;
    --area: rgba(57, 135, 229, 0.14);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a988f; --axis: #898781;
  --line: #2c2c2a; --line-strong: #383835; --ring: rgba(255, 255, 255, 0.10);
  --accent: #3987e5; --accent-hover: #5598e7; --accent-soft: rgba(57, 135, 229, 0.16);
  --good-ink: #2fbf2f; --crit-ink: #ef7a7a; --crit-soft: rgba(208, 59, 59, 0.16); --warn-soft: rgba(250, 178, 25, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --q0: #1c2532; --q1: #184f95; --q2: #1c5cab; --q3: #256abf; --q4: #3987e5; --q5: #6da7ec; --q6: #b7d3f6;
  --area: rgba(57, 135, 229, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:root:lang(ar) { --font: var(--font-ar); }
/* Arabic is cursive: letter spacing breaks the joins, and there are no capitals */
:lang(ar) :is(h1, h2, h3, h4, .brand-name, .nav-label, .section-t, .tile .value, .place-head, .auth-side h2, .wc-value, .wc-sec-t, .wc-num b, .wt-menu-h, .wt-tab-group) { letter-spacing: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: end; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* boot */
.boot { display: grid; place-items: center; height: 100vh; }
.boot-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* ---------- shell ---------- */
/* left side bar | top bar over the content (fills the width) | right side bar.
   The shell is exactly one screen tall: the page itself never scrolls, only the content area does. */
.shell {
  display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--side-right);
  height: 100vh; height: 100dvh; overflow: hidden;
}
body:has(> #app > .shell) { overflow: hidden; }
.side {
  height: 100%; min-height: 0; overflow-y: auto;
  background: var(--surface); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-logo svg { width: 18px; height: 18px; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.store-chip {
  margin: 0 4px 12px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.store-chip .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-chip .slug { font-size: 11.5px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav a, .nav-head {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; text-decoration: none; min-width: 0;
}
.nav-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a svg, .nav-head svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover, .nav-head:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a.active svg { opacity: 1; }
.nav .count { margin-inline-start: auto; font-size: 11.5px; background: var(--surface-3); color: var(--ink-2); padding: 0 7px; border-radius: 999px; font-variant-numeric: tabular-nums; flex: none; }
/* accordion groups: a header button, then the sub-sections (opened with an animated grid row) */
.nav-head { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; text-align: start; }
.nav-group.has-active > .nav-head { color: var(--ink); }
.nav-group.has-active > .nav-head svg { opacity: 1; color: var(--accent); }
.nav-chev { font-size: 11px; color: var(--muted); flex: none; transition: transform .2s; }
.nav-group.open > .nav-head .nav-chev { transform: rotate(180deg); }
.nav-group.open > .nav-head .count { display: none; }  /* its sub-sections show their own */
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.nav-group.open > .nav-sub { grid-template-rows: 1fr; }
.nav-sub-in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px; }
.nav-group:not(.open) .nav-sub-in { visibility: hidden; transition: visibility 0s .2s; }
.nav .nav-sublink { padding-block: 6px; padding-inline: 37px 10px; font-size: 13px; position: relative; }
.nav-dot { position: absolute; inset-inline-start: 18px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--line-strong); }
.nav .nav-sublink.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .nav-sublink.active::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--accent); }
.nav .nav-sublink.active .nav-dot { background: var(--accent); }
.nav-group.open { margin-bottom: 4px; }
/* alert badges (hot leads): tinted with the serious tone, text mixed towards ink for contrast */
.nav .count.hot { background: color-mix(in srgb, var(--serious) 18%, var(--surface)); color: color-mix(in srgb, var(--serious) 45%, var(--ink)); font-weight: 650; }
/* Groups (shell.js buildNav): Overview | Sales | Catalog | Reports | Administration, set apart by space,
   each after its small caption. */
.nav { gap: 0; }
.nav-sec { display: flex; flex-direction: column; gap: 2px; }
.nav-sec + .nav-sec { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.nav-sec > .nav-label { padding: 0 10px 6px; font-size: 10.5px; }
:lang(ar) .nav-sec > .nav-label { font-size: 11.5px; text-transform: none; }
/* An open sub-menu: a darker block (both themes) inset from the nav, with room around and between its
   options; the active option keeps its accent fill and bar. The block's spacing lives on the links, so
   the closed (0fr) row still collapses to nothing. */
:root { --nav-sub-bg: #ecebe5; --nav-sub-hover: #e2e1da; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --nav-sub-bg: #0f0f0e; --nav-sub-hover: #1c1c1b; } }
:root[data-theme="dark"] { --nav-sub-bg: #0f0f0e; --nav-sub-hover: #1c1c1b; }
.nav-sub { overflow: hidden; transition: grid-template-rows .2s ease, margin .2s ease; }
.nav-group.open > .nav-sub { margin-top: 4px; }
.nav-sub-in { gap: 3px; border-radius: 8px; background: var(--nav-sub-bg); margin-inline-start: 6px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06); }
.nav-sub-in > .nav-sublink { margin-inline: 6px; padding-inline: 28px 10px; }
.nav-sub-in > .nav-sublink:first-child { margin-top: 6px; }
.nav-sub-in > .nav-sublink:last-child { margin-bottom: 6px; }
.nav-sub-in .nav-dot { inset-inline-start: 12px; }
.nav-sub-in > .nav-sublink:hover { background: var(--nav-sub-hover); }
.nav-sub-in > .nav-sublink.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.nav-group.open { margin-bottom: 6px; }
/* Store chip: the name with the open-storefront button beside it */
.store-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.store-name-row .name { flex: 1; min-width: 0; }
.store-chip .store-open { flex: none; width: 26px; height: 26px; margin-block: -4px; color: var(--muted); }
.store-chip .store-open:hover { color: var(--accent); background: var(--surface-3); text-decoration: none; }
.store-chip .store-open i { font-size: 12.5px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); flex: none; }

/* Right side bar: a slim rail reserved for page context (icons later); empty for now. */
.side-right {
  height: 100%; min-height: 0; overflow-y: auto;
  background: var(--surface); border-inline-start: 1px solid var(--line);
}

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
/* Top bar: same surface as the side bars, set off from the content by a line */
.topbar {
  position: relative; flex: none; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; min-height: 61px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar.scrolled { box-shadow: var(--shadow); }
.topbar + .content { padding-top: 14px; }
.topbar h1 { font-size: 19px; }
.topbar-title { min-width: 0; }
.topbar-actions { margin-inline-start: auto; }
.topbar-actions:empty { display: none; }
.topbar-actions:empty + .account-btn { margin-inline-start: auto; }

/* Account menu button (avatar, name, store or role) at the end of the top bar */
.account-btn {
  display: inline-flex; align-items: center; gap: 10px; flex: none; max-width: 260px;
  padding-block: 4px; padding-inline: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer;
}
.account-btn:hover { background: var(--surface-2); }
.account-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-btn .avatar { background: var(--accent-soft); color: var(--accent); }
.account-btn .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account-btn .who b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .who span { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .chev { font-size: 11px; color: var(--muted); }
.account-menu .wt-menu-h:first-child { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.topbar .crumb { color: var(--muted); font-size: 12.5px; }
.btn.menu-btn { display: none; }
.nav-scrim { display: none; }
.content {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0;
}

/* Page tabs: the page's sub-sections (the same links as the side bar), between the top bar and the content */
.page-tabs { flex: none; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 20px; min-width: 0; }
.page-tabs-in { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.page-tabs-in::-webkit-scrollbar { display: none; }
.page-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: -1px; white-space: nowrap;
  color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; text-decoration: none;
}
.page-tab:hover { color: var(--ink); text-decoration: none; }
.page-tab.is-cur { color: var(--accent); border-bottom-color: var(--accent); }
.page-tab .count { font-size: 11.5px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.count.hot { background: color-mix(in srgb, var(--serious) 18%, var(--surface)); color: color-mix(in srgb, var(--serious) 45%, var(--ink)); font-weight: 650; }
.page-tabs + .content { padding-top: 14px; }

/* Top bar path while a record page is open: "Orders / WS100481" */
.crumbs { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.crumbs a:hover { color: var(--accent); }
.crumb-sep { color: var(--muted); margin: 0 10px; font-weight: 400; }
.crumb-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Table pages: the list, and the record page that replaces it while a record is open */
.page-list, .page-record { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* While the list shows, the page holds still and only the table's rows scroll: the content area,
   the list and the table are flex columns, and the rows' scroller takes the height that is left under
   the intro, toolbar and filters. A screen too short for a usable table (the card keeps 300px) lets
   the content area scroll again. Phones keep one page scroll (table.css turns the inner one off). */
@media (min-width: 721px) {
  .content:has(> .page-list:not([hidden])) { padding-bottom: 12px; }
  .page-list { flex: 1; min-height: 0; }
  .page-list > * { flex: none; }  /* intro banners and tips keep their height */
  .page-list > .page-table { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .page-table > .wt { flex: 1; min-height: 0; }
  .page-table .wt-card { flex: 1; min-height: 300px; }
  .page-table .wt-card > * { flex: none; }
  .page-table .wt-card > .wt-scroll { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
}
.rec-page { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* The record header: back, title and the record's actions (save, delete, print…). It stays at the top of
   the content area (the scroller) while the page scrolls, on the page background, so the actions are
   always in view; the negative margin keeps its resting place where it was. */
.rec-page-h {
  display: flex; align-items: center; gap: 8px 12px; min-width: 0; flex-wrap: wrap;
  /* top: minus the content area's top padding, so it sits flush with the area's edge and nothing
     scrolls through above it */
  position: sticky; top: -14px; z-index: 6; background: var(--bg); padding-block: 8px; margin-top: -8px;
}
.rec-page-h h2 { font-size: 18px; min-width: 0; }
.rec-page-t { min-width: min(100%, 200px); }
.rec-page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; min-width: 0; }
.rec-page-actions > .grow { display: none; }  /* footer spacers: the header already puts the actions at the end */
@media (max-width: 720px) { .rec-page-actions { flex-basis: 100%; } }
.rec-page-b {
  display: flex; flex-direction: column; gap: 18px; min-width: 0;
  padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.content.loading { opacity: .55; transition: opacity .15s; pointer-events: none; }

.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
}
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.banner.crit { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 8px 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-h > .stack.grow { min-width: min(100%, 160px); }
.card-h .sub { color: var(--muted); font-size: 12.5px; }
.card-b { padding: 14px 16px 16px; }
.card-b.flush { padding: 8px 0 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* stat tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.tile .label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.tile .value { font-size: 24px; font-weight: 620; letter-spacing: -0.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .delta { font-size: 12.5px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; color: var(--muted); }
.tile .delta > span:first-child { white-space: nowrap; }
.delta .up-good, .delta .down-good { color: var(--good-ink); font-weight: 600; }
.delta .up-bad, .delta .down-bad { color: var(--crit-ink); font-weight: 600; }
.tile.hero .value { font-size: 34px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-weight: 550; cursor: pointer; white-space: nowrap; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--crit-ink); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.btn.danger:hover { background: var(--crit-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; border-color: var(--ink-2) transparent var(--ink-2) transparent; animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select, .textarea {
  height: 34px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); min-width: 0;
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 84px; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.search { padding-inline-start: 32px; background-repeat: no-repeat; background-position: 10px center; background-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); width: 260px; }
.input.search:dir(rtl) { background-position: right 10px center; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field > div > .input, .field > div > .select { width: 100%; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--crit-ink); }
.field.invalid .input, .field.invalid .textarea, .field.invalid .select { border-color: var(--crit); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
/* an input with a currency sign before it ($, DZD, the Arabic dinar sign): one bordered box, any sign width */
.prefix {
  display: flex; align-items: center; min-width: 0; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface);
}
.prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prefix > b { flex: none; padding-inline: 10px 4px; color: var(--muted); font-weight: 500; pointer-events: none; white-space: nowrap; }
.prefix > .input { flex: 1; width: 100%; height: 32px; border: 0; padding-inline-start: 4px; background: transparent; }
.prefix > .input:focus { box-shadow: none; }
.field.invalid .prefix { border-color: var(--crit); }

/* segmented control + tabs */
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--surface-3); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; font-weight: 550; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: transparent; padding: 9px 12px; font-weight: 550; color: var(--ink-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* badges: dot + label (status never by colour alone) */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 550; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
/* Each tone sets --tone; the pill is tinted with it, the dot (or a tag's icon) is the tone itself and the
   text is the tone mixed towards ink, which keeps at least 4.5:1 on the tint in light and dark themes.
   The tint means a badge still carries its tone if a tag icon's glyph is missing from icons.css. */
.badge { --tone: var(--axis); }
.badge.good { --tone: var(--good); }
.badge.warn { --tone: var(--warn); }
.badge.serious { --tone: var(--serious); }
.badge.crit { --tone: var(--crit); }
.badge.info { --tone: var(--accent); }
.badge.violet { --tone: var(--s7); }
.badge:is(.good, .warn, .serious, .crit, .info, .violet) {
  background: color-mix(in srgb, var(--tone) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--tone) 32%, var(--surface));
  color: color-mix(in srgb, var(--tone) 52%, var(--ink));
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex: none; }
.badge.warn::before { background: color-mix(in srgb, var(--warn) 85%, var(--ink)); }
.badge.plain::before { display: none; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); font-size: 12px; margin-inline-end: 4px; margin-bottom: 4px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: end; font-variant-numeric: tabular-nums; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl .cell-title { font-weight: 550; }
.tbl .cell-sub { font-size: 12px; color: var(--muted); }
.thumb { width: 36px; height: 36px; border-radius: 7px; flex: none; display: grid; place-items: center; font-weight: 650; font-size: 12px; color: #fff; overflow: hidden; background: var(--s1); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ---------- drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11, 11, 11, 0.32); z-index: 30; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; inset-inline-end: 0; bottom: 0; width: min(560px, 100vw); z-index: 31; background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out;
}
.drawer.wide { width: min(760px, 100vw); }
.drawer:dir(rtl) { animation-name: slide-rtl; }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
@keyframes slide-rtl { from { transform: translateX(-24px); opacity: .6; } }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { font-size: 17px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.drawer-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.section-t { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.modal {
  position: fixed; z-index: 41; left: 50%; top: 18vh; transform: translateX(-50%); width: min(440px, calc(100vw - 32px));
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.overlay.top { z-index: 40; }
/* Form dialogs (dom.js drawer()): centered on the screen (inset + auto margins, so the same in RTL),
   the body scrolls when the form is taller than the screen; a full-screen sheet on phones. */
.drawer.dlg {
  inset: 0; margin: auto; width: min(560px, calc(100vw - 48px)); height: fit-content;
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  border-radius: 14px; border: 1px solid var(--line); overflow: hidden; animation: dlg-in .16s ease-out;
}
.drawer.dlg.wide { width: min(760px, calc(100vw - 48px)); }
.drawer.dlg .drawer-b { min-height: 0; overscroll-behavior: contain; }
.drawer.dlg .drawer-f { flex-wrap: wrap; }
.overlay.dlg-backdrop { background: rgba(11, 11, 11, 0.42); }
@keyframes dlg-in { from { transform: translateY(10px) scale(.985); opacity: 0; } }
@media (max-width: 640px) {
  .drawer.dlg, .drawer.dlg.wide { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .drawer.dlg .drawer-h { padding: 12px 16px; }
  .drawer.dlg .drawer-b { padding: 16px 16px 24px; }
  .drawer.dlg .drawer-f { padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding-bottom: 14px; padding-inline-start: 22px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 7.5px; top: 14px; bottom: -2px; width: 1px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .t { font-weight: 550; text-transform: capitalize; }
.lines { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lines .line { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); }
.lines .line:first-child { border-top: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 650; font-size: 15px; padding-top: 6px; border-top: 1px solid var(--line); }

/* ---------- toasts & tooltip ---------- */
.toasts { position: fixed; z-index: 60; bottom: 20px; inset-inline-end: 20px; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 11px 14px; border-radius: 9px; background: var(--ink); color: var(--surface);
  box-shadow: var(--shadow-lg); font-weight: 500; display: flex; gap: 10px; align-items: center; animation: rise .18s ease-out;
}
.toast.err { background: var(--crit); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.toast svg, .badge svg, .row > svg { width: 16px; height: 16px; flex: none; }
.tooltip {
  position: fixed; z-index: 70; pointer-events: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; min-width: 120px;
}
.tooltip .tt-h { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row b { font-weight: 650; font-variant-numeric: tabular-nums; }
.tooltip .key { width: 12px; height: 2px; border-radius: 1px; flex: none; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; direction: ltr; }  /* time reads left to right in RTL too */
.chart .grid-line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base-line { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--axis); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .series-line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: var(--area); }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; }
.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.chart .col { fill: var(--s1); }
.chart .col:hover, .chart .col.hot { fill: var(--accent-hover); }
.chart-tools { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; }
.chart-table { max-height: 320px; overflow: auto; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bar-row .track { height: 10px; position: relative; }
.bar-row .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--s1); min-width: 2px; }
.bar-row .val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; min-width: 64px; text-align: end; white-space: nowrap; }
.bar-row .val b { color: var(--ink); font-weight: 600; }

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-step { display: grid; grid-template-columns: 150px 1fr 110px; gap: 12px; align-items: center; }
.funnel-step .track { height: 24px; position: relative; background: var(--surface-2); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.funnel-step .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; }
.funnel-step .lbl { font-size: 13px; }
.funnel-step .v { text-align: end; font-variant-numeric: tabular-nums; }
.funnel-step .v small { display: block; color: var(--muted); font-size: 11.5px; }
.funnel-step.is-mark .v small { color: var(--crit-ink); font-weight: 600; }
.funnel-step.is-mark .v small svg { width: 12px; height: 12px; vertical-align: -1px; }
.funnel-step.is-mark .lbl { font-weight: 600; }
.funnel-note { margin: 4px 0 0; display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.funnel-note > i { color: var(--crit-ink); margin-top: 2px; }
.checkout-funnel { gap: 12px; }

/* visitors by wilaya: name | bar | visitors | orders | conversion */
.places-wrap { gap: 14px; }
.places { display: flex; flex-direction: column; gap: 7px; }
.place-row { position: relative; display: grid; grid-template-columns: minmax(90px, 26%) minmax(40px, 1fr) 64px 64px 78px; align-items: center; gap: 10px; font-size: 13px; }
.place-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.place-row .track { height: 10px; position: relative; }
.place-row .fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--s1); min-width: 2px; }
.place-row .num { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.place-row .num b { color: var(--ink); font-weight: 600; }
.place-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.place-head .name, .place-head .num { color: var(--muted); }
.place-row.is-cold .o { color: color-mix(in srgb, var(--warn) 55%, var(--ink)); font-weight: 600; }
.place-row .cold-ico { margin-inline-end: 5px; font-size: 11.5px; }
.places-more { align-self: flex-start; }
.places-note { margin: 0; }
.place-head .lbl-short { display: none; }

.segbar { display: flex; gap: 2px; height: 28px; width: 100%; }
.segbar > div { border-radius: 4px; display: flex; align-items: center; padding: 0 8px; color: #fff; font-size: 12px; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; }
.segbar > div.dark-ink { color: #0b0b0b; }
.segbar.thin { height: 8px; }
.segbar.thin > div { border-radius: 999px; padding: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* hours read left to right in both directions, like the time axis of the line charts */
.heat { display: grid; grid-template-columns: max-content repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 10.5px; color: var(--axis); direction: ltr; }
.heat .cell { aspect-ratio: 1 / 1; border-radius: 3px; background: var(--q0); min-height: 10px; }
.heat .cell:hover { outline: 2px solid var(--ink); outline-offset: -1px; }
.heat .hl { display: flex; align-items: center; padding-right: 6px; white-space: nowrap; }
.heat .hh { text-align: center; }
.ramp { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 10px; direction: ltr; }
.ramp i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }

.meter { height: 8px; border-radius: 999px; background: var(--q0); overflow: hidden; }
.meter > div { height: 100%; background: var(--accent); border-radius: 999px; }

.preview-store { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.preview-store .hero { padding: 22px 20px; color: #fff; display: flex; align-items: center; gap: 14px; background-size: cover; background-position: center; min-height: 104px; }
.preview-store .hero h3 { font-size: 20px; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.preview-store .pv-tag { opacity: .92; margin-top: 4px; text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.preview-store .pv-logo {
  width: 52px; height: 52px; flex: none; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: #222; font-weight: 700; font-size: 20px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.preview-store .pv-logo img { width: 100%; height: 100%; object-fit: cover; }
.input.color { width: 64px; padding: 2px; }

/* ---------- record drawers (order, product, store, user) ---------- */
.rec-title { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.rec-ico {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 16px;
}
.rec-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rec-line { gap: 8px; font-size: 17px; font-weight: 650; line-height: 1.25; }
.rec-line > span:first-child { overflow-wrap: anywhere; }
.rec-sub { font-weight: 400; }
.rec-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.rec-panel .section-t { margin: 0; }
.rec-links { gap: 6px; }
.rec-checks { gap: 8px 22px; }
.rec-tags { flex-wrap: wrap; min-height: 22px; }
.rec-desc { margin: 10px 0 0; }
.rec-addr { gap: 4px; margin-top: 12px; }
:is(.drawer, .rec-page) .addr { gap: 2px; }
:is(.drawer, .rec-page) .addr b { color: var(--ink); }
:is(.drawer, .rec-page) .tracking { margin-top: 8px; }
/* Algeria-form orders: wilaya and phone numbers with call and copy */
.addr-wilaya { gap: 6px; color: var(--ink); }
.addr-wilaya > i { color: var(--muted); width: 16px; text-align: center; }
.phones { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.phone-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.phone-k { min-width: 92px; }
.phone-call { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--accent); text-decoration: none; padding: 3px 0; white-space: nowrap; }
.phone-call:hover bdi { text-decoration: underline; }
.phone-call > i { width: 16px; text-align: center; }
.phone-line .btn.icon { margin-inline-start: -2px; }
.addr-hint { margin: 6px 0 0; }
.copy-buffer { position: fixed; top: -1000px; left: 0; width: 1px; height: 1px; opacity: 0; }
:is(.drawer, .rec-page) .line-total { min-width: 84px; text-align: end; }
:is(.drawer, .rec-page) .totals-wrap { margin-top: 12px; }
:is(.drawer, .rec-page) .wc-card { box-shadow: none; }
.card.flat { box-shadow: none; }
.tips { gap: 10px; }
.page-table { min-width: 0; }
.preview-store .body { padding: 14px 20px; background: var(--surface); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preview-store .ph { height: 60px; border-radius: 8px; background: var(--surface-3); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: linear-gradient(155deg, #123a6b 0%, #1c5cab 55%, #2a78d6 100%); color: #fff; padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; max-width: 440px; }
.auth-side p { opacity: .85; max-width: 440px; margin-top: 12px; font-size: 15px; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.auth-points div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; opacity: .95; }
.auth-points svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 24px; }
.auth-card .btn { height: 40px; }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--crit-soft); color: var(--crit-ink); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .side-right { display: none; }
  .side { position: fixed; z-index: 35; inset-inline-start: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s, visibility 0s .2s; visibility: hidden; }
  .shell.nav-open .side { box-shadow: var(--shadow-lg); visibility: visible; transition: transform .2s; }
  .side:dir(rtl) { transform: translateX(100%); }
  .shell.nav-open .side:dir(rtl) { transform: none; }
  .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 34; background: rgba(11, 11, 11, 0.32); animation: fade .15s ease-out; }
  .shell.nav-open .side { transform: none; }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; row-gap: 8px; }
  .topbar > .row { flex-wrap: wrap; justify-content: flex-end; }
  .topbar-title { flex: 1; }
  .account-btn { order: 2; padding: 3px; }
  .account-btn .who, .account-btn .chev { display: none; }
  .topbar-actions { order: 3; width: 100%; margin-inline-start: 0; }
  .content { padding: 4px 16px 40px; }
  .page-tabs { padding: 0 8px; }
  .page-tabs + .content { padding-top: 14px; }
  .rec-page-b { padding: 16px; }
  .crumbs a, .crumb-sep { display: none; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .input.search { width: 100%; }
  .filters > * { flex: 1 1 auto; }
  .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 120px 1fr; }
  .funnel-step { grid-template-columns: 1fr 90px; }
  .funnel-step .track { grid-column: 1 / -1; grid-row: 2; }
  .place-row { grid-template-columns: minmax(0, 1fr) 58px 52px 66px; row-gap: 4px; }
  .place-row .track { grid-column: 1 / -1; grid-row: 2; }
  .place-head .track { display: none; }
  .place-head .lbl-long { display: none; }
  .place-head .lbl-short { display: inline; }
  .leads-sum .bar-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .leads-sum .bar-row .track { grid-column: 1 / -1; grid-row: 2; }
  .hide-sm { display: none !important; }
}
/* ---------- scrollbars ----------
   Thin (6px), and out of sight until they are needed. A scroll area's thumb fades in, faint, while the
   pointer is over the area, stronger while it scrolls (shell.js gives it .is-scrolling for a moment) and
   strongest under the pointer, then fades out again. --sb-thumb is a registered colour, so it can fade;
   each bar's thumb reads it from its area, and areas inside an area inherit it. Reduced motion (below)
   turns the fade into a plain switch. Firefox gets its thin bar with the same colours. */
@property --sb-thumb { syntax: "<color>"; inherits: true; initial-value: transparent; }
:root {
  --sb-faint: color-mix(in srgb, var(--ink) 16%, transparent);
  --sb-on: color-mix(in srgb, var(--ink) 30%, transparent);
  --sb-strong: color-mix(in srgb, var(--ink) 46%, transparent);
}
:where(.side, .side-right, .content, .drawer-b, .tbl-wrap, .chart-table, .wt-scroll, .wt-pop, .wt-options, .wt-modal-b,
  .wt-print-cols, .wt-failures, .assign-list, .chat-b, .team-wilayas) { transition: --sb-thumb .35s ease; }
:where(.side, .side-right, .content, .drawer-b, .tbl-wrap, .chart-table, .wt-scroll, .wt-pop, .wt-options, .wt-modal-b,
  .wt-print-cols, .wt-failures, .assign-list, .chat-b, .team-wilayas):hover { --sb-thumb: var(--sb-faint); }
.is-scrolling { --sb-thumb: var(--sb-on); }
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--sb-thumb); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background: var(--sb-strong); }
}
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
