/* ============================================================
   PVZ Design System
   Токены, компоненты, сигнатурная анимация Login.
   Мотив: сетка ячеек ПВЗ (локер-борд). Один яркий момент —
   активация ячеек на входе; везде остальное — спокойно.
   ============================================================ */

:root {
    --ink: #14171F;
    --ink-soft: #4B5261;
    /* На фоне страницы (--paper) прежний #6B7280 давал контраст 4.47 - ниже нормы 4.5.
       Этот оттенок того же семейства даёт 4.96, оставаясь визуально приглушённым. */
    --muted: #636B7A;
    --paper: #F5F6F8;
    --surface: #FFFFFF;
    --line: #E6E8EC;

    --accent: #005BFF;
    --accent-ink: #0044CC;
    --accent-soft: #EAF1FF;

    --amber: #FF8A00;
    --amber-soft: #FFF3E4;
    --green: #17B26A;
    --green-soft: #E7F8EF;
    --red: #F04438;
    --red-soft: #FDEDEC;

    /* Заливочные оттенки выше на белом фоне дают 2.4-3.8 контраста - для текста этого мало
       (норма 4.5). Поэтому у каждого состояния есть отдельный текстовый оттенок: на белом,
       на --paper и на собственном -soft фоне он держит минимум 5.6. */
    --green-ink: #0A6E3E;
    --amber-ink: #9A4D00;
    --red-ink: #B0231A;

    /* Ещё два состояния, которых не было в палитре: «Аннулирована» и «Оспаривается».
       Их цвета жили прямо в разметке двух страниц. */
    --slate-soft: #EEF0F2;
    --slate-ink: #454C53;
    --violet-soft: #F2ECFC;
    --violet-ink: #55309B;

    --scroll-thumb: #C3C8D2;
    --scroll-thumb-hover: #A8AEBC;

    /* Ступени скругления. Раньше по трём файлам было 20 разных значений - от 3 до 24 px,
       причём соседние (5/6, 9/10, 20/22) отличались на пиксель и читались как небрежность. */
    --radius-xs: 6px;   /* мелкие элементы: значки, кнопки-иконки, поля в плотных таблицах */
    --radius-sm: 8px;   /* кнопки, поля ввода */
    --radius-md: 12px;  /* карточки, панели */
    --radius-lg: 18px;  /* крупные контейнеры, модальные окна */

    /* Тени тонированы в синеву акцента, а не чисто чёрные: серый "нейтральный" оттенок
       на цветном фоне читается как грязь, а слегка окрашенная тень сливается с палитрой. */
    --shadow-sm: 0 1px 2px rgba(24, 33, 56, .07), 0 1px 1px rgba(24, 33, 56, .04);
    --shadow-md: 0 8px 24px rgba(24, 33, 56, .10), 0 2px 6px rgba(24, 33, 56, .05);
    --shadow-lg: 0 20px 48px rgba(24, 33, 56, .18), 0 4px 12px rgba(24, 33, 56, .08);

    --ease: cubic-bezier(.2, .7, .3, 1);

    /* Шкала кеглей. До неё в трёх файлах жили 35 разных размеров - .7, .72, .75, .78, .8, .82,
       .85, .875, .88, .9 rem и так далее, то есть по несколько неразличимых вариантов одного и
       того же. Ступени заданы в rem, но кратны 16 px, чтобы текст попадал в пиксельную сетку. */
    --text-xs: .75rem;    /* 12 - подписи, коды, служебные пометки */
    --text-sm: .8125rem;  /* 13 - вторичный текст, ячейки плотных таблиц */
    --text-base: .875rem; /* 14 - основной текст интерфейса */
    --text-md: 1rem;      /* 16 - крупный текст, заголовки блоков */
    --text-lg: 1.125rem;  /* 18 - заголовки карточек */
    --text-xl: 1.25rem;   /* 20 - заголовки разделов */
    --text-2xl: 1.5rem;   /* 24 - заголовок страницы */
    --text-3xl: 1.75rem;  /* 28 - крупные иконки пустых состояний */

    --font-display: 'Golos Text', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    --hero-glow-1: rgba(0, 91, 255, .20);
    --hero-glow-2: rgba(0, 194, 255, .16);
    --hero-glow-3: rgba(255, 138, 0, .16);
    --hero-grid-line: rgba(0, 91, 255, .07);
}

[data-bs-theme="dark"] {
    --ink: #EDEFF3;
    --ink-soft: #B7BDC9;
    --muted: #8B93A3;
    --paper: #0B0D12;
    --surface: #12151C;
    --line: #232733;

    --accent: #3D82FF;
    --accent-ink: #6EA1FF;
    --accent-soft: #17233D;

    --amber-soft: #2E2013;
    --green-soft: #112A1E;
    --red-soft: #2E1717;

    /* В тёмной теме проблема обратная: заливочные оттенки читаются хорошо, а затемнённые
       текстовые - нет, поэтому здесь они светлее фона. */
    --green-ink: #5FE3A5;
    --amber-ink: #FFB067;
    --red-ink: #FF8C82;

    --slate-soft: #22262E;
    --slate-ink: #B7BDC9;
    --violet-soft: #241B3A;
    --violet-ink: #B9A3F0;

    --scroll-thumb: #2C323F;
    --scroll-thumb-hover: #3C4457;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .5);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .6);

    --hero-glow-1: rgba(61, 130, 255, .35);
    --hero-glow-2: rgba(0, 194, 255, .26);
    --hero-glow-3: rgba(255, 138, 0, .2);
    --hero-grid-line: rgba(110, 161, 255, .1);
}

/* ============================================================
   Base
   ============================================================ */
body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    transition: background .2s var(--ease), color .2s var(--ease);
}

/* На время смены темы переходы выключены: иначе каждый элемент с transition (а в табеле и
   претензиях их тысячи) запускал собственную анимацию цвета, и переключение подтормаживало.
   Сама смена и так показана кругом из переключателя (View Transitions, см. _Layout). */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
}

/* ------------------------------------------------------------
   Браузерные поверхности: их не рисовали, но пользователь видит их постоянно.
   С системными значениями выделение и полоса прокрутки в тёмной теме выглядят
   деталями чужого приложения.
   ------------------------------------------------------------ */
::selection {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

input, textarea, select, [contenteditable] {
    caret-color: var(--accent);
}

/* Схема оформления для нативных частей браузера. Без неё раскрытый список <select>,
   календарь у поля даты и автозаполнение рисуются светлыми даже в тёмной теме - и наш
   светлый текст оказывался на белом фоне. */
:root {
    color-scheme: light;
    scrollbar-color: var(--scroll-thumb) transparent;
    scrollbar-width: thin;
}

[data-bs-theme="dark"] {
    color-scheme: dark;
}

/* Явные цвета пунктов списка - подстраховка для браузеров, где color-scheme не влияет
   на выпадающий список (Firefox на Windows рисует его собственной темой). */
.filterbar__field > select option,
.form-select option,
select.form-control option {
    background-color: var(--surface);
    color: var(--ink);
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    /* Прозрачная рамка с background-clip даёт отступ от края - полоса не липнет к содержимому. */
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
    background-clip: content-box;
}

::-webkit-scrollbar-corner { background: transparent; }

.text-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.text-muted {
    color: var(--muted) !important;
}

a {
    color: var(--accent);
}

/* Bootstrap primary → design token (loaded after bootstrap.min.css, wins on source order) */
.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-ink);
    --bs-btn-hover-border-color: var(--accent-ink);
    --bs-btn-active-bg: var(--accent-ink);
    --bs-btn-active-border-color: var(--accent-ink);
}

.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-bg: var(--accent);
}

.bg-primary { background-color: var(--accent) !important; }
.text-primary { color: var(--accent) !important; }

/* Bootstrap-овские цвета состояний используются в разметке около 180 раз (суммы, статусы
   претензий, остатки рассрочки). Собственные значения Bootstrap на белом дают 1.6-4.5 -
   для текста о деньгах этого мало, поэтому классы переводятся на проверенные оттенки. */
.text-success { color: var(--green-ink) !important; }
.text-danger { color: var(--red-ink) !important; }
.text-warning { color: var(--amber-ink) !important; }

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}

/* Отклик на нажатие: кнопка чуть проминается под пальцем/курсором. Без этого нажатие
   ощущается "мёртвым" - визуально ничего не подтверждает, что клик пойман. */
.btn:active:not(:disabled) {
    transform: scale(.97);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Тот же приём, что у .btn-primary выше: связать Bootstrap-примитив с токеном. Родной радиус
   .form-control/.form-select (6px, у -sm - 4px) ни к одному из --radius-* не привязан, хотя токен
   --radius-sm прямо документирован как "кнопки, поля ввода". На карточках/кнопках с явным
   --radius-sm/--radius-md вокруг эти узкие уголки читаются как чужеродная деталь - особенно
   в мобильном реflow (Payroll/ManagementStaff), где поле - единственный крупный элемент своей
   строки, а не одна из многих ячеек в таблице. */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
}
.form-control-sm,
.form-select-sm {
    border-radius: var(--radius-xs);
}

/* ============================================================
   Motion — один сигнатурный момент (Login), везде остальное сдержанно
   ============================================================ */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    animation: revealUp .5s var(--ease) both;
    animation-delay: calc(var(--d, 0) * 80ms);
}

@keyframes cellIn {
    from { opacity: 0; transform: scale(.85); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes cellPulse {
    0%   { box-shadow: 0 0 0 0 rgba(61, 130, 255, 0); border-color: rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .02); }
    35%  { box-shadow: 0 0 0 6px rgba(61, 130, 255, .18); border-color: #3D82FF; background: rgba(61, 130, 255, .22); }
    100% { box-shadow: 0 0 0 0 rgba(61, 130, 255, 0); border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); }
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .cell { animation: none !important; opacity: 1 !important; transform: none !important; }
    * { transition-duration: .001ms !important; }
}

/* ============================================================
   Шапка сайта (Pages/Shared/_Layout.cshtml). Деловая и тихая: один стиль иконок
   (контурные), активный раздел - полоса по нижней линии шапки, служебные кнопки одного
   размера 32x32, цифры нейтральные. Уже 1280 px разделы показываются иконками с подсказкой
   (не «гамбургер»); на телефоне разделы живут в нижней панели, в шапке - знак, поиск и
   колокольчик. Движение - только у значка темы (смена солнца и луны), 200 мс.
   ============================================================ */
.hd {
    --hd-ease: cubic-bezier(0.23, 1, 0.32, 1);
    position: relative; z-index: 1030;
    display: flex; align-items: center; gap: 6px;
    height: 56px; padding: 0 20px; margin-bottom: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.hd-brand { display: inline-flex; align-items: center; gap: 10px; margin-right: 14px; color: var(--ink); text-decoration: none; flex: none; }
.hd-brand:hover { color: var(--ink); }
.hd-brand__mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.hd-brand__mark svg { width: 22px; height: 22px; }
.hd-brand__word { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }

/* Разделы: контурные иконки, текст обычного веса; активный - полоса по нижней линии шапки */
.hd-nav { display: flex; align-items: stretch; align-self: stretch; gap: 2px; min-width: 0; }
.hd-nav > .dropdown { display: flex; }
.hd-link {
    position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px;
    color: var(--ink-soft); font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap;
    border: 0; background: none; cursor: pointer;
    transition: color .15s ease;
}
.hd-link .bi { font-size: 15px; color: var(--muted); transition: color .15s ease; }
.hd-link::before {
    content: ''; position: absolute; inset: 11px 3px; border-radius: 8px; background: var(--paper);
    opacity: 0; transition: opacity .15s ease; z-index: -1;
}
.hd-link:focus-visible { outline: none; }
.hd-link:focus-visible::before { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
@media (hover: hover) and (pointer: fine) {
    .hd-link:hover { color: var(--ink); }
    .hd-link:hover::before { opacity: 1; }
    .hd-link:hover .bi { color: var(--ink-soft); }
}
.hd-link[aria-expanded="true"] { color: var(--ink); }
.hd-link[aria-expanded="true"]::before { opacity: 1; }
.hd-link.is-current { color: var(--ink); font-weight: 600; }
.hd-link.is-current .bi { color: var(--accent); }
.hd-link.is-current::after {
    content: ''; position: absolute; left: 11px; right: 11px; bottom: -1px; height: 2px;
    border-radius: 2px 2px 0 0; background: var(--accent);
}
.hd-link.dropdown-toggle::after { display: none; } /* своя стрелка вместо бутстраповской */
.hd-link .hd-chev { font-size: 10px; }

.hd-sp { flex: 1; }

/* Поиск - видимая кнопка быстрого перехода (Ctrl K) */
.hd-search {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; width: 220px; padding: 0 8px 0 10px; flex: none;
    border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--muted);
    font-size: 13px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.hd-search__label { flex: 1; text-align: left; }
.hd-search kbd {
    font-family: var(--font-mono); font-size: 11px; padding: 0 5px; border-radius: 5px; line-height: 18px;
    border: 1px solid var(--line); background: var(--surface); color: var(--muted); box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
    .hd-search:hover { border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); background: var(--surface); }
}

/* Служебные кнопки - одного размера */
.hd-ib {
    position: relative; width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 16px; cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, transform .12s var(--hd-ease);
}
.hd-ib:active { transform: scale(.94); }
.hd-ib.dropdown-toggle::after { display: none; }
@media (hover: hover) and (pointer: fine) { .hd-ib:hover { background: var(--paper); color: var(--ink); } }
.hd-ib[aria-expanded="true"] { background: var(--paper); color: var(--ink); }

/* Число на колокольчике - нейтральное: красное «9+» висело всегда и перестало что-то значить */
.notification-bell__badge {
    position: absolute; top: 3px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px;
    background: var(--ink); color: var(--surface); font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
    box-shadow: 0 0 0 2px var(--surface);
}
.notification-bell__badge[hidden] { display: none; }

/* Значок темы: солнце и луна сменяют друг друга - единственное движение в шапке */
.hd-theme__icon { position: absolute; transition: opacity .2s var(--hd-ease), transform .2s var(--hd-ease); }
.hd-theme__sun { opacity: 1; transform: none; }
.hd-theme__moon { opacity: 0; transform: translateY(6px) rotate(-30deg); }
[data-bs-theme="dark"] .hd-theme__sun { opacity: 0; transform: translateY(-6px) rotate(30deg); }
[data-bs-theme="dark"] .hd-theme__moon { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .hd-theme__icon { transition: none; } }

.hd-tenant {
    display: inline-flex; align-items: center; gap: 6px; height: 28px; max-width: 220px; padding: 0 10px; border-radius: 99px; flex: none;
    border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hd-tenant .bi { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .hd-tenant:hover { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); } }

.hd-divider { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex: none; }

/* Профиль - аватар с инициалами; имя, почта и роль - первой строкой меню */
.hd-avatar {
    width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; flex: none; cursor: pointer;
    background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-ink);
    font-size: 12px; font-weight: 700; letter-spacing: .02em;
    transition: box-shadow .15s ease, transform .12s var(--hd-ease);
}
.hd-avatar::after { display: none; }
.hd-avatar:active { transform: scale(.95); }
.hd-avatar[aria-expanded="true"], .hd-avatar:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); outline: none; }

.hd-login { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.hd-login:hover { background: var(--paper); color: var(--ink); }

/* Меню шапки (Bootstrap dropdown) */
.hd .dropdown-menu {
    min-width: 240px; margin-top: 8px !important; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
}
.hd .dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
    color: var(--ink); font-size: 13.5px; white-space: nowrap;
}
.hd .dropdown-item .bi { color: var(--muted); width: 16px; text-align: center; }
.hd .dropdown-item:hover, .hd .dropdown-item:focus { background: var(--paper); color: var(--ink); }
.hd .dropdown-item.active, .hd .dropdown-item:active { background: var(--accent-soft); color: var(--accent-ink); }
.hd .dropdown-divider { margin: 4px 2px; border-color: var(--line); opacity: 1; }
.hd-menu-head { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.hd-menu-head b { display: block; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-menu-head span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.hd-profile-menu { width: 300px; }
.hd-danger, .hd-danger .bi { color: var(--red-ink) !important; }

/* Плотность таблиц: «Обычная / Плотная» - в меню профиля, на телефоне - в шторке «Ещё» */
.density-seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); }
.density-seg button {
    height: 24px; padding: 0 9px; border: 0; border-radius: 6px; background: none;
    font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.density-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Список уведомлений под колокольчиком (содержимое подгружает site.js) */
.notification-panel {
    width: 360px;
    max-width: calc(100vw - 24px);
    padding: 0 !important;
    overflow: hidden;
}
.notification-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    font-size: .88rem;
}
.notification-panel__mark-all {
    background: none;
    border: none;
    color: var(--accent-ink, var(--accent));
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.notification-panel__mark-all:hover { text-decoration: underline; }
.notification-panel__body {
    max-height: 380px;
    overflow-y: auto;
    padding: 0 10px;
}
.notification-panel__body .feed { padding: 2px 0; }
.notification-panel__foot {
    display: block;
    text-align: center;
    padding: 9px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent-ink, var(--accent));
    text-decoration: none;
    border-top: 1px solid var(--line);
}
.notification-panel__foot:hover { background: var(--paper); }

/* Узкий десктоп: сначала поиск сворачивается в значок, затем разделы - в иконки с подсказкой */
@media (max-width: 1439.98px) {
    .hd-search { width: 32px; padding: 0; justify-content: center; }
    .hd-search__label, .hd-search kbd { display: none; }
}
@media (max-width: 1279.98px) {
    .hd-link .hd-lbl, .hd-link .hd-chev { display: none; }
    .hd-link { padding: 0 10px; }
    .hd-link.is-current::after { left: 8px; right: 8px; }
    .hd-tenant { max-width: 140px; }
}
@media (max-width: 1099.98px) {
    .hd-brand__word { display: none; }
    .hd-brand { margin-right: 6px; }
}

/* ============================================================
   Нижняя панель вкладок (телефон, ≤899.98px) - замена гамбургеру, который на этой ширине
   раньше разворачивал .navbar-collapse прямо в потоке страницы и отодвигал контент вниз.
   Правила скрытия/показа завязаны на body.has-bottom-nav (проставляется в _Layout.cshtml
   только авторизованным), а не на сам факт узкого экрана - иначе неавторизованный
   пользователь на телефоне остался бы вовсе без навигации (у него нет ни одной вкладки нижней
   панели, только "Главная"/"Вход" в исходном .navbar-collapse).
   ============================================================ */
.bottom-nav, .more-sheet { display: none; }

@media (max-width: 899.98px) {
    body.has-bottom-nav .hd-hide-m { display: none !important; }
    body.has-bottom-nav .hd { padding: 0 12px; }

    body.has-bottom-nav {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    body.has-bottom-nav .bottom-nav {
        display: flex;
        position: fixed;
        inset: auto 0 0 0;
        z-index: 1030;
        background: var(--surface);
        border-top: 1px solid var(--line);
        padding: 4px 2px max(4px, env(safe-area-inset-bottom));
    }
}

.bottom-nav__tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: .64rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.bottom-nav__tab i { font-size: 1.15rem; }
.bottom-nav__tab.is-current { color: var(--accent-ink); }

/* ---- Шторка «Ещё» - тот же fixed-оверлей + body-lock, что уже применяет мобильная панель
   претензии (Pages/Schedule/Claims/Index.cshtml, .claims-layout.panel-open), только со своим
   классом блокировки скролла, чтобы обе не конфликтовали, если вдруг открыты одновременно. ---- */
.more-sheet[hidden] { display: none; }

body.has-bottom-nav .more-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1095;
}

.more-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 20, .45);
}

.more-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 82vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
}

.more-sheet__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    margin: 6px auto 14px;
}

.more-sheet__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}

.more-sheet__avatar { font-size: 1.9rem; line-height: 1; color: var(--muted); flex: none; }
.more-sheet__user-name { display: block; font-weight: 600; font-size: .9rem; }
.more-sheet__user-email { display: block; font-size: .76rem; color: var(--muted); max-width: 220px; }

.more-sheet .icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex: none;
    border: none; background: transparent; color: var(--muted);
    border-radius: var(--radius-xs);
}
.more-sheet .icon-btn:hover { background: var(--accent-soft); color: var(--accent); }

.more-sheet__row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.more-sheet__row-label { font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.more-sheet__row-label i { color: var(--muted); }

.more-sheet__heading {
    padding: 16px 4px 6px;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted);
}

.more-sheet__item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 11px 4px; border: none; background: none;
    font-size: .87rem; font-weight: 500; color: var(--ink);
    text-decoration: none; border-radius: var(--radius-sm);
}
.more-sheet__item i { color: var(--muted); width: 18px; text-align: center; flex: none; }
.more-sheet__item.is-current { color: var(--accent-ink); }
.more-sheet__item.is-current i { color: var(--accent-ink); }
.more-sheet__item--danger { color: var(--red-ink); }

/* Список сетей в модалке переключателя (см. #tenantSwitchModal в _Layout.cshtml) - прокрутка
   вместо бесконечного роста окна, когда сетей становится много (сеть на клиента). */
.tenant-switch-list {
    max-height: 320px;
    overflow-y: auto;
}
.tenant-switch-list__item[hidden] { display: none; }
.more-sheet__item--danger i { color: var(--red-ink); }

/* Кнопка темы и «Плотность таблиц» физически переезжают сюда из шапки при ширине ≤899.98px
   (см. скрипт в _Layout.cshtml), а не дублируются. */
#sheetThemeSlot, #sheetDensitySlot { display: inline-flex; align-items: center; }

@media (max-width: 899.98px) {
    body.more-sheet-lock { overflow: hidden; }
}

/* ============================================================
   Состояние загрузки таблицы. Пока обновлённая разметка едет с сервера, содержимое
   гасится и по нему идёт блик - иначе на секунду-две таблица выглядит замершей и
   непонятно, приняли действие или нет.
   ============================================================ */
.table-loading {
    position: relative;
    pointer-events: none;
}

.table-loading > * {
    opacity: .45;
    transition: opacity .15s var(--ease);
}

.table-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    background-size: 60% 100%;
    background-repeat: no-repeat;
    animation: tableShimmer 1.1s infinite var(--ease);
    pointer-events: none;
}

[data-bs-theme="dark"] .table-loading::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
    background-size: 60% 100%;
    background-repeat: no-repeat;
}

@keyframes tableShimmer {
    from { background-position: -60% 0; }
    to   { background-position: 160% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .table-loading::after { animation: none; }
}

/* ============================================================
   Кольцо фокуса - одно на всё приложение.
   Раньше :focus-visible определялся в трёх файлах по-разному, а в мессенджере отсутствовал:
   при работе с клавиатуры было не видно, где находишься.
   ============================================================ */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Мышью кольцо не показываем - :focus-visible сам это различает, но Bootstrap добавляет
   собственную тень на :focus, которая срабатывает и по клику. */
.btn:focus:not(:focus-visible),
.form-control:focus:not(:focus-visible),
.form-select:focus:not(:focus-visible) {
    box-shadow: none;
}

/* ============================================================
   Подсветка строки после сохранения. Поля в Зарплате правятся прямо в таблице, и по
   умолчанию непонятно, записалось ли значение: вспышка фона подтверждает результат
   и гаснет, не задерживая внимание.
   ============================================================ */
@keyframes rowSaved {
    from { background-color: var(--green-soft); }
    to   { background-color: transparent; }
}

.row-saved > td,
td.cell-saved {
    animation: rowSaved 1.1s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
    .row-saved > td, td.cell-saved { animation: none; }
}

/* ============================================================
   Печать: табель и зарплатные ведомости выводят на бумагу, а по умолчанию туда уходят
   меню, кнопки и фильтры, съедая половину листа.
   ============================================================ */
@media print {
    header, .navbar, .toast-stack, .cmdk,
    .btn, .btn-group,
    .card-modern .card-body > form.row,
    .modal, .modal-backdrop {
        display: none !important;
    }

    body { background: #fff; color: #000; }

    .card-modern {
        border: none;
        box-shadow: none;
    }

    /* Таблица разворачивается на всю ширину листа, шапка повторяется на каждой странице. */
    .table-responsive { overflow: visible !important; }
    .table-modern { width: 100% !important; font-size: 10pt; }
    .table-modern thead { display: table-header-group; }
    .table-modern tbody tr { page-break-inside: avoid; }
    .table-modern thead th { padding: 6px 8px; color: #000; background: #f2f2f2 !important; }
    .table-modern tbody td { padding: 5px 8px; }

    /* Ссылки на бумаге кликать нельзя - лишнее подчёркивание только мешает. */
    a { text-decoration: none !important; color: #000 !important; }

    @page { margin: 12mm; }
}

/* ============================================================
   Значок в статусе. Это не украшение, а доступность: до сих пор состояние несла только
   заливка, и для дальтоника "Оплачено" и "Не удержать" различались лишь оттенком. Значок
   даёт второй признак - и ускоряет чтение всем остальным.
   Классы приходят из GetStatusCssClass/GetResolutionCssClass (Claims.IndexModel).
   ============================================================ */
.claim-status-badge::before,
.claim-resolution-select::before {
    font-family: bootstrap-icons;
    font-size: .78em;
    margin-right: 5px;
    vertical-align: -1px;
    display: inline-block;
}

.claim-status-paid::before,
.claim-resolution-done::before,
.claim-response-answered::before { content: "\f26a"; }        /* галочка в круге */

.claim-status-cancelled::before,
.claim-resolution-cancelled::before { content: "\f2e5"; }      /* минус в круге */

.claim-resolution-cannot::before,
.claim-response-cannot::before { content: "\f622"; }           /* крест в круге */

.claim-status-underreview::before,
.claim-resolution-underreview::before,
.claim-response-inprogress::before { content: "\f291"; }       /* часы */

.claim-resolution-pending::before,
.claim-response-withholding::before { content: "\f47a"; }      /* замок - деньги удерживаются */

.claim-resolution-disputing::before,
.claim-response-disputing::before { content: "\f130"; }        /* стрелки по кругу - оспаривание */

/* У <select> псевдоэлемент не отображается: значок там пришлось бы рисовать фоном,
   а стрелка выпадающего списка уже занимает это место. Поэтому только для бейджей. */
select.claim-resolution-select::before,
select.claim-response-select::before { content: none; }

/* ============================================================
   Состояния претензии: статус, ответ управляющего и решение.
   Один словарь на обе темы. До этого те же 15 правил были записаны трижды: в <style>
   страницы Претензий, в <style> Зарплаты (с пометкой «скопированы намеренно») и ещё раз
   здесь для тёмной темы - и при правке оттенка расходились между экранами.
   ============================================================ */
:root .claim-status-underreview,
:root .claim-resolution-underreview,
.claim-response-inprogress {
    background-color: var(--accent-soft);
    color: var(--accent-ink);
}

:root .claim-status-cancelled,
.claim-resolution-cancelled {
    background-color: var(--slate-soft);
    color: var(--slate-ink);
}

:root .claim-status-paid,
:root .claim-resolution-done,
.claim-response-answered {
    background-color: var(--green-soft);
    color: var(--green-ink);
}

:root .claim-resolution-pending,
.claim-response-withholding {
    background-color: var(--amber-soft);
    color: var(--amber-ink);
}

:root .claim-resolution-cannot,
.claim-response-cannot {
    background-color: var(--red-soft);
    color: var(--red-ink);
}

:root .claim-resolution-disputing,
.claim-response-disputing {
    background-color: var(--violet-soft);
    color: var(--violet-ink);
}

/* «Ожидает ответа» (Ozon переименовал из «Требуется ответ») - единственное состояние, которое
   зовёт к действию, поэтому оно одно идёт плотной заливкой, а не приглушённой подложкой. */
:root .claim-status-answerrequired {
    background-color: var(--amber);
    color: #17120A;
}

/* Рамка выводится из цвета текста самой плашки: отдельный тон для каждого состояния
   был третьим значением, за которым нужно следить. */
:root .claim-status-answerrequired,
:root .claim-status-underreview,
:root .claim-status-cancelled,
:root .claim-status-paid,
:root .claim-resolution-underreview,
:root .claim-resolution-pending,
:root .claim-resolution-done,
:root .claim-resolution-cannot,
:root .claim-resolution-cancelled,
:root .claim-resolution-disputing,
:root .claim-response-inprogress,
:root .claim-response-answered,
:root .claim-response-withholding,
:root .claim-response-disputing,
.claim-response-cannot {
    border-color: color-mix(in srgb, currentColor 22%, transparent);
}

/* ============================================================
   Смена вкладки в «Зарплате». Содержимое подменяется без перезагрузки страницы,
   поэтому переход показывается сменой состояния: уходящая вкладка тускнеет,
   пришедшая проявляется со сдвигом на несколько пикселей.
   ============================================================ */
.tab-content.is-loading {
    opacity: .45;
    pointer-events: none;
    transition: opacity .12s var(--ease);
}

/* Таблицы «Зарплаты» - без обёртки .table-responsive, каждая на своей вкладке; скролл вешается
   одним правилом на общий .tab-content вместо оборачивания каждой таблицы отдельно. Без
   медиа-запроса: таблица сводки по зоне шире 1024px и на десктопе тоже, а overflow-x:auto
   не влияет на вид, пока ширины хватает, так что держать его включённым всегда безопасно. */
.tab-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes tabEnter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.is-entering {
    animation: tabEnter .22s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {
    .tab-content.is-entering { animation: none; }
    .tab-content.is-loading { transition: none; }
}

/* ============================================================
   Панель страницы: разделы модуля и действия в одной строке, разделы читаются как вкладки,
   из действий выделено только одно. Боковое меню не подходит - табель это 31 колонка дат,
   вертикальная панель отняла бы как раз ту ширину, которой и так не хватает.
   ============================================================ */
.pagebar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.pagebar__tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    /* На узких экранах вкладок (Табель/Претензии/Подработки/...) больше, чем помещается
       в строку - без этого ряд толкал всю страницу в горизонтальную прокрутку вместо
       того, чтобы прокручиваться сам. */
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Вкладки листаются вбок пальцем - полоса прокрутки под ними на телефоне только занимала место. */
.pagebar__tabs { scrollbar-width: none; }
.pagebar__tabs::-webkit-scrollbar { display: none; }

.pagebar__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    border-radius: var(--radius-xs);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.pagebar__tab:hover { color: var(--ink); background: var(--surface); }

/* Средняя ширина: у невыбранных разделов - только значок (имя в title), у выбранного - значок и
   имя. На телефоне вкладки листаются лентой и подписи остаются. */
@media (min-width: 768px) and (max-width: 1099.98px) {
    .pagebar__tab:not(.is-active) .pagebar__lbl { display: none; }
    .pagebar__tab:not(.is-active) { padding: 0 10px; }
}

.pagebar__tab.is-active {
    background: var(--surface);
    color: var(--accent-ink);
    box-shadow: var(--shadow-sm);
}

.pagebar__tab .bi, .pagebar__tab .icon-gavel { font-size: var(--text-base); opacity: .75; }
.pagebar__tab.is-active .bi, .pagebar__tab.is-active .icon-gavel { opacity: 1; }

/* Кастомная inline-SVG иконка «Претензий» (судейский молоток) - Bootstrap Icons такой не
   содержит. vertical-align подобран как для .bi, чтобы не прыгала относительно текста рядом. */
.icon-gavel { vertical-align: -0.125em; }

.pagebar__push { margin-left: auto; }

/* Группа из нескольких кнопок действий (см. Claims/Index.cshtml) - без обёртки при переносе
   строки margin-left:auto толкал только первую кнопку в свою отдельную строку до упора вправо,
   а вторая (без этого класса) переносилась ещё ниже и прижималась к левому краю - "одна сверху
   на всю ширину, другая ниже слева", а не пара рядом. Обёртка переносится ЦЕЛИКОМ одним блоком. */
.pagebar__actions { display: flex; gap: 8px; }

@media (max-width: 480px) {
    /* На самом узком экране (телефон в портретной ориентации) обеим кнопкам одинаково не
       хватает места для полного текста, даже сжатым шрифтом (ellipsis внутри inline-flex
       кнопки с иконкой ведёт себя непредсказуемо - см. короткие/длинные варианты подписи
       прямо в разметке, Claims/Index.cshtml) - делим ширину поровну вместо переноса каждой
       кнопки на свою строку. */
    .pagebar__actions { width: 100%; }
    .pagebar__actions .btn {
        flex: 1 1 0;
        padding-left: 8px;
        padding-right: 8px;
        font-size: .82rem;
        white-space: nowrap;
    }
}

/* Действия: одна первичная кнопка, остальные - тихие. */
.pagebar .btn {
    height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-sm);
}

.pagebar__icons {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}

.pagebar__icons button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.pagebar__icons button + button { border-left: 1px solid var(--line); }

@media (hover: hover) and (pointer: fine) {
    .pagebar__icons button:hover { background: var(--paper); color: var(--ink); }
}

/* ============================================================
   Панель фильтров: подпись стоит внутри поля слева, вся панель - одна строка высотой 32px,
   переносится только когда полям действительно не хватает ширины.
   ============================================================ */
.filterbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    margin-bottom: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.filterbar__field {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 32px;
    padding: 0 4px 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    font-size: var(--text-sm);
    color: var(--muted);
    white-space: nowrap;
}

/* Поле внутри рамки не рисует собственную: рамка одна на пару «подпись + значение». */
.filterbar__field > select,
.filterbar__field > input {
    height: 30px;
    max-width: 200px;
    padding: 0 2px;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 500;
    box-shadow: none;
}

.filterbar__field > input[type="number"] { width: 62px; }

/* Поле поиска забирает свободную ширину: искать по обрезку строки неудобно. */
.filterbar__field--grow { flex: 1 1 260px; max-width: 460px; }
.filterbar__field--grow > input { flex: 1; max-width: none; }
.filterbar__field > .bi { color: var(--muted); font-size: var(--text-sm); }

/* Opera GX рисует у <select> собственную рамку и подложку поверх наших стилей: сбрасываем
   системное оформление целиком и рисуем стрелку сами, иначе поля обводятся чёрным
   в одном браузере и выглядят нормально в остальных. */
.filterbar__field > select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 20px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 11px) center, calc(100% - 6px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: var(--ink);
}

.filterbar__field > select::-ms-expand { display: none; }

.filterbar__field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.filterbar__field > select:focus,
.filterbar__field > input:focus { outline: none; }

/* Стрелки перемотки месяца (см. Pages/Shared/_MonthYearFilter.cshtml) - сидят в той же
   "таблетке" .filterbar__field, что и сами <select>, а не отдельным элементом рядом,
   чтобы пара "месяц + год" со стрелками по бокам читалась как один цельный контрол. */
.month-nav {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.month-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
}

.month-nav__btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.month-nav__btn:disabled { opacity: .3; cursor: default; }

/* Заголовок страницы внутри строки фильтров: на экранах с одним набором данных
   отдельная строка с названием раздела занимала высоту, ничего не добавляя. */
.filterbar__heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-md);
    letter-spacing: -0.02em;
    color: var(--ink);
    white-space: nowrap;
}

.filterbar__heading .bi { color: var(--accent); font-size: var(--text-base); }

.filterbar__check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
    font-size: var(--text-sm);
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
}

.filterbar__check input { margin: 0; cursor: pointer; }

/* Отступ навешен на саму кнопку, а не на пустой распорке: при переносе строк распорка
   занимала всю свободную ширину и выталкивала кнопки на отдельную строку. */
.filterbar__push { margin-left: auto; }

/* Короткое пояснение к экрану - в той же строке, а не отдельной полосой над таблицей. */
.filterbar__note {
    flex: 1 1 240px;
    min-width: 0;
    font-size: var(--text-xs);
    color: var(--muted);
    text-align: right;
}

/* Расшифровка кодов живёт в той же строке, а не отдельной полосой над таблицей. */
.filterbar__legend {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-xs);
    color: var(--muted);
    white-space: nowrap;
}

/* На узком экране обеим строкам расшифровки не хватает места рядом - переносим их одна
   под другой вместо того, чтобы толкать всю страницу в горизонтальную прокрутку. */
@media (max-width: 576px) {
    .filterbar__legend {
        flex-wrap: wrap;
        white-space: normal;
    }
}

.filterbar__legend b {
    font-weight: 600;
    color: var(--ink-soft);
}

.filterbar .btn {
    height: 32px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
}

/* ============================================================
   Мультивыбор зоны в фильтрах (Табель): та же "таблетка" .filterbar__field, но вместо
   <select> - кнопка, открывающая панель чекбоксов, чтобы отметить сразу несколько зон
   вместо одной. См. initZoneMultiselect в Pages/Schedule/Index.cshtml.
   ============================================================ */
.filterbar__multiselect { position: relative; }

.filterbar__multiselect-toggle {
    cursor: pointer;
    font: inherit;
}

.filterbar__multiselect-toggle .bi-chevron-down {
    font-size: 10px;
    color: var(--muted);
    transition: transform .15s var(--ease);
}

.filterbar__multiselect-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.filterbar__multiselect-toggle span[data-zone-label] {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.filterbar__multiselect-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1070;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.filterbar__multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}

.filterbar__multiselect-option:hover { background: var(--paper); }
.filterbar__multiselect-option input { margin: 0; cursor: pointer; }
.filterbar__multiselect-option input:disabled ~ span { color: var(--muted); }
.filterbar__multiselect-option--all { font-weight: 600; }

.filterbar__multiselect-divider {
    height: 1px;
    margin: 4px 2px 6px;
    background: var(--line);
}

/* ============================================================
   Раскрывашка панели фильтров (Табель, Претензии) на мобильном. На десктопе строка
   фильтров уже компактна (32px, см. комментарий у .filterbar выше) - там раскрывашка не
   нужна, .filterbar-collapse развёрнут всегда. На узком экране те же поля переносятся
   каждое на свою строку (ширины не хватает даже одному) и превращаются в блок на 6-8
   строк высотой над самой таблицей - здесь по умолчанию свёрнуто, открывается по кнопке.
   Bootstrap collapse (.collapse/.show, data-bs-toggle) - без единой строчки своего JS.
   ============================================================ */
.filterbar-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink);
}

.filterbar-toggle__chevron { transition: transform .15s var(--ease); color: var(--muted); }
.filterbar-toggle[aria-expanded="true"] .filterbar-toggle__chevron { transform: rotate(180deg); }

@media (max-width: 899.98px) {
    .filterbar-toggle { display: flex; }
}

/* На десктопе панель развёрнута всегда, независимо от .show - раскрывашка там просто
   не отрисована (display:none выше), переключать нечего. */
@media (min-width: 900px) {
    .filterbar-collapse { display: block !important; }
}

/* ============================================================
   Карточки для обычных CRUD-таблиц (список сущностей, "Изменить"/"Удалить" ведут на
   отдельные страницы) на мобильном (≤899.98px) - те же общие принципы, что у Табеля
   (.sched-desktop/.sched-mobile) и Претензий (.claims-desktop-table/.claims-mobile-cards):
   рендерятся оба варианта одним проходом по тем же данным, видимость переключает только
   CSS. В отличие от карточек Претензий здесь нет ни инлайн-редактирования, ни боковой
   панели - карточка просто показывает те же поля, что и строка таблицы, действия ведут
   на отдельные страницы Edit/Delete как и раньше.
   ============================================================ */
.mobile-list-cards { display: none; }

@media (max-width: 899.98px) {
    .crud-desktop-table { display: none; }
    .mobile-list-cards { display: block; }
}

.mobile-list-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.mobile-list-card--muted { opacity: .6; }

.mobile-list-card__title { font-size: .92rem; font-weight: 600; color: var(--ink); }
.mobile-list-card__sub { font-size: .78rem; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.mobile-list-card__row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 6px 0; border-top: 1px solid var(--line);
    font-size: .82rem;
}
.mobile-list-card__row:first-of-type { border-top: none; margin-top: 8px; }
.mobile-list-card__row > span:first-child { color: var(--muted); flex: none; }
.mobile-list-card__row > span:last-child { text-align: right; font-weight: 500; color: var(--ink); }

.mobile-list-card__actions {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
/* min-width вместо голого flex: 1 1 0 - на карточках с 3-4 действиями (напр. Admin/Users)
   и длинными подписями ("Заблокировать") кнопки без него не переносились и обрезались
   по правому краю на узких экранах вместо переноса на вторую строку. */
.mobile-list-card__actions .btn { flex: 1 1 auto; min-width: 120px; }

/* Предупреждение (например, подработка с конфликтом графика) - та же акцентная полоса
   слева, что уже использует остальное приложение для тревожных состояний строки. */
.mobile-list-card--warning { border-left: 3px solid var(--amber); }

/* Заголовок группы (юр. лицо) и её денежные итоги - используются там, где группировка
   в таблице несёт реальные суммы, а не только организует строки (Подработки, Компенсации),
   в отличие от плоского списка карточек Претензий, где заголовки групп сознательно убраны. */
.mobile-list-card__group-heading {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 4px 6px; margin-top: 4px;
    font-size: .8rem; font-weight: 700; color: var(--ink);
}

.mobile-list-card__group-totals {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: .82rem;
}
.mobile-list-card__group-totals > div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-soft); }
.mobile-list-card__group-totals span { color: inherit; }
.mobile-list-card__group-totals--net { color: var(--accent-ink) !important; font-weight: 700; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px !important; }
.mobile-list-card__group-totals--grand { background: var(--accent-soft); border-color: var(--accent); }

/* ============================================================
   Реflow таблицы в карточки БЕЗ дублирования разметки (≤767.98px) - для таблиц с
   input/select на ОДНОЙ общей форме (например, ManagementStaff "ЗП", все Entries[i].*
   уходят одним POST). .mobile-list-card выше рендерит desktop и mobile ДВАЖДЫ из одних
   данных, а для инлайн-полей внутри общей формы это опасно (одинаковый name у видимого
   и скрытого input даёт задвоенное значение при отправке) - здесь разметка РОВНО ОДНА,
   CSS перекладывает те же <td> в вертикальный список, подписи берёт из data-label.
   Порог 767.98px, а не 899.98px - на ширине разложенного Galaxy Z Fold 5 (портрет ≈884px)
   реflow-карточка растягивается с пустым зазором, см. .pr-reflow-compact ниже.
   ============================================================ */
@media (max-width: 767.98px) {
    table.table-reflow-mobile { display: block; width: 100%; }
    table.table-reflow-mobile thead { display: none; }
    table.table-reflow-mobile tbody,
    table.table-reflow-mobile tfoot { display: block; }

    table.table-reflow-mobile tr:not(.table-reflow-block) {
        display: block;
        margin-bottom: 12px;
        padding: 10px 12px;
        background: var(--surface);
        border: 1px solid var(--line) !important;
        border-radius: var(--radius-md);
    }

    table.table-reflow-mobile tr:not(.table-reflow-block) > td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 6px 0 !important;
        border: none !important;
        border-top: 1px solid var(--line) !important;
        text-align: right;
    }
    table.table-reflow-mobile tr:not(.table-reflow-block) > td:first-child { border-top: none !important; }

    table.table-reflow-mobile tr:not(.table-reflow-block) > td::before {
        content: attr(data-label);
        flex: none;
        font-size: .78rem;
        color: var(--muted);
        text-align: left;
    }

    table.table-reflow-mobile tr:not(.table-reflow-block) > td > * { margin-left: auto; }
    table.table-reflow-mobile tr:not(.table-reflow-block) > td input,
    table.table-reflow-mobile tr:not(.table-reflow-block) > td select { max-width: 140px; }

    /* Строки-разделители/итоги (colspan) - не пара "подпись/значение", просто блок текста. */
    table.table-reflow-mobile tr.table-reflow-block {
        display: block;
        padding: 8px 12px;
        border: none !important;
    }
    table.table-reflow-mobile tr.table-reflow-block > td {
        display: block;
        border: none !important;
    }

    /* Строки-итоги с НЕСКОЛЬКИМИ суммами в одной строке (напр. "Итого по юр. лицу"/"Итого
       по зоне" в Payroll/Index.cshtml) НЕ помечаются .table-reflow-block - им нужна обычная
       раскладка label/value, просто ячейка-подпись (обычно с colspan) помечается этим
       классом, чтобы не показывать рядом пустой лейбл и не прижимать текст через space-between. */
    table.table-reflow-mobile tr:not(.table-reflow-block) > td.pr-reflow-label-only {
        justify-content: flex-start;
        text-align: left;
    }
    table.table-reflow-mobile tr:not(.table-reflow-block) > td.pr-reflow-label-only::before {
        content: none;
    }

    /* Пустая "техническая" колонка (напр. место под кнопку удаления в десктопной версии
       этой же строки итогов) - показывать в реflow-карточке нечего, просто убираем. */
    table.table-reflow-mobile tr:not(.table-reflow-block) > td.pr-reflow-hide-empty {
        display: none;
    }
}

/* Дубль-ячейка адреса ПВЗ для строк 2+ внутри rowspan-группы (Payroll/Index.cshtml,
   .pr-zone-table) - нужна только на мобильном реflow, где rowspan ничего не значит.
   Порог должен совпадать с самим реflow (см. выше) - переключаются синхронно. */
@media (min-width: 768px) {
    .pr-zone-mobile-addr { display: none; }
}

/* Обратная сторона того же приёма - исходная rowspan-ячейка на мобильном скрыта (её роль
   на этой ширине уже играет .pr-zone-mobile-addr выше), иначе в первой карточке группы
   адрес показывался бы дважды - один раз без подписи (сама rowspan-ячейка), второй раз
   с подписью "Адрес ПВЗ". */
@media (max-width: 767.98px) {
    /* Специфичность должна как минимум сравняться с ".table-reflow-mobile tr:not(...) > td"
       (table+tr+td = 3 типа, 2 класса) - иначе рядовой класс-селектор проигрывал ей и ячейка
       оставалась видимой (display:flex) вопреки этому правилу. */
    table.table-reflow-mobile tr td.pr-zone-rowspan-addr { display: none; }
}

/* ============================================================
   "Компактная" ширина 768-1199.98px - между мобильным реflow и полным десктопом.
   Основной кейс - разложенный Galaxy Z Fold 5, где реflow-карточка растянута, а полная
   десктопная таблица не всегда влезает без прокрутки. Ничего не реflow-ится, таблица
   остаётся настоящей, просто плотнее (меньше шрифт и отступы).
   ============================================================ */
@media (min-width: 768px) and (max-width: 1199.98px) {
    table.table-reflow-mobile {
        font-size: .8rem;
    }
    /* .table-modern thead th/.table-modern tbody td (pvz-style.css, ниже по файлу) - та же
       специфичность (0,1,2), что у голого "table.table-reflow-mobile th/td" - при равенстве
       побеждает тот, кто ниже по файлу, а не этот блок. thead/tbody в селекторе добавляют
       третий типовой уровень (0,1,3), которого достаточно, чтобы выиграть независимо от
       порядка в файле. */
    table.table-reflow-mobile thead th,
    table.table-reflow-mobile tbody td,
    table.table-reflow-mobile tfoot td {
        padding: 6px 8px;
    }
}

/* ============================================================
   Плотность таблиц. В табеле и Зарплате строк много: компактный режим отыгрывает
   примерно треть высоты строки, и на экран помещается заметно больше данных.
   Переключатель - в меню профиля (на телефоне - в шторке «Ещё»), выбор запоминается.
   ============================================================ */
.density-compact .table-modern thead th { padding: 8px 10px; }
.density-compact .table-modern tbody td { padding: 7px 10px; }
.density-compact .table-sm td,
.density-compact .table-sm th { padding: 4px 6px; }
.density-compact .card-modern .card-body { padding: 14px; }
.density-compact .form-control-sm,
.density-compact .form-select-sm { padding-top: 2px; padding-bottom: 2px; }

/* ============================================================
   Модальные окна: масштаб вместо стандартного "падения" Bootstrap на 50px вниз.
   Закрывается быстрее, чем открывается.
   ============================================================ */
.modal.fade .modal-dialog {
    transform: scale(.97);
    transition: transform .2s var(--ease), opacity .2s var(--ease);
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.modal-content {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-backdrop.show { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
    .modal.fade .modal-dialog { transition: none; }
}

/* ============================================================
   Быстрый переход (Ctrl+K)
   ============================================================ */
.cmdk {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 16px 16px;
}

.cmdk__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 20, .45);
    backdrop-filter: blur(2px);
    animation: cmdkFade .15s var(--ease) both;
}

.cmdk__panel {
    position: relative;
    width: min(620px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    /* Панель приходит сверху - оттуда, где её вызвали клавишами, а не разрастается из центра. */
    animation: cmdkIn .18s var(--ease) both;
}

@keyframes cmdkFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmdkIn {
    from { opacity: 0; transform: translateY(-8px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cmdk__search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.cmdk__input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: var(--text-md);
    outline: none;
}

.cmdk__kbd,
.cmdk__footer kbd {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    color: var(--muted);
    background: var(--paper);
}

.cmdk__results {
    max-height: 52vh;
    overflow-y: auto;
    padding: 6px;
}

.cmdk__group {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 10px 4px;
}

.cmdk__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    text-decoration: none;
    font-size: var(--text-base);
}

.cmdk__item.is-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.cmdk__item i { opacity: .75; }
.cmdk__title { flex: 1; }
.cmdk__sub { font-size: var(--text-sm); color: var(--muted); }
.cmdk__item.is-active .cmdk__sub { color: var(--accent); opacity: .8; }

.cmdk__empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    font-size: var(--text-base);
}

.cmdk__footer {
    display: flex;
    gap: 16px;
    padding: 9px 16px;
    border-top: 1px solid var(--line);
    background: var(--paper);
    font-size: var(--text-xs);
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    .cmdk__panel, .cmdk__backdrop { animation: none; }
}

/* ============================================================
   Закреплённая шапка таблицы. Работает только внутри контейнера с вертикальной
   прокруткой (например .claims-table-wrap): при прокрутке длинного списка заголовки
   колонок остаются на месте, иначе на середине таблицы уже непонятно, что за столбец.
   ============================================================ */
.table-sticky-head thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

/* Своя подложка обязательна: у прилипшей ячейки прозрачный фон, и строки просвечивали бы
   сквозь заголовок при прокрутке. */
.table-sticky-head thead th::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

/* ============================================================
   Пустое состояние - когда данных за период нет.
   Вместо строки серого текста: что именно пусто, почему и что можно сделать.
   ============================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 40px 24px;
    color: var(--ink-soft);
}

.empty-state__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: var(--text-xl);
    margin-bottom: 4px;
}

.empty-state__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-md);
    color: var(--ink);
}

.empty-state__hint {
    font-size: var(--text-base);
    color: var(--muted);
    max-width: 46ch;
}

.empty-state__action {
    margin-top: 10px;
}

/* Внутри таблицы состояние занимает всю ширину и не притворяется строкой данных. */
td > .empty-state {
    padding: 32px 16px;
}

/* ============================================================
   Всплывающие сообщения о результате действия
   ============================================================ */
.toast-stack {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    font-size: var(--text-base);
    pointer-events: auto;
    /* Появляется от края, к которому принадлежит: выезжает справа, а не возникает из ничего. */
    animation: toastIn .28s var(--ease) both;
}

.app-toast > i:first-child { font-size: var(--text-md); line-height: 1.35; }
.app-toast span { flex: 1; }
.app-toast--success > i:first-child { color: var(--green-ink); }
.app-toast--error > i:first-child { color: var(--red-ink); }

/* Тонированный фон вместо цветной полосы слева - спокойнее и не оставляет на карточке
   единственный ярко-цветной край. */
.app-toast--success { background: var(--green-soft); }
.app-toast--error { background: var(--red-soft); }

.app-toast__close {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 0 2px;
    line-height: 1;
    cursor: pointer;
    transition: color .15s var(--ease);
}

.app-toast__close:hover { color: var(--ink); }

/* Живое уведомление (см. site.js, NotificationHub): кликабельная карточка того же вида, что и
   строка в колокольчике - кружок-значок в цветах .feed__item--*, заголовок и текст в две строки. */
.app-toast--notify { padding: 10px 10px 10px 12px; width: 360px; max-width: 100%; }

.app-toast__link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.app-toast__link:hover .app-toast__title { color: var(--accent-ink); }

.app-toast__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: var(--text-sm);
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.app-toast__icon--claim { background: var(--violet-soft); color: var(--violet-ink); }
.app-toast__icon--alert { background: var(--red-soft); color: var(--red-ink); }
.app-toast__icon--money { background: var(--green-soft); color: var(--green-ink); }

.app-toast__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.app-toast__title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .15s var(--ease);
}

.app-toast__body {
    color: var(--muted);
    font-size: var(--text-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.app-toast.is-leaving {
    animation: toastOut .2s var(--ease) both;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(16px) scale(.98); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(16px); }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast, .app-toast.is-leaving { animation: none; }
}

/* ============================================================
   Сегментированный переключатель для фильтров (половина месяца и т.п.).
   Все варианты видны сразу, выбор - одно нажатие вместо "открыть список - выбрать".
   ============================================================ */
.segmented {
    --seg-count: 2;
    position: relative;
    display: flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper);
}

.segmented__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc((100% - 6px - 2px) / var(--seg-count));
    height: calc(100% - 6px);
    border-radius: calc(var(--radius-sm) - 2px);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: translateX(calc(var(--seg-index) * (100% + 2px)));
    transition: transform .25s var(--ease);
}

.segmented__opt {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: 6px 4px;
    border: none;
    background: transparent;
    border-radius: calc(var(--radius-sm) - 2px);
    color: var(--muted);
    font-size: var(--text-base);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: color .15s var(--ease);
}

.segmented__opt:hover { color: var(--ink-soft); }
.segmented__opt.is-active { color: var(--accent); }

.segmented__opt:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Замок на зафиксированном периоде - приглушён, чтобы не спорить с подписью. */
.segmented__badge {
    font-size: var(--text-xs);
    opacity: .6;
}

@media (prefers-reduced-motion: reduce) {
    .segmented__thumb { transition: none; }
}

/* ============================================================
   Cards
   ============================================================ */
.card-modern {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}

/* Подъём при наведении убран: .card-modern - обычный контейнер для таблиц и форм, курсор
   ходит по нему постоянно, и всплывающий блок дёргал бы содержимое под указателем. Тень
   остаётся, она обозначает наведение, ничего не смещая. Кликабельные карточки модулей на
   главной поднимаются по-прежнему - у .module-card свой :hover ниже.

   Эффекты наведения - только для мыши: на сенсорном экране :hover залипает после касания
   и снимается лишь тапом по другому месту. */
@media (hover: hover) {
    .card-modern:hover {
        box-shadow: var(--shadow-md);
    }
}

.card-modern .card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 16px 20px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-md);
    color: var(--ink);
}

.card-modern .card-body {
    padding: 20px;
}

/* Module / dashboard cards */
.module-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
    color: var(--ink);
}

.module-card.is-disabled {
    opacity: .6;
    pointer-events: none;
}

.module-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.module-card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: var(--text-xl);
}

.module-card__code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: .08em;
    color: var(--muted);
}

.module-card__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0;
}

.module-card__desc {
    color: var(--muted);
    font-size: var(--text-base);
    margin: 0;
    flex-grow: 1;
}

.module-card__go {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.module-card__go i {
    transition: transform .2s var(--ease);
}

.module-card:hover .module-card__go i {
    transform: translateX(3px);
}

/* ============================================================
   Page header — переиспользуемый заголовок раздела
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-header__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.page-header h2 {
    margin: 0;
}

/* ============================================================
   Dashboard hero — контейнерная анимация, не на весь фон
   ============================================================ */
.dash-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 34px 30px;
    background: var(--surface);
}

.dash-hero__grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        repeating-linear-gradient(90deg, var(--hero-grid-line) 0 1px, transparent 1px 46px),
        repeating-linear-gradient(0deg, var(--hero-grid-line) 0 1px, transparent 1px 46px);
    -webkit-mask-image: linear-gradient(115deg, black 20%, transparent 75%);
    mask-image: linear-gradient(115deg, black 20%, transparent 75%);
    animation: heroGridPan 26s linear infinite;
}

@keyframes heroGridPan {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 92px 0, 0 92px; }
}

.dash-hero__glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(440px circle at 10% 20%, var(--hero-glow-1), transparent 62%),
        radial-gradient(380px circle at 90% 80%, var(--hero-glow-2), transparent 62%),
        radial-gradient(280px circle at 65% -15%, var(--hero-glow-3), transparent 65%);
    animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(3%, -4%) scale(1.1); }
}

.dash-hero__content {
    position: relative;
    z-index: 1;
}

.dash-hero h1 {
    margin-bottom: 6px;
}

@media (prefers-reduced-motion: reduce) {
    .dash-hero__glow, .dash-hero__grid { animation: none; }
}

/* ============================================================
   Badges / status pills
   ============================================================ */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 600;
}

.badge-soft-amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge-soft-green { background: var(--green-soft); color: var(--green-ink); }
.badge-soft-red   { background: var(--red-soft);   color: var(--red-ink); }
.badge-soft-accent{ background: var(--accent-soft);color: var(--accent-ink); }

.legend-bar {
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--ink-soft);
}

/* ============================================================
   Tables
   ============================================================ */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

/* Цифры в таблицах - моноширинные по ширине знака. В пропорциональном шрифте "1" уже
   остальных цифр, из-за чего колонки сумм не выстраиваются по разрядам и их тяжело
   сравнивать взглядом. Буквы это не затрагивает. */
.table-modern th,
.table-modern td {
    font-variant-numeric: tabular-nums;
}

.table-modern thead th {
    background: var(--paper);
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: .06em;
    border: none;
    padding: 14px 12px;
}

.table-modern tbody td {
    padding: 14px 12px;
    border-top: 1px solid var(--line);
    vertical-align: middle;
    color: var(--ink);
}

.table-modern tbody tr {
    transition: background .15s var(--ease);
}

.table-modern tbody tr:hover {
    background: var(--accent-soft);
}

/* Bootstrap .table-light/.table-secondary/.bg-light are fixed-color by design
   and don't follow data-bs-theme — retarget them so dark mode has no white patches. */
.table-light {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--paper);
    --bs-table-border-color: var(--line);
    --bs-table-striped-bg: var(--paper);
}

.table-secondary {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--paper);
    --bs-table-border-color: var(--line);
    --bs-table-striped-bg: var(--paper);
    opacity: .75;
}

.bg-light {
    background-color: var(--paper) !important;
}

.table-warning {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--amber-soft);
    --bs-table-border-color: var(--line);
}

.table-info {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--accent-soft);
    --bs-table-border-color: var(--line);
}

.table-success {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--green-soft);
    --bs-table-border-color: var(--line);
}

.table-danger {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--red-soft);
    --bs-table-border-color: var(--line);
}

.table-primary {
    --bs-table-color: var(--ink);
    --bs-table-bg: var(--accent-soft);
    --bs-table-border-color: var(--line);
}

/* ============================================================
   Nav tabs
   ============================================================ */
.nav-tabs {
    border-bottom: 1px solid var(--line);
    gap: 4px;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--muted);
    font-weight: 600;
    padding: .6rem 1rem;
    transition: color .15s var(--ease), background .15s var(--ease);
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    background: var(--accent-soft);
    border: none;
    box-shadow: inset 0 -2px 0 var(--accent);
}

/* ============================================================
   Forms (shared with Login)
   ============================================================ */
.form-group-modern {
    margin-bottom: 20px;
    position: relative;
}

.form-label-modern {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--ink-soft);
    font-size: var(--text-sm);
}

.form-control-modern {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: var(--text-md);
    background: var(--paper);
    color: var(--ink);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input-icon {
    position: absolute;
    left: 14px;
    /* Отступ в 38 px отсчитывался от верха группы вместе с подписью, а обёртка на форме входа
       содержит только само поле - иконка уезжала под нижнюю границу. Центрирование не зависит
       от того, что лежит выше, и от высоты поля. */
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
    color: var(--muted);
    font-size: var(--text-md);
    transition: color .15s var(--ease);
}

.form-control-modern:focus + .input-icon {
    color: var(--accent);
}

.form-check-modern {
    display: flex;
    align-items: center;
    margin-bottom: 22px;
}

.form-check-modern input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent);
}

.form-check-modern label {
    margin: 0;
    cursor: pointer;
    user-select: none;
    color: var(--ink-soft);
    font-size: var(--text-base);
}

.validation-message {
    color: var(--red-ink);
    font-size: var(--text-sm);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   LOGIN — живая витрина: aurora-фон + непрерывно "дышащая"
   сетка ячеек ПВЗ + стеклянная карточка формы.
   ============================================================ */
.login-stage {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
    background: radial-gradient(circle at 18% 15%, #0E1B36 0%, #070B14 55%, #030509 100%);
}

.aurora {
    position: absolute;
    inset: -10%;
    filter: blur(70px);
    z-index: 0;
}

.aurora .blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    opacity: .8;
}

.aurora .blob-a {
    width: 560px;
    height: 560px;
    left: -8%;
    top: -12%;
    background: radial-gradient(circle, #005BFF 0%, transparent 70%);
    animation: driftA 24s ease-in-out infinite alternate;
}

.aurora .blob-b {
    width: 480px;
    height: 480px;
    right: -8%;
    top: 6%;
    background: radial-gradient(circle, #00C2FF 0%, transparent 70%);
    animation: driftB 28s ease-in-out infinite alternate;
}

.aurora .blob-c {
    width: 440px;
    height: 440px;
    left: 26%;
    bottom: -18%;
    background: radial-gradient(circle, #FF8A00 0%, transparent 72%);
    opacity: .35;
    animation: driftC 32s ease-in-out infinite alternate;
}

@keyframes driftA { from { transform: translate(0, 0) scale(1); } to { transform: translate(70px, 50px) scale(1.15); } }
@keyframes driftB { from { transform: translate(0, 0) scale(1); } to { transform: translate(-60px, 70px) scale(1.1); } }
@keyframes driftC { from { transform: translate(0, 0) scale(1); } to { transform: translate(50px, -40px) scale(1.2); } }

.cell-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
    padding: 22px;
    -webkit-mask-image: radial-gradient(circle at 50% 45%, black, transparent 82%);
    mask-image: radial-gradient(circle at 50% 45%, black, transparent 82%);
}

.cell-field .cell {
    border-radius: var(--radius-xs);
    border: 1px solid rgba(255, 255, 255, .07);
    background: rgba(255, 255, 255, .02);
    animation: cellBreathe 7s ease-in-out infinite;
    animation-delay: calc(var(--i) * 131ms);
}

/* Число колонок посчитано под пропорции экрана - высота поля всегда 100vh (растягивает
   .cell-field), а ячейки квадратные только если ширина/высота колонок и строк совпадают.
   16 колонок держат квадрат на широком низком десктопе; тот же счёт на узком высоком
   мобильном экране даёт всего 6 строк на всю высоту - ячейки растягиваются в вертикальные
   прямоугольники. Меньше колонок → больше строк → ячейки снова близки к квадрату. */
@media (max-width: 768px) {
    .cell-field { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 480px) {
    .cell-field { grid-template-columns: repeat(6, 1fr); }
}

@keyframes cellBreathe {
    0%, 100% { border-color: rgba(255, 255, 255, .07); background: rgba(255, 255, 255, .02); box-shadow: none; }
    45%      { border-color: #3D82FF; background: rgba(61, 130, 255, .28); box-shadow: 0 0 18px rgba(61, 130, 255, .35); }
}

.float-icon {
    position: absolute;
    z-index: 1;
    color: rgba(255, 255, 255, .07);
    animation: floatY ease-in-out infinite;
}

@keyframes floatY {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-22px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
    .aurora .blob, .cell-field .cell, .float-icon { animation: none !important; }
    .cell-field .cell { border-color: rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); }
}

.login-center {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    justify-content: center;
}

.glass-card {
    width: 100%;
    max-width: 420px;
    background: rgba(18, 21, 30, .55);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--radius-lg);
    padding: 38px 34px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
    color: #fff;
    animation: cardIn .6s var(--ease) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.glass-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.glass-card__brand .mark {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    box-shadow: 0 8px 20px rgba(0, 91, 255, .45);
    flex-shrink: 0;
}

.glass-card__brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-md);
    color: #fff;
}

.glass-card__brand-sub {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, .5);
}

.glass-card__headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-xl);
    line-height: 1.3;
    margin: 0 0 6px;
}

.glass-card__sub {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, .55);
    margin: 0 0 26px;
}

.glass-card .form-label-modern { color: rgba(255, 255, 255, .72); }
.glass-card .form-control-modern {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .14);
    color: #fff;
}
.glass-card .form-control-modern::placeholder { color: rgba(255, 255, 255, .32); }
.glass-card .form-control-modern:focus {
    background: rgba(255, 255, 255, .1);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(61, 130, 255, .3);
}
.glass-card .input-icon { color: rgba(255, 255, 255, .4); }
.glass-card .form-control-modern:focus + .input-icon { color: #fff; }
.glass-card .form-check-modern label { color: rgba(255, 255, 255, .68); }
.glass-card .validation-message { color: #FF9C90; }

.login-foot {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 18px;
    color: rgba(255, 255, 255, .35);
    font-size: var(--text-xs);
    font-family: var(--font-mono);
}

.btn-login {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-size: var(--text-md);
    font-weight: 700;
    cursor: pointer;
    transition: background .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
    box-shadow: 0 1px 2px rgba(0, 91, 255, .25);
}

.btn-login:hover {
    background: var(--accent-ink);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 91, 255, .25);
}

.btn-login:active {
    transform: translateY(0);
}

/* ============================================================
   Лента событий (.feed) - переехала сюда из Pages/Index.cshtml, т.к. используется ещё в
   центре уведомлений (Pages/Notifications/Index.cshtml) и в колокольчике шапки
   (_Layout.cshtml) - держать её в трёх местах по отдельности означало бы дублировать
   каждую правку трижды.
   ============================================================ */
.feed { list-style: none; margin: 0; padding: 0; }

.feed__item + .feed__item { border-top: 1px solid var(--line); }

.feed__link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 4px;
    text-decoration: none;
    color: var(--ink);
    border-radius: var(--radius-sm);
    transition: background .15s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
    .feed__link:hover { background: var(--paper); color: var(--ink); }
}

.feed__icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: var(--text-sm);
    background: var(--slate-soft);
    color: var(--slate-ink);
}

/* Вид события кодируется значком и цветом кружка: замок - закрытие периода,
   ромб - претензия, купюра - деньги на согласовании. */
.feed__item--lock .feed__icon { background: var(--accent-soft); color: var(--accent-ink); }
.feed__item--claim .feed__icon { background: var(--violet-soft); color: var(--violet-ink); }
.feed__item--alert .feed__icon { background: var(--red-soft); color: var(--red-ink); }
.feed__item--money .feed__icon { background: var(--green-soft); color: var(--green-ink); }

.feed__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.feed__title { font-size: var(--text-sm); font-weight: 500; }
.feed__details { font-size: var(--text-xs); color: var(--muted); }

.feed__time {
    flex-shrink: 0;
    font-size: var(--text-xs);
    color: var(--ink-3, var(--muted));
    white-space: nowrap;
    padding-top: 2px;
}

/* Непрочитанное уведомление (центр уведомлений/колокольчик, не лента главной - там
   отдельного понятия "прочитано" нет) - точка слева и чуть более яркий заголовок. */
.feed__item--unread .feed__title { font-weight: 700; color: var(--ink); }
.feed__item--unread .feed__link { position: relative; }
.feed__item--unread .feed__link::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 18px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.feed-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 4px;
    color: var(--muted);
}

.feed-empty i { font-size: var(--text-3xl); opacity: .5; }
.feed-empty b { color: var(--ink); font-size: var(--text-base); }
.feed-empty p { margin: 2px 0 0; font-size: var(--text-sm); }

.btn-login:disabled {
    opacity: .75;
    cursor: default;
    transform: none;
}
