/* @raha/tokens — the root variables of the Raha systems, in load order:

   1. the base palette, type, radius and elevation scale
   2. the system tokens — the theme (data-brand), Vazirmatn, spacing, motion
   3. the root rules of the vendor overrides

   Every kit variable carries the one prefix `--raha-` (a few brand and layout ones keep `--brand-*`, `--space-*`, `--app-*`);
   the table of old names is in docs/CONSUMING.md. */

@import "./raha.css";



/* ---- 1. Base palette, type, radius, elevation ---- */

:root {
  --custom-modal-backdrop-bg: #a6adbf;
}

html[data-theme=dark], body[data-theme=dark] {
  --raha-primary-bg-subtle: #02011f;
  --raha-info-bg-subtle: #100023;
  --raha-secondary: #b9c2da;
  --raha-secondary-rgb: 185, 194, 218;
  --raha-tertiary-bg: #232323;
  --raha-tertiary-bg-rgb: 35, 35, 35;
}

:root {
  --custom-body-bg: #FDFDFF;
  --app-sidebar-bg: #ffffff;
  --app-header-bg: var(--custom-body-bg);
}

[data-theme=dark] {
  --custom-body-bg: var(--raha-secondary-bg);
  --app-sidebar-bg: var(--raha-body-bg);
  --app-header-bg: var(--raha-secondary-bg);
}

:root, [data-theme=light] {
  /* Explicit, not inferred: a product's `<meta name="color-scheme" content="light dark">` would otherwise draw the browser's own
     controls (checkbox, scrollbar) dark under a dark OS while the panel is light. */
  color-scheme: light;
  --raha-blue: #0d6efd;
  --raha-indigo: #6610f2;
  --raha-purple: #6f42c1;
  --raha-pink: #d63384;
  --raha-red: #dc3545;
  --raha-orange: #fd7e14;
  --raha-yellow: #ffc107;
  --raha-green: #198754;
  --raha-teal: #20c997;
  --raha-cyan: #0dcaf0;
  --raha-black: #000;
  --raha-white: #ffffff;
  --raha-gray: #6c757d;
  --raha-gray-dark: #343a40;
  --raha-gray-100: #f8f9fa;
  --raha-gray-200: #e9ecef;
  --raha-gray-300: #dee2e6;
  --raha-gray-400: #ced4da;
  --raha-gray-500: #adb5bd;
  --raha-gray-600: #6c757d;
  --raha-gray-700: #495057;
  --raha-gray-800: #343a40;
  --raha-gray-900: #212529;
  --raha-primary: #5955D1;
  --raha-secondary: #29294B;
  --raha-success: #009966;
  --raha-info: #7008E7;
  --raha-warning: #F5A70D;
  --raha-danger: #F83636;
  --raha-light: #F2F2F6;
  --raha-dark: #0C243C;
  --raha-white: #ffffff;
  --raha-gray: #97A1C0;
  --raha-primary-rgb: 89, 85, 209;
  --raha-secondary-rgb: 41, 41, 75;
  --raha-success-rgb: 0, 153, 102;
  --raha-info-rgb: 112, 8, 231;
  --raha-warning-rgb: 245, 167, 13;
  --raha-danger-rgb: 248, 54, 54;
  --raha-light-rgb: 242, 242, 246;
  --raha-dark-rgb: 12, 36, 60;
  --raha-white-rgb: 255, 255, 255;
  --raha-gray-rgb: 151, 161, 192;
  --raha-primary-text-emphasis: #242254;
  --raha-secondary-text-emphasis: #10101e;
  --raha-success-text-emphasis: #003d29;
  --raha-info-text-emphasis: #2d035c;
  --raha-warning-text-emphasis: #624305;
  --raha-danger-text-emphasis: #631616;
  --raha-light-text-emphasis: #495057;
  --raha-dark-text-emphasis: #495057;
  --raha-primary-bg-subtle: #f5f5fc;
  --raha-secondary-bg-subtle: #f2f2f4;
  --raha-success-bg-subtle: #f0f9f6;
  --raha-info-bg-subtle: #f6f0fe;
  --raha-warning-bg-subtle: #fefaf0;
  --raha-danger-bg-subtle: #fff3f3;
  --raha-light-bg-subtle: #fcfcfd;
  --raha-dark-bg-subtle: #f5f6f7;
  --raha-primary-border-subtle: #d6d5f4;
  --raha-secondary-border-subtle: #cacad2;
  --raha-success-border-subtle: #bfe6d9;
  --raha-info-border-subtle: #dbc1f9;
  --raha-warning-border-subtle: #fde9c3;
  --raha-danger-border-subtle: #fdcdcd;
  --raha-light-border-subtle: #e9ecef;
  --raha-dark-border-subtle: #adb5bd;
  --raha-white-rgb: 255, 255, 255;
  --raha-black-rgb: 0, 0, 0;
  --raha-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --raha-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --raha-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
  --raha-body-font-family: "YekanBakh", sans-serif;
  --raha-body-font-size: 0.875rem;
  --raha-body-font-weight: 500;
  --raha-body-line-height: 1.6;
  --raha-body-text-align: start;
  --raha-gutter-x: 1.5rem;
  --raha-gutter-y: 0;
  --raha-body-color: #696981;
  --raha-body-color-rgb: 105, 105, 129;
  --raha-body-bg: #fff;
  --raha-body-bg-rgb: 255, 255, 255;
  --raha-emphasis-color: #000;
  --raha-emphasis-color-rgb: 0, 0, 0;
  --raha-secondary-color: rgba(105, 105, 129, 0.75);
  --raha-secondary-color-rgb: 105, 105, 129;
  --raha-secondary-bg: #f9f9f9;
  --raha-secondary-bg-rgb: 249, 249, 249;
  --raha-tertiary-color: rgba(105, 105, 129, 0.5);
  --raha-tertiary-color-rgb: 105, 105, 129;
  --raha-tertiary-bg: #f8f9fa;
  --raha-tertiary-bg-rgb: 248, 249, 250;
  --raha-heading-color: #0C243C;
  --raha-link-color: #5955D1;
  --raha-link-color-rgb: 89, 85, 209;
  --raha-link-decoration: none;
  --raha-link-hover-color: #4744a7;
  --raha-link-hover-color-rgb: 71, 68, 167;
  --raha-code-color: #d63384;
  --raha-highlight-color: #696981;
  --raha-highlight-bg: #fff3cd;
  --raha-border-width: 1px;
  --raha-border-style: solid;
  --raha-border-color: #EEEEF3;
  --raha-border-color-translucent: rgba(0, 0, 0, 0.1);
  --raha-border-radius: 0.375rem;
  --raha-border-radius-sm: 0.25rem;
  --raha-border-radius-lg: 0.625rem;
  --raha-border-radius-xl: 1rem;
  --raha-border-radius-xxl: 2rem;
  --raha-border-radius-2xl: var(--raha-border-radius-xxl);
  --raha-border-radius-pill: 50rem;
  --raha-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --raha-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --raha-box-shadow-lg: 0 0.26rem 1.126rem 0 rgba(45, 42, 60, 0.15);
  --raha-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
  --raha-focus-ring-width: 0.1rem;
  --raha-focus-ring-opacity: 0.25;
  --raha-focus-ring-color: rgba(89, 85, 209, 0.25);
  --raha-form-valid-color: #009966;
  --raha-form-valid-border-color: #009966;
  --raha-form-invalid-color: #F83636;
  --raha-form-invalid-border-color: #F83636;
}

[data-theme=dark] {
  color-scheme: dark;
  --raha-body-color: #999999;
  --raha-body-color-rgb: 153, 153, 153;
  --raha-body-bg: #1E1E1E;
  --raha-body-bg-rgb: 30, 30, 30;
  --raha-emphasis-color: #ffffff;
  --raha-emphasis-color-rgb: 255, 255, 255;
  --raha-secondary-color: rgba(153, 153, 153, 0.75);
  --raha-secondary-color-rgb: 153, 153, 153;
  --raha-secondary-bg: #282828;
  --raha-secondary-bg-rgb: 40, 40, 40;
  --raha-tertiary-color: rgba(153, 153, 153, 0.5);
  --raha-tertiary-color-rgb: 153, 153, 153;
  --raha-tertiary-bg: #26283e;
  --raha-tertiary-bg-rgb: 38, 40, 62;
  --raha-primary-text-emphasis: #9b99e3;
  --raha-secondary-text-emphasis: #7f7f93;
  --raha-success-text-emphasis: #66c2a3;
  --raha-info-text-emphasis: #a96bf1;
  --raha-warning-text-emphasis: #f9ca6e;
  --raha-danger-text-emphasis: #fb8686;
  --raha-light-text-emphasis: #5d5d5d;
  --raha-dark-text-emphasis: #999999;
  --raha-primary-bg-subtle: #12112a;
  --raha-secondary-bg-subtle: #08080f;
  --raha-success-bg-subtle: #001f14;
  --raha-info-bg-subtle: #16022e;
  --raha-warning-bg-subtle: #312103;
  --raha-danger-bg-subtle: #320b0b;
  --raha-light-bg-subtle: #232323;
  --raha-dark-bg-subtle: #10101d;
  --raha-primary-border-subtle: #35337d;
  --raha-secondary-border-subtle: #19192d;
  --raha-success-border-subtle: #005c3d;
  --raha-info-border-subtle: #43058b;
  --raha-warning-border-subtle: #936408;
  --raha-danger-border-subtle: #952020;
  --raha-light-border-subtle: #333333;
  --raha-dark-border-subtle: #494949;
  --raha-heading-color: #bcbcbc;
  --raha-link-color: #9b99e3;
  --raha-link-hover-color: #afade9;
  --raha-link-color-rgb: 155, 153, 227;
  --raha-link-hover-color-rgb: 175, 173, 233;
  --raha-code-color: #e685b5;
  --raha-highlight-color: #999999;
  --raha-highlight-bg: #664d03;
  --raha-border-color: rgba(255, 255, 255, 0.05);
  --raha-border-color-translucent: rgba(255, 255, 255, 0.15);
  --raha-form-valid-color: #75b798;
  --raha-form-valid-border-color: #75b798;
  --raha-form-invalid-color: #ea868f;
  --raha-form-invalid-border-color: #ea868f;
}

:root {
  --raha-breakpoint-xs: 0;
  --raha-breakpoint-sm: 576px;
  --raha-breakpoint-md: 768px;
  --raha-breakpoint-lg: 992px;
  --raha-breakpoint-xl: 1200px;
  --raha-breakpoint-xxl: 1400px;
}

:root, [data-theme=light] {
  --raha-btn-close-filter:;
}

[data-theme=dark] {
  --raha-btn-close-filter: invert(1) grayscale(100%) brightness(200%);
}

:root, [data-theme=light] {
  --raha-carousel-indicator-active-bg: #ffffff;
  --raha-carousel-caption-color: #ffffff;
  --raha-carousel-control-icon-filter:;
}

[data-theme=dark] {
  --raha-carousel-indicator-active-bg: #000;
  --raha-carousel-caption-color: #000;
  --raha-carousel-control-icon-filter: invert(1) grayscale(100);
}

:root {
  --app-sidebar-width: 250px;
  --app-header-height: 80px;
  --app-sidebar-end: 80px;
}

@media (max-width: 1480px) {
  :root {
    --app-sidebar-end: 0;
  }
}

[data-app-sidebar=mini] {
  --app-sidebar-width: 80px;
}

:root {
  --app-menubar-tabs: 320px;
  --app-sidebar-panel: 410px;
}

@media (max-width: 1480px) {
  :root {
    --app-sidebar-panel: 0;
  }
}

@media (max-width: 1399px) {
  :root {
    --app-sidebar-panel: 0;
  }
}

[data-app-sidebar=mini] {
  --app-menubar-tabs: 80px;
}

@media (max-width: 1480px) {
  :root {
    --app-menubar-tabs: 80px;
  }
}

:root {
  --ai-menubar-tabs: 250px;
  --ai-app-header-height: 54px;
  --ai-sidebar-width: 250px;
}

[data-app-sidebar=mini] {
  --ai-menubar-tabs: 70px;
  --ai-sidebar-width: 70px;
}

@media (max-width: 1191px) {
  :root {
    --ai-sidebar-width: 0;
  }
}

html[data-theme=light] {
  --raha-gray-bg-subtle: #f8f9fa;
}

html[data-theme=dark] {
  --custom-modal-backdrop-bg: #303a54;
  --raha-light: #232323;
  --raha-dark: #b9c2da;
  --raha-light-rgb: 35, 35, 35;
  --raha-dark-rgb: 185, 194, 218;
  --raha-gray-bg-subtle: #393c56;
}

:root {
  --raha-btn-primary-hover: #504dbc;
  --raha-btn-primary-border-hover: #4e4bb8;
  --raha-btn-primary-active: #4e4bb8;
  --raha-btn-secondary-hover: #252544;
  --raha-btn-secondary-border-hover: #242442;
  --raha-btn-secondary-active: #242442;
}

:root {
  --swiper-navigation-size: 30px;
  --swiper-theme-color: var(--raha-primary);
}

:root, [data-theme=light], [data-theme=dark] {
  --fc-small-font-size: .85em;
  --fc-page-bg-color: #fff;
  --fc-neutral-bg-color: hsla(0, 0%, 82%, .3);
  --fc-neutral-text-color: grey;
  --fc-border-color: var(--raha-border-color);
  --fc-button-text-color: var(--raha-primary);
  --fc-button-bg-color: var(--raha-primary-bg-subtle);
  --fc-button-border-color: rgba(var(--raha-primary-rgb), 0.1);
  --fc-button-hover-bg-color: var(--raha-primary);
  --fc-button-hover-border-color: var(--raha-primary);
  --fc-button-active-bg-color: var(--raha-primary);
  --fc-button-active-border-color: var(--raha-primary);
  --fc-event-bg-color: #3788d8;
  --fc-event-border-color: #3788d8;
  --fc-event-text-color: #fff;
  --fc-event-selected-overlay-color: rgba(0, 0, 0, .25);
  --fc-more-link-bg-color: #d0d0d0;
  --fc-more-link-text-color: inherit;
  --fc-event-resizer-thickness: 8px;
  --fc-event-resizer-dot-total-width: 8px;
  --fc-event-resizer-dot-border-width: 1px;
  --fc-non-business-color: hsla(0, 0%, 84%, .3);
  --fc-bg-event-color: #8fdf82;
  --fc-bg-event-opacity: 0.3;
  --fc-highlight-color: rgba(188, 232, 241, .3);
  --fc-today-bg-color: var(--raha-light);
  --fc-now-indicator-color: red;
}

:root, [data-theme=dark] {
  --tagify-dd-color-primary: rgb(var(--raha-primary-rgb));
  --tagify-dd-text-color: var(--raha-heading-color);
  --tagify-dd-bg-color: var(--raha-body-bg);
  --tagify-dd-item-pad: 10px 10px;
}



/* ---- 2. the system tokens ---- */

/* Design tokens — the single density and colour layer (decision D31: compact/minimal). Imported once,
   from src/main.tsx, after the system's own base sheet.

   Two rules hold this file together:
   - Colour has TWO sources and one direction of flow. The TEMPLATE's palette is ALIASED, never
     copied: every --color-* token below resolves to a raha custom property in the vendored
     styles.css, so a template update propagates for free (§7.7 / FE-019). The client's BRAND is the
     case that contract cannot express, because it does not exist in the template at all. It is
     defined here, once, from their own brand-colour PDF, and pushed INTO the template by
     vendor-overrides.css, which re-points --raha-primary and its family at it (§7.7 / FE-022). The
     flow is still one-way and there is still exactly one place a brand colour can be edited or
     drift from. What that prevents is concrete: #021029, eyedropped off wordmark artwork, was
     proposed as a brand colour and is not one — the PDF has four, and none of them is that.
     The two places a var() is impossible remain the theme-color meta and the webmanifest; both
     cite their source in place.
   - No direction in any name (no --space-left). Consumers are forced onto logical properties —
     margin-inline-start, padding-inline, inset-inline — which is what makes the RTL shell work.

   Body type is NOT set here. The template already composes `body` from its own --raha-body-* knobs, so
   re-pointing those in vendor-overrides.css configures the template instead of fighting it; a second
   `body` rule here would silently win over it and hide that. */

/* ── BRAND ────────────────────────────────────────────────────────────────────────────────────────
   The client's identity: the one place its literals exist, and the only colour in this file that is
   a value rather than an alias. Everything here is transcribed from the kit they delivered, never
   sampled from artwork.

   TYPE. Vazirmatn, self-hosted: five faces — 300/400/500/600/700 — the family the Raha systems
   use throughout This RESTORES Vazirmatn (the
   app's earlier self-host, briefly replaced by IRANSans); IRANSans and its three woff2 are removed in
   the same change, so nothing resolves to family "IRANSans" any more and a browser fetches an
   @font-face src only when its family is used, so the removal cannot 404. The three `!important`
   YekanBakh rules left in styles.css are persian-datepicker selectors (.p-date-time-picker,
   .datepicker-plot-area, .p-timepicker) for a jQuery plugin §7.7 forbids loading — unreachable here,
   which is why nothing in vendor-overrides.css needs !important.

   COLOUR — NAMED, SWITCHABLE THEMES. The brand palette is a set of `--brand-*` variables, and the ACTIVE theme is
   chosen by the `data-brand` attribute on <html>. The kit ships ONE theme, the neutral `raha` (the bare `:root`,
   used when no attribute is set); a system defines its own as a `[data-brand="x"]` block in its own stylesheet
   (docs/CONSUMING.md §4). Recolouring a whole system is one attribute value, or an edit inside one theme block.

   CONTRAST is a property of a PAIR: a light primary fails strict AA with a white label, a dark one passes with room.
   ACCENT-3 is the dark-mode primary ink: it must read on the #1E1E1E ground, not on white. ACCENT-2 is the
   gradient's readable hold on white. A theme is checked against those two pairs before it ships.

   The derived `--brand-*-rgb` triples below each theme are the TEMPLATE's own ratios pre-computed as
   bare triples, because `rgba(var(--x-rgb), a)` needs a triple and CSS cannot mix a colour into one.
   They live inside the theme block so a swap carries them too — vendor-overrides.css reads them by
   name instead of hard-coding a navy triple. The next screen needing a brand colour takes it from the
   active theme's tokens, never eyedropped off a logo (which is how #021029 was once wrongly proposed). */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-family-brand: "Vazirmatn", sans-serif;
  /* The wordmark's gradient, from the theme's three accents. */
  --grad-wordmark: linear-gradient(135deg, var(--brand-accent-3) 0%, var(--brand-accent-2) 45%, var(--brand-accent-1) 100%);
}

/* DARK: the dark end of the gradient is unreadable on the dark header, so
   the wordmark falls to the brand accents that read on #1E1E1E (the theme's accent-3). Light is
   untouched. */
[data-theme="dark"] {
  --grad-wordmark: linear-gradient(135deg, var(--brand-accent-3) 0%, var(--brand-accent-2) 100%);
}

/* THE ACTIVE THEME. A theme is a set of `--brand-*` variables; the bare `:root` is the kit's own neutral theme,
   `raha`, and `<html data-brand="x">` selects a system's own block (docs/CONSUMING.md §4). Each block is
   self-contained: base colours, the rgb triples for rgba(), and the ratios CSS cannot derive with color-mix —
   so a theme carries them all and no component reads one theme's colour by name. */
:root {
  --brand-primary: #2563EB;
  --brand-primary-rgb: 37, 99, 235;
  --brand-accent-1: #1D4ED8;
  --brand-accent-2: #1E40AF;
  --brand-accent-2-rgb: 30, 64, 175;
  --brand-accent-3: #60A5FA;
  --brand-accent-3-rgb: 96, 165, 250;
  --brand-danger: #DC2626;
  --brand-danger-rgb: 220, 38, 38;
  --brand-info: #0EA5E9;
  --brand-info-rgb: 14, 165, 233;
  --brand-secondary: #475569;
  --brand-secondary-rgb: 71, 85, 105;
  --brand-warning: #D97706;
  --brand-warning-rgb: 217, 119, 6;
  /* The sign-in page's illustration: a system sets its own `url(...)`. */
  --brand-auth-art: none;
  /* Dashboard / chart brand ramp — theme-scoped, so a theme change reaches the charts too. */
  --raha-brand-primary: #2563EB;
  --raha-brand-primary-rgb: 37, 99, 235;
  --raha-primary-soft: #93C5FD;
  --raha-brand: #1D4ED8;
  --raha-bar-g1: #2563EB;
  --raha-rev-g1: #60A5FA;
  --raha-rev-g2: #2563EB;
  --raha-rev-g3: #1E40AF;
  --raha-chart-violet: #1D4ED8;
  --raha-chart-ink: #0F172A;
  --raha-chart-lilac: #BFDBFE;
  /* primary 80%+black · 60%+white · 48%+white · 85%+white — the ratios §3/§5 apply to the primary. */
  --brand-link-hover-rgb: 29, 78, 216;
  --brand-dark-link-rgb: 147, 197, 253;
  --brand-dark-link-hover-rgb: 191, 219, 254;
  --brand-focus-shadow-rgb: 59, 130, 246;
}

:root {

  /* Dashboard / charts palette; a system's charts read these at runtime. The BRAND ramp (primary/soft/brand/bar/rev stops +
     chart-violet/ink/lilac) moved INTO the theme blocks above, so a theme change reaches the dashboard too
     (client «بنفش هم تغییر کنه»). What stays here is theme-invariant; danger/warning follow the theme. */
  --raha-brand-success: #009966;
  --raha-success-soft: #e6f5ef;
  --raha-brand-danger: var(--brand-danger);
  --raha-danger-soft: #fff3f3;
  --raha-brand-warning: var(--brand-warning);
  --raha-warning-soft: #fef6e7;
  --raha-warning-ink: #a4700f;
  --raha-heading: #0C243C;
  --raha-brand-body: #696981;
  --raha-muted: #97A1C0;
  /* Surface neutrals — a faint azure gray (r<g<b), subtle, not the template's cold slate. */
  --raha-border: #E6EEF5;
  --raha-page: #FDFDFF;
  --raha-track: #EAF1F7;
  --raha-grid: #EDF3F9;
  --raha-dots: #BFCDD9;
  --raha-soft-bg: #F1F6FB;
  --raha-soft-bg-2: #EFF5FA;
  --raha-soft-bg-fixed: #F1F6FB;
  --raha-soft-bg-2-fixed: #EFF5FA;
  --raha-neutral-bg: #EEF4FA;
  --raha-mix-with: #5aa47c;
  --raha-mix-without: #d9695f;
  --raha-dadrasi-open: #5a99cc;
  --raha-chart-teal: #4ABF9A;
  --raha-radius: .375rem;
  --raha-card-radius: .625rem;
  --raha-shadow: 0 5px 10px rgba(2, 2, 76, .02);
  --raha-shadow-lg: 0 12px 28px rgba(2, 2, 76, .10);
}

/* The soft grounds are light tints, and the dark theme never redefined them, so every pinned header, total and
   segment track stayed pale on a dark page. Same specificity as the theme block above, so source order wins.
   The dashboard has no dark theme yet and reads the `-fixed` pair, which never flips. */
:root[data-theme="dark"] {
  --raha-soft-bg: var(--raha-tertiary-bg);
  --raha-soft-bg-2: var(--raha-tertiary-bg);
}

:root {
  /* Spacing — compact ramp in 2px units. It stops at 24px on purpose: with no 32/40 step defined,
     no screen can reach for a roomier one without changing this file. */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 12px;
  --space-6: 16px;
  --space-7: 24px;

  /* Control heights come from the TEMPLATE's own size variants — the 24/28/32px tokens that stood
     here were retired on 2026-08-26: deriving boxes smaller than the archive draws is what put a 24px
     button beside a 38.8px input on the register toolbar. D31 means choosing the template's small
     VARIANT, and the variant already has a height. */
  --control-pad-inline: var(--space-5);

  /* Tables — dense rows. */
  --table-row-h: 28px;
  --table-cell-pad-block: var(--space-2);
  --table-cell-pad-inline: var(--space-5);

  /* Type — md is the body default. */
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-md: 13px;
  --font-size-lg: 15px;
  --font-size-xl: 18px;
  --line-height-tight: 1.35;

  /* Icons — The measured sizes: glyph px and the square button that carries it. */
  --icon-size-menu: 22px;
  --icon-size-header: 18px;
  --icon-size-tool: 16px;
  --icon-box-header: 32px;
  --icon-box-tool: 30px;
  --icon-size-row: 14px;
  --icon-box-row: 18px;
  --icon-size-sort: 11px;
  --icon-size-text-btn: 15px;
  --icon-box-text-btn-h: 31px;
  /* The filter chip, measured 28.6px. The ONE button-height exception besides `.btn-icon`:
     a chip is not a control box of the template's scale, and the template's -sm button drew 37px beside the chip's 28.6. */
  --chip-box: 28.6px;

  /* The loading skeleton: a soft silver bar with a lighter sheen passing over it, both read off the theme's own ink and ground. */
  --raha-skeleton-base: color-mix(in srgb, var(--raha-body-color) 10%, var(--raha-body-bg));
  --raha-skeleton-sheen: color-mix(in srgb, var(--raha-body-color) 3%, var(--raha-body-bg));

  /* The self-hosted Persian face, reached through the template's own property, which
     vendor-overrides.css re-points at --font-family-brand above. Still no CDN (FE-023). */
  --font-family-base: var(--raha-body-font-family);

  /* Colour — aliases into the raha palette. Nothing here is a value. */
  --color-primary: var(--raha-primary);
  --color-on-primary: var(--raha-white);
  --color-surface: var(--raha-body-bg);
  --color-surface-sunken: var(--custom-body-bg);
  --color-surface-sidebar: var(--app-sidebar-bg);
  --color-surface-header: var(--app-header-bg);
  --color-text: var(--raha-body-color);
  --color-text-strong: var(--raha-emphasis-color);
  --color-text-muted: var(--raha-secondary-color);
  --color-border: var(--raha-border-color);
  --color-success: var(--raha-success);
  --color-warning: var(--raha-warning);
  --color-danger: var(--raha-danger);
  --color-info: var(--raha-info);

  --radius-sm: 3px;
  --border-w: 1px;

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 240ms;
  --motion-press: 150ms;

  /* Easing. The built-in curves are too weak for UI; these are the strong curves the motion bar
     asks for (from easing.dev, never hand-rolled). --ease-out for enter/exit, --ease-in-out for
     on-screen movement, --ease-drawer for iOS-like sheets. Consumers replace `ease-in-out` literals. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
/* In the dark the sheen is the lighter of the two. */
[data-theme=dark] {
  --raha-skeleton-base: color-mix(in srgb, var(--raha-body-color) 14%, var(--raha-body-bg));
  --raha-skeleton-sheen: color-mix(in srgb, var(--raha-body-color) 26%, var(--raha-body-bg));
}




/* ---- 3. the vendor overrides' root rules ---- */

:root {
  --raha-body-font-size: var(--font-size-md);
  --raha-body-line-height: var(--line-height-tight);
}

:root {
  --raha-body-font-family: var(--font-family-brand);
}

:root {
  --raha-primary: var(--brand-primary);
  --raha-primary-rgb: var(--brand-primary-rgb);
  --raha-primary-bg-subtle: color-mix(in srgb, var(--raha-primary) 6%, white);
  --raha-primary-border-subtle: color-mix(in srgb, var(--raha-primary) 25%, white);
  --raha-primary-text-emphasis: color-mix(in srgb, var(--raha-primary) 40%, black);
  --raha-link-color: var(--raha-primary);
  --raha-link-color-rgb: var(--brand-primary-rgb);
  --raha-link-hover-color: color-mix(in srgb, var(--raha-primary) 80%, black);
  --raha-link-hover-color-rgb: var(--brand-link-hover-rgb);
  --raha-btn-primary-hover: color-mix(in srgb, var(--raha-primary) 90%, black);
  --raha-btn-primary-border-hover: color-mix(in srgb, var(--raha-primary) 88%, black);
  --raha-btn-primary-active: color-mix(in srgb, var(--raha-primary) 88%, black);
  --raha-danger: var(--brand-danger);
  --raha-danger-rgb: var(--brand-danger-rgb);
  --raha-danger-bg-subtle: color-mix(in srgb, var(--raha-danger) 6%, white);
  --raha-danger-border-subtle: color-mix(in srgb, var(--raha-danger) 25%, white);
  --raha-danger-text-emphasis: color-mix(in srgb, var(--raha-danger) 40%, black);
  --raha-info: var(--brand-info);
  --raha-info-rgb: var(--brand-info-rgb);
  --raha-info-bg-subtle: color-mix(in srgb, var(--raha-info) 6%, white);
  --raha-info-border-subtle: color-mix(in srgb, var(--raha-info) 25%, white);
  --raha-info-text-emphasis: color-mix(in srgb, var(--raha-info) 40%, black);
  --raha-secondary: var(--brand-secondary);
  --raha-secondary-rgb: var(--brand-secondary-rgb);
  --raha-secondary-bg-subtle: color-mix(in srgb, var(--raha-secondary) 8%, white);
  --raha-secondary-border-subtle: color-mix(in srgb, var(--raha-secondary) 25%, white);
  --raha-secondary-text-emphasis: color-mix(in srgb, var(--raha-secondary) 40%, black);
  --raha-warning: var(--brand-warning);
  --raha-warning-rgb: var(--brand-warning-rgb);
  --raha-warning-bg-subtle: color-mix(in srgb, var(--raha-warning) 10%, white);
  --raha-warning-border-subtle: color-mix(in srgb, var(--raha-warning) 30%, white);
  --raha-warning-text-emphasis: color-mix(in srgb, var(--raha-warning) 55%, black);
}

[data-theme="dark"] {
  --raha-body-color: var(--raha-white);
  --raha-body-color-rgb: 255, 255, 255;
  --raha-heading-color: var(--raha-white);
  --raha-secondary-color: color-mix(in srgb, var(--raha-white) 75%, transparent);
  --raha-tertiary-color: color-mix(in srgb, var(--raha-white) 50%, transparent);
  --raha-primary-border-subtle: color-mix(in srgb, var(--raha-primary) 60%, black);
  --raha-primary-text-emphasis: color-mix(in srgb, var(--raha-primary) 60%, white);
  --raha-link-color: color-mix(in srgb, var(--raha-primary) 60%, white);
  --raha-link-color-rgb: var(--brand-dark-link-rgb);
  --raha-link-hover-color: color-mix(in srgb, var(--raha-primary) 48%, white);
  --raha-link-hover-color-rgb: var(--brand-dark-link-hover-rgb);
}

html[data-theme="dark"], body[data-theme="dark"] {
  --raha-info-bg-subtle: color-mix(in srgb, var(--raha-info) 14%, black);
  --raha-info-border-subtle: color-mix(in srgb, var(--raha-info) 60%, black);
  --raha-info-text-emphasis: color-mix(in srgb, var(--raha-info) 60%, white);
  --raha-warning-text-emphasis: color-mix(in srgb, var(--raha-warning) 60%, white);
}

:root {
  --raha-focus-ring-color: color-mix(in srgb, var(--raha-primary) 25%, transparent);
}

:root {
  --app-rail: 48px;
  --app-menubar-tabs: calc(var(--app-rail) + 163px);
}

:root[data-app-sidebar="mini"] {
  --app-menubar-tabs: var(--app-rail);
}

/* THIN SCROLLBARS in the theme's own ink, both themes: the browser's default is thick, arrowed and follows the OS. The sideways
   scroller of a table (`data-dt-scroll`) keeps its drawn bar — a non-auto `scrollbar-*` would switch ::-webkit-scrollbar off. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--raha-secondary-color) transparent;
}
[data-dt-scroll] {
  scrollbar-width: auto;
  scrollbar-color: auto;
}
