/*
 * Shop Control design system, layered over Tabler 1.0.
 *
 * World: ember on paper by day, ember on charcoal by night. Warm neutral ground, plain surfaces, hairlines
 * and quiet depth. Ink carries the primary actions; ember only says "here" and "look": the current place,
 * a count that needs a person, focus. Signal colours always travel with a word. Money is tabular, aligned
 * and coloured only when it moves. Direction-sensitive spacing uses logical properties, so RTL needs no
 * overrides.
 *
 * Contents: tokens · base · shell (rail, contextual menu, top bar, page head, tab bar) · command palette ·
 * surfaces · buttons · forms · tables · status · KPIs · board · stations and timeline · overlays · filters
 * and pagination · page patterns · sign-in · responsive.
 */

/* ================================================================ fonts */

/* IBM Plex Sans Arabic and IBM Plex Sans 1.1.0 (OFL, see vendor/fonts/OFL.txt), files unmodified because the
 * licence reserves the name Plex. An Arabic file also holds the Latin letters and digits, so an Arabic page
 * needs only that one file per weight; an English page needs only its small Latin split. Three weights:
 * 400 text, 500 labels, 600 titles and figures. */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSansArabic-Regular.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+20AC, U+2122, U+2190-2199, U+2212, U+221E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSansArabic-Medium.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+20AC, U+2122, U+2190-2199, U+2212, U+221E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSansArabic-SemiBold.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0600-06FF, U+0750-077F, U+08A0-08FF, U+2010-2015, U+2018-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+20AC, U+2122, U+2190-2199, U+2212, U+221E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-Regular-Latin1.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-Medium-Latin1.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-SemiBold-Latin1.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-Regular-Latin2.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-Medium-Latin2.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-SemiBold-Latin2.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0100-0101, U+0104-0130, U+0132-0151, U+0154-017F, U+018F, U+0192, U+01A0-01A1, U+01AF-01B0, U+01FA-01FF, U+0218-021B, U+0237, U+0259, U+1E80-1E85, U+1E9E, U+20A1, U+20A4, U+20A6, U+20A8-20AA, U+20AD-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BD, U+20BF; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-Regular-Pi.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0E3F, U+2000-200D, U+2015, U+2028-2029, U+202F, U+2032-2033, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+ECE0, U+EFCC, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-Medium-Pi.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0E3F, U+2000-200D, U+2015, U+2028-2029, U+202F, U+2032-2033, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+ECE0, U+EFCC, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/IBMPlexSans-SemiBold-Pi.woff2?v=1.1.0") format("woff2");
  unicode-range: U+0E3F, U+2000-200D, U+2015, U+2028-2029, U+202F, U+2032-2033, U+2070, U+2074-2079, U+2080-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+2215, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11, U+ECE0, U+EFCC, U+FEFF, U+FFFD; }

/* ================================================================ tokens */

:root,
[data-bs-theme="light"] {
  --font-sans: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
               "SF Pro Text", "SF Arabic", "Noto Sans Arabic", "Noto Sans", Tahoma, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  /* Paper */
  --ground: #f6f5f2;
  --surface: #ffffff;
  --sunken: #f0eeea;
  --hover: #f4f2ee;
  --line: #e5e2dc;
  --line-strong: #cfcbc2;
  --ink: #181715;
  --ink-2: #3d3a35;
  --muted: #5f5b54;
  --inverse: #181715;
  --inverse-hover: #3a3731;
  --on-inverse: #faf9f7;

  /* Ember: "here" and "look". Filled ember under text uses --accent-strong. */
  --accent: #e2561b;
  --accent-strong: #c2410c;
  --accent-hover: #b23e0c;
  --accent-rgb: 226, 86, 27;
  --accent-ink: #a8390b;
  --accent-soft: #fcece2;
  --on-accent: #ffffff;

  /* Signals: always paired with a word or icon */
  --good: #116b3f;
  --good-soft: #e2f4ea;
  --good-mark: #1a9a5b;
  --warn: #855600;
  --warn-soft: #fcf3d6;
  --warn-mark: #d99a14;
  --bad: #b32222;
  --bad-soft: #fce6e5;
  --bad-mark: #d93333;
  --info: #1f55b3;
  --info-soft: #e3edfc;
  --idle-mark: #a8a299;

  /* Chart series: money in ember, counts in slate, previous period in grey */
  --series-money: #e2561b;
  --series-latest: #e2561b;
  --series-count: #55617a;
  --series-prev: #b4afa6;

  --shadow-panel: 0 1px 0 rgba(24, 23, 21, 0.02), 0 1px 3px rgba(24, 23, 21, 0.05);
  --shadow-pop: 0 1px 2px rgba(24, 23, 21, 0.05), 0 12px 32px -8px rgba(24, 23, 21, 0.2);
  --shadow-raise: 0 6px 18px -10px rgba(24, 23, 21, 0.25);
  --scrim: rgba(24, 23, 21, 0.42);
  --selection: rgba(226, 86, 27, 0.2);
}

[data-bs-theme="dark"] {
  --ground: #100f0e;
  --surface: #191816;
  --sunken: #141312;
  --hover: #211f1d;
  --line: #2c2a27;
  --line-strong: #45413c;
  --ink: #eeebe5;
  --ink-2: #d2cdc5;
  --muted: #aaa49b;
  --inverse: #eeebe5;
  --inverse-hover: #d6d2ca;
  --on-inverse: #161513;

  --accent: #f06e36;
  --accent-strong: #f06e36;
  --accent-hover: #f58a5c;
  --accent-rgb: 240, 110, 54;
  --accent-ink: #f89264;
  --accent-soft: #381e13;
  --on-accent: #1c0d05;

  --good: #5cce8e;
  --good-soft: #142c1f;
  --good-mark: #50c684;
  --warn: #e8b03c;
  --warn-soft: #32270e;
  --warn-mark: #e8b03c;
  --bad: #f4807a;
  --bad-soft: #3a1716;
  --bad-mark: #f26862;
  --info: #84aef6;
  --info-soft: #15223a;
  --idle-mark: #76716a;

  --series-money: #f06e36;
  --series-latest: #f06e36;
  --series-count: #93a4c4;
  --series-prev: #5e5a54;

  --shadow-panel: 0 1px 0 rgba(0, 0, 0, 0.2);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -10px rgba(0, 0, 0, 0.75);
  --shadow-raise: 0 8px 22px -12px rgba(0, 0, 0, 0.7);
  --scrim: rgba(0, 0, 0, 0.6);
  --selection: rgba(240, 110, 54, 0.3);
}

:root {
  /* Type: fixed rem scale; rank is carried by weight before size. */
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.5rem;

  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --rail-w: 3.75rem;
  --subnav-w: 14.5rem;
  --top-h: 3.5rem;
  --gap: 1.25rem;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --t-fast: 140ms;
  --t-med: 220ms;
}

/* Tabler tokens mapped onto ours. */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
  --tblr-font-sans-serif: var(--font-sans);
  --tblr-body-font-family: var(--font-sans);
  --tblr-body-font-size: var(--fs-base);
  --tblr-primary: var(--accent);
  --tblr-primary-rgb: var(--accent-rgb);
  --tblr-primary-text-emphasis: var(--accent-ink);
  --tblr-link-color: var(--accent-ink);
  --tblr-link-color-rgb: var(--accent-rgb);
  --tblr-link-hover-color: var(--accent);
  --tblr-body-bg: var(--ground);
  --tblr-bg-surface: var(--surface);
  --tblr-bg-surface-secondary: var(--sunken);
  --tblr-bg-forms: var(--surface);
  --tblr-border-color: var(--line);
  --tblr-border-color-translucent: var(--line);
  --tblr-body-color: var(--ink);
  --tblr-emphasis-color: var(--ink);
  --tblr-secondary: var(--muted);
  --tblr-secondary-color: var(--muted);
  --tblr-muted: var(--muted);
  --tblr-gray-500: var(--muted);
  --tblr-border-radius: var(--r-sm);
  --tblr-danger: var(--bad);
  --tblr-success: var(--good);
  --tblr-warning: var(--warn);
  --tblr-info: var(--info);
}

/* ================================================================ base */

html { scrollbar-gutter: stable; }
html { scroll-padding-top: calc(var(--top-h) + 0.75rem); }
@media (max-width: 61.99em) { html { scroll-padding-bottom: 5rem; } }
[data-bs-theme="light"] { color-scheme: light; }
[data-bs-theme="dark"] { color-scheme: dark; }
a, button, summary, label, input, select, textarea, [role="option"] { touch-action: manipulation; -webkit-tap-highlight-color: rgba(var(--accent-rgb), 0.12); }
body.dash {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  accent-color: var(--accent);
  caret-color: var(--accent);
}
:lang(en) body.dash, body.dash:lang(en) { line-height: 1.55; }
html[lang="ar"] {
  --font-sans: "IBM Plex Sans Arabic", "IBM Plex Sans", "Segoe UI", "SF Arabic", "Noto Sans Arabic", "Noto Kufi Arabic",
               system-ui, -apple-system, Tahoma, Arial, sans-serif;
}

::selection { background: var(--selection); color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[x-cloak] { display: none !important; }
a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; letter-spacing: -0.005em; }
html[lang="ar"] :is(h1, h2, h3, h4) { letter-spacing: 0; } /* tracking breaks the joins of Arabic letters */
/* On an English page the switch to Arabic is the only Arabic text; a system face spares those pages a font file. */
a[hreflang="ar"] { font-family: "Segoe UI", "SF Arabic", "Noto Sans Arabic", system-ui, sans-serif; }
code, kbd, samp { font-family: var(--font-mono); font-size: max(0.75rem, 0.9em); }
hr { border-color: var(--line); opacity: 1; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* Numbers: tabular and isolated left-to-right inside Arabic text. */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.is-positive { color: var(--good); }
.is-negative { color: var(--bad); }
.text-secondary { color: var(--muted) !important; }
.text-danger { color: var(--bad) !important; }
.small, small { font-size: var(--fs-sm); }
.fw-medium { font-weight: 600 !important; }

/* The sprite's symbols carry bare paths; the outline style lives here so <use> inherits it. */
:where(body.dash) .icon {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.dash-skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 200;
  background: var(--surface); color: var(--ink); padding: 0.55rem 0.85rem; border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop); font-weight: 600;
}
.dash-skip:focus { top: 0.75rem; }

kbd.dash-kbd {
  display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.35rem; padding: 0 0.35rem;
  border: 1px solid currentColor; border-radius: 4px; background: transparent; color: inherit;
  font: 600 0.75rem/1 var(--font-sans); box-shadow: none;
}

/* ================================================================ shell: domain rail */

.rail {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 42; width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; padding-block: 0.75rem;
  background: var(--surface); border-inline-end: 1px solid var(--line);
}
.rail__brand { display: inline-grid; place-items: center; margin-bottom: 1rem; border-radius: 10px; }
.brand-mark { display: inline-grid; place-items: center; width: 2.125rem; height: 2.125rem; flex: none; border-radius: 10px; background: var(--inverse); }
.brand-mark svg { width: 58%; height: 58%; }
.brand-mark__ring { stroke: var(--on-inverse); stroke-opacity: 0.9; }
.brand-mark__arc { stroke: var(--accent); }
.brand-mark__dot { fill: var(--accent); }
.rail__domains { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.rail__domain {
  position: relative; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: var(--r-md);
  color: var(--muted); text-decoration: none; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.rail__domain .icon { width: 1.25rem; height: 1.25rem; }
.rail__domain:hover, .rail__domain.is-peek { background: var(--sunken); color: var(--ink); text-decoration: none; }
.rail__domain.is-current { background: var(--sunken); color: var(--ink); }
.rail__domain.is-current .icon { stroke-width: 2.1; }
.rail__domain.is-current::before { content: ""; position: absolute; inset-inline-start: -0.625rem; top: 0.5rem; width: 3px; height: 1.5rem; border-radius: 3px; background: var(--accent); }
.rail__count {
  position: absolute; top: -0.2rem; inset-inline-end: -0.2rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem;
  display: inline-grid; place-items: center; border-radius: 999px; background: var(--accent-strong); color: var(--on-accent);
  font-size: 0.6875rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--surface);
}
.rail__count:empty { display: none; }
.rail__toggle {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-top: 0.5rem; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.rail__toggle:hover { background: var(--sunken); color: var(--ink); }

/* ================================================================ shell: contextual menu */

.subnav {
  position: fixed; inset-block: 0; inset-inline-start: var(--rail-w); z-index: 41; width: var(--subnav-w);
  display: flex; flex-direction: column; background: var(--ground); border-inline-end: 1px solid var(--line);
}
.subnav__top { display: none; align-items: center; gap: 0.6rem; padding: 0.75rem 0.85rem; border-bottom: 1px solid var(--line); }
.subnav__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; min-width: 0; }
.subnav__close { margin-inline-start: auto; display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); }
.subnav__close:hover { background: var(--sunken); color: var(--ink); }
.subnav__search {
  display: flex; align-items: center; gap: 0.5rem; margin: 0.85rem 0.75rem 0.35rem; min-height: 2.125rem; padding: 0 0.6rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--muted);
  font-size: var(--fs-sm); text-align: start; transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.subnav__search:hover { border-color: var(--line-strong); color: var(--ink); }
.subnav__search span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.subnav__search .icon { width: 1rem; height: 1rem; }
.subnav__scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem 0.5rem 1rem; }
.subnav__title { display: flex; align-items: center; gap: 0.45rem; margin: 0.5rem 0.4rem 0.5rem; font-size: var(--fs-base); font-weight: 600; color: var(--ink); }
.subnav__title-icon { display: none; }
.subnav__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.125rem; }
.subnav__link {
  position: relative; display: flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; padding: 0.25rem 0.65rem; border-radius: var(--r-sm);
  color: var(--muted); font-size: 0.875rem; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.subnav__link::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: transparent; }
.subnav__link:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.subnav__link.is-current { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-panel), 0 0 0 1px var(--line); }
.subnav__link.is-current::before { background: var(--accent); }
.subnav__label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.subnav__count { min-width: 1.4rem; padding: 0 0.35rem; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 600; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.subnav__count.is-quiet { background: var(--sunken); color: var(--muted); }
.subnav__count:empty { display: none; }

.dash-scrim { position: fixed; inset: 0; z-index: 45; background: var(--scrim); }

/* Collapsed: only the rail stays; pointing at a domain shows its pages as a flyout. */
@media (min-width: 861px) {
  [data-rail="collapsed"] .subnav { visibility: hidden; opacity: 0; box-shadow: var(--shadow-pop); transition: opacity var(--t-fast) var(--ease); }
  [data-rail="collapsed"] .subnav.is-peek { visibility: visible; opacity: 1; }
  [data-rail="collapsed"] .dash-main { margin-inline-start: var(--rail-w); }
}
/* "Auto": a laptop-width window starts collapsed until the operator chooses. */
@media (min-width: 861px) and (max-width: 1180px) {
  [data-rail="auto"] .subnav { visibility: hidden; opacity: 0; box-shadow: var(--shadow-pop); transition: opacity var(--t-fast) var(--ease); }
  [data-rail="auto"] .subnav.is-peek { visibility: visible; opacity: 1; }
  [data-rail="auto"] .dash-main { margin-inline-start: var(--rail-w); }
}

/* ================================================================ shell: main column, top bar, page head */

.dash-main { margin-inline-start: calc(var(--rail-w) + var(--subnav-w)); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }

.dash-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem; min-height: var(--top-h); padding: 0.5rem 2rem;
  background: color-mix(in srgb, var(--ground) 90%, transparent); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.3) blur(8px);
}
.dash-top__crumbs { flex: 1; min-width: 0; }
.dash-crumbs { display: flex; align-items: center; gap: 0.35rem; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; min-width: 0; }
.dash-crumbs li { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; white-space: nowrap; }
.dash-crumbs li[aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; }
.dash-crumbs li[aria-current] span { overflow: hidden; text-overflow: ellipsis; }
.dash-crumbs li + li::before {
  content: ""; width: 0.4rem; height: 0.4rem; border-top: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: 0.6; flex: none;
}
[dir="rtl"] .dash-crumbs li + li::before { transform: rotate(-135deg); }
@media (max-width: 47.99em) {
  .dash-crumbs li:not([aria-current]) { display: none; }
  .dash-crumbs li + li::before { display: none; }
}
.dash-crumbs a { color: var(--muted); text-decoration: none; }
.dash-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.dash-top__find {
  display: flex; align-items: center; gap: 0.5rem; width: 19rem; min-height: 2.25rem; padding: 0 0.7rem;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); text-align: start;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.dash-top__find:hover { border-color: var(--line-strong); color: var(--ink); }
.dash-top__find span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dash-top__find .icon { width: 1rem; height: 1rem; }
.dash-top__tools { display: flex; align-items: center; gap: 0.15rem; }
.dash-top__tool {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 2.25rem; min-width: 2.25rem; padding: 0 0.5rem;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.dash-top__tool:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.dash-top__tool .icon { width: 1.2rem; height: 1.2rem; }
.dash-top__menu { display: none; }
.dash-top__dot { position: absolute; top: 0.3rem; inset-inline-end: 0.35rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--ground); overflow: hidden; color: transparent; font-size: 0; }
.dash-top__dot:empty { display: none; }
.dash-top__me { margin-inline-start: 0.35rem; }
.dash-top__me > summary { display: block; cursor: pointer; border-radius: 50%; }
.dash-avatar { display: inline-grid; place-items: center; width: 2.125rem; height: 2.125rem; border-radius: 50%; background: var(--inverse); color: var(--on-inverse); font-size: var(--fs-xs); font-weight: 600; }
.dash-menu__who { display: grid; padding: 0.4rem 0.65rem; line-height: 1.4; }
.dash-menu__who strong { font-weight: 600; }
.dash-menu__who span { font-size: var(--fs-xs); color: var(--muted); }
.dash-menu__list form { margin: 0; }
.theme-icon-light { display: none; }
[data-bs-theme="dark"] .theme-icon-light { display: inline-block; }
[data-bs-theme="dark"] .theme-icon-dark { display: none; }

/* Global progress: an ember line under the top bar while HTMX works. */
.dash-progress { position: fixed; top: 0; inset-inline: 0; z-index: 90; height: 2px; pointer-events: none; overflow: hidden; }
.dash-progress::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 30%;
  background: var(--accent); opacity: 0; transform: translateX(-100%);
}
html.is-loading .dash-progress::after { opacity: 1; animation: dash-progress 1.1s var(--ease) infinite; }
[dir="rtl"] .dash-progress::after { transform: translateX(100%); }
html.is-loading[dir="rtl"] .dash-progress::after { animation-name: dash-progress-rtl; }
@keyframes dash-progress { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes dash-progress-rtl { from { transform: translateX(100%); } to { transform: translateX(-340%); } }

.dash-content {
  flex: 1; width: 100%; max-width: 105rem; margin-inline: auto;
  padding: 1.75rem 2rem 3.5rem;
  display: flex; flex-direction: column; gap: var(--gap);
}
.dash-content:focus { outline: none; }
.dash-narrow { max-width: 46rem; }

.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.25rem; flex-wrap: wrap; }
.dash-head__text { min-width: min(100%, 16rem); flex: 1; }
.dash-head__title { margin: 0; font-size: 1.625rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.012em; overflow-wrap: anywhere; }
html[lang="ar"] .dash-head__title { letter-spacing: 0; }
.dash-head__sub { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.55; max-width: 72ch; }
.dash-head__date { margin: 0 0 0.1rem; color: var(--muted); font-size: var(--fs-sm); }
.dash-head__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dash-head__actions:empty { display: none; }
.dash-head__actions form { margin: 0; }

/* Phones: the main destinations stay under the thumb. */
.dash-tabbar { display: none; }

/* ================================================================ command palette */

.dash-cmdk {
  width: min(40rem, calc(100vw - 2rem)); max-height: min(34rem, calc(100vh - 6rem)); margin-top: 8vh; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-pop); overflow: hidden;
}
.dash-cmdk[open] { display: flex; flex-direction: column; }
.dash-cmdk::backdrop { background: var(--scrim); }
.dash-cmdk__field { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.dash-cmdk__field .icon { color: var(--muted); width: 1.25rem; height: 1.25rem; }
.dash-cmdk__input { flex: 1; border: 0; background: transparent; color: var(--ink); font-size: var(--fs-md); outline: none; min-width: 0; }
.dash-cmdk__input::placeholder { color: var(--muted); opacity: 1; }
.dash-cmdk__list { list-style: none; margin: 0; padding: 0.4rem; overflow-y: auto; overscroll-behavior: contain; }
.dash-cmdk__section { padding: 0.55rem 0.65rem 0.25rem; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.dash-cmdk__item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.65rem; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.dash-cmdk__item .icon { color: var(--muted); }
.dash-cmdk__item small { margin-inline-start: auto; color: var(--muted); }
.dash-cmdk__item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.dash-cmdk__item[aria-selected="true"] .icon { color: var(--accent-ink); }
.dash-cmdk__empty { padding: 1.25rem 1rem; color: var(--muted); text-align: center; }
.dash-cmdk__foot { display: flex; gap: 1rem; padding: 0.55rem 1rem; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }

/* ================================================================ surfaces */

.card {
  --tblr-card-border-color: var(--line);
  --tblr-card-bg: var(--surface);
  --tblr-card-cap-bg: transparent;
  --tblr-card-spacer-x: 1.25rem;
  --tblr-card-spacer-y: 1.1rem;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-panel);
}
.card-header { gap: 0.75rem; min-height: 3.25rem; border-bottom-color: var(--line); flex-wrap: wrap; border-start-start-radius: var(--r-lg); border-start-end-radius: var(--r-lg); }
.card-header > .ms-auto { margin-inline-start: auto !important; margin-left: 0; }
.card-title { font-size: 0.96875rem; font-weight: 600; margin: 0; display: inline-flex; align-items: center; gap: 0.45rem; }
.card-title .icon { color: var(--muted); }
.card-subtitle, .card-header .text-secondary { font-size: var(--fs-sm); }
.card-footer { background: transparent; border-top-color: var(--line); }

/* A panel title that states its takeaway: small label over a large figure. */
.dash-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.25rem 0; flex-wrap: wrap; }
.dash-panel__label { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.dash-panel__figure { margin: 0.1rem 0 0; font-size: var(--fs-2xl); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
.dash-panel__figure small { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); letter-spacing: 0; }

.dash-grid { display: grid; gap: var(--gap); }
.dash-grid > * { min-width: 0; }
.dash-grid--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: stretch; }
.dash-grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.dash-grid--pair { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch; }
.dash-grid--trio { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); align-items: stretch; }
.dash-grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.dash-grid--form { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; }
.dash-side, .dash-stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.dash-side__body { display: grid; gap: 0.75rem; }
.dash-side__stat { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
@media (min-width: 1081px) { .dash-side--sticky { position: sticky; top: calc(var(--top-h) + 1rem); } }

/* Section heading inside the work area (not a card). */
.dash-section-title { display: flex; align-items: baseline; gap: 0.75rem; margin: 0.5rem 0 -0.25rem; font-size: var(--fs-md); font-weight: 600; }
.dash-section-title small { font-weight: 500; color: var(--muted); }

/* ================================================================ buttons */

.btn {
  --tblr-btn-padding-x: 0.9rem;
  --tblr-btn-padding-y: 0.4rem;
  --tblr-btn-font-size: 0.875rem;
  --tblr-btn-font-weight: 500;
  --tblr-btn-border-radius: var(--r-sm);
  --tblr-btn-color: var(--ink);
  --tblr-btn-bg: var(--surface);
  --tblr-btn-border-color: var(--line);
  --tblr-btn-hover-color: var(--ink);
  --tblr-btn-hover-bg: var(--hover);
  --tblr-btn-hover-border-color: var(--line-strong);
  --tblr-btn-active-bg: var(--hover);
  --tblr-btn-active-color: var(--ink);
  --tblr-btn-active-border-color: var(--muted);
  --tblr-btn-disabled-opacity: 0.5;
  --tblr-btn-box-shadow: none;
  gap: 0.4rem; min-height: 2.25rem; box-shadow: var(--shadow-panel); white-space: nowrap;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn .icon { margin: 0; width: 1.1rem; height: 1.1rem; }
.btn-sm { --tblr-btn-padding-x: 0.65rem; --tblr-btn-padding-y: 0.25rem; --tblr-btn-font-size: 0.8125rem; min-height: 2rem; }
.btn-lg { --tblr-btn-padding-x: 1.15rem; --tblr-btn-padding-y: 0.55rem; --tblr-btn-font-size: 0.9375rem; --tblr-btn-border-radius: var(--r-md); min-height: 2.75rem; }
.btn-icon { min-width: 2.25rem; padding-inline: 0; justify-content: center; }
.btn-sm.btn-icon { min-width: 2rem; }
.btn-primary {
  --tblr-btn-color: var(--on-inverse); --tblr-btn-bg: var(--inverse); --tblr-btn-border-color: var(--inverse);
  --tblr-btn-hover-color: var(--on-inverse); --tblr-btn-hover-bg: var(--inverse-hover); --tblr-btn-hover-border-color: var(--inverse-hover);
  --tblr-btn-active-color: var(--on-inverse); --tblr-btn-active-bg: var(--inverse-hover); --tblr-btn-active-border-color: var(--inverse-hover);
  --tblr-btn-disabled-color: var(--on-inverse); --tblr-btn-disabled-bg: var(--inverse); --tblr-btn-disabled-border-color: var(--inverse);
  color: var(--on-inverse);
}
.btn-accent {
  --tblr-btn-color: var(--on-accent); --tblr-btn-bg: var(--accent-strong); --tblr-btn-border-color: var(--accent-strong);
  --tblr-btn-hover-color: var(--on-accent); --tblr-btn-hover-bg: var(--accent-hover); --tblr-btn-hover-border-color: var(--accent-hover);
  --tblr-btn-active-color: var(--on-accent); --tblr-btn-active-bg: var(--accent-hover); --tblr-btn-active-border-color: var(--accent-hover);
  color: var(--on-accent);
}
.btn-danger {
  --tblr-btn-color: #fff; --tblr-btn-bg: var(--bad); --tblr-btn-border-color: var(--bad);
  --tblr-btn-hover-color: #fff; --tblr-btn-hover-bg: var(--bad-mark); --tblr-btn-hover-border-color: var(--bad-mark);
  --tblr-btn-active-color: #fff; --tblr-btn-active-bg: var(--bad-mark);
}
[data-bs-theme="dark"] .btn-danger { --tblr-btn-color: #2a0703; --tblr-btn-hover-color: #2a0703; --tblr-btn-active-color: #2a0703; }
.btn-outline-danger {
  --tblr-btn-color: var(--bad); --tblr-btn-bg: var(--surface); --tblr-btn-border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
  --tblr-btn-hover-color: var(--bad); --tblr-btn-hover-bg: var(--bad-soft); --tblr-btn-hover-border-color: var(--bad);
  --tblr-btn-active-color: var(--bad); --tblr-btn-active-bg: var(--bad-soft); --tblr-btn-active-border-color: var(--bad);
}
.btn-outline-primary {
  --tblr-btn-color: var(--ink); --tblr-btn-bg: var(--surface); --tblr-btn-border-color: var(--line-strong);
  --tblr-btn-hover-color: var(--ink); --tblr-btn-hover-bg: var(--hover); --tblr-btn-hover-border-color: var(--ink);
  --tblr-btn-active-color: var(--ink); --tblr-btn-active-bg: var(--hover); --tblr-btn-active-border-color: var(--ink);
}
.btn-ghost-secondary, .btn-ghost-primary, .btn-ghost {
  box-shadow: none;
  --tblr-btn-bg: transparent; --tblr-btn-border-color: transparent;
  --tblr-btn-hover-bg: var(--hover); --tblr-btn-hover-border-color: transparent;
  --tblr-btn-active-bg: var(--hover); --tblr-btn-active-border-color: transparent;
}
.btn-ghost-secondary { --tblr-btn-color: var(--muted); --tblr-btn-hover-color: var(--ink); --tblr-btn-active-color: var(--ink); }
.btn-ghost-primary { --tblr-btn-color: var(--ink); --tblr-btn-hover-color: var(--ink); --tblr-btn-active-color: var(--ink); }
.btn-close { filter: none; opacity: 0.6; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
/* Server-confirmed work in flight: the button holds its place and says it is busy. */
.btn[aria-busy="true"] { position: relative; color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid var(--tblr-btn-color, currentColor); border-inline-end-color: transparent; animation: dash-spin 0.7s linear infinite;
}
.btn-primary[aria-busy="true"]::after { border-color: var(--on-inverse); border-inline-end-color: transparent; }
@keyframes dash-spin { to { transform: rotate(360deg); } }
.btn-group > .btn { min-height: 2rem; }

/* ================================================================ forms */

.form-label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); margin-bottom: 0.35rem; }
.form-label.required::after { content: " *"; color: var(--bad); }
.form-control, .form-select {
  min-height: 2.5rem; border-color: var(--line); border-radius: var(--r-sm); background-color: var(--surface); color: var(--ink);
  font-size: var(--fs-base); box-shadow: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-control::placeholder { color: var(--muted); opacity: 1; }
.form-control:hover, .form-select:hover { border-color: var(--line-strong); }
.form-control:focus, .form-select:focus {
  border-color: var(--ink); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16); outline: none;
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--sunken); color: var(--muted); }
.form-control-sm, .form-select-sm { min-height: 2rem; font-size: var(--fs-sm); }
textarea.form-control { min-height: 5rem; line-height: 1.5; }
.form-select { background-position: left 0.65rem center; }
[dir="ltr"] .form-select { background-position: right 0.65rem center; }
.form-check-input { border-color: var(--line-strong); background-color: var(--surface); width: 1.05rem; height: 1.05rem; }
[data-bs-theme="dark"] .form-check-input:checked { --tblr-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' width='16' height='16'%3e%3cpath fill='none' stroke='%23161513' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8.5l2.5 2.5l5.5 -5.5'/%3e%3c/svg%3e"); }
.form-check-input:checked { background-color: var(--inverse); border-color: var(--inverse); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); border-color: var(--accent); }
.form-check { display: flex; align-items: flex-start; gap: 0.55rem; padding-inline-start: 0; min-height: 1.75rem; }
.form-check .form-check-input { float: none; margin: 0.22rem 0 0; flex: none; }
.form-check-label { cursor: pointer; }
body.dash .form-hint { margin: 0.35rem 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.is-invalid, .form-control.is-invalid, .form-select.is-invalid { border-color: var(--bad) !important; }
.is-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent) !important; }
.invalid-feedback { display: flex; align-items: flex-start; gap: 0.35rem; margin-top: 0.35rem; color: var(--bad); font-size: var(--fs-sm); font-weight: 500; }

.dash-form { display: grid; gap: 1.1rem; }
.dash-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.dash-form legend { float: none; width: auto; }
.dash-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dash-form__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.dash-form__sub { margin-top: 0.6rem; }
.dash-form__section { display: grid; gap: 1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.dash-form__section:first-child { border-top: 0; padding-top: 0; }
.dash-form__section-title { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.dash-inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.dash-inline-form .form-control { max-width: 18rem; }
.dash-rule-form { flex-wrap: nowrap; align-items: flex-end; }
.dash-row-actions { display: inline-flex; gap: 0.3rem; align-items: center; flex-wrap: nowrap; justify-content: flex-end; }
.dash-row-actions form { margin: 0; }
.dash-input-xs { width: 4.75rem; display: inline-block; }
.dash-mini-field { display: grid; gap: 0.15rem; margin: 0; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; white-space: nowrap; }
[dir="rtl"] :is(p, td, span, div, li, a)[dir="auto"] { text-align: right; }
[dir="ltr"] :is(p, td, span, div, li, a)[dir="auto"] { text-align: left; }
.dash-input-affix { position: relative; display: flex; align-items: stretch; }
.dash-input-affix .form-control { flex: 1; }
.dash-input-affix__unit {
  display: inline-flex; align-items: center; padding: 0 0.7rem; border: 1px solid var(--line-strong); border-inline-start: 0;
  border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); background: var(--sunken); color: var(--muted); font-size: var(--fs-sm);
}
.dash-input-affix .form-control { border-start-end-radius: 0; border-end-end-radius: 0; }

/* Segmented choice (radio group drawn as one control). */
.dash-segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2rem; padding: 0.2rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--sunken); }
.dash-segmented--3 { grid-template-columns: repeat(3, 1fr); }
.dash-segmented label { margin: 0; cursor: pointer; position: relative; }
.dash-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.dash-segmented label > span { display: block; padding: 0.4rem 0.6rem; border-radius: 4px; text-align: center; font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.dash-segmented label:hover > span { color: var(--ink); }
.dash-segmented input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(6, 26, 26, 0.12), 0 0 0 1px var(--line); }
.dash-segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Option cards: a radio choice with a title and a line of explanation (supplier type, outcome). */
.dash-choices { display: grid; gap: 0.5rem; }
.dash-choice { position: relative; display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 1rem; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--surface); transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.dash-choice:hover { border-color: var(--line-strong); }
.dash-choice input { margin-top: 0.2rem; flex: none; }
.dash-choice__body { display: grid; gap: 0.15rem; min-width: 0; }
.dash-choice__title { font-weight: 600; }
.dash-choice__hint { font-size: var(--fs-sm); color: var(--muted); }
.dash-choice:has(input:checked) { border-color: var(--ink); background: var(--sunken); box-shadow: 0 0 0 1px var(--ink); }
.dash-choice:has(input:disabled) { cursor: not-allowed; opacity: 0.65; }
.dash-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.dash-checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.35rem 1rem; }
.dash-checkgrid .form-check { margin: 0; }
.dash-checkgrid .is-risky .form-check-label { color: var(--warn); font-weight: 600; }
.dash-perm-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

/* ================================================================ tables */

.table {
  --tblr-table-color: var(--ink);
  --tblr-table-bg: transparent;
  --tblr-table-border-color: var(--line);
  --tblr-table-hover-bg: var(--hover);
  --tblr-table-striped-bg: var(--sunken);
  margin: 0; font-size: 0.90625rem;
}
.table > :not(caption) > * > * { padding: 0.8rem 0.85rem; border-bottom-color: var(--line); }
.table > :not(caption) > * > *:first-child { padding-inline-start: 1.25rem; }
.table > :not(caption) > * > *:last-child { padding-inline-end: 1.25rem; }
.card-table { border-top: 0; }
.card-table thead th, .table thead th {
  position: sticky; top: 0; z-index: 1;
  font-size: var(--fs-sm); font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--muted); background: var(--surface); white-space: nowrap; border-bottom: 1px solid var(--line);
  padding-block: 0.65rem;
}
.card-table tbody tr { transition: background-color 120ms ease-out; }
.card-table tbody tr:hover { background: var(--hover); }
.card-table tbody tr:last-child td { border-bottom: 0; }
.table-sm > :not(caption) > * > * { padding-block: 0.4rem; }
.card-table td.num, .card-table td .num { white-space: nowrap; }
.table .text-end { text-align: end !important; }
.w-1 { width: 1%; }
/* Long product names wrap to two lines at most, with the full name on hover. */
.dash-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.dash-cell-title { font-weight: 500; color: var(--ink); text-decoration: none; }
a.dash-cell-title:hover { color: var(--accent-ink); text-decoration: underline; }
.dash-cell-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; margin-top: 0.15rem; font-size: var(--fs-sm); color: var(--muted); }
.dash-cell-meta > * + *::before { content: none; }
.dash-id { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.01em; }
/* relative, so hidden screen-reader labels scroll with the table instead of widening the page */
.table-responsive { position: relative; overscroll-behavior-x: contain; }
.dash-count, .dash-results-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  min-height: 2.75rem; padding: 0.5rem 1.25rem; font-size: var(--fs-sm); color: var(--muted); border-bottom: 1px solid var(--line);
}
.dash-results-meta strong { color: var(--ink); font-weight: 600; }
th .dash-sort { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; text-decoration: none; }
th .dash-sort:hover { color: var(--ink); }
th .dash-sort .icon { width: 0.9rem; height: 0.9rem; opacity: 0.5; }
th .dash-sort.is-active { color: var(--ink); }
th .dash-sort.is-active .icon { opacity: 1; color: var(--accent-ink); }
th[aria-sort] { color: var(--ink); }

/* Loading region: the old rows stay visible, dimmed, while the new ones are fetched. */
#results { transition: opacity var(--t-med) var(--ease); }
.htmx-request #results, #results.htmx-request, [aria-busy="true"]#results { opacity: 0.5; }

/* Skeleton rows for regions that load after the page. */
.dash-skeleton { display: grid; gap: 0.6rem; padding: 1rem 1.25rem; }
.dash-skeleton span { display: block; height: 0.85rem; border-radius: 4px; background: linear-gradient(90deg, var(--hover), var(--sunken), var(--hover)); background-size: 200% 100%; animation: dash-shimmer 1.4s ease-in-out infinite; }
.dash-skeleton span:nth-child(2n) { width: 70%; }
@keyframes dash-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ================================================================ status: badges, dots, banners */

.badge { font-weight: 600; }
.dash-badge {
  --tblr-badge-color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 0.35rem; vertical-align: middle;
  background: var(--sunken); color: var(--ink-2);
  font-weight: 500; font-size: 0.78125rem; line-height: 1.4; padding: 0.15em 0.55em; border-radius: 6px;
  border: 1px solid var(--line); white-space: nowrap; text-decoration: none;
}
.dash-badge.has-dot::before { content: ""; width: 0.375rem; height: 0.375rem; flex: none; border-radius: 50%; background: currentColor; }
.dash-badge .icon { width: 0.9rem; height: 0.9rem; }
a.dash-badge:hover { text-decoration: none; filter: brightness(0.97); }
.dash-badge.is-success { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.dash-badge.is-danger { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.dash-badge.is-warning { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.dash-badge.is-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.dash-badge.is-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
/* Status pill with a signal dot, for states that are read in lists. */
.dash-status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.dash-status::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--idle-mark); flex: none; }
.dash-status.is-success { color: var(--good); }
.dash-status.is-success::before { background: var(--good-mark); }
.dash-status.is-warning { color: var(--warn); }
.dash-status.is-warning::before { background: var(--warn-mark); }
.dash-status.is-danger { color: var(--bad); }
.dash-status.is-danger::before { background: var(--bad-mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad-mark) 18%, transparent); }
.dash-status.is-info { color: var(--info); }
.dash-status.is-info::before { background: var(--info); }

.alert {
  --tblr-alert-bg: var(--surface); --tblr-alert-border-color: var(--line); --tblr-alert-color: var(--ink);
  display: flex; align-items: flex-start; gap: 0.7rem; margin: 0; padding: 0.8rem 1rem; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: none;
}
.alert > .icon { margin-top: 0.15rem; flex: none; }
.alert-danger { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--ink); }
.alert-danger > .icon { color: var(--bad); }
.alert-warning { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn-mark) 35%, transparent); color: var(--ink); }
.alert-warning > .icon { color: var(--warn); }
.alert-success { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 30%, transparent); color: var(--ink); }
.alert-success > .icon { color: var(--good); }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--ink); }
.alert-info > .icon { color: var(--info); }
a.alert { text-decoration: none; }
a.alert:hover { filter: brightness(0.98); }
.alert strong { font-weight: 600; }
.alert p { margin: 0; }
.alert__action { margin-inline-start: auto; flex: none; align-self: center; }

.dash-delta { display: inline-flex; align-items: center; gap: 0.15rem; font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.dash-delta.is-up { color: var(--good); }
.dash-delta.is-down { color: var(--bad); }
.dash-delta.is-flat { color: var(--muted); }
.dash-delta .icon { width: 0.95em; height: 0.95em; }
[dir="rtl"] .dash-delta .icon { transform: scaleX(-1); }

/* Share bar: a 3px track along a row's bottom edge. */
.dash-share { position: relative; height: 3px; margin-top: 0.4rem; border-radius: 3px; background: var(--line); overflow: hidden; }
.dash-share > span { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--muted); }
.dash-share.is-warning > span { background: var(--warn-mark); }

/* ================================================================ KPIs */

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); overflow: hidden; }
.dash-stats--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dash-stat.is-attention .dash-stat__label::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-inline-end: 0.35rem; border-radius: 50%; background: var(--accent); vertical-align: 0.1em; }
.dash-stat.is-attention .dash-stat__value { color: var(--accent-ink); }
.dash-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-stat {
  display: grid; gap: 0.2rem; align-content: start;
  padding: 1rem 1.25rem 1.05rem; color: inherit; text-decoration: none;
  border-inline-start: 1px solid var(--line);
  transition: background-color var(--t-fast) var(--ease);
}
.dash-stat:first-child { border-inline-start: 0; }
a.dash-stat:hover { background: var(--hover); text-decoration: none; color: inherit; }
.dash-stat__label { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.dash-stat__value { font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.dash-stat__value small { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.dash-stat__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: var(--fs-xs); color: var(--muted); }
.dash-stat.is-warning .dash-stat__value { color: var(--warn); }
.dash-stat.is-danger .dash-stat__value { color: var(--bad); }

/* Money hero: one leading figure, then supporting figures in a quiet row. */
.dash-money { display: grid; gap: 1.1rem; padding: 1.25rem 1.25rem 0.5rem; }
.dash-money__lead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dash-money__label { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.dash-money__value { margin: 0.15rem 0 0; font-size: var(--fs-3xl); font-weight: 600; line-height: 1.05; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.dash-money__value small { font-size: var(--fs-md); font-weight: 600; color: var(--muted); letter-spacing: 0; margin-inline-start: 0.25rem; }
.dash-money__compare { display: flex; align-items: center; gap: 0.45rem; margin: 0.35rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.dash-money__support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.dash-money__support > .dash-stat { padding-inline: 0; padding-block: 0.85rem 0.6rem; border-inline-start: 0; }
.dash-money__support > .dash-stat + .dash-stat { padding-inline-start: 1.25rem; border-inline-start: 1px solid var(--line); }
.dash-money__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 1.25rem; margin: 0; padding: 0.7rem 0 0.2rem; list-style: none; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.dash-money__facts li { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.35rem; white-space: nowrap; }
.dash-money__facts strong { color: var(--ink); font-weight: 600; }
.dash-money__facts a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); }
.dash-money__facts a:hover { color: var(--accent-ink); }
/* Comparisons in the facts line stay grey: the line reports, the hero carries the trend. */
.dash-money__facts .dash-delta { color: var(--muted); font-weight: 600; }

.dash-chart { width: 100%; height: 16rem; }
.dash-chart--sm { height: 12rem; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--muted); }
.dash-legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.dash-legend__swatch { display: inline-block; width: 0.75rem; height: 0.55rem; border-radius: 2px; background: var(--series-money); }
.dash-legend__swatch.is-line { height: 2px; background: var(--series-count); }
.dash-legend__swatch.is-now { background: var(--series-money); }
.dash-legend__swatch.is-prev { height: 0; border-top: 2px dashed var(--series-prev); background: none; }

/* ================================================================ signature: the service status board */

.dash-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-panel); }
.dash-line {
  position: relative; display: grid; gap: 0.15rem; align-content: start; padding: 0.85rem 1.1rem 0.9rem;
  color: inherit; text-decoration: none; border-inline-start: 1px solid var(--line); min-width: 0;
  transition: background-color var(--t-fast) var(--ease);
}
.dash-line:first-child { border-inline-start: 0; }
a.dash-line:hover { background: var(--hover); color: inherit; text-decoration: none; }
.dash-line__name { display: flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.dash-line__name .icon { color: var(--muted); width: 1rem; height: 1rem; }
.dash-line__state { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.dash-line__state::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; background: var(--idle-mark); }
.dash-line.is-good .dash-line__state::before { background: var(--good-mark); }
.dash-line.is-warn .dash-line__state::before { background: var(--warn-mark); }
.dash-line.is-bad .dash-line__state::before { background: var(--bad-mark); }
.dash-line.is-good .dash-line__state { color: var(--good); }
.dash-line.is-warn .dash-line__state { color: var(--warn); }
.dash-line.is-bad .dash-line__state { color: var(--bad); }
.dash-line.is-idle .dash-line__state { color: var(--muted); }
.dash-line__fact { font-size: var(--fs-sm); color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.dash-line__fact strong { color: var(--ink); font-weight: 600; }
.dash-board__meta { display: flex; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem; font-size: var(--fs-sm); color: var(--muted); }
.dash-board__meta h2 { margin: 0; font-size: var(--fs-md); font-weight: 600; color: var(--ink); }

/* Attention queue: what needs a person, most urgent first, action at the end of the row. */
.dash-queue { list-style: none; margin: 0; padding: 0; }
.dash-queue__item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1.25rem; border-top: 1px solid var(--line); min-width: 0; }
.dash-queue__item:first-child { border-top: 0; }
.dash-queue__icon { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; flex: none; background: var(--sunken); color: var(--muted); }
.dash-queue__item.is-danger .dash-queue__icon { background: var(--bad-soft); color: var(--bad); }
.dash-queue__item.is-warning .dash-queue__icon { background: var(--warn-soft); color: var(--warn); }
.dash-queue__body { display: grid; min-width: 0; flex: 1; line-height: 1.4; }
.dash-queue__title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.dash-queue__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.5rem; font-size: var(--fs-sm); color: var(--muted); }
.dash-queue__go { flex: none; }

/* Quick actions: a short list of the things operators do most. */
.dash-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; padding: 1rem 1.25rem 1.15rem; }
.dash-action {
  display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 600;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.dash-action .icon { color: var(--muted); }
.dash-action:hover { border-color: var(--line-strong); background: var(--hover); color: var(--ink); text-decoration: none; }

/* Ranked list with share bars. */
.dash-ranked { list-style: none; margin: 0; padding: 0.35rem 0; }
.dash-ranked li { padding: 0.55rem 1.25rem 0.5rem; }
.dash-ranked__row { display: flex; align-items: baseline; gap: 0.75rem; }
.dash-ranked__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-ranked__value { font-weight: 600; }
.dash-ranked__foot { margin-top: 0.15rem; font-size: var(--fs-xs); color: var(--muted); text-align: end; }
.dash-ranked__sub { color: var(--muted); font-size: var(--fs-sm); min-width: 3.5rem; text-align: end; }

/* Activity feed. */
.dash-feed { list-style: none; margin: 0; padding: 0.25rem 0; }
.dash-feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.1rem 0.75rem; padding: 0.55rem 1.25rem; border-top: 1px solid var(--line); }
.dash-feed li:first-child { border-top: 0; }
.dash-feed__what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dash-feed__amount { text-align: end; font-weight: 600; }
.dash-feed__meta { font-size: var(--fs-sm); color: var(--muted); }
.dash-feed__when { font-size: var(--fs-sm); color: var(--muted); text-align: end; }

/* ================================================================ signature: stations (lifecycle) and timeline */

.dash-stations { display: flex; align-items: flex-start; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.dash-station { position: relative; flex: 1; display: grid; justify-items: center; gap: 0.35rem; min-width: 0; padding-top: 0.15rem; text-align: center; }
.dash-station::before { content: ""; position: absolute; top: calc(0.15rem + 6px); inset-inline-start: 50%; width: 100%; height: 3px; background: var(--line-strong); }
.dash-station:last-child::before { display: none; }
.dash-station__dot { position: relative; z-index: 1; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); }
.dash-station__label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); line-height: 1.3; padding-inline: 0.25rem; }
.dash-station.is-done::before { background: var(--inverse); }
.dash-station.is-done .dash-station__dot { border-color: var(--inverse); background: var(--inverse); }
.dash-station.is-done .dash-station__label { color: var(--ink-2); }
.dash-station.is-now .dash-station__dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18); }
.dash-station.is-now .dash-station__label { color: var(--ink); }
.dash-station.is-warn .dash-station__dot { border-color: var(--warn-mark); background: var(--warn-mark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn-mark) 22%, transparent); }
.dash-station.is-warn .dash-station__label { color: var(--warn); }
.dash-station.is-bad .dash-station__dot { border-color: var(--bad-mark); background: var(--bad-mark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad-mark) 20%, transparent); }
.dash-station.is-bad .dash-station__label { color: var(--bad); }
.dash-station.is-skip .dash-station__dot { border-style: dashed; }
/* Compact stations inside a table row: dots only, the label is the row's status pill. */
.dash-stations--mini { gap: 0; width: 6.5rem; }
.dash-stations--mini .dash-station { padding: 0; }
.dash-stations--mini .dash-station::before { top: 4px; height: 2px; }
.dash-stations--mini .dash-station__dot { width: 10px; height: 10px; border-width: 2px; }
.dash-stations--mini .dash-station__label { display: none; }

.dash-timeline { list-style: none; margin: 0; padding-block: 0.75rem; padding-inline: 1.25rem; position: relative; }
.dash-timeline__item { position: relative; padding-block: 0.5rem 0.75rem; padding-inline-start: 1.5rem; border-inline-start: 2px solid var(--line); display: grid; gap: 0.2rem; }
.dash-timeline__item::before { content: ""; position: absolute; inset-inline-start: -7px; top: 0.75rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--ink); }
.dash-timeline__item:last-child { border-inline-start-color: transparent; }
.dash-timeline__when { font-size: var(--fs-xs); color: var(--muted); }
.dash-timeline__what { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dash-timeline__note { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); white-space: pre-line; }

/* Setup checklist for a supplier: stations listed top to bottom with what each needs. */
.dash-steps { list-style: none; margin: 0; padding: 0.5rem 1.25rem 1rem; }
.dash-step { position: relative; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: 0.15rem 0.75rem; padding: 0.55rem 0; }
.dash-step::before { content: ""; position: absolute; inset-inline-start: calc(0.75rem - 1px); top: 1.6rem; bottom: -0.55rem; width: 2px; background: var(--line); }
.dash-step:last-child::before { display: none; }
.dash-step__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.dash-step__dot .icon { width: 0.85rem; height: 0.85rem; stroke-width: 2.5; }
.dash-step.is-done .dash-step__dot { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }
.dash-step.is-done::before { background: var(--inverse); }
.dash-step.is-now .dash-step__dot { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15); }
.dash-step.is-bad .dash-step__dot { border-color: var(--bad-mark); background: var(--bad-soft); color: var(--bad); }
.dash-step__title { font-weight: 600; align-self: center; }
.dash-step__hint { grid-column: 2; font-size: var(--fs-sm); color: var(--muted); }
.dash-step__action { grid-column: 2; margin-top: 0.35rem; justify-self: start; }
/* Side by side above the Command Center, where a tall list would push the numbers down. */
@media (min-width: 1081px) {
  .dash-steps--row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1rem; padding-block: 1rem; }
  .dash-steps--row .dash-step { grid-template-columns: minmax(0, 1fr); align-content: start; padding: 0; }
  .dash-steps--row .dash-step::before { inset-inline: 1.5rem -1rem; top: calc(0.75rem - 1px); bottom: auto; width: auto; height: 2px; }
  .dash-steps--row .dash-step__hint, .dash-steps--row .dash-step__action { grid-column: 1; }
}

/* ================================================================ overlays */

.dash-dialog {
  width: min(30rem, calc(100vw - 2rem)); padding: 1.35rem 1.4rem 1.2rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.dash-dialog::backdrop { background: var(--scrim); }
.dash-dialog[open] { animation: dash-pop var(--t-med) var(--ease); }
.dash-dialog__title { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.55rem; font-size: var(--fs-lg); font-weight: 600; }
.dash-dialog__title .icon { color: var(--warn); }
.dash-dialog--danger .dash-dialog__title .icon { color: var(--bad); }
.dash-dialog__body { margin: 0 0 1.25rem; color: var(--ink-2); text-align: start; white-space: normal; line-height: 1.6; }
.dash-dialog__actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
@keyframes dash-pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }

/* Drawer: a side sheet on the inline end, for creating and configuring without leaving the list. */
.dash-drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0; height: 100%; max-height: 100%;
  width: min(34rem, 100vw); max-width: 100vw; padding: 0; border: 0; border-inline-start: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.dash-drawer[open] { display: flex; flex-direction: column; animation: dash-drawer-in var(--t-med) var(--ease); }
[dir="rtl"] .dash-drawer[open] { animation-name: dash-drawer-in-rtl; }
.dash-drawer::backdrop { background: var(--scrim); }
.dash-drawer__head { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.dash-drawer__title { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.dash-drawer__sub { margin: 0.15rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.dash-drawer__close { margin-inline-start: auto; }
.dash-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem; display: grid; align-content: start; gap: 1.1rem; }
.dash-drawer__foot { display: flex; align-items: center; gap: 0.5rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--line); background: var(--sunken); flex-wrap: wrap; }
.dash-drawer__foot .btn-primary { margin-inline-start: auto; }
@keyframes dash-drawer-in { from { transform: translateX(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes dash-drawer-in-rtl { from { transform: translateX(-24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.dash-drawer form { display: contents; }

/* Toasts: one-line results of an action, polite for success, persistent for problems. */
.dash-toasts {
  position: fixed; z-index: 120; inset-block-end: 1.25rem; inset-inline-end: 1.25rem;
  display: grid; gap: 0.5rem; width: min(26rem, calc(100vw - 2rem)); pointer-events: none;
}
.dash-toast {
  display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.8rem 0.9rem; border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  pointer-events: auto; animation: dash-pop var(--t-med) var(--ease);
}
.dash-toast > .icon { flex: none; margin-top: 0.15rem; }
.dash-toast.is-success > .icon { color: var(--good); }
.dash-toast.is-danger { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.dash-toast.is-danger > .icon { color: var(--bad); }
.dash-toast.is-warning > .icon { color: var(--warn); }
.dash-toast.is-info > .icon { color: var(--info); }
.dash-toast__text { flex: 1; min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.dash-toast__close { flex: none; margin: -0.25rem; margin-inline-start: 0; }
.dash-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }

/* The session has ended (dashboard.js): the page stays as it is until its operator signs in again. */
.dash-session {
  position: fixed; z-index: 130; inset-block-start: 0.75rem; inset-inline: 0.75rem; margin-inline: auto; max-width: 46rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.75rem; padding: 0.8rem 0.9rem;
  border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); box-shadow: var(--shadow-pop);
  animation: dash-pop var(--t-med) var(--ease);
}
.dash-session[hidden] { display: none; }
.dash-session > .icon { flex: none; color: var(--warn); }
.dash-session p { flex: 1 1 18rem; margin: 0; line-height: 1.55; }

/* Tooltip for compact figures and icon buttons (title stays as the fallback). */
[data-tip] { position: relative; }
.dash-tip-host [data-tip]:hover::after, .dash-tip:hover::after, .dash-tip:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); inset-inline-start: 50%; transform: translateX(-50%);
  z-index: 50; width: max-content; max-width: 18rem; padding: 0.35rem 0.55rem; border-radius: var(--r-sm);
  background: var(--inverse); color: var(--on-inverse); font-size: var(--fs-xs); font-weight: 500; line-height: 1.4; white-space: normal; text-align: start; pointer-events: none;
}
[dir="rtl"] .dash-tip:hover::after, [dir="rtl"] .dash-tip:focus-visible::after { transform: translateX(50%); }

/* Disclosure menu (header actions). */
.dash-menu { position: relative; }
.dash-menu > summary { list-style: none; }
.dash-menu > summary::-webkit-details-marker { display: none; }
.dash-menu__list {
  position: absolute; top: calc(100% + 0.35rem); inset-inline-end: 0; z-index: 60; min-width: 13rem; padding: 0.35rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop);
  display: grid; gap: 0.1rem;
}
.dash-menu__list a, .dash-menu__list button {
  display: flex; align-items: center; gap: 0.55rem; width: 100%; padding: 0.5rem 0.65rem; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink); font-size: var(--fs-sm); text-align: start; text-decoration: none;
}
.dash-menu__list a:hover, .dash-menu__list button:hover { background: var(--hover); text-decoration: none; }
.dash-menu__list .is-danger { color: var(--bad); }
.dash-menu__list hr { margin: 0.25rem 0; }

/* ================================================================ empty states, errors */

.dash-empty { display: grid; justify-items: center; gap: 0.35rem; padding: 2rem 1.25rem; text-align: center; }
.dash-empty__icon {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-md);
  background: var(--sunken); color: var(--muted); margin-bottom: 0.15rem;
}
.dash-empty__icon .icon { width: 1.35rem; height: 1.35rem; }
.dash-empty__title { margin: 0; font-weight: 600; }
.dash-empty__hint { margin: 0 0 0.5rem; color: var(--muted); max-width: 48ch; font-size: var(--fs-sm); }
.dash-empty--inline { justify-items: start; text-align: start; padding: 1rem 1.25rem; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.85rem; align-items: center; }
.dash-empty--inline .dash-empty__icon { grid-row: span 2; margin: 0; width: 2.25rem; height: 2.25rem; }
.dash-empty--inline .dash-empty__hint { margin: 0; }
.dash-empty--inline .btn { grid-column: 2; justify-self: start; margin-top: 0.35rem; }

.dash-pending { background: transparent; border-style: dashed; box-shadow: none; }
.dash-pending__text { margin: 0; color: var(--muted); max-width: 62ch; }

.dash-error { max-width: 34rem; }
.dash-error .card-body { display: grid; gap: 0.75rem; justify-items: start; }
.dash-error__code { font-size: var(--fs-3xl); font-weight: 600; color: var(--accent-ink); line-height: 1; font-variant-numeric: tabular-nums; }
.dash-error__message { margin: 0; font-size: var(--fs-lg); }

/* Legacy inline flash list, kept for pages rendered without the toast stack. */
.dash-flashes { display: grid; gap: 0.5rem; }
.dash-flash { display: flex; align-items: center; gap: 0.75rem; margin: 0; }
.dash-flash .btn-close { margin-inline-start: auto; }

/* ================================================================ toolbars, filters, tabs, pagination */

.dash-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.dash-toolbar--end { justify-content: flex-end; }
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.dash-filters__search { position: relative; flex: 1 1 16rem; max-width: 26rem; margin: 0; }
.dash-filters__search .form-control { padding-inline-start: 2.3rem; }
.dash-filters__search::before {
  content: ""; position: absolute; inset-inline-start: 0.8rem; top: 50%; width: 0.85rem; height: 0.85rem; margin-top: -0.5rem;
  border: 1.75px solid var(--muted); border-radius: 50%; pointer-events: none;
}
.dash-filters__search::after {
  content: ""; position: absolute; inset-inline-start: 1.55rem; top: 50%; width: 0.4rem; height: 1.75px; margin-top: 0.3rem;
  background: var(--muted); transform: rotate(45deg); pointer-events: none;
}
[dir="rtl"] .dash-filters__search::after { inset-inline-start: 0.6rem; transform: rotate(-45deg); }
.dash-filters__field { flex: 0 1 auto; min-width: 9.5rem; margin: 0; }
.dash-filters__date { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.dash-filters__date .form-control { width: auto; }
.dash-filters__check { margin: 0; }
.dash-filters .btn-ghost-secondary { color: var(--muted); }

/* Active filter chips under the toolbar. */
.dash-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dash-chip {
  display: inline-flex; align-items: center; gap: 0.35rem; padding-block: 0.2rem; padding-inline: 0.65rem 0.35rem;
  border-radius: 6px; background: var(--sunken); color: var(--ink); font-size: var(--fs-sm); font-weight: 500; text-decoration: none;
}
.dash-chip .icon { width: 0.9rem; height: 0.9rem; }
.dash-chip:hover { text-decoration: none; background: var(--hover); color: var(--ink); }

/* Tabs: status views of one list, or sections of one record. URL-addressable. */
.dash-tabs { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tab {
  position: relative; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 0.85rem; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted);
  font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dash-tab:hover { color: var(--ink); text-decoration: none; }
.dash-tab[aria-current="page"], .dash-tab[aria-current="true"], .dash-tab[aria-selected="true"], .dash-tab.is-current { color: var(--ink); border-bottom-color: var(--ink); }
.dash-tab__check { width: 0.9rem; height: 0.9rem; stroke-width: 2.5; }
.dash-tab__count { min-width: 1.4rem; padding: 0 0.4rem; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: var(--fs-xs); line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; border: 1px solid var(--line); }
.dash-tab__count.is-danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.dash-tab__count.is-warning { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.card > .dash-tabs { padding-inline: 0.75rem; padding-top: 0.25rem; }

.dash-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dash-pager__label { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-pager-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; }
.dash-pager-row > .dash-pager { flex: 1 1 auto; }
.dash-sizes { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--fs-sm); color: var(--muted); }
.dash-sizes__label { margin-inline-end: 0.25rem; }
.dash-sizes__item {
  display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.25rem; padding: 0 0.5rem; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none;
}
.dash-sizes__item:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.dash-sizes__item[aria-current="true"] { background: var(--sunken); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-strong); }
.dash-pager .btn-group { gap: 0.35rem; }
.dash-pager .btn-group > .btn { border-radius: var(--r-sm) !important; margin: 0 !important; }

/* ================================================================ facts, profile, secrets */

.dash-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; align-items: center; padding: 1.25rem 1.5rem; }
.dash-profile__main { display: grid; gap: 0.15rem; }
.dash-profile__balance-label { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.dash-profile__balance { margin: 0; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.dash-profile__balance small { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.dash-profile__status { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.35rem 0 0; }
.dash-profile__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dash-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.85rem 1.5rem; margin: 0; }
.dash-facts div { min-width: 0; }
.dash-facts dt { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.dash-facts dd { margin: 0.1rem 0 0; font-weight: 500; overflow-wrap: anywhere; }
.dash-facts--list { grid-template-columns: minmax(0, 1fr); gap: 0; }
.dash-facts--list > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.dash-facts--list > div:first-child { border-top: 0; }
.dash-facts--list dd { margin: 0; text-align: end; }
.dash-facts__inline { margin: 0; }

.dash-secret { font-variant-numeric: tabular-nums; gap: 0.4rem; }
.secret-value {
  display: inline-block; max-width: 30rem; padding: 0.2rem 0.45rem; border-radius: 5px;
  background: var(--warn-soft); color: var(--ink); font-family: var(--font-mono);
  font-size: 0.8125rem; white-space: pre-wrap; word-break: break-all;
}
.dash-ref { max-width: 14rem; }
.dash-once { border-color: var(--warn-mark); background: var(--warn-soft); }
.dash-once .card-title { display: flex; align-items: center; gap: 0.5rem; }
.dash-copy { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.dash-copy__value { flex: 1 1 18rem; min-width: 0; padding: 0.5rem 0.65rem; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); color: var(--ink); overflow-wrap: anywhere; user-select: all; }

.dash-plain-list { list-style: none; margin: 0; padding: 0.35rem 0; }
.dash-plain-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 1.25rem; }
.dash-plain-list li + li { border-top: 1px solid var(--line); }
.card-body .dash-plain-list li { padding-inline: 0; }
.dash-stars { display: inline-flex; gap: 0.1rem; color: var(--line-strong); }
body.dash .dash-stars .icon { width: 1rem; height: 1rem; }
body.dash .dash-stars .icon.is-on { color: var(--warn-mark); fill: currentColor; }
.dash-review-text { max-width: 30rem; white-space: normal; }

.dash-matrix td:first-child { min-width: 14rem; }
.dash-tick { color: var(--good); }
.dash-perm-list { list-style: none; margin: 0; padding: 0.5rem 1.25rem 1rem; display: grid; gap: 0.45rem; }
.dash-perm-list li { display: flex; gap: 0.5rem; align-items: flex-start; }
.dash-perm-list .icon { color: var(--good); margin-top: 0.2rem; }
.dash-audit__details { max-width: 34rem; font-size: var(--fs-sm); color: var(--muted); word-break: break-word; }

.dash-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; font-size: var(--fs-sm); }
.dash-entries li { display: flex; justify-content: space-between; gap: 1rem; }
.dash-entries__code { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-ledger td { vertical-align: top; }

/* Old overview alert list (still used on the jobs page). */
.dash-alerts { list-style: none; margin: 0; padding: 0.35rem 0; }
.dash-alerts .dash-alert { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.7rem 1.25rem; border: 0; border-radius: 0; background: none; }
.dash-alerts .dash-alert + .dash-alert { border-top: 1px solid var(--line); }
.dash-alerts .dash-alert .icon { margin-top: 0.15rem; }
.dash-alerts .dash-alert.is-danger .icon { color: var(--bad); }
.dash-alerts .dash-alert.is-warning .icon { color: var(--warn); }
.dash-alerts .dash-alert a { color: var(--ink); font-weight: 500; }
.dash-alerts .dash-alert a:hover { color: var(--accent-ink); }

/* Coverage meter: mapped / total, used on supplier tiles and the mapping page. */
.dash-meter { display: grid; gap: 0.3rem; }
.dash-meter__track { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.dash-meter__fill { height: 100%; border-radius: 6px; background: var(--accent-strong); }
.dash-meter__fill.is-warning { background: var(--warn-mark); }
.dash-meter__label { display: flex; justify-content: space-between; gap: 0.5rem; font-size: var(--fs-xs); color: var(--muted); }

/* ================================================================ supplier workspace */

.dash-supplier { display: grid; grid-template-rows: auto auto 1fr auto; padding: 0; overflow: hidden; }
.dash-supplier__mono {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: var(--r-md); flex: none;
  background: var(--sunken); color: var(--ink); font-weight: 600; font-size: var(--fs-md); text-transform: uppercase;
}
.dash-supplier { position: relative; }

/* Record header: name, state and the record's key facts, with its actions. */
.dash-record { display: grid; gap: 1rem; padding: 1.2rem 1.25rem; }
.dash-record__top { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.dash-record__id { display: grid; gap: 0.25rem; min-width: 0; flex: 1; }
.dash-record__title { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.dash-record__states { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dash-record__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.dash-record__actions form { margin: 0; }

/* ================================================================ sign-in */

body.dash-auth { min-height: 100vh; margin: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--ground); }
.dash-auth__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 2rem; }
.dash-auth__brand { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 600; font-size: var(--fs-md); }
.dash-auth__tools { display: flex; align-items: center; gap: 0.15rem; }
.dash-auth__main { display: grid; place-items: start center; padding: 2rem 1.25rem 3rem; }
.dash-auth__panel { width: min(29rem, 100%); display: grid; gap: 1.1rem; padding: 2rem 2.25rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-panel); }
.dash-auth__lock { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-md); background: var(--sunken); color: var(--ink); }
.dash-auth__title { margin: 0; font-size: 1.5rem; font-weight: 600; }
.dash-auth__lede { margin: -0.6rem 0 0.25rem; color: var(--muted); }
.dash-auth__note { margin: 1rem 0 0; text-align: center; font-size: var(--fs-sm); color: var(--muted); }
.dash-auth__form { display: grid; gap: 1rem; }
.dash-auth__form .form-control { min-height: 2.875rem; font-size: var(--fs-md); }
.dash-auth__form .btn { min-height: 2.875rem; font-size: var(--fs-base); }
.dash-auth__password { position: relative; }
.dash-auth__password .form-control { padding-inline-end: 2.9rem; }
.dash-auth__reveal { position: absolute; inset-inline-end: 0.3rem; top: 50%; transform: translateY(-50%); }
.dash-auth__caps { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.35rem; font-size: var(--fs-sm); color: var(--warn); font-weight: 600; }

/* ================================================================ responsive */

@media (min-width: 1700px) {
  .dash-content { padding-inline: 2.25rem; }
}

@media (max-width: 1280px) {
}

@media (max-width: 1080px) {
  .dash-grid--main, .dash-grid--halves, .dash-grid--form, .dash-grid--thirds, .dash-grid--pair, .dash-grid--trio { grid-template-columns: minmax(0, 1fr); }
  .dash-stats--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-stats--6 .dash-stat:nth-child(3n + 1) { border-inline-start: 0; }
  .dash-stats--6 .dash-stat:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .dash-profile { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .rail { display: none; }
  .subnav {
    inset-inline-start: 0; z-index: 50; width: min(20rem, 88vw); background: var(--surface);
    transform: translateX(-100%); transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
    box-shadow: var(--shadow-pop); visibility: hidden;
  }
  [dir="rtl"] .subnav { transform: translateX(100%); }
  .subnav.is-open { transform: none; visibility: visible; transition: transform var(--t-med) var(--ease); }
  .subnav__top { display: flex; }
  .subnav__search { margin-top: 0.75rem; min-height: 2.75rem; }
  .subnav__search kbd { display: none; }
  /* !important: the base stylesheet hides [hidden] with !important, which kept every other section out of the drawer */
  .subnav__panel[hidden] { display: block !important; }
  .subnav__panel + .subnav__panel { margin-top: 0.75rem; }
  .subnav__title { margin-bottom: 0.25rem; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
  .subnav__title-icon { display: inline-block; width: 1rem; height: 1rem; }
  .subnav__link { min-height: 2.75rem; font-size: var(--fs-base); }
  .dash-main { margin-inline-start: 0; }
  .dash-top { padding: 0.45rem 1rem; gap: 0.35rem; }
  .dash-top__find { width: auto; flex: none; min-width: 2.75rem; min-height: 2.75rem; padding: 0; justify-content: center; border: 0; background: none; }
  .dash-top__find span, .dash-top__find kbd { display: none; }
  .dash-top__find .icon { width: 1.2rem; height: 1.2rem; }
  .dash-top__menu { display: inline-flex; }
  .dash-top__tool { min-width: 2.75rem; height: 2.75rem; }
  .dash-content { padding: 1.25rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
  .dash-head { align-items: stretch; }
  .dash-head__actions { width: 100%; }
  .dash-head__actions > .btn, .dash-head__actions > form > .btn, .dash-head__actions > a { flex: 1 1 auto; }
  /* A page's own menus open as a sheet above the tab bar, so every item fits on the screen and long lists scroll */
  .dash-head__actions .dash-menu[open] > .dash-menu__list {
    position: fixed; inset-inline: 0.75rem; top: auto; bottom: calc(4.25rem + env(safe-area-inset-bottom) + 0.5rem);
    min-width: 0; max-height: min(28rem, calc(100dvh - 10rem)); overflow-y: auto; overscroll-behavior: contain; z-index: 70;
  }
  .dash-head__actions .dash-menu__list a, .dash-head__actions .dash-menu__list button { min-height: 2.75rem; }
  .dash-tabbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; align-items: stretch;
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-top: 1px solid var(--line); backdrop-filter: blur(8px);
  }
  .dash-tabbar__item {
    position: relative; flex: 1 1 0; min-width: 0; min-height: 3.75rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
    border: 0; background: none; color: var(--muted); font-size: 0.75rem; font-weight: 500; text-decoration: none;
  }
  .dash-tabbar__item .icon { width: 1.3rem; height: 1.3rem; }
  .dash-tabbar__item > span:not(.rail__count) { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .dash-tabbar__item.is-current { color: var(--ink); }
  .dash-tabbar__item.is-current::before { content: ""; position: absolute; top: 0; width: 2rem; height: 2px; border-radius: 2px; background: var(--accent); }
  .dash-tabbar__item .rail__count { top: 0.45rem; inset-inline-end: calc(50% - 1.2rem); }
}

@media (max-width: 640px) {
  .dash-stats, .dash-stats--3, .dash-stats--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stats .dash-stat { border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
  .dash-stats .dash-stat:nth-child(-n + 2) { border-top: 0; }
  .dash-stats .dash-stat:nth-child(odd) { border-inline-start: 0; }
  .dash-stat__value { font-size: var(--fs-lg); }
  .dash-money__facts { grid-template-columns: minmax(0, 1fr); }
  .dash-ranked__name { white-space: normal; overflow-wrap: anywhere; }
  .dash-form__row { grid-template-columns: minmax(0, 1fr); }
  .dash-filters__search, .dash-filters__field { flex: 1 1 100%; max-width: none; }
  .dash-filters { flex-basis: 100%; }
  .dash-filters__date .form-control { flex: 1; min-width: 0; }
  .dash-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-line { border-top: 1px solid var(--line); }
  .dash-line:nth-child(-n + 2) { border-top: 0; }
  .dash-line:nth-child(odd) { border-inline-start: 0; }
  .dash-money__value { font-size: var(--fs-2xl); }
  .dash-actions { padding-inline: 1rem; }
  .dash-filters__date { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }
  .dash-top__tools .dash-top__tool span:not(.dash-top__dot) { display: none; }
  .dash-toasts { inset-inline: 1rem; inset-block-end: 5rem; width: auto; }
  .dash-auth__panel { padding: 1.5rem 1.25rem; }
  .dash-auth__bar { padding: 1rem 1.25rem; }
  .dash-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table > :not(caption) > * > *:first-child { padding-inline-start: 1rem; }
  .table > :not(caption) > * > *:last-child { padding-inline-end: 1rem; }

  /* Stacked tables: each row becomes a block of label / value lines. */
  .dash-table--stack thead { display: none; }
  .dash-table--stack, .dash-table--stack tbody, .dash-table--stack tr, .dash-table--stack td { display: block; width: 100%; }
  .dash-table--stack tr { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
  .dash-table--stack tbody tr:last-child { border-bottom: 0; }
  .dash-table--stack > :not(caption) > * > * { padding: 0.2rem 0 !important; border: 0; text-align: start !important; }
  .dash-table--stack td[data-label] { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
  .dash-table--stack td[data-label]::before { content: attr(data-label); flex: none; color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
  .dash-table--stack td[data-label] > * { text-align: end; }
  .dash-table--stack td.dash-td-main { padding-bottom: 0.35rem !important; }
  .dash-table--stack td.dash-td-check { float: inline-end; width: auto; }
  .dash-table--stack td:empty { display: none; }
  .dash-table--stack .dash-rule-form { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  html.is-loading .dash-progress::after { animation: none; transform: none; width: 100%; opacity: 0.6; }
}

@media (forced-colors: active) {
  .dash-line::before, .dash-station__dot, .dash-status::before { forced-color-adjust: none; }
  .rail__domain.is-current, .subnav__link.is-current { outline: 2px solid CanvasText; }
}

@media print {
  .rail, .subnav, .dash-top, .dash-toasts, .dash-tabbar, .dash-progress { display: none !important; }
  .dash-main { margin: 0 !important; }
}

/* Links inside rows read as text with a quiet underline; ember stays for attention and focus. */
.card-table tbody a:not(.btn):not(.badge):not(.dash-badge):not(.dash-cell-title),
.dash-facts dd a, .dash-ranked__name, .dash-feed a, .dash-queue__title, .dash-cell-meta a {
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em;
}
.card-table tbody a:not(.btn):not(.badge):not(.dash-badge):hover, .dash-facts dd a:hover, .dash-ranked__name:hover,
.dash-feed a:hover, .dash-queue__title:hover, .dash-cell-meta a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.dash-queue__title, .dash-ranked__name { text-decoration: none; }
.dash-ranked__name:hover { text-decoration: underline; }
.dash-queue__meta time, .dash-feed__when time, .dash-queue__meta .dash-id { white-space: nowrap; }
.dash-grid--catalog { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; }
@media (max-width: 1080px) { .dash-grid--catalog { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================ segmented links */

.dash-seg { display: inline-flex; gap: 0.125rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--sunken); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dash-seg a, .dash-seg button {
  display: inline-flex; align-items: center; min-height: 2rem; padding: 0.2rem 0.75rem; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--muted); font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.dash-seg a:hover, .dash-seg button:hover { color: var(--ink); text-decoration: none; }
.dash-seg [aria-current], .dash-seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-panel), 0 0 0 1px var(--line); }
.dash-seg--sm a, .dash-seg--sm button { min-height: 1.75rem; padding-inline: 0.65rem; font-size: var(--fs-sm); }
.dash-menu > summary.btn { list-style: none; cursor: pointer; }

/* ================================================================ command center */

.cc-sub { margin: 0.1rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.cc-more { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); text-decoration: none; }
.cc-more:hover { color: var(--ink); text-decoration: underline; }
.card-header > .cc-more { align-self: center; }

.cc-rev { display: flex; flex-direction: column; min-width: 0; }
.cc-rev__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; padding: 1.25rem 1.5rem 0; }
.cc-rev__label { margin: 0; font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.cc-rev__value { display: flex; align-items: center; gap: 0.2rem 0.6rem; flex-wrap: wrap; margin: 0.15rem 0 0; font-size: var(--fs-sm); color: var(--muted); }
.cc-rev__value > .num { font-size: var(--fs-3xl); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink); }
.cc-rev__value .dash-delta { padding: 0.1rem 0.45rem; border-radius: 6px; background: var(--sunken); font-size: 0.875rem; }
.cc-rev__value .dash-delta.is-up { background: var(--good-soft); }
.cc-rev__value .dash-delta.is-down { background: var(--bad-soft); }
.cc-rev__facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0.75rem 0 0; padding: 0 1.5rem; list-style: none; font-size: 0.875rem; color: var(--muted); }
.cc-rev__facts li { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.cc-rev__facts strong { color: var(--ink); font-weight: 600; }
.cc-rev__facts a { color: inherit; text-decoration: none; }
.cc-rev__facts a:hover { color: var(--ink); text-decoration: underline; }
.cc-rev__facts .dash-delta { font-size: var(--fs-sm); }
.cc-rev__chart { flex: 1; min-height: 16rem; padding: 0.5rem 1rem 0.25rem; }
.cc-rev__chart .dash-chart { height: 100%; min-height: 16rem; }
.cc-rev__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; padding: 0.65rem 1.5rem; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }

.cc-decide { display: flex; flex-direction: column; min-width: 0; }
.cc-decide .card-header { border-bottom: 0; }
.cc-decide .cc-list { flex: 1; }
.cc-list { list-style: none; margin: 0; padding: 0 0 0.35rem; }
.cc-item a { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.6rem 1.25rem; color: inherit; text-decoration: none; transition: background-color var(--t-fast) var(--ease); }
.cc-item a:hover { background: var(--hover); text-decoration: none; color: inherit; }
.cc-item__dot { width: 0.5rem; height: 0.5rem; margin-top: 0.45rem; flex: none; border-radius: 50%; background: var(--idle-mark); }
.cc-item.is-bad .cc-item__dot { background: var(--bad-mark); }
.cc-item.is-warn .cc-item__dot { background: var(--warn-mark); }
.cc-item__main { display: grid; min-width: 0; flex: 1; line-height: 1.45; }
.cc-item__title { font-weight: 600; font-size: 0.875rem; overflow-wrap: anywhere; }
.cc-item__meta { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
[dir="rtl"] .cc-item__meta { text-align: right; }
.cc-item__side { flex: none; font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cc-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.cc-stage {
  display: grid; gap: 0.15rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r-md); color: inherit; text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.cc-stage:hover { border-color: var(--line-strong); background: var(--hover); color: inherit; text-decoration: none; }
.cc-stage__count { font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; }
.cc-stage__label { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; }
.cc-outcomes { display: grid; gap: 0.55rem; margin-top: 1.1rem; }
.cc-outcomes__head { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.875rem; font-weight: 500; }
.cc-outcomes__head .num { font-weight: 400; color: var(--muted); }
.cc-bar { display: flex; gap: 2px; height: 0.625rem; border-radius: 4px; overflow: hidden; background: var(--sunken); }
.cc-bar__seg { display: block; min-width: 3px; background: var(--idle-mark); }
.cc-bar__dot { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 2px; background: var(--idle-mark); }
.cc-bar__seg.is-completed, .cc-bar__dot.is-completed { background: var(--good-mark); }
.cc-bar__seg.is-failed, .cc-bar__dot.is-failed { background: var(--bad-mark); }
.cc-bar__seg.is-manual_review, .cc-bar__dot.is-manual_review { background: var(--accent); }
.cc-bar__seg.is-unknown, .cc-bar__dot.is-unknown { background: var(--warn-mark); }
.cc-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--muted); }
.cc-legend a { display: inline-flex; align-items: center; gap: 0.35rem; color: inherit; text-decoration: none; }
.cc-legend a:hover { color: var(--ink); }
.cc-legend strong { color: var(--ink); font-weight: 600; }

.cc-suppliers { list-style: none; margin: 0; padding: 0; }
.cc-suppliers li + li { border-top: 1px solid var(--line); }
.cc-supplier { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.8rem 1.25rem; color: inherit; text-decoration: none; transition: background-color var(--t-fast) var(--ease); }
.cc-supplier:hover { background: var(--hover); color: inherit; text-decoration: none; }
.cc-supplier__main { display: grid; gap: 0.3rem; min-width: 0; }
.cc-supplier__name { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.5rem; font-weight: 600; }
.cc-supplier__chips { display: flex; flex-wrap: wrap; gap: 0.15rem 0.75rem; }
.cc-supplier__side { display: grid; justify-items: end; gap: 0.1rem; flex: none; font-size: var(--fs-sm); color: var(--muted); }
.cc-supplier__side strong { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.ready-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.ready-chip::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; flex: none; background: var(--idle-mark); }
.ready-chip.is-good::before { background: var(--good-mark); }
.ready-chip.is-warn { color: var(--warn); }
.ready-chip.is-warn::before { background: var(--warn-mark); }
.ready-chip.is-bad { color: var(--bad); }
.ready-chip.is-bad::before { background: var(--bad-mark); }

.cc-orders { list-style: none; margin: 0; padding: 0; }
.cc-orders li + li { border-top: 1px solid var(--line); }
.cc-orders a { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.65rem 1.25rem; color: inherit; text-decoration: none; transition: background-color var(--t-fast) var(--ease); }
.cc-orders a:hover { background: var(--hover); color: inherit; text-decoration: none; }
.cc-orders__main { display: grid; min-width: 0; line-height: 1.45; }
.cc-orders__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cc-orders__meta { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-orders__side { display: grid; justify-items: end; gap: 0.2rem; flex: none; }
.cc-orders__side strong { font-weight: 600; }

.cc-activity { list-style: none; margin: 0; padding: 0.35rem 1.25rem 0.75rem; }
.cc-activity li { padding: 0.5rem 0; }
.cc-activity li + li { border-top: 1px solid var(--line); }
.cc-activity p { margin: 0; font-size: 0.875rem; line-height: 1.5; }
.cc-activity strong { font-weight: 600; }
.cc-activity span { font-size: var(--fs-sm); color: var(--muted); }
.cc-activity__flag { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--warn) !important; }
.cc-activity__flag .icon { width: 0.9rem; height: 0.9rem; }

@media (max-width: 640px) {
  .cc-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-rev__head, .cc-rev__foot { padding-inline: 1rem; }
  .cc-rev__facts { padding-inline: 1rem; }
  .cc-rev__chart { padding-inline: 0.25rem; }
  .cc-rev__value > .num { font-size: var(--fs-2xl); }
  .dash-head__actions .dash-seg { width: 100%; }
  .dash-head__actions .dash-seg a { flex: 1; justify-content: center; }
}

/* ------------------------------------------------------------- Supplier board */
.sup-board { overflow: hidden; }
.sup-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(0, 1fr) 11.5rem; gap: 0.6rem 1.5rem; align-items: center; padding: 1rem 1.25rem; }
.sup-row + .sup-row { border-top: 1px solid var(--line); }
.sup-row__id { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; }
.sup-row__who { display: grid; gap: 0.35rem; min-width: 0; }
.sup-row__name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin: 0; font-size: var(--fs-md); font-weight: 600; }
.sup-row__name a { color: var(--ink); text-decoration: none; }
.sup-row__name a:hover { text-decoration: underline; }
.sup-row__facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; }
.sup-row__facts dt { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.sup-row__facts dd { margin: 0.1rem 0 0; font-weight: 600; white-space: nowrap; }
.sup-row__facts dd small { font-weight: 400; color: var(--muted); }
.sup-row__cover { min-width: 0; }
.sup-row__cover-foot { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.3rem; font-size: var(--fs-sm); color: var(--muted); }
.sup-row__actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; }
.sup-row__actions form { margin: 0; }
.sup-row__note { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 0.45rem; margin: 0; padding-top: 0.2rem; font-size: var(--fs-sm); color: var(--muted); }
.sup-row__note .icon { flex: none; width: 1rem; height: 1rem; margin-top: 0.1rem; }
.sup-row__note.is-warn { color: var(--warn); }
.sup-row__note.is-bad { color: var(--bad); }
.sup-routing { list-style: none; margin: 0; padding: 0; }
.sup-routing__row { display: flex; align-items: center; gap: 0.75rem; min-height: 3rem; padding: 0.4rem 1.25rem; }
.sup-routing__row + .sup-routing__row { border-top: 1px solid var(--line); }
.sup-routing__row.is-off .sup-routing__name { color: var(--muted); }
.sup-routing__rank { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--sunken); font-size: var(--fs-sm); font-weight: 600; }
.sup-routing__name { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-routing__name:hover { text-decoration: underline; }
.sup-routing__move { display: flex; gap: 0.25rem; margin: 0; }

/* ------------------------------------------------------------- Supplier page */
.sup-head { align-items: center; flex-wrap: wrap; }
.sup-head__mono { width: 3rem; height: 3rem; font-size: 1.15rem; flex: none; }
.sup-head__line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.sup-ready { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.ready-card { padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-panel); }
.ready-card__label { display: flex; align-items: center; gap: 0.4rem; margin: 0; font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.ready-card__label .icon { width: 1rem; height: 1rem; }
.ready-card__state { display: flex; align-items: center; gap: 0.5rem; margin: 0.45rem 0 0; font-size: 1.0625rem; font-weight: 600; }
.ready-card__state::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--idle-mark); }
.ready-card.is-good .ready-card__state::before { background: var(--good-mark); }
.ready-card.is-warn .ready-card__state { color: var(--warn); }
.ready-card.is-warn .ready-card__state::before { background: var(--warn-mark); }
.ready-card.is-bad .ready-card__state { color: var(--bad); }
.ready-card.is-bad .ready-card__state::before { background: var(--bad-mark); }
.ready-card__meta { margin: 0.25rem 0 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.55; }
.sup-facts { padding: 1rem 1.25rem; }

/* ------------------------------------------------------------- Connecting a supplier */
.wiz { display: grid; grid-template-columns: 14rem minmax(0, 46rem); gap: var(--gap); align-items: start; }
.wiz__steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.wiz__step > a, .wiz__step > span { display: flex; align-items: center; gap: 0.65rem; min-height: 2.75rem; padding: 0.35rem 0.6rem; border-radius: var(--r-md); color: var(--muted); text-decoration: none; }
.wiz__step > a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.wiz__step.is-now > a, .wiz__step.is-now > span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-panel), 0 0 0 1px var(--line); }
.wiz__dot { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; }
.wiz__dot .icon { width: 0.95rem; height: 0.95rem; }
.wiz__step.is-now .wiz__dot { border-color: var(--inverse); background: var(--inverse); color: var(--on-inverse); }
.wiz__step.is-done .wiz__dot { border-color: var(--good-mark); background: var(--good-mark); color: #fff; }
.wiz__step.is-bad .wiz__dot { border-color: var(--bad-mark); background: var(--bad-mark); color: #fff; }
.wiz__body { display: grid; gap: 1rem; }
.wiz__body form { margin: 0; }
.wiz__lead { margin: 0; color: var(--ink-2); line-height: 1.65; }
.wiz__result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 1rem; margin: 0; padding: 0.75rem 0.9rem; border-radius: var(--r-md); background: var(--sunken); }
.wiz__result .ready-chip { font-weight: 600; font-size: 0.9375rem; }
.wiz__fact { font-size: var(--fs-sm); color: var(--muted); }
.wiz__figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.5rem; margin: 0; }
.wiz__figures > div { padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-md); }
.wiz__figures dt { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.wiz__figures dd { margin: 0.15rem 0 0; font-size: 1.25rem; font-weight: 600; }
.wiz__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wiz__note { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.6; }
.wiz__note .icon { flex: none; width: 1.05rem; height: 1.05rem; margin-top: 0.1rem; }
.wiz__note.is-warn { color: var(--warn); }
.wiz__note.is-bad { color: var(--bad); }
.wiz__note.is-good { color: var(--good); }
.wiz__sync { display: grid; gap: 0.75rem; }
.wiz__spinner { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: wiz-spin 0.8s linear infinite; }
@keyframes wiz-spin { to { transform: rotate(360deg); } }
.wiz__checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.wiz__check { display: flex; align-items: flex-start; gap: 0.55rem; line-height: 1.55; }
.wiz__check-mark { flex: none; display: inline-flex; margin-top: 0.15rem; }
.wiz__check-mark .icon { width: 1.1rem; height: 1.1rem; }
.wiz__check.is-ok .wiz__check-mark { color: var(--good); }
.wiz__check.is-warn .wiz__check-mark { color: var(--warn); }
.wiz__check.is-stop .wiz__check-mark { color: var(--bad); }
.wiz__nav { display: flex; justify-content: space-between; gap: 0.5rem; }
.wiz__caps { padding: 0; }
.wiz__types { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* ------------------------------------------------------------- Mapping workspace */
.mq__views { align-self: flex-start; }
.mq__views a { gap: 0.4rem; }
.mq__views .num { color: var(--muted); font-weight: 500; }
.mq { display: grid; grid-template-columns: minmax(19rem, 25rem) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.mq__filters { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); }
.mq__filters .dash-filters { width: 100%; }
.mq__filters .dash-filters__search, .mq__filters .dash-filters__field { flex: 1 1 100%; max-width: none; }
.mq__rows { list-style: none; margin: 0; padding: 0; max-height: calc(100dvh - 22rem); min-height: 16rem; overflow-y: auto; overscroll-behavior: contain; }
.mq__rows li + li { border-top: 1px solid var(--line); }
.mq-row { display: grid; gap: 0.2rem; padding: 0.7rem 1rem; color: inherit; text-decoration: none; border-inline-start: 3px solid transparent; transition: background-color var(--t-fast) var(--ease); }
.mq-row:hover { background: var(--hover); color: inherit; text-decoration: none; }
.mq-row.is-current { background: var(--accent-soft); border-inline-start-color: var(--accent); }
.mq-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mq-row__name { font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.mq-row.is-out .mq-row__name { color: var(--muted); }
.mq-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.75rem; font-size: var(--fs-sm); color: var(--muted); }
.mq-row__hint { color: var(--accent-ink); }
.mq__panel { position: sticky; top: calc(var(--top-h) + 1rem); max-height: calc(100dvh - var(--top-h) - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.match__head { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); }
.match__eyebrow { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.match__eyebrow a { color: inherit; }
.match__name { margin: 0.2rem 0 0; font-size: 1.125rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; outline: none; }
.match__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.6rem 1rem; margin: 0.75rem 0 0; }
.match__facts dt { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.match__facts dd { margin: 0.1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.match__note { margin: 0.75rem 1.25rem 0; }
.match__body { display: grid; gap: 1.1rem; padding: 1.1rem 1.25rem; margin: 0; }
.match__group { display: grid; gap: 0.5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.match__group legend, .match__label { display: flex; align-items: center; gap: 0.35rem; margin: 0; font-weight: 600; font-size: 0.875rem; }
.match__group legend .icon { width: 1rem; height: 1rem; color: var(--accent-ink); }
.match__choices { display: grid; gap: 0.4rem; }
.match-choice { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.match-choice:hover { background: var(--hover); }
.match-choice:has(input:checked) { border-color: var(--ink); background: var(--sunken); }
.match-choice .form-check-input { flex: none; margin: 0; }
.match-choice__body { display: grid; flex: 1; min-width: 0; }
.match-choice__name { font-weight: 500; overflow-wrap: anywhere; }
.match-choice__meta { font-size: var(--fs-sm); color: var(--muted); text-align: start; }
.match-choice__score { flex: none; font-size: var(--fs-sm); color: var(--muted); }
.match-choice__score.is-high { color: var(--good); font-weight: 600; }
.match__preview { display: grid; gap: 0.9rem; padding: 0.9rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.match__preview:has(.match__summary) { border-style: solid; border-color: var(--line); }
.match__preview .btn-primary { justify-self: start; }
.match__empty { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.match__picked { margin: 0.1rem 0 0; font-weight: 600; }
.match__picked a { color: var(--ink); }
.match__sources { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.match__sources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; }
.match__sources li > :first-child { flex: 1; min-width: 0; }
.match__foot { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1.25rem; border-top: 1px solid var(--line); }
.match__foot form { margin: 0; }

@media (max-width: 74.99em) {
  .sup-row { grid-template-columns: minmax(0, 1fr) auto; }
  .sup-row__facts, .sup-row__cover { grid-column: 1 / -1; }
  .sup-row__actions { grid-column: 2; grid-row: 1; }
}
@media (max-width: 61.99em) {
  .mq { grid-template-columns: minmax(0, 1fr); }
  .mq__panel { position: static; max-height: none; scroll-margin-top: calc(var(--top-h) + 0.5rem); }
  .mq__rows { max-height: 22rem; }
  .wiz { grid-template-columns: minmax(0, 1fr); }
  .wiz__steps { overflow-x: auto; }
  .wiz__steps ol { grid-auto-flow: column; grid-auto-columns: max-content; gap: 0.25rem; }
  .sup-ready { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
}
@media (max-width: 47.99em) {
  .sup-row { grid-template-columns: minmax(0, 1fr); }
  .sup-row__actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .wiz__step:not(.is-now) .wiz__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ------------------------------------------------------------- Orders */
.order-row.is-attention > td:first-child { box-shadow: inset 3px 0 0 var(--bad-mark); }
[dir="rtl"] .order-row.is-attention > td:first-child { box-shadow: inset -3px 0 0 var(--bad-mark); }
.order-head { align-items: flex-end; }
.order-head__ref { font-family: var(--font-mono, ui-monospace, monospace); font-size: 1.5rem; }
.order-head__total { margin-inline-end: 0.5rem; font-size: 1.625rem; font-weight: 600; letter-spacing: -0.01em; }
.order-head__total small { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.order-head .dash-head__date a { color: var(--muted); }
.order-track { display: grid; gap: 0.4rem; padding: 1.1rem 1.25rem 0.9rem; }
.order-track__note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.order-decide { overflow: hidden; }
.order-decide__why { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1.1rem 1.25rem; }
.order-decide.is-bad .order-decide__why { background: var(--bad-soft); }
.order-decide.is-warn .order-decide__why { background: var(--warn-soft); }
.order-decide__mark { flex: none; display: inline-flex; margin-top: 0.1rem; }
.order-decide__mark .icon { width: 1.35rem; height: 1.35rem; }
.order-decide.is-bad .order-decide__mark { color: var(--bad); }
.order-decide.is-warn .order-decide__mark { color: var(--warn); }
.order-decide__title { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.order-decide__hint { margin: 0.2rem 0 0; color: var(--ink-2); line-height: 1.6; }
.order-decide__answer { margin: 0.35rem 0 0; font-size: var(--fs-sm); color: var(--muted); overflow-wrap: anywhere; }
.order-decide__form { padding: 1.1rem 1.25rem; border-top: 1px solid var(--line); }
.order-decide__choices { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.order-pane__hint { margin: 0; padding: 0.75rem 1.25rem; font-size: var(--fs-sm); color: var(--muted); }
.order-pane__meta { display: flex; align-items: center; gap: 0.4rem; margin: 0 0 0.75rem; font-size: var(--fs-sm); color: var(--muted); }
.order-pane__meta .icon { width: 1rem; height: 1rem; }
.dash-facts--list dd { text-align: end; }
@media (max-width: 47.99em) {
  .order-head .dash-head__actions .btn-icon { flex: none; width: 2.5rem; }
  .order-head__total { flex: 1; }
}

/* ---------- How products look to customers; required chats; customer notifications ---------- */
.dash-look__picture { display: flex; gap: 0.9rem; align-items: flex-start; }
.dash-look__img { flex: none; width: 6rem; height: 6rem; border-radius: 0.75rem; object-fit: cover; background: var(--sunken); border: 1px solid var(--line); }
.dash-look__img--empty { display: inline-flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--muted); }
.dash-look__img--empty .icon { width: 1.75rem; height: 1.75rem; }
.dash-look__emoji { font-size: 1.15rem; }
.dash-look__inline { margin-inline-end: 0.35rem; }
.dash-gate { padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 0.6rem; background: var(--sunken); }
.dash-gate__check { display: flex; align-items: flex-start; gap: 0.45rem; margin: 0; font-size: var(--fs-sm); line-height: 1.55; }
.dash-gate__check .icon { flex: none; width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; }
.dash-gate__check.is-ok { color: var(--good); }
.dash-gate__check.is-bad { color: var(--bad); }
.dash-sendbar { height: 3px; margin-top: 0.4rem; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 5rem; }
.dash-sendbar span { display: block; height: 100%; background: var(--info); border-radius: 3px; transition: width 0.4s ease; }
@media (prefers-reduced-motion: reduce) { .dash-sendbar span { transition: none; } }

/* ---------- Product type filter: three choices to combine, none means all ---------- */
.dash-filters__types { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.dash-filters__types-label { float: none; width: auto; margin: 0 0 0 0.15rem; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.dash-typechip { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.dash-typechip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dash-typechip span { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0 0.75rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); }
.dash-typechip input:checked + span { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }
.dash-typechip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Offer tiers: from what quantity or amount, how much ---------- */
.dash-tiers { display: grid; gap: 0.4rem; }
.dash-tiers__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; }
.dash-tiers__unit { width: auto; min-width: 4.5rem; }
[dir="rtl"] .dash-tiers__arrow { display: inline-block; transform: scaleX(-1); }

/* ---------------------------------------------------------------- client review, phase 4 */
.dash-row-actions--wrap { flex-wrap: wrap; }
.dash-secret-block { margin: 0; padding: 0.6rem 0.75rem; border-radius: 8px; background: var(--sunken); white-space: pre-wrap; word-break: break-all; font-size: var(--fs-sm); }
.dash-issues { margin: 0; padding-inline-start: 1.1rem; display: grid; gap: 0.3rem; font-size: var(--fs-sm); }
.dash-translations { list-style: none; margin: 0; padding: 0; }
.dash-translation { display: grid; gap: 0.4rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); }
.dash-translation:last-child { border-bottom: 0; }
.dash-translation__key { font-size: var(--fs-sm); color: var(--muted); background: none; padding: 0; }
.dash-translation__source { margin: 0; color: var(--ink-2); white-space: pre-wrap; }
.dash-translation__form { display: grid; gap: 0.4rem; }
.dash-translation__actions { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; }

/* the connector builder (comments 11/26) */
.bld-rows { display: grid; gap: 0.4rem; }
.bld-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 0.4rem; align-items: center; }
.bld-op__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.bld-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.bld-step { display: grid; gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
.bld-step__line { display: grid; grid-template-columns: auto 7.5rem minmax(0, 1fr) repeat(4, auto); gap: 0.4rem; align-items: center; }
.bld-step__n { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--line); font-size: var(--fs-sm); font-weight: 600; }
.bld-step__more { display: grid; gap: 0.75rem; padding-top: 0.25rem; }
.bld-cond { display: grid; grid-template-columns: 8rem minmax(0, 1.4fr) 7rem minmax(0, 1fr); gap: 0.4rem; align-items: center; }
.bld-map { display: grid; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.bld-map__title { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.bld-field { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.5rem; align-items: center; }
.bld-field .form-label { margin: 0; }
.bld-field--top { align-items: start; }
.bld-field--top .form-label { padding-top: 0.3rem; }
.bld-detail { display: grid; gap: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.bld-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.bld-test { display: grid; grid-template-columns: 11rem repeat(2, minmax(0, 1fr)) auto; gap: 0.5rem; }
.bld-trace { display: grid; gap: 0.5rem; margin-top: 1rem; }
.bld-result { padding: 0.75rem 1rem; border-radius: 10px; background: var(--sunken); }
.bld-result.is-ok { box-shadow: inset 3px 0 0 var(--good); }
.bld-result.is-bad { box-shadow: inset 3px 0 0 var(--bad); }
[dir="rtl"] .bld-result.is-ok { box-shadow: inset -3px 0 0 var(--good); }
[dir="rtl"] .bld-result.is-bad { box-shadow: inset -3px 0 0 var(--bad); }
.bld-result.is-info { box-shadow: inset 3px 0 0 var(--info); }
[dir="rtl"] .bld-result.is-info { box-shadow: inset -3px 0 0 var(--info); }
.bld-call { border: 1px solid var(--line); border-radius: 10px; padding: 0.5rem 0.75rem; }
.bld-call summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.bld-call code { word-break: break-all; }
.bld-pre { margin: 0.5rem 0 0; max-height: 18rem; overflow: auto; padding: 0.6rem 0.75rem; border-radius: 8px; background: var(--sunken); font-size: var(--fs-sm); white-space: pre-wrap; word-break: break-all; }
.bld-problems { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
@media (max-width: 720px) {
  .bld-step__line { grid-template-columns: auto minmax(0, 1fr) auto; }
  .bld-step__line .form-control { grid-column: 1 / -1; order: 2; }
  .bld-cond, .bld-field, .bld-test { grid-template-columns: minmax(0, 1fr); }
  .bld-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bld-row input:nth-child(2) { grid-column: 1 / 2; }
}
.dash-seg__count { margin-inline-start: 0.4rem; color: var(--muted); font-weight: 500; }
.bld-rows > .btn { justify-self: start; }
.bld-row--pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }

/* the suppliers' catalog by category (comment 19) */
.scat-cats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.scat-cat { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.5rem; padding: 0.3rem 0.5rem 0.3rem 0.4rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface, #fff); color: inherit; text-decoration: none;
  font-size: var(--fs-sm); font-weight: 500; }
[dir="rtl"] .scat-cat { padding: 0.3rem 0.4rem 0.3rem 0.5rem; }
.scat-cat:hover { border-color: var(--line-strong); }
.scat-cat.is-on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-ink); }
.scat-cat__icon { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--sunken); font-size: 0.95rem; }
.scat-cat__letter { font-weight: 600; color: var(--muted); }
.scat-cat__count { padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 0.75rem; }
.scat-cat.is-on .scat-cat__count { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-ink); }
