/* =========================================================================
   LiftCapital · демо дизайна · assets/styles.css · v2 «Диспетчерская» · v4.1 цвет версии 1
   -------------------------------------------------------------------------
   Один файл на все страницы: токены, каркас, компоненты.
   Страницы кабинетов этот файл НЕ редактируют. Локальные стили страницы:
   <style> в <head>, все селекторы под .page-<имя>, не более 150 строк.
   Нужен новый общий компонент: описать в NOTES.md (добавит финальный проход).

   v2: тёплая бумага, навы для структуры и действия, «сигнальный синий» для
   живого и интерактивного; Golos Text / Geologica / Geist Mono; каркас
   «панель слева .rail + контекстная полоса .context-bar»; индикатор этапов
   «шахта». Все классы и переменные v1 сохранены: новые добавлены, старые
   не удалены (устаревшие помечены DEPRECATED и работают как алиасы).

   v4.1 (24 окт): цвет версии 1 — один акцент индиго #3350CD (primary = accent),
   холодная нейтраль (#F4F6FA), белая панель навигации с правой кромкой, тона
   статусов, графики, тени и фокус v1; знак — ромб из точек (логотип Lift Capital),
   полный логотип #i-logo. Шкалы --navy-* и --signal-* стали алиасами --indigo-*.

    0  Tokens                          9  Table & toolbar
    1  Reset & base                   10  Pills, priority, tags, counts, badges, SLA
    2  Typography & utilities         11  Stage indicator «шахта» (наряд, 6 этапов)
    3  Icons & brand mark             12  Overlays: drawer, modal, toast, dropdown, tooltip
    4  App shell: rail, context bar,  13  Data display
       page (+ deprecated topbar)     14  Mobile: phone frame, header, tab bar
    5  Buttons                        15  Responsive
    6  Form controls                  16  Motion & accessibility
    7  Tabs & segmented               17  v3: night mode, cabin, lamp, loader,
    8  Cards, hero, KPI, exceptions       illustrations, schematic, «Здание»,
                                          palette, notifications, shortcuts,
                                          table density, toasts
                                      18  v4: record drawer (LC.show), list page
                                          (LC.listPage), «Новое обращение»

   v3 (24 окт): ночной режим html[data-theme="dark"] переопределяет только
   смысловые токены (блок сразу после :root); компоненты v2, которые брали
   сырые шаги палитры (--navy-50, --gray-300…), переведены на новые смысловые
   токены с теми же значениями в светлой теме — светлая тема не изменилась.
   ========================================================================= */


/* =========================================================================
   0. TOKENS
   Цвета только через переменные: тёмная тема = переопределение блока
   «Semantic» под [data-theme="dark"], компоненты не меняются.
   Контраст проверен скриптом (README «Контраст»): все пары текст/фон ≥ 4.5:1.
   ========================================================================= */
/* .theme-light / .theme-dark — «островки» темы для витрины (светлое и ночное рядом);
   страницы их не используют, тему всей страницы задаёт html[data-theme]. */
:root, .theme-light {
  color-scheme: light;

  /* --- Palette: индиго «Lift Indigo» (OKLCH h268) — цвет версии 1 --- */
  --indigo-50:  #F3F7FF;   /* выбранная строка, подложка info, активный пункт панели */
  --indigo-100: #E3EDFF;   /* аватар, выделение */
  --indigo-200: #C9DAFF;   /* рамка info */
  --indigo-300: #A2BDFF;   /* на тёмном: ссылки, текст индиго */
  --indigo-400: #7495F8;   /* на тёмном: знак */
  --indigo-500: #4D70E8;   /* фокус рамки поля */
  --indigo-600: #3350CD;   /* primary и accent: кнопки, ссылки, активный пункт, знак; белый 7.2:1, на белом 7.2:1 */
  --indigo-700: #273FAE;   /* hover, текст info и индиго на подложках */
  --indigo-800: #1D3189;   /* нажатие, штрих чертежа и иллюстраций */
  --indigo-900: #152461;   /* тёмный край порядковой шкалы */

  /* --- Palette: холодный серый с каплей индиго (OKLCH h268) — цвет версии 1 --- */
  --gray-0:   #FFFFFF;
  --gray-25:  #FAFBFD;   /* bg-subtle */
  --gray-50:  #F4F6FA;   /* bg-page */
  --gray-100: #EDEFF5;   /* bg-muted, bg-hover */
  --gray-150: #E7E9F0;   /* border-subtle */
  --gray-200: #E0E3EA;   /* border */
  --gray-300: #D0D4DE;   /* выключенный переключатель, ось графика */
  --gray-400: #A4A9B5;   /* рамка полей при наведении, неактивный текст */
  --gray-500: #828895;   /* точка neutral, placeholder */
  --gray-600: #676D7B;   /* text-3: 5.2:1 на белом, 4.7:1 на странице */
  --gray-700: #4E5462;   /* text-2: 7.6:1 */
  --gray-800: #303541;
  --gray-900: #151923;   /* text-1: 17.6:1 */
  --gray-950: #0B0E16;

  /* DEPRECATED (v2–v3): шкалы «навы» и «сигнальный» → алиасы на индиго. Новые стили: --indigo-* и смысловые токены */
  --navy-50: var(--indigo-50);   --navy-100: var(--indigo-100); --navy-200: var(--indigo-200); --navy-300: var(--indigo-300); --navy-400: var(--indigo-400);
  --navy-500: var(--indigo-500); --navy-600: var(--indigo-600); --navy-700: var(--indigo-700); --navy-800: var(--indigo-800); --navy-900: var(--indigo-900);
  --signal-50: var(--indigo-50);   --signal-100: var(--indigo-100); --signal-200: var(--indigo-200); --signal-300: var(--indigo-300); --signal-400: var(--indigo-400);
  --signal-500: var(--indigo-500); --signal-600: var(--indigo-600); --signal-700: var(--indigo-700); --signal-800: var(--indigo-800); --signal-900: var(--indigo-900);

  /* --- Palette: тона статусов (только смысл) — значения версии 1 --- */
  --red-50: #FFF2F1;    --red-100: #FFE4E0;    --red-200: #FDCBC5;
  --red-500: #E64340;   --red-600: #D0252A;    --red-700: #B32325;    --red-800: #901E1F;
  --orange-50: #FFF3EB; --orange-100: #FFE6D6; --orange-200: #FFCFB6;
  --orange-500: #F0772D;--orange-600: #E66B14; --orange-700: #A74A04; --orange-800: #863D0D;
  --amber-50: #FFF6E2;  --amber-100: #FFECC4;  --amber-200: #FDD89E;
  --amber-500: #F2AB19; --amber-600: #DE9B00;  --amber-700: #855C01;  --amber-800: #6D4B04;
  --green-50: #EAFBEE;  --green-100: #D7F6DF;  --green-200: #B7E7C4;
  --green-500: #32AC64; --green-600: #1F9F58;  --green-700: #17713E;  --green-800: #135C32;
  --teal-50: #E7FAF9;   --teal-100: #D3F5F2;   --teal-200: #B2E5E1;
  --teal-500: #28A6A0;  --teal-600: #0E9A94;   --teal-700: #006D68;   --teal-800: #005A56;

  /* --- Semantic: surfaces --- */
  --bg-page: var(--gray-50);
  --bg-surface: var(--gray-0);
  --bg-subtle: var(--gray-25);
  --bg-muted: var(--gray-100);
  --bg-hover: var(--gray-100);
  --bg-row-hover: #F6F7FB;
  --bg-selected: var(--indigo-50);
  --bg-inverse: var(--gray-900);         /* тост, подсказка */
  --bg-backdrop: rgb(21 25 35 / .32);

  /* --- Semantic: borders --- */
  --border: var(--gray-200);
  --border-subtle: var(--gray-150);
  --border-strong: #C5CAD5;              /* поля, вторичные кнопки */
  --border-focus: var(--indigo-500);

  /* --- Semantic: text --- */
  --text-1: var(--gray-900);
  --text-2: var(--gray-700);
  --text-3: var(--gray-600);
  --text-placeholder: #6C727F;           /* 4.8:1 на белом, 4.7:1 на bg-subtle (правило v2 сохранено) */
  --text-disabled: var(--gray-400);      /* неактивное: исключение WCAG */
  --text-inverse: var(--gray-0);
  --text-link: var(--indigo-600);
  --text-link-hover: var(--indigo-700);

  /* --- Semantic: primary — главные кнопки, активный пункт; в v1 это тот же индиго, что и accent --- */
  --primary: var(--indigo-600);
  --primary-hover: var(--indigo-700);
  --primary-active: var(--indigo-800);
  --on-primary: var(--gray-0);

  /* --- Semantic: accent — ссылки, фокус, выбранное, текущий этап, таймер --- */
  --accent: var(--indigo-600);
  --accent-hover: var(--indigo-700);
  --accent-active: var(--indigo-800);
  --accent-fg: var(--indigo-700);
  --accent-subtle: var(--indigo-50);
  --accent-soft: var(--indigo-100);
  --accent-border: var(--indigo-200);
  --on-accent: var(--gray-0);

  /* --- Semantic: rail — светлая панель навигации, как шапка v1: белая, активный пункт на индиго-50 --- */
  --rail-bg: var(--bg-surface);
  --rail-fg: var(--text-2);              /* 7.6:1 */
  --rail-fg-active: var(--accent-fg);    /* 8.2:1 на indigo-50 */
  --rail-item-hover: var(--bg-hover);
  --rail-item-active: var(--accent-subtle);
  --rail-divider: var(--border);         /* правая кромка панели и разделитель подвала */
  --rail-focus: var(--accent);

  /* --- Semantic: brand mark — ромб из точек (логотип Lift Capital), цветом индиго --- */
  --brand-square: var(--indigo-600);     /* знак и логотип на светлом */
  --brand-rail: var(--indigo-600);       /* знак на панели */
  --brand-ink: var(--gray-0);            /* DEPRECATED (v2): шахта и кабина прежнего знака */
  --brand-lamp: currentColor;            /* верхняя точка знака = сигнальная лампа; обычно не отличается от знака */
  --brand-lamp-on-dark: currentColor;

  /* --- Semantic: status tones (solid = точка/иконка/заливка, fg = текст, bg = подложка) — значения v1 --- */
  --info-solid: var(--indigo-600);     --info-fg: var(--indigo-700);
  --info-bg: var(--indigo-50);         --info-border: var(--indigo-200);
  --warning-solid: var(--amber-500);   --warning-fg: var(--amber-700);   /* v4.2: один «жёлтый» — ждёт внимания (в v1–v4.1 оранжевый) */
  --warning-bg: var(--amber-50);       --warning-border: var(--amber-200);
  --progress-solid: var(--warning-solid); --progress-fg: var(--warning-fg); /* v4.2: progress = псевдоним warning */
  --progress-bg: var(--warning-bg);    --progress-border: var(--warning-border);
  --danger-solid: var(--red-600);      --danger-fg: var(--red-700);
  --danger-bg: var(--red-50);          --danger-border: var(--red-200);
  --danger-row: #FFF7F6;               /* заливка строки «люди в кабине» */
  --success-solid: var(--green-600);   --success-fg: var(--green-700);
  --success-bg: var(--green-50);       --success-border: var(--green-200);
  --planned-solid: var(--teal-600);    --planned-fg: var(--teal-700);
  --planned-bg: var(--teal-50);        --planned-border: var(--teal-200);
  --neutral-solid: var(--gray-500);    --neutral-fg: var(--gray-700);
  --neutral-bg: var(--gray-100);       --neutral-border: var(--gray-200);

  /* --- Charts: палитра v1, порядок фиксирован (валидатор навыка dataviz на белом:
         соседние пары CVD ΔE ≥ 9.1, обычное зрение ΔE ≥ 19.6; слоты 1–3 различимы
         в любых парах). План/факт = --chart-muted + --chart-1. --- */
  --chart-1: var(--indigo-600);
  --chart-2: #EB6834;
  --chart-3: #1BAF7A;
  --chart-4: #EDA100;
  --chart-5: #E87BA4;
  --chart-6: #008300;
  --chart-7: #6250D6;
  --chart-8: #E34948;
  --chart-muted: #C5CAD5;
  --chart-grid: var(--gray-150);
  --chart-axis: var(--gray-300);
  --chart-label: var(--text-3);
  /* Порядковая шкала (приоритет, ступени): шаги индиго, валидатор --ordinal (см. README) */
  --chart-seq-1: var(--indigo-900);
  --chart-seq-2: var(--indigo-700);
  --chart-seq-3: var(--indigo-500);
  --chart-seq-4: var(--indigo-400);

  /* --- Typography: Golos Text — интерфейс, Geologica — заголовки и цифры,
         Geist Mono — номера, коды, таймеры (на 1px меньше окружающего текста).
         Моно по брифу — JetBrains Mono, но в сборке Google Fonts нет 12 из 18 казахских
         букв (Ә Қ Ғ Ң Ұ Һ и строчные); Geist Mono — полное покрытие, та же ширина 0.6em.
         Вернуть JetBrains Mono: эта переменная + параметр family в ссылке шрифтов. --- */
  --font-sans: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Geologica", "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-2xs: 11px;  --lh-2xs: 16px;   /* шапка таблицы (заглавные), подпись на панели */
  --fs-xs: 12px;   --lh-xs: 16px;    /* мелкая подпись, пилюли */
  --fs-sm: 13px;   --lh-sm: 18px;    /* подпись */
  --fs-base: 14px; --lh-base: 20px;  /* текст */
  --fs-md: 15px;   --lh-md: 22px;    /* заголовок карточки (display) */
  --fs-lg: 18px;   --lh-lg: 26px;    /* заголовок раздела (display) */
  --fs-lead: 22px; --lh-lead: 28px;  /* адрес в герой-карточке, заголовок экрана телефона */
  --fs-xl: 26px;   --lh-xl: 32px;    /* заголовок страницы (display) */
  --fs-kpi: 32px;  --lh-kpi: 36px;   /* цифра KPI-плитки (display) */
  --fs-hero: 44px; --lh-hero: 48px;  /* одна главная цифра на экран (display) */
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  --tracking-tight: -0.01em;         /* display-заголовки */
  --tracking-snug: -0.005em;
  --tracking-caps: 0.04em;           /* заглавные подписи */

  /* --- Spacing (4px base) --- */
  --space-0-5: 2px; --space-1: 4px; --space-1-5: 6px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px;  --space-5: 20px; --space-6: 24px; --space-7: 28px; --space-8: 32px;
  --space-10: 40px; --space-12: 48px; --space-16: 64px;

  /* --- Radii --- */
  --radius-xs: 4px;  --radius-sm: 6px;   /* пилюли, приоритет, теги, SLA */
  --radius-md: 10px; /* кнопки, поля, контролы */
  --radius-lg: 14px; /* карточки */
  --radius-xl: 18px; /* modal */ --radius-full: 999px;

  /* --- Shadows: только слои и наведение на кликабельное; холодная основа rgb(21 25 35), значения v1 --- */
  --shadow-xs: 0 1px 2px rgb(21 25 35 / .06);
  --shadow-hover: 0 1px 2px rgb(21 25 35 / .04), 0 8px 20px -6px rgb(21 25 35 / .12);
  --shadow-popover: 0 2px 6px -1px rgb(21 25 35 / .06), 0 12px 32px -8px rgb(21 25 35 / .18);
  --shadow-overlay: 0 24px 64px -12px rgb(21 25 35 / .32);
  --focus-ring: 0 0 0 3px rgb(51 80 205 / .22);
  --focus-ring-danger: 0 0 0 3px rgb(208 37 42 / .18);

  /* --- Controls --- */
  --control-sm: 32px; --control-md: 36px; --control-lg: 44px; --control-xl: 52px;

  /* --- Layout --- */
  --rail-w: 76px;                    /* панель навигации; 60 при ≤ 1024, 0 при ≤ 768 */
  --context-h: 52px;                 /* контекстная полоса */
  --topbar-h: var(--context-h);      /* DEPRECATED имя (v1): липкие шапки таблиц под полосой */
  --container: 1400px;
  --page-pad: 28px;
  --gap: 16px;
  --drawer-w: 560px;
  --modal-w: 560px;

  /* --- Layers --- */
  --z-sticky: 10; --z-topbar: 100; --z-rail: 110; --z-dropdown: 200; --z-overlay: 300;
  --z-modal: 400; --z-toast: 500; --z-tooltip: 600;

  /* --- Motion --- */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 280ms;

  /* --- v3: смысловые токены для мест, где компоненты v2 брали сырые шаги палитры.
         Значения в светлой теме те же, что были; ночной режим переопределяет их ниже. --- */
  --selection-bg: var(--indigo-100);
  --primary-fg: var(--indigo-700);       /* индиго как текст/иконка: таб-бар, номер шага формы */
  --brand-tile-bg: var(--indigo-50);     /* .icon-tile--brand, .form-step__num */
  --brand-tile-fg: var(--indigo-700);
  --brand-soft: var(--indigo-100);       /* аватар */
  --bg-elevated: var(--bg-surface);      /* выпадающее меню, подсказка графика */
  --bg-pressed: var(--gray-150);
  --border-hover: var(--gray-400);       /* рамка поля при наведении, чекбокс */
  --border-disabled: var(--gray-300);
  --danger-solid-hover: var(--red-700);
  --danger-solid-active: var(--red-800);
  --danger-border-strong: var(--red-500);
  --switch-off: var(--gray-300);
  --switch-knob: var(--gray-0);
  --segmented-ring: rgb(21 25 35 / .06);
  --segmented-count-bg: rgb(21 25 35 / .06);
  --prio-bar-off: var(--gray-300);
  --progress-icon: var(--amber-600);
  --info-track: var(--indigo-100);       /* дорожки .progress / .ring */
  --success-track: var(--green-100);
  --warning-track: var(--amber-100);
  --danger-track: var(--red-100);
  --neutral-track: var(--gray-150);
  --stage-done: var(--accent);           /* шахта этапов: пройденные этажи (v1: цвет акцента) */
  --on-stage-done: rgb(255 255 255 / .82);
  --stage-future: var(--border-strong);  /* будущие этажи */
  --stage-complete: var(--success-fg);   /* все этапы пройдены (заливка) */
  --on-stage-complete: var(--gray-0);
  --skeleton-base: var(--gray-100);
  --skeleton-shine: var(--gray-150);
  --star-off: var(--gray-300);
  --photo-bg: var(--gray-300);
  --phone-home: var(--gray-900);
  --grabber: var(--gray-300);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23676D7B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* --- v3: лампа (верхняя точка знака), загрузка, схема объекта, «Здание», иллюстрации-спрайт --- */
  --lamp-critical: var(--red-500);       /* верхняя точка знака при body.has-critical */
  --lamp-critical-on-dark: var(--red-500);  /* на панели: 4.0:1 к белому */
  --loader-ink: var(--indigo-800);       /* .loader--cabin */
  --schematic-ink: var(--indigo-800);    /* штрих чертежа 1.5px */
  --schematic-paper: var(--gray-50);     /* заливка цветом страницы */
  --schematic-white: var(--gray-0);      /* заливка «белый» */
  --schematic-line: rgb(29 49 137 / .32); /* этажи, тонкие линии (indigo-800 32%) */
  --illo-ink: var(--indigo-800);
  --illo-paper: var(--gray-50);
  --illo-white: var(--gray-0);
  --illo-accent: var(--indigo-600);
  --kbd-bg: var(--bg-surface);
  --kbd-border: var(--border-strong);

  /* --- v4.2: лайтбокс фото — тёмная подложка в обеих темах (фото смотрят на тёмном), ночью не переопределяются.
         Контраст к подложке над белой страницей (≈ rgb(26 28 36)): подпись 17:1, «когда и кто» 11.4:1, ссылка 9.1:1 --- */
  --lightbox-bg: rgb(11 14 22 / .94);          /* gray-950, 94 % */
  --lightbox-fg: var(--gray-0);
  --lightbox-fg-2: var(--gray-300);
  --lightbox-link: var(--indigo-300);
  --lightbox-btn: rgb(255 255 255 / .10);      /* круглые кнопки ‹ › × на подложке */
  --lightbox-btn-hover: rgb(255 255 255 / .20);
  --lightbox-focus: var(--indigo-300);
}


/* =========================================================================
   0b. NIGHT MODE — html[data-theme="dark"] (v3; значения v4.1 под индиго)
   Переопределяет только смысловые токены; компоненты не меняются. Значение
   хранит app.js в localStorage «lc-theme», атрибут ставится до первой
   отрисовки (app.js в <head>). Шкалы --indigo-*, --gray-* и тона палитры
   остаются прежними. Нейтраль — графит с каплей индиго, контраст текстовых
   пар ≥ 4.5:1 проверен скриптом (README «Ночной режим»).
   ========================================================================= */
html[data-theme="dark"], .theme-dark {
  color-scheme: dark;

  /* surfaces */
  --bg-page: #0F1218;
  --bg-surface: #161A21;
  --bg-subtle: #1B1F27;
  --bg-muted: #22272F;
  --bg-hover: #22272F;
  --bg-row-hover: #1D2129;
  --bg-selected: #1E2643;
  --bg-elevated: #1D222A;
  --bg-pressed: #2A2F38;
  --bg-inverse: #313949;                 /* тост, подсказка: светлее поверхности */
  --bg-backdrop: rgb(4 6 10 / .62);

  /* borders */
  --border: #31363E;
  --border-subtle: #262A32;
  --border-strong: #4E535C;
  --border-hover: #6C727B;
  --border-disabled: #31363E;
  --border-focus: var(--indigo-500);

  /* text */
  --text-1: #E7EAEE;                     /* 14.5:1 на поверхности */
  --text-2: #C0C4CC;                     /* 10.0:1 */
  --text-3: #A1A6AF;                     /* 7.1:1 на поверхности, 6.1:1 на muted */
  --text-placeholder: #9A9FA7;
  --text-disabled: #656970;
  --text-inverse: var(--gray-0);
  --text-link: var(--indigo-300);        /* 8.6:1 на поверхности */
  --text-link-hover: var(--indigo-200);

  /* primary: главная кнопка светлее поверхности, белый текст ≥ 4.5:1 */
  --primary: #3E5FD6;
  --primary-hover: #3553C4;
  --primary-active: #2E4AB3;
  --on-primary: var(--gray-0);
  --primary-fg: var(--indigo-300);       /* индиго как текст: 8.6:1 */

  /* accent */
  --accent: #5577EE;                     /* фокус, выбранное, текущий этап; 4.4:1 к поверхности */
  --accent-hover: var(--indigo-400);
  --accent-active: var(--indigo-300);
  --accent-fg: var(--indigo-200);
  --accent-subtle: #1B2342;
  --accent-soft: #212C5E;
  --accent-border: #364A99;
  --on-accent: #051027;                  /* тёмный текст на акценте: 4.7:1 */

  /* rail: та же поверхность, что карточки, с правой кромкой */
  --rail-bg: var(--bg-surface);
  --rail-fg: var(--text-2);
  --rail-fg-active: var(--accent-fg);
  --rail-item-hover: var(--bg-hover);
  --rail-item-active: var(--accent-subtle);
  --rail-divider: var(--border);
  --rail-focus: var(--indigo-300);

  /* brand mark */
  --brand-square: var(--indigo-400);
  --brand-rail: var(--indigo-400);
  --brand-lamp: currentColor;
  --brand-lamp-on-dark: currentColor;

  /* status tones: fg на bg ≥ 8:1, fg на поверхности ≥ 10:1, solid ≥ 3:1 к поверхности */
  --info-solid: #5577EE;               --info-fg: #BDCDFF;
  --info-bg: #1C2550;                  --info-border: #34479A;
  --warning-solid: #EFA831;            --warning-fg: #F8C379;      /* v4.2: янтарный вместо оранжевого */
  --warning-bg: #3E2909;               --warning-border: #6E4A0A;
  --progress-solid: var(--warning-solid); --progress-fg: var(--warning-fg);
  --progress-bg: var(--warning-bg);    --progress-border: var(--warning-border);
  --danger-solid: #D2393A;             --danger-fg: #FFB1A9;      /* белый на solid 4.8:1 */
  --danger-bg: #491F1D;                --danger-border: #823834;
  --danger-row: #2F1A18;
  --success-solid: #4BB160;            --success-fg: #9BE2A5;
  --success-bg: #1B351F;               --success-border: #315E39;
  --planned-solid: #2BAEA1;            --planned-fg: #85E1D5;
  --planned-bg: #0C3531;               --planned-border: #115F58;
  --neutral-solid: #858991;            --neutral-fg: #C0C4CC;
  --neutral-bg: #22272F;               --neutral-border: #31363E;

  /* charts: те же восемь тонов, шаги для тёмной поверхности (валидатор dataviz, dark, поверхность #161A21) */
  --chart-1: #5577EE;
  --chart-2: #D95926;
  --chart-3: #199E70;
  --chart-4: #C98500;
  --chart-5: #D55181;
  --chart-6: #008300;
  --chart-7: #9085E9;
  --chart-8: #E66767;
  --chart-muted: #5A606A;
  --chart-grid: #262A32;
  --chart-axis: #4E535C;
  --chart-label: var(--text-3);
  /* порядковая: яркий конец = высокий приоритет */
  --chart-seq-1: var(--indigo-200);
  --chart-seq-2: var(--indigo-300);
  --chart-seq-3: var(--indigo-400);
  --chart-seq-4: #5577EE;

  /* shadows & focus */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / .40);
  --shadow-hover: 0 8px 24px -10px rgb(0 0 0 / .65);
  --shadow-popover: 0 2px 6px -1px rgb(0 0 0 / .40), 0 14px 32px -10px rgb(0 0 0 / .70);
  --shadow-overlay: 0 24px 64px -16px rgb(0 0 0 / .80);
  --focus-ring: 0 0 0 3px rgb(85 119 238 / .38);
  --focus-ring-danger: 0 0 0 3px rgb(210 57 58 / .34);

  /* v3 semantic */
  --selection-bg: #2A3670;
  --brand-tile-bg: #212A4F;
  --brand-tile-fg: #BDCDFF;
  --brand-soft: #2A3360;
  --danger-solid-hover: #B83132;
  --danger-solid-active: #9E2A2B;
  --danger-border-strong: #B4504A;
  --switch-off: #4E535C;
  --switch-knob: #E7EAEE;
  --segmented-ring: rgb(255 255 255 / .06);
  --segmented-count-bg: rgb(255 255 255 / .08);
  --prio-bar-off: #4E535C;
  --progress-icon: #EFA831;
  --info-track: #243068;
  --success-track: #204026;
  --warning-track: #4A3410;
  --danger-track: #5A2523;
  --neutral-track: #31363E;
  --stage-done: #4A64BF;                 /* 3.3:1 к поверхности, белые цифры ≥ 4.5:1 */
  --on-stage-done: var(--gray-0);
  --stage-future: #3C4047;
  --stage-complete: #2E7B3F;             /* белые цифры 5.2:1 */
  --on-stage-complete: var(--gray-0);
  --skeleton-base: #22272F;
  --skeleton-shine: #2A2F38;
  --star-off: #484D56;
  --photo-bg: #3E434B;
  --phone-home: #E7EAEE;
  --grabber: #4E535C;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A6AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --lamp-critical: #E5484D;
  --lamp-critical-on-dark: #E5484D;
  --loader-ink: var(--indigo-300);
  --schematic-ink: #AEBEF2;              /* 10:1 к бумаге ночью */
  --schematic-paper: #171B2C;
  --schematic-white: #202536;
  --schematic-line: rgb(174 190 242 / .28);
  --illo-ink: #AEBEF2;
  --illo-paper: #171B2C;
  --illo-white: #232839;
  --illo-accent: var(--indigo-400);
  --kbd-bg: #1B1F27;
  --kbd-border: #4E535C;
}


/* =========================================================================
   1. RESET & BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
h1 { font-family: var(--font-display); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
h2 { font-family: var(--font-display); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-snug); }
h3 { font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
h4, h5, h6 { font-size: var(--fs-base); line-height: var(--lh-base); font-weight: var(--fw-semibold); }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:not([class]) { color: var(--text-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:not([class]):hover { color: var(--text-link-hover); }
hr { height: 1px; margin: var(--space-4) 0; border: 0; background: var(--border); }
table { border-collapse: collapse; }
code, kbd, samp { font-family: var(--font-mono); font-size: calc(1em - 1px); }
::selection { background: var(--selection-bg); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
html.has-overlay { overflow: hidden; }


/* =========================================================================
   2. TYPOGRAPHY & UTILITIES
   Display (Geologica): страница 26/32, раздел 18/26, карточка 15/22,
   KPI 32/36, главная цифра 44/48. Интерфейс (Golos Text): 14/20, 13/18, 12/16.
   ========================================================================= */
.t-hero    { font-family: var(--font-display); font-size: var(--fs-hero); line-height: var(--lh-hero); font-weight: var(--fw-semibold); letter-spacing: -0.02em; }
.t-kpi     { font-family: var(--font-display); font-size: var(--fs-kpi); line-height: var(--lh-kpi); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.t-page    { font-family: var(--font-display); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.t-lead    { font-family: var(--font-display); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.t-section { font-family: var(--font-display); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-snug); }
.t-card    { font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.t-body    { font-size: var(--fs-base); line-height: var(--lh-base); }
.t-caption { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.t-small   { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.t-caps    { font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-3); }
.t-strong  { font-weight: var(--fw-semibold); }
.t-medium  { font-weight: var(--fw-medium); }
.t-display { font-family: var(--font-display); }

.text-1 { color: var(--text-1); }
.text-2, .muted { color: var(--text-2); }
.text-3, .subtle { color: var(--text-3); }
.text-danger { color: var(--danger-fg); }
.text-success { color: var(--success-fg); }
.text-warning { color: var(--warning-fg); }
.text-accent { color: var(--accent-fg); }

.tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Номера сущностей: SR-2026-000123, WO-…, ACT-…, INV-… — моноширинный, на 1px меньше текста вокруг */
.code, .mono { font-family: var(--font-mono); font-size: calc(1em - 1px); font-weight: var(--fw-regular); letter-spacing: 0; white-space: nowrap; }
.code { color: var(--text-2); }
.link { color: var(--text-link); font-weight: var(--fw-medium); cursor: pointer; }
.link:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.link--muted { color: var(--text-2); }
.link .icon { width: 16px; height: 16px; vertical-align: -3px; }

/* Layout helpers */
.hstack { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.vstack { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.items-start { align-items: flex-start; }
.spacer { flex: 1 1 auto; }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-6 { gap: var(--space-6); }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--space-2); } .mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.w-full { width: 100%; }
.divider { height: 1px; margin: var(--space-4) 0; background: var(--border); border: 0; }
.divider--v { width: 1px; height: 20px; margin: 0 var(--space-1); background: var(--border); flex: none; }


/* =========================================================================
   3. ICONS & BRAND MARK — <svg class="icon"><use href="#i-name"/></svg>
   Спрайт вставляет app.js. 24-unit viewBox, обводка 1.75, без заливки.
   Знак #i-brand и #i-brand-rail: ромб из 25 точек (логотип Lift Capital), currentColor;
   верхняя точка — сигнальная лампа (--brand-lamp). Полный логотип с надписью: #i-logo.
   ========================================================================= */
.icon {
  width: 20px; height: 20px; flex: none;
  display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor;
  stroke-width: var(--icon-stroke, 1.75);
  stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.icon--xs { width: 14px; height: 14px; --icon-stroke: 2.1; }
.icon--sm { width: 16px; height: 16px; --icon-stroke: 2; }
.icon--md { width: 18px; height: 18px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; --icon-stroke: 1.5; }
.icon--fill { fill: currentColor; }

/* Квадрат с иконкой: исключения, файлы, роли */
.icon-tile {
  --tile-bg: var(--neutral-bg); --tile-fg: var(--neutral-fg);
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--tile-bg); color: var(--tile-fg);
}
.icon-tile .icon { width: 18px; height: 18px; }
.icon-tile--lg { width: 40px; height: 40px; border-radius: 11px; }
.icon-tile--lg .icon { width: 22px; height: 22px; }
.icon-tile--info     { --tile-bg: var(--info-bg);     --tile-fg: var(--info-fg); }
.icon-tile--progress { --tile-bg: var(--progress-bg); --tile-fg: var(--progress-fg); }
.icon-tile--warning  { --tile-bg: var(--warning-bg);  --tile-fg: var(--warning-fg); }
.icon-tile--danger   { --tile-bg: var(--danger-bg);   --tile-fg: var(--danger-fg); }
.icon-tile--success  { --tile-bg: var(--success-bg);  --tile-fg: var(--success-fg); }
.icon-tile--planned  { --tile-bg: var(--planned-bg);  --tile-fg: var(--planned-fg); }
.icon-tile--brand    { --tile-bg: var(--brand-tile-bg); --tile-fg: var(--brand-tile-fg); }   /* роли, разделы: структура */
.icon-tile--round    { border-radius: 50%; }

/* Знак и словесная марка */
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: none;
  color: var(--text-1); font-family: var(--font-display); font-size: 16px; line-height: 20px;
  font-weight: var(--fw-semibold); letter-spacing: -0.01em;
}
.brand__mark { width: 28px; height: 28px; color: var(--brand-square); }
.brand__mark.icon { stroke: none; }
/* v4.1: полный логотип (знак, разделитель, надпись LIFT CAPITAL) — символ #i-logo, viewBox 1234×266, currentColor */
.brand__logo { display: block; flex: none; width: 148px; height: 32px; color: var(--brand-square); }
.brand__sub { margin-left: 2px; color: var(--text-3); font-family: var(--font-sans); font-weight: var(--fw-regular); font-size: var(--fs-sm); }


/* =========================================================================
   4. APP SHELL — rail, context bar, page header, container, grid, section
   Разметка (порядок детей <body> важен): .rail → .context-bar → main.page
   Ant Design: Layout + Layout.Sider (collapsed, 76/60) + Menu + Layout.Header
   ========================================================================= */
/* 4.1 Панель навигации слева: знак, разделы роли, город, «Все кабинеты демо» */
.rail {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: var(--z-rail);
  width: var(--rail-w);
  display: flex; flex-direction: column;
  padding: 14px 4px 12px;
  background: var(--rail-bg); color: var(--rail-fg);
  box-shadow: inset -1px 0 0 var(--rail-divider);     /* v4.1: светлая панель с правой кромкой */
}
.rail__brand {
  flex: none; display: grid; place-items: center;
  height: 44px; margin: 0 8px 14px; border-radius: var(--radius-md);
  color: var(--brand-rail);
  transition: background-color var(--dur-1);
}
.rail__brand:hover { background: var(--rail-item-hover); }
.rail__brand .icon { width: 40px; height: 40px; stroke: none; }    /* ромб знака #i-brand-rail ≈ 38px */
.rail__nav { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.rail__item {
  position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 100%; min-height: 58px; padding: 9px 0 8px; border-radius: var(--radius-md);
  color: var(--rail-fg); font-size: var(--fs-2xs); line-height: 13px; font-weight: var(--fw-medium);
  text-align: center; hyphens: manual; overflow-wrap: anywhere;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.rail__item .icon { width: 20px; height: 20px; }
.rail__item:hover, .rail .dropdown.is-open > .rail__item { background: var(--rail-item-hover); color: var(--rail-fg-active); }
.rail__item.is-active, .rail__item[aria-current="page"] { background: var(--rail-item-active); color: var(--rail-fg-active); }
.rail__item:focus-visible, .rail__brand:focus-visible { outline: 2px solid var(--rail-focus); outline-offset: -2px; }
.rail__label { display: block; max-width: 100%; }
.rail__item > .count {
  position: absolute; top: 5px; left: calc(50% + 4px);
  min-width: 18px; height: 16px; padding: 0 5px;
  background: var(--accent); color: var(--on-accent);
  font-size: 10px; font-weight: var(--fw-semibold);
  box-shadow: 0 0 0 2px var(--rail-bg);
}
.rail__foot {
  flex: none; display: flex; flex-direction: column; gap: 4px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rail-divider);
}
.rail__foot .rail__item { min-height: 52px; }
.rail .dropdown { display: flex; width: 100%; }
.rail .dropdown > .dropdown__menu { top: auto; bottom: 0; left: calc(100% + 12px); right: auto; color: var(--text-1); }
.rail .city-switch__label { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; line-height: 12px; }
/* Подсказки у свёрнутой панели (≤ 1024): app.js ставит data-tooltip и data-tooltip-pos="right" */
@media (min-width: 1025px) { .rail [data-tooltip]::after { display: none; } }

/* 4.1b Панель раздела «Управление» (.rail--admin, v4.2): директор в служебном разделе.
   Отличие нейтральное, без новых цветов: панель цвета страницы, под знаком пункт
   «← К директору» (.rail__item--back), пункты раздела — в белой рамке .rail__group
   с заголовком .rail__group-title (шестерёнка и «Управление», как у пункта в панели
   директора). Подписи пункта «назад» и заголовка — 10px, как у переключателя города.
   В бургере (≤ 768) заголовок становится разделителем и подписью группы (app.js §11b).
   Разметка — COMPONENTS.md §1.4 «Администрирование». */
.rail--admin {
  --rail-bg: var(--bg-page);
  --rail-item-hover: var(--bg-surface);          /* на подложке страницы наведение белым */
}
.rail__item--back { min-height: 0; margin-bottom: 6px; padding: 8px 0 7px; gap: 4px; }
.rail__item--back .rail__label, .rail__group-title { font-size: 10px; line-height: 12px; }
.rail__group {
  --rail-item-hover: var(--bg-hover);
  flex: none; display: flex; flex-direction: column; gap: 2px;
  padding: 0 3px 3px;
  background: var(--bg-surface); border: 1px solid var(--rail-divider); border-radius: var(--radius-lg);
}
.rail__group .rail__item:focus-visible { outline-offset: 0; }   /* подпись в 60px пункта: кольцо в поле рамки, не по тексту */
.rail__group-title {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  margin: 0 -3px 1px; padding: 8px 0 7px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-1); font-weight: var(--fw-semibold); text-align: center;
}
.rail__group-title .icon { width: 16px; height: 16px; color: var(--text-3); }
/* Низкое окно (ноутбук 1366 × 768): пункты плотнее — панель раздела помещается без прокрутки;
   ещё ниже пункты прокручиваются (подсказок при > 1024 нет, обрезать нечего) */
@media (min-width: 1025px) and (max-height: 760px) {
  .rail--admin { padding-top: 10px; padding-bottom: 8px; }
  .rail--admin .rail__brand { margin-bottom: 8px; }
  .rail--admin .rail__item, .rail--admin .rail__foot .rail__item { min-height: 0; padding: 6px 0 5px; gap: 3px; }
  .rail--admin .rail__group-title { padding: 6px 0 5px; }
  .rail--admin .rail__foot { margin-top: 8px; padding-top: 8px; }
  .rail--admin .rail__nav { overflow-y: auto; scrollbar-width: none; }
}

/* 4.2 Контекстная полоса: роль и охват слева; поиск, уведомления, профиль справа */
.context-bar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  height: var(--context-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.context-bar__inner {
  height: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--page-pad);
  display: flex; align-items: center; gap: var(--space-3);
}
.context-bar__brand { display: none; flex: none; color: var(--brand-square); }
.context-bar__brand .icon { width: 28px; height: 28px; stroke: none; }
.context-bar__scope {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); white-space: nowrap;
}
.context-bar__scope > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.context-bar__role { color: var(--text-1); font-weight: var(--fw-medium); }
.context-bar__section { color: var(--text-1); font-weight: var(--fw-medium); }   /* v4.2: раздел внутри роли — «Директор · Управление · …» */
.context-bar__scope .live-dot { margin-right: 2px; }
.context-bar__tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); flex: none; }
.context-bar .topnav-burger { display: none; }
.rail ~ .context-bar, .rail ~ .page { margin-left: var(--rail-w); }
.rail ~ .toast-region { margin-left: calc(var(--rail-w) / 2); }

.avatar-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px 2px 2px;
  border-radius: var(--radius-full); color: var(--text-3);
  transition: background-color var(--dur-1);
}
.avatar-btn:hover, .dropdown.is-open > .avatar-btn { background: var(--bg-hover); }
.avatar-btn .icon { width: 16px; height: 16px; }

/* Поиск: иконка, по клику раскрывается поле */
.search { position: relative; display: flex; align-items: center; }
.search__field {
  position: absolute; right: 0; top: 50%; z-index: 2;
  width: 36px; opacity: 0; pointer-events: none;
  transform: translateY(-50%);
  transition: width var(--dur-2) var(--ease), opacity var(--dur-1);
}
.search.is-open .search__field { width: 320px; opacity: 1; pointer-events: auto; }

/* Бургер (≤ 768 и при нехватке места у устаревшей шапки) — строит app.js */
.topnav-burger__label { max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-1); }
.topnav-burger .dropdown__menu { max-height: calc(100vh - 80px); overflow-y: auto; }
.topnav-burger .dropdown__item > .count { margin-left: auto; }
.topnav-burger .dropdown__item.is-selected:has(> .count)::after { margin-left: 8px; }
.topnav-burger .dropdown__item .rail__label { display: inline; }

/* 4.3 Страница */
.page { padding: 28px 0 64px; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--page-pad); }
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-4) var(--space-6); margin-bottom: var(--space-6);
}
.page-header__text { min-width: 0; }
.page-header__eyebrow { margin-bottom: 6px; color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); }
.page-header__title { font-family: var(--font-display); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.page-header__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 6px; color: var(--text-2); font-size: var(--fs-base); line-height: var(--lh-base);
}
.page-header__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--success-solid); box-shadow: 0 0 0 3px var(--success-track);
}

/* Сетка 12 колонок, зазор 16px */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.col-1 { grid-column: span 1; }  .col-2 { grid-column: span 2; }  .col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }  .col-5 { grid-column: span 5; }  .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }  .col-8 { grid-column: span 8; }  .col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; } .col-11 { grid-column: span 11; } .col-12, .col-full { grid-column: 1 / -1; }

/* Раздел страницы */
.section { margin-top: var(--space-8); scroll-margin-top: 72px; }
.section:first-child { margin-top: 0; }
.section__head {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-2) var(--space-3); min-height: 32px; margin-bottom: var(--space-3);
}
.section__title {
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-snug);
}
.section__sub { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.section__actions { display: flex; align-items: center; gap: var(--space-2); }

/* 4.4 DEPRECATED (v1): белая шапка .topbar с вкладками .topnav. Оставлена как алиас,
   чтобы ещё не перенесённые страницы работали; новые страницы — .rail + .context-bar
   (рецепт переноса — COMPONENTS.md «Миграция страницы с v1 на v2»). */
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar__inner {
  height: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--page-pad);
  display: flex; align-items: center; gap: var(--space-6);
}
.topnav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav__item {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 36px; padding: 0 12px; border-radius: var(--radius-md);
  color: var(--text-2); font-weight: var(--fw-medium); white-space: nowrap;
  transition: background-color var(--dur-1), color var(--dur-1);
}
.topnav__item .icon { width: 18px; height: 18px; color: var(--text-3); transition: color var(--dur-1); }
.topnav__item:hover { background: var(--bg-hover); color: var(--text-1); }
.topnav__item.is-active, .topnav__item[aria-current="page"] { background: var(--bg-selected); color: var(--primary-fg); }
.topnav__item.is-active .icon, .topnav__item[aria-current="page"] .icon { color: var(--primary-fg); }
.topbar .topnav-burger { display: none; }
.topbar.is-nav-compact .topnav__item { padding: 0 10px; }
.topbar.is-nav-compact .topnav__item .icon { display: none; }
.topbar.is-nav-collapsed .topnav { display: none; }
.topbar.is-nav-collapsed .topnav-burger { display: inline-flex; }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); flex: none; }
.topbar__sep { width: 1px; height: 24px; margin: 0 var(--space-2); background: var(--border); }


/* =========================================================================
   5. BUTTONS — Ant Design: Button
   .btn + .btn--primary|secondary|ghost|danger|danger-soft|link
        + .btn--sm|lg|xl, .btn--icon, .btn--block, .btn--cta, .is-loading
   Главная — индиго (--primary), вторичная — белая с рамкой, опасная — красная. Радиус 10.
   ========================================================================= */
.btn {
  --btn-h: var(--control-md); --btn-px: 14px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--btn-h); padding: 0 var(--btn-px);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: var(--fs-base); line-height: 1; font-weight: var(--fw-medium);
  white-space: nowrap; text-decoration: none; user-select: none; cursor: pointer;
  transition: background-color var(--dur-1), border-color var(--dur-1), color var(--dur-1), box-shadow var(--dur-1);
}
.btn .icon { width: 18px; height: 18px; margin: 0 -2px; }
.btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--primary:active { background: var(--primary-active); }

.btn--secondary { background: var(--bg-surface); border-color: var(--border-strong); color: var(--text-1); }
.btn--secondary:hover { background: var(--bg-subtle); border-color: var(--border-hover); color: var(--text-1); }
.btn--secondary:active { background: var(--bg-muted); }
.btn--secondary .icon { color: var(--text-2); }

.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-1); }
.btn--ghost:active { background: var(--bg-pressed); }

.btn--danger { background: var(--danger-solid); color: var(--on-primary); }
.btn--danger:hover { background: var(--danger-solid-hover); color: var(--on-primary); }
.btn--danger:active { background: var(--danger-solid-active); }

/* v4.2: «Отменить» в списках — нейтральная кнопка, красный только при наведении и фокусе (меньше цвета в таблицах) */
.btn--danger-soft { background: var(--bg-surface); border-color: var(--border); color: var(--text-2); }
.btn--danger-soft:hover, .btn--danger-soft:focus-visible { background: var(--danger-bg); border-color: var(--danger-border-strong); color: var(--danger-fg); }

.btn--link { height: auto; padding: 0; border: 0; background: none; color: var(--text-link); }
.btn--link:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: 2px; }

.btn--sm { --btn-h: var(--control-sm); --btn-px: 12px; gap: 6px; font-size: var(--fs-sm); }
.btn--sm .icon { width: 16px; height: 16px; }
.btn--lg { --btn-h: var(--control-lg); --btn-px: 18px; font-size: 15px; }
.btn--lg .icon { width: 20px; height: 20px; }
.btn--xl { --btn-h: var(--control-xl); --btn-px: 20px; font-size: 16px; border-radius: 12px; }
.btn--xl .icon { width: 20px; height: 20px; }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--block { display: flex; width: 100%; }

/* Главная кнопка механика: текст слева, круглая стрелка справа */
.btn--cta { justify-content: space-between; padding-left: 20px; padding-right: 8px; }
.btn__chip {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgb(255 255 255 / .16);
}
.btn__chip .icon { margin: 0; }

.btn:disabled, .btn.is-disabled, .btn[aria-disabled="true"] {
  background: var(--bg-muted); border-color: var(--bg-muted); color: var(--text-disabled);
  cursor: not-allowed; box-shadow: none;
}
.btn--ghost:disabled, .btn--link:disabled { background: transparent; border-color: transparent; }
.btn:disabled .icon, .btn:disabled .btn__chip { color: inherit; background: transparent; }

.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: lc-spin .7s linear infinite;
}
.btn.is-loading > .icon:first-child { display: none; }

/* Иконка-кнопка без подписи (обязателен aria-label) */
.icon-btn {
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--radius-md);
  color: var(--text-2);
  transition: background-color var(--dur-1), color var(--dur-1);
}
.icon-btn:hover, .dropdown.is-open > .icon-btn { background: var(--bg-hover); color: var(--text-1); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .icon { width: 18px; height: 18px; }
.icon-btn--lg { width: 44px; height: 44px; }
.icon-btn--lg .icon { width: 24px; height: 24px; }
.icon-btn > .badge { position: absolute; top: 2px; right: 1px; }
.icon-btn > .badge--dot { top: 7px; right: 8px; }


/* =========================================================================
   6. FORM CONTROLS — Ant Design: Input, Select, Input.TextArea, Checkbox,
      Radio, Switch, Form.Item. Радиус 10, фокус — рамка и кольцо signal 3px/22%.
   ========================================================================= */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { color: var(--text-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); }
.field__req { margin-left: 2px; color: var(--danger-fg); }
.field__optional { margin-left: 4px; color: var(--text-3); font-weight: var(--fw-regular); }
.field__help { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.field__error { display: flex; align-items: center; gap: 4px; color: var(--danger-fg); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.field__error .icon { width: 14px; height: 14px; }

.input, .select, .textarea {
  display: block; width: 100%; height: var(--control-md);
  padding: 0 12px;
  background: var(--bg-surface); color: var(--text-1);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-size: var(--fs-base); line-height: var(--lh-base);
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--dur-1), box-shadow var(--dur-1), background-color var(--dur-1);
}
.input::placeholder, .textarea::placeholder { color: var(--text-placeholder); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-hover); }
.input:focus, .select:focus, .textarea:focus,
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--border-focus); box-shadow: var(--focus-ring); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg-muted); border-color: var(--border); color: var(--text-disabled); cursor: not-allowed; }
.input[readonly] { background: var(--bg-subtle); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"],
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger-solid); }
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus, .input.is-invalid:focus { box-shadow: var(--focus-ring-danger); }
.input--sm, .select--sm { height: var(--control-sm); font-size: var(--fs-sm); }
.input--lg, .select--lg { height: var(--control-lg); font-size: 16px; padding: 0 14px; }
.input--num { text-align: right; font-variant-numeric: tabular-nums; }
.textarea { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; }
.select {
  padding-right: 36px; cursor: pointer;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Поле с иконкой слева / кнопкой справа */
.input-icon { position: relative; display: block; min-width: 0; }
.input-icon > .icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-3); pointer-events: none;
}
.input-icon > .input { padding-left: 37px; }
.input-icon > .input--lg { padding-left: 41px; }
.input-icon > .icon:has(+ .input--lg) { left: 13px; width: 20px; height: 20px; }
.input-icon__end { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.input-icon__end.icon-btn { width: 28px; height: 28px; border-radius: 8px; }
.input-icon__end.icon-btn .icon { width: 18px; height: 18px; }
.input-icon:has(.input-icon__end) > .input { padding-right: 40px; }

/* Сетка формы */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-grid > .field--full, .form-grid > .col-full { grid-column: 1 / -1; }
.form-step { display: flex; align-items: center; gap: 10px; margin: var(--space-2) 0 var(--space-1); font-weight: var(--fw-semibold); }
.form-step__num {
  display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-tile-bg); color: var(--primary-fg); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
}

/* Чекбокс и радио: выбранное — сигнальный синий */
.check, .radio {
  display: inline-flex; align-items: flex-start; gap: 10px;
  color: var(--text-1); font-size: var(--fs-base); line-height: var(--lh-base); cursor: pointer;
}
.check__input, .radio__input {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--border-hover); border-radius: 5px;
  background: var(--bg-surface) center / 14px no-repeat;
  cursor: pointer;
  transition: background-color var(--dur-1), border-color var(--dur-1), border-width var(--dur-1);
}
.radio__input { border-radius: 50%; }
.check__input:hover, .radio__input:hover { border-color: var(--accent); }
.check__input:checked, .check__input:indeterminate { border-color: var(--accent); background-color: var(--accent); }
.check__input:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.check__input:indeterminate {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
.radio__input:checked { border-color: var(--accent); border-width: 5.5px; }
.check__input:focus-visible, .radio__input:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.check__input:disabled, .radio__input:disabled { border-color: var(--border-disabled); background-color: var(--bg-muted); cursor: not-allowed; }
.check:has(:disabled), .radio:has(:disabled) { color: var(--text-disabled); cursor: not-allowed; }
.check__hint { display: block; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); margin-top: 2px; }
.check--lg { gap: 12px; font-size: 15px; line-height: 22px; }
.check--lg .check__input { width: 24px; height: 24px; border-radius: 7px; background-size: 17px; margin-top: 0; }

/* Переключатель */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-base); }
.switch__input {
  -webkit-appearance: none; appearance: none; position: relative; flex: none;
  width: 36px; height: 20px; margin: 0; border-radius: var(--radius-full);
  background: var(--switch-off); cursor: pointer;
  transition: background-color var(--dur-2);
}
.switch__input::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--switch-knob); box-shadow: 0 1px 2px rgb(21 25 35 / .24);
  transition: transform var(--dur-2) var(--ease);
}
.switch__input:checked { background: var(--accent); }
.switch__input:checked::before { transform: translateX(16px); }
.switch__input:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.switch__input:disabled { opacity: .5; cursor: not-allowed; }
.switch--lg .switch__input { width: 48px; height: 28px; }
.switch--lg .switch__input::before { width: 24px; height: 24px; }
.switch--lg .switch__input:checked::before { transform: translateX(20px); }


/* =========================================================================
   7. TABS & SEGMENTED — Ant Design: Tabs, Segmented
   ========================================================================= */
.tabs {
  display: flex; gap: var(--space-6);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
  position: relative; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; color: var(--text-2); font-weight: var(--fw-medium); white-space: nowrap;
  transition: color var(--dur-1);
}
.tabs__item::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; border-radius: 2px 2px 0 0; background: transparent;
  transition: background-color var(--dur-1);
}
.tabs__item:hover { color: var(--text-1); }
.tabs__item.is-active { color: var(--text-1); }
.tabs__item.is-active::after { background: var(--accent); }
.tabs__item:focus-visible { outline-offset: -2px; }
.tab-panel { padding-top: var(--space-4); }

.segmented {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%;
  padding: 3px; border-radius: var(--radius-md); background: var(--bg-muted);
  overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented__item {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 7px;
  color: var(--text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap;
  transition: background-color var(--dur-1), color var(--dur-1), box-shadow var(--dur-1);
}
.segmented__item:hover { color: var(--text-1); }
.segmented__item.is-active {
  background: var(--bg-surface); color: var(--text-1);
  box-shadow: 0 0 0 1px var(--segmented-ring), var(--shadow-xs);
}
.segmented__item .icon { width: 16px; height: 16px; }
.segmented__item .count { height: 16px; min-width: 18px; padding: 0 5px; font-size: 11px; background: var(--segmented-count-bg); }
.segmented__item.is-active .count { background: var(--accent-soft); color: var(--accent-fg); }
.segmented--lg { padding: 4px; border-radius: 12px; }
.segmented--lg .segmented__item { height: 44px; padding: 0 16px; border-radius: 9px; font-size: var(--fs-base); }
.segmented--block { display: flex; width: 100%; }
.segmented--block .segmented__item { flex: 1 1 0; }
.segmented--icons .segmented__item { padding: 0 9px; }


/* =========================================================================
   8. CARDS, HERO, KPI, EXCEPTIONS — Ant Design: Card, Statistic, Alert
   Карточка: белая, рамка 1px, радиус 14, без тени; тень — только при
   наведении на кликабельную.
   ========================================================================= */
.card {
  position: relative; min-width: 0;
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.card__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.card__title { font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.card__subtitle { margin-top: 2px; color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.card__actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: var(--space-4); padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}
.card--flush { padding: 0; }
.card--flush > .card__head { padding: var(--space-4) var(--space-5) 0; margin-bottom: var(--space-3); }
.card--flush > .card__foot { margin: 0; padding: var(--space-3) var(--space-5); }
.card--compact { padding: var(--space-4); }
.card--subtle { background: var(--bg-subtle); border-color: var(--border-subtle); }
.card--interactive, a.card { display: block; color: inherit; cursor: pointer; transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2); }
.card--interactive:hover, a.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.card--interactive:focus-visible, a.card:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* Карточки и плитки прямо в колонке сетки тянутся на всю высоту ряда */
.grid > [class*="col-"] > .card, .grid > [class*="col-"] > .stat { height: 100%; }

/* Герой-карточка активного наряда (механик). Разметка v1 (.hero__head / .hero__art / .hero__body)
   сохранена; в v2 — композиция .hero--shaft ниже: шахта слева, сведения справа, без иллюстрации */
.hero {
  position: relative; overflow: hidden;
  padding: var(--space-4) var(--space-4) var(--space-5) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.hero__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-3); align-items: start; }
.hero__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding-top: 4px; }
.hero__art { width: 108px; height: auto; margin: 0 -4px 0 0; }
.hero__title { grid-column: 1 / -1; margin-top: 6px; font-family: var(--font-display); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.hero__sub { grid-column: 1 / -1; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.hero__body { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
.hero__actions { display: flex; flex-direction: column; gap: var(--space-2); }
/* v2: герой «шахта» — слева вертикальная шахта этапов, справа статус, номер, приоритет, адрес,
   объект, таймер и подпись этапа; ниже на всю ширину — главная кнопка и «Маршрут». Без иллюстрации. */
.hero--shaft { padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5); }
.hero__main {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-width: 0; min-height: 128px; padding-left: 60px;
}
.hero__main > * { max-width: 100%; }
.hero--shaft .hero__title { margin-top: 2px; }
.hero--shaft .hero__main > .stage--vertical { position: static; min-height: 0; padding-left: 0; margin-top: 2px; }
.hero--shaft .hero__main > .stage--vertical .stage__track { top: 2px; }
.hero--shaft .hero__actions { margin-top: var(--space-4); }

/* KPI-плитка: подпись сверху, цифра Geologica 32/36, иконка в круге bg-subtle.
   Никакой заливки цветом; критичная — только красная точка у подписи (.stat--alert). */
.stat {
  position: relative; min-width: 0;
  display: flex; flex-direction: column;
  padding: var(--space-4) var(--space-5) 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.stat__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; margin-bottom: var(--space-2); min-width: 0; }
.stat__head > .icon-tile {
  order: 2; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-subtle); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.stat__head > .icon-tile .icon { width: 20px; height: 20px; }
.stat__label { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); min-width: 0; }
.stat__value {
  color: var(--text-1); font-family: var(--font-display); font-size: var(--fs-kpi); line-height: var(--lh-kpi); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight); white-space: nowrap;
}
.stat__unit { margin-left: 4px; color: var(--text-3); font-family: var(--font-sans); font-size: 16px; font-weight: var(--fw-medium); letter-spacing: 0; }
.stat__foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  margin-top: 8px; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs);
}
.stat__meter { margin-top: var(--space-3); }
.stat--alert .stat__label::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%;
  background: var(--danger-solid); vertical-align: 1px;
}
a.stat, .stat--interactive { color: inherit; cursor: pointer; transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2); }
a.stat:hover, .stat--interactive:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }

.delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta .icon { width: 14px; height: 14px; --icon-stroke: 2.25; }
.delta--good { color: var(--success-fg); }
.delta--bad { color: var(--danger-fg); }
.delta--flat { color: var(--text-3); }

/* «Нужно действие» (v2): одна карточка-список. Шапка (заголовок, красный счётчик, подпись
   справа) и строки: значок тона в круге 36px, заголовок 600, строка «тип · номер · адрес»,
   справа таймер или статус и одно действие. ≥ 1200 — две колонки строк. Критичная строка —
   красная полоса слева и заливка, как строка таблицы. Ant Design: Card + List.
   Хуки строк те же, что у карточек v1: data-drawer-open, data-sr, data-exc, кнопки с data-*. */
.inbox { min-width: 0; overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.inbox__head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  min-height: 56px; padding: 12px 20px; border-bottom: 1px solid var(--border-subtle);
}
.inbox__heading { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-snug); }
.inbox__sub { margin-left: auto; color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.inbox__list { display: grid; grid-template-columns: minmax(0, 1fr); }
.inbox__row {                       /* значок — в поле слева; справа блок действий уходит под текст, только если строке тесно */
  position: relative; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  min-height: 64px; padding: 10px 16px 10px 68px;
  border-top: 1px solid var(--border-subtle);
  color: inherit; text-align: left;
  transition: background-color var(--dur-1);
}
.inbox__row:first-child { border-top: 0; }
.inbox__row[data-drawer-open], .inbox__row[tabindex], a.inbox__row { cursor: pointer; }
.inbox__row[data-drawer-open]:hover, .inbox__row[tabindex]:hover, a.inbox__row:hover { background: var(--bg-row-hover); }
.inbox__row:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.inbox__icon { width: 36px; height: 36px; border-radius: 50%; }            /* вместе с .icon-tile .icon-tile--{tone} */
.inbox__row > .inbox__icon { position: absolute; left: 20px; top: 50%; margin-top: -18px; }
.inbox__icon .icon { width: 18px; height: 18px; }
.inbox__body { flex: 1 1 240px; min-width: 0; }
.inbox__title { color: var(--text-1); font-family: var(--font-sans); font-size: var(--fs-base); line-height: var(--lh-base); font-weight: var(--fw-semibold); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.inbox__meta { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox__aside { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); max-width: 100%; }
.inbox__row--critical { background: var(--danger-row); box-shadow: inset 3px 0 0 var(--danger-solid); }
.inbox__row--critical[data-drawer-open]:hover, .inbox__row--critical[tabindex]:hover, a.inbox__row--critical:hover { background: var(--danger-bg); }
.inbox__empty { display: flex; align-items: center; gap: var(--space-5); padding: var(--space-4) var(--space-5); }
.inbox__empty img { width: 72px; flex: none; }
.inbox__empty-title { font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.inbox__empty-text { color: var(--text-2); }
@media (min-width: 1200px) {
  .inbox__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inbox__row:nth-child(2) { border-top: 0; }
  .inbox__row:nth-child(even) { border-left: 1px solid var(--border-subtle); }
}
@media (max-width: 560px) {
  .inbox__row { padding-left: 60px; }
  .inbox__row > .inbox__icon { left: 14px; }
  .inbox__sub { margin-left: 0; width: 100%; }
}

/* 8b. Канбан доски диспетчера — .kanban, .kb-col, .kb-card, .kb-crew (v4.2; v4.3 — шесть колонок)
   Доска = колонки по статусу обращения (Новые · У супервайзера · Назначено · В работе · Отложено · Выполнено)
   и панель по кнопке (v4.3: «Супервайзеры» по городам) — цели перетаскивания. v4.3: колонки не уже 196px —
   шесть помещаются при 1440 (по 208px), при 1366 доска прокручивается вбок на несколько пикселей. .kb-board > .kanban (колонки .kb-col: шапка + тело с прокруткой)
   + .kb-crew. Колонки равные: ≥ 1600 не уже 232px и панель 232px справа; < 1600 не уже 220px, а панель —
   рейка 56px из аватаров (кнопка разворачивает её поверх доски), поэтому при 1366 и 1440 пять колонок
   помещаются целиком. Не помещаются (≤ 1280) — доска прокручивается вбок (scroll-snap), край гаснет.
   Над доской — строка сигналов .kb-signals.
   Карточка .kb-card — белая на сером фоне колонки: номер и тип, адрес и объект (≤ 2 строк), сигнал
   (норматив, «без ответа», «вернул наряд», причина отложения) или тихий срок, исполнитель и одно действие.
   Цвет только у исключений: «люди в кабине» — .kb-card--critical (заливка --danger-row и полоса слева,
   как .inbox__row--critical). Перетаскивание: .kb-board.is-dragging, цели .is-drop-target, под курсором
   .is-drop-over, недоступные механики .is-drop-off, сама карточка .is-dragging.
   Разметка, данные и клавиши — COMPONENTS.md §32; эталон — dispatcher.html. */
.kb-signals { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.kb-signals__text { min-width: 0; color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.kb-signals__text b { color: var(--text-1); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.kb-board {
  position: relative;   /* панель механиков поверх доски (< 1600) и подпись цели при перетаскивании */
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: var(--space-4);   /* v4.2: панель механиков не в сетке, а поверх доски */
  min-width: 0; min-height: 0;
}
.kanban {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); grid-template-rows: minmax(0, 1fr); gap: var(--space-3);   /* v4.3: шесть колонок без прокрутки от 1440px */
  min-width: 0; min-height: 0; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin;
}
/* за краем есть ещё колонки — край доски мягко гаснет (классы ставит скрипт страницы по прокрутке) */
.kanban.has-more-end { -webkit-mask-image: linear-gradient(to right, black calc(100% - 40px), transparent); mask-image: linear-gradient(to right, black calc(100% - 40px), transparent); }
.kanban.has-more-start { -webkit-mask-image: linear-gradient(to right, transparent, black 40px); mask-image: linear-gradient(to right, transparent, black 40px); }
.kanban.has-more-start.has-more-end { -webkit-mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, black 40px, black calc(100% - 40px), transparent); }
.kb-col {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--bg-muted); border: 1px solid var(--border); border-radius: var(--radius-lg);   /* рамка: граница колонки видна (замечание заказчика) */
  scroll-snap-align: start;
  transition: background-color var(--dur-1);
}
.kb-col__head { flex: none; padding: var(--space-3) var(--space-4) var(--space-2); background: var(--bg-surface); border-bottom: 1px solid var(--border); border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; }
.kb-col__title {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--text-1); font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold);
}
.kb-col__title > .count { background: var(--bg-surface); }   /* счётчик на сером фоне колонки */
.kb-col__sub { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.kb-col__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-1) var(--space-1-5) var(--space-2);
  overscroll-behavior: contain; scrollbar-width: thin;
}
.kb-col__empty {
  padding: var(--space-4) var(--space-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); text-align: center;
}
/* Карточка обращения: клик и Enter — общая карточка (data-record), перетаскивание — в «Новых» и «Назначено» */
.kb-card {
  position: relative; flex: none; min-width: 0;
  display: flex; flex-direction: column; gap: var(--space-1-5);
  padding: 10px var(--space-3);
  background: var(--bg-surface); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; scroll-margin: var(--space-2);   /* J / K и «подсветить» прокручивают так, что рамка фокуса видна целиком */
  transition: border-color var(--dur-1), box-shadow var(--dur-2) var(--ease), background-color var(--dur-1), opacity var(--dur-1);
}
.kb-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-hover); }
.kb-card:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.kb-card__place {
  color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-card__place b { color: var(--text-1); font-weight: var(--fw-semibold); }
.kb-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1-5) var(--space-2); min-width: 0; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.kb-card__meta > .tag { max-width: 100%; }
.kb-card__meta > .tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.kb-card__stage { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-2); font-weight: var(--fw-medium); }
.kb-card__foot { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.kb-card__who { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--space-1-5); color: var(--text-1); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.kb-card__who > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-card__who--none { color: var(--text-3); }
.kb-card__foot > .btn { flex: none; margin-left: auto; }
.kb-card__foot > .btn--primary { flex: 1 1 auto; }
.kb-card__foot > [data-tooltip]::after { max-width: 100%; }   /* подсказка не шире кнопки: колонка обрезает по краям */
.kb-card--critical { background: var(--danger-row); box-shadow: inset 3px 0 0 var(--danger-solid); }
.kb-card--critical:hover { background: var(--danger-bg); border-color: var(--danger-border); box-shadow: inset 3px 0 0 var(--danger-solid), var(--shadow-hover); }
.kb-card.is-flash { border-color: var(--accent); animation: kb-flash 2.6s var(--ease); }   /* при уменьшенном движении остаётся рамка */
@keyframes kb-flash { 0%, 40% { background-color: var(--accent-soft); } }
.kb-card.is-dragging { opacity: .45; }
/* «Механики на смене»: бригады, у механика — нагрузка, геометка текстом, «свободен». Панель скрыта и открывается
   кнопкой .kb-crew-toggle в панели фильтров (aria-expanded) или сама на время перетаскивания:
   .kb-crew.is-open — 280px поверх правого края доски с тенью, «×» в шапке и Esc закрывают (заказчик: панель не должна мешать канбану) */
.kb-crew {
  display: none; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: border-color var(--dur-1), box-shadow var(--dur-1);
}
.kb-crew.is-open {
  display: flex; position: absolute; top: 0; right: 0; bottom: 0; z-index: calc(var(--z-sticky) + 1); width: 280px;
  box-shadow: var(--shadow-overlay); animation: kb-crew-in var(--dur-2) var(--ease);
}
.kb-crew-toggle.is-active { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent-fg); }
.kb-crew-toggle.is-active .icon { color: var(--accent-fg); }
.kb-crew__head { flex: none; display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-3) 10px var(--space-4); border-bottom: 1px solid var(--border-subtle); }
.kb-crew__heading { flex: 1 1 auto; min-width: 0; }
.kb-crew__close { margin: -6px -6px -6px 0; }
.kb-crew__title { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.kb-crew__sub { margin-top: var(--space-0-5); color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.kb-crew__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 var(--space-1) var(--space-2); overscroll-behavior: contain; scrollbar-width: thin; }
.kb-crew__team {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  padding: 10px var(--space-2) var(--space-1); background: var(--bg-surface);
  color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.kb-crew__list { display: flex; flex-direction: column; gap: var(--space-0-5); margin: 0; padding: 0; list-style: none; }
.kb-mech {
  display: flex; align-items: flex-start; gap: var(--space-2); width: 100%; min-width: 0;
  padding: var(--space-1-5) var(--space-2); border-radius: var(--radius-sm);
  color: inherit; text-align: left;
  transition: background-color var(--dur-1), opacity var(--dur-1);
}
.kb-mech:hover { background: var(--bg-hover); }
.kb-mech:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.kb-mech > .avatar { margin-top: 1px; }
.kb-mech__text { display: flex; flex-direction: column; min-width: 0; }
.kb-mech__name, .kb-mech__meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kb-mech__name { color: var(--text-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); }
.kb-mech__meta { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.kb-mech__free { color: var(--success-fg); font-weight: var(--fw-medium); }
/* Перетаскивание: цели подсвечены индиго, недоступные механики приглушены */
.kb-board.is-dragging .kb-col.is-drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kb-board.is-dragging .kb-crew { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kb-board.is-dragging .kb-mech.is-drop-target { background: var(--accent-subtle); }
.kb-board.is-dragging .kb-mech.is-drop-off { opacity: .4; }
.kb-board.is-dragging .is-drop-over { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-subtle); }
/* подпись цели у аватара рейки во время перетаскивания: имени в рейке нет, а title при перетаскивании не всплывает */
.kb-drop-label {
  position: absolute; z-index: calc(var(--z-sticky) + 2); transform: translateY(-50%);
  padding: var(--space-1-5) var(--space-2); border-radius: var(--radius-sm); background: var(--bg-inverse); color: var(--text-inverse); box-shadow: var(--shadow-popover);
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium); white-space: nowrap; pointer-events: none;
}
@keyframes kb-crew-in { from { opacity: 0; transform: translateX(12px); } }
@media (forced-colors: active) {
  .kb-card--critical { border-left: 3px solid CanvasText; }
  .kb-board.is-dragging .is-drop-target, .kb-board.is-dragging .is-drop-over { outline-color: Highlight; }
}

/* DEPRECATED (v1): ряд одинаковых карточек-исключений .exceptions / .exception.
   Оставлено для ещё не перенесённых страниц; новые — .inbox (выше), рецепт — COMPONENTS §18. */
.exceptions {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(248px, 1fr);
  gap: var(--gap);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  padding-bottom: 2px;
}
.exceptions--dense { grid-auto-columns: minmax(200px, 1fr); }
.exception {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 176px; padding: 14px var(--space-4) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  scroll-snap-align: start;
  transition: box-shadow var(--dur-2) var(--ease), border-color var(--dur-2);
}
.exception[tabindex], .exception[data-drawer-open], a.exception { cursor: pointer; color: inherit; }
.exception[tabindex]:hover, .exception[data-drawer-open]:hover, a.exception:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.exception__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 4px; }
.exception__title { color: var(--text-1); font-size: var(--fs-base); line-height: var(--lh-base); font-weight: var(--fw-semibold); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.exception__meta { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.exception__place { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.exception__foot { display: flex; align-items: center; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.exception--critical { border-color: var(--danger-solid); box-shadow: inset 0 0 0 1px var(--danger-solid); }
.exception--critical[tabindex]:hover, .exception--critical[data-drawer-open]:hover { border-color: var(--danger-solid); box-shadow: inset 0 0 0 1px var(--danger-solid), var(--shadow-hover); }
.exception--critical .icon-tile::after {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger-solid); box-shadow: 0 0 0 2px var(--bg-surface);
}
.exceptions-empty {
  display: flex; align-items: center; gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.exceptions-empty img { width: 72px; flex: none; }
.exceptions-empty__title { font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.exceptions-empty__text { color: var(--text-2); }


/* =========================================================================
   9. TABLE & TOOLBAR — Ant Design: Table, Pagination
   Шапка: 11/16, 600, заглавные, трекинг 0.04em, text-3; строка 44px.
   ========================================================================= */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.toolbar__search { width: 280px; max-width: 100%; }
.toolbar__end { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }

.table-wrap {
  position: relative; min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.table-wrap--scroll { max-height: var(--table-max-h, 560px); overflow: auto; }
.table-wrap--flush { border: 0; border-radius: 0; }
/* Таблица с панелью и подвалом в одной рамке: .table-card > .toolbar? + .table-wrap + .table-foot */
.table-card {
  min-width: 0; overflow: hidden; overflow: clip;
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.table-card > .table-wrap { border: 0; border-radius: 0; }
.table-card > .toolbar { margin: 0; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.table-card > .table-foot:first-child { border-top: 0; }
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: var(--fs-base); line-height: var(--lh-base);
}
.table th {
  position: sticky; top: var(--topbar-h); z-index: var(--z-sticky);
  height: 40px; padding: 0 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
  text-align: left; white-space: nowrap; vertical-align: middle;
}
/* Внутри настоящих контейнеров прокрутки шапка липнет к их верху */
.table-wrap--scroll .table th, .drawer .table th, .modal .table th { top: 0; }
.table th:first-child { border-top-left-radius: 13px; }
.table th:last-child { border-top-right-radius: 13px; }
.table-wrap--flush .table th, .table-card .table th { border-radius: 0; }
.table td {
  height: 44px; padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  transition: background-color var(--dur-1);
}
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.table tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }
.table-card .table tbody tr:last-child td { border-radius: 0; }
.table tbody tr:hover td { background: var(--bg-row-hover); }
.table tbody tr.is-selected td { background: var(--bg-selected); }
.table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.table tbody tr[data-drawer-open], .table tbody tr[data-modal-open], .table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .center { text-align: center; }
.table .col-check { width: 44px; }
.table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.table--compact td { height: 36px; }
.table--relaxed td { height: 56px; padding-top: 8px; padding-bottom: 8px; }
.table--sticky-off th { position: static; }

/* Итоговая строка; строки по приоритету: полоса слева, у critical лёгкая заливка */
.table tr.row--total > td { background: var(--bg-subtle); color: var(--text-1); font-weight: var(--fw-semibold); }
.table tr.row--total:hover > td { background: var(--bg-subtle); }
.table tbody tr.row--critical td { background: var(--danger-row); }
.table tbody tr.row--critical:hover td { background: var(--danger-bg); }
.table tbody tr.row--critical td:first-child { box-shadow: inset 3px 0 0 var(--danger-solid); }
/* v4.2: у аварий (.row--high) полосы слева больше нет — достаточно янтарного типа в строке */

/* Содержимое ячеек */
.cell-main { color: var(--text-1); font-weight: var(--fw-medium); }
.cell-sub { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.cell-stack { display: flex; flex-direction: column; min-width: 180px; line-height: 18px; }
.cell-stack .cell-sub { line-height: 16px; font-size: var(--fs-xs); }
.cell-person { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.cell-empty { color: var(--text-3); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.th-sort .icon { width: 14px; height: 14px; color: var(--text-disabled); }
.th-sort:hover, .th-sort.is-active { color: var(--text-1); }
.th-sort.is-active .icon { color: var(--accent); }

.table-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--text-3); font-size: var(--fs-sm);
}


/* =========================================================================
   10. PILLS, PRIORITY, TAGS, COUNTS, BADGES, SLA
   Статус никогда только цветом: точка/иконка + текст.
   ========================================================================= */
/* Ant Design: Tag (bordered={false}) или Badge status + text. Радиус 6.
   v4.2: точки перед подписью нет — статус читается текстом на подложке тона (заказчик: «убрать точки»).
   .pill--ring и .pill--nodot оставлены пустыми алиасами для старой разметки; --pill-dot — для графиков/легенд. */
.pill {
  --pill-fg: var(--neutral-fg); --pill-bg: var(--neutral-bg); --pill-dot: var(--neutral-solid);
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 22px; padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--pill-bg); color: var(--pill-fg);
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium);
  white-space: nowrap; vertical-align: middle;
}
.pill > .icon { width: 14px; height: 14px; margin-left: -2px; --icon-stroke: 2.1; }
.pill--lg { height: 26px; padding: 0 10px; font-size: var(--fs-sm); }

/* Тона */
.pill--info     { --pill-fg: var(--info-fg);     --pill-bg: var(--info-bg);     --pill-dot: var(--info-solid); }
.pill--progress { --pill-fg: var(--progress-fg); --pill-bg: var(--progress-bg); --pill-dot: var(--progress-solid); }
.pill--warning  { --pill-fg: var(--warning-fg);  --pill-bg: var(--warning-bg);  --pill-dot: var(--warning-solid); }
.pill--danger   { --pill-fg: var(--danger-fg);   --pill-bg: var(--danger-bg);   --pill-dot: var(--danger-solid); }
.pill--success  { --pill-fg: var(--success-fg);  --pill-bg: var(--success-bg);  --pill-dot: var(--success-solid); }
.pill--planned  { --pill-fg: var(--planned-fg);  --pill-bg: var(--planned-bg);  --pill-dot: var(--planned-solid); }
.pill--neutral  { --pill-fg: var(--neutral-fg);  --pill-bg: var(--neutral-bg);  --pill-dot: var(--neutral-solid); }

/* Семантические статусы (значения enum из модели данных).
   v4.2: у цвета одно значение — индиго «в движении», янтарный «ждёт внимания», красный «критично / не работает»,
   зелёный «готово», серый «неактивно». Оранжевого и кольца «ожидание» больше нет.
   Обращение · Наряд · Объект · Визит ТО · Освидетельствование · Акт · Счёт · Договор · Учётная запись */
.pill--sr-new, .pill--sr-routed, .pill--sr-assigned, .pill--sr-in-progress,   /* v4.3: sr-routed — «У супервайзера» */
.pill--wo-planned, .pill--wo-assigned, .pill--wo-accepted, .pill--wo-en-route, .pill--wo-on-site, .pill--wo-in-progress,
.pill--visit-scheduled, .pill--act-issued, .pill--inv-issued, .pill--user-invited
  { --pill-fg: var(--info-fg); --pill-bg: var(--info-bg); --pill-dot: var(--info-solid); }
.pill--sr-postponed, .pill--wo-paused, .pill--asset-under-repair,
.pill--act-disputed, .pill--insp-due, .pill--contract-expiring
  { --pill-fg: var(--warning-fg); --pill-bg: var(--warning-bg); --pill-dot: var(--warning-solid); }
.pill--asset-stopped, .pill--inv-overdue, .pill--visit-missed, .pill--insp-overdue
  { --pill-fg: var(--danger-fg); --pill-bg: var(--danger-bg); --pill-dot: var(--danger-solid); }
.pill--sr-resolved, .pill--wo-completed, .pill--wo-confirmed,
.pill--asset-operating, .pill--visit-done, .pill--insp-valid,
.pill--act-signed, .pill--inv-paid, .pill--contract-active, .pill--user-active
  { --pill-fg: var(--success-fg); --pill-bg: var(--success-bg); --pill-dot: var(--success-solid); }
.pill--sr-closed, .pill--sr-cancelled, .pill--wo-cancelled, .pill--asset-decommissioned,
.pill--act-draft, .pill--act-cancelled, .pill--inv-draft, .pill--inv-cancelled,
.pill--contract-draft, .pill--contract-expired, .pill--contract-terminated, .pill--user-disabled
  { --pill-fg: var(--neutral-fg); --pill-bg: var(--neutral-bg); --pill-dot: var(--neutral-solid); }
/* Приоритет / тип обращения: столбики сигнала (3 = высокий) — Ant Design: Tag + icon */
.prio {
  --prio-fg: var(--neutral-fg); --prio-bg: var(--neutral-bg);
  --b1: var(--neutral-solid); --b2: var(--prio-bar-off); --b3: var(--prio-bar-off);
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 22px; padding: 0 8px 0 7px; border-radius: var(--radius-sm);
  background: var(--prio-bg); color: var(--prio-fg);
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium);
  white-space: nowrap; vertical-align: middle;
}
.prio::before {
  content: ""; flex: none; width: 11px; height: 10px;
  background:
    linear-gradient(var(--b1), var(--b1)) 0 100% / 3px 4px no-repeat,
    linear-gradient(var(--b2), var(--b2)) 4px 100% / 3px 7px no-repeat,
    linear-gradient(var(--b3), var(--b3)) 8px 100% / 3px 10px no-repeat;
}
.prio--critical { --prio-fg: var(--on-primary); --prio-bg: var(--danger-solid); --b1: var(--gray-0); --b2: var(--gray-0); --b3: var(--gray-0); font-weight: var(--fw-semibold); }
.prio--high     { --prio-fg: var(--warning-fg); --prio-bg: var(--warning-bg); --b1: var(--warning-solid); --b2: var(--warning-solid); --b3: var(--warning-solid); }
.prio--medium   { --prio-fg: var(--neutral-fg); --prio-bg: var(--neutral-bg); --b1: var(--neutral-solid); --b2: var(--neutral-solid); }  /* v4.2: без синего — цвет только у критичных и аварий */
.prio--low      { --prio-fg: var(--neutral-fg); --prio-bg: var(--neutral-bg); }
.prio--planned  { --prio-fg: var(--planned-fg); --prio-bg: var(--planned-bg); padding: 0 8px; }
.prio--planned::before { display: none; }   /* v4.2: кольца-точки нет, плановое ТО — подписью */
.prio--lg { height: 26px; padding: 0 10px 0 9px; font-size: var(--fs-sm); }

/* Нейтральный тег: ТО-1, KONE, «Вне договора», роль — Ant Design: Tag */
.tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 22px; padding: 0 7px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: var(--fs-xs); line-height: 1; font-weight: var(--fw-medium);
  white-space: nowrap; vertical-align: middle;
}
.tag .icon { width: 14px; height: 14px; }
.tag--muted { background: var(--bg-muted); border-color: transparent; }
.tag--accent { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent-fg); }

/* Счётчик во вкладках, навигации, заголовках — Ant Design: Badge count (нейтральный) */
.count {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--radius-full);
  background: var(--bg-muted); color: var(--text-2);
  font-size: var(--fs-xs); line-height: 1; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums;
}
.count--accent, .tabs__item.is-active .count { background: var(--accent-soft); color: var(--accent-fg); }
.topnav__item.is-active .count { background: var(--brand-soft); color: var(--primary-fg); }
.count--danger { background: var(--danger-solid); color: var(--on-primary); }
.count--warning { background: var(--warning-bg); color: var(--warning-fg); }

/* Бейдж уведомлений — Ant Design: Badge */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full);
  background: var(--danger-solid); color: var(--on-primary);
  font-size: 11px; line-height: 1; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg-surface);
}
.badge--dot { min-width: 0; width: 8px; height: 8px; padding: 0; }
.badge--accent { background: var(--accent); color: var(--on-accent); }

/* Таймер норматива: обратный отсчёт, цвет по запасу времени; время — моноширинным */
.sla {
  --sla-fg: var(--text-2); --sla-bg: var(--bg-muted); --sla-icon: var(--accent); --sla-ring: transparent;
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 24px; padding: 0 8px; border-radius: var(--radius-sm);
  background: var(--sla-bg); color: var(--sla-fg);
  box-shadow: inset 0 0 0 1px var(--sla-ring);
  font-size: var(--fs-xs); line-height: 1; font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: middle;
}
.sla > .icon { width: 14px; height: 14px; color: var(--sla-icon); --icon-stroke: 2.1; }
.sla__time { color: var(--text-1); font-family: var(--font-mono); font-size: calc(1em - 1px); font-weight: var(--fw-semibold); }
.sla--warn { --sla-fg: var(--warning-fg); --sla-bg: var(--warning-bg); --sla-icon: var(--warning-solid); --sla-ring: var(--warning-border); }
.sla--overdue { --sla-fg: var(--danger-fg); --sla-bg: var(--danger-bg); --sla-icon: var(--danger-solid); --sla-ring: var(--danger-border); }
.sla--warn .sla__time, .sla--overdue .sla__time { color: inherit; }
.sla--met, .sla--paused { --sla-bg: transparent; --sla-fg: var(--text-3); --sla-icon: var(--success-solid); padding: 0; }
.sla--paused { --sla-icon: var(--progress-icon); }
.sla--met .sla__time, .sla--paused .sla__time { color: var(--text-2); font-family: var(--font-sans); font-size: 1em; font-weight: var(--fw-medium); }
.sla--lg { height: 28px; padding: 0 10px; font-size: var(--fs-sm); }
.sla--lg > .icon { width: 16px; height: 16px; }
.sla--lg.sla--met, .sla--lg.sla--paused { padding: 0; }


/* =========================================================================
   11. STAGE INDICATOR «ШАХТА» — наряд, 6 этапов
   Ant Design: Steps (свой рендер) / Progress steps={6}
   <div class="stage" data-stage="3"></div> — разметку дорисует app.js
   (.stage__head > .stage__label + .stage__name; ol.stage__track > 6 × li.stage__seg > span)
   Обычный: горизонтальная шахта, шесть «этажей»: пройденные — риски цветом акцента,
   текущий — кабина 14px сигнальным синим на риске, будущие — риски border-strong.
   --lg (телефон): этажи-квадраты 36px с номером, кабина на текущем.
   --compact (таблицы): шесть рисок 10×3 и «3 из 6».
   ========================================================================= */
.stage {
  --stage-cabin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath fill-rule='evenodd' d='M6.35 0h1.3v2.6h-1.3zM3.6 2.6h6.8a1.6 1.6 0 0 1 1.6 1.6v8.2a1.6 1.6 0 0 1-1.6 1.6H3.6A1.6 1.6 0 0 1 2 12.4V4.2a1.6 1.6 0 0 1 1.6-1.6Zm2.85 2.3h1.1v7.6h-1.1z'/%3E%3C/svg%3E");
  display: grid; gap: 8px; min-width: 0;
}
.stage__head { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.stage__label {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  color: var(--accent-fg); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stage__label::before { content: none; }
.stage__name { min-width: 0; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stage__name::before { content: "·"; margin-right: 8px; color: var(--text-3); }
.stage__track {
  position: relative;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end;
  height: 22px; margin: 0; padding: 0; list-style: none;
}
/* сама «шахта»: тонкая направляющая через все этажи */
.stage__track::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 2px;
  border-radius: 1px; background: var(--border-subtle);
}
.stage__seg { position: relative; height: 22px; font-size: 0; transition: none; }
.stage__seg > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stage__seg::after {
  content: ""; position: absolute; left: 14%; right: 14%; bottom: 0; height: 4px;
  border-radius: 2px; background: var(--stage-future);
  transition: background-color var(--dur-3) var(--ease);
}
.stage__seg.is-done::after { background: var(--stage-done); }
.stage__seg.is-current::after { left: 6%; right: 6%; background: var(--accent); }
.stage__seg.is-current::before {
  content: ""; position: absolute; left: 50%; bottom: 7px;
  width: 14px; height: 14px; margin-left: -7px;
  background: var(--accent);
  -webkit-mask: var(--stage-cabin) center / contain no-repeat;
          mask: var(--stage-cabin) center / contain no-repeat;
}
/* Пауза: кабина и риска янтарные */
.stage[data-stage-state="paused"] .stage__label { color: var(--progress-fg); }
.stage[data-stage-state="paused"] .stage__seg.is-current::after,
.stage[data-stage-state="paused"] .stage__seg.is-current::before { background: var(--progress-solid); }
/* Все этапы пройдены: риски зелёные, подпись зелёная */
.stage.is-complete .stage__label { color: var(--success-fg); }
.stage.is-complete .stage__seg::after { background: var(--success-solid); }

/* Крупный (телефон): этажи-квадраты 36px с номером, кабина на текущем */
.stage--lg { gap: 10px; }
.stage--lg .stage__head { font-size: var(--fs-base); line-height: var(--lh-base); }
.stage--lg .stage__track { height: 36px; gap: 0; align-items: center; }
.stage--lg .stage__track::before { display: none; }
.stage--lg .stage__seg { height: 36px; display: grid; place-items: center; font-size: var(--fs-sm); }
.stage--lg .stage__seg > span {
  position: relative; z-index: 1; clip: auto; overflow: visible;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--bg-surface); box-shadow: inset 0 0 0 1.5px var(--stage-future);
  color: var(--text-3); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease), color var(--dur-3) var(--ease);
}
/* перемычка к следующему этажу */
.stage--lg .stage__seg::after {
  left: calc(50% + 18px); right: auto; bottom: auto; top: 50%;
  width: calc(100% - 36px); height: 2px; margin-top: -1px; border-radius: 1px;
  background: var(--stage-future);
}
.stage--lg .stage__seg:last-child::after { display: none; }
.stage--lg .stage__seg.is-done > span { background: var(--stage-done); box-shadow: none; color: var(--on-stage-done); }
.stage--lg .stage__seg.is-done::after { background: var(--stage-done); }
.stage--lg .stage__seg.is-current::after { left: calc(50% + 18px); right: auto; background: var(--stage-future); }
.stage--lg .stage__seg.is-current > span { background: var(--accent-subtle); box-shadow: inset 0 0 0 2px var(--accent); color: transparent; }
.stage--lg .stage__seg.is-current::before { z-index: 2; bottom: auto; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.stage--lg[data-stage-state="paused"] .stage__seg.is-current > span { background: var(--progress-bg); box-shadow: inset 0 0 0 2px var(--progress-solid); }
.stage--lg[data-stage-state="paused"] .stage__seg.is-current::after { background: var(--stage-future); }
.stage--lg.is-complete .stage__seg > span { background: var(--stage-complete); box-shadow: none; color: var(--on-stage-complete); }
.stage--lg.is-complete .stage__seg::after { background: var(--stage-complete); }

/* Компактный: шесть рисок 10×3 и «3 из 6» — для таблиц и списков */
.stage--compact { display: flex; align-items: center; gap: 8px; }
.stage--compact .stage__track { display: flex; flex: none; gap: 3px; height: auto; align-items: center; }
.stage--compact .stage__track::before { display: none; }
.stage--compact .stage__seg { width: 10px; height: 3px; border-radius: 1.5px; background: var(--stage-future); }
.stage--compact .stage__seg::after, .stage--compact .stage__seg::before { display: none; }
.stage--compact .stage__seg.is-done { background: var(--stage-done); }
.stage--compact .stage__seg.is-current { height: 5px; border-radius: 2px; background: var(--accent); }
.stage--compact.is-complete .stage__seg { background: var(--success-solid); }
.stage--compact[data-stage-state="paused"] .stage__seg.is-current { background: var(--progress-solid); }
.stage--compact .stage__head { order: 2; flex: none; font-size: var(--fs-xs); line-height: var(--lh-xs); }
.stage--compact .stage__label { color: var(--text-2); font-weight: var(--fw-medium); }
.stage--compact .stage__name { display: none; }

/* Вертикальный (герой-карточка механика): шесть этажей снизу вверх (1 внизу, 6 вверху) в шахте
   44 × 123px; пройденные — цветом акцента, текущий — кабина акцентом, будущие — контур. Подпись этапа
   справа сверху. В .hero--shaft шахта встаёт в левую колонку карточки, подпись — в правую. */
.stage--vertical { position: relative; display: block; min-height: 123px; padding-left: 60px; }
.stage--vertical .stage__head { min-height: 18px; }
.stage--vertical .stage__track {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column-reverse; align-items: stretch; gap: 3px;
  width: 44px; height: auto; padding: 0 4px;
  box-shadow: inset 1.5px 0 0 var(--stage-future), inset -1.5px 0 0 var(--stage-future);
}
.stage--vertical .stage__track::before { display: none; }
.stage--vertical .stage__seg {
  display: grid; place-items: center; height: 18px; border-radius: 4px;
  background: var(--bg-surface); box-shadow: inset 0 0 0 1.5px var(--stage-future);
  transition: background-color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease);
}
.stage--vertical .stage__seg::after { display: none; }
.stage--vertical .stage__seg > span {
  position: static; width: auto; height: auto; overflow: visible; clip: auto;
  color: var(--text-3); font-size: 10px; line-height: 1; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
}
.stage--vertical .stage__seg.is-done { background: var(--stage-done); box-shadow: none; }
.stage--vertical .stage__seg.is-done > span { color: var(--on-stage-done); }
.stage--vertical .stage__seg.is-current { background: var(--accent-subtle); box-shadow: inset 0 0 0 1.5px var(--accent); }
.stage--vertical .stage__seg.is-current > span { color: transparent; }
.stage--vertical .stage__seg.is-current::before { bottom: auto; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.stage--vertical[data-stage-state="paused"] .stage__seg.is-current { background: var(--progress-bg); box-shadow: inset 0 0 0 1.5px var(--progress-solid); }
.stage--vertical.is-complete .stage__seg { background: var(--stage-complete); box-shadow: none; }
.stage--vertical.is-complete .stage__seg > span { color: var(--on-stage-complete); }


/* =========================================================================
   12. OVERLAYS — Ant Design: Drawer, Modal, message/notification, Dropdown, Tooltip
   ========================================================================= */
/* Drawer справа, 560px */
.drawer {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  display: flex; justify-content: flex-end;
  background: var(--bg-backdrop);
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.drawer.is-open { opacity: 1; }
.drawer__panel {
  position: relative; width: var(--drawer-w); max-width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg-surface); box-shadow: var(--shadow-overlay);
  transform: translateX(24px); transition: transform var(--dur-3) var(--ease);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__panel:focus, .modal__dialog:focus { outline: none; }
.drawer__panel--wide { width: 720px; }
.drawer__header {
  flex: none; display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.drawer__heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.drawer__eyebrow { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }
.drawer__title { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-snug); }
.drawer__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.drawer__header > .icon-btn { margin: -4px -6px 0 0; }
.drawer__nav { display: flex; align-items: center; gap: 2px; flex: none; color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.drawer__tabs { flex: none; padding: 0 var(--space-6); }
.drawer__body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-5) var(--space-6) var(--space-6); overscroll-behavior: contain; }
.drawer__section + .drawer__section { margin-top: var(--space-6); }
.drawer__section-title { margin-bottom: var(--space-3); color: var(--text-1); font-size: var(--fs-base); line-height: var(--lh-base); font-weight: var(--fw-semibold); }
.drawer__extra { flex: none; padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border-subtle); background: var(--bg-subtle); }
.drawer__footer {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--border); background: var(--bg-surface);
}
.drawer__footer .spacer { flex: 1; }

/* Modal по центру */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-8) var(--space-4);
  background: var(--bg-backdrop);
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.modal.is-open { opacity: 1; }
.modal__dialog {
  width: var(--modal-w); max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column;
  background: var(--bg-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-overlay);
  transform: translateY(8px) scale(.985); transition: transform var(--dur-3) var(--ease);
}
.modal.is-open .modal__dialog { transform: none; }
.modal__dialog--lg { width: 720px; }
.modal__dialog--xl { width: 880px; }
.modal__dialog--sm { width: 420px; }
.modal__header { flex: none; display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0 var(--space-6); }
.modal__heading { flex: 1; min-width: 0; }
.modal__title { font-family: var(--font-display); font-size: 20px; line-height: 26px; font-weight: var(--fw-semibold); letter-spacing: var(--tracking-snug); }
.modal__subtitle { margin-top: 2px; color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.modal__header > .icon-btn { margin: -2px -6px 0 0; }
.modal__body { flex: 1 1 auto; overflow-y: auto; padding: var(--space-5) var(--space-6); }
.modal__footer {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-subtle);
}
.modal__footer .spacer { flex: 1; }

/* Toast внизу по центру — window.showToast(text, {action, onAction}) */
.toast-region {
  position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  width: max-content; max-width: calc(100vw - 32px);
  transform: translateX(-50%); pointer-events: none;
}
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 44px; max-width: 520px; padding: 8px 8px 8px 14px;
  background: var(--bg-inverse); color: var(--text-inverse);
  border-radius: 12px; box-shadow: var(--shadow-popover);
  font-size: var(--fs-base); line-height: var(--lh-base);
  animation: lc-toast-in var(--dur-2) var(--ease);
}
.toast__icon { width: 18px; height: 18px; color: var(--green-500); }
.toast--danger .toast__icon { color: var(--red-500); }
.toast--info .toast__icon { color: var(--indigo-300); }
.toast__text { min-width: 0; padding-right: 4px; }
.toast__action {
  flex: none; height: 30px; padding: 0 10px; border-radius: 8px;
  color: var(--indigo-300); font-weight: var(--fw-semibold);
  transition: background-color var(--dur-1);
}
.toast__action:hover { background: rgb(255 255 255 / .08); }
.toast__close { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--gray-400); }
.toast__close:hover { background: rgb(255 255 255 / .08); color: var(--text-inverse); }
.toast__close .icon { width: 16px; height: 16px; }
.toast__timer {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--indigo-300); opacity: .7; transform-origin: left center;
  animation: lc-toast-timer linear forwards; animation-duration: var(--toast-duration, 5s);
}
.toast:hover .toast__timer { animation-play-state: paused; }
.toast.is-leaving { animation: lc-toast-out var(--dur-1) ease forwards; }

/* Dropdown menu */
.dropdown { position: relative; display: inline-flex; }
.dropdown__menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-dropdown);
  display: none; min-width: 220px; max-width: 360px; padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-popover);
}
.dropdown.is-open > .dropdown__menu { display: block; animation: lc-pop-in var(--dur-1) var(--ease); }
.dropdown--end > .dropdown__menu { left: auto; right: 0; }
.dropdown--up > .dropdown__menu { top: auto; bottom: calc(100% + 6px); }
.dropdown--wide > .dropdown__menu { width: 360px; }
.dropdown__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 36px; padding: 6px 10px; border-radius: 8px;
  color: var(--text-1); font-size: var(--fs-base); line-height: var(--lh-base); text-align: left;
  cursor: pointer; transition: background-color var(--dur-1);
}
.dropdown__item > .icon { width: 18px; height: 18px; color: var(--text-3); }
.dropdown__item:hover, .dropdown__item:focus-visible { background: var(--bg-hover); outline: none; }
.dropdown__item.is-selected { font-weight: var(--fw-medium); }
.dropdown__item.is-selected::after {
  content: ""; flex: none; width: 16px; height: 16px; margin-left: auto; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dropdown__item--danger, .dropdown__item--danger > .icon { color: var(--danger-fg); }
.dropdown__item--danger:hover { background: var(--danger-bg); }
.dropdown__item-text { display: flex; flex-direction: column; min-width: 0; }
.dropdown__item-meta { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.dropdown__item-end { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); }
.dropdown__divider { height: 1px; margin: 4px -4px; background: var(--border); }
.dropdown__label { padding: 8px 10px 4px; color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.dropdown__header { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.dropdown__header-text { display: flex; flex-direction: column; min-width: 0; }
.dropdown__header-text b { font-weight: var(--fw-semibold); }
.dropdown__header-text span { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }

/* Tooltip — data-tooltip="Текст" на кнопке/обёртке (не на <svg>); data-tooltip-pos="bottom|right" */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: var(--z-tooltip);
  width: max-content; max-width: 260px; padding: 6px 9px; border-radius: 8px;
  background: var(--bg-inverse); color: var(--text-inverse);
  font-family: var(--font-sans); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium);
  letter-spacing: 0; text-transform: none; text-align: left; white-space: normal;
  opacity: 0; pointer-events: none; transform: translate(-50%, 4px);
  transition: opacity var(--dur-1), transform var(--dur-1);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
[data-tooltip-pos="bottom"]::after { top: calc(100% + 8px); bottom: auto; transform: translate(-50%, -4px); }
[data-tooltip-pos="bottom"]:hover::after, [data-tooltip-pos="bottom"]:focus-visible::after { transform: translate(-50%, 0); }
[data-tooltip-pos="right"]::after { left: calc(100% + 10px); top: 50%; bottom: auto; transform: translate(-4px, -50%); }
[data-tooltip-pos="right"]:hover::after, [data-tooltip-pos="right"]:focus-visible::after { transform: translate(0, -50%); }


/* =========================================================================
   13. DATA DISPLAY
   ========================================================================= */
/* Avatar — Ant Design: Avatar, Avatar.Group */
.avatar {
  --size: 32px;
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-tile-fg);
  font-size: calc(var(--size) * .375); line-height: 1; font-weight: var(--fw-semibold);
  letter-spacing: .01em; text-transform: uppercase; user-select: none;
}
.avatar--xs { --size: 20px; font-size: 9px; }
.avatar--sm { --size: 24px; }
.avatar--lg { --size: 40px; }
.avatar--xl { --size: 56px; }
.avatar--neutral { background: var(--neutral-bg); color: var(--neutral-fg); }
.avatar--online::after, .avatar--offline::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success-solid); box-shadow: 0 0 0 2px var(--bg-surface);
}
.avatar--offline::after { background: var(--border-hover); }
.avatar-group { display: inline-flex; align-items: center; }
.avatar-group > .avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.avatar-group > .avatar + .avatar { margin-left: -6px; }

/* Description list — Ant Design: Descriptions */
.dl { display: grid; grid-template-columns: minmax(120px, 36%) minmax(0, 1fr); gap: 10px var(--space-4); }
.dl > dt { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-base); }
.dl > dd { min-width: 0; margin: 0; color: var(--text-1); }
.dl--stacked { grid-template-columns: minmax(0, 1fr); gap: 2px; }
.dl--stacked > dd + dt { margin-top: 10px; }

/* List rows — Ant Design: List */
.list { display: flex; flex-direction: column; }
.list__item {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 52px; padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left; color: inherit;
}
.list--wrap .list__title, .list--wrap .list__sub { white-space: normal; }
.list__item:last-child { border-bottom: 0; }
.list__body { flex: 1 1 auto; min-width: 0; }
.list__title { color: var(--text-1); font-weight: var(--fw-medium); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list__sub { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list__end { flex: none; display: flex; align-items: center; gap: var(--space-2); color: var(--text-2); font-variant-numeric: tabular-nums; }
.list--interactive .list__item {
  margin: 0 -10px; padding-left: 10px; padding-right: 10px;
  border-radius: var(--radius-md); border-bottom-color: transparent; cursor: pointer;
  transition: background-color var(--dur-1);
}
.list--interactive .list__item:hover { background: var(--bg-hover); }

/* Timeline / история — Ant Design: Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline__item {
  --dot: var(--neutral-solid);
  position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--space-3);
  padding-bottom: var(--space-4);
}
.timeline__item::before {
  content: ""; position: absolute; left: 9.5px; top: 20px; bottom: 2px;
  width: 1px; background: var(--border);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  width: 10px; height: 10px; margin: 5px auto 0; border-radius: 50%;
  background: var(--bg-surface); box-shadow: inset 0 0 0 2px var(--dot);
}
.timeline__item--info { --dot: var(--info-solid); }
.timeline__item--progress { --dot: var(--progress-solid); }
.timeline__item--warning { --dot: var(--warning-solid); }
.timeline__item--danger { --dot: var(--danger-solid); }
.timeline__item--success { --dot: var(--success-solid); }
.timeline__item--current .timeline__dot { background: var(--dot); box-shadow: 0 0 0 3px var(--bg-surface), 0 0 0 4px var(--dot); }
.timeline__title { color: var(--text-1); font-size: var(--fs-base); line-height: var(--lh-base); }
.timeline__title b { font-weight: var(--fw-semibold); }
.timeline__meta { margin-top: 2px; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); font-variant-numeric: tabular-nums; }
.timeline__body {
  margin-top: var(--space-2); padding: 8px 10px;
  background: var(--bg-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm);
}

/* Комментарии */
.comments { display: flex; flex-direction: column; gap: var(--space-4); }
.comment { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.comment__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.comment__author { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.comment__time { color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.comment__text { margin-top: 2px; color: var(--text-1); }
.composer { display: flex; align-items: flex-end; gap: var(--space-2); }
.composer .textarea { min-height: 44px; height: 44px; resize: none; }

/* Файлы и вложения */
.files { display: grid; gap: var(--space-2); }
.files > .file { min-width: 0; }
.file {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px var(--space-3);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.file__body { flex: 1 1 auto; min-width: 0; }
.file__name { color: var(--text-1); font-weight: var(--fw-medium); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file__meta { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.file .loader--cabin { flex: none; }        /* v4: кабина-загрузка в строке файла не сжимается */

/* Фото до/после и загрузка */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
.photo {
  position: relative; overflow: hidden;
  display: grid; place-items: center; aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background: var(--photo-bg);
  color: rgb(255 255 255 / .92);
}
.photo > .icon { width: 24px; height: 24px; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__label {
  position: absolute; left: 6px; bottom: 6px;
  height: 20px; padding: 0 6px; border-radius: 5px;
  display: inline-flex; align-items: center;
  background: rgb(21 25 35 / .7); color: var(--text-inverse);
  font-size: 11px; font-weight: var(--fw-medium);
}
.photo--missing { background: var(--bg-subtle); color: var(--text-3); box-shadow: inset 0 0 0 1.5px var(--border); }
.upload-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  aspect-ratio: 4 / 3; padding: var(--space-2);
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md);
  background: var(--bg-subtle); color: var(--text-3);
  font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-medium); text-align: center;
  cursor: pointer; transition: border-color var(--dur-1), color var(--dur-1), background-color var(--dur-1);
}
.upload-tile:hover { border-color: var(--accent); color: var(--accent-fg); background: var(--accent-subtle); }
.upload-tile .icon { width: 22px; height: 22px; }

/* Progress (meter) — Ant Design: Progress */
.progress {
  --value: 0%; --bar: var(--accent); --track: var(--info-track);
  position: relative; overflow: hidden;
  height: 6px; border-radius: var(--radius-full); background: var(--track);
}
.progress::before {
  content: ""; position: absolute; inset: 0 auto 0 0;
  width: var(--value); border-radius: inherit; background: var(--bar);
  transition: width var(--dur-3) var(--ease);
}
.progress--success { --bar: var(--success-solid); --track: var(--success-track); }
.progress--warning { --bar: var(--warning-solid); --track: var(--warning-track); }
.progress--danger  { --bar: var(--danger-solid);  --track: var(--danger-track); }
.progress--neutral { --bar: var(--neutral-solid); --track: var(--neutral-track); }
.progress--sm { height: 4px; }
.progress--lg { height: 8px; }
.progress-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  margin-bottom: 6px; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm);
}
.progress-row b { color: var(--text-1); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* Кольцевой показатель — Ant Design: Progress type="circle" */
.ring {
  --value: 0; --size: 88px; --thickness: 8px; --bar: var(--accent); --track: var(--info-track);
  position: relative; flex: none;
  display: inline-grid; place-items: center; width: var(--size); height: var(--size);
}
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--bar) calc(var(--value) * 1%), var(--track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), #000 calc(100% - var(--thickness) + 1px));
          mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), #000 calc(100% - var(--thickness) + 1px));
}
.ring__value { position: relative; font-family: var(--font-display); font-size: 20px; line-height: 24px; font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.ring--success { --bar: var(--success-solid); --track: var(--success-track); }

/* Alert — Ant Design: Alert */
.alert {
  --alert-bg: var(--info-bg); --alert-border: var(--info-border); --alert-icon: var(--info-solid);
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--alert-bg); border: 1px solid var(--alert-border); border-radius: 12px;
  color: var(--text-1); font-size: var(--fs-base); line-height: var(--lh-base);
}
.alert > .icon { flex: none; color: var(--alert-icon); }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { font-weight: var(--fw-semibold); }
.alert__text { color: var(--text-2); }
.alert__actions { flex: none; display: flex; align-items: center; gap: var(--space-2); margin: -4px -4px -4px 0; }
.alert--success { --alert-bg: var(--success-bg); --alert-border: var(--success-border); --alert-icon: var(--success-solid); }
.alert--progress { --alert-bg: var(--progress-bg); --alert-border: var(--progress-border); --alert-icon: var(--progress-icon); }
.alert--warning { --alert-bg: var(--warning-bg); --alert-border: var(--warning-border); --alert-icon: var(--warning-solid); }
.alert--danger  { --alert-bg: var(--danger-bg);  --alert-border: var(--danger-border);  --alert-icon: var(--danger-solid); }
.alert--neutral { --alert-bg: var(--bg-subtle); --alert-border: var(--border); --alert-icon: var(--text-3); }

/* Пустое состояние — Ant Design: Empty */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--space-10) var(--space-6); text-align: center;
}
.empty__art { width: 140px; height: auto; margin-bottom: var(--space-3); }
.empty__title { font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.empty__text { max-width: 380px; color: var(--text-2); }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-4); }
.empty--compact { flex-direction: row; align-items: center; gap: var(--space-4); padding: var(--space-4); text-align: left; }
.empty--compact .empty__art { width: 72px; margin: 0; }
.empty__art--display { width: 96px; }
.empty--compact .empty__art--display { width: 80px; }

/* Skeleton — Ant Design: Skeleton */
.skeleton {
  display: block; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
  background-size: 200% 100%;
  animation: lc-shimmer 1.4s ease-in-out infinite;
}
.skeleton--text { height: 12px; }
.skeleton--title { height: 18px; width: 45%; }
.skeleton--circle { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.skeleton--block { height: 88px; border-radius: 12px; }

/* Календарь месяца (план ТО) — Ant Design: Calendar */
.calendar { overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.calendar__weekdays, .calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar--workweek .calendar__weekdays, .calendar--workweek .calendar__grid { grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .5fr)); }
.calendar__weekdays > * {
  padding: 8px 10px; background: var(--bg-subtle); border-bottom: 1px solid var(--border);
  color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.calendar__day {
  min-width: 0; min-height: 104px; padding: 6px 8px 8px;
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
}
.calendar__day:nth-child(7n) { border-right: 0; }
.calendar__day.is-weekend { background: var(--bg-subtle); }
.calendar__day.is-muted { background: var(--bg-subtle); }
.calendar__day.is-muted .calendar__date { color: var(--text-disabled); }
.calendar__date {
  display: grid; place-items: center; width: 24px; height: 24px; margin-left: -4px; border-radius: 50%;
  color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums;
}
.calendar__day.is-today .calendar__date { background: var(--accent); color: var(--on-accent); }
.calendar__event {
  --ev-fg: var(--info-fg); --ev-bg: var(--info-bg); --ev-dot: var(--info-solid);
  display: flex; align-items: center; gap: 5px; min-width: 0;
  padding: 2px 6px; border-radius: var(--radius-xs);
  background: var(--ev-bg); color: var(--ev-fg);
  font-size: 11.5px; line-height: 16px; font-weight: var(--fw-medium);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.calendar__event > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.calendar__event::before { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--ev-dot); }
.calendar__event--done    { --ev-fg: var(--success-fg); --ev-bg: var(--success-bg); --ev-dot: var(--success-solid); }
.calendar__event--missed  { --ev-fg: var(--danger-fg);  --ev-bg: var(--danger-bg);  --ev-dot: var(--danger-solid); }
.calendar__event--planned { --ev-fg: var(--planned-fg); --ev-bg: var(--planned-bg); --ev-dot: var(--planned-solid); }
.calendar__event--more    { --ev-fg: var(--text-3); --ev-bg: transparent; padding-left: 0; }
.calendar__event--more::before { display: none; }

/* Чек-лист: заполнение (механик) и просмотр (супервайзер) */
.checklist { overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.checklist__item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  min-height: 52px; padding: 14px var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.checklist__item:last-child { border-bottom: 0; }
label.checklist__item { cursor: pointer; }
.checklist__text { flex: 1 1 auto; min-width: 0; line-height: 22px; }
.checklist__hint { display: block; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.checklist__mark { flex: none; width: 22px; height: 22px; }
.checklist__mark--ok { color: var(--success-solid); }
.checklist__mark--fail { color: var(--danger-solid); }
.checklist__mark--na { color: var(--border-hover); }

/* Оценка 1–5 — Ant Design: Rate */
.rating { display: inline-flex; gap: 2px; }
.rating__star {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md);
  color: var(--star-off); transition: color var(--dur-1), background-color var(--dur-1);
}
.rating__star .icon { width: 28px; height: 28px; fill: currentColor; stroke: currentColor; }
.rating__star:hover { background: var(--bg-hover); }
.rating__star.is-on { color: var(--accent); }

/* Графики: легенда, оси, подсказка (палитра: --chart-*) */
.chart { position: relative; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--chart-label); font-family: var(--font-sans); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.legend { display: flex; flex-wrap: wrap; gap: 6px var(--space-4); color: var(--text-2); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--swatch, var(--chart-1)); flex: none; }
.legend__swatch.is-dot { border-radius: 50%; }
.legend__line { width: 14px; height: 2px; border-radius: 1px; background: var(--swatch, var(--chart-1)); flex: none; }
.chart-tip {
  position: absolute; z-index: var(--z-tooltip); pointer-events: none;
  min-width: 150px; padding: 8px 10px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-popover);
  font-size: var(--fs-xs); line-height: var(--lh-xs);
}
.chart-tip__title { margin-bottom: 4px; color: var(--text-3); }
.chart-tip__row { display: flex; align-items: center; gap: 6px; }
.chart-tip__row b { margin-left: auto; padding-left: 12px; color: var(--text-1); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }


/* =========================================================================
   14. MOBILE — phone frame 390×844, screen header, tab bar, offline bar
   ?full=1 (или экран ≤ 500px) убирает рамку: html.is-full
   ========================================================================= */
.phone-stage {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; gap: var(--space-12);
  padding: var(--space-8) var(--space-6);
}
.phone-stage__aside { width: 300px; display: flex; flex-direction: column; gap: var(--space-3); }
.phone-stage__aside .brand { margin-bottom: var(--space-4); }
.phone-stage__title { font-family: var(--font-display); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.phone-stage__text { color: var(--text-2); }
.phone-stage__links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

.phone {
  --phone-w: 390px; --phone-h: 844px; --tabbar-h: 64px; --home-h: 22px;
  position: relative; flex: none;
  width: calc(var(--phone-w) + 24px); height: calc(var(--phone-h) + 24px);
  padding: 12px; border-radius: 62px;
  background: #15171B;
  box-shadow: inset 0 0 0 1.5px #33353B, 0 40px 80px -32px rgb(21 25 35 / .42);
}
.phone::before {
  content: ""; position: absolute; top: 25px; left: 50%; z-index: 20;
  width: 112px; height: 32px; border-radius: 20px; background: #000;
  transform: translateX(-50%);
}
.phone__screen {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  border-radius: 50px; background: var(--bg-page);
}
.phone__status {
  flex: none; height: 54px; padding: 18px 30px 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-surface);
  color: var(--text-1); font-size: 15px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums;
}
.phone__status-icons { display: flex; align-items: center; gap: 6px; }
.phone__status-icons svg { display: block; height: 12px; width: auto; fill: currentColor; }
.phone__home {
  position: absolute; left: 50%; bottom: 8px; z-index: 20;
  width: 134px; height: 5px; border-radius: 3px; background: var(--phone-home);
  transform: translateX(-50%); pointer-events: none;
}
.m-app {
  position: relative; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
.m-app::-webkit-scrollbar { display: none; }
.view { min-height: 100%; display: flex; flex-direction: column; }
.m-header {
  position: sticky; top: 0; z-index: 5; flex: none;
  height: 56px; padding: 0 8px 0 16px;
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle);
}
.m-header__back { margin-left: -8px; }
.m-header__title { flex: 1 1 auto; min-width: 0; font-family: var(--font-display); font-size: 17px; line-height: 22px; font-weight: var(--fw-semibold); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-content { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-6); }
.m-title { font-family: var(--font-display); font-size: var(--fs-lead); line-height: var(--lh-lead); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); }
.m-caption { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.m-section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.m-sticky-actions {
  position: sticky; bottom: 0; z-index: 4;
  margin-top: auto; padding: var(--space-3) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
}
.tabbar {
  flex: none; position: relative; z-index: 6;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  height: calc(var(--tabbar-h) + var(--home-h)); padding: 6px 8px var(--home-h);
  background: var(--bg-surface); border-top: 1px solid var(--border-subtle);
}
.tabbar__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 48px; border-radius: var(--radius-md);
  color: var(--text-3); font-size: 11px; line-height: 14px; font-weight: var(--fw-medium);
  transition: color var(--dur-1);
}
.tabbar__item .icon { width: 24px; height: 24px; }
.tabbar__item.is-active { color: var(--primary-fg); font-weight: var(--fw-semibold); }
.tabbar__item > .badge { position: absolute; top: 2px; left: calc(50% + 6px); }
.offline-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px var(--space-4);
  background: var(--progress-bg); border-bottom: 1px solid var(--progress-border);
  color: var(--progress-fg); font-size: var(--fs-sm); line-height: var(--lh-sm);
}
.offline-bar .icon { width: 18px; height: 18px; color: var(--progress-fg); }
.offline-bar b { font-weight: var(--fw-semibold); }

/* Слои внутри телефона: drawer/modal становятся листами снизу */
.phone .drawer, .phone .modal { position: absolute; }
.phone .modal { align-items: flex-end; padding: 0; }
.phone .modal__dialog { width: 100%; max-height: 88%; border-radius: 20px 20px 0 0; transform: translateY(32px); }
.phone .modal.is-open .modal__dialog { transform: none; }
.phone .modal__dialog::before {
  content: ""; align-self: center; flex: none; width: 36px; height: 4px; margin-top: 8px;
  border-radius: 2px; background: var(--grabber);
}
.phone .modal__header { padding: var(--space-3) var(--space-4) 0 var(--space-5); }
.phone .modal__body { padding: var(--space-4) var(--space-5); }
.phone .modal__footer { padding: var(--space-3) var(--space-5) calc(var(--space-3) + var(--home-h)); flex-direction: column-reverse; align-items: stretch; }
.phone .drawer__panel { width: 100%; }
.phone .toast-region { position: absolute; bottom: calc(var(--tabbar-h) + var(--home-h) + 12px); max-width: calc(100% - 24px); }
.phone .toast { max-width: 100%; }

/* Полноэкранный режим (?full=1, узкий экран) */
html.is-full .phone-stage, html.is-narrow .phone-stage { display: block; min-height: 0; padding: 0; }
html.is-full .phone-stage__aside, html.is-narrow .phone-stage__aside { display: none; }
html.is-full .phone-stage .phone, html.is-narrow .phone-stage .phone {
  --home-h: 0px;
  width: 100%; max-width: 560px; height: 100vh; height: 100dvh; margin: 0 auto; padding: 0; border-radius: 0;
  background: none; box-shadow: none; zoom: 1;
}
@media (min-width: 561px) {
  html.is-full .phone-stage .phone { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
html.is-full .phone-stage .phone::before, html.is-narrow .phone-stage .phone::before,
html.is-full .phone-stage .phone__status, html.is-narrow .phone-stage .phone__status,
html.is-full .phone-stage .phone__home, html.is-narrow .phone-stage .phone__home { display: none; }
html.is-full .phone-stage .phone__screen, html.is-narrow .phone-stage .phone__screen { border-radius: 0; }
html.is-full .phone-stage .tabbar, html.is-narrow .phone-stage .tabbar { padding-bottom: env(safe-area-inset-bottom, 0px); height: auto; min-height: var(--tabbar-h); }


/* =========================================================================
   15. RESPONSIVE — офис 1280–1600, не ломается на 1024 и 768
   Панель: 76px с подписями → ≤ 1024 60px только иконки с подсказками →
   ≤ 768 скрыта, в контекстной полосе бургер с пунктами панели.
   ========================================================================= */
@media (max-width: 1200px) {
  .grid > .col-2 { grid-column: span 4; }
}
@media (max-width: 1024px) {
  :root { --page-pad: 20px; --rail-w: 60px; }
  .rail { padding: 12px 6px 10px; }
  .rail__brand { height: 40px; margin: 0 0 12px; }
  .rail__brand .icon { width: 34px; height: 34px; }
  .rail__item, .rail__foot .rail__item { min-height: 44px; padding: 0; gap: 0; }
  .rail__label, .rail .city-switch__label { display: none; }
  .rail__item > .count { top: 3px; left: calc(50% + 3px); min-width: 16px; height: 15px; padding: 0 4px; font-size: 9.5px; }
  .topbar__inner { gap: var(--space-4); }
  .grid > .col-3 { grid-column: span 6; }
  .grid > .col-md-3 { grid-column: span 3; } .grid > .col-md-4 { grid-column: span 4; }
  .grid > .col-md-6 { grid-column: span 6; } .grid > .col-md-8 { grid-column: span 8; }
  .grid > .col-md-12 { grid-column: 1 / -1; }
  .table-wrap { overflow-x: auto; }
  .table th { top: 0; }
  .search.is-open .search__field { width: 260px; }
}
@media (max-width: 900px) {
  .topnav { display: none; }
  .topbar .topnav-burger { display: inline-flex; }
  .brand__sub { display: none; }
}
@media (max-width: 768px) {
  :root { --page-pad: 16px; --rail-w: 0px; }
  .rail { display: none; }
  .context-bar__inner { gap: var(--space-2); }
  .context-bar .topnav-burger, .context-bar__brand { display: inline-flex; }
  .context-bar__scope .context-bar__extra { display: none; }
  .page { padding-top: 20px; }
  .page-header__title { font-size: 24px; line-height: 30px; }
  .grid > .col-2, .grid > .col-3, .grid > .col-4 { grid-column: span 6; }
  .grid > .col-5, .grid > .col-6, .grid > .col-7, .grid > .col-8, .grid > .col-9,
  .grid > .col-10, .grid > .col-11 { grid-column: 1 / -1; }
  .grid > .col-sm-6 { grid-column: span 6; } .grid > .col-sm-12 { grid-column: 1 / -1; }
  .grid > .col-md-12 { grid-column: 1 / -1; } /* keep full width below 768 too */
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl > dd + dt { margin-top: 10px; }
  .drawer__panel, .drawer__panel--wide { width: 100%; }
  .drawer__header, .drawer__body, .drawer__footer { padding-left: var(--space-4); padding-right: var(--space-4); }
  .drawer__tabs { padding: 0 var(--space-4); }
  .toolbar__end { margin-left: 0; }
  .toolbar__search { width: 100%; }
  .search.is-open .search__field { width: calc(100vw - 120px); }
  .phone-stage { flex-direction: column; gap: var(--space-6); }
  .phone-stage__aside { width: 100%; max-width: 414px; }
  .calendar__day { min-height: 76px; padding: 4px; }
  .calendar__event { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .calendar__event::before { display: none; }
}
@media (max-width: 480px) {
  .grid > [class*="col-"] { grid-column: 1 / -1; }
  .page-header__actions { width: 100%; }
  .page-header__actions > .btn { flex: 1 1 auto; }
  .topbar__tools .city-switch__label { display: none; }
  .exceptions-empty { flex-direction: column; text-align: center; }
}
/* Рамка телефона на невысоких экранах */
@media (min-width: 501px) and (max-height: 940px) { html:not(.is-full) .phone-stage .phone { zoom: .9; } }
@media (min-width: 501px) and (max-height: 840px) { html:not(.is-full) .phone-stage .phone { zoom: .8; } }
@media (min-width: 501px) and (max-height: 740px) { html:not(.is-full) .phone-stage .phone { zoom: .7; } }


/* =========================================================================
   16. MOTION & ACCESSIBILITY
   ========================================================================= */
@keyframes lc-spin { to { transform: rotate(360deg); } }
@keyframes lc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes lc-pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes lc-toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lc-toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes lc-toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .toast__timer { display: none; }
}
@media (forced-colors: active) {
  .pill, .prio, .sla, .tag, .count { border: 1px solid CanvasText; }
  .rail { border-right: 1px solid CanvasText; }
  .rail__item.is-active, .rail__item[aria-current="page"] { outline: 2px solid Highlight; }
  .stage__seg.is-done::after, .stage__seg.is-current::after, .stage__seg.is-current::before { background: Highlight; }
  .stage--compact .stage__seg.is-done, .stage--compact .stage__seg.is-current,
  .stage--lg .stage__seg.is-done > span, .stage--lg .stage__seg.is-current > span,
  .stage--vertical .stage__seg.is-done, .stage--vertical .stage__seg.is-current { background: Highlight; color: HighlightText; }
  .inbox__row--critical { border-left: 3px solid CanvasText; }
}


/* =========================================================================
   17. V3 — «лифтовые» элементы и механизмы удобства (24 окт)
   Всё ниже — новые классы; классы и переменные v2 не переименованы и не
   удалены. Разметка и API — COMPONENTS.md §19–§28, образцы — design-system-v3.html.
   ========================================================================= */

/* 17.1 Ночной режим: переключатель вставляет app.js — в .rail__foot (кнопка .rail__item),
   в бургер полосы (≤ 768) и в подложку телефонной страницы (.phone-stage__links).
   Свой переключатель страницы: любой элемент с data-theme-toggle (кнопка или чекбокс). */
.theme-toggle .icon { transition: transform var(--dur-3) var(--ease); }
.theme-toggle:hover .icon { transform: rotate(-12deg); }

/* 17.2 Движущаяся кабина шахты этапов. app.js кладёт один элемент .stage__cabin первым
   ребёнком .stage__track и пишет номер этажа в --stage-i (0…5) на .stage; кабина
   переезжает за 280 мс (--dur-3, --ease). Статичный глиф текущего этажа скрыт (.has-cabin). */
.stage__cabin {
  position: absolute; z-index: 2; left: 0; bottom: 7px;
  display: block; width: calc((100% - 30px) / 6); height: 14px;
  list-style: none; pointer-events: none;
  transform: translateX(calc(var(--stage-i, 0) * (100% + 6px)));
  transition: transform var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease);
}
.stage__cabin::before {
  content: ""; position: absolute; left: 50%; top: 0;
  width: 14px; height: 14px; margin-left: -7px;
  background: var(--accent);
  -webkit-mask: var(--stage-cabin) center / contain no-repeat;
          mask: var(--stage-cabin) center / contain no-repeat;
}
.stage.has-cabin .stage__seg.is-current::before { display: none; }
.stage.is-complete .stage__cabin { opacity: 0; }
.stage[data-stage-state="paused"] .stage__cabin::before { background: var(--progress-solid); }
/* --lg: колонки без зазора, кабина 16px по центру этажа-квадрата */
.stage--lg .stage__cabin { top: 50%; bottom: auto; width: calc(100% / 6); height: 16px; margin-top: -8px; transform: translateX(calc(var(--stage-i, 0) * 100%)); }
.stage--lg .stage__cabin::before { width: 16px; height: 16px; margin-left: -8px; }
/* --compact: «кабина» — сигнальная риска 10 × 5, ездит по шести слотам (шаг 13px) */
.stage--compact .stage__cabin { top: 50%; bottom: auto; width: 10px; height: 5px; margin-top: -2.5px; border-radius: 2px; background: var(--accent); transform: translateX(calc(var(--stage-i, 0) * 13px)); }
.stage--compact .stage__cabin::before { display: none; }
.stage--compact.has-cabin .stage__seg.is-current { height: 3px; border-radius: 1.5px; background: var(--stage-future); }
.stage--compact[data-stage-state="paused"] .stage__cabin { background: var(--progress-solid); }
/* --vertical: шахта 44 × 123, этаж 18 + зазор 3; кабина поднимается снизу вверх */
.stage--vertical .stage__cabin { left: 4px; right: 4px; top: auto; bottom: 0; width: auto; height: 18px; transform: translateY(calc(var(--stage-i, 0) * -21px)); }
.stage--vertical .stage__cabin::before { top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; }

/* 17.3 Сигнальная лампа знака: app.js ставит body.has-critical, пока на странице видна
   критичная строка (.inbox__row--critical, .row--critical). Лампа красная, мягкая пульсация 2 с. */
@property --lamp-o { syntax: "<number>"; inherits: true; initial-value: 1; }
body.has-critical { --brand-lamp: var(--lamp-critical); --brand-lamp-on-dark: var(--lamp-critical-on-dark); }
body.has-critical svg.icon:has(> use[href="#i-brand"]),
body.has-critical svg.icon:has(> use[href="#i-brand-rail"]) { animation: lc-lamp-pulse 2s ease-in-out infinite; }
@keyframes lc-lamp-pulse { 0%, 100% { --lamp-o: 1; } 50% { --lamp-o: .32; } }

/* 17.4 Загрузка «кабина едет» (20px): ожидание PDF/XLSX, тост { loading: true } */
.loader { display: inline-block; flex: none; vertical-align: middle; }
.loader--cabin { position: relative; width: 14px; height: 20px; color: var(--loader-ink); }
.loader--cabin::after {                    /* шахта: две направляющие */
  content: ""; position: absolute; inset: 0;
  border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; opacity: .38;
}
.loader--cabin::before {                   /* кабина */
  content: ""; position: absolute; left: 3px; right: 3px; top: 2px; height: 7px;
  border-radius: 1.5px; background: currentColor;
  animation: lc-cabin-ride 1.6s var(--ease) infinite alternate;
}
@keyframes lc-cabin-ride { 0%, 12% { transform: translateY(9px); } 88%, 100% { transform: translateY(0); } }
.toast__loader { margin: 0 1px; color: var(--indigo-300); }
.btn .loader--cabin { color: inherit; }

/* 17.5 Иллюстрации из спрайта: <svg class="illo" aria-hidden="true"><use href="#illo-…"/></svg>.
   Цвета — через --illo-ink / --illo-paper / --illo-white / --illo-accent (ночной режим сам). */
.illo { display: inline-block; flex: none; width: 140px; height: auto; aspect-ratio: 200 / 168; overflow: visible; vertical-align: middle; }
.illo:has(> use[href="#illo-shaft-with-cabin"]) { aspect-ratio: 400 / 480; }
.illo:has(> use[href="#illo-service-van"]) { aspect-ratio: 224 / 136; }
.illo:has(> use[href="#illo-mechanic-with-toolbox"]) { aspect-ratio: 200 / 224; }
.illo:has(> use[href="#illo-floor-display"]) { aspect-ratio: 96 / 72; }
.empty__art.illo { display: block; }
.inbox__empty .illo, .exceptions-empty .illo { width: 72px; }
/* Пока страница показывает <img src="assets/illustrations/…"> на светлой поверхности, ночью
   рисунок переводится в тёмный фильтром (переходное правило; спрайт — правильный путь, §19) */
html[data-theme="dark"] :is(.empty, .inbox__empty, .exceptions-empty, .card, .hero) img[src*="illustrations/"] {
  filter: invert(1) hue-rotate(180deg) brightness(1.18) contrast(.88);
}

/* 17.6 Схема объекта — LC.buildingSchematic(el, data) или [data-schematic='{…}'].
   Дом в разрезе: этажи — линии, подъезды — секции, лифт — шахта с кабиной цвета статуса
   (форма тоже говорит: сплошная — работает, «×» — остановлен, штриховка — в ремонте,
   пунктир — выведен). Статус никогда только цветом: под схемой пилюли «П1 · Работает». */
.schematic { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.schematic--mini { display: inline-grid; width: 120px; gap: 0; vertical-align: middle; }
.schematic__svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.schematic__legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.schematic .sc-building { fill: var(--schematic-paper); stroke: var(--schematic-ink); stroke-width: 1.5; }
.schematic .sc-floor { stroke: var(--schematic-line); stroke-width: 1; shape-rendering: crispEdges; }
.schematic .sc-wall { stroke: var(--schematic-ink); stroke-width: 1.5; }
.schematic .sc-shaft, .schematic .sc-machine { fill: var(--schematic-white); stroke: var(--schematic-ink); stroke-width: 1.25; }
.schematic .sc-door { fill: var(--schematic-white); stroke: var(--schematic-ink); stroke-width: 1; }
.schematic .sc-rope { stroke: var(--schematic-line); stroke-width: 1; }
.schematic .sc-ground { stroke: var(--schematic-ink); stroke-width: 1.5; }
.schematic .sc-ground-2 { stroke: var(--schematic-line); stroke-width: 1; }
.schematic .sc-cabin--operating { fill: var(--success-solid); }
.schematic .sc-cabin--stopped { fill: var(--danger-solid); }
.schematic .sc-cabin--repair { fill: var(--warning-solid); }
/* v4.2: лифт не работает — вся шахта красная (заказчик: «закрась всю шахту, чтобы было понятно») */
.schematic .sc-shaft--stopped { fill: var(--danger-border); stroke: var(--danger-solid); }
.schematic .sc-lift.is-selected .sc-shaft--stopped, .schematic .sc-lift[tabindex]:hover .sc-shaft--stopped { stroke: var(--danger-solid); }
.schematic .sc-cabin--off { fill: var(--schematic-white); stroke: var(--neutral-solid); stroke-width: 1.25; stroke-dasharray: 2 2; }
.schematic .sc-run { fill: none; stroke-width: 4; stroke-linecap: round; }
.schematic .sc-run--operating { stroke: var(--success-solid); }
.schematic .sc-run--stopped { stroke: var(--danger-solid); }
.schematic .sc-run--repair { stroke: var(--warning-solid); stroke-dasharray: 4 3; stroke-linecap: butt; }
.schematic .sc-run--off { stroke: var(--neutral-solid); stroke-dasharray: 2 3; stroke-width: 2; }
.schematic .sc-rail { fill: none; stroke: var(--schematic-ink); stroke-width: 1.25; }
.schematic .sc-mark { fill: none; stroke: var(--schematic-white); stroke-width: 1.5; stroke-linecap: round; }
.schematic .sc-label { fill: var(--text-2); font-family: var(--font-sans); font-size: 11px; font-weight: var(--fw-semibold); }
.schematic .sc-sub { fill: var(--text-3); font-family: var(--font-sans); font-size: 10.5px; }
.schematic .sc-lamp { fill: var(--accent); }
.schematic .sc-lift.is-selected .sc-shaft { stroke: var(--accent); stroke-width: 2; }
.schematic .sc-lift[tabindex] { cursor: pointer; outline: none; }
.schematic .sc-lift[tabindex]:hover .sc-shaft { stroke: var(--accent); }
.schematic .sc-lift[tabindex]:focus-visible .sc-shaft { stroke: var(--border-focus); stroke-width: 2.5; }

/* 17.6b Фото объекта и лайтбокс — .gallery, .gallery--strip, .lightbox (v4.2)
   Фото — LC_DATA assets[].photos; карточка объекта: полоса из трёх миниатюр в «Паспорте» под схемой
   и вкладка «Фото» (3 в ряд в drawer 560px, 2 при ≤ 480). Миниатюра — кнопка 4:3, клик — LC.lightbox
   (app.js §30): слой поверх drawer, тёмная подложка в обеих темах (токены --lightbox-*). */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4) var(--space-3); margin: 0; padding: 0; list-style: none; }
.gallery__item, .gallery__figure { min-width: 0; margin: 0; }
.gallery__thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius-md); background: var(--bg-muted); cursor: zoom-in;
}
.gallery__thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border-subtle); pointer-events: none; }
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease); }
.gallery__thumb:hover img { transform: scale(1.04); }
.gallery__thumb:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.gallery__caption { display: flex; flex-direction: column; gap: 2px; margin-top: var(--space-2); min-width: 0; }
.gallery__title { color: var(--text-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.gallery__meta { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.gallery__meta .link { font-weight: var(--fw-regular); }
.gallery--strip { gap: var(--space-2); }
/* полоса в «Паспорте»: под схемой, над разделом «Паспорт» */
.rec-photos { display: grid; justify-items: start; gap: var(--space-2); margin-top: var(--space-5); }
.rec-photos > .gallery { justify-self: stretch; width: 100%; }
.rec-photos__all { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.drawer--record .rec-photos + .drawer__section { margin-top: var(--space-5); }

.lightbox {
  position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1);   /* над drawer карточки, под модалками (палитра, «?» поверх просмотра) */
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--lightbox-bg); color: var(--lightbox-fg);
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox:focus { outline: none; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 64px; padding: var(--space-3) var(--space-4); }
.lightbox__counter { color: var(--lightbox-fg-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }
.lightbox__stage {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-3);
  min-height: 0; padding: 0 var(--space-4) var(--space-5);
}
.lightbox__nav--prev { grid-column: 1; }
.lightbox__figure { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); min-width: 0; margin: 0; }
.lightbox__nav--next { grid-column: 3; }
.lightbox__img {
  display: block; width: auto; height: auto; max-width: min(90vw, 100%); max-height: min(80vh, calc(100vh - 168px)); object-fit: contain;   /* 168 — полоса сверху и подпись */
  border-radius: var(--radius-md); transform: scale(.98); transition: transform var(--dur-3) var(--ease);
}
.lightbox.is-open .lightbox__img { transform: none; }
.lightbox__caption { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 640px; text-align: center; }
.lightbox__title { color: var(--lightbox-fg); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.lightbox__meta { color: var(--lightbox-fg-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }
.lightbox .link { color: var(--lightbox-link); }
.lightbox .link:hover { color: var(--lightbox-fg); }
.lightbox__btn { border-radius: var(--radius-full); background: var(--lightbox-btn); color: var(--lightbox-fg); }
.lightbox__btn:hover { background: var(--lightbox-btn-hover); color: var(--lightbox-fg); }
.lightbox__btn:focus-visible, .lightbox .link:focus-visible { outline: 2px solid var(--lightbox-focus); outline-offset: 2px; }
@media (max-width: 480px) {
  .gallery:not(.gallery--strip) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lightbox__stage { gap: var(--space-1); padding: 0 var(--space-2) var(--space-4); }
  .lightbox__nav { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox__img, .gallery__thumb img { transition: none; }
  .lightbox__img, .gallery__thumb:hover img { transform: none; }
}
@media (forced-colors: active) { .lightbox { background: Canvas; color: CanvasText; } .lightbox__btn { border: 1px solid ButtonText; } }

/* 17.7 «Здание» — навигация по этажам: LC.buildingNav(el, {floors}) или [data-building-nav].
   Чертёж: штрих индиго 1.5px, заливки фон страницы и белый; шахта с кабиной слева, кабина едет
   на выбранный этаж, на этаже загорается сигнальная лампа. Этажи снизу вверх. */
.bnav { --bn-floor-h: 64px; --bn-shaft-w: 52px; position: relative; display: grid; min-width: 0; padding: 0 10px; color: var(--text-1); }
.bnav--compact { --bn-floor-h: 52px; --bn-shaft-w: 44px; }
.bnav__roof { position: relative; height: 16px; }
.bnav__machine {
  position: absolute; left: 0; bottom: 0; width: var(--bn-shaft-w); height: 16px;
  border: 1.5px solid var(--schematic-ink); border-bottom: 0; border-radius: 4px 4px 0 0;
  background: var(--schematic-white);
}
.bnav__machine::after { content: ""; position: absolute; left: 50%; top: 4px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--schematic-ink); }
.bnav__body {
  position: relative; display: grid; grid-template-columns: var(--bn-shaft-w) minmax(0, 1fr);
  border: 1.5px solid var(--schematic-ink); border-bottom: 0; background: var(--schematic-white);
}
.bnav__shaft {
  position: relative; border-right: 1.5px solid var(--schematic-ink); background-color: var(--schematic-paper);
  background-image: repeating-linear-gradient(to top, transparent 0 calc(var(--bn-floor-h) - 1px), var(--schematic-line) calc(var(--bn-floor-h) - 1px) var(--bn-floor-h));
  background-size: 7px 100%; background-position: right 0 bottom 0; background-repeat: no-repeat;
}
.bnav__shaft::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px solid var(--schematic-line); }
.bnav__cabin {
  position: absolute; left: 9px; right: 9px; bottom: 5px; height: calc(var(--bn-floor-h) - 10px);
  border: 1.5px solid var(--schematic-ink); border-radius: 4px; background: var(--schematic-white);
  transform: translateY(calc(var(--bn-i, 0) * var(--bn-floor-h) * -1));
  transition: transform calc(var(--dur-3) + var(--bn-dist, 0) * 90ms) var(--ease);
}
.bnav__cabin::before { content: ""; position: absolute; top: 5px; bottom: 5px; left: 50%; margin-left: -.75px; border-left: 1.5px solid var(--schematic-ink); opacity: .5; }
.bnav__floors { display: flex; flex-direction: column-reverse; margin: 0; padding: 0; list-style: none; min-width: 0; }
.bnav__floor { height: var(--bn-floor-h); min-width: 0; border-top: 1px solid var(--schematic-line); }
.bnav__floor:last-child { border-top: 0; }
.bnav__link {
  display: grid; grid-template-columns: 18px auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; height: 100%; padding: 0 16px 0 10px; color: inherit; text-align: left;
  transition: background-color var(--dur-1);
}
.bnav__link:hover { background: var(--bg-row-hover); }
.bnav__link:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -3px; }
.bnav__num { color: var(--text-3); font-family: var(--font-mono); font-size: 12px; font-weight: var(--fw-semibold); text-align: right; font-variant-numeric: tabular-nums; }
.bnav__text { display: grid; min-width: 0; }
.bnav__label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--font-display); font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
.bnav__sub { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.bnav__lamp { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--stage-future); transition: background-color var(--dur-2), box-shadow var(--dur-2); }
.bnav__floor.is-active .bnav__link { background: var(--accent-subtle); }
.bnav__floor.is-active .bnav__lamp { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.bnav__ground { position: relative; height: 10px; margin: 0 -10px; border-top: 1.5px solid var(--schematic-ink); }
.bnav__ground::after { content: ""; position: absolute; left: 12px; right: 12px; top: 3px; border-top: 1px solid var(--schematic-line); }
.bnav--compact .bnav__link { gap: 10px; padding-right: 12px; }
.bnav--compact .bnav__label { font-size: var(--fs-base); line-height: var(--lh-base); }
.bnav--compact .bnav__sub { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.bnav--compact .bnav__link .icon-tile { width: 28px; height: 28px; }
.bnav--compact .bnav__link .icon-tile .icon { width: 16px; height: 16px; }

/* 17.8 Поиск-палитра (Ctrl/⌘ K, «/», кнопка поиска в полосе) — modal, вставляет app.js */
.modal--palette { align-items: flex-start; padding-top: min(12vh, 112px); }
.palette { width: 640px; max-height: min(580px, calc(100vh - 2 * min(12vh, 112px))); overflow: hidden; }
.palette__head { flex: none; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px 0 18px; border-bottom: 1px solid var(--border-subtle); }
.palette__head > .icon { color: var(--text-3); }
.palette__input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--text-1); font-size: 16px; line-height: 24px; outline: none; }
.palette__input::placeholder { color: var(--text-placeholder); opacity: 1; }
.palette__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.palette__esc { flex: none; }
.palette__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 10px; overscroll-behavior: contain; scroll-padding: 8px; }
.palette__group-title { padding: 10px 10px 4px; color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.palette__item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 10px; border-radius: var(--radius-md); cursor: pointer; }
.palette__item.is-active { background: var(--bg-selected); }
.palette__item > .icon-tile { width: 32px; height: 32px; border-radius: 50%; }
.palette__text { flex: 1 1 auto; min-width: 0; display: grid; }
.palette__title, .palette__meta { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.palette__title { color: var(--text-1); font-weight: var(--fw-medium); }
.palette__meta { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.palette__go { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: var(--fs-xs); opacity: 0; }
.palette__item.is-active .palette__go { opacity: 1; }
.palette mark { padding: 0 1px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-fg); }
.palette__empty { padding: 28px 16px 30px; text-align: center; }
.palette__empty-title { color: var(--text-1); font-weight: var(--fw-semibold); }
.palette__empty-text { margin-top: 4px; color: var(--text-3); font-size: var(--fs-sm); }
.palette__foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 10px 16px; border-top: 1px solid var(--border-subtle); background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl); color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs);
}
.palette__foot > span { display: inline-flex; align-items: center; gap: 4px; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 20px; height: 20px; padding: 0 5px;
  border: 1px solid var(--kbd-border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--kbd-bg); color: var(--text-2);
  font-family: var(--font-sans); font-size: 11px; line-height: 1; font-weight: var(--fw-medium); white-space: nowrap;
}

@media (max-width: 560px) {
  .modal--palette { padding: 12px; }
  .palette { max-height: calc(100vh - 24px); }
  .palette__foot { display: none; }
}

/* 17.9 Уведомления — drawer справа 400px (колокольчик в полосе), вставляет app.js */
.drawer__panel--narrow { width: 400px; }
.notif .drawer__header { align-items: center; }
.notif .drawer__title { display: flex; align-items: center; gap: 8px; }
.notif__group + .notif__group { margin-top: 20px; }
.notif__group-title { margin-bottom: 4px; color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.notif__list { display: grid; margin: 0 -10px; padding: 0; list-style: none; }
.notice {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: start; gap: 2px 12px;
  width: 100%; padding: 10px; border-radius: var(--radius-md);
  color: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur-1);
}
.notice:hover { background: var(--bg-row-hover); }
.notice:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.notice > .icon-tile { grid-row: span 2; border-radius: 50%; }
.notice__text { min-width: 0; color: var(--text-1); font-weight: var(--fw-medium); }
.notice__meta { grid-column: 2 / -1; min-width: 0; color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.notice__time { display: inline-flex; align-items: center; gap: 6px; padding-top: 1px; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); white-space: nowrap; font-variant-numeric: tabular-nums; }
.notice.is-unread .notice__text { font-weight: var(--fw-semibold); }
.notice.is-unread .notice__time::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.notif__empty { display: grid; justify-items: center; gap: 4px; padding: 32px 16px; text-align: center; color: var(--text-2); }

/* 17.10 Горячие клавиши — лист «?» (modal), вставляет app.js */
.shortcuts__group + .shortcuts__group { margin-top: 18px; }
.shortcuts__title { margin-bottom: 2px; color: var(--text-3); font-size: var(--fs-2xs); line-height: var(--lh-2xs); font-weight: var(--fw-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.kbd-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
.kbd-list > dt, .kbd-list > dd { min-height: 40px; display: flex; align-items: center; border-bottom: 1px solid var(--border-subtle); }
.kbd-list > dt { padding-right: 12px; color: var(--text-1); }
.kbd-list > dd { justify-content: flex-end; gap: 4px; margin: 0; color: var(--text-3); font-size: var(--fs-xs); }
.kbd-list > :nth-last-child(-n+2) { border-bottom: 0; }

/* 17.11 Таблицы: плотность «обычная / компактная» (.table-card[data-density] или <body data-density>;
   переключатель ставит app.js, выбор — localStorage «lc-density») и липкая первая колонка ≤ 1024 */
.density { flex: none; }
.density .segmented__item { height: 28px; }
.table-card__bar { display: flex; justify-content: flex-end; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.table-card.is-compact .table td { height: 36px; }
.table-card.is-compact .table th { height: 34px; }
.table-card.is-compact .table--relaxed td { height: 44px; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 1024px) {
  .table-wrap .table th:first-child { left: 0; z-index: calc(var(--z-sticky) + 1); }
  .table-wrap .table tr > th.col-check:first-child + th { left: 44px; z-index: calc(var(--z-sticky) + 1); }
  :where(.table-wrap .table tbody td:first-child),
  :where(.table-wrap .table tbody tr > .col-check:first-child + td) { position: sticky; left: 0; z-index: 1; background-color: var(--bg-surface); }
  :where(.table-wrap .table tbody tr > .col-check:first-child + td) { left: 44px; }
  :where(.table-wrap .table tbody td:first-child:not(.col-check), .table-wrap .table tbody tr > .col-check:first-child + td)::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; background: var(--border-subtle);
  }
  /* .table--no-sticky-col — без липкой колонки */
  .table-wrap .table.table--no-sticky-col th:first-child,
  .table-wrap .table.table--no-sticky-col tr > th.col-check:first-child + th { left: auto; z-index: var(--z-sticky); }
  :where(.table-wrap .table--no-sticky-col tbody) td { position: static; }
  :where(.table-wrap .table--no-sticky-col tbody) td::after { content: none; }
}

/* 17.12 Тосты v3: стек до трёх (старый уходит с анимацией), полоска времени — только у тоста
   с действием («Отменить», 5 с), загрузка — showToast(text, { loading: true }) */
.toast--loading { padding-left: 12px; }

/* 17.13 Ночной режим: доступность и мелочи */
html[data-theme="dark"] .phone { box-shadow: inset 0 0 0 1.5px #3A3D44, 0 40px 80px -32px rgb(0 0 0 / .7); }
@media (forced-colors: active) {
  .stage__cabin::before, .stage--compact .stage__cabin { background: Highlight; }
  .loader--cabin::before { background: CanvasText; }
  .palette__item.is-active, .bnav__floor.is-active .bnav__link { outline: 2px solid Highlight; }
}


/* =========================================================================
   18. V4 — «Раздел = страница»: общая карточка записи, страница-список,
   «Новое обращение». Новые классы; классы и переменные v2/v3 не менялись.
   Разметку строит app.js (LC.show.*, LC.listPage, LC.modals.newRequest),
   рецепт страницы раздела — COMPONENTS.md §31.
   ========================================================================= */

/* 18.1 Общая карточка записи #lc-record-drawer (560px): шапка с «Назад» для переходов
   обращение → наряд → объект → клиент, разделы drawer'а v2, подвал с действиями */
.drawer__header > .rec__back { margin: -4px -2px 0 -10px; }
.rec-note { margin-top: var(--space-2); color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.rec-desc { color: var(--text-1); white-space: pre-line; }
.rec-code { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.rec-code__mask { color: var(--text-3); letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.rec-cancel { margin-bottom: var(--space-5); }
.rec-cancel .alert__body { display: grid; gap: var(--space-3); }
.rec-comment--client .comment__text { padding: 8px 10px; border-radius: var(--radius-md); background: var(--accent-subtle); border: 1px solid var(--accent-soft); }
.drawer--record .comment__head .tag { margin-left: auto; }
.rec-kind { margin: var(--space-5) 0 var(--space-2); }
.rec-list { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }
.rec-rating { display: inline-flex; gap: 2px; color: var(--star-off); }
.rec-rating .icon { width: 22px; height: 22px; stroke: currentColor; }
.rec-rating .icon.is-on { color: var(--accent); }
.rec-row { cursor: pointer; }
.rec-row .list__title, .rec-row .list__sub { display: block; }
.rec-row .list__title .code { color: var(--text-1); }
.rec-row .list__end { flex-wrap: wrap; justify-content: flex-end; }
.rec-assign > .dropdown__menu, .drawer--record .drawer__footer .dropdown__menu { min-width: 300px; max-height: min(420px, 60vh); overflow-y: auto; }
.rec__audit { display: inline-flex; align-items: center; gap: 4px; }
.drawer--record .drawer__footer { flex-wrap: wrap; row-gap: var(--space-2); }
.drawer--record .schematic + .drawer__section { margin-top: var(--space-5); }
.sla--late > .icon { color: var(--danger-solid); }

/* 18.2 Страница-список LC.listPage: полоса фильтров в рамке таблицы, сегменты со счётчиками,
   поиск и выпадающие фильтры; выбранный фильтр подсвечен; строки — tr.is-clickable */
.list-card > .list-toolbar { flex-wrap: wrap; row-gap: var(--space-3); }
.list-filters { flex-wrap: wrap; justify-content: flex-end; }
.list-filter > .dropdown__menu { min-width: 248px; max-height: 420px; overflow-y: auto; }
.list-filter .btn .icon--sm { margin-right: -4px; color: var(--text-3); }
.list-filter .btn > span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.btn.is-filtered { border-color: var(--accent-border); background: var(--accent-subtle); color: var(--accent-fg); }
.btn.is-filtered .icon { color: var(--accent-fg); }
.list-table th, .list-table td { white-space: nowrap; }
.list-table th:not(:first-child):not(:last-child), .list-table td:not(:first-child):not(:last-child) { padding-left: 10px; padding-right: 10px; }
.list-table .col-fit { width: 1%; }
.list-table td.cell-wrap { white-space: normal; }
.list-table .cell-wrap .cell-stack { min-width: 200px; }
.list-table td.col-fit .cell-stack { min-width: 0; }   /* v4: стопка в узком столбце (номер, статус) не раздувает его */
.list-table .cell-note { display: block; max-width: 168px; white-space: normal; color: var(--text-3); font-family: var(--font-sans); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.list-table .cell-stack.cell-end { min-width: 0; align-items: flex-end; }
.list-table tr.list-empty-row td, .list-table tr.list-empty-row:hover td { background: var(--bg-surface); cursor: default; }
.list-foot b { color: var(--text-1); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
@media (min-width: 1400px) { .list-toolbar .toolbar__search { width: 300px; } }
/* столбцы, которые уступают место на узких экранах: --xl ≤ 1366, --lg ≤ 1200; сведения из них
   страница дублирует в соседней ячейке под классом .cell-alt (виден только когда столбец скрыт) */
.list-table .cell-alt { display: none; }
@media (max-width: 1366px) {
  .list-table .col-hide-xl { display: none; }
  .list-table .cell-alt--xl { display: block; }
}
@media (max-width: 1200px) {
  .list-table .col-hide-lg { display: none; }
  .list-table .cell-alt--lg { display: block; }
  .list-table .cell-wrap .cell-stack { min-width: 180px; }
}
@media (max-width: 1100px) {
  .list-table th, .list-table td { padding-left: 8px; padding-right: 8px; }
  .list-table .cell-wrap .cell-stack { min-width: 170px; }
}
@media (max-width: 768px) {
  .list-filters { justify-content: flex-start; }
  .list-filters > .toolbar__search { flex: 1 1 100%; }
  .list-seg { max-width: 100%; }
}

/* 18.2a Просторный список — LC.listPage({ tableClass: 'list-table--roomy' }), клиенты диспетчера и директора.
   Строка читается как карточка: 14px сверху и снизу, между колонками 32px, всё по верхней линии;
   первая линия ячейки 22px (тег, пилюля и текст стоят на одной линии), подписи 12/16.
   .cell-title — заголовок строки (полужирный; тег типа впереди — одной ширины, названия стоят ровно),
   .cell-main — вторичный текст строки. Компактная плотность (§17.11) — 8px сверху и снизу */
.list-table--roomy th { height: 44px; }
.list-table--roomy td { padding-top: 14px; padding-bottom: 14px; line-height: 22px; vertical-align: top; }
.list-table--roomy th, .list-table--roomy td,
.list-table--roomy th:not(:first-child):not(:last-child), .list-table--roomy td:not(:first-child):not(:last-child) { padding-left: 16px; padding-right: 16px; }
.list-table--roomy .cell-stack { min-width: 0; align-items: flex-start; gap: 2px; line-height: 22px; }
.list-table--roomy td.cell-wrap .cell-stack { min-width: 200px; }
.list-table--roomy .cell-sub { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.list-table--roomy .cell-title { color: var(--text-1); font-weight: var(--fw-semibold); }
.list-table--roomy .cell-title > .tag:first-child { min-width: 40px; justify-content: center; margin-right: 4px; }
.list-table--roomy .cell-main { color: var(--text-2); font-weight: var(--fw-regular); }
.table-card.is-compact .list-table--roomy td { padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 1100px) {
  .list-table--roomy th, .list-table--roomy td,
  .list-table--roomy th:not(:first-child):not(:last-child), .list-table--roomy td:not(:first-child):not(:last-child) { padding-left: 12px; padding-right: 12px; }
  .list-table--roomy th:first-child, .list-table--roomy td:first-child { padding-left: 16px; }
  .list-table--roomy th:last-child, .list-table--roomy td:last-child { padding-right: 16px; }
  .list-table--roomy td.cell-wrap .cell-stack { min-width: 180px; }
}

/* 18.3 «Новое обращение» (LC.modals.newRequest): адрес с подсказками, объект сегментами,
   норматив по типу, «Люди в кабине» переводит modal в критичный вид */
.newreq .form-step { margin-top: 0; }
.newreq .modal__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.newreq__where { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }   /* v4.2: город + адрес */
.newreq__where > .newreq__addr { flex: 1 1 280px; width: auto; }
.newreq__city .segmented__item { min-width: 84px; }
.newreq__city-one { display: inline-flex; align-items: center; height: 36px; }
.newreq__addr { display: flex; width: 100%; }
.newreq__addr > .input-icon { flex: 1 1 auto; }
.newreq__addr > .dropdown__menu { width: 100%; max-width: none; }
.newreq__objects .segmented__item { min-width: 64px; }
.newreq__objects:empty { display: none; }   /* v4.2: здание ещё не выбрано */
.newreq__norm { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 26px; color: var(--text-2); font-size: var(--fs-sm); }
.newreq__norm b { color: var(--text-1); font-weight: var(--fw-semibold); }
.newreq__people { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); }
.newreq__people .check__hint { margin-top: 2px; }
.newreq__files { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.newreq__crit { display: none; }
.newreq.is-critical .newreq__crit { display: inline-flex; }
.newreq.is-critical .modal__header { padding-bottom: var(--space-4); background: var(--danger-bg); border-bottom: 1px solid var(--danger-border); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.newreq.is-critical .newreq__people { background: var(--danger-bg); border-color: var(--danger-border); }
@media (max-width: 768px) { .newreq__files { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* =========================================================================
   19. Гайд: схемы бизнес-процессов — .g-proc, .g-flow (v4.3)
   Витрина процессов guide.html (#processes): сегменты .g-proc-tabs (data-tabs, role="tab",
   app.js переключает панели и стрелки ←/→), панели .g-proc-panel, в каждой — схема
   «роли × шаги» .g-proc. Слева дорожки ролей (--lanes штук по --lane-w), строки — шаги
   по порядку. Узел шага стоит на дорожке своей роли (--c); линия приходит от узла
   предыдущего шага (--p): вниз до границы строк, вбок, вниз в узел со стрелкой. Только
   CSS, без SVG и скрипта; схема читается и без линий — номер, роль подписью, порядок строк.
   Ветка (обход, страховка, исключение) — .g-proc__step--alt: пунктир, узел-контур;
   основная линия проходит её насквозь по дорожке --m (по умолчанию --p).
   Шаг системы — .g-proc__node--auto (контур). Роли различаются иконкой и подписью, не цветом.
   ≤ 1200 статус и ссылки уходят под текст шага; ≤ 900 схема складывается в список на одной
   дорожке. .g-flow (v3: сетка статусов, стрелки рисовал скрипт) заменена этой схемой.
   ========================================================================= */
.g-proc-tabs { flex-wrap: wrap; overflow: visible; }
.g-proc-tabs .segmented__item:focus-visible { outline-offset: -2px; }
.g-proc-legend { --g-line: var(--text-3); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: var(--space-4); color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.g-proc-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.g-proc-legend .g-proc__node { position: static; width: 22px; height: 22px; font-size: 10px; }
.g-proc-legend .g-proc__node::before, .g-proc-legend .g-proc__node::after { display: none; }
.g-proc-panel { margin-top: var(--space-6); }
@media (prefers-reduced-motion: no-preference) { .g-proc-panel:not([hidden]) { animation: lc-pop-in var(--dur-2) var(--ease); } }
.g-proc-panel__head { display: grid; gap: 6px; margin-bottom: var(--space-4); }
.g-proc-panel__title { font-size: var(--fs-lg); line-height: var(--lh-lg); }
.g-proc__ends { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.g-proc__ends b { color: var(--text-1); font-weight: var(--fw-semibold); }
.g-proc__ends > .icon { width: 16px; height: 16px; color: var(--text-3); }
.g-proc__count { margin-left: auto; color: var(--text-3); white-space: nowrap; }

/* Схема: шапка ролей, дорожки, шаги */
.g-proc {
  --lane-w: 84px; --meta-w: 216px; --col-gap: 24px; --g-line: var(--text-3);
  --lanes-w: calc(var(--lane-w) * var(--lanes, 5));
  padding: 0 var(--space-5) var(--space-1);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.g-proc__head, .g-proc__step { display: grid; grid-template-columns: var(--lanes-w) minmax(0, 1fr) var(--meta-w); column-gap: var(--col-gap); }
.g-proc__head {
  position: sticky; top: var(--g-nav-h, 0px); z-index: 3; align-items: end;
  padding: 14px 0 10px; background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.g-proc__head > .t-caps { padding-bottom: 2px; }
.g-proc__roles { display: flex; }
.g-proc__role {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: var(--lane-w);
  color: var(--text-1); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); text-align: center;
}
.g-proc__role .icon-tile { width: 28px; height: 28px; border-radius: 8px; }
.g-proc__role .icon-tile .icon { width: 16px; height: 16px; }
.g-proc__steps {
  position: relative; margin: 0; padding: 0; list-style: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--lane-w) / 2 - .5px), var(--border) 0 calc(var(--lane-w) / 2 + .5px), transparent 0 var(--lane-w)) 0 0 / var(--lanes-w) 100% no-repeat;
}
.g-proc__step {
  --x: calc(var(--lane-w) * (var(--c, 1) - .5));
  --px: calc(var(--lane-w) * (var(--p, var(--c, 1)) - .5));
  --mx: calc(var(--lane-w) * (var(--m, var(--p, var(--c, 1))) - .5));
  position: relative; grid-template-areas: "lanes body meta"; padding: 14px 0;
  background: linear-gradient(var(--border-subtle), var(--border-subtle)) right top / calc(100% - var(--lanes-w) - var(--col-gap)) 1px no-repeat;
}
.g-proc__step:first-child { background: none; }
/* линия от предыдущего узла: вбок по верху строки (::before), вниз в узел со стрелкой (узел ::before/::after);
   от своего узла вниз до конца строки (::after) */
.g-proc__step::before {
  content: ""; position: absolute; top: 0;
  left: calc(min(var(--x), var(--px)) - .75px);
  width: calc(max(var(--x), var(--px)) - min(var(--x), var(--px)) + 1.5px);
  border-top: 1.5px solid var(--g-line);
}
.g-proc__step::after { content: ""; position: absolute; top: 40px; bottom: 0; left: calc(var(--x) - .75px); border-left: 1.5px solid var(--g-line); }
.g-proc__node {
  position: absolute; left: calc(var(--x) - 13px); top: 14px; z-index: 1;
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font-family: var(--font-mono); font-size: 11px; line-height: 1; font-weight: var(--fw-semibold);
}
.g-proc__node::before { content: ""; position: absolute; left: calc(50% - .75px); bottom: 100%; height: 14px; border-left: 1.5px solid var(--g-line); }
.g-proc__node::after { content: ""; position: absolute; left: calc(50% - 4.5px); bottom: calc(100% - 1px); width: 9px; height: 6px; background: var(--g-line); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.g-proc__step:first-child::before, .g-proc__step:first-child > .g-proc__node::before,
.g-proc__step:first-child > .g-proc__node::after, .g-proc__step:last-child::after { display: none; }
.g-proc__node--auto { background: var(--bg-surface); color: var(--primary-fg); box-shadow: inset 0 0 0 1.5px var(--primary); }
.g-proc__node--alt { background: var(--bg-surface); color: var(--text-1); border: 1.5px dashed var(--g-line); }
/* ветка: свой вход пунктиром, основная линия идёт сквозь строку по дорожке --m */
.g-proc__step--alt::before { border-top-style: dashed; }
.g-proc__step--alt > .g-proc__node::before { border-left-style: dashed; }
.g-proc__step--alt::after { top: 0; left: calc(var(--mx) - .75px); }
.g-proc__step--alt > .g-proc__body { padding: 8px 12px 10px; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.g-proc__body { grid-area: body; min-width: 0; }
.g-proc__who { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.g-proc__who .icon { width: 14px; height: 14px; }
.g-proc__name { font-family: var(--font-sans); font-size: var(--fs-base); line-height: var(--lh-base); font-weight: var(--fw-semibold); }
.g-proc__text { margin-top: 2px; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.g-proc__meta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding-top: 16px; }
.g-proc__status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.g-proc__pair { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.g-proc__where { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.g-proc__where .link { display: inline-flex; align-items: center; gap: 6px; }
.g-proc__where .link .icon { width: 14px; height: 14px; vertical-align: 0; }

/* Что важно: две-три карточки под схемой */
.g-proc__notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.g-proc__note { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-content: start; }
.g-proc__note > .icon-tile { grid-row: span 2; }
.g-proc__note-title { font-family: var(--font-sans); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); }
.g-proc__note p { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.g-proc-panel .g-norms { margin-top: var(--space-4); }

@media (max-width: 1200px) {
  .g-proc__head, .g-proc__step { grid-template-columns: var(--lanes-w) minmax(0, 1fr); }
  .g-proc__head > .t-caps + .t-caps { display: none; }
  .g-proc__step { grid-template-areas: "lanes body" "lanes meta"; row-gap: 8px; }
  .g-proc__meta { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding-top: 0; }
  .g-proc__where { flex-direction: row; flex-wrap: wrap; gap: 2px 14px; }
}
@media (max-width: 1100px) {
  .g-proc { --lane-w: 74px; --col-gap: 20px; }
  .g-proc__role { font-size: var(--fs-2xs); }
}
@media (max-width: 900px) {
  /* список шагов: все узлы на одной дорожке слева, роль — подписью над шагом */
  .g-proc { --lanes-w: 26px; --col-gap: 14px; padding: 4px var(--space-4) var(--space-1); }
  .g-proc__head { display: none; }
  .g-proc__steps { background: none; }
  .g-proc__step { --x: 13px; --px: 13px; --mx: 13px; }
  .g-proc__step::before { display: none; }
  .g-proc__notes { grid-template-columns: minmax(0, 1fr); }
  .g-proc__ends { flex-direction: column; align-items: flex-start; }
  .g-proc__ends > .icon { display: none; }
  .g-proc__count { margin-left: 0; }
}
@media (max-width: 768px) {
  .g-proc-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .g-proc-tabs .segmented__item { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .g-proc-tabs { grid-template-columns: minmax(0, 1fr); }
}
@media (forced-colors: active) {
  .g-proc__node::after { background: CanvasText; }
  .g-proc__node { border: 1.5px solid CanvasText; }
}
