/* D5 CRM — design tokens v1 (25.10.2026)
   Source of truth: Design System "D5 CRM — дизайн-система" (tokens.json).
   Rule: components use only var(--…); no hex colours and no !important outside this file.
   Fonts: Golos Text (400/500/600) and JetBrains Mono (400) woff2 files live in static/fonts/
   (OFL licence) — @font-face is at the end of this file. */

:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-sunken: #f8f9f6;
  --surface-hover: #edf0ea;
  --line: #e0e4dc;
  --line-strong: #838d85;
  --ink: #17201b;
  --ink-muted: #58635b;
  --ink-subtle: #6b756d;
  --brand: #0e5641;
  --brand-hover: #0a4333;
  --brand-soft: #e2eee7;
  --brand-ink: #0b4a37;
  --on-brand: #ffffff;
  --accent: #b08a3e;
  --accent-soft: #f6eedd;
  --accent-ink: #6d5220;
  --focus: #0e5641;
  --info: #2b4f8e;
  --info-soft: #e8eef8;
  --success: #2b7a45;
  --success-soft: #e4f2e7;
  --warning: #8a5300;
  --warning-soft: #fcefd6;
  --danger: #a3263d;
  --danger-soft: #fae8eb;
  --on-danger: #ffffff;
  --sidebar: #fbfbf9;
  --sidebar-hover: #edf0ea;
  --sidebar-active: #e2eee7;
  --sidebar-active-ink: #0b4a37;
  --sidebar-ink: #46514a;
  --sidebar-ink-strong: #17201b;
  --brand-mark: #e32e28;
  --overlay: rgba(23, 32, 27, 0.42);
  --shadow-1: 0 1px 2px rgba(15, 43, 38, 0.06);
  --shadow-2: 0 6px 20px rgba(15, 43, 38, 0.12);
  --shadow-3: 0 18px 48px rgba(15, 43, 38, 0.22);

  /* Spacing (4px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;

  /* Sizes */
  --control-sm: 32px;
  --control: 36px;
  --control-touch: 44px;
  --row: 44px;
  --topbar: 56px;
  --sidebar-w: 240px;
  --content-max: 1200px;
  --control-h: var(--control);

  /* Layers */
  --z-sticky: 10;
  --z-dropdown: 20;
  --z-drawer: 30;
  --z-modal: 40;
  --z-toast: 50;

  /* Typography */
  --font-sans: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;
  --text-page-title: 600 24px/30px var(--font-sans);
  --text-section-title: 600 18px/24px var(--font-sans);
  --text-card-title: 600 15px/20px var(--font-sans);
  --text-body: 400 14px/20px var(--font-sans);
  --text-body-strong: 500 14px/20px var(--font-sans);
  --text-small: 400 13px/18px var(--font-sans);
  --text-label: 500 12px/16px var(--font-sans);
  --text-amount: 600 22px/28px var(--font-sans);
  --text-code: 400 13px/18px var(--font-mono);
  --tracking-label: 0.04em;

  /* Motion */
  --duration-fast: 120ms;
  --duration: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* The customer's weekly report (objects/report_sheet.html): palette «Мох и латунь», approved by Niki 01.11.2026.
     A printed document, so it has no dark variant. */
  --rp-desk: #e5e3df;
  --rp-plaster: #eeeeea;
  --rp-surface: #fcfcfa;
  --rp-white: #ffffff;
  --rp-ink: #22282a;
  --rp-ink-2: #4e5653;
  --rp-mute: #8a918d;
  --rp-line: #e3e6e2;
  --rp-moss: #3f5a4b;
  --rp-moss-2: #6a8676;
  --rp-mist: #d3ddd6;
  --rp-mist-2: #e7ede9;
  --rp-mist-edge: #c3ccc6;
  --rp-oak: #a9874f;
  --rp-oak-soft: #f3ecdd;
  --rp-tick: #b8c3bc;
  --rp-ask-a: #e0e9e3;
  --rp-ask-b: #d6e1da;
  --rp-bar: #3a4240;
  --rp-glow: #ffffff8c;
  --rp-glass: rgba(250, 251, 249, 0.8);
  --rp-shade: rgba(30, 40, 35, 0.12);
  --rp-raise: 0 1px 1px rgba(30, 40, 35, 0.06), 0 4px 10px -4px rgba(30, 40, 35, 0.1), 0 22px 40px -18px rgba(30, 40, 35, 0.28);
  --rp-rest: 0 1px 0 rgba(30, 40, 35, 0.05), 0 8px 22px -14px rgba(30, 40, 35, 0.22);
  --rp-node: 0 6px 12px -6px rgba(30, 35, 40, 0.55);
  --rp-paper: 0 1px 2px rgba(0, 0, 0, 0.08), 0 16px 44px rgba(0, 0, 0, 0.12);
  --font-report: "Commissioner", "Helvetica Neue", Arial, sans-serif;

  /* Breakpoints (for reference; CSS vars cannot be used inside @media):
     phone < 768px · tablet 768–1199px · desktop ≥ 1200px */
}

/* The design project's weekly report (customer_report_design.py): palette «Терракота и латунь», approved by Niki
   02.11.2026; the report's tokens of «Мох и латунь» are redefined on the sheets of a design report. */
.rp-terra {
  --rp-plaster: #efebe8;
  --rp-surface: #fdfcfb;
  --rp-ink: #2b2522;
  --rp-ink-2: #5a504b;
  --rp-mute: #958b85;
  --rp-line: #e9e2dd;
  --rp-moss: #a5533a;
  --rp-moss-2: #c98266;
  --rp-mist: #ecd8ce;
  --rp-mist-2: #f5ebe6;
  --rp-mist-edge: #ddc8bd;
  --rp-oak: #97803f;
  --rp-oak-soft: #f1ecdc;
  --rp-tick: #d2c1b8;
  --rp-ask-a: #f6e6de;
  --rp-ask-b: #f0dbd0;
  --rp-bar: #3b3330;
  --rp-shade: rgba(50, 35, 28, 0.12);
  --rp-raise: 0 1px 1px rgba(50, 35, 28, 0.06), 0 4px 10px -4px rgba(50, 35, 28, 0.1), 0 22px 40px -18px rgba(50, 35, 28, 0.28);
  --rp-rest: 0 1px 0 rgba(50, 35, 28, 0.05), 0 8px 22px -14px rgba(50, 35, 28, 0.22);
}

/* Phone: larger tap targets and text */
@media (max-width: 767px) {
  :root {
    --control-h: var(--control-touch);
    --text-page-title: 600 20px/26px var(--font-sans);
    --text-body: 400 15px/22px var(--font-sans);
    --text-body-strong: 500 15px/22px var(--font-sans);
  }
}

/* Dark theme: data-theme="dark" on <html>, or system setting when no choice is stored */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101412;
  --surface: #171d1a;
  --surface-sunken: #131815;
  --surface-hover: #1f2722;
  --line: #2a332e;
  --line-strong: #5d6a62;
  --ink: #e8ede9;
  --ink-muted: #a3afa7;
  --ink-subtle: #8d9991;
  --brand: #58c29b;
  --brand-hover: #77d2b0;
  --brand-soft: #14352a;
  --brand-ink: #8be0bf;
  --on-brand: #062218;
  --accent: #d9b56b;
  --accent-soft: #33290f;
  --accent-ink: #e8cb8c;
  --focus: #8be0bf;
  --info: #8fb3ef;
  --info-soft: #15233b;
  --success: #79cf92;
  --success-soft: #13301c;
  --warning: #f2bb57;
  --warning-soft: #35270b;
  --danger: #f2909f;
  --danger-soft: #3b1219;
  --on-danger: #2a060d;
  --sidebar: #131815;
  --sidebar-hover: #1f2722;
  --sidebar-active: #14352a;
  --sidebar-active-ink: #8be0bf;
  --sidebar-ink: #b3beb7;
  --sidebar-ink-strong: #ffffff;
  --brand-mark: #ef4a43;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #101412;
    --surface: #171d1a;
    --surface-sunken: #131815;
    --surface-hover: #1f2722;
    --line: #2a332e;
    --line-strong: #5d6a62;
    --ink: #e8ede9;
    --ink-muted: #a3afa7;
    --ink-subtle: #8d9991;
    --brand: #58c29b;
    --brand-hover: #77d2b0;
    --brand-soft: #14352a;
    --brand-ink: #8be0bf;
    --on-brand: #062218;
    --accent: #d9b56b;
    --accent-soft: #33290f;
    --accent-ink: #e8cb8c;
    --focus: #8be0bf;
    --info: #8fb3ef;
    --info-soft: #15233b;
    --success: #79cf92;
    --success-soft: #13301c;
    --warning: #f2bb57;
    --warning-soft: #35270b;
    --danger: #f2909f;
    --danger-soft: #3b1219;
    --on-danger: #2a060d;
    --sidebar: #131815;
    --sidebar-hover: #1f2722;
    --sidebar-active: #14352a;
    --sidebar-active-ink: #8be0bf;
    --sidebar-ink: #b3beb7;
    --sidebar-ink-strong: #ffffff;
    --brand-mark: #ef4a43;
    --overlay: rgba(0, 0, 0, 0.6);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 6px 20px rgba(0, 0, 0, 0.5);
    --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration: 0ms; }
}

/* Fonts are served from static/fonts/ (Fontsource builds, OFL licence; see OFL-*.txt).
   Each weight is split into latin / latin-ext (₽ sign) / cyrillic files; the browser
   downloads only the ranges a page uses. */
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-cyrillic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; src: url("../fonts/golos-text-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* Commissioner (200–600) only for the customer's weekly report; OFL licence in OFL-Commissioner.txt. */
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-200-normal.woff2") format("woff2"); font-weight: 200; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-ext-200-normal.woff2") format("woff2"); font-weight: 200; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-cyrillic-200-normal.woff2") format("woff2"); font-weight: 200; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-ext-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-cyrillic-300-normal.woff2") format("woff2"); font-weight: 300; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-cyrillic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Commissioner"; src: url("../fonts/commissioner-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
