/*
 * Полный переход интерфейса на Tabler (github.com/tabler/tabler, MIT):
 * assets/template/tabler/css/tabler.min.css — официальная сборка
 * @tabler/core, подключена в layout/header.php ВМЕСТО шаблона Hando.
 * Tabler (@tabler/core) + app.css: единая дизайн-система поверх Tabler.
 * Tabler даёт базовые компоненты; app.css задаёт токены (--app-*),
 * компактный ритм, таблицы, dataTables, flatpickr и уникальные блоки
 * (дашборд, сайдбар, сервисные кнопки, конструктор форм).
 */

/* Feather: плейсхолдер невидим до replace; SVG сразу нужного размера (без 24→15 сверху слева) */
[data-feather]:not(svg) {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    flex-shrink: 0;
    overflow: hidden;
    visibility: hidden;
    speak: never;
}

/* Stroke feather выходит за viewBox — без overflow:visible обрезаются «уши» календаря, края trash и т.п. */
svg.feather,
svg.lucide {
    overflow: visible;
}

.app-menu-icon [data-feather]:not(svg),
.app-sidebar .nav-link-icon [data-feather]:not(svg),
.app-topbar-menu__link-icon [data-feather]:not(svg),
.app-topbar-menu__group-icon [data-feather]:not(svg),
.app-topbar-menu__dropdown-icon [data-feather]:not(svg),
.app-topbar-subnav__icon [data-feather]:not(svg) {
    width: 16px;
    height: 16px;
}

.btn [data-feather]:not(svg) {
    width: 1em;
    height: 1em;
}

/* Меню: иконки уже inline с сервера — без клиентской перерисовки */
.app-menu-icon > svg.feather,
.app-sidebar .nav-link-icon > .app-menu-icon > svg.feather,
.app-topbar-menu__link-icon > svg.feather,
.app-topbar-menu__group-icon > svg.feather,
.app-topbar-menu__dropdown-icon > svg.feather,
.app-topbar-subnav__icon > svg.feather {
    display: block;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
}

/* Geist Mono — моноширинный (код, SQL); UI-шрифт — Open Sans (см. open-sans.css) */
@font-face {
    font-family: 'Geist Mono';
    src: url('../fonts/geist/GeistMono-Variable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: optional;
}

.font-monospace,
code,
pre,
kbd,
samp {
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace);
}

/* --- мост переменных: у Tabler свой префикс (--tblr-*), а не Bootstrap
   (--bs-*), на котором были написаны наши собственные классы (виджеты,
   дерево сущностей, flatpickr-тема, dataTables). Явно не задаём тут
   ничего в --tblr-primary/border-radius и т.п. — дефолты Tabler уже
   совпадают с нашим фирменным синим (#066fd1) и нужными скруглениями,
   переопределять их незачем. Мост просто разрешает нашим старым
   классам находить значения по знакомым именам. --- */
:root {
    --brand-accent: #0B679E;
    /* Фактический UI-шрифт задаётся в layout/header.php (app_settings_ui_font_vars_html) */
    --tblr-font-sans-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* «Вдавленный» контрол: время в таблицах + поле «выбор со списком» (.app-field-select) */
    --app-inset-bg: color-mix(in srgb, var(--app-table-header-bg, #f1f5f9) 45%, #fff);
    --app-inset-border: color-mix(in srgb, var(--app-table-border, #d0d7e0) 45%, transparent);
    --app-inset-shadow:
        inset 0 1px 1px rgba(15, 23, 42, .05),
        inset 0 -1px 0 rgba(255, 255, 255, .65);

    --bs-primary: var(--tblr-primary);
    --bs-primary-rgb: var(--tblr-primary-rgb);
    --bs-body-bg: var(--tblr-body-bg);
    --bs-body-color: var(--tblr-body-color);
    --bs-border-color: var(--tblr-border-color);
    --bs-secondary-color: var(--tblr-secondary-color);
    --bs-tertiary-bg: var(--tblr-bg-surface-secondary);
    --bs-card-bg: var(--tblr-bg-surface);
    --bs-border-radius: var(--tblr-border-radius);
    --bs-font-monospace: var(--tblr-font-monospace, monospace);
    --bs-link-color: var(--tblr-link-color);
    --bs-link-color-rgb: var(--tblr-primary-rgb);
    --bs-success: var(--tblr-success);
}

html,
body {
    font-family: var(--tblr-font-sans-serif);
    overflow-x: hidden;
}

body {
    font-family: var(--tblr-font-sans-serif) !important;
}

/* Не форсируем шрифт на все теги — иначе ломаются иконки (FA / Line Awesome / Tabler Icons)
   и появляется ощущение «сначала один шрифт, потом другой». */

/* Font Awesome (solid) требует вес 900 для отображения глифов — иначе показывает
   пустые квадраты. Глиф иконки рисуется через content на псевдоэлементе
   ::before (так работает Font Awesome / наша самохостящаяся Line Awesome),
   поэтому вес нужно задавать именно на ::before/::after — псевдоэлементы
   не наследуют переопределённый вес шрифта от родителя. */
.fas,
.fa,
.fas::before,
.fas::after,
.fa::before,
.fa::after {
    font-weight: 900 !important;
}

/* --- заголовки разделов бокового меню (см. layout/header.php,
   .nav-section-title) — своего готового класса под тёмный сайдбар
   в Tabler нет, стиль подобран по образцу их .subheader --- */
.nav-section-title {
    padding: .5rem 1.5rem .2rem;
    font-size: .7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--tblr-secondary-color);
}

.nav-section-title:first-child {
    padding-top: .15rem;
}

/* --- вспомогательные классы, которых нет в Bootstrap/Tabler --- */
.text-xs {
    font-size: .7rem;
}

.text-gray-300 {
    color: var(--tblr-gray-300, #d1d5db) !important;
}

.text-gray-600 {
    color: var(--tblr-secondary-color) !important;
}

.text-gray-800 {
    color: var(--tblr-body-color) !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.border-left-primary {
    border-left: .25rem solid var(--tblr-primary) !important;
}

.border-left-success {
    border-left: .25rem solid var(--tblr-success, #2fb344) !important;
}

/* --- дерево сущностей --- */
.entity-tree .entity-row {
    padding: .5rem .6rem;
    border-radius: var(--tblr-border-radius);
    border-left: 2px solid transparent;
}

.entity-tree .entity-row:hover {
    background: rgba(var(--tblr-primary-rgb), .06);
    border-left-color: var(--tblr-primary);
}

/* --- кнопки-иконки: геометрия задаётся в блоке «Единая система размеров» --- */

/* --- second-tier outline-кнопки (btn-outline-secondary): у Tabler обводка
   и текст идут цветом secondary (#6b7280) и выглядят почти чёрными.
   Держим светло-серую рамку и мягкий hover — как у чипов/полей в списках. */
.btn-outline-secondary {
    --tblr-btn-color: #5b6b7c;
    --tblr-btn-bg: #f3f5f7;
    --tblr-btn-border-color: #d0dce6;
    --tblr-btn-hover-color: #0f2d42;
    --tblr-btn-hover-bg: #e9eef3;
    --tblr-btn-hover-border-color: #b9cbd8;
    --tblr-btn-active-color: #0f2d42;
    --tblr-btn-active-bg: #e2e8ee;
    --tblr-btn-active-border-color: #b9cbd8;
    --tblr-btn-disabled-color: #8aa0b0;
    --tblr-btn-disabled-bg: #f8fafc;
    --tblr-btn-disabled-border-color: #e2eaf0;
    background: #f3f5f7;
    border-color: #d0dce6;
    color: #5b6b7c;
    box-shadow: none;
}

/* Outline primary: тонкая серая обводка как у «Печатные формы». */
.btn-outline-primary {
    --tblr-btn-color: #3d5668;
    --tblr-btn-bg: #fff;
    --tblr-btn-border-color: #d0dce6;
    --tblr-btn-hover-color: #0f2d42;
    --tblr-btn-hover-bg: #f4f7fa;
    --tblr-btn-hover-border-color: #b9cbd8;
    --tblr-btn-active-color: #0f2d42;
    --tblr-btn-active-bg: #eef3f7;
    --tblr-btn-active-border-color: #b9cbd8;
    --tblr-btn-disabled-color: #8aa0b0;
    --tblr-btn-disabled-bg: #fff;
    --tblr-btn-disabled-border-color: #e2eaf0;
    background: #fff;
    border-color: #d0dce6;
    color: #3d5668;
    box-shadow: none;
}

/* Primary: белый фон и тонкая серая обводка — как остальные outline-кнопки. */
.btn-primary {
    --tblr-btn-color: #3d5668;
    --tblr-btn-bg: #fff;
    --tblr-btn-border-color: #d0dce6;
    --tblr-btn-hover-color: #0f2d42;
    --tblr-btn-hover-bg: #f4f7fa;
    --tblr-btn-hover-border-color: #b9cbd8;
    --tblr-btn-active-color: #0f2d42;
    --tblr-btn-active-bg: #eef3f7;
    --tblr-btn-active-border-color: #b9cbd8;
    background: #fff !important;
    border-color: #d0dce6 !important;
    color: #3d5668 !important;
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: #f4f7fa !important;
    border-color: #b9cbd8 !important;
    color: #0f2d42 !important;
    box-shadow: none;
    filter: none;
}

.btn-primary:active {
    background: #eef3f7 !important;
    filter: none;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    background: #f4f7fa !important;
    border-color: #b9cbd8 !important;
    color: #0f2d42 !important;
    box-shadow: none;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    background: #e9eef3 !important;
    border-color: #b9cbd8 !important;
    color: #0f2d42 !important;
    box-shadow: none;
}

/* --- круглые кнопки-иконки в шапке (избранное, переключатель темы):
   вместо инверсии в сплошной серый фон на hover — просто меняем цвет
   иконки на фирменный синий, фон остаётся прозрачным --- */
.app-topbar .btn-ghost-secondary {
    --tblr-btn-hover-color: var(--brand-accent);
    --tblr-btn-hover-bg: transparent;
    --tblr-btn-hover-border-color: transparent;
    --tblr-btn-active-color: var(--brand-accent);
    --tblr-btn-active-bg: transparent;
    --tblr-btn-active-border-color: transparent;
}

/* --- кнопки-ссылки на управление дашбордом внизу главной: рамка и иконка
   в фирменном синем (#0B679E), иконка в заливке слева, текст акцентом --- */

/* Спокойная «выпуклая» кнопка — единый стиль с кнопками панели фильтров */
.btn-soft,
.btn.btn-soft {
    color: #475569;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%);
    border: 1px solid #dbe3eb;
    border-radius: 6px;
    font-weight: 500;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 1px 2px rgba(15, 23, 42, .06);
}

.btn-soft:hover,
.btn.btn-soft:hover {
    color: #334155;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #cfd8e3;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 2px 4px rgba(15, 23, 42, .08);
}

.btn-soft:active,
.btn.btn-soft:active,
.btn-soft:focus-visible,
.btn.btn-soft:focus-visible {
    color: #334155;
    background: #eef2f6;
    border-color: #c5d0dc;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .1);
}

.btn-soft:focus-visible,
.btn.btn-soft:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, .12);
}

.btn-soft svg.feather,
.btn.btn-soft svg.feather {
    color: inherit;
    stroke: currentColor;
}

/* Тот же стиль, что у «Применить / Сбросить» в фильтрах */
.order-blanks-actions__group .dropdown-toggle,
.order-blanks-actions .btn.btn-outline-secondary,
.item-page-documents__btn.btn,
.item-page-reports__btn.btn,
.item-page-reports__quick.btn,
.service-toolbar .btn-outline-secondary:not(.btn-icon),
.page-header-actions-right .btn-outline-secondary:not(.btn-icon),
.print-form-buttons__btn.btn-outline-secondary:not(.btn-icon) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%) !important;
    border: 1px solid #dbe3eb !important;
    border-radius: 6px !important;
    font-weight: 500;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 1px 2px rgba(15, 23, 42, .06) !important;
}

.order-blanks-actions__group .dropdown-toggle:hover,
.order-blanks-actions__group .dropdown-toggle:focus,
.order-blanks-actions__group .dropdown-toggle.show,
.order-blanks-actions .btn.btn-outline-secondary:hover,
.order-blanks-actions .btn.btn-outline-secondary:focus,
.item-page-documents__btn.btn:hover,
.item-page-documents__btn.btn:focus,
.item-page-documents__btn.btn.show,
.item-page-reports__btn.btn:hover,
.item-page-reports__btn.btn:focus,
.item-page-reports__btn.btn.show,
.item-page-reports__quick.btn:hover,
.item-page-reports__quick.btn:focus,
.service-toolbar .btn-outline-secondary:not(.btn-icon):hover,
.service-toolbar .btn-outline-secondary:not(.btn-icon):focus,
.page-header-actions-right .btn-outline-secondary:not(.btn-icon):hover,
.page-header-actions-right .btn-outline-secondary:not(.btn-icon):focus,
.print-form-buttons__btn.btn-outline-secondary:not(.btn-icon):hover,
.print-form-buttons__btn.btn-outline-secondary:not(.btn-icon):focus {
    color: #334155 !important;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%) !important;
    border-color: #cfd8e3 !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 2px 4px rgba(15, 23, 42, .08) !important;
}

.btn-accent-split {
    display: inline-flex;
    align-items: stretch;
    height: 30px;
    padding: 0 !important;
    overflow: hidden;
    border-color: var(--brand-accent) !important;
    background: transparent !important;
    line-height: 1;
}

.btn-accent-split-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: linear-gradient(135deg, #1583C0, var(--brand-accent));
    color: #fff;
}

.btn-accent-split-icon svg.feather {
    margin-right: 0 !important;
    width: 15px;
    height: 15px;
    color: #fff;
    stroke: #fff;
    flex: 0 0 auto;
}

.btn-accent-split-label {
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--brand-accent);
    white-space: nowrap;
}

.btn-accent-split:hover {
    background: color-mix(in srgb, var(--brand-accent) 6%, transparent) !important;
}

.btn-accent-split:hover .btn-accent-split-label { color: var(--brand-accent); }

/* иконка + подпись во всех кнопках — Font Awesome (feather — через gap в .btn) */

/* Inline-code задаётся в блоке «Единая система размеров». */

.system-field-row {
    color: var(--tblr-secondary-color);
    font-weight: 400;
}

.system-fields-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
    color: var(--tblr-body-color);
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 1.2;
}

.system-fields-title span {
    color: var(--tblr-secondary-color);
    font-size: inherit;
    font-weight: 400;
}

.field-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 5px;
    background: #f3f4f6;
    color: #64748b;
    vertical-align: middle;
    flex: 0 0 auto;
}

.field-lock-badge .icon-svg {
    width: 12px;
    height: 12px;
    display: block;
}

.system-fields-panel {
    margin-bottom: 1.15rem;
    border: 1px solid var(--tblr-border-color-translucent, rgba(15, 45, 66, .1));
    border-radius: var(--app-control-radius, 0.375rem);
    background: #fff;
}

.system-fields-panel__summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    /* UA: summary { font-weight: bold } */
    font-weight: 400;
}

.system-fields-panel__summary::-webkit-details-marker,
.system-fields-panel__summary::marker {
    display: none;
    content: '';
}

.system-fields-panel__summary::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid #94a3b8;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    flex: 0 0 auto;
    transition: transform .15s ease;
}

.system-fields-panel[open] > .system-fields-panel__summary::before {
    transform: rotate(90deg);
}

.system-fields-panel__title {
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    color: var(--tblr-body-color);
}

.system-fields-panel__count {
    margin-left: auto;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
}

.system-fields-panel__body {
    border-top: 1px solid var(--tblr-border-color-translucent, rgba(15, 45, 66, .1));
}

.system-fields-panel__body .table,
.system-fields-panel__body .table td,
.app-system-fields-table,
.app-system-fields-table td {
    margin-bottom: 0;
    font-weight: 400;
}

.field-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid #d7c58d;
    border-radius: 5px;
    background: #fff9e8;
    color: #65521e;
    font-size: var(--app-font-size, 14px);
    font-weight: 500;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
}

.field-status-badge svg.feather {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    stroke-width: 2;
}

.field-status-badge-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    cursor: help;
}

.field-status-badge-icon .icon-svg {
    width: 15px;
    height: 15px;
    fill: #b08c1f;
}

/* --- свои inline-svg иконки (логотип / редактировать / удалить) --- */
.icon-svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: currentColor;
    flex-shrink: 0;
}

/* МАКС: широкий viewBox — выравниваем по центру линии иконок 16px */
.icon-svg--max {
    width: 1.25em;
    height: 0.86em;
    overflow: visible;
    vertical-align: middle;
    display: inline-block;
}

.app-menu-icon .icon-svg--max,
.app-topbar-menu__link-icon .icon-svg--max,
.app-topbar-menu__group-icon .icon-svg--max,
.app-topbar-menu__dropdown-icon .icon-svg--max {
    width: 18px !important;
    height: 12px !important;
    max-width: none;
    max-height: none;
}

.app-topbar-max-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 16px;
    line-height: 0;
    color: var(--tblr-secondary-color);
    text-decoration: none;
}

.app-topbar-max-btn .icon-svg--max,
.app-topbar-square-btn .icon-svg--max {
    width: 18px !important;
    height: 12px !important;
    margin: 0 !important;
    vertical-align: 0;
    display: block;
    transform: translateY(-2px);
}

.app-topbar-max-btn:hover,
.app-topbar-max-btn.is-active {
    color: #0B679E;
}

/* иконка меню сущности / группы меню, когда значение — сама SVG-разметка
   (выбрана из библиотеки Lucide или своя), а не CSS-класс — см.
   includes/functions.php::icon_value_render() */
.icon-value-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: 0;
    line-height: 0;
    overflow: visible;
}

.icon-value-svg svg,
.icon-svg-custom {
    width: 1em;
    height: 1em;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
    display: block;
    overflow: visible;
    margin: 0;
}

.icon-value-svg svg:not([fill="none"]),
.icon-svg-custom:not([fill="none"]) {
    fill: currentColor;
}

.icon-value-svg svg [stroke],
.icon-svg-custom [stroke] {
    fill: none;
}

/* Lucide: тоньше линии и ровное выравнивание в меню / пикере */
.icon-value-svg svg[fill="none"],
.icon-svg-custom[fill="none"] {
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* превью в подборщике иконки (настройки сущности / меню) */
.fa-icon-picker-preview {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
    font-size: 22px;
    line-height: 0;
    color: var(--tblr-body-color);
}

.fa-icon-picker-preview .icon-value-svg,
.fa-icon-picker-preview > i,
.fa-icon-picker-preview > svg {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: inherit;
    line-height: 1;
}

.fa-icon-picker-preview .icon-value-svg svg,
.fa-icon-picker-preview > svg,
.fa-icon-picker-preview .icon-svg-custom {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.fa-icon-picker-preview__empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--tblr-secondary-color);
    opacity: .55;
    font-size: 18px;
    line-height: 1;
}

.logo-box .icon-svg {
    width: 22px;
    height: 22px;
    color: var(--tblr-primary);
}

.auth-brand .icon-svg {
    width: 32px;
    height: 32px;
    color: var(--brand-accent);
}

.auth-brand__logo {
    --auth-logo-size: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.auth-brand__logo .app-brand-logo,
.auth-brand__logo .icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--auth-logo-size);
    height: var(--auth-logo-size);
    color: inherit;
}

.auth-brand__logo .app-brand-logo svg,
.auth-brand__logo .icon-svg svg,
.auth-brand__logo svg {
    width: var(--auth-logo-size) !important;
    height: var(--auth-logo-size) !important;
    max-width: var(--auth-logo-size);
    max-height: var(--auth-logo-size);
    display: block;
}

.btn-icon .icon-svg {
    width: 13px;
    height: 13px;
}

/* --- главная: компактные карточки-статистики ---
   max-width — чтобы виджет не растягивался шире остальных карточек, когда
   в ряду мало элементов (flex-grow иначе отдаёт ему всё свободное место) */
.stat-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    flex: 1 1 220px;
    max-width: 300px;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    box-shadow: var(--app-shadow-sm, 0 1px 3px rgba(15, 23, 42, .035));
    padding: .9rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease;
}

/* Сетка главной (раскладка виджетов) */
.dash-layout-root {
    position: relative;
    min-height: 40vh;
}

/* Вкладки-дашборды на главной */
.dash-boards {
    margin-top: 0;
}
.dash-boards__tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    flex-wrap: wrap;
    margin: 0 0 12px;
    padding: 0 0 0;
    border: 0;
    border-bottom: 1px solid var(--tblr-border-color-translucent, rgba(15, 23, 42, .1));
    border-radius: 0;
    background: transparent;
    overflow: visible;
}
.dash-boards__tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0 12px 1px;
    margin: 0 0 -1px;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--tblr-secondary-color, #64748b);
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
    box-sizing: border-box;
    position: relative;
}
.dash-boards__tab:last-of-type,
.dash-boards__tab:has(+ .dash-boards__tab--add),
.dash-boards__tab:has(+ .dash-boards__tab-remove),
.dash-boards__tab:has(+ .dash-edit-fab) {
    border-right-color: transparent;
}
.dash-boards__tab:hover {
    color: var(--tblr-body-color, #1e293b);
    background: rgba(15, 23, 42, .035);
}
.dash-boards__tab.is-active {
    background: transparent;
    color: var(--brand-accent, #0B679E);
    font-weight: 500;
    box-shadow: none;
    border-bottom-color: var(--brand-accent, #0B679E);
}
.dash-boards__tab.is-active::after {
    display: none;
}
.dash-boards__tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: .8;
    color: inherit;
}
.dash-boards__tab-icon svg,
.dash-boards__tab-icon .icon-value-svg,
.dash-boards__tab-icon .icon-value-svg svg {
    width: 15px !important;
    height: 15px !important;
    display: block;
}
.dash-boards__tab-label {
    line-height: 1;
    white-space: nowrap;
}
.dash-boards__group {
    position: relative;
    display: inline-flex;
    align-items: flex-end;
}
.dash-boards__tab--group {
    gap: 5px;
}
.dash-boards__group-caret {
    width: 14px !important;
    height: 14px !important;
    opacity: .65;
    transition: transform .15s ease;
}
.dash-boards__group.is-open .dash-boards__group-caret {
    transform: rotate(180deg);
}
.dash-boards__group-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    min-width: max(100%, 160px);
    padding: 4px;
    margin: 0;
    border: 1px solid var(--tblr-border-color-translucent, rgba(15, 23, 42, .12));
    border-radius: 8px;
    background: var(--tblr-bg-surface, #fff);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .1);
    display: none;
    flex-direction: column;
    gap: 1px;
    pointer-events: none;
}
.dash-boards__group.is-open .dash-boards__group-menu {
    display: flex;
    pointer-events: auto;
}
.dash-boards__tab--menu-item {
    width: 100%;
    height: 32px;
    margin: 0;
    border-radius: 6px;
    border-bottom: 0;
    justify-content: flex-start;
    font-weight: 400;
}
.dash-boards__tab--menu-item.is-active {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 10%, transparent);
    border-bottom-color: transparent;
    font-weight: 400;
}
.dash-boards__group.is-active > .dash-boards__tab--group {
    color: var(--brand-accent, #0B679E);
    font-weight: 500;
    border-bottom-color: var(--brand-accent, #0B679E);
}
.dash-is-editing .dash-boards__group {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    margin: 0 4px 6px 0;
    padding: 6px 6px 4px;
    border: 1px dashed color-mix(in srgb, var(--brand-accent, #0B679E) 28%, #cbd5e1);
    border-radius: 10px;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #fff);
}
.dash-is-editing .dash-boards__group-menu {
    display: flex;
    position: static;
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    pointer-events: auto;
}
.dash-is-editing .dash-boards__tab--group {
    display: none;
}
.dash-boards__group-edit {
    display: none;
}
.dash-is-editing .dash-boards__group-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0 2px 2px;
}
.dash-boards__group-edit-icon {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
    color: var(--brand-accent, #0B679E);
    opacity: .85;
}
.dash-boards__group-edit-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    height: 26px;
    padding: 0 8px;
    border: 1px solid var(--tblr-border-color, #e2e8f0);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--brand-accent, #0B679E);
    background: #fff;
}
.dash-boards__group-edit-count {
    flex-shrink: 0;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 12%, #fff);
    color: var(--brand-accent, #0B679E);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4rem;
    text-align: center;
}
.dash-is-editing .dash-boards__tab--menu-item {
    width: auto;
    border-bottom: 1px solid transparent;
    border-radius: 8px 8px 0 0;
    background: #fff;
}
.dash-is-editing .dash-boards__tab--menu-item .dash-boards__tab-group-input,
.dash-is-editing .dash-boards__tab--menu-item input[data-role="board-group"][type="hidden"] {
    display: none !important;
}
.dash-is-editing .dash-boards__tab-group-input {
    display: inline-block;
    width: 96px;
    height: 22px;
    margin-left: 4px;
    padding: 0 6px;
    border: 1px solid var(--tblr-border-color, #e2e8f0);
    border-radius: 4px;
    font-size: 11px;
    color: var(--tblr-secondary-color, #64748b);
    background: #fff;
}
.dash-boards__tab-group-input[hidden] {
    display: none !important;
}
.dash-boards__tab-input {
    width: 120px;
    max-width: 28vw;
    height: 22px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
    outline: none;
}
.dash-boards__tab-input:focus {
    outline: none;
    box-shadow: none;
}
.dash-is-editing .dash-boards__tab-icon {
    cursor: pointer;
    border-radius: 4px;
}
.dash-is-editing .dash-boards__tab-icon:hover {
    opacity: 1;
    background: rgba(11, 103, 158, 0.1);
}
.dash-boards__tab--add {
    width: 32px;
    min-width: 32px;
    padding: 0 0 1px;
    margin: 0 0 -1px;
    justify-content: center;
    color: var(--brand-accent, #0B679E);
    border-right: 0;
    border-radius: 8px 8px 0 0;
}
.dash-boards__tab--add:hover {
    background: rgba(11, 103, 158, 0.06);
}
.dash-boards__tab-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 0 -1px;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.dash-boards__tab-remove:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, .06);
}
.dash-boards__panel[hidden] {
    display: none !important;
}
.dash-boards__empty {
    padding: 32px 12px;
}
.dash-board-icon-host > .d-flex {
    display: none !important;
}
.dash-board-icon-host > textarea {
    display: none !important;
}

.dash-grid__cell--report .dash-grid__body {
    min-height: 0;
}
.dash-report {
    display: block;
    width: 100%;
}
.dash-report--empty {
    padding: 16px 4px;
    color: var(--tblr-secondary-color, #64748b);
    font-size: 13px;
}
.dash-report__toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 8px;
    min-height: 0;
}
.dash-report__toolbar:empty {
    display: none;
    margin: 0;
}
.dash-report__filters {
    margin-bottom: 8px;
}
/* legacy pending placeholder while editing */
.dash-report-tile--pending {
    border: 1px dashed var(--tblr-border-color, #e2e8f0);
    border-radius: 8px;
    padding: 16px;
    color: var(--tblr-secondary-color, #64748b);
    font-size: 13px;
}
.dash-report-tile__msg {
    padding: 8px 0;
    text-align: center;
    color: var(--tblr-secondary-color, #64748b);
    font-size: 13px;
}
.dash-grid__report-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--tblr-secondary-color, #64748b);
    cursor: pointer;
}
.dash-grid__report-settings:hover {
    color: var(--brand-accent, #0B679E);
    background: rgba(11, 103, 158, 0.08);
}
.dash-report-defaults__row .form-label-sm {
    font-size: 12px;
    font-weight: 500;
}

.dash-is-editing .dash-boards__tabs {
    border-bottom-color: rgba(11, 103, 158, 0.28);
}

/* Настройка раскладки главной — в ряду вкладок справа */
.dash-edit-fab {
    position: static;
    margin-left: auto;
    margin-bottom: -1px;
    z-index: 2;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: #64748b;
    box-shadow: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.dash-edit-fab:hover {
    background: rgba(11, 103, 158, 0.06);
    border-color: transparent;
    color: var(--tblr-body-color, #1e293b);
}
.dash-edit-fab.is-active {
    color: var(--brand-accent, #0B679E);
    background: rgba(11, 103, 158, 0.1);
    border-color: transparent;
}
/* выше специфичность .btn-icon .icon-svg (14px) — иначе иконка выглядит крошечной */
.dash-edit-fab.btn-icon .icon-svg,
.dash-edit-fab .icon-svg {
    width: 20px !important;
    height: 20px !important;
}
.dash-edit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    margin: 0 48px 12px 0;
    padding: .55rem .75rem;
    background: #eef6ff;
    border: 1px solid #c7ddf7;
    border-radius: 10px;
}
.dash-edit-bar__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    min-width: 0;
}
.dash-edit-bar__text strong { font-size: 13px; color: #1e3a5f; }
.dash-edit-bar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.dash-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
}
.dash-grid__cell {
    position: relative;
    box-sizing: border-box;
    flex: 0 0 auto;
    /* 24 колонки с учётом gap: ширина = n долей ряда + (n−1) промежутков */
    width: calc(
        (100% - 23 * 12px) / 24 * var(--dash-span, 6)
        + (var(--dash-span, 6) - 1) * 12px
    );
    min-width: 0;
    max-width: 100%;
}
.dash-grid__cell--full {
    width: 100%;
    flex-basis: 100%;
}
.dash-grid__break {
    flex: 0 0 100%;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
}
.dash-grid__body > .stat-card,
.dash-grid__body > .stat-card--custom,
.dash-grid__cell > .stat-card,
.dash-grid__cell > .stat-card--custom {
    max-width: none;
    width: 100%;
    flex: none;
}
/* Кнопки (Реестр-триггер, «+ счёт») — всегда свой стандартный размер, не от сетки */
.dash-grid__body > .dash-qa,
.dash-grid__body > .dash-qa-form,
.dash-grid__cell > .dash-qa,
.dash-grid__cell > .dash-qa-form {
    width: auto;
    max-width: 100%;
    flex: none;
}
.dash-grid__body > .dash-qa-form,
.dash-grid__cell > .dash-qa-form {
    display: inline-flex;
}
.dash-grid__body > .dash-qa-form > .dash-qa,
.dash-grid__cell > .dash-qa-form > .dash-qa {
    width: auto;
}
.dash-grid__body > .reestr-dash-widget,
.dash-grid__cell--reestr .reestr-dash-widget {
    /* как в модуле: компактная кнопка / панель до 560px */
    width: min(560px, 100%);
    max-width: min(560px, 100%);
}
.dash-grid__cell--compact {
    width: max-content;
    max-width: 100%;
}
.dash-grid__cell--compact .dash-grid__body {
    width: max-content;
    max-width: 100%;
}
.dash-grid__cell--reestr {
    width: max-content;
    max-width: 100%;
}
.dash-grid__cell--reestr.is-panel-open,
.dash-grid__cell--reestr:has(.reestr-dash-widget.is-open) {
    /* раскрытая панель Реестра — занимает колонку сетки (основная часть) */
    width: calc(
        (100% - 23 * 12px) / 24 * var(--dash-span, 6)
        + (var(--dash-span, 6) - 1) * 12px
    );
    max-width: 100%;
}
.dash-grid__cell--reestr:has(.reestr-dash-widget.is-open) .reestr-dash-widget {
    width: 100%;
    max-width: min(560px, 100%);
}
.dash-grid__chrome {
    display: none;
}
.dash-is-editing #dash-grid {
    padding: 10px;
    background: color-mix(in srgb, var(--bs-tertiary-bg, #f1f5f9) 80%, transparent);
    border: 1px dashed #b6c9de;
    border-radius: 12px;
}
.dash-is-editing .dash-grid__cell[data-layout-key] {
    outline: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    padding: 0;
}
.dash-is-editing .dash-grid__cell[data-layout-key].is-dragging,
.dash-is-editing .dash-grid__cell[data-layout-key].fd-dragging {
    opacity: .45;
}
.dash-drag-handle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: var(--bs-tertiary-bg, #f1f5f9);
    color: var(--bs-secondary-color, #64748b);
    cursor: grab;
    user-select: none;
    -webkit-user-drag: element;
}
.dash-drag-handle:active {
    cursor: grabbing;
}
.dash-layout-root .fd-block-drag.fd-drag-handle,
.dash-layout-root .dash-drag-handle {
    opacity: 1;
    position: static;
}
.dash-is-editing .dash-grid__chrome {
    display: block;
    position: relative;
    z-index: 2;
    padding: 6px 10px 4px;
    border-bottom: 1px solid var(--bs-border-color);
    background: #f8fafc;
    border-radius: 10px 10px 0 0;
}
.dash-grid__chrome-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    padding-right: 12px;
}
.dash-grid__chrome-title {
    font-weight: 600;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}
.dash-grid__chrome-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
}
.dash-grid__newrow {
    appearance: none;
    border: 1px solid var(--bs-border-color);
    background: #fff;
    border-radius: 4px;
    font-size: 10px;
    padding: 1px 6px;
    cursor: pointer;
    color: #64748b;
}
.dash-grid__newrow.is-on {
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 12%, #fff);
    border-color: color-mix(in srgb, var(--tblr-primary, #206bc4) 40%, #fff);
    color: var(--tblr-primary, #206bc4);
}
.dash-grid__resize {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 10px;
    cursor: col-resize;
}
.dash-grid__resize::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 3px;
    width: 3px;
    height: 22px;
    margin-top: -11px;
    border-radius: 2px;
    background: #94a3b8;
    opacity: .75;
}
.dash-is-editing .dash-grid__cell[data-layout-key]:hover .dash-grid__resize::after {
    background: var(--tblr-primary, #206bc4);
    opacity: 1;
}
.dash-is-editing .dash-grid__body {
    user-select: none;
    padding: 8px 10px 10px;
}
.dash-is-editing .dash-grid__chrome,
.dash-is-editing .dash-grid__chrome-bar {
    cursor: default;
}
.dash-grid__remove {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 6px;
    background: #fff;
    color: #b42318;
    line-height: 1;
    font-size: 14px;
    cursor: pointer;
}
.dash-grid__remove:hover {
    border-color: #f5c2c0;
    background: #fff5f5;
}
.dash-grid__cell--spacer .dash-spacer {
    min-height: 0;
}
.dash-spacer__label {
    display: none;
}
.dash-is-editing .dash-grid__cell--spacer .dash-spacer {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 8px,
        #f1f5f9 8px,
        #f1f5f9 16px
    );
}
.dash-is-editing .dash-spacer__label {
    display: inline;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: .01em;
}
.dash-grid__cell--gap {
    width: 100%;
    flex-basis: 100%;
    min-height: var(--dash-gap, 16px);
}
.dash-grid__cell--gap .dash-vgap {
    height: var(--dash-gap, 16px);
}
.dash-is-editing .dash-grid__cell--gap .dash-vgap {
    border-top: 1px dashed #cbd5e1;
}
.dash-grid__cell--section,
.dash-layout-root .fd-block.dash-grid__cell--section {
    width: 100%;
    flex-basis: 100%;
    min-width: 100%;
    grid-column: auto;
}
.dash-grid .fd-block.dash-grid__cell--section {
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    cursor: default;
}
.dash-grid .fd-block-label,
.dash-grid .dash-block-label,
.dash-grid .fd-block-controls,
.dash-grid .dash-block-controls {
    display: none !important;
}
.dash-grid .fd-block-canvas,
.dash-grid .dash-block-canvas {
    min-height: 0;
    border: 0;
    padding: 0;
    background: transparent;
}
.dash-grid .fd-block-canvas.is-empty::before {
    content: none;
}
.dash-is-editing .fd-block.dash-grid__cell--section {
    background: color-mix(in srgb, var(--bs-body-bg) 70%, transparent);
    box-shadow: none;
    padding: 4px;
    border: 1px solid color-mix(in srgb, var(--bs-border-color) 85%, transparent);
    border-radius: 6px;
    cursor: pointer;
}
.dash-is-editing .dash-grid .fd-block-label,
.dash-is-editing .dash-grid .dash-block-label {
    display: flex !important;
}
.dash-is-editing .dash-grid .fd-block.is-selected > .fd-block-controls,
.dash-is-editing .dash-grid .fd-block.is-settings-open > .fd-block-controls,
.dash-is-editing .dash-grid .fd-block.is-selected > .dash-block-controls,
.dash-is-editing .dash-grid .fd-block.is-settings-open > .dash-block-controls {
    display: block !important;
}
.dash-is-editing .dash-grid .fd-block-canvas,
.dash-is-editing .dash-grid .dash-block-canvas {
    min-height: 48px;
    border: 1px dashed color-mix(in srgb, var(--bs-border-color) 70%, transparent);
    border-radius: 8px;
    padding: 6px;
    background: var(--bs-body-bg, #fff);
}
.dash-is-editing .dash-section__title {
    display: none;
}
.dash-section__title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 .5rem;
}
.dash-section__title:empty {
    display: none;
    margin: 0;
}
.dash-section__title-input {
    display: none;
    flex: 1 1 160px;
    min-width: 0;
    max-width: 280px;
    margin: 0;
    padding: .15rem .5rem;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 6px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    height: 24px;
}
.dash-is-editing .dash-section__title-input {
    display: inline-block;
}
.dash-grid--nested,
.dash-block-canvas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    min-height: 48px;
}
.dash-is-editing .fd-block-canvas.is-empty::before {
    content: 'Перетащите сюда виджеты';
}
.dash-is-editing #dash-grid.is-drop-target {
    outline: 1.5px solid color-mix(in srgb, var(--brand-accent, #0B679E) 35%, transparent);
    outline-offset: 2px;
}
.dash-drop-marker {
    position: fixed;
    z-index: 1400;
    pointer-events: none;
    border-radius: 999px;
    background: var(--brand-accent, #0B679E);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--brand-accent, #0B679E) 25%, transparent),
        0 2px 8px rgba(15, 45, 66, .18);
    opacity: 0;
}
.dash-drop-marker.is-visible {
    opacity: 1;
}
@media (max-width: 768px) {
    .dash-grid__cell:not(.dash-grid__cell--full):not(.dash-grid__cell--compact):not(.dash-grid__cell--reestr) {
        width: 100%;
        flex-basis: 100%;
    }
    .dash-edit-fab {
        position: static;
        margin-left: auto;
    }
    .dash-edit-bar {
        margin-right: 0;
    }
}

.stat-card:hover {
    border-color: var(--tblr-primary);
    text-decoration: none;
    color: inherit;
}

.stat-card .stat-number {
    font-size: 16px;
    line-height: 1;
}

/* --- главная: кнопки быстрого создания записи --- */
.dash-qa-form {
    display: inline-flex;
    margin: 0;
}
.dash-qa {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.25;
    border-radius: var(--app-control-radius, 8px);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    background: #fff;
    color: #111;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
    white-space: nowrap;
}
.dash-qa__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    line-height: 0;
}
.dash-qa__icon svg,
.dash-qa__icon i,
.dash-qa__icon img,
.dash-qa .dash-qa__icon.stat-card__icon-svg svg,
.dash-qa .dash-qa__icon.icon-value-svg svg {
    width: 14px;
    height: 14px;
    max-width: 14px;
    max-height: 14px;
}
.dash-qa__label {
    display: inline-block;
    font-weight: 400;
}
.dash-qa--outline-blue {
    color: var(--tblr-primary, #206bc4);
    background: #fff;
    border-color: color-mix(in srgb, var(--tblr-primary, #206bc4) 42%, #c5d5e2);
}
.dash-qa--outline-blue:hover {
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 7%, #fff);
    border-color: var(--tblr-primary, #206bc4);
    color: var(--tblr-primary, #206bc4);
}
.dash-qa--outline-blue .dash-qa__icon { color: var(--tblr-primary, #206bc4); }
.dash-qa--outline-blue:hover .dash-qa__icon { color: var(--tblr-primary, #206bc4); }

/* Мягкая выпуклая — как кнопки фильтров / «Добавить запись» */
.dash-qa--soft-raised {
    color: #475569;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%);
    border-color: #dbe3eb;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 1px 2px rgba(15, 23, 42, .06);
}
.dash-qa--soft-raised:hover {
    color: #334155;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #cfd8e3;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 2px 4px rgba(15, 23, 42, .08);
}
.dash-qa--soft-raised:active {
    color: #334155;
    background: #eef2f6;
    border-color: #c5d0dc;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .1);
}
.dash-qa--soft-raised .dash-qa__icon,
.dash-qa--soft-raised:hover .dash-qa__icon {
    color: inherit;
}

/* Уже сохранённые кнопки «контур синий» на карточке — тот же спокойный вид */
.entity-create-btn.dash-qa--outline-blue,
.item-page-subentity__add.dash-qa--outline-blue,
.item-page-subentity__attach.dash-qa--outline-blue {
    color: #475569;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%);
    border-color: #dbe3eb;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 1px 2px rgba(15, 23, 42, .06);
}
.entity-create-btn.dash-qa--outline-blue:hover,
.item-page-subentity__add.dash-qa--outline-blue:hover,
.item-page-subentity__attach.dash-qa--outline-blue:hover {
    color: #334155;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #cfd8e3;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 2px 4px rgba(15, 23, 42, .08);
}
.entity-create-btn.dash-qa--outline-blue .dash-qa__icon,
.entity-create-btn.dash-qa--outline-blue:hover .dash-qa__icon,
.item-page-subentity__add.dash-qa--outline-blue .dash-qa__icon,
.item-page-subentity__attach.dash-qa--outline-blue .dash-qa__icon {
    color: inherit;
}

.dash-qa--outline-slate {
    color: #111;
    background: #fff;
    border-color: #d0dce6;
}
.dash-qa--outline-slate:hover {
    background: #f4f7fa;
    border-color: #b9cbd8;
    color: #000;
}

.dash-qa--outline-teal {
    color: #0f766e;
    background: #fff;
    border-color: color-mix(in srgb, #0f766e 35%, #c5d5e2);
}
.dash-qa--outline-teal:hover {
    background: color-mix(in srgb, #0f766e 6%, #fff);
    border-color: #0f766e;
}

.dash-qa--outline-amber {
    color: #92400e;
    background: #fff;
    border-color: color-mix(in srgb, #fbbf24 55%, #e2e8f0);
}
.dash-qa--outline-amber:hover {
    background: color-mix(in srgb, #fbbf24 12%, #fff);
    border-color: #f59e0b;
}

.dash-qa--solid-primary {
    background: var(--tblr-primary, #206bc4);
    border-color: var(--tblr-primary, #206bc4);
    color: #fff;
    box-shadow: none;
}
.dash-qa--solid-primary:hover {
    filter: brightness(.95);
    color: #fff;
}
.dash-qa--solid-primary .dash-qa__icon { color: #fff; }

.dash-qa--solid-success {
    background: var(--tblr-success, #2fb344);
    border-color: var(--tblr-success, #2fb344);
    color: #fff;
}
.dash-qa--solid-success:hover { filter: brightness(.95); color: #fff; }

.dash-qa--solid-info {
    background: var(--tblr-info, #4299e1);
    border-color: var(--tblr-info, #4299e1);
    color: #fff;
}
.dash-qa--solid-info:hover { filter: brightness(.95); color: #fff; }

.dash-qa--solid-warning {
    background: var(--tblr-warning, #f76707);
    border-color: var(--tblr-warning, #f76707);
    color: #fff;
}
.dash-qa--solid-warning:hover { filter: brightness(.95); color: #fff; }

.dash-qa--solid-danger {
    background: var(--tblr-danger, #d63939);
    border-color: var(--tblr-danger, #d63939);
    color: #fff;
}
.dash-qa--solid-danger:hover { filter: brightness(.95); color: #fff; }

.dash-qa--solid-dark {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}
.dash-qa--solid-dark:hover { filter: brightness(1.1); color: #fff; }

.dash-qa--soft-primary {
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 12%, #fff);
    border-color: color-mix(in srgb, var(--tblr-primary, #206bc4) 28%, #fff);
    color: var(--tblr-primary, #206bc4);
}
.dash-qa--soft-primary:hover { background: color-mix(in srgb, var(--tblr-primary, #206bc4) 18%, #fff); }

.dash-qa--soft-success {
    background: color-mix(in srgb, var(--tblr-success, #2fb344) 12%, #fff);
    border-color: color-mix(in srgb, var(--tblr-success, #2fb344) 28%, #fff);
    color: #1a7a32;
}
.dash-qa--soft-success:hover { background: color-mix(in srgb, var(--tblr-success, #2fb344) 18%, #fff); }

.dash-qa--soft-info {
    background: color-mix(in srgb, var(--tblr-info, #4299e1) 12%, #fff);
    border-color: color-mix(in srgb, var(--tblr-info, #4299e1) 28%, #fff);
    color: #1d6fa5;
}
.dash-qa--soft-info:hover { background: color-mix(in srgb, var(--tblr-info, #4299e1) 18%, #fff); }

.dash-qa--soft-warning {
    background: color-mix(in srgb, var(--tblr-warning, #f76707) 12%, #fff);
    border-color: color-mix(in srgb, var(--tblr-warning, #f76707) 28%, #fff);
    color: #b45309;
}
.dash-qa--soft-warning:hover { background: color-mix(in srgb, var(--tblr-warning, #f76707) 18%, #fff); }

.dash-qa--soft-danger {
    background: color-mix(in srgb, var(--tblr-danger, #d63939) 12%, #fff);
    border-color: color-mix(in srgb, var(--tblr-danger, #d63939) 28%, #fff);
    color: #b42318;
}
.dash-qa--soft-danger:hover { background: color-mix(in srgb, var(--tblr-danger, #d63939) 18%, #fff); }

.dash-qa--ghost {
    background: transparent;
    border-color: transparent;
    color: #111;
    padding-left: 8px;
    padding-right: 8px;
}
.dash-qa--ghost:hover { background: rgba(30, 58, 95, .06); color: #000; }

/* Текст + обводка на прозрачном фоне (как Экспорт/Импорт, без белой заливки) */
.dash-qa--text-outline {
    background: transparent;
    border-color: #c5d4e0;
    color: #111;
    box-shadow: none;
}
.dash-qa--text-outline:hover {
    background: rgba(32, 107, 196, 0.05);
    border-color: #9eb6c9;
    color: #000;
}
.dash-qa--text-outline .dash-qa__icon { color: #334155; }
.dash-qa--text-outline:hover .dash-qa__icon { color: #000; }

/* --- современные формы (не просто цвет) --- */
.dash-qa--link-quiet {
    background: transparent;
    border-color: transparent;
    color: #111;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 0;
    text-decoration: none;
}
.dash-qa--link-quiet .dash-qa__label {
    border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent);
    padding-bottom: 1px;
}
.dash-qa--link-quiet:hover {
    color: var(--tblr-primary, #206bc4);
    background: transparent;
}
.dash-qa--link-quiet:hover .dash-qa__label {
    border-bottom-color: currentColor;
}

.dash-qa--chip-soft {
    background: #eef3f8;
    border-color: transparent;
    color: #3d5668;
    border-radius: 999px;
    padding: 5px 14px;
}
.dash-qa--chip-soft:hover {
    background: #e2ebf3;
    color: #0f2d42;
}

.dash-qa--elevated {
    background: #fff;
    border-color: transparent;
    color: #111;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .06);
}
.dash-qa--elevated:hover {
    box-shadow: 0 2px 4px rgba(15, 23, 42, .07), 0 8px 18px rgba(15, 23, 42, .08);
    color: #000;
}

.dash-qa--dashed-light {
    background: transparent;
    border: 1px dashed #c5d0db;
    color: #111;
}
.dash-qa--dashed-light:hover {
    background: rgba(32, 107, 196, .03);
    border-color: #8aa6bd;
    color: #000;
}

/* Тонкая линия снизу — не контур */
.dash-qa--hairline {
    background: transparent;
    border: none;
    border-radius: 0;
    border-bottom: 1px dotted #9aafc0;
    color: #111;
    padding: 5px 2px 4px;
    box-shadow: none;
}
.dash-qa--hairline:hover {
    background: transparent;
    border-bottom-color: var(--tblr-primary, #206bc4);
    color: #000;
}
.dash-qa--hairline .dash-qa__icon { color: #334155; }

.dash-qa--underline-only {
    background: transparent;
    border-color: transparent;
    border-bottom: 2px solid #c5d4e0;
    border-radius: 0;
    color: #3d5668;
    padding-left: 2px;
    padding-right: 2px;
    padding-bottom: 4px;
}
.dash-qa--underline-only:hover {
    border-bottom-color: var(--tblr-primary, #206bc4);
    color: var(--tblr-primary, #206bc4);
    background: transparent;
}

.dash-qa--split-icon {
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: #fff;
    border-color: #e2e8f0;
    color: #3d5668;
}
.dash-qa--split-icon .dash-qa__icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #eaf3fb;
    color: #3b7ab0;
}
.dash-qa--split-icon:hover {
    border-color: #b9cbd8;
    background: #fafcfe;
}
.dash-qa--split-icon:hover .dash-qa__icon {
    background: #dcecf8;
}

.dash-qa--soft-pill {
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 10%, #fff);
    border-color: transparent;
    color: #2a5f8f;
    border-radius: 999px;
    padding-left: 16px;
    padding-right: 16px;
}
.dash-qa--soft-pill:hover {
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 16%, #fff);
    color: #1a4a75;
}

.dash-qa--frost {
    background: color-mix(in srgb, #fff 70%, #d7e8f7);
    border-color: color-mix(in srgb, #fff 40%, #b7d0e6);
    color: #3d5668;
    backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.dash-qa--frost:hover {
    background: color-mix(in srgb, #fff 55%, #cfe3f4);
    color: #0f2d42;
}

.dash-qa--dot-lead {
    position: relative;
    background: #fff;
    border-color: #e2e8f0;
    color: #3d5668;
    padding-left: 14px;
    gap: 8px;
}
.dash-qa--dot-lead::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tblr-primary, #206bc4);
    flex: 0 0 auto;
}
.dash-qa--dot-lead:hover {
    border-color: #b9cbd8;
    background: #f8fafc;
}

.dash-qa--quiet-square {
    background: #f4f7fa;
    border-color: transparent;
    color: #3d5668;
    border-radius: 4px;
    padding: 6px 12px;
    letter-spacing: 0.01em;
}
.dash-qa--quiet-square:hover {
    background: #e8eef4;
    color: #0f2d42;
}

.dash-qa--pill-solid {
    background: var(--tblr-primary, #206bc4);
    border-color: var(--tblr-primary, #206bc4);
    color: #fff;
    border-radius: 999px;
    padding-left: 18px;
    padding-right: 18px;
}
.dash-qa--pill-solid:hover { filter: brightness(.95); color: #fff; }

.dash-qa--pill-outline {
    color: #1e3a5f;
    border-color: #8ab2e6;
    border-radius: 999px;
    padding-left: 18px;
    padding-right: 18px;
}
.dash-qa--pill-outline:hover { background: rgba(138, 178, 230, .08); }

.dash-qa--tile {
    flex-direction: column;
    gap: 8px;
    min-width: 88px;
    padding: 12px 14px;
    border-radius: 10px;
    border-color: var(--tblr-border-color, #e6e8eb);
    background: var(--tblr-bg-surface, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    white-space: normal;
    text-align: center;
}
.dash-qa--tile .dash-qa__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 12%, #fff);
    color: var(--tblr-primary, #206bc4);
}
.dash-qa--tile .dash-qa__icon svg,
.dash-qa--tile .dash-qa__icon i,
.dash-qa--tile .dash-qa__icon.stat-card__icon-svg svg,
.dash-qa--tile .dash-qa__icon.icon-value-svg svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
}
.dash-qa--tile .dash-qa__label {
    font-size: 12px;
    color: #334155;
    max-width: 7.5rem;
}
.dash-qa--tile:hover {
    border-color: #8ab2e6;
    box-shadow: 0 2px 8px rgba(30, 58, 95, .08);
}

.dash-qa--accent-bar {
    position: relative;
    padding-left: 14px;
    color: #475569;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%);
    border-color: #dbe3eb;
    border-radius: 6px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 1px 2px rgba(15, 23, 42, .06);
}
.dash-qa--accent-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 3px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 55%, #94a3b8);
}
.dash-qa--accent-bar:hover {
    color: #334155;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #cfd8e3;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 2px 4px rgba(15, 23, 42, .08);
}
.dash-qa--accent-bar .dash-qa__icon,
.dash-qa--accent-bar:hover .dash-qa__icon {
    color: inherit;
}

.dash-qa-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .45rem;
    align-items: stretch;
}
.dash-qa-style-grid .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.dash-qa-style-grid .btn-check + .dash-qa-style-option {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .4rem;
    align-items: flex-start;
    padding: .5rem .55rem;
    border: 1px solid var(--tblr-border-color, #e6e8eb);
    border-radius: .4rem;
    background: #fff;
    cursor: pointer;
    width: 100%;
    min-height: 72px;
    max-height: 80px;
    overflow: hidden;
    box-sizing: border-box;
}
.dash-qa-style-grid .dash-qa,
.dash-qa-style-grid .js-cb-style-demo,
.dash-qa-style-grid .auto-admin-style-demo {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 1 auto;
    transform: none !important;
    overflow: hidden;
}
.dash-qa-style-grid .dash-qa__label {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* в сетке превью все стили в одну линию — без «плиток» и огромных капсул */
.dash-qa-style-grid .dash-qa--tile {
    flex-direction: row;
    min-width: 0;
    padding: 5px 10px;
    gap: 6px;
    box-shadow: none;
    white-space: nowrap;
    text-align: left;
}
.dash-qa-style-grid .dash-qa--tile .dash-qa__icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
}
.dash-qa-style-grid .dash-qa--tile .dash-qa__icon svg,
.dash-qa-style-grid .dash-qa--tile .dash-qa__icon i {
    width: 12px !important;
    height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
}
.dash-qa-style-grid .dash-qa--tile .dash-qa__label {
    font-size: inherit;
    max-width: none;
}
.dash-qa-style-grid .dash-qa--split-icon {
    padding: 3px 8px 3px 3px;
}
.dash-qa-style-grid .dash-qa--split-icon .dash-qa__icon {
    width: 22px;
    height: 22px;
}
.dash-qa-style-grid .dash-qa--pill-outline,
.dash-qa-style-grid .dash-qa--pill-solid,
.dash-qa-style-grid .dash-qa--soft-pill,
.dash-qa-style-grid .dash-qa--chip-soft {
    padding-left: 12px;
    padding-right: 12px;
}
.dash-qa-style-grid .btn-check:checked + .dash-qa-style-option {
    border-color: var(--tblr-primary, #206bc4);
    box-shadow: 0 0 0 1px var(--tblr-primary, #206bc4);
}
.dash-qa-style-option__name {
    font-size: .7rem;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--tblr-secondary-color);
    line-height: 1.3;
}

/* --- универсальный виджет: своя иконка/рамка/фон/PNG-подложка/ярлычки/график --- */
.stat-card--custom {
    position: relative;
    overflow: hidden;
    display: block;
}

.stat-card--custom .stat-card__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .9rem;
}

.stat-card__bg-image {
    position: absolute;
    max-width: none;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.stat-card__icon-svg {
    display: inline-flex;
    align-items: center;
}

.stat-card__icon-svg svg {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}

/* --- пресеты визуального размещения виджета --- */
.stat-card--preset-card_classic { max-width: none; }
.stat-card--preset-card_compact {
    max-width: none;
    padding: .55rem .85rem;
}
.stat-card--preset-card_compact .stat-number { font-size: 1.35rem; }
.stat-card--preset-card_compact .stat-label { font-size: 12px; }
.stat-card--preset-card_hero {
    max-width: none;
    padding: 1.15rem 1.25rem 1.15rem 1.4rem;
    border-left: 4px solid var(--widget-accent, var(--bs-primary, #206bc4));
}
.stat-card--preset-card_hero .stat-number { font-size: 2.1rem; font-weight: 700; }
.stat-card--preset-card_split .stat-card__body {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 1rem;
}
.stat-card--preset-card_soft {
    max-width: none;
    border-color: transparent;
    background: color-mix(in srgb, var(--widget-accent, var(--bs-primary, #206bc4)) 10%, #fff);
}
.stat-card--preset-chart_focus .stat-number { font-size: 1.15rem; }
.stat-card--preset-chart_focus .stat-card__chart,
.stat-card--preset-chart_focus .stat-card__chart--donut {
    width: 100%;
    margin-top: .35rem;
}
.stat-card--preset-kpi_spark .stat-card__body {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
}
.stat-card--preset-kpi_spark .stat-card__chart { width: 100%; }

.widget-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
}
.widget-preset-option {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .5rem;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.widget-preset-option:hover { border-color: #94a3b8; }
.btn-check:checked + .widget-preset-option {
    border-color: var(--tblr-primary, #206bc4);
    box-shadow: 0 0 0 2px rgba(32, 107, 196, .18);
}
.widget-preset-option__preview {
    height: 48px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    position: relative;
    overflow: hidden;
}
.widget-preset-option__preview::before,
.widget-preset-option__preview::after {
    content: '';
    position: absolute;
    background: #94a3b8;
    border-radius: 2px;
    opacity: .55;
}
.widget-preset-option__name {
    font-size: 12px;
    line-height: 1.25;
    color: #334155;
}
.widget-preset-grid--sql-head {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.widget-preset-option--sql-head {
    padding: .45rem;
}
.widget-preset-option--sql-head .widget-preset-option__name {
    font-size: 11px;
}
.widget-sql-head-swatch {
    height: 36px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 4px;
    box-sizing: border-box;
}
.widget-sql-head-swatch--half {
    justify-content: flex-start;
}
.widget-sql-head-swatch__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    height: 100%;
    padding: 0 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 500;
    background: #e2e8f0;
    color: #334155;
    box-sizing: border-box;
    overflow: hidden;
}
.widget-sql-head-swatch--half .widget-sql-head-swatch__bar {
    width: 52%;
}
.widget-sql-head-swatch__t {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.widget-sql-head-swatch__n {
    flex: 0 0 auto;
    opacity: .75;
    font-variant-numeric: tabular-nums;
}
.widget-sql-head-swatch--plain .widget-sql-head-swatch__bar { background: transparent; color: #1e293b; padding: 0; }
.widget-sql-head-swatch--bar .widget-sql-head-swatch__bar { background: #f1f5f9; border: 1px solid #e2e8f0; }
.widget-sql-head-swatch--soft .widget-sql-head-swatch__bar,
.widget-sql-head-swatch--half-soft .widget-sql-head-swatch__bar {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 14%, #fff);
    color: var(--brand-accent, #0B679E);
}
.widget-sql-head-swatch--split .widget-sql-head-swatch__bar { background: #f8fafc; border-bottom: 2px solid #e2e8f0; border-radius: 0; }
.widget-sql-head-swatch--accent .widget-sql-head-swatch__bar,
.widget-sql-head-swatch--half-accent .widget-sql-head-swatch__bar {
    background: #f8fafc;
    border-left: 1px solid var(--brand-accent, #0B679E);
}
.widget-sql-head-swatch--line .widget-sql-head-swatch__bar {
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--brand-accent, #0B679E);
}
.widget-sql-head-swatch--ink .widget-sql-head-swatch__bar,
.widget-sql-head-swatch--half-ink .widget-sql-head-swatch__bar { background: #0f172a; color: #fff; }
.widget-sql-head-swatch--outline .widget-sql-head-swatch__bar {
    background: #fff;
    color: var(--brand-accent, #0B679E);
    border: 1.5px solid var(--brand-accent, #0B679E);
}
.widget-sql-head-swatch--gradient .widget-sql-head-swatch__bar {
    background: linear-gradient(90deg, #0B679E, #38bdf8);
    color: #fff;
}
.widget-sql-head-swatch--band .widget-sql-head-swatch__bar { background: #0B679E; color: #fff; border-radius: 0; }
.widget-sql-head-swatch--panel .widget-sql-head-swatch__bar { background: #e8eef5; border: 1px solid #cbd5e1; }
.widget-sql-head-swatch--sky .widget-sql-head-swatch__bar { background: #e0f2fe; color: #0369a1; }
.widget-sql-head-swatch--mint .widget-sql-head-swatch__bar { background: #dcfce7; color: #166534; }
.widget-sql-head-swatch--warm .widget-sql-head-swatch__bar { background: #ffedd5; color: #9a3412; }
.widget-sql-head-swatch--half .widget-sql-head-swatch__bar {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 14%, #fff);
    color: var(--brand-accent, #0B679E);
}

.widget-preset-grid--badges {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
}
.widget-preset-option--badge {
    padding: .4rem;
}
.widget-preset-option--badge .widget-preset-option__name {
    font-size: 11px;
}
.widget-badge-swatch {
    height: 28px;
    padding: 0 8px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    color: #fff;
    background: var(--brand-accent, #0B679E);
    overflow: hidden;
    white-space: nowrap;
}
.widget-badge-swatch--none {
    background: transparent;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}
.widget-badge-swatch--soft {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 16%, #fff);
    color: var(--brand-accent, #0B679E);
}
.widget-badge-swatch--pill { border-radius: 999px; }
.widget-badge-swatch--outline {
    background: #fff;
    color: var(--brand-accent, #0B679E);
    border: 1px solid var(--brand-accent, #0B679E);
}
.widget-badge-swatch--muted {
    background: #e2e8f0;
    color: #475569;
}
.widget-badge-swatch--tag {
    background: #0B679E;
    border-radius: 3px 8px 8px 3px;
}
.widget-badge-swatch--slim {
    height: 18px;
    margin: 5px 0;
    font-size: 10px;
}
.widget-badge-swatch--lift {
    box-shadow: 0 2px 6px rgba(15, 23, 42, .18);
}
.widget-badge-swatch--info {
    background: #0284c7;
}
.widget-badge-swatch--dot {
    background: transparent;
    color: #334155;
    justify-content: flex-start;
    padding-left: 14px;
    position: relative;
}
.widget-badge-swatch--dot::before {
    content: '';
    position: absolute;
    left: 4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-accent, #0B679E);
}
.widget-badge-swatch--capsule { border-radius: 999px; }
.widget-badge-swatch--underline {
    background: transparent;
    color: #334155;
    border-radius: 0;
    border-bottom: 2px solid var(--brand-accent, #0B679E);
}
.widget-badge-swatch--gradient {
    background: linear-gradient(90deg, #0B679E, #38bdf8);
}
.widget-badge-swatch--glass {
    background: color-mix(in srgb, #0B679E 35%, transparent);
    color: #0f172a;
    border: 1px solid color-mix(in srgb, #0B679E 30%, #fff);
}
.widget-badge-swatch--ribbon { border-radius: 3px; }
.widget-badge-swatch--ribbon-soft {
    background: color-mix(in srgb, #0B679E 18%, #fff);
    color: #0B679E;
}
.widget-badge-swatch--ribbon-fold { background: #d63939; border-radius: 4px 4px 4px 0; }
.widget-badge-swatch--ribbon-success { background: #2fb344; }
.widget-badge-swatch--ribbon-warn { background: #facc15; color: #713f12; }
.widget-badge-swatch--ribbon-dark { background: #0f172a; }
.widget-badge-swatch--flag {
    background: #0B679E;
    clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%);
}
.widget-badge-swatch--stamp {
    background: transparent;
    color: #d63939;
    border: 2px solid #d63939;
    border-radius: 2px;
    transform: rotate(-6deg);
}
.widget-badge-swatch--banner {
    border-radius: 0;
    background: #0B679E;
}
.widget-badge-swatch--edge {
    border-radius: 0 6px 6px 0;
    border-left: 3px solid #022c43;
}
.widget-badge-swatch--ticket {
    background: repeating-linear-gradient(90deg, #0B679E 0 10px, #095a8a 10px 12px);
}
.widget-badge-swatch--accent-bar {
    background: #f1f5f9;
    color: #334155;
    border-left: 3px solid #0B679E;
    border-radius: 0 5px 5px 0;
    justify-content: flex-start;
    padding-left: 8px;
}
.widget-badge-swatch--corner {
    background: #0B679E;
    border-radius: 0 0 0 10px;
}
.widget-badge-swatch--chips {
    background: transparent;
    gap: 4px;
}
.widget-badge-swatch--chips span {
    background: #0B679E;
    color: #fff;
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 10px;
    line-height: 1.2;
}
.widget-badge-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.widget-badge-color {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .45rem;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 999px;
    cursor: pointer;
    background: #fff;
    font-size: 11px;
    color: #475569;
}
.widget-badge-color:hover { border-color: #94a3b8; }
.btn-check:checked + .widget-badge-color {
    border-color: var(--tblr-primary, #206bc4);
    box-shadow: 0 0 0 2px rgba(32, 107, 196, .16);
    color: #0f172a;
}
.widget-badge-color__swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}
.widget-badge-color__swatch--auto {
    background: conic-gradient(#0B679E, #2fb344, #facc15, #d63939, #0B679E);
}
.widget-badge-color__name { line-height: 1; }
.wpp-classic::before { left: 8px; top: 10px; width: 18px; height: 18px; border-radius: 4px; }
.wpp-classic::after { left: 32px; top: 12px; width: 50%; height: 14px; }
.wpp-compact::before { left: 8px; top: 16px; width: 70%; height: 10px; }
.wpp-hero::before { left: 0; top: 0; bottom: 0; width: 4px; height: 100%; border-radius: 0; background: #206bc4; opacity: 1; }
.wpp-hero::after { left: 14px; top: 14px; width: 40%; height: 20px; }
.wpp-split::before { left: 8px; top: 10px; width: 28px; height: 28px; border-radius: 6px; }
.wpp-split::after { left: 44px; top: 14px; width: 45%; height: 18px; }
.wpp-soft { background: color-mix(in srgb, #206bc4 12%, #fff) !important; }
.wpp-soft::after { left: 12px; top: 16px; width: 55%; height: 14px; background: #206bc4; opacity: .45; }
.wpp-chart::before { left: 10px; top: 8px; width: 30%; height: 8px; }
.wpp-chart::after {
    left: 10px; right: 10px; bottom: 8px; height: 18px;
    background: repeating-linear-gradient(90deg, #64748b 0 6px, transparent 6px 10px);
    opacity: .45;
}
.wpp-table::before {
    inset: 8px;
    width: auto; height: auto;
    background:
        linear-gradient(#94a3b8, #94a3b8) 0 0 / 100% 1px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 33% / 100% 1px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 66% / 100% 1px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 100% / 100% 1px no-repeat;
    opacity: .5;
}
.wpp-sql-clean::before {
    inset: 10px 8px; width: auto; height: auto; opacity: .55; border-radius: 0;
    background:
        linear-gradient(#cbd5e1, #cbd5e1) 0 0 / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 40% / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 70% / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 100% / 100% 1px no-repeat;
}
.wpp-sql-hair::before {
    inset: 12px 8px; width: auto; height: auto; opacity: .4; border-radius: 0;
    background:
        linear-gradient(#e2e8f0, #e2e8f0) 0 25% / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 55% / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 85% / 100% 1px no-repeat;
}
.wpp-sql-zebra::before {
    inset: 8px; width: auto; height: auto; border-radius: 3px; opacity: 1;
    background:
        linear-gradient(#f1f5f9, #f1f5f9) 0 0 / 100% 25% no-repeat,
        linear-gradient(#fff, #fff) 0 25% / 100% 25% no-repeat,
        linear-gradient(#f1f5f9, #f1f5f9) 0 50% / 100% 25% no-repeat,
        linear-gradient(#fff, #fff) 0 75% / 100% 25% no-repeat;
}
.wpp-sql-cards::before {
    left: 8px; right: 8px; top: 8px; height: 12px; width: auto;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; opacity: 1;
}
.wpp-sql-cards::after {
    left: 8px; right: 8px; top: 26px; height: 12px; width: auto;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; opacity: .85;
}
.wpp-sql-panel::before {
    inset: 6px; width: auto; height: auto; border-radius: 8px; opacity: 1;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}
.wpp-sql-rail::before {
    left: 0; top: 6px; bottom: 6px; width: 2px; height: auto; border-radius: 1px;
    background: #0b679e; opacity: 1;
}
.wpp-sql-rail::after {
    left: 10px; right: 8px; top: 12px; height: 22px; width: auto;
    background:
        linear-gradient(#e2e8f0, #e2e8f0) 0 0 / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 100% / 100% 1px no-repeat;
    opacity: .7;
}
.wpp-sql-soft { background: #f3f8fc !important; }
.wpp-sql-soft::before {
    left: 8px; right: 8px; top: 10px; height: 8px; width: auto;
    background: color-mix(in srgb, #0b679e 22%, #fff); opacity: .9; border-radius: 3px;
}
.wpp-sql-line::before {
    left: 8px; right: 8px; top: 12px; height: 1px; width: auto;
    background: #0b679e; opacity: .85; border-radius: 0;
}
.wpp-sql-line::after {
    left: 8px; right: 8px; top: 20px; height: 16px; width: auto;
    background:
        linear-gradient(#e2e8f0, #e2e8f0) 0 0 / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 0 100% / 100% 1px no-repeat;
    opacity: .55;
}
.wpp-sql-grid::before {
    inset: 8px; width: auto; height: auto; opacity: .55; border: 1px solid #cbd5e1; border-radius: 4px;
    background:
        linear-gradient(#e2e8f0, #e2e8f0) 0 50% / 100% 1px no-repeat,
        linear-gradient(#e2e8f0, #e2e8f0) 55% 0 / 1px 100% no-repeat;
}
.wpp-sql-value::before {
    left: 8px; top: 12px; width: 48%; height: 8px; opacity: .35;
}
.wpp-sql-value::after {
    right: 8px; left: auto; top: 8px; bottom: 8px; width: 30%; height: auto;
    background: color-mix(in srgb, #0b679e 10%, #fff); opacity: 1; border-radius: 5px;
}
.wpp-sql-dense::before {
    inset: 12px 8px; width: auto; height: auto; opacity: .5;
    background:
        linear-gradient(#cbd5e1, #cbd5e1) 0 0 / 100% 1px no-repeat,
        linear-gradient(#cbd5e1, #cbd5e1) 0 7px / 100% 1px no-repeat,
        linear-gradient(#cbd5e1, #cbd5e1) 0 14px / 100% 1px no-repeat,
        linear-gradient(#cbd5e1, #cbd5e1) 0 21px / 100% 1px no-repeat;
}
.wpp-sql-sky { background: #f0f7fc !important; }
.wpp-sql-sky::before {
    left: 8px; right: 8px; top: 10px; height: 8px; width: auto;
    background: #93c5fd; opacity: .45; border-radius: 3px;
}
.wpp-sql-mint { background: #f2faf6 !important; }
.wpp-sql-mint::before {
    left: 8px; right: 8px; top: 10px; height: 8px; width: auto;
    background: #86efac; opacity: .45; border-radius: 3px;
}
.wpp-sql-slate { background: #f1f5f9 !important; }
.wpp-sql-slate::before {
    inset: 6px; width: auto; height: auto; border-radius: 6px; opacity: 1;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}
.wpp-sql-mono::before {
    left: 8px; top: 12px; width: 50%; height: 8px; opacity: .3;
}
.wpp-sql-mono::after {
    right: 8px; left: auto; top: 11px; width: 24%; height: 10px;
    background: #64748b; opacity: .45; border-radius: 2px;
}
.wpp-rows::before {
    left: 10px; right: 10px; top: 10px; height: 28px;
    width: auto;
    background:
        linear-gradient(#94a3b8, #94a3b8) 0 0 / 100% 6px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 12px / 100% 6px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 24px / 70% 6px no-repeat;
    opacity: .45;
}
.wpp-cards::before {
    left: 8px; top: 8px; width: calc(50% - 12px); height: 32px; border-radius: 4px; opacity: .4;
}
.wpp-cards::after {
    left: calc(50% + 2px); top: 8px; width: calc(50% - 12px); height: 32px; border-radius: 4px; opacity: .4;
}
.wpp-spark::before { left: 10px; top: 10px; width: 28%; height: 10px; }
.wpp-spark::after {
    left: 10px; right: 10px; bottom: 10px; height: 14px; width: auto;
    background: linear-gradient(90deg, transparent, #64748b, transparent);
    clip-path: polygon(0 70%, 20% 40%, 40% 55%, 60% 20%, 80% 45%, 100% 30%, 100% 100%, 0 100%);
    opacity: .5;
}

/* --- виджет списка / таблицы --- */
.dash-list-widget {
    display: block;
    max-width: none;
    width: 100%;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
.dash-list-widget:hover { color: inherit; text-decoration: none; }
.dash-list-widget__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .85rem .35rem;
    border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
    background: #f8fafc;
}
.dash-list-widget__title {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin: 0;
    text-decoration: none;
}
a.dash-list-widget__title:hover {
    color: var(--tblr-primary, #0b679e);
}
.dash-list-widget__meta {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}
.dash-list-widget__empty {
    padding: 1rem .9rem;
    font-size: 13px;
    color: #94a3b8;
}
.dash-list-widget__table {
    width: 100%;
    margin: 0;
    font-size: 12.5px;
}
.dash-list-widget__table th,
.dash-list-widget__table td {
    padding: .4rem .75rem;
    border-top: 1px solid #eef2f6;
    vertical-align: middle;
    font-weight: 400;
}
.dash-list-widget__table thead th {
    border-top: 0;
    background: #fff;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    padding-top: .3rem;
    padding-bottom: .3rem;
}
.dash-list-widget__table .app-table-col-icon,
.dash-list-widget__table .app-table-col-icon__svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dash-list-widget__table .app-table-col-icon-header {
    width: 1%;
    text-align: center;
}
.dash-list-widget a.app-listing-heading-link {
    text-decoration: none;
    color: inherit;
    font-weight: 400 !important;
    font-synthesis: none;
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.dash-list-widget a.app-listing-heading-link:hover {
    color: var(--tblr-primary, #0b679e);
}
.dash-list-widget__card-k {
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}
.dash-list-widget__table tbody tr:hover { background: rgba(11, 103, 158, .04); }

/* SQL-таблица: как основные listing-таблицы приложения */
.dash-list-widget--sql {
    --sql-pad-x: 12px;
    --sql-font-size: var(--app-font-size, 14px);
    font-size: var(--sql-font-size);
    background: #fff;
    border-color: var(--app-table-border, #e6ebf0);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.dash-list-widget--sql .dash-list-widget__head {
    justify-content: flex-start;
    align-items: baseline;
    gap: .4rem;
    padding: .45rem var(--sql-pad-x) .2rem;
    flex-wrap: wrap;
    background: transparent;
    border-bottom: 0;
}
.dash-list-widget--sql.dash-list-widget--no-head .dash-list-widget__head {
    display: none;
}
.dash-list-widget--sql .dash-list-widget__title {
    font-size: var(--sql-font-size);
    font-weight: 400;
    line-height: 1.3;
    color: var(--tblr-body-color, #1e293b);
}
.dash-list-widget--sql .dash-list-widget__title--spacer {
    flex: 1 1 auto;
    min-width: 0;
}
.dash-list-widget--sql .dash-list-widget__meta {
    font-size: var(--app-font-size-sm, 12px);
    font-weight: 400;
    color: var(--tblr-secondary-color, #64748b);
    background: transparent;
    border-radius: 0;
    padding: 0;
    line-height: 1.25;
    white-space: nowrap;
}
.dash-list-widget--sql .dash-sql-table {
    margin: 0 0 4px;
}
.dash-list-widget--sql .dash-sql-table > .table-responsive {
    width: 100%;
    max-width: 100%;
    padding: 0;
    overflow-x: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
}
.dash-list-widget--sql .dash-list-widget__table {
    width: 100%;
    min-width: 100%;
    max-width: none;
    margin: 0;
    font-size: var(--app-font-size, 14px);
    line-height: 1.25;
    border-collapse: separate;
    border-spacing: 0;
    --bs-table-border-color: var(--app-table-border, #e6ebf0);
    --bs-table-hover-bg: var(--app-table-hover, rgba(11, 103, 158, 0.04));
    --bs-table-striped-bg: var(--app-table-zebra, #fafbfc);
}
.dash-list-widget--sql .dash-list-widget__table > :not(caption) > * > * {
    border-width: 0 0 1px;
    border-color: var(--app-table-border, #e6ebf0);
    padding: var(--app-table-padding-y, 6px) var(--app-table-padding-x, 10px);
    vertical-align: middle;
    box-shadow: none;
    font-size: var(--app-font-size, 14px);
}
.dash-list-widget--sql .dash-list-widget__table th:first-child,
.dash-list-widget--sql .dash-list-widget__table td:first-child {
    width: 100%;
    padding-left: var(--sql-pad-x);
}
.dash-list-widget--sql .dash-list-widget__table th:last-child,
.dash-list-widget--sql .dash-list-widget__table td:last-child {
    padding-right: var(--sql-pad-x);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.dash-list-widget--sql .dash-list-widget__table th:not(:first-child),
.dash-list-widget--sql .dash-list-widget__table td:not(:first-child) {
    width: 1%;
    white-space: nowrap;
}
.dash-list-widget--sql .dash-list-widget__table thead th {
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--app-table-header-size, var(--app-font-size, 14px));
    font-weight: 500;
    line-height: 1.25;
    color: var(--app-table-header-color, #5b6b7c) !important;
    background-color: var(--app-table-header-bg, #f3f5f7) !important;
    --bs-table-bg: var(--app-table-header-bg, #f3f5f7);
    border-bottom: 1px solid var(--app-table-header-border, color-mix(in srgb, var(--brand-accent, #0B679E) 10%, #e2e7ed));
    white-space: nowrap;
}
.dash-list-widget--sql .dash-list-widget__table tbody td {
    color: var(--tblr-body-color, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-list-widget--sql .dash-list-widget__table tbody tr:last-child > * {
    border-bottom-width: 0;
}
.dash-list-widget--sql .dash-list-widget__table tbody tr:hover > * {
    --bs-table-bg-state: var(--app-table-hover, rgba(11, 103, 158, 0.04));
    background-color: var(--app-table-hover, rgba(11, 103, 158, 0.04));
}
.dash-list-widget--sql .dash-list-widget__empty {
    font-size: var(--app-font-size, 14px);
    padding: .75rem var(--sql-pad-x);
}

/* SQL head: full / half bars (not section badges) */
.dash-list-widget--sql.dash-list-widget--has-sql-head {
    overflow: visible;
}
.dash-list-widget--sql .dash-sql-head,
.dash-list-widget--sql-cards .dash-sql-head,
.dash-list-widget--sql-cards .dash-list-widget__head.dash-sql-head {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin: 0;
    padding: .4rem var(--sql-pad-x) .35rem !important;
    border-bottom: 0 !important;
    background: transparent !important;
    min-height: 0;
}
.dash-list-widget--sql .dash-sql-head--half.dash-sql-head--align-right {
    justify-content: flex-end;
}
.dash-list-widget--sql .dash-sql-head--half.dash-sql-head--align-left {
    justify-content: flex-start;
}
.dash-list-widget--sql .dash-sql-head__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    min-width: 0;
    width: 100%;
    padding: .48rem .75rem;
    border-radius: 8px;
    box-sizing: border-box;
}
.dash-list-widget--sql .dash-sql-head--half .dash-sql-head__inner {
    width: 50%;
    max-width: 50%;
}
.dash-list-widget--sql .dash-sql-head__title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--sql-font-size, 14px);
    font-weight: 500;
    line-height: 1.3;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-list-widget--sql a.dash-sql-head__title:hover {
    opacity: .88;
    text-decoration: none;
}
/* счётчик — компактный чип справа, не склеивается с заголовком */
.dash-list-widget--sql .dash-sql-head__count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.45rem;
    padding: .12rem .45rem;
    border-radius: 999px;
    font-size: var(--sql-font-size, 14px);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    white-space: nowrap;
    background: rgba(15, 23, 42, .08);
    color: inherit;
    opacity: 1;
}
.dash-list-widget--sql .dash-sql-head--ink .dash-sql-head__count,
.dash-list-widget--sql .dash-sql-head--band .dash-sql-head__count,
.dash-list-widget--sql .dash-sql-head--gradient .dash-sql-head__count,
.dash-list-widget--sql .dash-sql-head--half-ink .dash-sql-head__count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* variants */
.dash-list-widget--sql .dash-sql-head--plain .dash-sql-head__inner {
    padding: .2rem 0 .15rem;
    border-radius: 0;
    background: transparent;
    color: #1e293b;
}
.dash-list-widget--sql .dash-sql-head--plain .dash-sql-head__count {
    background: #e2e8f0;
    color: #475569;
}

.dash-list-widget--sql .dash-sql-head--bar .dash-sql-head__inner {
    background: #e8eef5;
    color: #1e293b;
    border: 1px solid #d5dee8;
}
.dash-list-widget--sql .dash-sql-head--soft .dash-sql-head__inner {
    background: color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 14%, #fff);
    color: color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 75%, #0f172a);
    border: 1px solid color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 22%, #e2e8f0);
}
.dash-list-widget--sql .dash-sql-head--split .dash-sql-head__inner {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.dash-list-widget--sql .dash-sql-head--accent .dash-sql-head__inner {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 1px solid var(--sql-head-tint, var(--brand-accent, #0B679E));
    color: #1e293b;
    border-radius: 6px;
}
.dash-list-widget--sql .dash-sql-head--line .dash-sql-head__inner {
    background: transparent;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--sql-head-tint, var(--brand-accent, #0B679E));
    color: #1e293b;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: .35rem;
}
.dash-list-widget--sql .dash-sql-head--ink .dash-sql-head__inner {
    background: var(--sql-head-tint, #0f172a);
    color: #fff;
    border: 0;
}
.dash-list-widget--sql .dash-sql-head--outline .dash-sql-head__inner {
    background: #fff;
    color: var(--sql-head-tint, var(--brand-accent, #0B679E));
    border: 1.5px solid var(--sql-head-tint, var(--brand-accent, #0B679E));
}
.dash-list-widget--sql .dash-sql-head--gradient .dash-sql-head__inner {
    background: linear-gradient(90deg, var(--sql-head-tint, var(--brand-accent, #0B679E)), color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 55%, #38bdf8));
    color: #fff;
    border: 0;
}
.dash-list-widget--sql .dash-sql-head--band .dash-sql-head__inner {
    background: var(--sql-head-tint, var(--brand-accent, #0B679E));
    color: #fff;
    border-radius: 0;
    padding-top: .55rem;
    padding-bottom: .55rem;
}
.dash-list-widget--sql .dash-sql-head--panel .dash-sql-head__inner {
    background: #e8eef5;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.dash-list-widget--sql .dash-sql-head--sky .dash-sql-head__inner {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.dash-list-widget--sql .dash-sql-head--mint .dash-sql-head__inner {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.dash-list-widget--sql .dash-sql-head--warm .dash-sql-head__inner {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

/* full-bleed полосы на всю ширину виджета */
.dash-list-widget--sql .dash-sql-head--ink,
.dash-list-widget--sql .dash-sql-head--band,
.dash-list-widget--sql .dash-sql-head--gradient {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.dash-list-widget--sql .dash-sql-head--ink .dash-sql-head__inner,
.dash-list-widget--sql .dash-sql-head--band .dash-sql-head__inner,
.dash-list-widget--sql .dash-sql-head--gradient .dash-sql-head__inner {
    border-radius: 0;
    padding-left: var(--sql-pad-x);
    padding-right: var(--sql-pad-x);
}

/* half variants */
.dash-list-widget--sql .dash-sql-head--half .dash-sql-head__inner,
.dash-list-widget--sql .dash-sql-head--half-soft .dash-sql-head__inner {
    background: color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 14%, #fff);
    color: color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 75%, #0f172a);
    border: 1px solid color-mix(in srgb, var(--sql-head-tint, var(--brand-accent, #0B679E)) 22%, #e2e8f0);
}
.dash-list-widget--sql .dash-sql-head--half-ink .dash-sql-head__inner {
    background: var(--sql-head-tint, #0f172a);
    color: #fff;
    border: 0;
}
.dash-list-widget--sql .dash-sql-head--half-accent .dash-sql-head__inner {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 1px solid var(--sql-head-tint, var(--brand-accent, #0B679E));
    color: #1e293b;
}

/* строки-карточки: шапка совпадает по ширине с карточками строк */
.dash-list-widget--sql-cards .dash-sql-head:not(.dash-sql-head--ink):not(.dash-sql-head--band):not(.dash-sql-head--gradient) {
    padding-left: var(--sql-pad-x) !important;
    padding-right: var(--sql-pad-x) !important;
}
.dash-list-widget--sql-cards .dash-sql-head__inner {
    border-radius: 10px;
}

/* --- SQL table: 15 лёгких вариаций на базе listing --- */

.dash-list-widget--sql-clean .dash-sql-table > .table-responsive {
    border-color: var(--app-table-border, #e6ebf0);
}

.dash-list-widget--sql-hair .dash-sql-table > .table-responsive {
    border-color: #eef1f4;
    box-shadow: none;
}
.dash-list-widget--sql-hair .dash-list-widget__table > :not(caption) > * > * {
    border-color: #f0f2f5;
}
.dash-list-widget--sql-hair .dash-list-widget__table thead th {
    background-color: #fafbfc !important;
    --bs-table-bg: #fafbfc;
}

.dash-list-widget--sql-zebra .dash-list-widget__table tbody tr:nth-child(even) > * {
    background-color: var(--app-table-zebra, #fafbfc);
}

.dash-list-widget--sql-cards {
    background: #f7f8fa;
    border-color: transparent;
    box-shadow: none;
}
.dash-list-widget--sql-cards .dash-sql-table > .table-responsive {
    border: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}
.dash-list-widget--sql-cards .dash-list-widget__table {
    border-collapse: separate;
    border-spacing: 0 6px;
}
.dash-list-widget--sql-cards .dash-list-widget__table thead th {
    background: transparent !important;
    --bs-table-bg: transparent;
    border-bottom: 0;
    color: var(--app-table-header-color, #5b6b7c) !important;
    padding-top: 2px;
    padding-bottom: 2px;
}
.dash-list-widget--sql-cards .dash-list-widget__table tbody td {
    border: 0 !important;
    background: #fff;
    box-shadow: 0 0 0 1px var(--app-table-border, #e6ebf0);
}
.dash-list-widget--sql-cards .dash-list-widget__table tbody td:first-child {
    border-radius: 6px 0 0 6px;
}
.dash-list-widget--sql-cards .dash-list-widget__table tbody td:last-child {
    border-radius: 0 6px 6px 0;
}
.dash-list-widget--sql-cards .dash-list-widget__table tbody tr:hover td {
    background: #f8fafc;
}

.dash-list-widget--sql-panel {
    background: #f3f5f7;
    border-color: transparent;
    box-shadow: none;
}
.dash-list-widget--sql-panel .dash-sql-table {
    margin: 0 10px 10px;
}
.dash-list-widget--sql-panel .dash-sql-table > .table-responsive {
    background: #fff;
    border: 1px solid var(--app-table-border, #e6ebf0);
    border-radius: var(--app-table-radius, 5px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    overflow: hidden;
}
.dash-list-widget--sql-panel .dash-list-widget__table th:first-child,
.dash-list-widget--sql-panel .dash-list-widget__table td:first-child {
    padding-left: var(--app-table-padding-x, 10px);
}
.dash-list-widget--sql-panel .dash-list-widget__table th:last-child,
.dash-list-widget--sql-panel .dash-list-widget__table td:last-child {
    padding-right: var(--app-table-padding-x, 10px);
}

.dash-list-widget--sql-slate {
    background: #f1f5f9;
    border-color: transparent;
    box-shadow: none;
}
.dash-list-widget--sql-slate .dash-sql-table {
    margin: 0 10px 10px;
}
.dash-list-widget--sql-slate .dash-sql-table > .table-responsive {
    background: #fff;
    border: 1px solid var(--app-table-border, #e6ebf0);
    border-radius: var(--app-table-radius, 5px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    overflow: hidden;
}
.dash-list-widget--sql-slate .dash-list-widget__table th:first-child,
.dash-list-widget--sql-slate .dash-list-widget__table td:first-child {
    padding-left: var(--app-table-padding-x, 10px);
}
.dash-list-widget--sql-slate .dash-list-widget__table th:last-child,
.dash-list-widget--sql-slate .dash-list-widget__table td:last-child {
    padding-right: var(--app-table-padding-x, 10px);
}

.dash-list-widget--sql-rail {
    border-left: 2px solid var(--brand-accent, #0B679E);
}

.dash-list-widget--sql-soft {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 3%, #fff);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 12%, #e6ebf0);
}
.dash-list-widget--sql-soft .dash-list-widget__table thead th {
    background-color: color-mix(in srgb, var(--brand-accent, #0B679E) 6%, #f3f5f7) !important;
    --bs-table-bg: color-mix(in srgb, var(--brand-accent, #0B679E) 6%, #f3f5f7);
}

.dash-list-widget--sql-line .dash-list-widget__table thead th {
    background-color: transparent !important;
    --bs-table-bg: transparent;
    border-bottom: 1px solid var(--brand-accent, #0B679E);
    color: var(--app-table-header-color, #5b6b7c) !important;
}

.dash-list-widget--sql-grid .dash-list-widget__table > :not(caption) > * > * {
    border-width: 1px;
}
.dash-list-widget--sql-grid .dash-list-widget__table thead th {
    border-bottom-width: 1px;
}

.dash-list-widget--sql-value .dash-list-widget__table th:last-child,
.dash-list-widget--sql-value .dash-list-widget__table td:last-child {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 5%, #fff);
}
.dash-list-widget--sql-value .dash-list-widget__table thead th:last-child {
    color: var(--brand-accent, #0B679E) !important;
}
.dash-list-widget--sql-value .dash-list-widget__table tbody td:last-child {
    font-weight: 500;
}

.dash-list-widget--sql-dense .dash-list-widget__table > :not(caption) > * > * {
    padding-top: 4px;
    padding-bottom: 4px;
}

.dash-list-widget--sql-sky {
    background: #f5f9fc;
    border-color: #dde8f1;
}
.dash-list-widget--sql-sky .dash-list-widget__table thead th {
    background-color: #eaf2f8 !important;
    --bs-table-bg: #eaf2f8;
    color: #4a6d86 !important;
}

.dash-list-widget--sql-mint {
    background: #f5faf7;
    border-color: #dcece3;
}
.dash-list-widget--sql-mint .dash-list-widget__table thead th {
    background-color: #eaf6ef !important;
    --bs-table-bg: #eaf6ef;
    color: #3d7a58 !important;
}

.dash-list-widget--sql-mono .dash-list-widget__table td:last-child,
.dash-list-widget--sql-mono .dash-list-widget__table th:last-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-variant-numeric: tabular-nums;
}
.dash-list-widget--sql-mono .dash-list-widget__table tbody td:last-child {
    font-weight: 500;
}

.dash-list-widget__rows { list-style: none; margin: 0; padding: 0; }
.dash-list-widget__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .9rem;
    border-top: 1px solid #eef2f6;
    font-size: 13px;
}
.dash-list-widget__row:first-child { border-top: 0; }
.dash-list-widget__row-main { min-width: 0; }
.dash-list-widget__row-title {
    font-weight: 500;
    color: #0f172a;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-list-widget__row-sub {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: #64748b;
}
.dash-list-widget__cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
    padding: .65rem;
}
.dash-list-widget__card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .55rem .65rem;
    background: #fff;
    min-width: 0;
}
.dash-list-widget__card-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 .25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-list-widget__card-line {
    font-size: 11.5px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-grid__body > .dash-list-widget {
    width: 100%;
    max-width: none;
}
.dash-grid__body > .dash-list-widget--sql {
    width: 100%;
    max-width: none;
}

.widget-filters-builder {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.widget-filter-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) minmax(108px, 0.7fr) minmax(220px, 1.8fr) 34px;
    gap: .4rem;
    align-items: center;
}
.widget-filter-row > .js-ff-field,
.widget-filter-row > .js-ff-op {
    min-width: 0;
}
.widget-filter-row > .btn {
    width: 34px;
    height: 34px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.widget-filter-row .js-ff-value {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}
.widget-filter-current {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    flex: 0 0 auto;
}
.widget-filter-current .form-check-input {
    margin: 0;
    flex: 0 0 auto;
}
.widget-filter-row .js-ff-user-path {
    flex: 1 1 auto;
    min-width: 0;
}
.widget-filter-row .js-ff-user-field,
.widget-filter-row .js-ff-val,
.widget-filter-row .js-ff-from,
.widget-filter-row .js-ff-to {
    min-width: 0;
    width: 100%;
}
@media (max-width: 576px) {
    .widget-filter-row {
        grid-template-columns: 1fr 34px;
        grid-template-areas:
            "field del"
            "op del"
            "value del";
    }
    .widget-filter-row > .js-ff-field { grid-area: field; }
    .widget-filter-row > .js-ff-op { grid-area: op; }
    .widget-filter-row > .js-ff-value { grid-area: value; }
    .widget-filter-row > .btn { grid-area: del; align-self: start; }
}

.widget-cols-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .35rem .5rem;
    max-height: 220px;
    overflow: auto;
    padding: .65rem .75rem;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 8px;
    background: #f8fafc;
}
.widget-cols-picker__item {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    cursor: pointer;
}
.widget-cols-picker__item input {
    margin-top: 2px;
}
.widget-cols-picker__item em {
    font-style: normal;
    font-size: 11px;
}

.dash-chart-widget {
    display: block;
    width: 100%;
    max-width: none;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 88%, transparent);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dash-chart-widget__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1rem .55rem;
    border-bottom: none;
    background: transparent;
}
.dash-chart-widget--val-top-left .dash-chart-widget__head {
    flex-direction: row;
}
.dash-chart-widget__title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0f172a;
    text-decoration: none;
    min-width: 0;
    flex: 1 1 auto;
}
.dash-chart-widget__title:hover { color: var(--tblr-primary, #206bc4); }
.dash-chart-widget__meta {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #0f172a;
    white-space: nowrap;
    flex: 0 0 auto;
}
.dash-chart-widget__value-row {
    padding: 0 1rem;
}
.dash-chart-widget__value-row--above {
    padding-top: .75rem;
    padding-bottom: 0;
}
.dash-chart-widget__value-row--below {
    padding-top: 0;
    padding-bottom: .15rem;
}
.dash-chart-widget__value-row--below .dash-chart-widget__meta {
    font-size: 1.5rem;
}
.dash-chart-widget__value-row--bottom {
    padding: 0 1rem .85rem;
    text-align: center;
}
.dash-chart-widget__value-row--above .dash-chart-widget__meta,
.dash-chart-widget__value-row--below .dash-chart-widget__meta {
    display: block;
}
.dash-chart-widget__value-side {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 .15rem;
}
.dash-chart-widget__value-side .dash-chart-widget__meta {
    font-size: 1.45rem;
}
.dash-chart-widget__empty {
    padding: 1rem 1rem 1.15rem;
    font-size: 13px;
    color: #94a3b8;
}
.dash-chart-widget__body {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .85rem 1rem;
    padding: .35rem 1rem 1rem;
}
.dash-chart-widget--val-top-right .dash-chart-widget__body,
.dash-chart-widget--val-top-left .dash-chart-widget__body,
.dash-chart-widget--val-above .dash-chart-widget__body,
.dash-chart-widget--val-below .dash-chart-widget__body,
.dash-chart-widget--val-bottom .dash-chart-widget__body,
.dash-chart-widget--val-center .dash-chart-widget__body,
.dash-chart-widget--val-hide .dash-chart-widget__body {
    display: block;
}
.dash-chart-widget__plot {
    flex: 1 1 auto;
    min-width: 0;
}
.dash-chart-widget--donut-legend .dash-chart-widget__plot {
    display: grid;
    grid-template-columns: minmax(120px, 168px) 1fr;
    align-items: center;
    gap: .75rem 1rem;
}
.dash-chart-widget__svg {
    display: block;
    max-width: 100%;
    height: auto;
}
.dash-chart-widget__svg--donut { max-width: 168px; margin-inline: auto; }
.dash-chart-widget__grid {
    stroke: #e2e8f0;
    stroke-width: 1;
    stroke-dasharray: 3 5;
}
.dash-chart-widget__track {
    fill: #f1f5f9;
}
.dash-chart-widget__axis-label {
    font-size: 10px;
    fill: #94a3b8;
}
.dash-chart-widget__bar-val {
    font-size: 11px;
    font-weight: 600;
    fill: #475569;
}
.dash-chart-widget__center-val {
    font-size: 15px;
    font-weight: 700;
    fill: #0f172a;
}
.dash-chart-widget__center-val--on-pie {
    fill: #fff;
    paint-order: stroke;
    stroke: rgba(15, 23, 42, 0.35);
    stroke-width: 3px;
}
.dash-chart-widget__center-lbl {
    font-size: 10px;
    fill: #94a3b8;
}
.dash-chart-widget__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 140px;
    min-width: 0;
}
.dash-chart-widget__legend li {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: 12px;
    padding: .28rem 0;
}
.dash-chart-widget__swatch {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
}
.dash-chart-widget__leg-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
}
.dash-chart-widget__leg-val {
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}
.dash-grid__body > .dash-chart-widget {
    width: 100%;
    max-width: none;
}

/* live-превью в конструкторе виджета */
.widget-preview-live {
    pointer-events: none;
    max-width: 360px;
}
.widget-preview-live--sql {
    max-width: none;
    width: 100%;
}
.widget-preview-live .dash-chart-widget,
.widget-preview-live .dash-list-widget {
    width: 100%;
    max-width: none;
}
.widget-preview-live--sql .dash-list-widget--sql {
    width: 100%;
}
.widget-preview-live--sql .dash-list-widget--sql .dash-sql-head__title,
.widget-preview-live--sql .dash-list-widget--sql .dash-list-widget__table td:first-child {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.brand-mark .app-brand-logo,
.brand-mark .app-brand-logo svg {
    width: 1.75rem;
    height: 1.75rem;
    display: block;
}
.app-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
}
.app-brand-logo svg,
.app-brand-logo-svg {
    max-width: 100%;
    max-height: 100%;
    display: block;
    overflow: hidden;
}

/* Логотип с градиентами — не перекрашивать в currentColor */
.app-brand-logo svg,
.app-brand-logo-svg,
.app-sidebar-brand .app-brand-logo svg,
.app-sidebar-brand .app-brand-logo-svg {
    fill: unset;
}

.field-layout-icon-svg svg,
.field-layout-icon {
    width: 1rem;
    height: 1rem;
    display: block;
    flex-shrink: 0;
}

/* currentColor для кастомных SVG; не затираем fill="none" у stroke-иконок */
.field-layout-icon-svg > svg {
    fill: currentColor;
    color: inherit;
}

.field-layout-icon-svg > svg [fill="none"] {
    fill: none;
}

.field-layout-icon-svg > svg [stroke]:not([stroke="none"]) {
    stroke: currentColor;
}

.field-layout-label--inline,
.field-layout-label-inline {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.field-layout-label-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
}

.field-layout-label-stack--reverse {
    flex-direction: column-reverse;
}

.field-layout-input-icon-wrap {
    position: relative;
}

.field-layout-input-icon-wrap--group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.field-layout-input-icon-wrap--group .field-layout-input-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 2.35rem;
    padding: 0 .65rem;
    color: var(--tblr-secondary);
    background: var(--tblr-bg-surface-secondary, #f8fafc);
    border: 1px solid var(--bs-border-color);
    border-right: 0;
    border-radius: var(--bs-border-radius, .375rem) 0 0 var(--bs-border-radius, .375rem);
}

.field-layout-input-icon-wrap--group .field-layout-input-body {
    flex: 1 1 auto;
    min-width: 0;
}

.field-layout-input-icon-wrap--group .field-layout-input-body .dadata-field-wrap {
    width: 100%;
}

.field-layout-input-icon-wrap--group .field-layout-input-body > .form-control,
.field-layout-input-icon-wrap--group .field-layout-input-body > .form-select,
.field-layout-input-icon-wrap--group .field-layout-input-body .dadata-field-wrap > .form-control,
.field-layout-input-icon-wrap--group .field-layout-input-body .dadata-field-wrap > .form-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* flatpickr оборачивает input — склеиваем addon + wrap в один контрол */
.field-layout-input-icon-wrap--group .field-layout-input-body > .flatpickr-input-wrap {
    display: block;
    width: 100%;
    min-width: 0;
}

.field-layout-input-icon-wrap--group .field-layout-input-body > .flatpickr-input-wrap > .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* связанная сущность / users-picker: иконка в одном контуре с полем, как у даты и списка */
.field-layout-input-icon-wrap--group:has(.related-entity-picker),
.field-layout-input-icon-wrap--group:has(.users-picker) {
    align-items: flex-start;
}

.field-layout-input-icon-wrap--group:has(.related-entity-picker) .field-layout-input-addon,
.field-layout-input-icon-wrap--group:has(.users-picker) .field-layout-input-addon {
    min-height: var(--app-control-height, 36px);
    height: var(--app-control-height, 36px);
    box-sizing: border-box;
}

.field-layout-input-icon-wrap--group .field-layout-input-body > .related-entity-picker,
.field-layout-input-icon-wrap--group .field-layout-input-body > .users-picker {
    width: 100%;
    min-width: 0;
}

.field-layout-input-icon-wrap--group .field-layout-input-body .related-entity-picker__row {
    width: 100%;
    min-width: 0;
}

.field-layout-input-icon-wrap--group .field-layout-input-body .related-entity-picker__control,
.field-layout-input-icon-wrap--group .field-layout-input-body .users-picker__control {
    min-width: 0;
    flex: 1 1 auto;
}

.field-layout-input-icon-wrap--group .field-layout-input-body .related-entity-picker__control > .form-control,
.field-layout-input-icon-wrap--group .field-layout-input-body .related-entity-picker__control--chips,
.field-layout-input-icon-wrap--group .field-layout-input-body .users-picker__control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.field-layout-input-icon-wrap--group .field-layout-input-body .related-entity-picker__control > .form-control {
    height: var(--app-control-height, 36px);
}

.field-layout-input-icon-wrap .field-layout-input-icon,
.field-layout-input-icon-wrap .field-layout-icon-svg {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    color: var(--tblr-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
}

.field-layout-input-icon-wrap:not(.field-layout-input-icon-wrap--group) .form-control:not(textarea),
.field-layout-input-icon-wrap:not(.field-layout-input-icon-wrap--group) .form-select {
    padding-left: 2.35rem;
}

.field-layout-input-icon-wrap--static {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.field-layout-input-icon-wrap--static .field-layout-input-icon {
    position: static;
    transform: none;
}

.info-field-label.field-layout-label--inline,
.info-field-label .field-layout-label-inline,
.info-field-label .field-layout-label-stack {
    display: inline-flex;
}

.stat-suffix {
    font-size: .7em;
    font-weight: 400;
    opacity: .85;
}

.stat-card__badges {
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.stat-card__badges .badge {
    font-weight: 500;
    font-size: .7rem;
}

.stat-card__chart {
    flex-basis: 100%;
    width: 100%;
    height: auto;
    max-height: 56px;
    display: block;
}

.stat-card__chart--donut {
    flex-basis: auto;
    width: 56px;
    height: 56px;
}

/* --- предпросмотр в форме виджета: перетаскиваемая/масштабируемая подложка --- */
#widget-preview {
    min-height: 90px;
}

#wp-bgimg {
    pointer-events: auto;
    cursor: move;
    touch-action: none;
}

.widget-resize-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--tblr-primary);
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 5;
    cursor: nwse-resize;
    touch-action: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

/* --- пикер иконок Lucide: квадратная кнопка, иконка по центру --- */
.la-icon-btn {
    width: 54px;
    height: 54px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.la-icon-btn img {
    width: 22px;
    height: 22px;
    pointer-events: none;
}

.footer {
    display: none !important;
}

/* --- flatpickr: компактная тема "голубая плашка" --- */
.flatpickr-calendar {
    /* светлее и голубее фирменного #0B679E — только календарь */
    --fp-accent: #5BB4D8;
    --fp-accent-text: #2F8BB8;
    --fp-day-size: 36px;
    --fp-grid-width: calc(var(--fp-day-size) * 7);
    width: var(--fp-grid-width);
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .12);
    font-family: inherit;
    font-size: 12px;
    line-height: 18px;
    user-select: none;
    -webkit-user-select: none;
}

input.flatpickr-date,
input.flatpickr-datetime {
    background-color: #fff;
    cursor: text;
}

.flatpickr-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.flatpickr-input-wrap > input.flatpickr-date,
.flatpickr-input-wrap > input.flatpickr-datetime {
    padding-right: 2.35rem;
}

/* Только чтение: форма поля остаётся, но легче и без календаря */
.flatpickr-input-wrap--readonly > input.flatpickr-date,
.flatpickr-input-wrap--readonly > input.flatpickr-datetime,
input.form-control[data-date-readonly="1"] {
    padding-right: 0.75rem;
    background-color: color-mix(in srgb, var(--tblr-bg-surface-secondary, #f1f5f9) 55%, #fff) !important;
    border-color: color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 70%, transparent) !important;
    box-shadow: none !important;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    cursor: default;
    opacity: 1;
}

.flatpickr-input-wrap--readonly > input.flatpickr-date:focus,
.flatpickr-input-wrap--readonly > input.flatpickr-datetime:focus,
input.form-control[data-date-readonly="1"]:focus {
    background-color: color-mix(in srgb, var(--tblr-bg-surface-secondary, #f1f5f9) 55%, #fff) !important;
    border-color: color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 70%, transparent) !important;
    box-shadow: none !important;
    outline: none;
}

.flatpickr-input-wrap--readonly .flatpickr-input-wrap__toggle {
    display: none !important;
}

.flatpickr-input-wrap__toggle {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.flatpickr-input-wrap__toggle:hover {
    color: #2F8BB8;
    background: rgba(91, 180, 216, 0.14);
}

.flatpickr-input-wrap__toggle:focus-visible {
    outline: 2px solid color-mix(in srgb, #5BB4D8 45%, transparent);
    outline-offset: 1px;
}

.flatpickr-input-wrap__toggle svg {
    display: block;
    width: 15px;
    height: 15px;
}

.items-filters__field--period .flatpickr-input-wrap.items-filters__control-wrap {
    flex: 1 1 0;
    min-width: 0;
}

.items-filters .flatpickr-input-wrap > input.flatpickr-date {
    padding-right: 2rem;
}

.items-filters .flatpickr-input-wrap__toggle {
    width: 1.5rem;
    height: 1.5rem;
    right: 0.2rem;
}

.items-filters .flatpickr-input-wrap__toggle svg {
    width: 13px;
    height: 13px;
}

/* datetime: календарь + список слотов справа */
.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots {
    display: grid;
    grid-template-columns: var(--fp-grid-width, 252px) 88px;
    grid-template-rows: auto 1fr auto;
    width: auto !important;
    max-width: calc(100vw - 16px);
}

.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots .flatpickr-months {
    grid-column: 1 / -1;
}

.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots .flatpickr-innerContainer {
    grid-column: 1;
    grid-row: 2;
}

.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots .flatpickr-time {
    display: none !important;
}

.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots .flatpickr-time-slots {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--tblr-border-color);
    min-height: 0;
    max-height: 248px;
}

.flatpickr-time-slots__list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
}

.flatpickr-time-slots__item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--tblr-body-color);
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    padding: 7px 4px;
    border-radius: .3rem;
    cursor: pointer;
}

.flatpickr-time-slots__item:hover {
    background: var(--tblr-bg-surface-secondary);
}

.flatpickr-time-slots__item.is-active {
    background: color-mix(in srgb, var(--fp-accent, #5BB4D8) 18%, #fff);
    color: var(--fp-accent-text, #2F8BB8);
    font-weight: 600;
}

.flatpickr-time-slots__actions {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: stretch;
    border-top: 1px solid var(--tblr-border-color);
    background: #fff;
}

.flatpickr-time-slots__close,
.flatpickr-time-slots__clear {
    flex: 1 1 50%;
    border: 0;
    background: transparent;
    color: var(--tblr-secondary-color);
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    padding: 9px 12px;
    cursor: pointer;
    text-align: center;
}

.flatpickr-time-slots__close {
    border-right: 1px solid var(--tblr-border-color);
    color: var(--tblr-body-color);
    font-weight: 500;
}

.flatpickr-time-slots__close:hover,
.flatpickr-time-slots__clear:hover {
    color: var(--fp-accent-text, #2F8BB8);
    background: var(--tblr-bg-surface-secondary);
}

.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots.arrowBottom,
.flatpickr-calendar.hasTime.flatpickr-calendar--time-slots.arrowTop {
    animation: none;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
    display: none;
}

.flatpickr-months {
    background: color-mix(in srgb, var(--tblr-primary, #0b679e) 78%, #fff);
    border-radius: var(--tblr-border-radius) var(--tblr-border-radius) 0 0;
    padding: .2rem 0;
    height: 34px;
}

.flatpickr-months .flatpickr-month {
    height: 34px;
}

.flatpickr-current-month {
    font-size: 110%;
    height: 34px;
    padding: 4px 0 0;
}

.flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year {
    color: #fff;
    fill: #fff;
    font-weight: 500;
}

.flatpickr-current-month input.cur-year {
    background: transparent;
    font-size: inherit;
}

/* Выпадающий список месяцев: кликабелен, option не наследуют белый цвет шапки */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: menulist;
    appearance: menulist;
    background: transparent;
    border: 0;
    margin: 0 .15rem 0 0;
    padding: 0 .1rem;
    max-width: 7.5rem;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option {
    color: #1e293b;
    background: #fff;
    font-weight: 400;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    top: 4px;
    padding: 4px 8px;
    height: 26px;
    color: #fff;
    fill: #fff;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    width: 12px;
    height: 12px;
    fill: #fff;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: #fff;
    fill: #fff;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: rgba(255, 255, 255, .72);
}

.flatpickr-innerContainer,
.flatpickr-rContainer,
.flatpickr-days {
    width: var(--fp-grid-width, 252px);
}

.flatpickr-weekdays {
    background: var(--tblr-bg-surface);
    height: 26px;
}

.flatpickr-weekdays .flatpickr-weekdaycontainer {
    display: grid;
    grid-template-columns: repeat(7, var(--fp-day-size, 36px));
    width: var(--fp-grid-width, 252px);
}

span.flatpickr-weekday {
    color: var(--tblr-secondary-color);
    font-weight: 600;
    font-size: .65rem;
    text-transform: uppercase;
    background: var(--tblr-bg-surface);
    width: var(--fp-day-size, 36px);
    max-width: none;
    flex: unset;
}

/* суббота и воскресенье в шапке */
span.flatpickr-weekday:nth-child(6),
span.flatpickr-weekday:nth-child(7) {
    color: var(--tblr-danger, #d63939);
}

.dayContainer {
    width: var(--fp-grid-width, 252px);
    min-width: var(--fp-grid-width, 252px);
    max-width: var(--fp-grid-width, 252px);
    display: grid;
    grid-template-columns: repeat(7, var(--fp-day-size, 36px));
    justify-items: center;
}

.flatpickr-day {
    color: var(--tblr-body-color);
    border-radius: .3rem;
    width: 32px;
    height: 30px;
    line-height: 30px;
    max-width: 32px;
    flex: unset;
    margin: 1px 0;
    font-size: 12px;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--tblr-secondary-color);
    opacity: .5;
}

.flatpickr-day:hover {
    background: var(--tblr-bg-surface-secondary);
    border-color: transparent;
}

/* сегодняшний день — тонкая зелёная обводка, не теряется при hover */
.flatpickr-day.today {
    border: 1px solid var(--tblr-success, #2fb344);
    color: var(--tblr-body-color);
    font-weight: 600;
    background: transparent;
    box-shadow: none;
}

.flatpickr-day.today:hover {
    background: color-mix(in srgb, var(--tblr-success, #2fb344) 8%, #fff);
    border-color: var(--tblr-success, #2fb344);
    color: var(--tblr-body-color);
}

.flatpickr-day.today.selected,
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
    background: color-mix(in srgb, var(--fp-accent, #5BB4D8) 18%, #fff);
    border-color: transparent;
    color: var(--fp-accent-text, #2F8BB8);
    font-weight: 600;
}

.flatpickr-day.today.selected,
.flatpickr-day.today.selected:hover,
.flatpickr-day.today.selected:focus {
    border-color: var(--tblr-success, #2fb344);
    box-shadow: none;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--tblr-secondary-color);
    opacity: .35;
}

/* выходные: числа субботы и воскресенья — красные */
.flatpickr-day.is-weekend:not(.selected):not(.flatpickr-disabled) {
    color: var(--tblr-danger, #d63939) !important;
}

.flatpickr-day.is-weekend.prevMonthDay,
.flatpickr-day.is-weekend.nextMonthDay {
    color: color-mix(in srgb, var(--tblr-danger, #d63939) 70%, var(--tblr-secondary-color)) !important;
    opacity: .6;
}

.flatpickr-day.today.is-weekend:not(.selected) {
    color: var(--tblr-danger, #d63939) !important;
    border-color: var(--tblr-success, #2fb344);
}

.flatpickr-day.selected.is-weekend,
.flatpickr-day.selected.is-weekend:hover,
.flatpickr-day.selected.is-weekend:focus {
    color: var(--fp-accent-text, #2F8BB8) !important;
}

/* --- Tabler application shell ------------------------------------------------ */
:root {
    --app-sidebar-width: 220px;
    --app-sidebar-width-collapsed: 56px;
}

.app-sidebar {
    --tblr-navbar-bg: var(--brand-accent);
    --tblr-navbar-border-color: rgba(255, 255, 255, .07);
    background: linear-gradient(200deg, var(--brand-accent) 0%, #094F7C 50%, #062C43 100%) !important;
    box-shadow: 4px 0 24px rgba(6, 48, 73, .14);
}

.app-sidebar__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100%;
    padding: 0;
}

.app-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    position: relative;
    flex-shrink: 0;
    min-height: 52px;
    padding: 8px 40px 8px 10px;
}

.app-sidebar .navbar-brand {
    min-height: 0;
    margin: 0;
    padding: 0;
    color: #fff;
}

.app-sidebar .navbar-brand:hover { text-decoration: none; }

.app-sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    margin: 0;
    padding: 0;
    color: #fff;
    text-decoration: none;
    --app-logo-size: 28px;
    --app-logo-title-size: 15px;
    --app-logo-subtitle-size: 10px;
    --app-logo-title-color: #ffffff;
    --app-logo-subtitle-color: #b7c9d8;
}

.app-sidebar-brand--bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.app-sidebar-brand--hidden {
    flex: 0 0 auto;
}

.app-sidebar-brand .app-brand-logo,
.app-sidebar-brand .icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--app-logo-size);
    height: var(--app-logo-size);
    flex-shrink: 0;
    color: #fff;
}

.app-sidebar-brand .app-brand-logo svg,
.app-sidebar-brand .icon-svg,
.app-sidebar-brand .app-brand-logo-svg {
    width: var(--app-logo-size) !important;
    height: var(--app-logo-size) !important;
    max-width: var(--app-logo-size);
    max-height: var(--app-logo-size);
    display: block;
    object-fit: contain;
}

.app-logo-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.app-sidebar__brand-text {
    min-width: 0;
    overflow: hidden;
}

.app-sidebar__brand-text strong {
    display: block;
    font-size: var(--app-logo-title-size);
    line-height: 1.15;
    font-weight: 500;
    color: var(--app-logo-title-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar__brand-text small {
    display: block;
    margin-top: .1rem;
    color: var(--app-logo-subtitle-color);
    font-size: var(--app-logo-subtitle-size);
    font-weight: 500;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* только реальный сайдбар — иначе скрывается текст в превью настроек брендинга */
.app-sidebar-collapsed .app-sidebar .app-sidebar-brand .app-sidebar__brand-text {
    display: none !important;
}

.app-sidebar-collapsed .app-sidebar .app-sidebar-brand {
    flex: 0 0 auto;
    flex-direction: row;
}

.app-sidebar__toggle {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .85);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: none;
}

.app-sidebar__toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
}

.app-sidebar__toggle svg {
    width: 15px;
    height: 15px;
}

body.app-sidebar-collapse-disabled .app-sidebar__toggle,
body.app-sidebar-always-collapsed .app-sidebar__toggle {
    display: none !important;
}

body.app-sidebar-collapse-disabled .app-sidebar__head,
body.app-sidebar-always-collapsed .app-sidebar__head {
    padding-right: 10px;
}

.app-sidebar-collapsed .app-sidebar__toggle svg {
    transform: rotate(180deg);
    transition: transform .15s ease;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--tblr-primary), #5c8df6);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(var(--tblr-primary-rgb), .28);
}

.brand-mark .icon-svg { width: 18px; height: 18px; }

/* Настройки: предпросмотр и размещение логотипа */
.settings-brand {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.settings-brand__preview-col {
    position: sticky;
    top: 12px;
}

.settings-brand__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.settings-brand__block-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--tblr-secondary);
    margin-bottom: 8px;
}

/* Прогресс шифрования/расшифровки файлов в настройках */
.files-migrate-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .45);
}
.files-migrate-overlay.d-none,
.files-migrate-overlay[hidden] {
    display: none !important;
}
.files-migrate-overlay__card {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--app-table-border, #e2e8f0);
    border-radius: 12px;
    padding: 22px 22px 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
    text-align: center;
}
.files-migrate-overlay__spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 14px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--tblr-primary, #0B679E);
    border-radius: 50%;
    animation: files-migrate-spin .7s linear infinite;
}
.files-migrate-overlay.is-error .files-migrate-overlay__spinner {
    border-top-color: #dc3545;
    animation: none;
}
.files-migrate-overlay__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.files-migrate-overlay__status {
    font-size: 14px;
    margin-bottom: 4px;
}
.files-migrate-overlay__file {
    min-height: 1.2em;
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.files-migrate-overlay__bar {
    height: 8px;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
    margin-bottom: 8px;
}
.files-migrate-overlay__bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--tblr-primary, #0B679E);
    transition: width .25s ease;
}
.files-migrate-overlay.is-error .files-migrate-overlay__bar span {
    background: #dc3545;
}
.files-migrate-overlay__meta {
    min-height: 1.2em;
}
body.files-migrate-busy {
    overflow: hidden;
}
@keyframes files-migrate-spin {
    to { transform: rotate(360deg); }
}

/* --- Шифрование данных: файлы + поля (в стиле svc-info) --- */
.svc-panel {
    margin-bottom: 1.25rem;
}

.svc-speed__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tblr-secondary-color);
}

.svc-speed__title {
    margin: 0 0 0.35rem;
    font-size: 1.2rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--tblr-body-color);
}

.svc-speed__lead {
    margin: 0;
    max-width: 40rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--tblr-secondary-color);
}

.enc-suite__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}
@media (max-width: 900px) {
    .enc-suite__grid {
        grid-template-columns: 1fr;
    }
}
.enc-card {
    padding: 1rem 1.05rem 1.05rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius, 0.5rem);
    background: var(--tblr-bg-surface);
    transition: border-color .15s ease;
}
.enc-card--on {
    border-color: color-mix(in srgb, var(--tblr-primary) 40%, var(--tblr-border-color-translucent));
}
.enc-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}
.enc-card__icon {
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--app-control-radius, 0.5rem) - 1px);
    background: color-mix(in srgb, var(--tblr-primary) 10%, transparent);
    color: var(--tblr-primary);
}
.enc-card__icon--fields {
    background: color-mix(in srgb, var(--tblr-success, #2fb344) 12%, transparent);
    color: var(--tblr-success, #2fb344);
}
.enc-card__feather {
    display: block;
}
.enc-card__titles {
    flex: 1;
    min-width: 0;
}
.enc-card__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.25;
}
.enc-card__sub {
    margin: 0.12rem 0 0;
    font-size: 0.78rem;
    color: var(--tblr-secondary-color);
}
.enc-card__sub code {
    font-size: 0.72rem;
}
.enc-card__badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--tblr-secondary-color);
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    border: 1px solid var(--tblr-border-color-translucent);
    background: var(--tblr-bg-surface-secondary);
}
.enc-card--on .enc-card__badge {
    color: var(--tblr-primary);
    border-color: color-mix(in srgb, var(--tblr-primary) 30%, var(--tblr-border-color-translucent));
    background: color-mix(in srgb, var(--tblr-primary) 8%, var(--tblr-bg-surface));
}
.enc-card__hint {
    font-size: 0.82rem;
    color: var(--tblr-secondary-color);
    line-height: 1.4;
}
.enc-card__note {
    padding: 0.55rem 0.7rem;
    border-radius: calc(var(--app-control-radius, 0.5rem) - 1px);
    border: 1px solid var(--tblr-border-color-translucent);
    background: var(--tblr-bg-surface-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--tblr-body-color);
}
.enc-card__note--warn {
    border-color: color-mix(in srgb, var(--tblr-warning, #f59f00) 28%, var(--tblr-border-color-translucent));
    background: color-mix(in srgb, var(--tblr-warning, #f59f00) 8%, var(--tblr-bg-surface));
}
.enc-card__note--ok {
    border-color: color-mix(in srgb, var(--tblr-success, #2fb344) 28%, var(--tblr-border-color-translucent));
    background: color-mix(in srgb, var(--tblr-success, #2fb344) 8%, var(--tblr-bg-surface));
}
.enc-card .btn-group {
    border-radius: var(--app-control-radius, 0.5rem);
}
.enc-card .btn-group > .btn {
    min-height: var(--app-control-height, 34px);
}
.enc-key {
    padding: 1rem 1.05rem 1.05rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius, 0.5rem);
    background: var(--tblr-bg-surface);
}
.enc-key__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.enc-key__title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 650;
}
.enc-key__sub {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: var(--tblr-secondary-color);
}
.enc-key__state {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    border: 1px solid var(--tblr-border-color-translucent);
}
.enc-key__state--ok {
    color: var(--tblr-success, #2fb344);
    border-color: color-mix(in srgb, var(--tblr-success, #2fb344) 35%, var(--tblr-border-color-translucent));
    background: color-mix(in srgb, var(--tblr-success, #2fb344) 8%, var(--tblr-bg-surface));
}
.enc-key__state--warn {
    color: var(--tblr-warning, #f59f00);
    border-color: color-mix(in srgb, var(--tblr-warning, #f59f00) 35%, var(--tblr-border-color-translucent));
    background: color-mix(in srgb, var(--tblr-warning, #f59f00) 8%, var(--tblr-bg-surface));
}
.enc-key__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: calc(var(--app-control-radius, 0.5rem) - 1px);
    background: var(--tblr-bg-surface-secondary);
}
.enc-key__mask {
    font-size: 0.84rem;
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace);
    color: var(--tblr-body-color);
}
.enc-key__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.enc-key__panel {
    margin-top: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: calc(var(--app-control-radius, 0.5rem) - 1px);
    background: var(--tblr-bg-surface);
}
#files-enc-panel .form-actions {
    margin-top: 1rem;
}

.settings-page .settings-field .form-label {
    margin-bottom: 4px;
    font-size: 12.5px;
}

.settings-page .settings-field .form-control,
.settings-page .settings-field .form-select {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
}

.settings-page .settings-field .form-text {
    margin-top: 2px;
    font-size: 11.5px;
}

.app-logo-preview {
    --app-logo-size: 28px;
    --app-logo-title-size: 15px;
    --app-logo-subtitle-size: 10px;
    --app-logo-title-color: #ffffff;
    --app-logo-subtitle-color: #b7c9d8;
}

.app-logo-preview__bar {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(200deg, var(--brand-accent) 0%, #094F7C 50%, #062C43 100%);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.app-logo-preview__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    --app-logo-size: inherit;
    --app-logo-title-size: inherit;
    --app-logo-subtitle-size: inherit;
    --app-logo-title-color: inherit;
    --app-logo-subtitle-color: inherit;
}

.app-logo-preview__brand.app-sidebar-brand--bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.app-logo-preview .app-logo-preview__text,
.app-logo-preview .app-sidebar__brand-text {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    opacity: 1 !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: hidden;
    pointer-events: auto !important;
    visibility: visible !important;
}

.app-logo-preview[data-layout="hidden"] .app-logo-preview__text,
.app-logo-preview[data-layout="hidden"] .app-sidebar__brand-text {
    display: none !important;
}

.app-logo-preview__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--app-logo-size);
    height: var(--app-logo-size);
    flex-shrink: 0;
    color: #fff;
}

.app-logo-preview__icon .app-brand-logo,
.app-logo-preview__icon .icon-svg,
.app-logo-preview__icon svg {
    width: var(--app-logo-size) !important;
    height: var(--app-logo-size) !important;
    max-width: var(--app-logo-size) !important;
    max-height: var(--app-logo-size) !important;
    display: block;
}

.app-logo-preview__hint {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--tblr-secondary);
}

.app-logo-svg-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--tblr-border-color);
    border-radius: 10px;
    background: var(--tblr-bg-surface);
}

.app-logo-svg-card__thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    background: linear-gradient(200deg, var(--brand-accent) 0%, #094F7C 100%);
    color: #fff;
}

.app-logo-svg-card__thumb svg,
.app-logo-svg-card__thumb .icon-svg {
    width: 22px !important;
    height: 22px !important;
    display: block;
    color: #fff;
}

.app-logo-svg-card__thumb--empty {
    opacity: .85;
}

.app-logo-svg-card__meta {
    min-width: 0;
    flex: 1;
}

.app-logo-svg-card__status {
    font-size: 12px;
    color: var(--tblr-secondary);
    margin-bottom: 4px;
}

.app-logo-svg-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.app-logo-svg-modal-preview {
    min-height: 48px;
    display: flex;
    align-items: center;
}

.app-logo-svg-modal-preview svg {
    width: 40px;
    height: 40px;
    display: block;
    color: var(--brand-accent);
}

.app-logo-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo-size-control .form-range {
    flex: 1;
    min-width: 0;
}

.app-logo-size-control__value {
    flex-shrink: 0;
    min-width: 44px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--tblr-secondary);
    text-align: right;
}

.app-logo-color-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-logo-color-control .form-control-color {
    width: 36px;
    height: 32px;
    padding: 3px;
}

.app-logo-color-control__hex {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.app-logo-layout-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.app-logo-layout-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: 0;
    cursor: pointer;
}

.app-logo-layout-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-logo-layout-option__card {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    background: var(--tblr-bg-surface);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.app-logo-layout-option__card--bottom {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.app-logo-layout-option__card--hidden {
    justify-content: center;
}

.app-logo-layout-option__icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--brand-accent) 75%, #000);
    flex-shrink: 0;
}

.app-logo-layout-option__lines {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.app-logo-layout-option__lines span {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: var(--tblr-border-color);
}

.app-logo-layout-option__lines span:first-child {
    width: 72%;
    background: color-mix(in srgb, var(--tblr-body-color) 35%, transparent);
}

.app-logo-layout-option__lines span:last-child {
    width: 48%;
}

.app-logo-layout-option__label {
    font-size: 10.5px;
    line-height: 1.2;
    color: var(--tblr-secondary);
    text-align: center;
}

.app-logo-layout-option input:checked + .app-logo-layout-option__card {
    border-color: color-mix(in srgb, var(--brand-accent) 55%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent) 14%, transparent);
    background: color-mix(in srgb, var(--brand-accent) 6%, #fff);
}

.app-logo-layout-option input:focus-visible + .app-logo-layout-option__card {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

.app-ui-font-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 8px;
}

.app-ui-font-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.app-ui-font-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-ui-font-option__card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    background: var(--tblr-bg-surface);
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.app-ui-font-option__sample {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--tblr-body-color);
}

.app-ui-font-option__name {
    font-size: 11px;
    line-height: 1.25;
    color: var(--tblr-secondary);
}

.app-ui-font-option input:checked + .app-ui-font-option__card,
.app-ui-font-option.is-active .app-ui-font-option__card {
    border-color: color-mix(in srgb, var(--brand-accent) 55%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent) 14%, transparent);
    background: color-mix(in srgb, var(--brand-accent) 6%, #fff);
}

.app-ui-font-option input:focus-visible + .app-ui-font-option__card {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .app-ui-font-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .settings-brand {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .settings-brand__preview-col {
        position: static;
    }
}

.app-sidebar__nav {
    padding: 4px 0 10px;
}

/* Десктоп: колонка всегда видна. На мобилке — обычный Bootstrap collapse. */
@media (min-width: 992px) {
    .app-sidebar.navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .app-sidebar.navbar-expand-lg .navbar-collapse .navbar-nav {
        flex-direction: column;
        flex-grow: 1;
    }
}

/* Мобилка: сайдбар как компактная шапка + выпадающее меню по гамбургеру */
@media (max-width: 991.98px) {
    .navbar-vertical.app-sidebar {
        position: sticky;
        top: 0;
        z-index: 1030;
        width: 100% !important;
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: 0 4px 16px rgba(6, 48, 73, .18);
    }

    .navbar-vertical.app-sidebar ~ .navbar,
    .navbar-vertical.app-sidebar ~ .page-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* свёрнутый десктопный режим не должен ломать мобильное меню */
    body.app-sidebar-collapsed .app-sidebar .nav-link-title,
    body.app-sidebar-collapsed .app-sidebar .nav-section-title,
    body.app-sidebar-collapsed .app-sidebar .app-sidebar-section__toggle,
    body.app-sidebar-collapsed .app-sidebar .app-sidebar-group__toggle,
    body.app-sidebar-collapsed .app-sidebar .app-sidebar-group__toggle::after,
    body.app-sidebar-collapsed .app-sidebar .app-sidebar-group__toggle .app-sidebar-section__chevron {
        display: revert;
        width: auto;
        height: auto;
        margin: revert;
        padding: revert;
        overflow: visible;
        opacity: 1;
        font-size: inherit;
        color: inherit;
        visibility: visible;
    }

    body.app-sidebar-collapsed .app-sidebar-section__panel.collapse,
    body.app-sidebar-collapsed .app-sidebar-group__panel.collapse {
        display: none;
    }

    body.app-sidebar-collapsed .app-sidebar-section__panel.collapse.show,
    body.app-sidebar-collapsed .app-sidebar-group__panel.collapse.show {
        display: block;
    }

    /* подменю групп — в потоке меню, не flyout поверх контента */
    .app-sidebar-group__panel,
    body.app-sidebar-collapsed .app-sidebar-group__panel,
    body > .app-sidebar-group__panel.app-sidebar-flyout-portal {
        position: static !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        z-index: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal:not(.show):not(.is-open) {
        display: none !important;
    }

    .app-sidebar-group__panel .nav,
    body.app-sidebar-collapsed .app-sidebar-group__panel .nav {
        padding: 4px 0 6px 12px;
        margin: 0 8px 0 14px;
        border-left: 1px solid rgba(255, 255, 255, .18);
    }

    .app-sidebar-group__panel .nav-link,
    body.app-sidebar-collapsed .app-sidebar-group__panel .nav-link {
        width: auto !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .app-sidebar-group__panel .nav-link-title,
    body.app-sidebar-collapsed .app-sidebar-group__panel .nav-link-title {
        display: inline !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        opacity: 1 !important;
        position: static !important;
        clip: auto !important;
    }

    .app-sidebar__inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        min-height: 0;
        padding: 6px 10px;
        gap: 4px 8px;
    }

    .app-sidebar__head {
        flex: 1 1 auto;
        min-height: 44px;
        padding: 4px 8px 4px 4px;
    }

    .app-sidebar .navbar-toggler.app-sidebar__menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        margin: 0;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #fff;
        box-shadow: none;
        opacity: .92;
    }

    .app-sidebar .navbar-toggler.app-sidebar__menu-btn:hover,
    .app-sidebar .navbar-toggler.app-sidebar__menu-btn:focus {
        background: rgba(255, 255, 255, .12);
        opacity: 1;
        box-shadow: none;
    }

    .app-sidebar .navbar-toggler.app-sidebar__menu-btn[aria-expanded="true"] {
        background: rgba(255, 255, 255, .16);
    }

    .app-sidebar .app-sidebar__menu-icon,
    .app-sidebar .app-sidebar__menu-icon svg {
        width: 20px;
        height: 20px;
        display: block;
        stroke: currentColor;
    }

    .app-sidebar .navbar-toggler-icon {
        display: none;
    }

    .app-sidebar .navbar-collapse {
        flex: 1 0 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .app-sidebar .navbar-collapse:not(.show) {
        display: none !important;
    }

    .app-sidebar .navbar-collapse.show,
    .app-sidebar .navbar-collapse.collapsing {
        display: block !important;
        border-top: 1px solid rgba(255, 255, 255, .12);
        margin-top: 4px;
        padding-top: 6px;
        padding-bottom: 8px;
        max-height: min(70vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .app-sidebar.navbar-expand-lg .navbar-collapse .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    .app-sidebar__nav {
        padding: 2px 0 4px;
    }

    .app-sidebar-brand .app-sidebar__brand-text {
        display: none;
    }
}

.app-sidebar .nav-section-title {
    color: rgba(255, 255, 255, .32);
    padding: 10px 12px 4px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.2;
}

.app-sidebar-section {
    margin-top: 2px;
}

.app-sidebar-section__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 16px);
    margin: 1px 8px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: var(--app-font-size);
    font-weight: 400;
    color: rgba(255, 255, 255, .72);
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.app-sidebar-section__toggle:hover,
.app-sidebar-section__toggle:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .07);
    outline: none;
}

.app-sidebar-section__toggle[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.app-sidebar-section__toggle::after {
    display: none;
}

.app-sidebar-section__chevron {
    width: 13px;
    height: 13px;
    margin-left: auto;
    opacity: .5;
    flex-shrink: 0;
    transition: transform .15s ease;
}

.app-sidebar-section__toggle[aria-expanded="true"] .app-sidebar-section__chevron {
    transform: rotate(180deg);
}

.app-sidebar-section__list {
    padding: 0;
    margin: 0;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1px 8px;
    padding: 7px 10px;
    border-radius: 6px;
    color: rgba(255,255,255,.72);
    font-size: var(--app-font-size);
    line-height: 1.2;
    min-width: 0;
    max-width: calc(100% - 16px);
    overflow: hidden;
    box-sizing: border-box;
}

.app-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.app-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.app-sidebar .nav-link {
    --app-menu-icon-size: 16px;
    --app-menu-icon-slot: 20px;
}

/* Flyout в body: те же токены, иначе SVG остаются «как есть» (16 vs 24) */
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link {
    --app-menu-icon-size: 16px;
    --app-menu-icon-slot: 20px;
}

.app-sidebar .nav-link-icon,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--app-menu-icon-slot);
    height: var(--app-menu-icon-slot);
    min-width: var(--app-menu-icon-slot);
    min-height: var(--app-menu-icon-slot);
    flex: 0 0 var(--app-menu-icon-slot);
    color: inherit;
    opacity: .9;
    line-height: 0;
    overflow: visible;
    padding: 0;
    margin: 0;
}

.app-sidebar .nav-link-icon .icon-value-svg,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-value-svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--app-menu-icon-size) !important;
    height: var(--app-menu-icon-size) !important;
    min-width: var(--app-menu-icon-size) !important;
    min-height: var(--app-menu-icon-size) !important;
    max-width: var(--app-menu-icon-size) !important;
    max-height: var(--app-menu-icon-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    line-height: 0 !important;
    font-size: var(--app-menu-icon-size) !important;
    color: inherit;
}

.app-sidebar .nav-link-icon .app-menu-icon,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .app-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--app-menu-icon-size);
    height: var(--app-menu-icon-size);
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
    color: inherit;
}

/* Единый квадрат: перебиваем Tabler (.nav-link-icon svg { height:100% } без width) */
.app-sidebar .nav-link-icon svg,
.app-sidebar .nav-link-icon .icon-svg,
.app-sidebar .nav-link-icon svg.feather,
.app-sidebar .nav-link-icon .icon-svg-custom,
.app-sidebar .nav-link-icon .icon-value-svg svg,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon svg,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-svg,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon svg.feather,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-svg-custom,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-value-svg svg {
    width: var(--app-menu-icon-size) !important;
    height: var(--app-menu-icon-size) !important;
    min-width: var(--app-menu-icon-size) !important;
    min-height: var(--app-menu-icon-size) !important;
    max-width: var(--app-menu-icon-size) !important;
    max-height: var(--app-menu-icon-size) !important;
    display: block;
    margin: 0 !important;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* FA / Line Awesome в слоте меню */
.app-sidebar .nav-link-icon .app-menu-icon > i,
.app-sidebar .nav-link-icon .icon-value-svg > i,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .app-menu-icon > i,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-value-svg > i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--app-menu-icon-size) !important;
    height: var(--app-menu-icon-size) !important;
    font-size: var(--app-menu-icon-size) !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.app-sidebar .nav-link-title {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-group__toggle {
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.app-sidebar-group__toggle::after {
    display: none;
    margin-left: auto;
    opacity: .45;
}

.app-sidebar-group__toggle .app-sidebar-section__chevron {
    margin-left: auto;
    flex: 0 0 auto;
}

.app-sidebar-group__toggle[aria-expanded="true"] .app-sidebar-section__chevron {
    transform: rotate(180deg);
}

.app-sidebar-group__panel .nav-link {
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px !important;
    padding-right: 10px !important;
    font-size: var(--app-font-size);
}

.app-sidebar-group__panel .nav {
    padding: 4px 0 6px 12px;
    margin: 0 8px 0 14px;
    border-left: 1px solid rgba(255, 255, 255, .18);
}

    /* свёрнутый сайдбар (только десктоп): подменю через JS-портал (.is-open) */
@media (hover: hover) and (min-width: 992px) {
    body.app-sidebar-collapsed .app-sidebar-group.is-hover-open > .app-sidebar-group__panel,
    body.app-sidebar-collapsed .app-sidebar-group.is-flyout-open > .app-sidebar-group__panel {
        /* панель обычно уже в body; правило на случай если ещё не успели перенести */
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (min-width: 992px) {
    .navbar-expand-lg.navbar-vertical.app-sidebar {
        width: var(--app-sidebar-width) !important;
        transition: width .18s ease;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .navbar-expand-lg.navbar-vertical.app-sidebar .app-sidebar__inner,
    .navbar-expand-lg.navbar-vertical.app-sidebar .navbar-collapse,
    .navbar-expand-lg.navbar-vertical.app-sidebar .app-sidebar__nav {
        min-width: 0;
        max-width: 100%;
    }

    .navbar-expand-lg.navbar-vertical.app-sidebar:not(.app-sidebar-collapsed) .navbar-collapse,
    body:not(.app-sidebar-collapsed) .navbar-expand-lg.navbar-vertical.app-sidebar .navbar-collapse,
    body:not(.app-sidebar-collapsed) .app-sidebar__nav {
        overflow-x: hidden;
    }

    .navbar-expand-lg.navbar-vertical.app-sidebar ~ .navbar,
    .navbar-expand-lg.navbar-vertical.app-sidebar ~ .page-wrapper {
        margin-left: var(--app-sidebar-width) !important;
        width: calc(100% - var(--app-sidebar-width));
        max-width: calc(100% - var(--app-sidebar-width));
        transition: margin-left .18s ease, width .18s ease, max-width .18s ease;
    }

    .app-sidebar-collapsed {
        --app-sidebar-width: var(--app-sidebar-width-collapsed);
    }

    /* чтобы flyout не обрезался overflow сайдбара */
    body.app-sidebar-collapsed .navbar-expand-lg.navbar-vertical.app-sidebar {
        overflow: visible !important;
    }

    body.app-sidebar-collapsed .app-sidebar .navbar-collapse {
        overflow: visible !important;
    }

    body.app-sidebar-collapsed .app-sidebar__nav {
        overflow-y: auto;
        overflow-x: visible;
        max-height: calc(100vh - 64px);
        padding-right: 0;
    }

    .app-sidebar-collapsed .app-sidebar .nav-link-title,
    .app-sidebar-collapsed .app-sidebar .nav-section-title,
    .app-sidebar-collapsed .app-sidebar .app-sidebar-section__toggle,
    .app-sidebar-collapsed .app-sidebar .app-sidebar-group__toggle::after,
    .app-sidebar-collapsed .app-sidebar .app-sidebar-group__toggle .app-sidebar-section__chevron {
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .app-sidebar-collapsed .app-sidebar-section__panel.collapse {
        display: block !important;
        height: auto !important;
        visibility: visible;
    }

    .app-sidebar-collapsed .app-sidebar__head {
        justify-content: center;
        padding: 8px 6px;
    }

    .app-sidebar-collapsed .app-sidebar-brand,
    .app-sidebar-collapsed .app-sidebar .navbar-brand {
        justify-content: center;
    }

    .app-sidebar-collapsed .app-sidebar__toggle {
        top: 4px;
        right: -12px;
        width: 24px;
        height: 24px;
        border-radius: 999px;
        background: #fff;
        color: var(--brand-accent);
        border-color: var(--app-table-border);
        box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
    }

    .app-sidebar-collapsed .app-sidebar__toggle:hover {
        background: #fff;
        color: var(--brand-accent);
        border-color: var(--app-table-border);
    }

    /* --- свёрнутый сайдбар: центр иконок + flyout поверх всего --- */
    body.app-sidebar-collapsed .app-sidebar.navbar-vertical {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body.app-sidebar-collapsed .app-sidebar .container-fluid.app-sidebar__inner {
        padding-left: 0 !important;
        padding-right: 0 !important;
        align-items: center;
        width: 100%;
        max-width: 100%;
    }

    body.app-sidebar-collapsed .app-sidebar .navbar-collapse {
        width: 100%;
        padding: 0 !important;
        align-items: center;
    }

    body.app-sidebar-collapsed .app-sidebar__nav.navbar-nav {
        width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        align-items: center;
    }

    body.app-sidebar-collapsed .app-sidebar__nav > .nav-item,
    body.app-sidebar-collapsed .app-sidebar-section__list > .nav-item {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    body.app-sidebar-collapsed .app-sidebar .nav-link {
        justify-content: center !important;
        align-items: center !important;
        gap: 0 !important;
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        min-width: 40px !important;
        margin: 3px auto !important;
        padding: 0 !important;
    }

    body.app-sidebar-collapsed .app-sidebar-group {
        position: relative;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    body.app-sidebar-collapsed .app-sidebar-group__toggle {
        width: 40px !important;
        max-width: 40px !important;
        min-width: 40px !important;
    }

    body.app-sidebar-collapsed .app-sidebar .nav-link-icon {
        margin: 0 !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        flex: 0 0 18px !important;
        --app-menu-icon-size: 18px;
        --app-menu-icon-slot: 18px;
    }

    /* портал flyout в body — не перекрывается сайдбаром */
    body > .app-sidebar-group__panel.app-sidebar-flyout-portal {
        position: fixed !important;
        z-index: 2200 !important;
        display: none;
        min-width: 220px;
        max-width: min(320px, calc(100vw - 72px));
        max-height: min(70vh, 420px);
        overflow-x: hidden;
        overflow-y: auto;
        padding: 8px;
        margin: 0;
        background: linear-gradient(200deg, var(--brand-accent) 0%, #094F7C 100%);
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 10px;
        box-shadow: 10px 12px 28px rgba(6, 48, 73, .32);
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal.is-open {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav {
        margin: 0;
        padding: 0;
        border-left: 0;
        gap: 2px;
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link {
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 10px !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 2px 0 !important;
        padding: 8px 10px !important;
        overflow: hidden;
        color: rgba(255, 255, 255, .88) !important;
        background: transparent;
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link:hover,
    body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link.active {
        color: #fff !important;
        background: rgba(255, 255, 255, .12) !important;
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon {
        color: inherit !important;
        opacity: .95;
        --app-menu-icon-size: 16px;
        --app-menu-icon-slot: 20px;
        width: var(--app-menu-icon-slot) !important;
        height: var(--app-menu-icon-slot) !important;
        min-width: var(--app-menu-icon-slot) !important;
        min-height: var(--app-menu-icon-slot) !important;
        flex: 0 0 var(--app-menu-icon-slot) !important;
    }

    body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-title {
        display: block !important;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        color: inherit !important;
        visibility: visible !important;
    }

    .app-sidebar-collapsed .app-sidebar__nav > .nav-item,
    .app-sidebar-collapsed .app-sidebar-section__list > .nav-item {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* только пункты сайдбара — иначе ломаются вкладки страниц (.nav-tabs) */
    .app-sidebar-collapsed .app-sidebar .nav-link {
        justify-content: center;
        align-items: center;
        gap: 0;
        width: 40px;
        height: 40px;
        max-width: 40px;
        margin: 3px auto;
        padding: 0 !important;
    }

    .app-sidebar-collapsed .app-sidebar .app-sidebar-group__toggle {
        width: 40px;
        max-width: 40px;
    }

    .app-sidebar-collapsed .app-sidebar .nav-link-icon {
        margin: 0;
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        flex: 0 0 18px;
        --app-menu-icon-size: 18px;
        --app-menu-icon-slot: 18px;
    }

    .app-sidebar-collapsed .app-sidebar .app-sidebar-group {
        position: relative;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* в свёрнутом режиме панель — fixed (позиция через JS), чтобы не резалась */
    .app-sidebar-collapsed .app-sidebar-group__panel {
        position: fixed;
        z-index: 2200;
        display: none !important;
        min-width: 220px;
        max-width: min(320px, calc(100vw - 72px));
        max-height: min(70vh, 420px);
        overflow-y: auto;
        padding: 8px;
        margin: 0;
        background: linear-gradient(200deg, var(--brand-accent) 0%, #094F7C 100%);
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 10px;
        box-shadow: 10px 12px 28px rgba(6, 48, 73, .32);
    }

    /* только явный flyout/hover — не Bootstrap .show (иначе панель «всплывает» без позиции) */
    .app-sidebar-collapsed .app-sidebar-group.is-flyout-open > .app-sidebar-group__panel,
    .app-sidebar-collapsed .app-sidebar-group.is-hover-open > .app-sidebar-group__panel {
        display: block !important;
        height: auto !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .app-sidebar-collapsed .app-sidebar-group__panel .nav {
        margin: 0;
        padding: 0;
        border-left: 0;
    }

    .app-sidebar-collapsed .app-sidebar-group__panel .nav-link {
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 10px !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 2px 0 !important;
        padding: 8px 10px !important;
        overflow: hidden;
        color: rgba(255, 255, 255, .88) !important;
        background: transparent;
    }

    .app-sidebar-collapsed .app-sidebar-group__panel .nav-link:hover,
    .app-sidebar-collapsed .app-sidebar-group__panel .nav-link.active {
        color: #fff !important;
        background: rgba(255, 255, 255, .12) !important;
    }

    /* выше специфичности, чем «рельса 40px» — иначе текст «С…» / «Б…» */
    body.app-sidebar-collapsed .app-sidebar .app-sidebar-group__panel .nav-link {
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 10px !important;
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 2px 0 !important;
        padding: 8px 10px !important;
    }

    body.app-sidebar-collapsed .app-sidebar .app-sidebar-group__panel .nav-link-icon {
        margin: 0 !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        flex: 0 0 18px !important;
    }

    /* вернуть подписи в выносном списке — иначе остаются width:0 / opacity:0 от скрытия в рельсе */
    .app-sidebar-collapsed .app-sidebar-group__panel .nav-link-title,
    body.app-sidebar-collapsed .app-sidebar .app-sidebar-group__panel .nav-link-title {
        display: block !important;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        color: inherit !important;
        visibility: visible !important;
    }

    .app-sidebar-collapsed .app-sidebar-group__panel .nav {
        gap: 2px;
    }
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 52px;
    padding: 0;
    background: var(--tblr-bg-surface, #fff);
    border-bottom: 1px solid var(--tblr-border-color-translucent);
    /* Tabler .navbar рисует нижнюю линию через inset box-shadow — без этого получается двойной «шлейф» */
    box-shadow: none !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: visible;
}

.app-topbar__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    min-width: 0;
}

.app-topbar-menu {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* тонкий скроллбар выглядел как серый «шлейф» под пунктами меню */
    scrollbar-width: none;
    -ms-overflow-style: none;
    font-size: var(--app-font-size);
}

.app-topbar-menu::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.app-topbar-menu__list {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    padding: 0;
}

.app-topbar-menu__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 2px;
    font-size: var(--app-font-size);
    font-weight: 400;
    line-height: 18px;
    color: var(--tblr-secondary-color);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    background: transparent;
    box-shadow: none;
    transition: background .15s ease, color .15s ease;
}

.app-topbar-menu__link-label,
.app-topbar-menu__group-label,
.app-topbar-menu__dropdown-label {
    display: block;
    line-height: 18px;
    align-self: center;
}

.app-topbar-menu {
    --app-menu-icon-size: 16px;
    --app-menu-icon-slot: 20px;
}

.app-topbar-menu__link-icon,
.app-topbar-menu__group-icon,
.app-topbar-menu__dropdown-icon,
.app-topbar-menu .app-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--app-menu-icon-slot);
    align-self: center;
    width: var(--app-menu-icon-slot);
    height: var(--app-menu-icon-slot);
    min-width: var(--app-menu-icon-slot);
    min-height: var(--app-menu-icon-slot);
    color: inherit;
    opacity: 1;
    overflow: visible;
    line-height: 0;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.app-topbar-menu .app-menu-icon .icon-value-svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--app-menu-icon-size) !important;
    height: var(--app-menu-icon-size) !important;
    min-width: var(--app-menu-icon-size) !important;
    min-height: var(--app-menu-icon-size) !important;
    max-width: var(--app-menu-icon-size) !important;
    max-height: var(--app-menu-icon-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    overflow: visible !important;
    line-height: 0 !important;
    font-size: var(--app-menu-icon-size) !important;
    flex-shrink: 0;
}

.app-topbar-menu .app-menu-icon svg,
.app-topbar-menu .app-menu-icon .icon-svg-custom {
    width: var(--app-menu-icon-size) !important;
    height: var(--app-menu-icon-size) !important;
    min-width: var(--app-menu-icon-size) !important;
    min-height: var(--app-menu-icon-size) !important;
    max-width: var(--app-menu-icon-size) !important;
    max-height: var(--app-menu-icon-size) !important;
    display: block;
    margin: 0 !important;
    flex-shrink: 0;
    box-sizing: border-box;
    color: inherit;
    overflow: visible;
}

/* Меню: тонкие линии (Feather 2 → 1.25, Lucide 1.5 → 1.25) */
.app-topbar-menu svg[fill="none"],
.app-topbar-menu svg.feather,
.app-topbar-menu .icon-svg-custom,
.app-sidebar .nav-link-icon svg[fill="none"],
.app-sidebar .nav-link-icon svg.feather,
.app-sidebar .nav-link-icon .icon-svg-custom,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon svg[fill="none"],
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon svg.feather,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-svg-custom {
    stroke-width: 1.25 !important;
}

.app-topbar-menu svg[fill="none"] path,
.app-topbar-menu svg[fill="none"] line,
.app-topbar-menu svg[fill="none"] polyline,
.app-topbar-menu svg[fill="none"] circle,
.app-topbar-menu svg[fill="none"] rect,
.app-topbar-menu svg.feather path,
.app-topbar-menu svg.feather line,
.app-topbar-menu svg.feather polyline,
.app-topbar-menu svg.feather circle,
.app-topbar-menu svg.feather rect,
.app-sidebar .nav-link-icon svg[fill="none"] path,
.app-sidebar .nav-link-icon svg.feather path,
.app-sidebar .nav-link-icon .icon-svg-custom path,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon svg[fill="none"] path,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon svg.feather path,
body > .app-sidebar-group__panel.app-sidebar-flyout-portal .nav-link-icon .icon-svg-custom path {
    stroke-width: inherit !important;
}

.app-topbar-menu__dropdown-icon .icon-value-svg svg[fill="none"],
.app-menu-icon .icon-value-svg svg[fill="none"],
.app-topbar-menu__dropdown-icon .icon-svg-custom[fill="none"],
.app-menu-icon .icon-svg-custom[fill="none"] {
    stroke-width: 1.25;
}

.app-topbar-menu__group {
    flex-shrink: 0;
    position: relative;
}

.app-topbar-menu__group-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: none;
    border-radius: 2px;
    background: transparent;
    color: var(--tblr-secondary-color);
    font-size: var(--app-font-size);
    font-weight: 400;
    line-height: 18px;
    box-shadow: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.app-topbar-menu__dropdown {
    min-width: 220px;
    padding: 4px;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    background: #fff;
    z-index: 2000;
}

.app-topbar-menu .dropdown.show > .app-topbar-menu__dropdown,
.dropdown-menu.app-topbar-menu__dropdown.show {
    display: block !important;
}

/* запасной путь: hover/focus, если JS ещё не обновился */
@media (hover: hover) {
    .app-topbar-menu__group:hover > .app-topbar-menu__dropdown,
    .app-topbar-menu__group:focus-within > .app-topbar-menu__dropdown {
        display: block !important;
        position: absolute;
        top: calc(100% + 2px);
        left: 0;
        margin: 0;
    }
}

.app-topbar-menu__group-btn:hover,
.app-topbar-menu__group-btn:focus,
.app-topbar-menu__group-btn:focus-visible,
.app-topbar-menu__group-btn.show,
.dropdown.show > .app-topbar-menu__group-btn {
    background: var(--app-table-hover);
    color: var(--tblr-body-color);
    box-shadow: none;
    outline: none;
}

.app-topbar-menu__group-btn::after {
    margin-left: 4px;
    opacity: .45;
    vertical-align: unset;
    align-self: center;
    flex-shrink: 0;
}

.app-topbar-menu__group-btn.dropdown-toggle::after {
    position: static;
    top: auto;
    margin-top: 0;
    margin-bottom: 0;
}

/* --- Верхнее меню: стиль «Вкладки» (синяя полоса + второй ряд) --- */
.app-topbar--tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--brand-accent, #0B679E);
    border-bottom: none;
    box-shadow: none !important;
    /* sticky: непрозрачный фон, чтобы контент не просвечивал под меню */
    isolation: isolate;
}

/* Стык сайдбар ↔ синяя шапка: убрать светлую кромку и субпиксельный зазор */
body:has(.app-topbar--tabs) .app-sidebar {
    --tblr-navbar-border-color: transparent;
    border-right: none !important;
    box-shadow: none;
}

@media (min-width: 992px) {
    .navbar-expand-lg.navbar-vertical.app-sidebar ~ .app-topbar--tabs {
        margin-left: calc(var(--app-sidebar-width) - 1px) !important;
        width: calc(100% - var(--app-sidebar-width) + 1px);
        max-width: calc(100% - var(--app-sidebar-width) + 1px);
    }
}

.app-topbar--tabs .app-topbar__inner {
    min-height: 52px;
    padding-top: 0;
    padding-bottom: 0;
}

.app-topbar--tabs .app-topbar-menu {
    --app-menu-icon-size: 16px;
    --app-menu-icon-slot: 20px;
}

.app-topbar--tabs .app-topbar-menu__list {
    gap: 2px;
    align-items: center;
}

.app-topbar-menu__tab {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    max-width: none;
    padding: 7px 12px;
    margin: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, .92);
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 18px;
    text-decoration: none;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.app-topbar-menu__tab:hover,
.app-topbar-menu__tab:focus-visible {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    outline: none;
    text-decoration: none;
}

.app-topbar-menu__tab.is-active {
    background: rgba(0, 0, 0, .18);
    color: #fff;
}

.app-topbar-menu__tab-icon,
.app-topbar-menu__tab .app-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--app-menu-icon-slot);
    width: var(--app-menu-icon-slot);
    height: var(--app-menu-icon-slot);
    color: inherit;
    line-height: 0;
}

.app-topbar-menu__tab-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 18px;
}

.app-topbar-subnav {
    --app-menu-icon-size: 16px;
    --app-menu-icon-slot: 20px;
    display: none;
    position: relative;
    width: 100%;
    background: #fff;
    border-bottom: 0;
    min-height: 40px;
}

.app-topbar-subnav.is-open {
    display: block;
}

.app-topbar-subnav.is-open::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 1px;
    background: #e6ebf0;
    pointer-events: none;
}

.app-topbar-subnav__panel {
    display: none;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    padding: 0 16px;
    min-height: 40px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-topbar-subnav__panel::-webkit-scrollbar {
    display: none;
}

.app-topbar-subnav__panel.is-active {
    display: flex;
}

.app-topbar-subnav__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 0;
    color: color-mix(in srgb, var(--brand-accent, #0B679E) 55%, #8a97a5);
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease;
}

.app-topbar-subnav__link::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 2px;
    border-radius: 1px;
    background: transparent;
    transition: background .15s ease;
}

.app-topbar-subnav__link:hover {
    color: var(--brand-accent, #0B679E);
    text-decoration: none;
}

.app-topbar-subnav__link:hover::after {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 28%, transparent);
}

.app-topbar-subnav__link.is-active {
    color: var(--brand-accent, #0B679E);
    font-weight: 400;
}

.app-topbar-subnav__link.is-active::after {
    background: var(--brand-accent, #0B679E);
}

.app-topbar-subnav__icon,
.app-topbar-subnav .app-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--app-menu-icon-slot);
    width: var(--app-menu-icon-slot);
    height: var(--app-menu-icon-slot);
    min-width: var(--app-menu-icon-slot);
    min-height: var(--app-menu-icon-slot);
    color: inherit;
    opacity: .9;
    line-height: 0;
}

.app-topbar-subnav__icon svg,
.app-topbar-subnav__icon .icon-value-svg,
.app-topbar-subnav__icon .icon-value-svg svg,
.app-topbar-subnav__icon .icon-svg-custom {
    width: var(--app-menu-icon-size) !important;
    height: var(--app-menu-icon-size) !important;
    max-width: var(--app-menu-icon-size) !important;
    max-height: var(--app-menu-icon-size) !important;
}

.app-topbar-subnav__label {
    display: inline-block;
    line-height: 1.2;
}

/* Действия справа (поиск, избранное, профиль) — в том же стиле, что вкладки меню */
.app-topbar--tabs .app-topbar-actions {
    align-self: center;
    gap: 2px;
    padding-left: 8px;
}

.app-topbar--tabs .app-topbar-actions > .dropdown {
    align-items: center;
}

.app-topbar--tabs .btn-ghost-secondary {
    --tblr-btn-color: rgba(255, 255, 255, .92);
    --tblr-btn-bg: transparent;
    --tblr-btn-border-color: transparent;
    --tblr-btn-hover-color: #fff;
    --tblr-btn-hover-bg: rgba(255, 255, 255, .12);
    --tblr-btn-hover-border-color: transparent;
    --tblr-btn-active-color: #fff;
    --tblr-btn-active-bg: rgba(0, 0, 0, .18);
    --tblr-btn-active-border-color: transparent;
}

.app-topbar--tabs .app-topbar-square-btn,
.app-topbar--tabs .app-topbar-profile-chip {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 7px 10px !important;
    border: none !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, .92) !important;
    box-shadow: none !important;
    line-height: 18px;
    transition: background .15s ease, color .15s ease;
}

.app-topbar--tabs .app-topbar-square-btn {
    width: auto !important;
}

.app-topbar--tabs .app-topbar-square-btn:hover,
.app-topbar--tabs .app-topbar-square-btn:focus,
.app-topbar--tabs .app-topbar-square-btn:focus-visible,
.app-topbar--tabs .app-topbar-profile-chip:hover,
.app-topbar--tabs .app-topbar-profile-chip:focus,
.app-topbar--tabs .app-topbar-profile-chip:focus-visible {
    color: #fff !important;
    background: rgba(255, 255, 255, .12) !important;
    outline: none;
    text-decoration: none;
}

.app-topbar--tabs .app-topbar-square-btn.show,
.app-topbar--tabs .app-topbar-square-btn:active,
.app-topbar--tabs .app-topbar-square-btn.is-active,
.app-topbar--tabs .app-topbar-profile-chip.show,
.app-topbar--tabs .app-topbar-profile-chip:active,
.app-topbar--tabs .app-topbar-profile-chip[aria-expanded="true"],
.app-topbar--tabs .dropdown.show > .app-topbar-square-btn,
.app-topbar--tabs .dropdown.show > .app-topbar-profile-chip {
    color: #fff !important;
    background: rgba(0, 0, 0, .18) !important;
    text-decoration: none;
}

.app-topbar--tabs .gsearch-topbar-btn.is-active,
.app-topbar--tabs .reestr-topbar-btn.is-active {
    color: #fff !important;
    background: rgba(0, 0, 0, .18) !important;
}

.app-topbar--tabs .app-topbar-username,
.app-topbar--tabs .app-topbar-chevron {
    color: inherit !important;
}

.app-topbar--tabs .app-topbar-square-btn svg.feather,
.app-topbar--tabs .app-topbar-square-btn .icon-svg,
.app-topbar--tabs .app-topbar-square-btn > svg,
.app-topbar--tabs .app-topbar-profile-chip svg.feather,
.app-topbar--tabs .app-topbar-chevron {
    width: 16px;
    height: 16px;
    color: inherit;
    stroke-width: 1.25;
}

.app-topbar--tabs .app-topbar-square-btn svg[fill="none"],
.app-topbar--tabs .app-topbar-square-btn svg.feather,
.app-topbar--tabs .app-topbar-profile-chip svg[fill="none"],
.app-topbar--tabs .app-topbar-profile-chip svg.feather {
    stroke-width: 1.25 !important;
}

.app-topbar--tabs .app-topbar-max-btn,
.app-topbar--tabs .app-topbar-max-btn:hover,
.app-topbar--tabs .app-topbar-max-btn.is-active {
    color: inherit !important;
}

.app-topbar--tabs .app-topbar-max-btn .icon-svg--max,
.app-topbar--tabs .app-topbar-square-btn .icon-svg--max {
    color: inherit;
}

/* Превью выбора стиля в настройках меню */
.menu-topbar-style-option {
    flex: 1 1 240px;
    max-width: 360px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--tblr-border-color-translucent, rgba(0, 0, 0, .1));
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.menu-topbar-style-option:hover,
.menu-topbar-style-option.is-selected,
.menu-topbar-style-option:has(input:checked) {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 55%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent, #0B679E) 25%, transparent);
}

.menu-topbar-style-option .form-check-input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.menu-topbar-style-option__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.menu-topbar-style-option__title {
    font-weight: 600;
    font-size: 14px;
    color: var(--tblr-body-color);
}

.menu-topbar-style-option__desc {
    font-size: 12px;
    line-height: 1.35;
    color: var(--tblr-secondary-color);
}

.menu-topbar-style-option__preview {
    display: flex;
    margin-top: 8px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--tblr-border-color-translucent, rgba(0, 0, 0, .08));
}

.menu-topbar-style-option__preview--classic {
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: #fff;
}

.menu-topbar-style-option__preview--classic > span {
    display: block;
    height: 10px;
    width: 42px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--tblr-secondary-color) 22%, transparent);
}

.menu-topbar-style-option__preview--tabs {
    flex-direction: column;
    height: 42px;
}

.menu-topbar-style-option__preview-rail {
    flex: 1 1 auto;
    background: var(--brand-accent, #0B679E);
}

.menu-topbar-style-option__preview-sub {
    flex: 0 0 14px;
    background: #fff;
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--brand-accent, #0B679E) 35%, transparent);
}

.app-topbar-menu__dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    border-radius: 2px;
    padding: 4px 8px !important;
    font-size: var(--app-font-size);
    line-height: 18px;
    min-height: 30px;
    color: var(--tblr-secondary-color);
}

.app-topbar-menu__dropdown-item > .app-topbar-menu__dropdown-icon,
.app-topbar-menu__dropdown-item > .app-menu-icon {
    flex: 0 0 var(--app-menu-icon-slot);
    width: var(--app-menu-icon-slot);
    height: var(--app-menu-icon-slot);
    min-width: var(--app-menu-icon-slot);
    align-self: center;
    margin: 0 !important;
    padding: 0 !important;
}

.app-topbar-menu__dropdown-label {
    flex: 1 1 auto;
    min-width: 0;
}

.app-topbar-menu__dropdown-item svg.feather,
.app-topbar-menu__dropdown-item .icon-svg,
.app-topbar-menu__dropdown-item .icon-value-svg,
.app-topbar-menu__dropdown-item .icon-svg-custom,
.app-topbar-menu__dropdown-item .dropdown-item__icon {
    margin: 0 !important;
}

.app-topbar-menu__dropdown-icon > i,
.app-menu-icon > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin: 0;
    font-size: 16px;
    line-height: 1;
}

.app-topbar-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--brand-accent) 22%, transparent);
    border-radius: 2px;
    background: color-mix(in srgb, var(--brand-accent) 7%, #fff);
    color: var(--brand-accent);
    font-size: var(--app-font-size);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.app-topbar-menu-btn:hover,
.app-topbar-menu-btn:focus,
.app-topbar-menu-btn:focus-visible {
    background: color-mix(in srgb, var(--brand-accent) 12%, #fff);
    border-color: color-mix(in srgb, var(--brand-accent) 32%, transparent);
    color: var(--brand-accent);
    box-shadow: none;
    outline: none;
}

.app-topbar-menu__link:hover {
    background: var(--app-table-hover);
    color: var(--tblr-body-color);
    text-decoration: none;
}

.app-topbar-menu__link.is-active {
    background: transparent;
    color: var(--brand-accent);
    box-shadow: inset 0 -1px 0 var(--brand-accent);
}

.app-topbar-menu__item--action {
    flex-shrink: 0;
}

.app-topbar-menu__item--action + .app-topbar-menu__item--action,
.app-topbar-menu__link + .app-topbar-menu__item--action {
    margin-left: 4px;
}

.app-menu-settings-table td,
.app-menu-settings-table th {
    vertical-align: middle;
}

.app-menu-icon-fields {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-menu-icon-fields__feather {
    min-width: 88px;
    max-width: 110px;
}

.app-menu-icon-fields__pick {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-menu-icon-fields__preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    overflow: visible;
    line-height: 0;
}

.app-menu-icon-fields__preview .icon-value-svg,
.app-menu-icon-fields__preview svg {
    width: 15px !important;
    height: 15px !important;
}

.shared-menu-icon-picker-host > .d-flex {
    display: none !important;
}

.app-menu-group-card .form-check {
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    /* как на десктопе: меню слева, действия справа — в одной строке */
    .app-topbar__inner {
        flex-wrap: nowrap;
        gap: 8px;
        min-height: 48px;
        align-items: center;
    }

    .app-topbar-menu {
        display: block;
        order: 0;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 0;
        border-top: none;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .app-topbar-actions {
        order: 0;
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 12px;
        padding-left: 8px;
        min-height: 0;
        box-shadow: none;
    }

    .app-topbar-menu__list {
        padding: 0;
        gap: 2px;
    }

    /* обычные пункты — только иконки; у групп подпись оставляем */
    .app-topbar-menu__link {
        gap: 0;
        padding: 8px;
        min-width: 36px;
        justify-content: center;
    }

    .app-topbar-menu__link-label {
        display: none;
    }

    .app-topbar-menu__group-btn {
        padding: 8px 10px;
    }

    .app-topbar-menu__link-icon,
    .app-topbar-menu__group-icon {
        width: 18px;
        height: 18px;
        opacity: 1;
    }
}

.app-topbar .container-fluid {
    overflow: visible;
}

.app-topbar > .container-fluid {
    padding-right: var(--tblr-page-padding, 1.25rem);
}

.app-topbar-actions .dropdown-menu {
    z-index: 1050;
    display: none;
    position: absolute;
    top: 100%;
    left: auto;
    right: 0;
    margin-top: 0.35rem;
    min-width: 12rem;
}

.app-topbar-actions .dropdown-menu.show {
    display: block;
}

.app-eyebrow { font-size: var(--app-font-size-sm, 12px); letter-spacing: .06em; }
.page-wrapper { background: var(--tblr-body-bg); }
.form-control, .form-select { transition: border-color .15s ease, box-shadow .15s ease; }
.form-control:focus,
.form-select:focus {
    border-color: var(--brand-accent, #0B679E);
    box-shadow: none;
    outline: none;
}
/* Вдавленный вид — только у поля «выбор со списком» / этапы, не у всех select */
.form-select.app-field-select:focus,
.form-select.stages-field-select:focus {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 32%, var(--app-inset-border));
    box-shadow: var(--app-inset-shadow);
}

/* Dashboard */
.dashboard-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 190px;
    padding: 2.1rem;
    overflow: hidden;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: 12px;
    background: linear-gradient(120deg, var(--tblr-bg-surface) 0%, color-mix(in srgb, var(--tblr-primary) 7%, var(--tblr-bg-surface)) 100%);
}

.dashboard-hero-content { position: relative; z-index: 2; max-width: 650px; }
.dashboard-hero .display-6 { font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 750; letter-spacing: -.04em; }
.dashboard-hero-art { position: absolute; right: 5%; width: 210px; height: 150px; opacity: .9; }
.dashboard-hero-art span { position: absolute; display: block; border-radius: 18px; transform: rotate(-8deg); }
.dashboard-hero-art span:nth-child(1) { inset: 22px 18px 20px 20px; background: rgba(var(--tblr-primary-rgb), .09); }
.dashboard-hero-art span:nth-child(2) { inset: 46px 44px 2px 0; background: rgba(var(--tblr-primary-rgb), .15); }
.dashboard-hero-art span:nth-child(3) { width: 54px; height: 54px; right: 0; top: 0; background: linear-gradient(135deg, var(--tblr-primary), #6d91f5); box-shadow: 0 16px 34px rgba(var(--tblr-primary-rgb), .25); }
.dashboard-shortcut { min-height: 100%; color: inherit; text-decoration: none !important; }
.dashboard-shortcut .avatar svg { width: 20px; height: 20px; }
.dashboard-shortcut .card-title { margin-bottom: .35rem; font-size: .95rem; }
.dashboard-shortcut p { font-size: .78rem; line-height: 1.5; }

/* Authentication */
.account-body {
    margin: 0;
    min-height: 100vh;
    background: #f4f7fa;
}

.account-page {
    min-height: 100vh;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    min-height: 100vh;
}

.login-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
}

.login-panel--brand {
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(200deg, var(--brand-accent) 0%, #094F7C 52%, #062C43 100%);
}

.login-panel__glow {
    position: absolute;
    inset: auto -18% -22% auto;
    width: 68%;
    height: 68%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(142, 197, 255, .28) 0%, transparent 68%);
    pointer-events: none;
    animation: login-glow 8s ease-in-out infinite alternate;
}

.login-panel__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 35% 40%, #000 0%, transparent 72%);
    pointer-events: none;
    opacity: .7;
}

.login-panel__brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    max-width: 420px;
    animation: login-rise .55s ease both;
}

.login-panel__titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-panel__title {
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.03em;
    color: #fff;
}

.login-panel__subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(183, 201, 216, .95);
}

.login-panel--brand .auth-brand__logo,
.login-panel--brand .auth-brand__logo .icon-svg {
    color: #fff;
}

.login-panel--form {
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background:
        radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--brand-accent) 10%, transparent), transparent 34%),
        linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
}

.login-form {
    width: 100%;
    max-width: 400px;
    animation: login-rise .55s ease .08s both;
}

.login-form__head {
    margin-bottom: 28px;
}

.login-form__logo-mobile {
    display: none;
    margin-bottom: 20px;
}

.login-form__title {
    margin: 0 0 8px;
    font-size: clamp(1.55rem, 2.4vw, 1.9rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #0f2a3d;
}

.login-form__subtitle {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #6b7c8a;
}

.login-form__error {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--tblr-danger) 28%, transparent);
    border-left: 3px solid var(--tblr-danger);
    border-radius: 4px;
    background: color-mix(in srgb, var(--tblr-danger) 7%, #fff);
    color: #8a1f2b;
    font-size: 13px;
}

.login-form__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field__label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #243846;
}

.login-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field__icon {
    position: absolute;
    left: 14px;
    display: inline-flex;
    color: #8aa0b0;
    pointer-events: none;
}

.login-field__icon svg {
    width: 17px;
    height: 17px;
}

.login-field__input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    border: 1px solid #d5e0e8;
    border-radius: 4px;
    background: rgba(255, 255, 255, .92);
    color: #142833;
    font-size: 14px;
    line-height: 1.2;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.login-field__input::placeholder {
    color: #97a8b5;
}

.login-field__input:hover {
    border-color: #b8c9d5;
}

.login-field__input:focus {
    border-color: color-mix(in srgb, var(--brand-accent) 55%, #b8c9d5);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 14%, transparent);
    background: #fff;
}

.login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    margin-top: 6px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #1583C0, var(--brand-accent));
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-accent) 24%, transparent);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.login-submit svg {
    width: 17px;
    height: 17px;
    transition: transform .15s ease;
}

.login-submit:hover {
    filter: brightness(1.04);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-accent) 30%, transparent);
}

.login-submit:hover svg {
    transform: translateX(2px);
}

.login-submit:active {
    transform: translateY(1px);
}

.login-form__footer {
    margin-top: 28px;
    font-size: 12px;
    color: #8aa0b0;
}

.login-form__alt {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.login-form__alt-sep {
    position: relative;
    display: block;
    width: 100%;
    max-width: 220px;
    text-align: center;
    font-size: 12px;
    font-weight: 450;
    letter-spacing: .04em;
    text-transform: lowercase;
    color: #93a4b0;
}

.login-form__alt-sep::before,
.login-form__alt-sep::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 1.4em);
    height: 1px;
    background: #e2eaf0;
}

.login-form__alt-sep::before { left: 0; }
.login-form__alt-sep::after { right: 0; }

.login-form__qr-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5a7385;
    text-decoration: none;
    font-weight: 450;
    font-size: 14px;
    line-height: 1.3;
    transition: color .15s ease;
}

.login-form__qr-link:hover {
    color: #0b679e;
}

.login-form__qr-link .icon-svg--orbita {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    opacity: .85;
}

.login-form__qr-link:hover .icon-svg--orbita {
    opacity: 1;
}

/* QR login page — спокойный тон */
.login-form.orbita-login-qr .login-form__title {
    font-weight: 500;
    letter-spacing: -.015em;
}

.login-form.orbita-login-qr .login-form__subtitle {
    font-weight: 400;
    color: #7a8d9a;
}

.orbita-login-qr__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 4px 0 8px;
}

.orbita-login-qr__frame {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e4edf3;
    background: #fff;
    box-shadow: 0 1px 0 rgba(15, 42, 61, 0.03);
}

.orbita-login-qr__frame img,
.orbita-login-qr__frame .orbita-qr {
    display: block;
    width: 188px;
    height: 188px;
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.orbita-login-qr__status {
    margin: 0;
    font-size: 13px;
    font-weight: 450;
    color: #5a7385;
}

.orbita-login-qr__hint {
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    color: #93a4b0;
}

.orbita-login-qr__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    justify-content: center;
    margin-top: 18px;
}

.orbita-login-qr__link {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 450;
    color: #5a7385;
    text-decoration: none;
    cursor: pointer;
    transition: color .15s ease;
}

.orbita-login-qr__link:hover {
    color: #0b679e;
}

.orbita-login-qr__link--muted {
    color: #93a4b0;
}

.login-form__info {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--brand-accent) 28%, transparent);
    border-left: 3px solid var(--brand-accent);
    border-radius: 4px;
    background: color-mix(in srgb, var(--brand-accent) 8%, #fff);
    color: #0f3a52;
    font-size: 13px;
}

.login-form--otp {
    max-width: 440px;
}

.login-form__eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-accent);
}

.login-stepbar {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.login-stepbar__step {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: #dce8ef;
}

.login-stepbar__step.is-done {
    background: linear-gradient(90deg, #7eb0cc, var(--brand-accent));
}

.login-stepbar__step.is-active {
    background: var(--brand-accent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand-accent) 40%, transparent);
}

.login-otp {
    position: relative;
    margin: 8px 0 4px;
    padding: 28px 4px 0;
    --otp-filled: 0;
}

.login-otp__glow {
    position: absolute;
    inset: 0 -8% 24px;
    background: radial-gradient(
        ellipse 80% 70% at 50% 55%,
        color-mix(in srgb, var(--brand-accent) calc(6% + var(--otp-filled) * 5%), transparent),
        transparent 72%
    );
    pointer-events: none;
    transition: background .25s ease;
}

.login-otp__row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.login-otp__row.is-shake {
    animation: login-otp-shake .42s ease;
}

.login-otp__cell {
    flex: 1 1 0;
    min-width: 0;
    max-width: 52px;
    height: 56px;
    padding: 0;
    border: 1.5px solid #d8e6ee;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    color: #0f2a3d;
    font-size: 1.65rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    outline: none;
    caret-color: var(--brand-accent);
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 42, 61, .04);
    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease,
        background .18s ease,
        color .18s ease;
    animation: login-otp-rise .5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(var(--otp-i, 0) * 45ms + 80ms);
}

.login-otp__cell:hover:not(:focus):not(:disabled) {
    border-color: #b5cedc;
    background: #fff;
}

.login-otp__cell:focus {
    border-color: var(--brand-accent);
    background: #fff;
    box-shadow:
        0 0 0 4px color-mix(in srgb, var(--brand-accent) 14%, transparent),
        0 10px 28px color-mix(in srgb, var(--brand-accent) 18%, transparent);
    transform: translateY(-2px) scale(1.03);
}

.login-otp__cell.is-filled {
    border-color: color-mix(in srgb, var(--brand-accent) 45%, #d8e6ee);
    background: #f6fbfe;
}

.login-otp__cell.is-success {
    border-color: #5cb894;
    background: linear-gradient(180deg, #edf9f3 0%, #e2f5ec 100%);
    color: #176b4c;
    box-shadow: 0 6px 20px rgba(47, 158, 116, .16);
    animation: login-otp-cell-flash .55s cubic-bezier(.2, .85, .25, 1.2) both;
    animation-delay: calc(var(--otp-i, 0) * 65ms);
}

.login-otp__track {
    position: relative;
    z-index: 1;
    height: 2px;
    margin: 18px 0 0;
    border-radius: 1px;
    background: #e4edf3;
    overflow: hidden;
}

.login-otp__track-fill {
    display: block;
    height: 100%;
    width: calc(var(--otp-filled, 0) / 6 * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, #5a9fc4, var(--brand-accent));
    transition: width .22s cubic-bezier(.4, 0, .2, 1);
}

.login-otp__hint {
    position: relative;
    z-index: 1;
    margin: 12px 0 0;
    font-size: 12.5px;
    color: #8aa0b0;
    text-align: center;
    line-height: 1.4;
}

.login-otp.is-success .login-otp__glow {
    background: radial-gradient(
        ellipse 80% 70% at 50% 55%,
        color-mix(in srgb, #2f9e74 22%, transparent),
        transparent 72%
    );
}

.login-otp.is-success .login-otp__track-fill {
    width: 100%;
    background: linear-gradient(90deg, #5cb894, #2f9e74);
}

.login-form--otp.is-otp-success .login-form__title {
    color: #176b4c;
}

.login-form--otp.is-otp-success .login-form__eyebrow {
    color: #2f9e74;
}

@keyframes login-otp-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes login-otp-cell-flash {
    0% {
        transform: scale(.92);
        filter: brightness(1);
    }
    45% {
        transform: scale(1.06);
        filter: brightness(1.08);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes login-otp-badge-pop {
    0% { transform: scale(.85); }
    55% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

@keyframes login-otp-ring {
    0% {
        opacity: .9;
        transform: scale(.7);
    }
    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}

@keyframes login-otp-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.login-otp-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.login-link-btn {
    border: 0;
    background: transparent;
    color: var(--brand-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    transition: opacity .15s ease, color .15s ease;
}

.login-link-btn:hover:not(:disabled) {
    opacity: .85;
    text-decoration: underline;
}

.login-link-btn:disabled {
    color: #8aa0b0;
    cursor: default;
    opacity: 1;
}

.login-link-btn--muted {
    color: #6b7c8a;
    font-weight: 500;
}

@keyframes login-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes login-glow {
    from { transform: translate(0, 0) scale(1); opacity: .85; }
    to { transform: translate(-6%, -4%) scale(1.08); opacity: 1; }
}

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-panel--brand {
        display: none;
    }

    .login-panel--form {
        min-height: 100vh;
        padding: 32px 20px;
        background:
            radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--brand-accent) 14%, transparent), transparent 42%),
            linear-gradient(180deg, #f8fbfd 0%, #eef3f7 100%);
    }

    .login-form__logo-mobile {
        display: block;
    }

    .login-form__logo-mobile .auth-brand__logo,
    .login-form__logo-mobile .auth-brand__logo .icon-svg {
        color: var(--brand-accent);
    }

    .login-otp {
        padding-top: 20px;
    }

    .login-otp__row {
        gap: 5px;
    }

    .login-otp__cell {
        max-width: 44px;
        height: 50px;
        font-size: 1.4rem;
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-panel__brand,
    .login-form,
    .login-panel__glow,
    .login-otp,
    .login-otp__cell,
    .login-otp__row.is-shake,
    .login-submit,
    .login-submit svg {
        animation: none !important;
        transition: none !important;
    }
}

.login-card { width: 100%; max-width: 440px; margin: auto; border-radius: 16px; }
.login-card .form-label { font-weight: 600; }
.login-card .input-icon-addon svg { width: 18px; height: 18px; }
.login-card .btn svg { width: 18px; margin-left: .4rem; }

@media (max-width: 991.98px) {
    .app-sidebar .navbar-brand { min-height: 48px; }
    .dashboard-hero { padding: 1.5rem; min-height: 165px; }
    .dashboard-hero-art { opacity: .35; right: -60px; }
}

/* --- всплывающие уведомления об успехе/ошибке действия (flash_set()):
   компактная плашка в правом верхнем углу вместо во всю ширину страницы,
   сама исчезает через пару секунд --- */
.app-toast-stack {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1040;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    max-width: 360px;
}

.app-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .65rem .8rem;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-left: 3px solid var(--tblr-secondary);
    border-radius: var(--tblr-border-radius);
    box-shadow: var(--tblr-shadow-lg, 0 8px 24px rgba(0, 0, 0, .1));
    font-size: var(--app-font-size);
    color: var(--tblr-body-color);
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .2s ease, transform .2s ease;
}

.app-toast.show { opacity: 1; transform: translateX(0); }
.app-toast.hide { opacity: 0; transform: translateX(12px); }

.app-toast svg.feather { width: 16px; height: 16px; flex: 0 0 auto; }
.app-toast-text { flex: 1; }

.app-toast-close {
    border: none;
    background: none;
    padding: 0 0 0 6px;
    font-size: 16px;
    line-height: 1;
    color: var(--tblr-secondary-color);
    cursor: pointer;
}

.app-toast-success { border-left-color: var(--tblr-success); }
.app-toast-success svg.feather { color: var(--tblr-success); }
.app-toast-danger { border-left-color: var(--tblr-danger); }
.app-toast-danger svg.feather { color: var(--tblr-danger); }
.app-toast-warning { border-left-color: var(--tblr-warning); }
.app-toast-warning svg.feather { color: var(--tblr-warning); }
.app-toast-info { border-left-color: var(--tblr-info); }
.app-toast-info svg.feather { color: var(--tblr-info); }

/* --- Единая система размеров интерфейса ------------------------------------
   Один базовый кегль, одна высота интерактивных элементов и компактный
   вертикальный ритм. Эти правила намеренно находятся последними: они сводят
   Tabler, DataTables и старые Bootstrap-классы к одной визуальной системе. */
:root {
    --brand-accent: #0B679E;
    --tblr-primary: var(--brand-accent);
    --tblr-primary-rgb: 11, 103, 158;
    --tblr-link-color: var(--brand-accent);

    --app-font-size: 14px;
    --app-font-size-sm: 12px;
    --app-control-height: 34px;
    --app-control-radius: 8px;
    --app-control-padding-x: 14px;
    --app-card-padding: 12px;
    --app-section-gap: 12px;
    --app-shadow-sm: 0 1px 3px rgba(15, 23, 42, .035);

    --app-table-padding-y: 6px;
    --app-table-padding-x: 10px;
    --app-table-header-size: var(--app-font-size);
    --app-table-action-size: 26px;
    --app-table-border: #e6ebf0;
    --app-table-radius: 5px;
    --app-table-header-bg: #f3f5f7;
    --app-table-header-color: #5b6b7c;
    --app-table-header-border: color-mix(in srgb, var(--brand-accent) 10%, #e2e7ed);
    --app-table-hover: rgba(11, 103, 158, 0.04);
    --app-table-zebra: #fafbfc;
    --app-filters-bg: #fff;
    --app-filters-header-bg: #f3f5f7;
    --app-filters-border: color-mix(in srgb, var(--brand-accent) 9%, #e3e8ee);

    /* DataTables 3 — мягкая зебра/hover в тон интерфейса */
    --dt_background-selected: 11, 103, 158;
    --dt-row_background-stripe: 250, 251, 252;
    --dt-row_background-hover: 11, 103, 158;
    --dt-column-ordering_background: 11, 103, 158;

    --tblr-body-font-size: var(--app-font-size);
    --tblr-border-radius: var(--app-control-radius);
}

html { font-size: 14px; }

body {
    font-size: var(--app-font-size);
    line-height: 1.4;
}

/* Кнопки: варианты sm/lg меняют только смысл в разметке, но не геометрию. */
.btn,
.btn.btn-sm,
.btn.btn-lg {
    min-height: var(--app-control-height);
    padding: 0 var(--app-control-padding-x);
    border-radius: var(--app-control-radius);
    font-size: var(--app-font-size);
    font-weight: 500;
    letter-spacing: .01em;
    line-height: 1.2;
    gap: 6px;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition:
        color .16s ease,
        background .16s ease,
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease,
        filter .16s ease;
}

.btn:not(.btn-link) { display: inline-flex; }

.btn-primary,
.btn-outline-primary,
.btn-outline-secondary {
    box-shadow: none;
}

.btn-icon,
.btn.btn-sm.btn-icon,
.btn.btn-lg.btn-icon {
    width: var(--app-control-height);
    min-width: var(--app-control-height);
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex: 0 0 auto;
}

.btn:not(.btn-icon) svg.feather,
.btn:not(.btn-icon) .icon-svg,
.btn i.fa,
.btn i.fas,
.btn i.far,
.btn i.fal,
.btn i.fab {
    margin-right: 0;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.btn i.fa,
.btn i.fas,
.btn i.far,
.btn i.fal,
.btn i.fab,
.btn i.fa-sm {
    font-size: var(--app-font-size) !important;
}

.btn svg.feather { flex: 0 0 auto; }

.btn-icon svg.feather,
.btn-icon .icon-svg { width: 14px; height: 14px; }

.btn-accent-split { height: var(--app-control-height); }

/* Поля, списки и дополнения к ним совпадают с кнопками по высоте и радиусу.
   Высота фиксирована, вертикальный padding = 0: иначе при 30–34px + pad 6px
   «живая» зона клика сжимается в узкую полоску по центру — сверху/снизу
   поле почти не ловит фокус. */
.form-control,
.form-control-sm,
.form-control-lg,
.form-select,
.form-select-sm,
.form-select-lg,
.input-group-text {
    min-height: var(--app-control-height);
    border-radius: var(--app-control-radius);
    font-size: var(--app-font-size);
    line-height: 1.25;
}

.form-control:not(textarea):not(.form-control-color),
.form-control-sm:not(textarea):not(.form-control-color),
.form-control-lg:not(textarea):not(.form-control-color),
.form-select,
.form-select-sm,
.form-select-lg {
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    padding-top: 0;
    padding-bottom: 0;
    line-height: calc(var(--app-control-height) - 2px);
}

.input-group-text {
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
}

.form-control,
.form-control-sm,
.form-control-lg { padding-left: 10px; padding-right: 10px; }

.form-select,
.form-select-sm,
.form-select-lg { padding-left: 10px; }

/* Поле «выбор со списком» / этапы — «вдавленный» вид как у времени в таблицах.
   Не вешать на все .form-select: иначе затрагивает настройки, фильтры, конструктор. */
.form-select.app-field-select,
.form-select.stages-field-select {
    border-color: var(--app-inset-border);
    background-color: var(--app-inset-bg);
    box-shadow: var(--app-inset-shadow);
}

.form-select.app-field-select:disabled,
.form-select.stages-field-select:disabled {
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .03);
}

textarea.form-control {
    height: auto;
    min-height: 82px;
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.4;
}
.form-control-color { width: var(--app-control-height); height: var(--app-control-height); padding: 4px; }
.form-label { margin-bottom: 5px; font-size: var(--app-font-size); }

/* Клик по отступам «карточки» поля (рамка/фон из дизайнера) — в фокус контрола */
.field-layout-chrome {
    cursor: text;
}

/* Подписи полей не должны перехватывать выделение текста соседних инпутов */
.app-modal-form .form-label,
.app-modal-form label.form-label,
.profile-page .form-label {
    user-select: none;
    -webkit-user-select: none;
}

.app-modal-form .rt-wysiwyg {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.app-modal-form.row > [class*="col-"] {
    position: relative;
    z-index: 0;
}
.form-text { margin-top: 4px; font-size: 12px; line-height: 1.35; }

.field-unique-wrap {
    position: relative;
}
.field-unique-wrap .form-control {
    padding-right: 2.35rem;
}
.field-unique-badge {
    position: absolute;
    top: calc(var(--app-control-height, 36px) / 2);
    right: 10px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    line-height: 0;
}
.field-unique-badge__icon {
    width: 16px;
    height: 16px;
    display: block;
}
.field-unique-badge__icon.is-ok {
    color: var(--tblr-success, #2fb344);
}
.field-unique-badge__icon.is-err {
    color: var(--tblr-danger, #d63939);
}
.field-unique-input--ok {
    border-color: color-mix(in srgb, var(--tblr-success, #2fb344) 55%, var(--tblr-border-color, #dce1e7)) !important;
}
.field-unique-input--err {
    border-color: color-mix(in srgb, var(--tblr-danger, #d63939) 65%, var(--tblr-border-color, #dce1e7)) !important;
}
.field-unique-input--ok:focus,
.field-unique-input--err:focus {
    box-shadow: none;
}

.field-required-input--empty,
.form-control.field-required-input--empty,
.form-select.field-required-input--empty,
.field-required-input--empty .form-control,
.field-required-input--empty .form-select {
    border-color: color-mix(in srgb, var(--tblr-danger, #d63939) 50%, var(--tblr-border-color, #dce1e7)) !important;
    background-image: none !important;
}
.form-check-input.field-required-input--empty {
    border-color: color-mix(in srgb, var(--tblr-danger, #d63939) 50%, var(--tblr-border-color, #dce1e7));
}
.form-required-hint {
    line-height: 1.3;
    margin-right: auto;
    max-width: min(100%, 22rem);
}

/* Карточки и заголовки используют тот же спокойный компактный ритм. */
.card {
    border-color: var(--tblr-border-color-translucent);
    border-radius: 8px;
    box-shadow: var(--app-shadow-sm);
}

/* Контент страниц — без отдельной «коробки», встроен в фон */
.page-body .card:not(.stat-card):not(.stat-card--custom):not(.login-card):not(.keep-card) {
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.page-body .card:not(.stat-card):not(.stat-card--custom):not(.login-card):not(.keep-card) > .card-body {
    padding: 0;
}

.page-body .card:not(.stat-card):not(.stat-card--custom):not(.login-card):not(.keep-card) > .card-header,
.page-body .card:not(.stat-card):not(.stat-card--custom):not(.login-card):not(.keep-card) > .card-footer {
    padding-left: 0;
    padding-right: 0;
    background: transparent;
    border: none;
}

.item-page .keep-card,
.profile-page .keep-card {
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--app-table-border, #e8ecf1);
    border-radius: 10px;
    box-shadow: none;
}

.item-page .item-page-subentity.keep-card,
.item-page .item-page-subentity-map.keep-card {
    /* подсветка строк доходит до скругления; у карты overflow не режем — иначе «двойная» рамка */
    overflow: hidden;
}
.item-page .item-page-subentity-map.keep-card {
    overflow: visible;
}

/* Подсущность: мягкая подложка, таблица — белый лист внутри */
.item-page .item-page-subentity.keep-card {
    background: #f4f6f9;
    border: 1px solid #e3e8ef;
    box-shadow: none;
}

/* Карта точек: без рамки карточки — одна чистая кнопка */
.item-page .item-page-subentity-map.keep-card {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible;
}
.item-page .item-page-subentity-map.keep-card > .card-body {
    padding: 0 !important;
}
.item-page .item-page-subentity-map .osm-subentity-points {
    margin-top: 0;
}
.item-page .item-page-subentity-map .osm-subentity-points__head {
    margin-bottom: 0;
    min-height: 0;
}
.item-page .item-page-subentity-map .osm-subentity-points__body.show {
    margin-top: 0.55rem;
    padding: 0;
    border-top: 0;
}

.item-page .item-page-subentity.keep-card > .card-header {
    background: transparent;
    border-bottom: none;
    min-height: 0;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    padding-left: calc(var(--app-card-padding) + var(--il-block-pad, 0px)) !important;
    padding-right: calc(var(--app-card-padding) + var(--il-block-pad, 0px)) !important;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: hidden;
}

/* Заголовок сжимается, кнопки не наезжают на название */
.item-page .item-page-subentity.keep-card > .card-header.item-page-subentity__head > .item-page-subentity__head-title,
.item-page .item-page-subentity.keep-card > .card-header > .item-page-subentity__head-title,
.fd-subentity-preview > .card-header.item-page-subentity__head > .item-page-subentity__head-title,
.fd-subentity-preview > .card-header > .item-page-subentity__head-title {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.item-page .item-page-subentity.keep-card > .card-header .item-page-subentity__head-title > svg,
.item-page .item-page-subentity.keep-card > .card-header .item-page-subentity__head-title > i,
.fd-subentity-preview > .card-header .item-page-subentity__head-title > svg,
.fd-subentity-preview > .card-header .item-page-subentity__head-title > i {
    flex-shrink: 0;
}

.item-page .item-page-subentity.keep-card > .card-header .item-page-subentity__head-label,
.fd-subentity-preview > .card-header .item-page-subentity__head-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-page .item-page-subentity.keep-card > .card-header > .item-page-subentity__head-actions,
.fd-subentity-preview > .card-header > .item-page-subentity__head-actions {
    flex: 0 0 auto;
    flex-shrink: 0;
    margin-left: auto;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 0.35rem;
    position: relative;
    z-index: 1;
}

.item-page .item-page-subentity.keep-card > .card-header .btn-link {
    --tblr-btn-bg: transparent;
    --tblr-btn-hover-bg: transparent;
    --tblr-btn-active-bg: transparent;
    --tblr-btn-border-color: transparent;
    --tblr-btn-hover-border-color: transparent;
    color: var(--tblr-body-color);
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    text-decoration: none;
    min-height: 0;
    height: auto;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    justify-content: flex-start;
}

.item-page .item-page-subentity.keep-card > .card-header .btn-link:hover,
.item-page .item-page-subentity.keep-card > .card-header .btn-link:focus,
.item-page .item-page-subentity.keep-card > .card-header .btn-link:focus-visible,
.item-page .item-page-subentity.keep-card > .card-header .btn-link:active {
    color: var(--brand-accent, #0B679E);
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none;
}

.item-page .item-page-subentity.keep-card > .card-header .item-page-subentity__add,
.item-page .item-page-subentity.keep-card > .card-header .item-page-subentity__attach {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: var(--app-font-size, 14px);
}

.item-form-parent-banner {
    margin: 0;
}

.item-form-parent-field {
    margin-bottom: 0;
}

.item-parent-bar--form {
    margin-bottom: 0;
}

.item-parent-bar__picker {
    margin-top: 10px;
}

.item-parent-bar__picker[hidden] {
    display: none !important;
}

.item-parent-bar__picker .parent-item-picker .related-entity-picker__search {
    background: var(--tblr-bg-forms, var(--tblr-body-bg, #fff));
}

.item-parent-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    min-height: 42px;
    border: 1px solid var(--tblr-border-color-translucent, #e6ebf1);
    border-radius: var(--app-control-radius, 6px);
    background: color-mix(in srgb, var(--tblr-bg-surface) 88%, #f1f5f9);
    line-height: 1.45;
}

/* В сетке формы рядом с обычными полями — высота как у .form-control */
.item-parent-bar--control {
    height: var(--app-control-height, 34px);
    min-height: var(--app-control-height, 34px);
    padding: 0 0.75rem;
    flex-wrap: nowrap;
    background: var(--tblr-bg-forms, var(--tblr-body-bg, #fff));
    box-sizing: border-box;
}

.item-parent-bar--control .item-parent-bar__main {
    line-height: 1.25;
    font-size: var(--app-font-size, 14px);
}

.item-parent-bar--control .item-parent-bar__actions {
    margin-right: -2px;
}

.item-parent-bar--control .item-parent-bar__actions.table-actions {
    flex-shrink: 0;
}

.item-parent-bar--control.item-parent-bar--picker {
    padding: 0;
    border: 0;
    background: transparent;
    min-height: 0;
}

.item-parent-bar--control.item-parent-bar--picker .parent-item-picker {
    width: 100%;
}

.item-parent-bar__main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    font-size: var(--app-font-size, 14px);
    line-height: 1.45;
}

.item-parent-bar__label {
    flex-shrink: 0;
}

.item-parent-bar__value {
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-parent-bar__link {
    font-weight: 500;
    text-decoration: none;
}

.item-parent-bar__link:hover {
    text-decoration: underline;
}

.item-parent-bar--inline {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
}

.item-parent-bar--inline .item-parent-bar__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: var(--app-font-size-sm, 13px);
}

.item-parent-bar--inline .parent-item-picker {
    width: 100%;
}

.item-parent-bar__actions {
    flex: 0 0 auto;
}

.subentity-attach-dialog {
    max-width: 440px;
}

.subentity-attach-modal {
    border: 1px solid rgba(15, 45, 66, .08);
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, .03),
        0 18px 48px rgba(15, 23, 42, .22);
    overflow: hidden;
}

.subentity-attach-modal__head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(15, 45, 66, .08);
}

.subentity-attach-modal__head .modal-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.subentity-attach-modal__body {
    padding: 14px 16px 16px;
}

.subentity-attach-modal__foot {
    padding: 10px 16px;
    border-top: 1px solid rgba(15, 45, 66, .08);
    justify-content: flex-start;
}

.subentity-attach-search {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.subentity-attach-search__field {
    position: relative;
}

.subentity-attach-search__icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    color: #8aa0b0;
    pointer-events: none;
    line-height: 0;
}

.subentity-attach-search__icon svg {
    width: 15px;
    height: 15px;
}

.subentity-attach-search__input {
    padding-left: 34px;
    min-height: var(--app-control-height, 36px);
    border-radius: 8px;
    border-color: #d8dee6;
    background: #fff;
}

.subentity-attach-search__input:focus {
    border-color: color-mix(in srgb, var(--brand-accent, #0b679e) 45%, #d8dee6);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent, #0b679e) 14%, transparent);
}

.subentity-attach-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tblr-border-color, #d8dee6) 22%, #fff);
    color: #5b6b7c;
    font-size: 12.5px;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.subentity-attach-filter .form-check-input {
    margin: 0;
    float: none;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.subentity-attach-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #7a93a6;
    letter-spacing: .02em;
}

.subentity-attach-suggest {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow: auto;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
}

.subentity-attach-empty,
.subentity-attach-idle {
    padding: 18px 14px;
    border: 1px dashed #d8e2ea;
    border-radius: 10px;
    background: color-mix(in srgb, #f8fafc 80%, #fff);
    text-align: center;
    font-size: 13px;
    line-height: 1.45;
    color: #7a93a6;
}

.subentity-attach-idle:not(.d-none) + .subentity-attach-empty.d-none {
    display: none;
}

.parent-item-picker .related-entity-picker__control {
    position: relative;
}

.parent-item-picker__open {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--brand-accent, #0b679e);
    opacity: .85;
    text-decoration: none;
    z-index: 2;
}

.parent-item-picker__open:hover {
    opacity: 1;
}

.parent-item-picker .related-entity-picker__search {
    padding-right: 4.25rem;
}

.parent-item-picker .related-entity-picker__clear {
    right: 8px;
}

.subentity-attach-suggest__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e4ebf2;
    border-radius: 8px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.subentity-attach-suggest__item:hover,
.subentity-attach-suggest__item:focus-visible {
    border-color: color-mix(in srgb, var(--brand-accent, #0b679e) 35%, #e4ebf2);
    background: color-mix(in srgb, var(--brand-accent, #0b679e) 5%, #fff);
    box-shadow: 0 1px 2px rgba(15, 45, 66, .06);
    outline: none;
}

.subentity-attach-suggest__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.subentity-attach-suggest__label {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.25;
}

.subentity-attach-suggest__meta {
    font-size: 12px;
    color: #8aa0b0;
    line-height: 1.25;
}

.subentity-attach-suggest__action {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--brand-accent, #0b679e);
    opacity: .85;
}

.subentity-attach-suggest__item:hover .subentity-attach-suggest__action,
.subentity-attach-suggest__item:focus-visible .subentity-attach-suggest__action {
    opacity: 1;
}

.subentity-attach-empty,
.subentity-attach-error {
    margin-top: 8px;
    padding: 14px 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.subentity-attach-empty {
    background: #f7f9fb;
    color: #8aa0b0;
}

.subentity-attach-error {
    background: color-mix(in srgb, var(--tblr-danger, #d63939) 8%, #fff);
    color: var(--tblr-danger, #d63939);
}

.item-page .item-page-subentity.keep-card > .card-header .text-muted {
    color: color-mix(in srgb, var(--tblr-body-color) 55%, transparent) !important;
    font-weight: 400;
    font-size: inherit;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: 0;
    vertical-align: baseline;
}

.item-page .item-page-copy-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    cursor: pointer;
    border-radius: 6px;
}

.item-page .item-page-copy-wrap:hover .item-page-copy-btn,
.item-page .item-page-copy-wrap:focus-visible .item-page-copy-btn {
    color: var(--brand-accent, #0B679E);
}

.item-page .item-page-copy-wrap:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--brand-accent, #0B679E) 45%, transparent);
    outline-offset: 2px;
}

.item-page .item-page-copy-wrap__text {
    min-width: 0;
}

.item-page .item-page-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    box-shadow: none;
    pointer-events: none;
    transition: color .15s ease;
}

.item-page .item-page-copy-btn svg,
.item-page .item-page-copy-btn svg.feather {
    width: 14px;
    height: 14px;
    display: block;
}

.item-page .item-page-copy-btn.is-copied {
    color: #5a9e78;
    background: transparent;
}

.item-page .item-page-copy-btn.is-copied svg {
    animation: item-page-copy-pop .32s ease;
}

@keyframes item-page-copy-pop {
    0% { transform: scale(.85); opacity: .5; }
    100% { transform: scale(1); opacity: 1; }
}

.item-page .related-entity-info-btns {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.item-page .related-entity-info-btn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.related-entity-info-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tblr-link-color, var(--brand-accent, #0B679E));
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font: inherit;
    vertical-align: baseline;
}
button.related-entity-info-link:hover {
    color: var(--tblr-link-hover-color, var(--brand-accent, #0B679E));
}

.app-modal-form--view .related-entity-picker [data-role="search"],
.app-modal-form--view .related-multi-picker [data-role="search"],
.app-modal-form--view .users-picker [data-role="search"],
.app-modal-form--view .entity-files__drop,
.app-modal-form--view .entity-files__upload-btn,
.app-modal-form--view .entity-files__card--add,
.app-modal-form--view .field-eds__start-btn,
.app-modal-form--view .field-eds__manage-toggle,
.app-modal-form--view .field-eds__reset,
.app-modal-form--view [data-role="remove"],
.app-modal-form--view .related-entity-picker__add {
    display: none !important;
}
.app-modal-form--view .form-control:disabled,
.app-modal-form--view .form-select:disabled {
    opacity: 1;
    background-color: var(--tblr-bg-surface-secondary, #f8fafc);
    color: var(--tblr-body-color);
}
.app-modal-form--view .rt-wysiwyg,
.app-modal-form--view .rt-wysiwyg__editor {
    pointer-events: none;
}

.item-page .related-entity-info-links .related-entity-info-link + .related-entity-info-link::before {
    content: ', ';
    color: var(--bs-body-color);
    text-decoration: none;
}

.app-listing .related-entity-listing-link + .related-entity-listing-link::before {
    content: ', ';
    color: inherit;
    text-decoration: none;
}

.item-page .accordion-button {
    font-size: var(--app-font-size);
    font-weight: 400;
}

/* Блоки раскладки страницы записи */
.info-layout-collapsible {
    font-size: var(--app-font-size);
    margin: 0 0 8px;
    color: #2c3e50;
    line-height: 1.25;
    border: 1px solid #eaeef2;
    border-radius: 8px;
    background: transparent;
    overflow: hidden;
}
.info-layout-collapsible__head {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.info-layout-collapsible__head:hover { background: #e8f4fd; }
.info-layout-collapsible__head--compact {
    padding: 8px 12px;
    border-top: 1px solid #eaeef2;
}
.info-layout-collapsible__head--field {
    width: 100%;
    padding: 8px 12px;
    min-height: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #eaeef2;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: left;
}
.info-layout-collapsible__head--field:hover { background: #e8f4fd; }
.info-layout-collapsible__head--field .info-field-inner {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    width: 100%;
    min-height: 0 !important;
    display: block !important;
}
.info-layout-collapsible__head--field .info-field-label {
    margin-bottom: 0 !important;
}
.info-layout-collapsible__head--field .info-field-value {
    line-height: 1.3;
}
.info-layout-collapsible__field {
    flex: 1 1 auto;
    min-width: 0;
}
.info-layout-collapsible__chev {
    width: 14px;
    height: 14px;
    opacity: .6;
    flex-shrink: 0;
    transition: transform .15s ease;
}
.info-layout-collapsible__head[aria-expanded="false"] .info-layout-collapsible__chev {
    transform: rotate(-90deg);
}
.info-layout-collapsible__pinned {
    padding: 0;
}
.info-layout-collapsible__info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
.info-layout-collapsible__text {
    flex: 1 1 auto;
    min-width: 0;
}
.info-layout-collapsible__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    color: #5d6d7e;
}
.info-layout-collapsible__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.info-layout-collapsible__title { display: block; font-size: 16px; font-weight: 500; color: #2c3e50; }
.info-layout-collapsible__title--muted { font-size: 13px; font-weight: 500; color: #6c7a89; }
.info-layout-collapsible__sub { display: block; font-size: 12px; color: #7f8c8d; margin-top: 4px; }
.info-layout-collapsible__title p,
.info-layout-collapsible__title div,
.info-layout-collapsible__sub p,
.info-layout-collapsible__sub div {
    margin: 0;
    display: inline;
}
.info-layout-collapsible__title b,
.info-layout-collapsible__title strong { font-weight: 600; }
.info-layout-collapsible__title a,
.info-layout-collapsible__sub a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.info-layout-collapsible__title a:hover,
.info-layout-collapsible__sub a:hover { color: #3498db; }
.info-layout-collapsible__phone {
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}
.info-layout-collapsible__phone:hover { color: #3498db; }
.info-layout-collapsible__body {
    padding: 20px;
    border-top: 1px solid #eaeef2;
    background: #fff;
}
.info-layout-heading {
    margin: 0 0 10px;
    color: #2c3e50;
    line-height: 1.25;
}
.info-layout-heading__inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.info-layout-heading--center .info-layout-heading__inner {
    justify-content: center;
    text-align: center;
}
.info-layout-heading--right .info-layout-heading__inner {
    justify-content: flex-end;
    text-align: right;
}
.info-layout-heading__text {
    flex: 0 1 auto;
    min-width: 0;
}
.info-layout-heading__title {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}
.info-layout-heading__sub {
    display: block;
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 4px;
}
.info-layout-heading__title p,
.info-layout-heading__title div,
.info-layout-heading__sub p,
.info-layout-heading__sub div {
    margin: 0;
    display: inline;
}
.info-layout-heading .info-layout-collapsible__icon {
    width: 1.5rem;
    height: 1.5rem;
}
.info-layout-icon-text {
    min-width: 0;
}
.info-layout-icon-text__row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.info-layout-icon-text__text {
    flex: 1 1 auto;
    min-width: 0;
}
.info-layout-icon-text__title {
    font-size: var(--il-it-title-size, var(--app-font-size, 14px));
    font-weight: 400;
    color: var(--tblr-body-color, #2c3e50);
    line-height: 1.35;
}
.info-layout-icon-text__sub {
    font-size: max(11px, calc(var(--il-it-title-size, 14px) * 0.85));
    color: var(--tblr-secondary-color, #7f8c8d);
    margin-top: 2px;
    line-height: 1.35;
}
.info-layout-icon-text__title p,
.info-layout-icon-text__title div,
.info-layout-icon-text__sub p,
.info-layout-icon-text__sub div {
    margin: 0;
    display: inline;
}
.info-layout-icon-text .info-layout-collapsible__icon {
    flex: 0 0 auto;
    width: var(--il-it-icon-size, 20px);
    height: var(--il-it-icon-size, 20px);
    opacity: var(--il-it-icon-opacity, 1);
}
.info-layout-icon-text .info-layout-collapsible__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}
.info-layout-icon-text--icon .info-layout-icon-text__text {
    display: none;
}
.info-layout-row--inline {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.info-layout-tabs {
    width: 100%;
    margin: 10px 0;
}
/* Закладки как в примере: единый блок с контентом. Шрифт/размер — наши. */
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    /* Вся полоса вкладок выше контента — иначе поля (Клиент и т.п.)
       перехватывают клики по неактивным закладкам. */
    position: relative;
    z-index: 5;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item {
    display: block;
    float: none;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    width: auto;
    position: relative;
    z-index: 1;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    margin-bottom: -1px;
    padding: 6px 14px;
    border-top: 0.5px solid #d8d8d8;
    border-bottom: 0.5px solid #d8d8d8;
    border-left: 0.5px solid #d8d8d8;
    border-right: none;
    border-radius: 0;
    background: #fbfbfb;
    color: #999;
    font-size: var(--app-font-size, 13px);
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:first-child .nav-link {
    border-radius: 5px 0 0 0;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:last-child .nav-link {
    border-right: 0.5px solid #d8d8d8;
    border-radius: 0 5px 0 0;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:only-child .nav-link {
    border-radius: 5px 5px 0 0;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link:hover {
    color: #666;
    background: #f5f5f5;
    border-top-color: #d8d8d8;
    border-bottom-color: #d8d8d8;
    border-left-color: #d8d8d8;
    border-right: none;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:last-child .nav-link:hover {
    border-right: 0.5px solid #d8d8d8;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--tblr-primary, #0b679e) 35%, transparent);
    outline-offset: -2px;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active {
    border-top: 0.5px solid #d8d8d8;
    border-left: 0.5px solid #d8d8d8;
    border-right: 0.5px solid #d8d8d8;
    border-bottom: 0.5px solid #fff;
    background: #fff;
    color: #000;
    font-weight: 400;
    box-shadow: none;
    z-index: 2;
}
.info-layout-tabs__content {
    margin: 0;
    padding: 0;
    border: 0.5px solid #d8d8d8;
    border-top: none;
    border-radius: 0 0 5px 5px;
    background: #fff;
    position: relative;
    z-index: 0;
}
.info-layout-tabs__content > .tab-pane {
    padding: 15px;
}
.info-layout-tabs__content > .tab-pane > .row {
    --bs-gutter-y: 0.35rem;
}

/* Вкладки формы / дизайнера — тот же «файловый» стиль, что на странице записи. */
.info-layout-tabs--form {
    margin: 0;
}
.info-layout-tabs--form .info-layout-tabs__content > .tab-pane {
    padding: 14px;
}
.info-layout-tabs--designer {
    margin: 0 0 12px;
}
.info-layout-tabs--designer .info-layout-tabs__content {
    padding: 0;
    background: #fff;
}
.info-layout-tabs--designer .info-layout-tabs__content > .tab-pane {
    padding: 0;
}
.info-layout-tabs--designer .fd-form-tab-pane > .card.fd-tab-column {
    border: none;
    border-radius: 0;
    box-shadow: none;
}
.info-layout-tabs--designer .info-layout-tabs__nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.info-layout-section {
    margin: 0;
}
.info-layout-section .info-layout-section {
    margin: 0;
}
.info-layout-block-wrap:has(> .info-layout-section) {
    min-width: 0;
}
.info-layout-block-wrap--nested {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.info-layout-block-wrap--nested > .info-layout-section {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.info-layout-section--nested {
    margin: 0;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.info-layout-section--nested > .row {
    max-width: 100%;
    min-width: 0;
}
.info-layout-section--nested .row > [class*="col-grid-"] {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.info-layout-section--nested.info-layout-section--has-badge {
    position: relative;
    overflow: visible;
}
.info-layout-section--nested .info-layout-section__badge--ribbon,
.info-layout-section--nested .info-layout-section__badge--ribbon-fold,
.info-layout-section--nested .info-layout-section__badge--ribbon-soft,
.info-layout-section--nested .info-layout-section__badge--ribbon-success,
.info-layout-section--nested .info-layout-section__badge--ribbon-warn,
.info-layout-section--nested .info-layout-section__badge--ribbon-dark,
.info-layout-section--nested .info-layout-section__badge--pill,
.info-layout-section--nested .info-layout-section__badge--outline,
.info-layout-section--nested .info-layout-section__badge--gradient,
.info-layout-section--nested .info-layout-section__badge--glass,
.info-layout-section--nested .info-layout-section__badge--dot,
.info-layout-section--nested .info-layout-section__badge--muted,
.info-layout-section--nested .info-layout-section__badge--stamp,
.info-layout-section--nested .info-layout-section__badge--soft,
.info-layout-section--nested .info-layout-section__badge--tag,
.info-layout-section--nested .info-layout-section__badge--slim,
.info-layout-section--nested .info-layout-section__badge--lift,
.info-layout-section--nested .info-layout-section__badge--ticket,
.info-layout-section--nested .info-layout-section__badge--flag,
.info-layout-section--nested .info-layout-section__badge--edge,
.info-layout-section--nested .info-layout-section__badge--corner,
.info-layout-section--nested .info-layout-section__badge--banner,
.info-layout-section--nested .info-layout-section__badge--info,
.info-layout-section--nested .info-layout-section__badge--accent-bar,
.info-layout-section--nested .info-layout-section__badge--plate,
.info-layout-section--nested .info-layout-section__badge--plate-ru {
    top: 4px;
    transform: translateY(0);
}
.info-layout-section--nested .info-layout-section__badge--ribbon-fold {
    transform: translateY(0);
}
.info-layout-section--nested .info-layout-section__badge--chips {
    margin-bottom: .35rem;
}
.info-layout-section--nested .info-field-inner,
.info-layout-section--nested .info-layout-icon-text {
    min-width: 0;
    max-width: 100%;
}
.info-layout-section--has-badge {
    position: relative;
    overflow: visible;
}
.info-layout-section__badge {
    z-index: 3;
    pointer-events: none;
}
.info-layout-section__badge-text {
    display: inline-block;
    padding: 5px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    color: #fff;
    background: var(--badge-tint, var(--brand-accent, #0B679E));
    border-radius: 6px;
    box-shadow: none;
    text-shadow: none;
    white-space: nowrap;
}
.info-layout-section__badge-text--with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.info-layout-section__badge-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.info-layout-section__badge-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}
.info-layout-section__badge--has-icon.info-layout-section__badge--chips,
.info-layout-section__badge--has-icon.info-layout-section__badge--plate,
.info-layout-section__badge--has-icon.info-layout-section__badge--plate-ru {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.info-layout-section__badge--has-icon.info-layout-section__badge--chips .info-layout-section__badge-icon {
    margin-left: 2px;
}
/* Ярлык внутри секции с отступами — не вылезает на кнопки шапки */
.info-layout-section__badge--ribbon,
.info-layout-section__badge--ribbon-fold,
.info-layout-section__badge--ribbon-soft,
.info-layout-section__badge--ribbon-success,
.info-layout-section__badge--ribbon-warn,
.info-layout-section__badge--ribbon-dark,
.info-layout-section__badge--pill,
.info-layout-section__badge--outline,
.info-layout-section__badge--gradient,
.info-layout-section__badge--glass,
.info-layout-section__badge--dot,
.info-layout-section__badge--muted,
.info-layout-section__badge--stamp,
.info-layout-section__badge--soft,
.info-layout-section__badge--tag,
.info-layout-section__badge--slim,
.info-layout-section__badge--lift,
.info-layout-section__badge--ticket,
.info-layout-section__badge--plate,
.info-layout-section__badge--plate-ru {
    position: absolute;
    top: 10px;
    transform: none;
}
.info-layout-section__badge--plate,
.info-layout-section__badge--plate-ru {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.info-layout-section__badge--plate .field-plate-ru,
.info-layout-section__badge--plate-ru .field-plate-ru,
.info-layout-section__badge--plate .field-plate-chips,
.info-layout-section__badge--plate-ru .field-plate-chips {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}
.info-layout-section__badge--side-right {
    right: 12px;
    left: auto;
}
.info-layout-section__badge--side-left {
    left: 12px;
    right: auto;
}
.info-layout-section__badge--ribbon-fold {
    transform: none;
}
.info-layout-section__badge--ribbon-fold.info-layout-section__badge--side-right {
    right: 10px;
}
.info-layout-section__badge--ribbon-fold.info-layout-section__badge--side-left {
    left: 10px;
}
.info-layout-section__badge--ribbon-fold.info-layout-section__badge--side-left .info-layout-section__badge-text {
    border-radius: 4px 4px 0 4px;
}
.info-layout-section__badge--ribbon-fold.info-layout-section__badge--side-left .info-layout-section__badge-text::after {
    left: auto;
    right: 0;
    border-width: 6px 0 0 6px;
    border-color: color-mix(in srgb, var(--badge-tint, #d63939) 72%, #000) transparent transparent transparent;
}
.info-layout-section__badge--ribbon-fold .info-layout-section__badge-text {
    position: relative;
    border-radius: 4px 4px 4px 0;
    background: var(--badge-tint, #d63939);
}
.info-layout-section__badge--ribbon-fold .info-layout-section__badge-text::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    border-style: solid;
    border-width: 6px 6px 0 0;
    border-color: color-mix(in srgb, var(--badge-tint, #d63939) 72%, #000) transparent transparent transparent;
}
.info-layout-section__badge--ribbon-soft .info-layout-section__badge-text {
    color: color-mix(in srgb, var(--badge-tint, #334155) 82%, #000);
    background: color-mix(in srgb, var(--badge-tint, #94a3b8) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--badge-tint, #94a3b8) 28%, #e2e8f0);
}
.info-layout-section__badge--ribbon-success .info-layout-section__badge-text {
    background: var(--badge-tint, var(--tblr-success, #2fb344));
}
.info-layout-section__badge--ribbon-warn .info-layout-section__badge-text {
    color: #713f12;
    background: var(--badge-tint, #facc15);
}
.info-layout-section__badge--ribbon-dark .info-layout-section__badge-text {
    background: var(--badge-tint, #0f172a);
}
.info-layout-section__badge--pill .info-layout-section__badge-text {
    border-radius: 999px;
    padding: 5px 14px;
}
.info-layout-section__badge--outline .info-layout-section__badge-text {
    color: var(--badge-tint, var(--brand-accent, #0B679E));
    background: transparent;
    border: 1.5px solid var(--badge-tint, var(--brand-accent, #0B679E));
}
.info-layout-section__badge--gradient .info-layout-section__badge-text {
    background: linear-gradient(
        135deg,
        var(--badge-tint, #0B679E) 0%,
        color-mix(in srgb, var(--badge-tint, #0B679E) 45%, #60a5fa) 100%
    );
}
.info-layout-section__badge--glass .info-layout-section__badge-text {
    color: #0f172a;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.info-layout-section__badge--corner {
    position: absolute;
    bottom: 10px;
    top: auto;
    transform: none;
}
.info-layout-section__badge--corner.info-layout-section__badge--side-right {
    right: 12px;
    left: auto;
}
.info-layout-section__badge--corner.info-layout-section__badge--side-left {
    left: 12px;
    right: auto;
}
.info-layout-section__badge--corner .info-layout-section__badge-text {
    background: #334155;
    border-radius: 4px;
}
.info-layout-section__badge--info {
    display: block;
    margin: 0 0 .55rem;
}
.info-layout-section__badge--info .info-layout-section__badge-text {
    display: block;
    color: #0369a1;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 6px;
}
.info-layout-section__badge--muted .info-layout-section__badge-text {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}
.info-layout-section__badge--accent-bar {
    display: block;
    margin: 0 0 .55rem;
}
.info-layout-section__badge--accent-bar.info-layout-section__badge--side-right {
    text-align: right;
}
.info-layout-section__badge--accent-bar.info-layout-section__badge--side-left {
    text-align: left;
}
.info-layout-section__badge--accent-bar .info-layout-section__badge-text {
    display: inline-block;
    color: #0f172a;
    background: transparent;
    border-radius: 0;
    padding: 2px 0 2px 10px;
    border-left: 3px solid var(--badge-tint, var(--brand-accent, #0B679E));
    border-right: 0;
}
.info-layout-section__badge--accent-bar.info-layout-section__badge--side-right .info-layout-section__badge-text {
    padding: 2px 10px 2px 0;
    border-left: 0;
    border-right: 3px solid var(--badge-tint, var(--brand-accent, #0B679E));
}
.info-layout-section__badge--dot .info-layout-section__badge-text::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: currentColor;
    vertical-align: 1px;
}
.info-layout-section__badge--dot .info-layout-section__badge-text {
    color: var(--badge-tint, var(--brand-accent, #0B679E));
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.info-layout-section__badge--capsule {
    display: flex;
    margin: 0 0 .55rem;
}
.info-layout-section__badge--capsule.info-layout-section__badge--side-left {
    justify-content: flex-start;
}
.info-layout-section__badge--capsule.info-layout-section__badge--side-right {
    justify-content: flex-end;
}
.info-layout-section__badge--capsule .info-layout-section__badge-text {
    border-radius: 999px;
    padding: 5px 18px;
    background: var(--badge-tint, var(--brand-accent, #0B679E));
}
.info-layout-section__badge--underline {
    display: block;
    margin: 0 0 .5rem;
}
.info-layout-section__badge--underline.info-layout-section__badge--side-right {
    text-align: right;
}
.info-layout-section__badge--underline.info-layout-section__badge--side-left {
    text-align: left;
}
.info-layout-section__badge--underline .info-layout-section__badge-text {
    display: inline-block;
    color: #0f172a;
    background: transparent;
    border-bottom: 2px solid var(--badge-tint, var(--brand-accent, #0B679E));
    border-radius: 0;
    padding: 0 2px 3px;
}
.info-layout-section__badge--chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 .55rem;
}
.info-layout-section__badge--chips.info-layout-section__badge--side-right {
    justify-content: flex-end;
}
.info-layout-section__badge--chips.info-layout-section__badge--side-left {
    justify-content: flex-start;
}
.info-layout-section__chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    white-space: nowrap;
    text-shadow: none;
}
/* Флажок — на верхнем крае секции (как лента), не внутри поверх заголовка */
.info-layout-section__badge--flag {
    position: absolute;
    top: 10px;
    transform: none;
}
.info-layout-section__badge--flag.info-layout-section__badge--side-left {
    left: 0;
    right: auto;
    transform: none;
}
.info-layout-section__badge--flag.info-layout-section__badge--side-right {
    right: 0;
    left: auto;
    transform: none;
}
.info-layout-section__badge--flag.info-layout-section__badge--side-left .info-layout-section__badge-text {
    border-radius: 0 6px 6px 0;
    padding: 6px 12px 6px 10px;
    background: var(--badge-tint, var(--brand-accent, #0B679E));
}
.info-layout-section__badge--flag.info-layout-section__badge--side-right .info-layout-section__badge-text {
    border-radius: 6px 0 0 6px;
    padding: 6px 10px 6px 12px;
    background: var(--badge-tint, var(--brand-accent, #0B679E));
}
.info-layout-section--badge-flag {
    padding-top: 0;
}
.info-layout-section__badge--stamp {
    position: absolute;
    top: 10px;
}
.info-layout-section__badge--stamp.info-layout-section__badge--side-right {
    right: 12px;
    left: auto;
}
.info-layout-section__badge--stamp.info-layout-section__badge--side-left {
    left: 12px;
    right: auto;
}
.info-layout-section__badge--stamp .info-layout-section__badge-text {
    color: var(--badge-tint, #b91c1c);
    background: transparent;
    border: 2px solid var(--badge-tint, #ef4444);
    border-radius: 4px;
    font-weight: 400;
    letter-spacing: .03em;
    text-transform: uppercase;
    transform: rotate(-6deg);
}
.info-layout-section__badge--banner {
    display: block;
    margin: 0 0 .65rem;
}
.info-layout-section__badge--banner .info-layout-section__badge-text {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 6px;
    padding: 7px 12px;
    background: color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 12%, #fff);
    color: var(--badge-tint, var(--brand-accent, #0B679E));
    border: 1px solid color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 28%, #fff);
}

/* Мягкая заливка цветом */
.info-layout-section__badge--soft .info-layout-section__badge-text {
    color: color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 88%, #000);
    background: color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 14%, #fff);
    border: 1px solid color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 26%, #fff);
}

/* Бирка с вырезом */
.info-layout-section__badge--tag .info-layout-section__badge-text {
    position: relative;
    padding-left: 16px;
    border-radius: 3px 6px 6px 3px;
    background: var(--badge-tint, var(--brand-accent, #0B679E));
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
.info-layout-section__badge--tag.info-layout-section__badge--side-left .info-layout-section__badge-text {
    padding-left: 12px;
    padding-right: 16px;
    border-radius: 6px 3px 3px 6px;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

/* Вкладка внутри секции (не над шапкой) */
.info-layout-section__badge--edge {
    position: absolute;
    top: 10px;
    transform: none;
    margin-top: 0;
}
.info-layout-section__badge--edge .info-layout-section__badge-text {
    border-radius: 6px;
    padding: 4px 12px 5px;
    box-shadow: none;
}
.info-layout-section--badge-edge {
    padding-top: 0;
}

/* Компактный тонкий */
.info-layout-section__badge--slim .info-layout-section__badge-text {
    padding: 2px 9px;
    font-size: 12px;
    letter-spacing: .02em;
    border-radius: 4px;
    background: var(--badge-tint, var(--brand-accent, #0B679E));
}

/* С лёгкой тенью */
.info-layout-section__badge--lift .info-layout-section__badge-text {
    background: var(--badge-tint, var(--brand-accent, #0B679E));
    border-radius: 8px;
    box-shadow:
        0 1px 2px color-mix(in srgb, var(--badge-tint, #0B679E) 25%, transparent),
        0 6px 14px color-mix(in srgb, var(--badge-tint, #0B679E) 18%, transparent);
}

/* Билет с пунктиром */
.info-layout-section__badge--ticket .info-layout-section__badge-text {
    color: color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 90%, #000);
    background: color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 8%, #fff);
    border: 1.5px dashed color-mix(in srgb, var(--badge-tint, var(--brand-accent, #0B679E)) 55%, #fff);
    border-radius: 2px;
    letter-spacing: .03em;
}

.info-layout-section__badge--tinted.info-layout-section__badge--chips .info-layout-section__chip {
    color: color-mix(in srgb, var(--badge-tint) 88%, #000);
    background: color-mix(in srgb, var(--badge-tint) 12%, #fff);
    border-color: color-mix(in srgb, var(--badge-tint) 26%, #e2e8f0);
}
.info-layout-section__badge--tinted.info-layout-section__badge--dot .info-layout-section__badge-text::before {
    background: var(--badge-tint);
}
.info-layout-section__badge--tinted.info-layout-section__badge--accent-bar .info-layout-section__badge-text {
    border-color: var(--badge-tint);
}
.info-layout-section__badge--tinted.info-layout-section__badge--underline .info-layout-section__badge-text {
    border-bottom-color: var(--badge-tint);
}
.info-layout-section__badge--tinted.info-layout-section__badge--info .info-layout-section__badge-text {
    color: color-mix(in srgb, var(--badge-tint) 88%, #000);
    background: color-mix(in srgb, var(--badge-tint) 12%, #fff);
    border-color: color-mix(in srgb, var(--badge-tint) 30%, #fff);
}
.info-layout-section__badge--tinted.info-layout-section__badge--muted .info-layout-section__badge-text {
    color: color-mix(in srgb, var(--badge-tint) 75%, #334155);
    background: color-mix(in srgb, var(--badge-tint) 8%, #f8fafc);
    border-color: color-mix(in srgb, var(--badge-tint) 18%, #e2e8f0);
}
.info-layout-section__badge--tinted.info-layout-section__badge--corner .info-layout-section__badge-text {
    background: var(--badge-tint);
}
.info-layout-section[style] {
    margin-bottom: .65rem;
}
.item-page .info-layout-section[style] .row {
    --bs-gutter-y: .45rem;
    --bs-gutter-x: .7rem;
}
.form-layout-section,
.form-layout-row,
.form-layout-collapsible {
    margin: 0;
}
.form-layout-section[style],
.form-layout-row[style],
.form-layout-collapsible[style] {
    margin-bottom: .25rem;
}
.info-layout-section .row > [class*="col-"],
.info-layout-root > [class*="col-"] {
    min-width: 0;
}
.info-layout-root > .info-layout-block-wrap {
    padding-top: 0;
    padding-bottom: 0;
}
.info-layout-break {
    flex: 0 0 100%;
    width: 100%;
    height: 0;
    margin: 0 0 calc(var(--bs-gutter-y, .5rem) * -1) 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: 0;
}
.item-page .info-layout-root.row,
.item-page .info-layout-section .row,
.item-page .info-layout-row .row,
.item-page .info-layout-collapsible__body .row,
.item-page .info-layout-collapsible__pinned .row,
.item-page .row.g-1 {
    --bs-gutter-y: .25rem;
    --bs-gutter-x: .5rem;
    align-items: flex-start;
}
.item-page .info-layout-root > .info-layout-block-wrap {
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}
.item-page .info-field-cell {
    line-height: 1.35;
}
.item-page .info-field-inner {
    padding: 0;
    font-size: var(--app-font-size);
    overflow: visible;
}
.item-page .info-field-cell--label-hidden,
.item-page .info-field-cell--label-left {
    align-self: stretch;
}
.item-page .info-field-cell--text-center,
.item-page .info-field-cell--text-center .info-field-label,
.item-page .info-field-cell--text-center .info-field-value {
    text-align: center;
}
.item-page .info-field-cell--text-right,
.item-page .info-field-cell--text-right .info-field-label,
.item-page .info-field-cell--text-right .info-field-value {
    text-align: right;
}
.field-col--text-center,
.field-col--text-center .form-label,
.field-col--text-center .form-control,
.field-col--text-center .form-select {
    text-align: center;
}
.field-col--text-right,
.field-col--text-right .form-label,
.field-col--text-right .form-control,
.field-col--text-right .form-select {
    text-align: right;
}
.item-page .info-field-inner[style*="padding"] {
    padding: .3rem .5rem !important;
}
.item-page .info-field-cell .info-field-label,
.item-page .info-field-inner > .info-field-label {
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 4px !important;
    line-height: 1.35;
}
.item-page .info-field-cell .info-field-value {
    font-size: inherit;
    line-height: 1.35;
}
/* Подпись слева: зазор + не даём названию наезжать на значение; иконки не режем */
.item-page .field-form-label-left:not(.field-form-label-left--switch) {
    align-items: center;
    gap: .65rem;
    min-height: 0;
    overflow: visible;
}
.item-page .field-form-label-left:not(.field-form-label-left--switch) .field-form-label-left__label {
    flex: 0 1 auto;
    max-width: 48%;
    min-width: 0;
    min-height: 0;
    align-items: center;
    overflow: hidden;
}
.item-page .field-form-label-left .info-field-label,
.item-page .field-form-label-left .info-field-label.small {
    margin-bottom: 0 !important;
    font-size: inherit;
    line-height: 1.35;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-page .field-form-label-left .info-field-label.field-layout-label--inline,
.item-page .field-form-label-left .field-layout-label-inline {
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    vertical-align: middle;
}
.item-page .field-form-label-left .field-layout-icon,
.item-page .field-form-label-left .field-layout-icon-svg,
.item-page .field-form-label-left .field-layout-icon-svg svg {
    flex-shrink: 0;
    overflow: visible;
}
.item-page .field-form-label-left > .info-field-value {
    flex: 1 1 auto;
    min-width: 4rem;
    line-height: 1.35;
    overflow: visible;
}
.item-page .info-field-cell > .info-field-inner > div:last-child,
.item-page .info-field-cell .info-field-value {
    margin: 0;
}
.item-page .info-layout-spacer {
    padding: 0;
    margin: 0;
    border: 0;
    min-height: 0;
    height: auto;
    align-self: flex-start;
}
.item-page .info-layout-spacer + .info-field-cell {
    align-self: flex-start;
}
.form-layout-gap,
.info-layout-gap {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
    grid-column: 1 / -1;
    pointer-events: none;
}
.item-page .row.g-1 > [class*="col-grid-"] > .info-field-inner,
.item-page .info-layout-section .row > [class*="col-grid-"] > .info-field-inner {
    flex: 0 1 auto;
}
.item-page .info-layout-inline-field__label {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: #95a5a6;
    display: block;
    margin-bottom: 4px;
}
.item-page .info-layout-inline-field__value { font-size: var(--app-font-size); color: #2c3e50; }

.info-layout-collapsible__body .info-layout-section:first-child,
.info-layout-collapsible__body .info-layout-row:first-child { margin-top: 0; }

.card-body { padding: var(--app-card-padding); }

.card-header,
.card-header.py-3,
.card-header.bg-white {
    min-height: 36px;
    padding: 7px var(--app-card-padding) !important;
    background: var(--tblr-bg-surface);
    border-bottom: 1px solid var(--tblr-border-color-translucent);
}

.card-footer {
    padding: 7px var(--app-card-padding);
    background: var(--tblr-bg-surface);
    border-top: 1px solid var(--tblr-border-color-translucent);
}

.card-title { font-size: var(--app-font-size); font-weight: 400; margin-bottom: 0; }

.app-topbar-page-title {
    font-size: var(--app-font-size);
    font-weight: 400;
    color: var(--tblr-body-color);
}

.page-body { padding-top: 8px; padding-bottom: 24px; }

/* Без лишнего Tabler margin-top: подменю или главная с дашбордами. */
body:has(.app-topbar-subnav.is-open) .page-body,
body:has(.dash-layout-root) .page-body {
    margin-top: 0 !important;
    padding-top: 8px !important;
}

/* Страницы отчётов: плотнее шапка и фильтры. */
.page-body:has(.entity-report-filters) .page-header,
.page-body:has(.entity-report-filters) .page-header.mb-3,
.page-body:has(.custom-report__main) .page-header,
.page-body:has(.custom-report__main) .page-header.mb-3 {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

.entity-report-filters.items-filters {
    margin-bottom: 8px;
}

/* Список записей: убрать Tabler margin-top (~1.5rem), оставить лёгкий зазор */
.page-body:has(.app-page-table--fill) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

body:has(.app-page-table--fill) .gsearch-strip:not(.is-open) {
    display: none !important;
    flex: none !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

.page-body:has(.app-page-table--fill) .page-header,
.page-body:has(.app-page-table--fill) .page-header--compact,
.page-body:has(.app-page-table--fill) .page-header.mb-3 {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
}

.page-body:has(.app-page-table--fill) .page-header .row {
    align-items: center;
    min-height: 0;
}

.page-body:has(.app-page-table--fill) .page-header--compact .page-title {
    margin: 0;
    line-height: 1.25;
}

.page-body:has(.app-page-table--fill) .entity-admin-nav-shell {
    margin-bottom: 0.4rem;
}

.page-body:has(.app-page-table--fill) .entity-admin-nav-shell.is-collapsed {
    margin-bottom: 0.25rem;
}

.page-body:has(.app-page-table--fill) .entity-admin-nav {
    margin-bottom: 0;
}

.page-body:has(.app-page-table--fill) .qf-bar {
    margin-bottom: 6px;
}

.page-body:has(.app-page-table--fill) .page-header-actions-right {
    padding-top: 0;
}

.page-body:has(.app-page-table--fill) .page-header-actions-right .service-toolbar {
    margin: 0;
}

.page-body:has(.app-page-table--fill) .items-list-layout--filters-right {
    gap: 12px;
    margin-top: 0;
}

.page-body:has(.app-page-table--fill) .items-list-layout__main > .page-header {
    margin-bottom: 4px !important;
}

.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4,
.page-body h5,
.page-body h6,
.page-body .fw-semibold,
.page-body .fw-bold,
.page-body .fw-medium {
    font-weight: 400 !important;
}

.app-sidebar .nav-link,
.app-sidebar .nav-link.active {
    font-weight: 400;
}

.page-header {
    margin-top: 0 !important;
    margin-bottom: var(--app-section-gap) !important;
}

.page-header--compact {
    margin-bottom: 8px !important;
}

.page-header--crumb-only {
    margin-bottom: 10px !important;
}

.page-header--crumb-only .breadcrumb {
    margin-bottom: 0;
}

.page-header .breadcrumb {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.3;
}

.page-header__subtitle {
    margin: 4px 0 0;
    font-size: var(--app-font-size, 14px);
    line-height: 1.35;
    font-weight: 400;
    color: var(--tblr-secondary-color);
}

.item-page-crumb .breadcrumb,
.breadcrumb.item-page-crumb__list {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.3;
    color: var(--tblr-body-color);
}

.item-page-crumb__entity,
.item-page-crumb__entity a,
.item-page-crumb__title,
.item-page-crumb__title a {
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    color: var(--tblr-body-color);
    text-decoration: none;
}

.item-page-crumb__entity a:hover,
.item-page-crumb__title a:hover {
    color: var(--brand-accent, #0B679E);
}

.item-page-crumb__title {
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
    color: var(--tblr-body-color);
}

.item-page-crumb .breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    float: none;
    padding-right: 0.45rem;
    padding-left: 0.15rem;
    color: color-mix(in srgb, var(--tblr-body-color) 45%, transparent);
    opacity: 1;
}

.page-header__meta {
    font-size: var(--app-font-size-sm);
    font-weight: 400;
    color: var(--tblr-secondary-color);
}

.page-header__meta::before {
    content: '·';
    margin: 0 5px;
    color: var(--tblr-secondary-color);
    opacity: 0.55;
}

.page-title--with-leading {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

.page-title__leading {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.page-title__leading-tools {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.page-title__leading .entity-settings-toolbar,
.page-title__leading .entity-admin-nav-toggle {
    margin: 0;
}

.page-title__leading .entity-settings-toolbar__btn,
.page-title__leading .entity-admin-nav-toggle {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    color: #8292a6;
    border: 0;
    border-radius: 6px;
    background: transparent;
}

.page-title__leading .entity-settings-toolbar__btn:hover,
.page-title__leading .entity-settings-toolbar__btn:focus,
.page-title__leading .entity-settings-toolbar__btn.show,
.page-title__leading .entity-admin-nav-toggle:hover,
.page-title__leading .entity-admin-nav-toggle:focus-visible,
.page-title__leading .entity-admin-nav-toggle.is-open {
    color: var(--brand-accent, #0B679E);
    background: var(--app-table-hover, rgba(11, 103, 158, 0.06));
}

.page-title__leading .entity-admin-nav-toggle__icon,
.page-title__leading .entity-settings-toolbar__btn svg.feather {
    width: 13.5px;
    height: 13.5px;
    min-width: 13.5px;
    display: block;
    margin: 0;
    flex: 0 0 auto;
    stroke-width: 1.75;
}

.page-title__text {
    min-width: 0;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 400;
}

.page-header--compact .page-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
    font-size: 14px;
    line-height: 1.25;
}

.page-header--compact .page-title.page-title--with-leading {
    align-items: center;
    gap: 6px 8px;
}

.page-header--compact .page-title + .text-secondary {
    margin-top: 0;
}

.page-header.mb-3 { margin-bottom: var(--app-section-gap) !important; }

.page-header .row { row-gap: 8px; }

.page-header-actions {
    margin-top: 8px;
}

.page-header-actions--left .table-actions {
    justify-content: flex-start;
}

.page-header-actions-right {
    align-self: center;
    padding-top: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    overflow: visible;
}

.page-header .table-actions .entity-create-btn,
.page-header-actions-right .entity-create-btn {
    align-self: center;
}

/* Вкладки разделов сущности */
.related-entity-cfg {
    padding: 12px 14px;
    border: 1px solid rgba(15, 45, 66, .1);
    border-radius: 8px;
    background: rgba(11, 103, 158, .03);
}

.related-entity-mappings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-entity-mapping-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: center;
}

.related-entity-mapping-row__arrow {
    text-align: center;
    color: #7a93a6;
    font-weight: 600;
}

.related-entity-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-entity-sorts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-entity-sort-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.9fr) 36px;
    gap: 8px;
    align-items: center;
}

.related-display-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-display-fields__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: start;
}

.related-display-fields__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.related-display-fields__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.related-display-fields__in-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--bs-secondary-color, #6c757d);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.related-display-fields__in-label input {
    margin: 0;
}

.related-display-fields__nested {
    padding: 8px 10px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 6px;
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.related-display-fields__nested-label {
    font-size: 12px;
    color: var(--bs-secondary-color, #6c757d);
    margin-bottom: 6px;
}

.related-display-fields__nested-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.related-display-fields__nested-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
}

.related-display-fields__nested-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
}

.related-display-fields__nested-in-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    color: var(--bs-secondary-color, #6c757d);
    cursor: pointer;
}

.related-display-fields__nested-search input,
.related-display-fields__nested-in-label input {
    margin: 0;
}

.related-entity-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(110px, 0.7fr) minmax(130px, 0.8fr) minmax(0, 1fr) 36px;
    gap: 8px;
    align-items: start;
}

.related-entity-filter-row__value {
    min-width: 0;
}

.related-entity-filter-picker .users-picker {
    width: 100%;
}

.related-entity-filter-picker .users-picker__control {
    min-height: var(--app-control-height, 30px);
}

.related-entity-picker {
    position: relative;
}

.related-multi-picker {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-multi-picker__row {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.related-multi-picker__row .related-multi-picker__control {
    flex: 1 1 auto;
    min-width: 0;
}

.related-multi-picker__create[hidden] {
    display: none !important;
}

.related-multi-picker__control {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.related-multi-picker__control--chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: var(--app-control-height, 30px);
    padding: 5px 8px;
    border: 1px solid var(--tblr-border-color, rgba(15, 45, 66, .14));
    border-radius: var(--app-control-radius, 6px);
    background: #fff;
}

.related-multi-picker__control--chips:focus-within {
    border-color: var(--brand-accent, #0B679E);
    box-shadow: none;
}

.related-multi-picker__chips {
    display: contents;
}

.related-multi-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(100%, 28rem);
    padding: 4px 8px 4px 10px;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #d0d5dd) 80%, #94a3b8);
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary, #f1f5f9) 88%, #fff);
    color: #334155;
    font-size: 14px;
    line-height: 1.35;
}

.related-multi-picker__chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-weight: 400;
}

.related-multi-picker__chip-remove {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.related-multi-picker__chip-remove:hover {
    color: #0f172a;
}

.related-multi-picker__control--chips .related-multi-picker__search {
    flex: 1 1 140px;
    min-width: 120px;
    border: 0;
    padding: 4px 4px;
    box-shadow: none;
    outline: none;
    background: transparent;
    height: auto;
    min-height: 22px;
}

.related-multi-picker__search {
    padding-right: 2rem;
}

.related-multi-picker.is-chosen .related-multi-picker__search,
.related-multi-picker.is-chosen .related-multi-picker__search:focus {
    caret-color: transparent;
    cursor: default;
    background: #f4f7fa;
    border-color: #d5e0e8;
    box-shadow: none;
    color: #1e293b;
}

.related-multi-picker__search.is-unresolved {
    color: #c62828;
}

.related-multi-picker__option.is-selected {
    color: #8aa0b0;
    cursor: default;
}

.related-multi-picker__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #8aa0b0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.related-multi-picker__clear:hover {
    color: #334155;
}

.related-multi-picker__suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 30;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #d5e0e8;
    border-radius: var(--tblr-border-radius, .375rem);
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 42, 61, .12);
}

.related-multi-picker__suggest--portal {
    position: fixed;
    right: auto;
    z-index: 2060;
}

.related-multi-picker__suggest[hidden] {
    display: none !important;
}

.related-multi-picker__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 12px;
    cursor: pointer;
    color: #142833;
}

.related-multi-picker__option-label {
    flex: 1 1 auto;
    min-width: 0;
}

.related-multi-picker__option-check {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: #0b679e;
    opacity: .95;
}

.related-multi-picker__option-check svg {
    width: 14px;
    height: 12px;
    display: block;
}

.related-multi-picker__option.is-selected .related-multi-picker__option-check {
    opacity: 1;
}

.related-multi-picker__option:hover,
.related-multi-picker__option:focus {
    background: rgba(11, 103, 158, 0.08);
}

.related-multi-picker__empty {
    padding: 8px 10px 10px;
    color: #8aa0b0;
    font-size: 13px;
}

.related-multi-picker__empty-text {
    padding: 2px 2px 8px;
}

.related-multi-picker__create-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(11, 103, 158, 0.06);
    color: var(--brand-accent, #0b679e);
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}

.related-multi-picker__create-option:hover,
.related-multi-picker__create-option:focus {
    background: rgba(11, 103, 158, 0.12);
    outline: none;
}

.related-multi-picker__create-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.9;
}

.related-multi-picker__create-option-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.related-multi-picker__create-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.related-entity-picker__row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.numeric-quick {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
}

.numeric-quick__input {
    position: relative;
    flex: 0 0 auto;
    flex-shrink: 0;
    width: var(--numeric-quick-input-width, 5.5rem);
    min-width: 3rem;
    max-width: 100%;
}

.numeric-quick__input.is-resizing {
    user-select: none;
}

.numeric-quick__input .form-control {
    width: 100%;
    min-width: 0;
}

.numeric-quick__resize {
    display: none;
    position: absolute;
    top: 0;
    right: -5px;
    bottom: 0;
    width: 10px;
    cursor: ew-resize;
    z-index: 3;
    touch-action: none;
}

.numeric-quick__resize::after {
    content: '';
    position: absolute;
    top: 22%;
    bottom: 22%;
    right: 3px;
    width: 2px;
    border-radius: 1px;
    background: color-mix(in srgb, var(--tblr-border-color, #d8dee6) 90%, #64748b);
    opacity: 0;
    transition: opacity .15s ease, background .15s ease;
}

.numeric-quick__input:hover .numeric-quick__resize::after,
.numeric-quick__input.is-resizing .numeric-quick__resize::after {
    opacity: 1;
}

.numeric-quick__options {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 3px;
    border-radius: var(--app-control-radius, 6px);
    background: color-mix(in srgb, var(--tblr-border-color, #d8dee6) 28%, #fff);
    box-shadow: inset 0 1px 2px rgba(15, 45, 66, .06);
}

.numeric-quick__btn {
    appearance: none;
    margin: 0;
    padding: 4px 11px;
    min-height: calc(var(--app-control-height, 30px) - 6px);
    border: 0;
    border-radius: calc(var(--app-control-radius, 6px) - 2px);
    background: transparent;
    color: var(--tblr-secondary-color, #64748b);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.numeric-quick__btn:hover:not(.is-active) {
    color: var(--tblr-body-color, #334155);
    background: color-mix(in srgb, #fff 55%, transparent);
}

.numeric-quick__btn.is-active {
    background: #fff;
    color: var(--tblr-body-color, #1e293b);
    font-weight: 500;
    box-shadow:
        0 1px 2px rgba(15, 45, 66, .08),
        0 3px 10px rgba(15, 45, 66, .14);
}

.numeric-quick__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0b679e) 30%, transparent);
}

.numeric-quick__btn.is-active:focus-visible {
    box-shadow:
        0 1px 2px rgba(15, 45, 66, .08),
        0 3px 10px rgba(15, 45, 66, .14),
        0 0 0 2px color-mix(in srgb, var(--brand-accent, #0b679e) 30%, transparent);
}

.field-numeric--negative,
.field-numeric-value--negative {
    color: #c62828;
}

input.field-numeric--negative {
    color: #c62828;
}

.field-input-copy {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.field-input-copy__control {
    flex: 1 1 auto;
    min-width: 0;
}

.field-input-copy__btn {
    flex: 0 0 auto;
    align-self: stretch;
    width: var(--app-control-height);
    min-width: var(--app-control-height);
    height: auto;
    min-height: var(--app-control-height);
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    box-shadow: none;
    border-radius: var(--tblr-border-radius, 0.375rem);
}

.field-input-copy__btn:hover,
.field-input-copy__btn:focus {
    background: rgba(11, 103, 158, 0.06);
    border-color: transparent;
    color: var(--brand-accent, #0b679e);
}

.field-input-copy__btn.is-copied {
    color: #1f7a58;
    background: color-mix(in srgb, #2f9e74 12%, transparent);
}

.field-input-copy__btn svg,
.field-input-copy__svg {
    width: 16px;
    height: 16px;
    display: inline-flex;
}

.field-input-copy__svg svg {
    width: 16px;
    height: 16px;
}

.related-entity-picker__row .related-entity-picker__control {
    flex: 1 1 auto;
    min-width: 0;
}

.related-entity-picker__create {
    flex: 0 0 auto;
    align-self: stretch;
    width: var(--app-control-height);
    min-width: var(--app-control-height);
    height: auto;
    min-height: var(--app-control-height);
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    box-shadow: none;
    border-radius: var(--tblr-border-radius, 0.375rem);
}

.related-entity-picker__create:hover,
.related-entity-picker__create:focus {
    background: rgba(11, 103, 158, 0.06);
    border-color: transparent;
    color: #475569;
    box-shadow: none;
}

.related-entity-picker__create:focus-visible {
    outline: 2px solid rgba(11, 103, 158, 0.28);
    outline-offset: 1px;
}

.related-entity-picker__create svg {
    display: block;
    width: 15px;
    height: 15px;
}

.auto-number-field__control {
    display: flex;
    align-items: stretch;
    gap: 0;
    max-width: 420px;
}

.auto-number-field__free {
    max-width: 420px;
}

.auto-number-field__free-input-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.auto-number-field__free-input-wrap > .auto-number-field__free-input {
    padding-right: 2.35rem;
}

.auto-number-field__restore {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.auto-number-field__restore:hover {
    color: var(--tblr-primary, #0b679e);
    background: rgba(11, 103, 158, 0.08);
}

.auto-number-field__restore:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--tblr-primary, #0b679e) 35%, transparent);
    outline-offset: 1px;
}

.auto-number-field__restore .icon-svg,
.auto-number-field__restore svg {
    display: block;
    width: 15px;
    height: 15px;
}

.auto-number-field__prefix,
.auto-number-field__sep {
    display: inline-flex;
    align-items: center;
    padding: 0 0.7rem;
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    border: 1px solid var(--tblr-border-color, rgba(15, 45, 66, .14));
    color: #475569;
    font-size: 13px;
    white-space: nowrap;
}

.auto-number-field__prefix {
    border-radius: var(--app-control-radius, 0.375rem) 0 0 var(--app-control-radius, 0.375rem);
    border-right: 0;
    min-width: 3.5rem;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
    font-weight: 400;
    margin: 0;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.auto-number-field__prefix:disabled {
    opacity: 1;
    cursor: default;
}

.auto-number-field__prefix--clickable,
.auto-number-field__sep--clickable {
    cursor: pointer;
}

.auto-number-field__prefix--clickable:hover,
.auto-number-field__sep--clickable:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.auto-number-field__prefix--clickable:focus-visible {
    outline: 2px solid var(--tblr-primary, #206bc4);
    outline-offset: -2px;
    z-index: 1;
}

.auto-number-field__sep {
    border-left: 0;
    border-right: 0;
    padding: 0 0.35rem;
    color: #94a3b8;
}

.auto-number-field__number {
    border-radius: 0 var(--app-control-radius, 0.375rem) var(--app-control-radius, 0.375rem) 0;
    max-width: 140px;
}

.auto-number-field__hint {
    margin-top: 0.35rem;
}

.auto-number-field.is-unique-err .auto-number-field__prefix,
.auto-number-field.is-unique-err .auto-number-field__sep,
.auto-number-field.is-unique-err .auto-number-field__number {
    border-color: var(--tblr-danger, #d63939);
    color: var(--tblr-danger, #d63939);
}

.auto-number-field.is-unique-ok .auto-number-field__prefix,
.auto-number-field.is-unique-ok .auto-number-field__sep,
.auto-number-field.is-unique-ok .auto-number-field__number {
    border-color: var(--tblr-success, #2fb344);
}

.related-entity-picker__control {
    position: relative;
}

.related-entity-picker__control--chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: var(--app-control-height, 30px);
    padding: 5px 8px;
    border: 1px solid var(--tblr-border-color, rgba(15, 45, 66, .14));
    border-radius: var(--app-control-radius, 6px);
    background: #fff;
}

.related-entity-picker__control--chips:focus-within {
    border-color: var(--brand-accent, #0B679E);
    box-shadow: none;
}

.related-entity-picker__chips {
    display: contents;
}

.related-entity-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(100%, 28rem);
    padding: 4px 8px 4px 10px;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #d0d5dd) 80%, #94a3b8);
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary, #f1f5f9) 88%, #fff);
    color: #334155;
    font-size: 14px;
    line-height: 1.35;
}

.related-entity-picker__chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-weight: 400;
}

.related-entity-picker__chip-remove {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.related-entity-picker__chip-remove:hover {
    color: #0f172a;
}

.related-entity-picker__control--chips .related-entity-picker__search {
    flex: 1 1 140px;
    min-width: 120px;
    border: 0;
    padding: 4px 4px;
    box-shadow: none;
    outline: none;
    background: transparent;
    height: auto;
    min-height: 26px;
    font-size: 14px;
    line-height: 1.35;
}

.related-entity-picker__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #7a93a6;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    z-index: 2;
}

.related-entity-picker__search {
    padding-right: 2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-entity-picker__search.is-unresolved,
.related-multi-picker__search.is-unresolved {
    color: #c62828;
}

.related-entity-picker__search.is-unresolved::placeholder,
.related-multi-picker__search.is-unresolved::placeholder {
    color: inherit;
    opacity: 0.55;
}

.related-entity-picker__control--chips .related-entity-picker__search {
    padding-right: 4px;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.related-entity-picker__suggest,
.related-entity-picker__suggest--portal {
    z-index: 2060;
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(15, 45, 66, .14);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 45, 66, .12);
}

.related-entity-picker__suggest:not(.related-entity-picker__suggest--portal) {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
}

.related-entity-picker__suggest--portal {
    position: fixed;
}

.related-entity-picker__suggest[hidden] {
    display: none !important;
}

.related-entity-picker__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 9px 12px;
    font-size: 14px;
    color: #16324a;
    cursor: pointer;
}

.related-entity-picker__option-label {
    flex: 1 1 auto;
    min-width: 0;
}

.related-entity-picker__option-check {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    color: #0b679e;
    opacity: .95;
}

.related-entity-picker__option-check svg {
    width: 14px;
    height: 12px;
    display: block;
}

.related-entity-picker__option:hover,
.related-entity-picker__option:focus,
.related-entity-picker__option.is-active {
    background: rgba(11, 103, 158, .08);
    outline: none;
}

.related-entity-picker__option.is-selected,
.related-entity-picker__option:disabled {
    opacity: .72;
    cursor: default;
}

.related-entity-picker__option.is-selected .related-entity-picker__option-check {
    opacity: 1;
}

.related-entity-picker__empty {
    padding: 8px 10px 10px;
    font-size: 13px;
    color: #7a93a6;
}

.related-entity-picker__empty-text {
    padding: 2px 2px 8px;
}

.related-entity-picker__create-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: rgba(11, 103, 158, 0.06);
    color: var(--brand-accent, #0b679e);
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    transition: background .12s ease;
}

.related-entity-picker__create-option:hover,
.related-entity-picker__create-option:focus {
    background: rgba(11, 103, 158, 0.12);
    outline: none;
}

.related-entity-picker__create-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.9;
}

.related-entity-picker__create-option-icon svg {
    display: block;
    width: 16px;
    height: 16px;
}

.related-entity-picker__create-option-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

@media (max-width: 700px) {
    .related-entity-mapping-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .related-entity-mapping-row__arrow {
        display: none;
    }

    .related-entity-filter-row {
        grid-template-columns: 1fr;
    }
}


.entity-admin-nav {
    position: relative;
    z-index: 30;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.entity-admin-nav-shell {
    position: relative;
    z-index: 30;
    margin: 0 0 1.1rem;
    display: flex;
    align-items: flex-start;
}

.entity-admin-nav-shell.is-collapsed {
    margin-bottom: 0.55rem;
}

.entity-admin-nav-shell.is-collapsed .entity-admin-nav {
    display: none;
}

.entity-admin-nav-shell:not(.is-collapsed) .entity-admin-nav-shell__reveal {
    display: none;
}

/* В настройках сущности меню всегда развёрнуто — без pill и кнопки свернуть */
.entity-admin-nav-shell--always-open .entity-admin-nav-shell__reveal,
.entity-admin-nav-shell--always-open .entity-admin-nav__collapse {
    display: none !important;
}

.entity-admin-nav-shell--always-open {
    margin-bottom: 1.1rem;
}

.entity-admin-nav-shell--always-open .entity-admin-nav {
    display: block;
}

/* Если переключатель уже в шапке рядом с «Настройки сущности» — pill не дублируем */
body:has(.page-title__leading .js-entity-admin-nav-toggle) .entity-admin-nav-shell__reveal {
    display: none !important;
}

body:has(.page-title__leading .js-entity-admin-nav-toggle) .entity-admin-nav-shell.is-collapsed {
    margin-bottom: 0;
    min-height: 0;
}

.entity-admin-nav-shell__reveal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 10px;
    border: 1px solid rgba(15, 45, 66, .12);
    border-radius: 999px;
    background: linear-gradient(180deg, #fff 0%, #f7fafc 100%);
    color: #5a7388;
    font-size: var(--app-font-size);
    font-weight: 500;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.entity-admin-nav-shell__reveal:hover,
.entity-admin-nav-shell__reveal:focus-visible {
    color: #0B679E;
    border-color: rgba(11, 103, 158, .28);
    background: #fff;
    box-shadow: 0 2px 8px rgba(11, 103, 158, .1);
    outline: none;
}

.entity-admin-nav-shell__reveal-icon {
    width: 15px;
    height: 15px;
    min-width: 15px;
    stroke-width: 2;
    opacity: .9;
}

.entity-admin-nav-shell__reveal-chevron {
    width: 14px;
    height: 14px;
    min-width: 14px;
    stroke-width: 2;
    opacity: .45;
    margin-left: 2px;
}

.entity-admin-nav-shell__reveal:hover .entity-admin-nav-shell__reveal-chevron {
    opacity: .75;
}

.entity-admin-nav__collapse {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 32px;
    height: auto;
    padding: 10px 8px;
    border: 0;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: #8a9aab;
    cursor: pointer;
}

.entity-admin-nav__collapse:hover,
.entity-admin-nav__collapse:focus-visible {
    color: #0B679E;
    outline: none;
}

.entity-admin-nav__collapse-icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    stroke-width: 2;
    opacity: .7;
}

.entity-admin-nav__scroll {
    display: flex;
    align-items: stretch;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(15, 45, 66, .12);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.entity-admin-nav__tab,
.entity-admin-nav__group-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 400;
    color: #5a7388;
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    box-shadow: none;
}

.entity-admin-nav__icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    stroke-width: 1.75;
    flex: 0 0 auto;
    display: block;
    vertical-align: 0;
    opacity: .85;
}

.entity-admin-nav__icon.icon-svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
}

.entity-admin-nav__dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 400;
    color: #334155;
}

.entity-admin-nav__dropdown-item .entity-admin-nav__icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-right: 0 !important;
    opacity: .85;
}

.entity-admin-nav__dropdown-item .entity-admin-nav__icon.icon-svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-width: 16px;
}

.entity-admin-nav__tab:hover,
.entity-admin-nav__group-btn:hover,
.entity-admin-nav__group-btn:focus,
.entity-admin-nav__group-btn.show {
    color: #0B679E;
    text-decoration: none;
    background: transparent;
    box-shadow: none;
    outline: none;
}

.entity-admin-nav__tab.is-active,
.entity-admin-nav__group-btn.is-active {
    color: #0B679E;
    font-weight: 400;
    border-bottom-color: #0B679E;
}

.entity-admin-nav__group {
    position: relative;
    flex: 0 0 auto;
}

.entity-admin-nav__group-btn {
    cursor: pointer;
}

.entity-admin-nav__group-btn.dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: 0.15em;
    opacity: .45;
}

.entity-admin-nav .dropdown.show > .entity-admin-nav__dropdown,
.dropdown-menu.entity-admin-nav__dropdown.show {
    display: block !important;
}

.entity-admin-nav__dropdown {
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    z-index: 2050;
}

.entity-admin-nav__dropdown-caption {
    padding: 4px 10px 8px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #8a9aab;
}

.entity-admin-nav__dropdown-item:hover,
.entity-admin-nav__dropdown-item:focus {
    background: var(--app-table-hover, #f1f5f9);
    color: #0B679E;
}

.entity-admin-nav__dropdown-item.is-active {
    color: #0B679E;
    font-weight: 400;
    background: rgba(11, 103, 158, .06);
}

.item-page-documents__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.item-page-documents__btn .icon-svg,
.item-page-documents__btn svg.feather {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: inherit;
}

.item-page-reports__btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.item-page-reports__btn svg.feather {
    width: 15px;
    height: 15px;
}
.item-page-reports .dropdown-menu {
    min-width: min(280px, calc(100vw - 24px));
    padding: .35rem 0;
}
.item-page-reports-group {
    max-width: 100%;
}
.item-page-reports__quick {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: min(100%, 28rem);
    white-space: normal;
    text-align: left;
    line-height: 1.25;
    height: auto;
    min-height: calc(1.5em + .5rem + 2px);
    padding-top: .25rem;
    padding-bottom: .25rem;
}
.item-page-reports__quick > span {
    min-width: 0;
}
.item-page-reports__quick-icon,
.item-page-reports__quick-icon svg,
.item-page-reports__quick-icon .icon-svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}
.item-page-reports__quick-icon--svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.item-page-reports__quick-icon--svg svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}
.item-page-reports__quick.active {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), .08);
}

.item-page-documents .dropdown-menu {
    /* Не уже кнопки «Печатные формы»; длиннее текст — шире по содержимому */
    --bs-dropdown-min-width: 100%;
    min-width: 100%;
    width: max-content;
    max-width: min(360px, calc(100vw - 24px));
    padding: .25rem .4rem .25rem .25rem;
    overflow: visible;
}

.item-page-documents__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    width: max-content;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: .35rem .75rem .35rem .65rem;
    margin: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    white-space: nowrap;
    overflow: visible;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 400;
    line-height: 1.35;
}

button.item-page-documents__row {
    appearance: none;
    -webkit-appearance: none;
}

.item-page-documents__row:hover,
.item-page-documents__row:focus,
.item-page-documents__row:focus-visible {
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    color: inherit;
    outline: none;
}

.item-page-documents__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--app-font-size);
    font-weight: 400;
    line-height: 1.35;
}

.item-page-documents__formats {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    overflow: visible;
    margin-left: auto;
    padding-right: 2px;
    color: #7a93a6;
    line-height: 0;
}

.item-page-documents__row:hover .item-page-documents__formats,
.item-page-documents__row:focus-visible .item-page-documents__formats {
    color: #5a7388;
}

.item-page-documents__fmt {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: inherit;
    text-decoration: none;
    line-height: 0;
    overflow: visible;
    pointer-events: none;
}

.item-page-documents__fmt.is-static {
    pointer-events: none;
}

.item-page-documents__formats svg,
.item-page-documents__formats .icon-svg,
.item-page-documents__formats .item-page-documents__fmt-icon,
.item-page-documents__fmt-icon,
.item-page-documents__fmt > svg,
.item-page-documents__fmt svg.feather,
.item-page-documents__fmt .icon-svg {
    display: block;
    width: 13.5px !important;
    height: 13.5px !important;
    min-width: 13.5px;
    min-height: 13.5px;
    max-width: 13.5px;
    max-height: 13.5px;
    margin: 0;
    flex: 0 0 auto;
    color: inherit;
    overflow: visible;
}

.item-page-documents__formats svg.feather {
    stroke-width: 1.25 !important;
}

.print-form-preview-modal .modal-body {
    background: #e8eef3;
}

.print-form-preview-modal__frame {
    display: block;
    width: 100%;
    height: min(72vh, 820px);
    border: 0;
    background: #fff;
}

.page-title,
h1.page-title,
h2.page-title {
    margin-bottom: 0;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0;
}

.page-title.mb-3,
h1.page-title.mb-3,
h2.page-title.mb-3 { margin-bottom: 0 !important; }

.page-title .text-muted,
.page-title small {
    font-size: var(--app-font-size);
    font-weight: 400;
}

.breadcrumb {
    margin-bottom: 2px;
    font-size: 14px;
    line-height: 1.3;
    background: none;
    box-shadow: none;
    user-select: none;
}

.breadcrumb-item,
.breadcrumb-item.active {
    font-weight: 400;
    color: var(--tblr-body-color);
    background: none;
    box-shadow: none;
    text-shadow: none;
}

.breadcrumb-item a {
    font-weight: 400;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--brand-accent);
}

.breadcrumb ::selection {
    background: transparent;
    color: inherit;
}

.badge { font-size: 11px; line-height: 1.35; padding: 4px 8px; border-radius: 6px; font-weight: 500; }

.app-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 999px;
    white-space: nowrap;
    vertical-align: middle;
}

.app-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.app-status--on {
    background: #eef6f1;
    color: #1f6b3f;
}

.app-status--on::before {
    background: #34a853;
    box-shadow: 0 0 0 2px rgba(52, 168, 83, 0.18);
}

.app-status--off {
    background: #f3f4f6;
    color: #64748b;
}

.app-status--off::before {
    background: #94a3b8;
}

/* Остальные badge — без конфликта цвета Tabler secondary на цветном фоне */
.badge.bg-success,
.badge.text-bg-success {
    background-color: #eef6f1 !important;
    color: #1f6b3f !important;
    border: none;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
    background-color: #f3f4f6 !important;
    color: #64748b !important;
    border: none;
}

.badge.bg-danger,
.badge.text-bg-danger {
    background-color: #fef2f2 !important;
    color: #b42318 !important;
    border: none;
}

.badge.bg-warning,
.badge.text-bg-warning {
    background-color: #fff8eb !important;
    color: #9a5b13 !important;
    border: none;
}

.badge.bg-info,
.badge.text-bg-info {
    background-color: #eff6ff !important;
    color: #1d5fad !important;
    border: none;
}

.subheader {
    margin-bottom: var(--app-section-gap);
    color: var(--tblr-secondary-color);
    font-size: var(--app-font-size-sm);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

/* Подсказки и ошибки — один компактный вид на всех страницах. */
.alert {
    padding: 8px 12px;
    margin-bottom: var(--app-section-gap);
    border-radius: var(--app-control-radius);
    font-size: var(--app-font-size);
    line-height: 1.4;
}

.alert.small,
.alert-sm {
    padding: 6px 10px;
    font-size: var(--app-font-size-sm);
}

.alert .small { font-size: var(--app-font-size-sm); }

.alert strong { font-weight: 600; }

/* Список записей (режим list) и прочие list-group. */
.list-group { font-size: var(--app-font-size); }

.list-group-item {
    padding: 8px var(--app-card-padding);
    border-color: var(--tblr-border-color-translucent);
}

.list-group-flush > .list-group-item { padding-left: 0; padding-right: 0; }

/* Вкладки форм — как вкладки сущности (.entity-admin-nav): линия снизу, без «коробки». */
.nav-tabs {
    gap: 4px;
    margin-bottom: var(--app-section-gap);
    border-bottom: 1px solid rgba(15, 45, 66, .12);
    background: transparent;
    padding: 0;
}

.nav-tabs .nav-link {
    width: auto;
    max-width: none;
    min-width: 0;
    height: auto;
    margin: 0;
    margin-bottom: -1px;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: #5a7388;
    background: transparent;
    font-size: var(--app-font-size);
    font-weight: 400;
    line-height: 1.25;
    box-shadow: none;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus,
.nav-tabs .nav-link:focus-visible {
    color: #0B679E;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    outline: none;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link.active:hover,
.nav-tabs .nav-link.active:focus,
.nav-tabs .nav-item.show .nav-link {
    color: #0B679E;
    background: transparent;
    border: none;
    border-bottom: 1px solid #0B679E;
    font-weight: 400;
}

/* Не даём общим .nav-tabs сбить рамку у закладок на странице записи / в форме. */
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link:hover,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link:focus,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link:focus-visible,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active:hover,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active:focus {
    border-top: 0.5px solid #d8d8d8 !important;
    border-left: 0.5px solid #d8d8d8 !important;
    border-right: none !important;
    border-bottom: 0.5px solid #d8d8d8 !important;
    margin-bottom: -1px !important;
    background: #fbfbfb;
    color: #999;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:last-child .nav-link,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:last-child .nav-link:hover,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-item:last-child .nav-link.active {
    border-right: 0.5px solid #d8d8d8 !important;
}
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active:hover,
.info-layout-tabs .nav.nav-tabs.info-layout-tabs__nav .nav-link.active:focus {
    border-right: 0.5px solid #d8d8d8 !important;
    border-bottom-color: #fff !important;
    background: #fff !important;
    color: #000 !important;
}

/* Устаревший boxed — оставлен на случай старой разметки, визуально как обычные вкладки. */
.nav-tabs.nav-tabs--boxed {
    gap: 4px !important;
    border-bottom: 1px solid rgba(15, 45, 66, .12) !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-bottom: var(--app-section-gap);
}

.nav-tabs.nav-tabs--boxed > .nav-item {
    margin: 0 !important;
}

.nav-tabs.nav-tabs--boxed .nav-link,
.nav-tabs.nav-tabs--boxed .nav-link:hover,
.nav-tabs.nav-tabs--boxed .nav-link:focus,
.nav-tabs.nav-tabs--boxed .nav-link:focus-visible,
.nav-tabs.nav-tabs--boxed .nav-link.active,
.nav-tabs.nav-tabs--boxed .nav-link.active:hover,
.nav-tabs.nav-tabs--boxed .nav-link.active:focus,
.nav-tabs.nav-tabs--boxed .nav-link.active:focus-visible,
.nav-tabs.nav-tabs--boxed .nav-item.show .nav-link {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    margin-bottom: -1px !important;
    padding: 10px 12px !important;
    border: none !important;
    border-bottom: 1px solid transparent !important;
    border-radius: 0 !important;
    color: #5a7388 !important;
    background: transparent !important;
    font-weight: 400 !important;
    box-shadow: none !important;
}

.nav-tabs.nav-tabs--boxed .nav-link:hover,
.nav-tabs.nav-tabs--boxed .nav-link:focus,
.nav-tabs.nav-tabs--boxed .nav-link:focus-visible {
    color: #0B679E !important;
}

.nav-tabs.nav-tabs--boxed .nav-link.active,
.nav-tabs.nav-tabs--boxed .nav-link.active:hover,
.nav-tabs.nav-tabs--boxed .nav-link.active:focus,
.nav-tabs.nav-tabs--boxed .nav-link.active:focus-visible,
.nav-tabs.nav-tabs--boxed .nav-item.show .nav-link {
    color: #0B679E !important;
    border-bottom-color: #0B679E !important;
}

/* Пагинация вне DataTables — та же геометрия, что у .page-link в таблицах. */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 0;
    gap: 4px;
    max-width: 100%;
    row-gap: 4px;
}

.app-pagination-nav {
    max-width: 100%;
    overflow: hidden;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--app-control-height);
    height: var(--app-control-height);
    padding: 0 10px;
    border-radius: var(--app-control-radius) !important;
    font-size: var(--app-font-size);
    line-height: 1;
    box-shadow: none;
}

.page-item.active .page-link {
    background: var(--tblr-primary);
    border-color: var(--tblr-primary);
}

/* Пустые inline-сообщения (legacy). */
.card-body.text-center.text-muted.py-4,
.card-body.text-center.text-muted.py-5 {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
    color: var(--tblr-secondary-color) !important;
    font-size: var(--app-font-size);
}

/* Legacy Bootstrap-разметка форм. */
.form-group { margin-bottom: var(--app-section-gap); }

/* Поля с иконкой (логин, профиль). */
.input-icon .form-control { padding-left: 36px; }

.input-icon-addon {
    color: var(--tblr-secondary-color);
}

.input-icon-addon svg.feather {
    width: 16px;
    height: 16px;
}

/* Inline-code в тексте и таблицах. */
code {
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .92em;
    background: var(--tblr-bg-surface-secondary);
    color: inherit;
}

code.column-name {
    padding: 1px 5px;
    border-radius: 4px;
}

/* Служебная строка таблицы (админ-группа и т.п.). */
.table tbody tr.table-light,
.table tbody tr.table-light td {
    background: #f0f4f8 !important;
    color: #64748b;
}

/* Topbar: круглые ghost-кнопки совпадают с .btn-icon. */
.app-topbar .btn-icon.rounded-circle {
    width: var(--app-control-height);
    height: var(--app-control-height);
}

.app-topbar .navbar-nav .nav-link {
    font-size: var(--app-font-size);
}

.app-topbar .badge.bg-yellow {
    font-size: 9px;
    font-weight: 400;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    padding: 0;
    border-radius: 3px;
    color: #fff;
    top: -2px !important;
    right: -4px !important;
}

/* Минималистичная панель действий в шапке */
.app-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
    position: relative;
    z-index: 3;
    margin-left: auto;
    padding-left: 14px;
    align-self: stretch;
    background: transparent;
    box-shadow: none;
}

.app-topbar-actions > .dropdown {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
}

.app-topbar-square-btn {
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none;
    border-radius: 0;
    background: transparent !important;
    color: var(--tblr-secondary-color);
    box-shadow: none !important;
    outline: none;
    transition: color .15s ease;
}

.app-topbar-square-btn:hover {
    border-color: transparent;
    background: transparent !important;
    color: var(--tblr-body-color);
}

.app-topbar-square-btn:focus,
.app-topbar-square-btn:focus-visible,
.app-topbar-square-btn.show,
.app-topbar-square-btn:active,
.app-topbar-square-btn.is-active {
    border-color: transparent;
    background: transparent !important;
    color: var(--tblr-body-color);
    box-shadow: none !important;
    outline: none;
}

.app-topbar-square-btn svg.feather,
.app-topbar-square-btn .icon-svg,
.app-topbar-square-btn > svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

.app-topbar-square-btn > *,
.app-topbar-profile-chip > * {
    pointer-events: none;
}

.app-topbar-profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--tblr-body-color);
    text-decoration: none;
    line-height: 1;
    box-shadow: none !important;
    outline: none;
    cursor: pointer;
    font: inherit;
    transition: color .15s ease;
}

.app-topbar-profile-chip:hover {
    border-color: transparent;
    background: transparent;
    color: var(--tblr-body-color);
    text-decoration: none;
}

.app-topbar-profile-chip:focus,
.app-topbar-profile-chip:focus-visible,
.app-topbar-profile-chip:active,
.app-topbar-profile-chip.show,
.dropdown.show > .app-topbar-profile-chip,
.app-topbar-profile-chip[aria-expanded="true"] {
    border-color: transparent;
    background: transparent;
    color: var(--tblr-body-color);
    text-decoration: none;
    box-shadow: none !important;
    outline: none;
}

.dropdown.show > .app-topbar-profile-chip {
    z-index: 1;
}

.app-topbar-avatar {
    flex: 0 0 auto;
}

.app-topbar-avatar--img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}

.app-topbar-username {
    font-size: var(--app-font-size);
    font-weight: 400;
    color: var(--tblr-body-color);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-topbar-chevron {
    width: 13px;
    height: 13px;
    color: var(--tblr-secondary-color);
    flex: 0 0 auto;
}

.app-topbar-profile-chip.dropdown-toggle::after {
    display: none;
}

@media (max-width: 575.98px) {
    .app-topbar-profile-chip {
        padding-right: 0;
    }
}

/* --- Таблицы: DataTables 3 + лёгкий современный слой поверх Tabler --- */
table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    border-collapse: collapse;
}

table.dataTable td,
table.dataTable th {
    box-sizing: border-box;
}

/* Tabler по умолчанию делает thead UPPERCASE и «офисную» сетку — переопределяем */
.table thead th {
    text-transform: none;
    letter-spacing: 0;
}

.app-page-table .table,
.dt-container .table {
    --bs-table-border-color: var(--app-table-border);
    --bs-table-striped-bg: var(--app-table-zebra);
    --bs-table-hover-bg: var(--app-table-hover);
    margin-bottom: 0;
    font-size: var(--app-font-size);
    line-height: 1.25;
}

.app-page-table .table > :not(caption) > * > *,
.dt-container .table > :not(caption) > * > * {
    border-width: 0 0 1px;
    border-color: var(--app-table-border);
    padding: var(--app-table-padding-y) var(--app-table-padding-x);
    vertical-align: middle;
    box-shadow: none;
}

.app-page-table .table > tbody > tr > td,
.dt-container .table > tbody > tr > td,
table.dataTable > tbody > tr > td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Дата/время в таблицах: дата обычная, время — «вдавленная» плашка */
/* Дата / дата-время: ширина строго по содержимому (иначе таблица раздувает колонку) */
.app-page-table .table > thead > tr > th.app-table-col--fit,
.app-page-table .table > tbody > tr > td.app-table-col--fit,
.app-page-table .table > tfoot > tr > td.app-table-col--fit,
.item-page-subentity__table > thead > tr > th.app-table-col--fit,
.item-page-subentity__table > tbody > tr > td.app-table-col--fit,
.matched-records__table > thead > tr > th.app-table-col--fit,
.matched-records__table > tbody > tr > td.app-table-col--fit,
table.dataTable > thead > tr > th.app-table-col--fit,
table.dataTable > tbody > tr > td.app-table-col--fit {
    width: 1%;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.app-page-table .table > :is(thead, tbody, tfoot) > tr > :is(th, td):has(.app-datetime),
.item-page-subentity__table > :is(thead, tbody) > tr > :is(th, td):has(.app-datetime),
.matched-records__table > :is(thead, tbody) > tr > :is(th, td):has(.app-datetime),
table.dataTable > :is(thead, tbody) > tr > :is(th, td):has(.app-datetime) {
    width: 1%;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.app-datetime {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    width: max-content;
    max-width: 100%;
    white-space: nowrap;
    line-height: 1.25;
    vertical-align: middle;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.app-datetime-date {
    display: inline-flex;
    align-items: baseline;
    flex: 0 0 auto;
    gap: 0;
    color: inherit;
    font-weight: 400;
}

.app-datetime-weekday {
    display: inline-block;
    flex: 0 0 1.85em;
    width: 1.85em;
    min-width: 1.85em;
    font-variant-numeric: tabular-nums;
    text-align: left;
    overflow: hidden;
}

.app-datetime-sep {
    display: inline-block;
    flex: 0 0 0.85em;
    width: 0.85em;
    text-align: center;
    color: var(--tblr-secondary-color, #94a3b8);
    font-weight: 400;
}

.app-datetime-day {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.app-datetime-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.08em 0.42em;
    min-height: 1.35em;
    line-height: 1.2;
    border: 1px solid var(--app-inset-border);
    border-radius: 4px;
    background: var(--app-inset-bg);
    color: inherit;
    font-weight: 400;
    box-shadow: var(--app-inset-shadow);
}

.app-datetime-time.app-datetime-time--plain {
    border-color: color-mix(in srgb, var(--app-table-border, #d0d7e0) 55%, transparent);
    background: color-mix(in srgb, var(--app-table-header-bg, #f1f5f9) 45%, #fff);
    box-shadow: none;
}

.app-datetime-time.app-datetime-midnight {
    color: var(--tblr-secondary-color, #94a3b8);
    font-weight: 400;
    border-color: color-mix(in srgb, var(--app-table-border, #d0d7e0) 30%, transparent);
    background: color-mix(in srgb, var(--app-table-header-bg, #f1f5f9) 30%, #fff);
    box-shadow:
        inset 0 1px 1px rgba(15, 23, 42, .035),
        inset 0 -1px 0 rgba(255, 255, 255, .5);
}

td.listing-inline-edit[data-inline-edit="1"] .app-datetime-date,
td.listing-inline-edit[data-inline-edit="1"] .app-datetime-time {
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}

td.listing-inline-edit[data-inline-edit="1"] .app-datetime-date:hover {
    color: var(--brand-accent, #0B679E);
}

td.listing-inline-edit[data-inline-edit="1"] .app-datetime-time:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 45%, var(--app-inset-border, #d0d7e0));
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0B679E) 14%, transparent);
}

/* Данные: ширина от содержимого; лишнее место делят все колонки (длинный текст не режется зря) */
.app-page-table .table > thead > tr > th.app-table-col--compact,
.app-page-table .table > tbody > tr > td.app-table-col--compact,
.app-page-table .table > tfoot > tr > td.app-table-col--compact,
.item-page-subentity__table > thead > tr > th.app-table-col--compact,
.item-page-subentity__table > tbody > tr > td.app-table-col--compact,
.matched-records__table > thead > tr > th.app-table-col--compact,
.matched-records__table > tbody > tr > td.app-table-col--compact {
    width: auto;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* fit сильнее compact: дата/время не раздуваются пустым местом */
.app-page-table .table > thead > tr > th.app-table-col--fit,
.app-page-table .table > tbody > tr > td.app-table-col--fit,
.app-page-table .table > tfoot > tr > td.app-table-col--fit,
.item-page-subentity__table > thead > tr > th.app-table-col--fit,
.item-page-subentity__table > tbody > tr > td.app-table-col--fit,
.matched-records__table > thead > tr > th.app-table-col--fit,
.matched-records__table > tbody > tr > td.app-table-col--fit,
table.dataTable > thead > tr > th.app-table-col--fit,
table.dataTable > tbody > tr > td.app-table-col--fit {
    width: 1% !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Чекбокс / # / действия — только они сжимаются «в контент» */
.app-page-table .table > thead > tr > th.app-listing-sum-check,
.app-page-table .table > tbody > tr > td.app-listing-sum-check,
.app-page-table .table > thead > tr > th.app-table-col--id,
.app-page-table .table > tbody > tr > td.app-table-col--id,
.app-page-table .table > thead > tr > th.app-table-col--actions,
.app-page-table .table > tbody > tr > td.app-table-col--actions {
    width: 1%;
    max-width: none;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.app-page-table .table > thead > tr > th.app-table-col--fluid,
.app-page-table .table > tbody > tr > td.app-table-col--fluid,
.app-page-table .table > tfoot > tr > td.app-table-col--fluid {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-page-table .table > thead > tr > th.app-table-col--content,
.app-page-table .table > tbody > tr > td.app-table-col--content,
.app-page-table .table > tfoot > tr > td.app-table-col--content,
.item-page-subentity__table > thead > tr > th.app-table-col--content,
.item-page-subentity__table > tbody > tr > td.app-table-col--content,
.matched-records__table > thead > tr > th.app-table-col--content,
.matched-records__table > tbody > tr > td.app-table-col--content {
    width: auto;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-page-table .table > thead > tr > th.app-table-col--truncated,
.app-page-table .table > tbody > tr > td.app-table-col--truncated,
.app-page-table .table > tfoot > tr > td.app-table-col--truncated,
.item-page-subentity__table > thead > tr > th.app-table-col--truncated,
.item-page-subentity__table > tbody > tr > td.app-table-col--truncated,
.matched-records__table > thead > tr > th.app-table-col--truncated,
.matched-records__table > tbody > tr > td.app-table-col--truncated {
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Список записей: авто-ширина по содержимому на всю ширину карточки */
.app-page-table--fill .table {
    table-layout: auto;
    width: 100%;
    min-width: 100%;
    height: max-content;
}

.app-page-table--fill .table > thead > tr > th.app-listing-sum-check,
.app-page-table--fill .table > tbody > tr > td.app-listing-sum-check,
.app-page-table--fill .table > tfoot > tr > td.app-listing-sum-check {
    width: 2.25rem;
}

.app-page-table--fill .table > thead > tr > th.app-table-col--id,
.app-page-table--fill .table > tbody > tr > td.app-table-col--id,
.app-page-table--fill .table > tfoot > tr > td.app-table-col--id {
    width: 3.5rem;
}

.app-page-table--fill .table > thead > tr > th.app-table-col--actions,
.app-page-table--fill .table > tbody > tr > td.app-table-col--actions,
.app-page-table--fill .table > tfoot > tr > td.app-table-col--actions {
    width: 1%;
    position: sticky;
    right: 0;
    z-index: 4;
    isolation: isolate;
    text-align: right;
    vertical-align: middle;
    background-color: #fff;
    background-clip: padding-box;
    box-shadow: inset 0 0 0 9999px #fff;
}

.app-page-table--fill .table > thead > tr > th.app-table-col--actions {
    z-index: 6;
    background-color: var(--app-table-header-bg) !important;
    box-shadow: inset 0 0 0 9999px var(--app-table-header-bg);
}

.app-page-table--fill .table > tbody > tr > td.app-table-col--actions {
    overflow: visible;
}

.app-page-table--fill .table.table-striped > tbody > tr:nth-of-type(odd) > td.app-table-col--actions {
    background-color: #fff;
    box-shadow: inset 0 0 0 9999px var(--bs-table-striped-bg, var(--app-table-zebra, #fafbfc));
}

.app-page-table--fill .table.table-hover > tbody > tr:hover > td.app-table-col--actions {
    background-color: #fff;
    box-shadow: inset 0 0 0 9999px var(--bs-table-hover-bg, var(--app-table-hover, #fff));
}

.app-page-table--fill .table > tbody > tr.app-listing-row--hl > td.app-table-col--actions {
    background-color: var(--listing-row-bg, #fff);
    box-shadow: inset 0 0 0 9999px var(--listing-row-bg, #fff);
}

.app-page-table--fill .table > tfoot > tr > td.app-table-col--actions {
    background-color: var(--app-table-header-bg, #f3f5f7);
    box-shadow: inset 0 0 0 9999px var(--app-table-header-bg, #f3f5f7);
}

.app-page-table--fill .table > tbody > tr > td:not(.app-table-col--actions),
.app-page-table--fill .table > thead > tr > th:not(.app-table-col--actions) {
    overflow: hidden !important;
    text-overflow: ellipsis;
}

.app-page-table--fill .table > tbody > tr > td.listing-inline-edit.is-editing {
    overflow: visible !important;
}

.app-page-table--fill .table-actions {
    justify-content: flex-end;
    width: 100%;
}

.app-page-table--fill .table > :not(caption) > * > *.app-table-col--actions {
    padding-left: var(--app-table-padding-x);
    padding-right: var(--app-table-padding-x);
}

.app-page-table--fill .table .is-listing-col-hidden {
    display: none !important;
}

/* Подсущность на карточке: длинный текст обрезаем, чтобы не разъезжалась таблица */
.item-page-subentity__table > thead > tr > th.app-table-col--wrap,
.item-page-subentity__table > tbody > tr > td.app-table-col--wrap,
.item-page-subentity__table > tfoot > tr > td.app-table-col--wrap {
    max-width: 16rem;
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    vertical-align: middle;
}

.item-page-subentity__table > thead > tr > th.app-table-col--compact,
.item-page-subentity__table > tbody > tr > td.app-table-col--compact,
.item-page-subentity__table > tfoot > tr > td.app-table-col--compact {
    min-width: 4.5rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.item-page-subentity__table > thead > tr > th.text-center,
.item-page-subentity__table > tbody > tr > td.text-center,
.item-page-subentity__table > tfoot > tr > td.text-center {
    text-align: center;
}

.item-page-subentity__table > thead > tr > th.text-end,
.item-page-subentity__table > tbody > tr > td.text-end,
.item-page-subentity__table > tfoot > tr > td.text-end {
    text-align: right;
}

.item-page-subentity__table > thead > tr > th.text-start,
.item-page-subentity__table > tbody > tr > td.text-start,
.item-page-subentity__table > tfoot > tr > td.text-start {
    text-align: left;
}

.item-page-subentity__th--filterable.text-center .item-page-subentity__th-btn {
    justify-content: center;
    width: 100%;
}

.item-page-subentity__th--filterable.text-end .item-page-subentity__th-btn {
    justify-content: flex-end;
    width: 100%;
}

.item-page-subentity__table > tfoot > tr.subentity-table__sum-row > td {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.item-page-subentity__table {
    table-layout: auto;
    width: 100%;
}

.app-page-table .table > tbody > tr > td[colspan],
.dt-container .table > tbody > tr > td[colspan],
table.dataTable > tbody > tr > td[colspan] {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
}

.app-page-table .table thead th,
.dt-container .table thead th,
table.dataTable thead th {
    text-transform: none;
    font-size: var(--app-table-header-size);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.25;
    color: var(--app-table-header-color, #5b6b7c);
    background-color: var(--app-table-header-bg) !important;
    --bs-table-bg: var(--app-table-header-bg);
    --bs-table-bg-type: none;
    --bs-table-accent-bg: transparent;
    --bs-table-color: var(--app-table-header-color, #5b6b7c);
    border-bottom: 1px solid var(--app-table-header-border, color-mix(in srgb, var(--brand-accent) 10%, #e2e7ed));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-listing-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-decoration: none;
    cursor: pointer;
}

.app-listing-sort:hover,
.app-listing-sort:focus,
.app-listing-sort.is-active {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.app-listing-sort__label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Стрелки сортировки — всегда у правого края ячейки заголовка */
.app-listing-sort__ind {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: auto;
    opacity: 0.35;
}

.app-listing-sort__ind svg {
    display: block;
    fill: currentColor;
}

.app-listing-sort__up,
.app-listing-sort__down {
    opacity: 0.45;
}

.app-listing-sort:hover .app-listing-sort__ind {
    opacity: 0.7;
}

.app-listing-sort.is-active .app-listing-sort__ind {
    opacity: 0.9;
}

.app-listing-sort.is-asc .app-listing-sort__up,
.app-listing-sort.is-desc .app-listing-sort__down {
    opacity: 1;
}

.app-listing-sort.is-asc .app-listing-sort__down,
.app-listing-sort.is-desc .app-listing-sort__up {
    opacity: 0.25;
}

.app-page-table .table tbody tr:last-child > *,
.dt-container .table tbody tr:last-child > *,
table.dataTable tbody tr:last-child > *,
.app-page-table .table tfoot tr:last-child > * {
    border-bottom-width: 0;
}

.app-page-table .table tfoot.app-listing-sum-foot td,
.app-listing-sum-foot td {
    border-top: 1px solid var(--app-table-border);
    background: var(--app-table-zebra);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.app-listing-sum-check {
    width: 28px;
    text-align: center;
    vertical-align: middle !important;
}

/* Компактные лёгкие чекбоксы в таблицах (листинг + сабэнтити) */
.app-listing-sum-check .form-check-input,
.item-page-subentity__th--select .form-check-input,
.item-page-subentity__td--select .form-check-input {
    --tblr-form-check-bg: #fff;
    --tblr-form-check-bg-image: none;
    width: 12px;
    height: 12px;
    margin: 0;
    float: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid #cfd6df;
    border-radius: 3px;
    background-color: #fff;
    background-image: none;
    background-size: 9px 9px;
    box-shadow: none;
    transition:
        border-color .12s ease,
        background-color .12s ease,
        box-shadow .12s ease;
}

.app-listing-sum-check .form-check-input:hover,
.item-page-subentity__th--select .form-check-input:hover,
.item-page-subentity__td--select .form-check-input:hover {
    border-color: #aeb8c5;
    background-color: #fafbfc;
}

.app-listing-sum-check .form-check-input:focus,
.item-page-subentity__th--select .form-check-input:focus,
.item-page-subentity__td--select .form-check-input:focus {
    border-color: color-mix(in srgb, var(--brand-accent, #0b679e) 40%, #c5ced9);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0b679e) 12%, transparent);
}

.app-listing-sum-check .form-check-input:checked,
.item-page-subentity__th--select .form-check-input:checked,
.item-page-subentity__td--select .form-check-input:checked {
    border: 1px solid color-mix(in srgb, var(--brand-accent, #0b679e) 32%, #d8dee6);
    background-color: color-mix(in srgb, var(--brand-accent, #0b679e) 11%, #fff);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230b679e' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M3.5 8.5l2.8 2.8 6.2-6.5'/%3e%3c/svg%3e");
}

.app-listing-sum-check .form-check-input:checked:hover,
.item-page-subentity__th--select .form-check-input:checked:hover,
.item-page-subentity__td--select .form-check-input:checked:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0b679e) 45%, #c5ced9);
    background-color: color-mix(in srgb, var(--brand-accent, #0b679e) 16%, #fff);
}

.app-listing-sum-check .form-check-input:indeterminate,
.item-page-subentity__th--select .form-check-input:indeterminate,
.item-page-subentity__td--select .form-check-input:indeterminate {
    border: 1px solid color-mix(in srgb, var(--brand-accent, #0b679e) 32%, #d8dee6);
    background-color: color-mix(in srgb, var(--brand-accent, #0b679e) 11%, #fff);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230b679e' stroke-linecap='round' stroke-width='1.75' d='M3.5 8h9'/%3e%3c/svg%3e");
}

.app-listing-sum-check .form-check-input:checked:focus,
.app-listing-sum-check .form-check-input:indeterminate:focus,
.item-page-subentity__th--select .form-check-input:checked:focus,
.item-page-subentity__th--select .form-check-input:indeterminate:focus,
.item-page-subentity__td--select .form-check-input:checked:focus,
.item-page-subentity__td--select .form-check-input:indeterminate:focus {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0b679e) 12%, transparent);
}

.app-listing-sum-label {
    font-weight: 600;
    white-space: nowrap;
}

.app-page-table .table > tbody > tr > td.js-listing-sum-cell {
    font-variant-numeric: tabular-nums;
}

table.table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * {
    box-shadow: inset 0 0 0 9999px var(--app-table-zebra);
}

table.table.dataTable.table-hover > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px var(--app-table-hover);
}

.app-page-table .table > tbody > tr.table-light > *,
.dt-container .table > tbody > tr.table-light > * {
    background-color: #f1f5f9 !important;
    box-shadow: none !important;
}

/* Сортировка — тихие стрелки, заметнее при наведении */
table.dataTable thead .dt-column-order::before,
table.dataTable thead .dt-column-order::after {
    opacity: 0;
    transition: opacity .12s ease;
}

table.dataTable thead th:hover .dt-column-order::before,
table.dataTable thead th:hover .dt-column-order::after,
table.dataTable thead th.dt-ordering-asc .dt-column-order::before,
table.dataTable thead th.dt-ordering-desc .dt-column-order::after {
    opacity: 0.4;
}

.table tbody td a:not(.btn):not(.dropdown-item) {
    font-weight: 500;
    text-decoration: none;
}

.table tbody td a:not(.btn):not(.dropdown-item):hover {
    color: var(--brand-accent);
}

/* Инлайн-редактирование ячеек списка — без обводки, в строке */
td.listing-inline-edit {
    cursor: pointer;
    position: relative;
}

td.listing-inline-edit:hover {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 5%, transparent);
}

td.listing-inline-edit.is-editing {
    cursor: text;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    z-index: 2;
    vertical-align: middle;
}

td.listing-inline-edit.is-saving {
    opacity: .65;
    pointer-events: none;
}

td.listing-inline-edit.is-saved {
    background: color-mix(in srgb, #2fb344 10%, transparent);
}

td.listing-inline-edit.is-error {
    background: color-mix(in srgb, #d63939 8%, transparent);
}

td.listing-inline-edit .listing-inline-edit__view {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

td.listing-inline-edit.app-table-col--fit .listing-inline-edit__view,
td.listing-inline-edit:has(.app-datetime) .listing-inline-edit__view {
    display: inline-block;
    width: max-content;
    max-width: 100%;
    vertical-align: middle;
}

td.listing-inline-edit .listing-inline-edit__control {
    display: inline-block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    vertical-align: middle;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    outline: none !important;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

/* date/datetime: ячейка и инпут строго по содержимому, без пустого хвоста */
td.listing-inline-edit[data-field-type="fieldtype_input_date"].is-editing,
td.listing-inline-edit[data-field-type="fieldtype_input_datetime"].is-editing {
    width: 1% !important;
    max-width: none !important;
    white-space: nowrap !important;
}

td.listing-inline-edit .listing-inline-edit__control--fit,
td.listing-inline-edit.app-table-col--fit.is-editing .listing-inline-edit__control,
td.listing-inline-edit[data-field-type="fieldtype_input_date"].is-editing .listing-inline-edit__control,
td.listing-inline-edit[data-field-type="fieldtype_input_datetime"].is-editing .listing-inline-edit__control {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    display: inline-block !important;
    field-sizing: content;
}

td.listing-inline-edit .listing-inline-edit__control:is(select) {
    display: inline-block !important;
    width: max-content !important;
    min-width: 6.5rem !important;
    max-width: min(14rem, 100%) !important;
    padding: 0 !important;
    cursor: pointer;
    background: transparent !important;
    appearance: auto;
    -webkit-appearance: menulist;
}

.listing-inline-edit__menu {
    position: fixed;
    z-index: 1080;
    min-width: 8rem;
    max-width: min(18rem, calc(100vw - 16px));
    max-height: min(16rem, calc(100vh - 16px));
    overflow: auto;
    padding: .25rem;
    margin: 0;
    list-style: none;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 90%, #94a3b8);
    border-radius: .4rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
    font-size: 14px;
    line-height: 1.4;
}

.listing-inline-edit__menu--time {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    width: max-content;
    max-width: min(12.5rem, calc(100vw - 16px));
    max-height: min(18rem, calc(100vh - 16px));
    padding: .4rem;
    border-radius: .55rem;
    border-color: color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 70%, transparent);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 10px 28px rgba(15, 23, 42, .1);
}

.listing-inline-edit__menu--time .listing-inline-edit__menu-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: .4rem .5rem;
    margin: 0;
    border-bottom: none;
    border-radius: .35rem;
    background: #eef2f6;
    border: 1px solid color-mix(in srgb, #cbd5e1 55%, transparent);
}

.listing-inline-edit__menu-date {
    font-size: 14px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    text-align: center;
    color: #475569;
}

.listing-inline-edit__menu-time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(var(--time-rows, 6), auto);
    grid-auto-flow: column;
    gap: .2rem;
    overflow: auto;
    min-height: 0;
}

.listing-inline-edit__menu--time .listing-inline-edit__menu-item {
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    padding: .38rem .7rem;
    position: relative;
    border: 1px solid transparent;
    border-radius: .4rem;
    color: var(--tblr-body-color, #334155);
    background: transparent;
    transition:
        background-color .14s ease,
        border-color .14s ease,
        color .14s ease,
        box-shadow .14s ease;
}

.listing-inline-edit__menu--time .listing-inline-edit__menu-item:hover,
.listing-inline-edit__menu--time .listing-inline-edit__menu-item.is-active {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 6%, transparent);
    color: var(--brand-accent, #0B679E);
    border-color: transparent;
}

.listing-inline-edit__menu--time .listing-inline-edit__menu-item.is-current {
    padding-right: .7rem;
    background: transparent;
    background-image: none;
    color: var(--brand-accent, #0B679E);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 55%, #94a3b8);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent, #0B679E) 12%, transparent);
}

.listing-inline-edit__menu--time .listing-inline-edit__menu-item.is-current:hover {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 5%, transparent);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 70%, #94a3b8);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-accent, #0B679E) 16%, transparent);
}

.listing-inline-edit__menu--time .listing-inline-edit__menu-item.is-current::after {
    content: none;
    display: none;
}

.listing-inline-edit__menu-group {
    padding: .35rem .55rem .15rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--tblr-secondary-color, #6c757d);
    text-transform: none;
}

.listing-inline-edit__menu-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: .35rem .55rem;
    border: 0;
    border-radius: .3rem;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-inline-edit__menu-item:hover,
.listing-inline-edit__menu-item.is-active {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 10%, transparent);
}

.listing-inline-edit__menu-item.is-current {
    font-weight: inherit;
    background: transparent;
    color: var(--brand-accent, #0B679E);
    padding-right: 1.6rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230B679E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .45rem center;
    background-size: 12px 12px;
}

.listing-inline-edit__menu-item.is-current:hover {
    background-color: color-mix(in srgb, var(--brand-accent, #0B679E) 10%, transparent);
}

td.listing-inline-edit .listing-inline-edit__control:focus,
td.listing-inline-edit .listing-inline-edit__control:focus-visible {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent;
}

td.listing-inline-edit[data-field-type="fieldtype_input_numeric"] .listing-inline-edit__control,
td.listing-inline-edit.text-end .listing-inline-edit__control {
    text-align: right;
}

td.listing-inline-edit.text-center .listing-inline-edit__control {
    text-align: center;
}

td.listing-inline-edit.text-start .listing-inline-edit__control {
    text-align: left;
}

/* Узкое поле (quick width / max chars) — позиция как у текста в ячейке.
   date/datetime исключены: для них ширина по содержимому (см. выше). */
td.listing-inline-edit[data-input-width]:not([data-field-type="fieldtype_input_date"]):not([data-field-type="fieldtype_input_datetime"]) .listing-inline-edit__control,
td.listing-inline-edit[data-max-chars]:not([data-field-type="fieldtype_input_date"]):not([data-field-type="fieldtype_input_datetime"]) .listing-inline-edit__control {
    width: var(--listing-inline-input-width, 5.5rem);
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
}

td.listing-inline-edit .listing-inline-edit__view:empty::before {
    content: '—';
    color: var(--tblr-secondary-color, #6c757d);
}

.table tbody td .text-muted.small,
.table tbody td .table-row-id {
    margin-left: 4px;
    color: var(--tblr-secondary-color) !important;
    font-size: 12px;
    font-weight: 400;
}

.table-responsive > .table { margin-bottom: 0; }

/* Кнопки в строках таблицы и в виджете файлов — лёгкие ghost-иконки.
   Иконки в шапке списка (.service-toolbar / .page-header) остаются обычными btn-icon. */
.table .btn-icon,
.table .btn.btn-sm.btn-icon,
.table .btn.btn-lg.btn-icon,
.app-table-icon-actions .btn-icon,
.app-table-icon-actions .btn.btn-sm.btn-icon,
.app-table-icon-actions .btn.btn-lg.btn-icon,
.entity-files .table-actions .btn-icon,
.entity-files .table-actions .btn.btn-sm.btn-icon,
.entity-files .table-actions .btn.btn-lg.btn-icon,
.entity-files-modal .table-actions .btn-icon,
.entity-files-modal .table-actions .btn.btn-sm.btn-icon,
.entity-files-modal .table-actions .btn.btn-lg.btn-icon {
    width: var(--app-table-action-size);
    min-width: var(--app-table-action-size);
    height: var(--app-table-action-size);
    min-height: var(--app-table-action-size);
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    box-shadow: none;
    overflow: visible;
}

.table .btn-icon:hover,
.table .btn.btn-sm.btn-icon:hover,
.app-table-icon-actions .btn-icon:hover,
.app-table-icon-actions .btn.btn-sm.btn-icon:hover,
.app-table-icon-actions .btn.btn-lg.btn-icon:hover,
.entity-files .table-actions .btn-icon:hover,
.entity-files .table-actions .btn.btn-sm.btn-icon:hover,
.entity-files .table-actions .btn.btn-lg.btn-icon:hover,
.entity-files-modal .table-actions .btn-icon:hover,
.entity-files-modal .table-actions .btn.btn-sm.btn-icon:hover,
.entity-files-modal .table-actions .btn.btn-lg.btn-icon:hover {
    background: rgba(11, 103, 158, 0.08);
    border-color: transparent;
    color: var(--tblr-body-color);
}

.table .btn-icon:focus-visible,
.app-table-icon-actions .btn-icon:focus-visible,
.entity-files .table-actions .btn-icon:focus-visible,
.entity-files-modal .table-actions .btn-icon:focus-visible {
    outline: none;
    background: rgba(11, 103, 158, 0.1);
    border-color: transparent;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0B679E) 22%, transparent);
}

.table .btn-outline-danger.btn-icon,
.app-table-icon-actions .btn-outline-danger.btn-icon,
.entity-files .table-actions .btn-outline-danger.btn-icon {
    color: var(--tblr-danger);
}

.table .btn-outline-danger.btn-icon:hover,
.app-table-icon-actions .btn-outline-danger.btn-icon:hover,
.entity-files .table-actions .btn-outline-danger.btn-icon:hover {
    background: color-mix(in srgb, var(--tblr-danger) 10%, transparent);
    border-color: transparent;
    color: var(--tblr-danger);
}

/* Избранное: только цвет иконки, без подложки */
.table .btn-warning.btn-icon,
.table .btn-outline-warning.btn-icon,
.app-table-icon-actions .btn-warning.btn-icon,
.app-table-icon-actions .btn-outline-warning.btn-icon,
.app-table-icon-actions .btn-icon.is-favorite,
.page-header .table-actions .btn-warning.btn-icon,
.page-header .table-actions .btn-outline-warning.btn-icon,
.page-header .table-actions .btn-icon.is-favorite {
    color: #d97706;
    background: transparent;
    border-color: transparent;
}

.table .btn-warning.btn-icon:hover,
.table .btn-outline-warning.btn-icon:hover,
.app-table-icon-actions .btn-warning.btn-icon:hover,
.app-table-icon-actions .btn-outline-warning.btn-icon:hover,
.app-table-icon-actions .btn-icon.is-favorite:hover,
.page-header .table-actions .btn-warning.btn-icon:hover,
.page-header .table-actions .btn-outline-warning.btn-icon:hover,
.page-header .table-actions .btn-icon.is-favorite:hover {
    color: #b45309;
    background: transparent;
    border-color: transparent;
}

.table .btn-icon svg.feather,
.table .btn-icon .icon-svg,
.app-table-icon-actions .btn-icon svg.feather,
.app-table-icon-actions .btn-icon .icon-svg,
.entity-files .table-actions .btn-icon svg.feather,
.entity-files .table-actions .btn-icon .icon-svg,
.entity-files-modal .table-actions .btn-icon svg.feather,
.entity-files-modal .table-actions .btn-icon .icon-svg {
    width: 15px;
    height: 15px;
}

/* Тулбар списка: иконки настроек = высота основных кнопок, без обводки */
.service-toolbar .table-actions,
.page-header .table-actions {
    gap: 6px;
    min-height: var(--app-control-height);
}

.service-toolbar .table-actions .btn-icon,
.service-toolbar .table-actions .btn.btn-sm.btn-icon,
.page-header .table-actions .btn-icon,
.page-header .table-actions .btn.btn-sm.btn-icon {
    width: var(--app-control-height);
    min-width: var(--app-control-height);
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    box-shadow: none;
}

.service-toolbar .table-actions .btn-icon:hover,
.service-toolbar .table-actions .btn.btn-sm.btn-icon:hover,
.page-header .table-actions .btn-icon:hover,
.page-header .table-actions .btn.btn-sm.btn-icon:hover {
    background: rgba(11, 103, 158, 0.06);
    border-color: transparent;
    color: var(--tblr-body-color);
}

.service-toolbar .table-actions .btn-icon svg.feather,
.service-toolbar .table-actions .btn-icon .icon-svg,
.page-header .table-actions .btn-icon svg.feather,
.page-header .table-actions .btn-icon .icon-svg {
    width: 16px;
    height: 16px;
}

/* Активное избранное — после ghost-стилей шапки, иначе они затирают цвет */
.page-header .table-actions .btn.btn-sm.btn-icon.is-favorite,
.page-header .table-actions .btn.btn-sm.btn-icon.btn-warning,
.page-header .table-actions .btn.btn-sm.btn-icon.btn-outline-warning,
.page-header .app-table-icon-actions .btn.btn-sm.btn-icon.is-favorite,
.app-table-icon-actions .btn.btn-sm.btn-icon.is-favorite,
.app-table-icon-actions .btn.btn-sm.btn-icon.btn-warning {
    color: #d97706 !important;
    background: transparent !important;
    border-color: transparent !important;
}

.page-header .table-actions .btn.btn-sm.btn-icon.is-favorite:hover,
.page-header .table-actions .btn.btn-sm.btn-icon.btn-warning:hover,
.page-header .table-actions .btn.btn-sm.btn-icon.btn-outline-warning:hover,
.page-header .app-table-icon-actions .btn.btn-sm.btn-icon.is-favorite:hover,
.app-table-icon-actions .btn.btn-sm.btn-icon.is-favorite:hover,
.app-table-icon-actions .btn.btn-sm.btn-icon.btn-warning:hover {
    color: #b45309 !important;
    background: transparent !important;
    border-color: transparent !important;
}

.table .badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
}

.table code.column-name {
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid var(--app-table-border);
    background: #f8fafc;
    color: #475569;
}

/* Карточка + таблица (формы, пустые состояния) */
.card:has(> .card-body.p-0) > .card-header {
    border-bottom-color: var(--app-table-border);
}

.card-body.p-0 .table thead th {
    border-top: none;
}

/* Таблица на всю ширину страницы */
.app-page-table {
    width: 100%;
    margin-bottom: var(--app-section-gap);
    overflow: visible;
}

/* Список записей: шапка сайта на месте, прокрутка — внутри таблицы */
@media (min-width: 992px) {
    html:has(.app-page-table--fill),
    body:has(.app-page-table--fill) {
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    body:has(.app-page-table--fill) .page {
        display: flex;
        flex-direction: column;
        height: 100%;
        height: 100dvh;
        max-height: 100%;
        max-height: 100dvh;
        overflow: hidden;
    }

    body:has(.app-page-table--fill) .app-topbar,
    body:has(.app-page-table--fill) .gsearch-strip {
        flex: 0 0 auto;
    }

    .page-wrapper:has(.app-page-table--fill) {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .page-body:has(.app-page-table--fill) {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .page-body:has(.app-page-table--fill) > .container-fluid {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .page-body:has(.app-page-table--fill) > .container-fluid > :not(.items-list-layout):not(.app-page-table) {
        flex: 0 0 auto;
    }

    body:has(.app-page-table--fill) .items-list-layout--filters-right {
        flex: 1 1 auto;
        min-height: 0;
        align-items: stretch;
        overflow: hidden;
    }

    body:has(.app-page-table--fill) .items-list-layout__main {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    body:has(.app-page-table--fill) .items-list-layout__main > :not(.app-page-table--fill) {
        flex: 0 0 auto;
    }

    body:has(.app-page-table--fill) .items-list-layout__aside {
        position: relative;
        top: auto;
        align-self: stretch;
        max-height: 100%;
        overflow: auto;
        padding-top: 0;
    }

    .app-page-table--fill {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        margin-bottom: 0;
    }

    .app-page-table--fill .app-page-table__scroll {
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        max-height: none;
    }
}

.app-page-table__scroll {
    width: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #fff;
    border: 1px solid var(--app-table-border);
    border-radius: var(--app-table-radius, 5px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}

/* Заголовок таблицы всегда виден при вертикальном скролле списка */
.app-page-table__scroll .table > thead > tr > th,
.app-page-table__scroll table.dataTable > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: var(--app-table-header-bg) !important;
    box-shadow: 0 1px 0 var(--app-table-header-border, color-mix(in srgb, var(--brand-accent) 10%, #e2e7ed));
}

.app-page-table__scroll .table > thead > tr > th.app-table-col--actions {
    z-index: 7;
    top: 0;
}

/* Таблица без scroll-обёртки — тот же лёгкий скруглённый контур */
.app-page-table > .table,
.app-page-table > .table-responsive {
    background: #fff;
    border: 1px solid var(--app-table-border);
    border-radius: var(--app-table-radius, 5px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    /* overflow:hidden ломает position:sticky у thead при скролле страницы */
    overflow: visible;
}

.app-page-table > .table-responsive {
    overflow: auto;
}

/* Колоночные заголовки матриц/карточек — липнут под sticky-шапкой */
.app-page-table > .table > thead > tr > th {
    position: sticky;
    top: var(--app-sticky-offset, 52px);
    z-index: 6;
    background-color: var(--app-table-header-bg) !important;
    box-shadow: 0 1px 0 var(--app-table-header-border, color-mix(in srgb, var(--brand-accent) 10%, #e2e7ed));
}

.app-page-table > .table-responsive > .table > thead > tr > th {
    top: 0;
}

/* DataTables: рамка только вокруг таблицы — length/search снаружи, без наезда на thead */
.app-page-table > .dt-container {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.app-page-table > .dt-container .dt-layout-table {
    background: #fff;
    border: 1px solid var(--app-table-border);
    border-radius: var(--app-table-radius, 5px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
    overflow: auto;
    padding: 0;
}

.app-page-table > .dt-container .dt-layout-table > div {
    overflow: visible;
}

.app-page-table > .table {
    margin-bottom: 0;
}

.app-page-table__scroll .table,
.app-page-table__scroll table.dataTable,
.app-page-table > .table,
.app-page-table > .table-responsive > .table {
    border-collapse: separate;
    border-spacing: 0;
}

.app-page-table__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 0;
    border-bottom: none;
}

.app-page-table__title {
    font-size: var(--app-font-size);
    font-weight: 400;
    color: var(--tblr-body-color);
}

.app-page-table__meta {
    font-size: var(--app-font-size-sm);
    color: var(--tblr-secondary-color);
}

.app-page-table + .app-page-table,
.app-page-table + .card,
.card + .app-page-table {
    margin-top: var(--app-section-gap);
}

.app-page-table .table,
.app-page-table table.dataTable {
    width: 100%;
    min-width: 100%;
    max-width: none;
}

/* DataTables 3: панель управления и пагинация */
.dt-container {
    font-size: var(--app-font-size-sm);
    color: var(--tblr-secondary-color);
    overflow: visible;
}

/* Убираем лишний mt у Bootstrap-layout DT внутри карточки страницы */
.app-page-table > .dt-container > .dt-layout-row.mt-2 {
    margin-top: 0 !important;
}

.app-page-table > .dt-container > .dt-layout-row.mt-2 + .dt-layout-row.mt-2 {
    margin-top: 0 !important;
}

/* Модальные формы — по центру экрана, без анимации сдвига */
#appFormModal.modal {
    transition: none;
}

#appFormModal.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem;
    /* скролл только внутри .modal-body, не снаружи белой карточки */
    overflow: hidden;
}

/* «Авто» ширина: не давать Bootstrap .modal-dialog (~500px с 576px) сжимать форму.
   Ручная ширина задаётся inline на dialog и перекрывает эти max-width. */
#appFormModal .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: calc(100vw - 3rem);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: none !important;
}

@media (min-width: 992px) {
    #appFormModal .modal-dialog.modal-lg {
        max-width: min(800px, calc(100vw - 3rem));
    }

    #appFormModal .modal-dialog.modal-xl {
        max-width: min(1140px, calc(100vw - 3rem));
    }
}

@media (max-width: 575.98px) {
    #appFormModal.modal.show {
        padding: .5rem;
    }

    #appFormModal .modal-dialog {
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
}

/* Родительская форма свёрнута в угол — поверх затемнения, кликабельна «вернуться» */
#appFormModal.modal.show.is-docked {
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
    padding: 0 !important;
    pointer-events: none;
    z-index: 1080;
    background: transparent;
}

#appFormModal.modal.is-docked .modal-dialog,
#appFormModal.modal.is-docked .modal-dialog.modal-dialog-centered {
    position: fixed !important;
    right: 16px !important;
    bottom: 16px !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    width: min(300px, calc(100vw - 24px)) !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    align-items: unset !important;
    transform: none !important;
    pointer-events: auto;
    animation: app-modal-dock-in .22s ease;
    filter: none;
}

#appFormModal.modal.is-docked .modal-content {
    max-height: none !important;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .35);
    border: 1px solid rgba(15, 23, 42, .12);
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

#appFormModal.modal.is-docked .modal-content:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 40%, rgba(15, 23, 42, .12));
    box-shadow: 0 12px 32px rgba(15, 23, 42, .4);
}

#appFormModal.modal.is-docked .modal-header {
    padding: 10px 12px;
    border-bottom: 0;
    gap: 2px;
    flex-direction: column;
    align-items: stretch;
    background: transparent;
}

#appFormModal.modal.is-docked .modal-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--tblr-body-color, #1e293b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#appFormModal.modal.is-docked .modal-header::after {
    content: 'Нажмите, чтобы вернуться';
    display: block;
    width: 100%;
    font-size: 11px;
    font-weight: 400;
    color: var(--tblr-secondary-color, #6c757d);
    line-height: 1.2;
}

#appFormModal.modal.is-docked .modal-body,
#appFormModal.modal.is-docked .btn-close {
    display: none !important;
}

@keyframes app-modal-dock-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-backdrop.is-parent-docked-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Затемнение вложенной формы — как у обычной модалки (серый неактивный фон) */
body.modal-open .modal-backdrop.show.related-create-backdrop {
    z-index: 1065 !important;
    opacity: var(--bs-backdrop-opacity, 0.5) !important;
    pointer-events: auto !important;
    background-color: #000 !important;
}

#appFormModal.modal-static .modal-content,
#appRelatedCreateModal.modal-static .modal-content {
    animation: app-modal-attention .42s ease;
}

@keyframes app-modal-attention {
    0%, 100% { transform: translateX(0); }
    18% { transform: translateX(-7px); }
    36% { transform: translateX(7px); }
    54% { transform: translateX(-5px); }
    72% { transform: translateX(5px); }
    90% { transform: translateX(-2px); }
}

#appFormModal .modal-content {
    width: 100%;
    max-height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#appFormModal .modal-header {
    flex: 0 0 auto;
    padding: 12px 14px;
    min-height: 0;
    align-items: center;
}

#appFormModal .modal-body {
    padding-top: 1.35rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#appFormModal .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    justify-content: flex-end;
}

/* Вложенная модалка создания — по центру поверх серого фона */
#appRelatedCreateModal.modal {
    transition: none;
    z-index: 1070;
}

#appRelatedCreateModal.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.5rem;
    z-index: 1070;
    overflow: hidden;
}

#appRelatedCreateModal .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: calc(100vw - 3rem);
    max-height: calc(100vh - 3rem);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: none !important;
}

@media (min-width: 992px) {
    #appRelatedCreateModal .modal-dialog.modal-lg {
        max-width: min(800px, calc(100vw - 3rem));
    }

    #appRelatedCreateModal .modal-dialog.modal-xl {
        max-width: min(1140px, calc(100vw - 3rem));
    }
}

@media (max-width: 575.98px) {
    #appRelatedCreateModal.modal.show {
        padding: .5rem;
    }

    #appRelatedCreateModal .modal-dialog {
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }
}

#appRelatedCreateModal .modal-content {
    width: 100%;
    max-height: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, .04),
        0 20px 50px rgba(15, 23, 42, .35);
}

/* Режим модалки: полоска только у заголовка (серая — просмотр/редактирование, синяя тонкая — создание) */
#appFormModal.app-form-modal--edit .modal-header,
#appRelatedCreateModal.app-form-modal--edit .modal-header {
    border-left: 4px solid var(--tblr-border-color, #c8d0d8);
}
#appFormModal.app-form-modal--create .modal-header,
#appRelatedCreateModal.app-form-modal--create .modal-header {
    border-left: 2px solid var(--brand-accent, #0B679E);
}

#appRelatedCreateModal .modal-header {
    flex: 0 0 auto;
    padding: 12px 14px;
    min-height: 0;
    align-items: center;
}

#appRelatedCreateModal .modal-body {
    padding-top: 1.35rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#appRelatedCreateModal .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    justify-content: flex-end;
}

#appFormModal .app-modal-form .alert-info {
    font-size: var(--app-font-size-sm);
}

#appFormModal .app-modal-form > .col-12 > .item-form-parent-banner {
    margin-bottom: 0.25rem;
}

.dt-container .dt-layout-row {
    margin-bottom: 0;
    align-items: center;
}

/* Верхняя панель (Показывать / Поиск) — над карточкой таблицы */
.app-page-table > .dt-container > .dt-layout-row:first-child {
    margin-bottom: 10px;
    padding: 0;
}

/* Нижняя панель (info / paging) — под карточкой */
.app-page-table > .dt-container > .dt-layout-row:last-child {
    margin-top: 10px;
    padding: 0;
}

.dt-container .dt-length label,
.dt-container .dt-search label,
.dt-container .dt-info {
    font-weight: 400;
    color: var(--tblr-secondary-color);
}

.dt-container .dt-length,
.dt-container .dt-search {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
    height: var(--app-control-height, 34px);
    min-height: var(--app-control-height, 34px);
    padding: 0 10px;
    border: 1px solid var(--app-table-border);
    border-radius: var(--app-control-radius);
    background: #fff;
    font-size: var(--app-font-size-sm);
    line-height: calc(var(--app-control-height, 34px) - 2px);
    color: var(--tblr-body-color);
    box-shadow: none;
    transition: border-color .12s ease;
}

.dt-container .dt-search input {
    width: 200px;
    margin-left: 0;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus {
    border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--app-table-border));
    outline: none;
    box-shadow: none;
}

.dt-container .dt-search input::placeholder {
    color: color-mix(in srgb, var(--tblr-secondary-color) 72%, transparent);
}

.dt-container .dt-info {
    padding-top: 8px;
}

.dt-container .dt-paging {
    padding-top: 8px;
    max-width: 100%;
    overflow: hidden;
}

.dt-container .dt-paging .pagination,
.field-sql-query__pager .pagination {
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: flex-end;
}

.dt-container .page-link {
    min-width: 28px;
    padding: 4px 10px !important;
    border-radius: var(--app-control-radius) !important;
    border-color: var(--app-table-border) !important;
    font-size: var(--app-font-size-sm);
    line-height: 1.2;
    box-shadow: none !important;
}

.dt-container .page-item.active .page-link {
    background: var(--brand-accent) !important;
    border-color: var(--brand-accent) !important;
    color: #fff !important;
}

.dt-container .page-item:not(.active) .page-link:hover {
    background: var(--app-table-zebra);
    border-color: #d5dbe3;
}

/* Убираем двойную рамку у пагинации Bootstrap */
.dt-container .dt-paging .dt-paging-button.page-item,
.dt-container .dt-paging .dt-paging-button.page-item:hover,
.dt-container .dt-paging .dt-paging-button.page-item.disabled {
    width: auto;
    min-width: 0;
    height: auto;
    margin-left: 4px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.dt-container .pagination { margin: 0; }

/* Системные поля — компактная 3-колоночная таблица */
.app-system-fields-table .app-col-id,
.app-system-fields-table th.app-col-id,
.app-system-fields-table td:first-child {
    width: 52px;
    white-space: nowrap;
}

/* Модальные окна, выпадающие меню и навигация не выбиваются по кеглю. */
.dropdown-menu,
.modal-content,
.nav-link,
.pagination { font-size: var(--app-font-size); }

.dropdown-menu { padding: 4px; }
.dropdown-item {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: var(--app-font-size);
    line-height: 1.15;
}

.dropdown-item svg.feather {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-right: 8px !important;
    stroke-width: 2;
}

.dropdown-item .icon-svg,
.dropdown-item__icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-right: 8px;
}

.dropdown-divider { margin: 4px -4px; }
.modal-header, .modal-footer { padding: 12px 14px; }

#appDialogModal .modal-header {
    display: flex;
    align-items: center;
    min-height: 52px;
}

#appDialogModal .modal-title {
    margin: 0;
    line-height: 1.25;
}

#appDialogModal .modal-header .btn-close {
    margin: 0;
    padding: 0.5rem;
}

#appDialogModalMessage {
    white-space: pre-line;
}

#appDialogModal.app-dialog--rich #appDialogModalMessage {
    white-space: normal;
}

#appDialogModal.app-dialog--date-change .modal-content {
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 80%, transparent);
    border-radius: .75rem;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .04),
        0 18px 40px rgba(15, 23, 42, .14);
    overflow: hidden;
}

#appDialogModal.app-dialog--date-change .modal-header {
    border-bottom: 1px solid color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 70%, transparent);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    min-height: 56px;
    padding: .9rem 1.1rem;
}

#appDialogModal.app-dialog--date-change .modal-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: #0f172a;
}

#appDialogModal.app-dialog--date-change .modal-body {
    padding: 1.1rem 1.1rem 1rem;
}

#appDialogModal.app-dialog--date-change .modal-footer {
    border-top: 1px solid color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 70%, transparent);
    background: #f8fafc;
    padding: .85rem 1.1rem;
    gap: .5rem;
}

#appDialogModal.app-dialog--date-change .modal-footer .btn {
    box-shadow: none !important;
}

#appDialogModal.app-dialog--date-change #appDialogModalConfirm {
    background: var(--brand-accent, #0B679E);
    border-color: var(--brand-accent, #0B679E);
    color: #fff;
    font-weight: 500;
}

#appDialogModal.app-dialog--date-change #appDialogModalConfirm:hover {
    filter: brightness(1.05);
}

#appDialogModalDialog.app-dialog-date {
    max-width: 420px;
}

.app-date-change__flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: .55rem;
}

.app-date-change__chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    padding: .7rem .8rem;
    border-radius: .55rem;
    border: 1px solid transparent;
    min-width: 0;
}

.app-date-change__chip--from {
    background: #f1f5f9;
    border-color: color-mix(in srgb, #cbd5e1 70%, transparent);
}

.app-date-change__chip--to {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 28%, #cbd5e1);
}

.app-date-change__label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.app-date-change__chip--to .app-date-change__label {
    color: color-mix(in srgb, var(--brand-accent, #0B679E) 75%, #64748b);
}

.app-date-change__date {
    font-size: 1.05rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    line-height: 1.25;
}

.app-date-change__chip--to .app-date-change__date {
    color: var(--brand-accent, #0B679E);
}

.app-date-change__time {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: #64748b;
}

.app-date-change__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    align-self: center;
}

.app-date-change__hint {
    margin: .85rem 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #64748b;
}

@media (max-width: 480px) {
    .app-date-change__flow {
        grid-template-columns: 1fr;
        gap: .45rem;
    }

    .app-date-change__arrow {
        transform: rotate(90deg);
        padding: .1rem 0;
    }
}
.modal-title {
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.modal-body { padding: 14px; }

/* Сетка полей: авто-ширина по содержимому, фиксируем только узкие колонки */
.app-data-grid {
    width: 100% !important;
    table-layout: auto;
}

.app-data-grid .app-col-id { width: 52px; }
.app-data-grid .app-col-name { width: auto; min-width: 120px; }
.app-data-grid .app-col-type { width: auto; min-width: 140px; }
.app-data-grid .app-col-tab { width: auto; min-width: 100px; }
.app-data-grid .app-col-db { width: auto; min-width: 160px; }
.app-data-grid .app-col-required { width: 88px; }
.app-data-grid .app-col-actions { width: 72px; }

.app-data-grid th,
.app-data-grid td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-data-grid th:last-child,
.app-data-grid td:last-child {
    text-align: right;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-height: 0;
    white-space: nowrap;
}

/* Вторая карточка под таблицей (системные поля и т.п.) */
.card + .card {
    margin-top: var(--app-section-gap);
}

/* Отступы первой/последней колонки внутри карточки */
.card .table thead th:first-child,
.card .table tbody td:first-child,
.card .table-responsive .table thead th:first-child,
.card .table-responsive .table tbody td:first-child {
    padding-left: var(--app-card-padding);
}

.card .table thead th:last-child,
.card .table tbody td:last-child,
.card .table-responsive .table thead th:last-child,
.card .table-responsive .table tbody td:last-child {
    padding-right: var(--app-card-padding);
}

@media (max-width: 767.98px) {
    .dt-container .dt-search,
    .dt-container .dt-paging,
    .dt-container .dt-length,
    .dt-container .dt-info { justify-content: flex-start; }
}

.card.mb-3,
.alert.mb-3,
.subheader.mb-3 { margin-bottom: var(--app-section-gap) !important; }

/* Сервисная панель списка записей — те же outline-кнопки, что и в остальной системе. */
.service-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

/* Панель фильтров списка записей */
.items-filters {
    --filters-radius: 12px;
    --filters-control-radius: 10px;
    --filters-border: color-mix(in srgb, var(--brand-accent, #0B679E) 6%, #e8eef3);
    --filters-soft: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #f7fafc);
    --filters-ink: #5b6b7c;
    --filters-muted: #8a97a5;
    margin-bottom: var(--app-section-gap);
    font-size: 13.5px;
}

.items-filters__bar-head {
    display: contents;
}

.items-filters__bar-title {
    display: none;
}

.items-filters-toggle-host {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.items-filters-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--filters-soft, #f7fafc);
    color: var(--filters-ink, #5b6b7c);
    line-height: 1;
    cursor: pointer;
    overflow: visible;
    transition: color .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.items-filters-icon-btn:hover {
    color: var(--brand-accent, #0B679E);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
}

/* Активный / открытый */
.items-filters-icon-btn.is-open,
.items-filters-icon-btn.is-filtered {
    color: var(--brand-accent, #0B679E);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 10%, #fff);
    border-color: transparent;
    box-shadow: none;
}

.items-filters-icon-btn.is-open {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 12%, #fff);
}

.items-filters-icon-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.items-filters-icon-btn__icon svg {
    width: 16px;
    height: 16px;
}

.items-filters-icon-btn__badge {
    position: absolute;
    top: 1px;
    right: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--brand-accent, #0B679E);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 0 0 1.5px #fff;
}

.qf-bar .items-filters-icon-btn {
    flex: 0 0 auto;
    align-self: center;
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
}

.service-toolbar .items-filters-icon-btn {
    flex: 0 0 auto;
}

/* Не клипать бейдж счётчика у края шапки */
.page-header,
.page-header .row,
.page-header-actions-right,
.service-toolbar,
.qf-bar {
    overflow: visible;
}

.items-filters--collapsible.is-collapsed:not(.has-active-chips) {
    display: none;
}

/* Фильтры по умолчанию — только при открытой панели (сверху) или в боковой колонке */
.items-filters--collapsible.is-collapsed .items-filters__chip--default {
    display: none !important;
}

.items-filters--collapsible.is-collapsed .items-filters__bar--filters,
.items-filters--collapsible.is-collapsed .items-filters__footer,
.items-filters--collapsible.is-collapsed .items-filters__bar--save {
    display: none !important;
}

.items-filters--collapsible.is-collapsed.has-active-chips {
    margin-bottom: 12px;
}

.items-list-layout--filters-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--filters-panel-width, 280px);
    gap: 20px;
    align-items: start;
    flex: 1 1 auto;
    min-height: 0;
}

.items-list-layout__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.items-list-layout__aside {
    position: sticky;
    top: 12px;
}

.items-list-layout__aside .items-filters {
    margin-bottom: 0;
}

.items-filters--right .items-filters__bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    max-height: calc(100vh - 24px);
    background: #fff;
    border: 1px solid var(--filters-border);
    border-radius: var(--filters-radius);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .05), 0 1px 2px rgba(15, 23, 42, .03);
}

.items-filters--right .items-filters__bar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    background: transparent;
    border-bottom: none;
}

.items-filters--right .items-filters__bar-title {
    display: inline;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: .01em;
    color: #64748b;
}

.items-filters--right .items-filters__form {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    padding: 4px 16px 16px;
    gap: 12px;
    background: transparent;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.items-filters--right .items-filters__control,
.items-filters--right .items-filters .form-control.items-filters__control,
.items-filters--right .items-filters .form-select.items-filters__control,
.items-filters--right .items-filters__field > .form-control,
.items-filters--right .items-filters__field > .form-select,
.items-filters--right .items-filters__field .form-control,
.items-filters--right .items-filters__field .form-select {
    background-color: #fff;
}

.items-filters--right .items-filters__icon {
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 0;
    width: 18px;
    min-width: 18px;
    height: 18px;
}

.items-filters--right .items-filters__fields {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: transparent;
    padding-bottom: 4px;
    gap: 10px;
    box-sizing: border-box;
}

/* inline width из редактора — только для верхнего ряда; справа всегда на всю колонку */
.items-filters--right .items-filters__field,
.items-filters--right .items-filters__field--date,
.items-filters--right .items-filters__field--period,
.items-filters--right .items-filters__field--switch,
.items-filters--right .items-filters__field--multi {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.items-filters--right .items-filters__field--period {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.items-filters--right .items-filters__field--period > input,
.items-filters--right .items-filters__field--period > .flatpickr-input-wrap,
.items-filters--right .items-filters__field--period > .field-layout-input-icon-wrap,
.items-filters--right .items-filters__field .field-layout-input-icon-wrap,
.items-filters--right .items-filters__field .flatpickr-input-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.items-filters--right .items-filters__footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 10px;
    padding: 0 2px;
}

.items-filters--right .items-filters__presets {
    flex-direction: column;
    align-items: stretch;
}

.items-filters--right .items-filters__presets-list {
    flex-wrap: wrap;
}

.items-filters__save-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 0;
    width: var(--app-control-height);
    min-width: var(--app-control-height);
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: #64748b;
    user-select: none;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.items-filters__save-trigger:hover {
    color: var(--brand-accent, #0B679E);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
    border-color: transparent;
}

.items-filters--right .items-filters__save-trigger {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0 10px;
    gap: 6px;
    border-radius: 6px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
    border: 1px solid #e4eaf0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
    color: var(--filters-muted, #8a97a5);
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}

.items-filters--right .items-filters__save-trigger:hover {
    color: var(--brand-accent, #0B679E);
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #d5dde6;
}

.items-filters--right .items-filters__save-trigger .items-filters__action-icon {
    display: inline-flex;
    flex: 0 0 auto;
}

.items-filters--right .items-filters__save-trigger .items-filters__action-label {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.items-filters:not(.items-filters--right) .items-filters__save-trigger .items-filters__action-label {
    display: none;
}

.items-filters--right .items-filters__active {
    margin-bottom: 12px;
}

.filter-editor__preview.items-filters--right {
    max-width: 280px;
    width: 100%;
}

@media (max-width: 992px) {
    .items-list-layout--filters-right {
        grid-template-columns: 1fr;
    }

    .items-list-layout__aside {
        position: static;
        order: -1;
    }
}

.items-filters__active {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

/* Сверху при открытой панели чипы не нужны: значения уже в полях,
   а отдельная строка съедает высоту под таблицу. */
.items-filters:not(.items-filters--right):not(.is-collapsed) .items-filters__active {
    display: none;
}

.items-filters__active-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-width: 16px;
    height: 16px;
    color: #94a3b8;
    flex: 0 0 auto;
}

.items-filters__active-icon svg {
    width: 14px;
    height: 14px;
}

.items-filters__chip {
    display: inline-flex;
    align-items: center;
    max-width: min(320px, 100%);
    background: #f8fafc;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.2;
    overflow: hidden;
    box-shadow:
        inset 0 0 0 1px #e8eef3,
        0 1px 0 rgba(255, 255, 255, .9);
}

.items-filters__chip--default {
    background: #fafbfc;
}

.items-filters__chip-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 5px 10px;
    color: #64748b;
    font-weight: 400;
}

.items-filters__chip:has(.items-filters__chip-remove) .items-filters__chip-text {
    padding-right: 2px;
}

.items-filters__chip-key {
    color: #94a3b8;
    flex-shrink: 0;
    font-weight: 400;
}

.items-filters__chip-key::after {
    content: ':';
}

.items-filters__chip-val {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.items-filters__chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    margin-right: 2px;
    border-radius: 5px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    line-height: 1;
}

.items-filters__chip-remove:hover {
    color: var(--tblr-danger);
    background: color-mix(in srgb, var(--tblr-danger) 8%, transparent);
    text-decoration: none;
}

.items-filters__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--filters-border);
    border-radius: var(--filters-radius);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .04);
}

.items-filters__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-width: 18px;
    height: 18px;
    margin-top: 0;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
}

.items-filters__icon svg {
    width: 15px;
    height: 15px;
}

.items-filters__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.items-filters__fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.items-filters__field {
    display: flex;
    align-items: center;
    flex: 1 1 140px;
    min-width: 120px;
    max-width: 220px;
}

.items-filters__field--date {
    max-width: 160px;
}

.items-filters__field--period {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
    min-width: 220px;
    max-width: 320px;
}

.items-filters__field--switch {
    align-items: center;
    flex: 0 0 auto;
    max-width: none;
}

.items-filters__field--switch .entity-report-filter-switch {
    flex-wrap: nowrap;
}

.items-filters__field--multi {
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 320px;
}

.items-filters__field--search {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 280px;
    align-items: stretch;
}

.items-filters__field--multi .users-picker,
.items-filters__field--multi .field-layout-input-icon-wrap,
.items-filters__field--search .users-picker,
.items-filters__field--search .field-layout-input-icon-wrap {
    width: 100%;
    min-width: 0;
}

.items-filters__field--multi .users-picker__control,
.items-filters__field--search .users-picker__control {
    min-height: 34px;
}

.items-filters--right .items-filters__field--multi,
.items-filters--right .items-filters__field--search {
    max-width: none;
    width: 100%;
}

.filter-editor__preview .items-filters__field--multi .users-picker,
.filter-editor__preview .items-filters__field--multi [data-users-picker-preview] {
    pointer-events: none;
}

.items-filters__field--period .items-filters__control {
    flex: 1 1 0;
    min-width: 0;
}

.items-filters__period-sep {
    flex: 0 0 auto;
    color: var(--filters-muted);
    font-size: 13px;
    line-height: 1;
    opacity: .7;
}

/* Все контролы в полоске фильтров — одна высота с кнопками/датами/селектами */
.items-filters__control,
.items-filters .form-control.items-filters__control,
.items-filters .form-select.items-filters__control,
.items-filters .form-control-sm.items-filters__control,
.items-filters .form-select-sm.items-filters__control {
    width: 100%;
    height: var(--app-control-height) !important;
    min-height: var(--app-control-height) !important;
    margin: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    background: #fff;
    border-color: color-mix(in srgb, var(--filters-border) 80%, #dbe3eb);
    border-radius: var(--filters-control-radius) !important;
    font-size: 13.5px !important;
    line-height: calc(var(--app-control-height) - 2px);
    box-sizing: border-box;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.items-filters__control:hover,
.items-filters .form-control.items-filters__control:hover,
.items-filters .form-select.items-filters__control:hover {
    border-color: color-mix(in srgb, var(--brand-accent) 18%, #d0d9e3);
}

/* Пикер связанной сущности в полоске фильтров — компактно, список по фокусу. */
.items-filters__related-picker {
    width: 100%;
    min-width: 0;
}
.items-filters__related-picker .related-entity-picker__row {
    width: 100%;
}
.items-filters__related-picker .related-entity-picker__control {
    width: 100%;
}
.items-filters__related-picker .related-entity-picker__search.items-filters__control {
    padding-right: 28px !important;
}
.items-filters__field .field-layout-input-icon-wrap:has(.items-filters__related-picker),
.items-filters__field .field-layout-input-body:has(.items-filters__related-picker) {
    width: 100%;
    min-width: 0;
}

.items-filters__field > .flatpickr-input-wrap,
.items-filters__field--period > .flatpickr-input-wrap,
.items-filters__field--date > .flatpickr-input-wrap {
    display: block;
    width: 100%;
    height: var(--app-control-height);
    min-height: var(--app-control-height);
}

.items-filters__field > .flatpickr-input-wrap > .form-control,
.items-filters__field--period > .flatpickr-input-wrap > .form-control,
.items-filters__field--date > .flatpickr-input-wrap > .form-control,
.items-filters__field > .form-control,
.items-filters__field > .form-select,
.items-filters__field--period > .form-control,
.items-filters__field--date > .form-control {
    height: var(--app-control-height) !important;
    min-height: var(--app-control-height) !important;
    margin: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: var(--filters-control-radius) !important;
    border-color: color-mix(in srgb, var(--filters-border) 80%, #dbe3eb);
    box-sizing: border-box;
}

.items-filters__control:focus,
.items-filters .form-control.items-filters__control:focus,
.items-filters .form-select.items-filters__control:focus,
.items-filters__field > .form-control:focus,
.items-filters__field > .form-select:focus {
    border-color: color-mix(in srgb, var(--brand-accent) 45%, #c5d4e0);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 12%, transparent);
    outline: none;
    background: #fff;
}

.items-filters__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
}

.items-filters__apply,
.items-filters__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 0;
    width: var(--app-control-height);
    min-width: var(--app-control-height);
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    padding: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: color .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.items-filters__action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.items-filters__action-icon svg {
    width: 16px;
    height: 16px;
}

.items-filters__action-label {
    display: none;
}

/* Выпуклая спокойная кнопка — без синей заливки */
.items-filters__apply {
    color: #475569;
    background: linear-gradient(180deg, #ffffff 0%, #f3f6f9 100%);
    border: 1px solid #dbe3eb;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 1px 2px rgba(15, 23, 42, .06);
}

.items-filters__apply:hover {
    color: #334155;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #cfd8e3;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .95) inset,
        0 2px 4px rgba(15, 23, 42, .08);
}

.items-filters__apply:active {
    color: #334155;
    background: #eef2f6;
    border-color: #c5d0dc;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .1);
}

.items-filters__apply:focus-visible {
    color: #334155;
    border-color: color-mix(in srgb, var(--brand-accent) 35%, #c5d0dc);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 12%, transparent);
    outline: none;
}

.items-filters__reset {
    color: #64748b;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

.items-filters__reset:hover {
    color: #475569;
    background: #f1f5f9;
    border-color: transparent;
    text-decoration: none;
}

.items-filters__reset:focus-visible {
    color: #475569;
    border-color: #cbd5e1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, .1);
}

/* Справа — подписи; пресет отдельной строкой, чтобы длинный текст не обрезался */
.items-filters--right .items-filters__actions {
    width: 100%;
    margin-left: 0;
    margin-top: auto;
    padding-top: 6px;
    gap: 8px;
    background: transparent;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.items-filters--right .items-filters__apply,
.items-filters--right .items-filters__reset {
    flex: 1 1 calc(50% - 4px);
    width: auto;
    min-width: 0;
    padding: 0 10px;
    gap: 6px;
    border-radius: 6px;
}

.items-filters--right .items-filters__action-icon {
    display: none;
}

.items-filters--right .items-filters__action-label {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.items-filters--right .items-filters__reset {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fb 100%);
    border: 1px solid #e4eaf0;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset;
}

.items-filters--right .items-filters__reset:hover {
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border-color: #d5dde6;
}

.items-filters__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 10px;
    padding: 0 2px;
}

.items-filters__presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.items-filters__presets-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: var(--tblr-secondary-color);
    white-space: nowrap;
}

.items-filters__presets-label svg {
    width: 14px;
    height: 14px;
}

.items-filters__presets-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.filter-panel-chip {
    display: inline-flex;
    align-items: stretch;
    max-width: 100%;
    background: color-mix(in srgb, var(--brand-accent) 5%, #fff);
    border: none;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.2;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-accent) 10%, transparent);
}

.filter-panel-chip__link {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    padding: 5px 8px 5px 10px;
    color: color-mix(in srgb, var(--brand-accent) 70%, #334155);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.filter-panel-chip__link:hover {
    background: color-mix(in srgb, var(--brand-accent) 8%, transparent);
    color: var(--brand-accent);
    text-decoration: none;
}

.filter-panel-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 24px;
    padding: 0 7px;
    margin: 0;
    border: 0;
    border-left: 1px solid color-mix(in srgb, var(--brand-accent) 12%, transparent);
    border-radius: 0;
    color: color-mix(in srgb, var(--brand-accent) 55%, #8a97a5);
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    background: transparent;
}

.filter-panel-chip__remove:hover {
    color: var(--tblr-danger);
    background: color-mix(in srgb, var(--tblr-danger) 8%, transparent);
}

.items-filters__save-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.items-filters__save-label {
    margin: 0;
    font-size: 14px;
    color: var(--tblr-secondary-color);
    white-space: nowrap;
}

.items-filters__save-name {
    flex: 1 1 200px;
    max-width: 320px;
    min-width: 160px;
    height: var(--app-control-height) !important;
    min-height: var(--app-control-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box;
}

.items-filters.is-saving .items-filters__save-trigger {
    visibility: hidden;
}

.items-filters__save-form .btn {
    border-radius: 6px;
    font-size: 14px;
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    padding-top: 0;
    padding-bottom: 0;
}

@media (max-width: 767.98px) {
    .items-filters__bar {
        flex-direction: column;
        align-items: stretch;
    }

    .items-filters__icon {
        display: none;
    }

    .items-filters__field {
        max-width: none;
    }

    .items-filters__field--period {
        max-width: none;
    }

    .items-filters__actions {
        width: auto;
        margin-left: auto;
    }

    .items-filters:not(.items-filters--right) .items-filters__apply,
    .items-filters:not(.items-filters--right) .items-filters__reset {
        width: var(--app-control-height);
        min-width: var(--app-control-height);
        padding: 0;
    }

    .items-filters--right .items-filters__actions {
        width: 100%;
        margin-left: 0;
    }

    .items-filters__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .items-filters__save-trigger {
        margin-left: 0;
    }

    .items-filters__save-name {
        max-width: none;
    }
}

/* Отладка — служебная информация, а не авария: мягкая жёлтая подложка
   вместо тяжёлой чёрной консоли. */
.debug-panel {
    border-color: #ead99e;
    background: #fffdf5;
    box-shadow: none;
}

.debug-panel .card-body { padding: 10px 12px; }

.debug-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    color: #79601c;
    font-size: var(--app-font-size);
    line-height: 1.2;
}

.debug-panel-title svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.debug-query {
    padding: 8px 10px;
    overflow-x: auto;
    border: 1px solid #ebdca7;
    border-radius: var(--app-control-radius);
    background: #fff8d9;
    color: #5d4b19;
    font-size: var(--app-font-size);
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.debug-query code {
    padding: 0;
    background: transparent;
    color: inherit;
}

@media (max-width: 991.98px) {
    .service-toolbar {
        width: 100%;
        margin-top: 8px;
        justify-content: flex-start;
    }
}

/* --- страница «Мой профиль» --- */
.profile-page {
    max-width: 880px;
}

.profile-hero {
    position: relative;
    margin-bottom: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.profile-hero__body {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 8px 0 20px;
    border-bottom: 1px solid color-mix(in srgb, var(--tblr-border-color, var(--bs-border-color)) 70%, transparent);
}

.profile-hero__avatar-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.profile-avatar {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: color-mix(in srgb, var(--tblr-primary) 10%, transparent);
    border: 0;
    box-shadow: none;
}

.profile-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--tblr-primary);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
}

.profile-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.profile-avatar-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--tblr-primary);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease;
}

.profile-avatar-pick:hover {
    background: color-mix(in srgb, var(--tblr-primary) 8%, transparent);
}

.profile-avatar-pick svg {
    width: 14px;
    height: 14px;
}

.profile-avatar-submit {
    min-width: 96px;
}

.profile-avatar-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.profile-avatar-submit:not(:disabled) {
    animation: profile-upload-ready .25s ease;
}

@keyframes profile-upload-ready {
    from { transform: translateY(2px); opacity: .6; }
    to { transform: none; opacity: 1; }
}

.profile-hero__meta {
    min-width: 0;
    flex: 1 1 auto;
}

.profile-hero__eyebrow {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--tblr-secondary-color);
    margin-bottom: 2px;
}

.profile-hero__name {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--tblr-body-color);
}

.profile-hero__login {
    display: inline-flex;
    margin-top: 8px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--tblr-secondary-color);
    font-size: 13px;
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace) !important;
}

.profile-hero__hint {
    margin: 8px 0 0;
    color: var(--tblr-secondary-color);
    font-size: 13px;
    line-height: 1.4;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0 40px;
        align-items: start;
    }
}

.profile-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 22px 0 8px;
}

@media (min-width: 900px) {
    .profile-panel + .profile-panel {
        border-left: 1px solid color-mix(in srgb, var(--tblr-border-color, var(--bs-border-color)) 70%, transparent);
        padding-left: 40px;
    }
}

.profile-panel__head {
    margin-bottom: 16px;
}

.profile-panel__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.25;
}

.profile-panel__subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--tblr-secondary-color);
}

.profile-panel__form .form-label {
    font-size: 13px;
}

.profile-readonly-field {
    display: flex;
    align-items: center;
    min-height: var(--app-control-height, 36px);
    padding: 0 12px;
    border: 1px solid var(--tblr-border-color-translucent, var(--bs-border-color));
    border-radius: var(--app-control-radius, 8px);
    background: color-mix(in srgb, var(--tblr-body-bg, var(--bs-body-bg)) 65%, transparent);
    color: var(--tblr-secondary-color);
    font-size: var(--app-font-size, 14px);
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace) !important;
}

.profile-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--tblr-border-color, var(--bs-border-color)) 55%, transparent);
}

.profile-form-actions .btn {
    margin: 0;
    padding: 0 16px;
}

.profile-page .input-group .btn {
    min-width: var(--app-control-height, 36px);
    padding: 0;
}

.profile-page .input-group .btn svg.feather {
    width: 14px;
    height: 14px;
    margin: 0;
}

@media (max-width: 575.98px) {
    .profile-hero__body {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 4px 0 18px;
    }

    .profile-hero__avatar-form {
        align-items: flex-start;
    }
}

/* --- подсказка под заголовком страницы (вместо тяжёлого alert-secondary) --- */
.page-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--tblr-primary) 12%, transparent);
    border-radius: var(--app-control-radius);
    background: color-mix(in srgb, var(--tblr-primary) 4%, var(--tblr-bg-surface));
    color: var(--tblr-secondary-color);
    font-size: var(--app-font-size-sm);
    line-height: 1.45;
}

.page-hint svg.feather {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex: 0 0 auto;
    color: var(--tblr-primary);
}

/* legacy: старые alert-secondary.small выглядят как page-hint */
.alert.alert-secondary.small {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: var(--app-section-gap);
    border: 1px solid color-mix(in srgb, var(--tblr-primary) 12%, transparent);
    border-radius: var(--app-control-radius);
    background: color-mix(in srgb, var(--tblr-primary) 4%, var(--tblr-bg-surface));
    color: var(--tblr-secondary-color);
    font-size: var(--app-font-size-sm);
    line-height: 1.45;
}

.alert.alert-info:not(.alert-dismissible) {
    padding: 10px 12px;
    margin-bottom: var(--app-section-gap);
    border-radius: var(--app-control-radius);
    font-size: var(--app-font-size-sm);
    line-height: 1.45;
}

.ui-form-card .card-header .card-title {
    font-weight: 600;
}

/* Форма настроек поля — на всю ширину контента, две колонки */
.ui-form-card:has(.field-form),
.ui-form-card:has(.field-form--has-choices) {
    max-width: none;
    width: 100%;
}

.field-form.row {
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    margin-left: 0;
    margin-right: 0;
}

.field-form:not(.field-form--has-choices) #field-form-core {
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
}

#field-form-side {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

#field-form-side > .col-12 {
    width: 100%;
    max-width: 100%;
    flex: none;
    padding-left: 0;
    padding-right: 0;
}

/* Блоки настроек типа в форме поля — отдельные карточки, без склейки */
#field-form-side > .col-12[style*="display: none"],
#field-form-side > .col-12[style*="display:none"] {
    display: none !important;
}

#field-form-side > #related-sum-block:not([style*="display: none"]):not([style*="display:none"]) {
    margin-top: 0.75rem;
}

@media (min-width: 992px) {
    .field-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 1rem;
        row-gap: 0.5rem;
        align-items: start;
    }

    .field-form > #field-form-core,
    .field-form > #choices-block,
    .field-form > #field-form-side,
    .field-form > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: none;
    }

    .field-form > #field-form-core {
        grid-column: 1;
        grid-row: 1;
    }

    .field-form > #choices-block {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
    }

    .field-form:not(.field-form--has-choices) > #field-form-side {
        grid-column: 2;
        grid-row: 1;
    }

    .field-form--has-choices > #field-form-side {
        grid-column: 1 / -1;
    }

    .field-form > .modal {
        grid-column: 1 / -1;
    }

    .field-form > .field-form__actions-col {
        grid-column: 1 / -1;
    }
}

.field-form > * {
    order: 10;
}

.field-form > #field-form-core {
    order: 1;
}

.field-form > #choices-block {
    order: 2;
}

.field-form > #field-form-side {
    order: 3;
}

.field-form > .field-form__actions-col {
    order: 100;
    margin-top: 0.75rem;
    padding-top: 0.35rem;
}

.field-form .form-label {
    margin-bottom: 0.15rem;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}

.field-form .form-text {
    margin-top: 0.15rem;
    font-size: 12px;
    line-height: 1.35;
}

.field-form .alert {
    font-size: 12.5px;
}

.field-form__flags {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius);
    background: var(--tblr-bg-surface-secondary, var(--app-table-zebra));
}

.field-form__flags--inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 1rem;
    padding: 0.4rem 0.65rem;
}

.field-form__flags-checks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 0.4rem 1rem;
}

.field-form__encrypt {
    padding-top: 0.45rem;
    margin-top: 0.15rem;
    border-top: 1px solid var(--tblr-border-color-translucent);
}

.field-form__encrypt .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.field-form__encrypt .form-text {
    padding-left: 1.55rem;
    max-width: 40rem;
    line-height: 1.35;
}

@media (min-width: 576px) {
    .field-form__flags-checks {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.field-form__flags .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    min-height: 0;
    min-width: 0;
    padding-left: 0;
}

.field-form__flags .form-check-input {
    float: none;
    margin: 0;
    position: static;
    flex-shrink: 0;
}

.field-form__flags .form-check-label {
    margin: 0;
    font-size: 13px;
    line-height: 1.25;
    min-width: 0;
}

/* Форма бланка XLSX — на всю ширину, без пустой боковой колонки */
.order-blank-form {
    width: 100%;
    max-width: none;
}

.order-blank-form__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--app-table-border, #e8ecf1);
    border-radius: var(--app-control-radius, 0.375rem);
}

.order-blank-form__toolbar-hint {
    flex: 1 1 280px;
    min-width: 0;
    line-height: 1.35;
}

.order-blank-form__toolbar-actions,
.order-blank-form__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.order-blank-form__footer {
    margin-top: 16px;
    padding-top: 4px;
}

.order-blank-form .field-form__flags {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.45rem 1rem;
}

.field-form__inline-select {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(15, 45, 66, .1);
}

.field-form__inline-select .form-label {
    margin: 0;
    white-space: nowrap;
    color: inherit;
    font-weight: 500;
    font-size: 13px;
}

.field-form__inline-select .form-select {
    width: auto;
    min-width: 11rem;
    max-width: 16rem;
}

.field-form__boolean-style {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding-top: 0.35rem;
    border-top: 1px dashed rgba(15, 45, 66, .1);
}
.field-form__boolean-style .field-form__inline-select {
    padding-top: 0;
    border-top: 0;
}
.field-form__boolean-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.field-form__boolean-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 148px;
    padding: 12px 14px;
    border: 1px solid var(--app-table-border, #e6ebf0);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
    overflow: hidden;
}
.field-form__boolean-preview:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 35%, var(--app-table-border, #e6ebf0));
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 3%, #fff);
}
.field-form__boolean-preview.is-selected {
    border-color: var(--brand-accent, #0B679E);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 6%, #fff);
}
.field-form__boolean-preview:focus-visible {
    outline: 1px solid var(--brand-accent, #0B679E);
    outline-offset: 1px;
}
.field-form__boolean-preview-demos {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}
.field-form__boolean-preview-name {
    font-size: 12px;
    color: #5a7388;
    line-height: 1.25;
}
.field-form__boolean-preview.is-selected .field-form__boolean-preview-name {
    color: var(--brand-accent, #0B679E);
}

.field-form__boolean-listing-icons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed rgba(15, 45, 66, .1);
}
.field-form__boolean-listing-icon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.field-form__boolean-listing-icon-label {
    flex: 0 0 2.5rem;
    font-size: 12.5px;
    font-weight: 600;
    color: #475569;
}
.field-boolean-listing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.field-boolean-listing-icon,
.field-boolean-listing-icon svg,
.field-boolean-listing-icon .icon-svg,
.field-boolean-listing-icon .icon-value-svg,
.field-boolean-listing-icon .icon-value-svg svg {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-accent, #0B679E);
}
.field-boolean-listing-icon svg {
    width: 16px;
    height: 16px;
}

.field-choices-editor {
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius);
    background: var(--tblr-bg-surface-secondary, var(--app-table-zebra));
    padding: 0.4rem 0.5rem;
    max-width: none;
}

.field-choices-editor__none {
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(15, 45, 66, .08);
}

.field-choices-editor__default {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: pointer;
    color: #64748b;
    font-size: 12.5px;
    user-select: none;
}

.field-choices-editor__default input {
    margin: 0;
    accent-color: var(--tblr-primary, #0b679e);
}

.field-choices-editor__list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.field-choices-editor__row {
    display: grid;
    grid-template-columns: 1.25rem auto auto minmax(0, 1fr) minmax(140px, 1.1fr) auto auto;
    gap: 0.35rem;
    align-items: center;
    padding: 0.1rem 0;
    border-radius: 4px;
}

.field-choices-editor__row.is-dragging {
    opacity: 0.55;
}

.field-choices-editor__row.is-drag-over {
    box-shadow: inset 0 2px 0 0 var(--tblr-primary, #206bc4);
}

.field-choices-editor__handle {
    cursor: grab;
    color: #94a3b8;
    font-size: 0.7rem;
    letter-spacing: -0.12em;
    user-select: none;
    line-height: 1;
    text-align: center;
}

.field-choices-editor__handle:active {
    cursor: grabbing;
}

.field-choices-editor__icon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.field-choices-editor__icon > .form-select {
    min-width: 0;
    flex: 1 1 72px;
    max-width: 100%;
}

.field-choices-editor__pick {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.field-choices-editor__svg-btn [data-choice-icon-preview] {
    width: var(--choice-svg-preview-size, 16px);
    height: var(--choice-svg-preview-size, 16px);
    min-width: var(--choice-svg-preview-size, 16px);
    min-height: var(--choice-svg-preview-size, 16px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    overflow: visible;
}

.field-choices-editor__svg-btn [data-choice-icon-preview] svg,
.field-choices-editor__svg-btn [data-choice-icon-preview] .icon-svg {
    width: 16px !important;
    height: 16px !important;
    display: block;
    overflow: visible;
}

.field-choices-editor__icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
    max-height: min(62vh, 520px);
    overflow: auto;
    padding: 2px;
}

.field-choices-editor__icon-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 64px;
    padding: 6px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
}

.field-choices-editor__icon-cell:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 35%, #d8dee6);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 5%, #fff);
}

.field-choices-editor__icon-cell.is-selected {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 45%, #d8dee6);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
    color: var(--brand-accent, #0B679E);
}

.field-choices-editor__icon-cell-glyph {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    overflow: visible;
}

.field-choices-editor__icon-cell-glyph svg,
.field-choices-editor__icon-cell-glyph .icon-svg {
    width: 18px !important;
    height: 18px !important;
    display: block;
    overflow: visible;
}

.field-choices-editor__svg-btn [data-choice-icon-preview] .field-choices-editor__icon-img,
.field-choices-editor__icon-cell-glyph .field-choices-editor__icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: none;
}

.field-choices-editor__icon-cell-label {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    color: #64748b;
    max-width: 100%;
}

.field-choices-editor__svg {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.field-choices-editor__svg-btn {
    --choice-svg-preview-size: 18px;
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    background: #fff;
    overflow: visible;
}

.field-choices-editor__svg-btn [data-choice-svg-preview],
.field-choices-editor__svg-btn [data-choice-icon-preview] {
    width: var(--choice-svg-preview-size);
    height: var(--choice-svg-preview-size);
    min-width: var(--choice-svg-preview-size);
    min-height: var(--choice-svg-preview-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    overflow: visible;
    color: inherit;
    font-size: var(--choice-svg-preview-size);
}

.field-choices-editor__svg-btn [data-choice-svg-preview] .icon-value-svg,
.field-choices-editor__svg-btn [data-choice-svg-preview] .icon-svg,
.field-choices-editor__svg-btn [data-choice-svg-preview] svg,
.field-choices-editor__svg-btn [data-choice-svg-preview] .icon-value-svg svg,
.field-choices-editor__svg-btn [data-choice-icon-preview] svg,
.field-choices-editor__svg-btn [data-choice-icon-preview] .icon-svg {
    width: var(--choice-svg-preview-size) !important;
    height: var(--choice-svg-preview-size) !important;
    min-width: var(--choice-svg-preview-size) !important;
    min-height: var(--choice-svg-preview-size) !important;
    max-width: var(--choice-svg-preview-size) !important;
    max-height: var(--choice-svg-preview-size) !important;
    display: block;
    flex-shrink: 0;
    color: inherit;
    overflow: visible;
}

.field-choices-editor__svg-btn [data-choice-svg-preview].text-muted {
    font-size: 16px;
    line-height: 1;
    color: #94a3b8;
}

.field-choices-editor__svg-modal-preview {
    min-height: 120px;
    background: #f8fafc;
    color: #334155;
}

.field-choices-editor__svg-modal-preview svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
}

.field-choices-editor__color {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.field-choices-editor__color-picker {
    width: 1.85rem;
    height: 1.85rem;
    min-width: 1.85rem;
    padding: 0.12rem;
    cursor: pointer;
}

.field-choices-editor__color-picker.is-empty {
    opacity: 0.45;
}

.field-choices-editor__color-clear {
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    line-height: 1;
    color: #94a3b8;
}

.field-choice-label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.25;
    overflow: visible;
}

/* В таблице: статус как плоская кнопка одной ширины */
.app-page-table .table td .field-choice-label,
table.table.dataTable td .field-choice-label,
.item-page-subentity__table td .field-choice-label,
.matched-records__table td .field-choice-label,
.dash-report-widget table td .field-choice-label {
    --list-icon-size: 14px;
    box-sizing: border-box;
    width: 9.5rem;
    min-width: 9.5rem;
    max-width: 9.5rem;
    padding: 3px 8px 3px 6px;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #d0d5dd) 88%, #94a3b8);
    background: #fff;
    box-shadow: none;
    vertical-align: middle;
}

.app-page-table .table td .field-choice-label .field-choice-label__text,
table.table.dataTable td .field-choice-label .field-choice-label__text,
.item-page-subentity__table td .field-choice-label .field-choice-label__text,
.matched-records__table td .field-choice-label .field-choice-label__text,
.dash-report-widget table td .field-choice-label .field-choice-label__text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Цветная подложка — только в таблицах, на странице записи нет */
.app-page-table .table td .field-choice-label--tinted,
table.table.dataTable td .field-choice-label--tinted,
.item-page-subentity__table td .field-choice-label--tinted,
.matched-records__table td .field-choice-label--tinted,
.dash-report-widget table td .field-choice-label--tinted {
    --choice-color: #94a3b8;
    border-color: color-mix(in srgb, var(--choice-color) 18%, #dde3ea);
    background: color-mix(in srgb, var(--choice-color) 8%, #ffffff);
    box-shadow: none;
    color: inherit;
}

.app-page-table .table td .field-choice-label--tinted .field-choice-label__icon,
table.table.dataTable td .field-choice-label--tinted .field-choice-label__icon,
.item-page-subentity__table td .field-choice-label--tinted .field-choice-label__icon,
.matched-records__table td .field-choice-label--tinted .field-choice-label__icon,
.dash-report-widget table td .field-choice-label--tinted .field-choice-label__icon {
    color: #5a7388;
}

.app-page-table .table td .field-choice-label--tinted .field-choice-label__sep,
table.table.dataTable td .field-choice-label--tinted .field-choice-label__sep,
.item-page-subentity__table td .field-choice-label--tinted .field-choice-label__sep,
.matched-records__table td .field-choice-label--tinted .field-choice-label__sep,
.dash-report-widget table td .field-choice-label--tinted .field-choice-label__sep {
    background: color-mix(in srgb, var(--tblr-border-color, #d0d5dd) 85%, #94a3b8);
}

.field-choice-label__text {
    min-width: 0;
    font-size: 14px;
    line-height: 1.25;
}

.field-choice-label__sep {
    flex: 0 0 auto;
    width: 1px;
    align-self: stretch;
    min-height: 16px;
    margin: 0 7px;
    background: color-mix(in srgb, var(--tblr-border-color, #d0d5dd) 85%, #94a3b8);
}

.field-choice-label__icon {
    --list-icon-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--list-icon-size);
    height: var(--list-icon-size);
    min-width: var(--list-icon-size);
    min-height: var(--list-icon-size);
    font-size: var(--list-icon-size);
    color: #5a7388;
    line-height: 0;
    /* Свои SVG часто без внутренних отступов — overflow:hidden срезает stroke */
    overflow: visible;
}

.field-choice-label__icon .icon-value-svg,
.field-choice-label__icon .icon-svg,
.field-choice-label__icon .icon-svg-custom {
    width: var(--list-icon-size) !important;
    height: var(--list-icon-size) !important;
    min-width: var(--list-icon-size) !important;
    min-height: var(--list-icon-size) !important;
    max-width: var(--list-icon-size) !important;
    max-height: var(--list-icon-size) !important;
    font-size: var(--list-icon-size) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
    overflow: visible !important;
}

.field-choice-label__icon svg,
.field-choice-label__icon svg.feather,
.field-choice-label__icon .icon-value-svg svg,
.field-choice-label__icon .icon-svg-custom svg,
.field-choice-label__icon .icon-svg-custom {
    /* Чуть меньше слота: свои SVG без padding — stroke не упирается в край ячейки */
    width: calc(var(--list-icon-size) - 1px) !important;
    height: calc(var(--list-icon-size) - 1px) !important;
    min-width: calc(var(--list-icon-size) - 1px) !important;
    min-height: calc(var(--list-icon-size) - 1px) !important;
    max-width: calc(var(--list-icon-size) - 1px) !important;
    max-height: calc(var(--list-icon-size) - 1px) !important;
    display: block;
    flex-shrink: 0;
    overflow: visible !important;
}

.field-choice-label__icon .icon-svg,
.field-choice-label__icon .icon-svg--max {
    fill: currentColor;
}

.field-choice-label__icon svg.feather {
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
}

.field-choice-values {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 0;
}

.field-choice-values__sep {
    color: #94a3b8;
    /* пробел после запятой иначе схлопывается во flex-элементе */
    white-space: pre;
}

.field-choices-editor__row .field-choices-editor__default {
    width: 24px;
    height: 24px;
    justify-content: center;
}

.field-choices-editor__id {
    min-width: 2.25rem;
    padding: 0 0.15rem;
    color: #94a3b8;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-align: right;
    user-select: all;
    line-height: 1;
}

.field-choices-editor__remove {
    color: #94a3b8;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.field-choices-editor__remove:hover {
    color: var(--tblr-danger);
    background: rgba(220, 53, 69, 0.06);
}

.field-form .related-entity-cfg {
    padding: 0.9rem 1rem;
    border-radius: 8px;
}

.field-form #related-sum-block .related-entity-cfg {
    padding: 1rem 1.1rem 1.05rem;
}

.field-form #related-sum-block .form-text {
    margin-top: 0.35rem;
    line-height: 1.45;
}

@media (min-width: 576px) {
    .field-form #numeric-field-block .row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .field-form #numeric-field-block .row > [class*="col-"] {
        width: auto;
        max-width: none;
        flex: none;
        padding: 0;
    }

    .field-form #numeric-field-block #numeric-quick-options-wrap {
        grid-column: 1 / -1;
    }

    .field-form #related-sum-block .row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.85rem 1rem;
    }

    .field-form #related-sum-block .row > [class*="col-"] {
        width: auto;
        max-width: none;
        flex: none;
        padding: 0;
    }

    .field-form #related-sum-block .row > .col-12,
    .field-form #related-sum-block #related-sum-multi-wrap {
        grid-column: 1 / -1;
    }
}

.field-form .related-entity-cfg > .text-muted.small,
.field-form .related-entity-cfg > .text-secondary.small,
.field-form .related-entity-cfg > p.small {
    margin-bottom: 0.5rem !important;
}

.field-form .related-entity-cfg__maps {
    margin-top: 0.65rem !important;
}

.field-form .border.rounded.p-3 {
    padding: 0.55rem 0.65rem !important;
}

.field-form .fw-semibold.mb-2 {
    margin-bottom: 0.35rem !important;
}

.field-form .form-text.mb-2 {
    margin-bottom: 0.35rem !important;
}

.field-form .form-actions {
    margin-top: 0.25rem;
    padding-top: 0.35rem;
}

.entity-cfg-form .form-label {
    margin-bottom: 0.25rem;
}

.entity-cfg-form .form-text {
    margin-top: 0.25rem;
}

.entity-cfg-form .fa-icon-picker-preview {
    width: 38px;
    height: 38px;
}

.item-page-cfg-form .form-label {
    margin-bottom: 0.2rem;
    font-size: var(--app-font-size-sm);
}

.item-page-cfg-form .form-text {
    margin-top: 0.2rem;
}

.row-color-rules {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.row-color-rules__row {
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius);
    background: var(--tblr-bg-surface-secondary, var(--app-table-zebra));
}

.row-color-rules__color {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    max-width: 26rem;
}

.row-color-rules__color .js-row-color-picker {
    width: 2.25rem;
    height: 2rem;
    padding: 0.15rem;
    flex: 0 0 auto;
}

.row-color-rules__color .js-row-color-hex {
    width: 5.75rem;
    flex: 0 0 auto;
    text-transform: lowercase;
}

.row-color-rules__opacity {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.row-color-rules__opacity .js-row-color-opacity {
    width: 3.25rem;
    padding-left: 0.4rem;
    padding-right: 0.25rem;
    text-align: right;
}

.row-color-rules__opacity-suffix {
    font-size: 12px;
    color: var(--tblr-secondary-color, #667382);
    line-height: 1;
    user-select: none;
}

.row-color-rules__presets {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 11.5rem;
}

.row-color-rules__swatch {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    padding: 0;
    cursor: pointer;
}

.row-color-rules__swatch:hover {
    outline: 2px solid var(--tblr-primary);
    outline-offset: 1px;
}

.app-listing-heading-link,
a.app-listing-heading-link,
.app-page-table a.app-listing-heading-link,
table.table a.app-listing-heading-link,
a.app-listing-related-link,
a.related-entity-listing-link:not(.related-entity-listing-link--rich) {
    color: var(--tblr-primary);
    text-decoration: none;
    font-weight: 400 !important;
    font-synthesis: none;
    text-shadow: none !important;
    -webkit-text-stroke: 0;
    /* цветной текст на Retina с subpixel часто «плывёт»; grayscale = как у обычного текста по чёткости */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-listing-heading-link:hover,
a.app-listing-heading-link:hover,
.app-page-table a.app-listing-heading-link:hover,
table.table a.app-listing-heading-link:hover,
a.app-listing-related-link:hover,
a.related-entity-listing-link:not(.related-entity-listing-link--rich):hover {
    color: var(--tblr-primary);
    text-decoration: none;
    opacity: 1;
    font-weight: 400 !important;
    text-shadow: none !important;
}

.app-page-table .table > tbody > tr.app-listing-row--hl > *,
table.table.dataTable > tbody > tr.app-listing-row--hl > *,
.item-page-subentity__table > tbody > tr.app-listing-row--hl > *,
.matched-records__table > tbody > tr.app-listing-row--hl > *,
.list-group-item.app-listing-row--hl,
.card.app-listing-row--hl {
    --bs-table-bg: var(--listing-row-bg);
    --bs-table-striped-bg: var(--listing-row-bg);
    --bs-table-hover-bg: var(--listing-row-bg);
    background-color: var(--listing-row-bg) !important;
    box-shadow: none !important;
}

.app-page-table--fill .table > tbody > tr.app-listing-row--hl > td.app-table-col--actions {
    background-color: var(--listing-row-bg, #fff) !important;
    box-shadow: inset 0 0 0 9999px var(--listing-row-bg, #fff) !important;
}

.card.app-listing-row--hl .card-footer {
    background-color: transparent;
}

.items-filters .form-control.flatpickr-date {
    border-radius: 6px !important;
    font-size: 14px !important;
}

.ui-form-card .form-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid var(--tblr-border-color-translucent);
}

.form-actions .btn,
.ui-form-card .form-actions .btn {
    min-height: var(--app-control-height);
    padding: 0 14px;
    margin: 0;
}

/* --- пустое состояние страниц и списков --- */
.page-empty-state {
    padding: 40px 0 24px;
}

.page-empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--tblr-secondary-color);
    opacity: 0.42;
}

.page-empty-state__icon svg.feather {
    width: 30px;
    height: 30px;
    stroke-width: 1.5;
}

.page-empty-state__icon .icon-svg {
    width: 30px;
    height: 30px;
    opacity: 0.42;
}

.page-empty-state__title {
    margin-bottom: 4px;
    font-size: var(--app-font-size);
    font-weight: 400;
    color: var(--tblr-body-color);
}

.page-empty-state__text {
    max-width: 420px;
    margin: 0 auto 14px;
    color: var(--tblr-secondary-color);
    font-size: var(--app-font-size);
    line-height: 1.45;
}

/* --- список виджетов --- */
.widget-list-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 500;
}

.widget-list-title__icon {
    display: inline-flex;
    flex: 0 0 auto;
}

.widget-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.widget-list-tags .badge {
    font-weight: 500;
}

/* Выбор нескольких значений: список + метки (вместо native select multiple) */
.cfg-field-picker {
    min-width: 0;
    width: 100%;
}
.cfg-field-picker__select {
    width: 100%;
}
.cfg-field-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 8px 4px 8px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--app-control-radius, 0.375rem);
    background: var(--bs-tertiary-bg);
    font-size: 13px;
    line-height: 1.2;
}
.cfg-field-picker__chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cfg-field-picker__chip-remove {
    border: none;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}
.cfg-field-picker__chip-remove:hover {
    color: var(--bs-danger);
}

.item-page-subentity__row-main {
    font-weight: 500;
    line-height: 1.3;
}
.item-page-subentity__row-meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--bs-secondary-color);
    line-height: 1.3;
}
.item-page-subentity__row-inline {
    font-size: var(--app-font-size);
    line-height: 1.35;
}
.item-page-subentity__row-stacked .item-page-subentity__stack-line + .item-page-subentity__stack-line {
    margin-top: 2px;
}
.item-page-subentity__row-stacked .item-page-subentity__stack-line {
    font-size: var(--app-font-size);
    line-height: 1.35;
}
.item-page-subentity--layout {
    margin-bottom: 0.75rem;
}
.info-layout-root .item-page-subentity--layout:last-child {
    margin-bottom: 0;
}
.item-page-subentity .list-group-flush > .list-group-item {
    padding-left: var(--app-card-padding);
    padding-right: var(--app-card-padding);
}
.item-page-subentity .list-group-item:not(.list-group-item-action) {
    cursor: default;
}
.item-page-subentity__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 10px 8px;
    padding: 0;
    background: #fff;
    border: 1px solid #e6ebf1;
    border-radius: 8px;
}

/* Скругление + overflow-x обрезает крайние иконки — чуть больше воздуха справа у действий */
.item-page-subentity__table > thead > tr > th.item-page-subentity__th--actions,
.item-page-subentity__table > tbody > tr > td.item-page-subentity__td--actions,
.item-page-subentity__table > tfoot > tr > td.item-page-subentity__td--actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
    overflow: visible;
    padding-left: 6px;
    padding-right: 14px;
}

.item-page-subentity.keep-card .item-page-subentity__table > thead > tr > th.item-page-subentity__th--actions:last-child,
.item-page-subentity.keep-card .item-page-subentity__table > tbody > tr > td.item-page-subentity__td--actions:last-child,
.item-page-subentity.keep-card .item-page-subentity__table > tfoot > tr > td.item-page-subentity__td--actions:last-child {
    padding-right: 14px;
}

.item-page-subentity__table > tbody > tr > td.item-page-subentity__td--actions .table-actions,
.item-page-subentity__table > tbody > tr > td.item-page-subentity__td--actions .btn-icon {
    overflow: visible;
}

/* Без названия: таблица сразу на подложке */
.item-page .item-page-subentity.keep-card.item-page-subentity--no-title > .item-page-subentity__table-wrap,
.item-page .item-page-subentity.keep-card.item-page-subentity--no-title .item-page-subentity__table-wrap {
    margin-top: 8px;
}
.item-page-subentity__table {
    --bs-table-border-color: var(--app-table-border, #e8ecf1);
    --bs-table-hover-bg: var(--app-table-hover, rgba(11, 103, 158, 0.04));
    width: 100%;
    margin-bottom: 0;
    font-size: var(--app-font-size, 14px);
    line-height: 1.25;
    color: var(--tblr-body-color);
    border-collapse: separate;
    border-spacing: 0;
}
.item-page-subentity__table > :not(caption) > * > * {
    border-width: 0 0 1px;
    border-color: var(--app-table-border, #e8ecf1);
    padding: var(--app-table-padding-y, 6px) var(--app-table-padding-x, 10px);
    vertical-align: middle;
    box-shadow: none;
}
/* В карточке не дублируем «card padding» на крайних ячейках — зазор уже у wrap */
.item-page-subentity.keep-card .item-page-subentity__table > thead > tr > th:first-child,
.item-page-subentity.keep-card .item-page-subentity__table > tbody > tr > td:first-child,
.item-page-subentity.keep-card .item-page-subentity__table > tfoot > tr > td:first-child {
    padding-left: var(--app-table-padding-x, 10px);
}
.item-page-subentity.keep-card .item-page-subentity__table > thead > tr > th:last-child,
.item-page-subentity.keep-card .item-page-subentity__table > tbody > tr > td:last-child,
.item-page-subentity.keep-card .item-page-subentity__table > tfoot > tr > td:last-child {
    padding-right: var(--app-table-padding-x, 10px);
}
/* Мягкие края подсветки — как полоса, а не обрубок */
.item-page-subentity__table > tbody > tr.app-listing-row--hl > *:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}
.item-page-subentity__table > tbody > tr.app-listing-row--hl > *:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}
.item-page-subentity__table > tbody > tr.app-listing-row--hl:last-child > * {
    border-bottom-color: transparent;
}
/* Шапка таблицы: без заливки, только линия */
.item-page-subentity__table thead th {
    text-transform: none;
    font-size: inherit;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: #8292a6;
    background: transparent;
    border-bottom: 1px solid var(--app-table-border, #e8ecf1);
    white-space: nowrap;
    vertical-align: middle;
}
.item-page-subentity__table thead th:first-child {
    border-top-left-radius: 0;
}
.item-page-subentity__table thead th:last-child {
    border-top-right-radius: 0;
}
.item-page-subentity__table tbody tr:nth-of-type(odd) {
    --bs-table-bg-type: transparent;
}
.item-page-subentity__th--filterable {
    position: relative;
}
.item-page-subentity__th-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: inherit;
    cursor: pointer;
    max-width: 100%;
}
.item-page-subentity__th-btn:hover {
    color: var(--brand-accent, #0B679E);
}
.item-page-subentity__th--filterable.is-filtering .item-page-subentity__th-btn {
    display: none;
}
.item-page-subentity__th-input {
    min-width: 0;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    outline: none !important;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}
.item-page-subentity__th-input:focus,
.item-page-subentity__th-input:focus-visible {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent;
}
.item-page-subentity__th--filterable.is-filtering {
    white-space: nowrap;
}
.item-page-subentity__table-link {
    color: var(--brand-accent, #0B679E);
    font-weight: 400;
    text-decoration: none;
}
.item-page-subentity__table-link:hover {
    color: var(--brand-accent, #0B679E);
    text-decoration: underline;
}
.item-page-subentity__table-row--link {
    cursor: default;
}
/* Подсущность: статус с иконкой не режем по вертикали */
.item-page-subentity__table > tbody > tr > td:has(.status-date),
.item-page-subentity__table > tbody > tr > td:has(.status-date-badge),
.item-page-subentity__table > tbody > tr > td:has(.status-date-tag),
.item-page-subentity__table > tbody > tr > td:has(.field-choice-label) {
    overflow: visible;
}
.item-page-subentity__table > tbody > tr > td.item-page-subentity__td--status-ribbon {
    padding-top: 4px;
    padding-bottom: 4px;
    vertical-align: middle;
}
.item-page-subentity__table > tbody > tr > td.item-page-subentity__td--status-ribbon .status-date--cell-tag {
    display: block;
    width: 100%;
}
.item-page-subentity__row--with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.item-page-subentity__row-body {
    min-width: 0;
    flex: 1 1 auto;
}
.item-page-subentity__row-link {
    color: inherit;
    text-decoration: none;
}
.item-page-subentity__row-link:hover {
    color: var(--brand-accent, #0B679E);
}
.item-page-subentity__row-actions-wrap {
    flex: 0 0 auto;
    margin-left: auto;
}
.item-page-subentity__pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px calc(var(--app-card-padding) + var(--il-block-pad, 0px));
    border-top: 1px solid var(--app-table-border, #e8ecf1);
}
.item-page-subentity__pager-info {
    font-size: var(--app-font-size-sm, 12px);
}
.item-page-subentity__pager-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.item-page-subentity__pager-btns .btn {
    min-width: 30px;
    padding-left: 8px;
    padding-right: 8px;
}

.cfg-subentity-settings .form-label {
    margin-bottom: 4px;
    font-size: 13px;
}
.cfg-subentity-preview-label {
    font-weight: 500;
    letter-spacing: .01em;
}
.cfg-subentity-preview {
    margin-bottom: 0;
}
.cfg-subentity-preview .card-header .btn.disabled {
    pointer-events: none;
}
.cfg-subentity-preview__body .list-group-item-action:hover {
    background: var(--bs-tertiary-bg);
}

/* Ссылки: без подчёркивания — hover через цвет и фон (Tabler/Bootstrap по умолчанию underline). */
a,
a:hover,
a:focus,
a:focus-visible,
a:active,
.btn-link,
.btn-link:hover,
.btn-link:focus,
.btn-link:focus-visible,
.btn-link:active,
.dt-container a:hover,
.page-hint a:hover,
.dropdown-item:hover {
    text-decoration: none;
}

/* Счётчик файлов в таблице записей */
.entity-files-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--tblr-secondary);
    font-size: var(--app-font-size-sm);
    line-height: 1;
    white-space: nowrap;
}
.entity-files-count__icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.entity-files-count__value {
    font-variant-numeric: tabular-nums;
}

/* Связанная сущность: иконка + (N) в списке */
.related-listing-count {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 0;
    background: transparent;
    color: var(--tblr-secondary);
    font-size: var(--app-font-size-sm);
    line-height: 1;
    padding: .15rem .2rem;
    border-radius: .35rem;
    cursor: pointer;
    white-space: nowrap;
}
.related-listing-count:hover,
.related-listing-count:focus-visible {
    color: var(--tblr-primary);
    background: color-mix(in srgb, var(--tblr-primary, #066fd1) 8%, transparent);
    outline: none;
}
.related-listing-count__icon,
.related-listing-count__icon-svg {
    --list-icon-size: 15px;
    width: var(--list-icon-size);
    height: var(--list-icon-size);
    min-width: var(--list-icon-size);
    min-height: var(--list-icon-size);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    overflow: hidden;
}
.related-listing-count__icon svg,
.related-listing-count__icon .icon-svg,
.related-listing-count__icon .icon-value-svg,
.related-listing-count__icon .icon-value-svg svg,
.related-listing-count__icon-svg {
    width: var(--list-icon-size) !important;
    height: var(--list-icon-size) !important;
    max-width: var(--list-icon-size) !important;
    max-height: var(--list-icon-size) !important;
    display: block;
}
.related-listing-count__value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.related-listing-count--value-only .related-listing-count__icon,
.related-listing-count--value-only .related-listing-count__icon-svg,
.related-listing-count[data-mode="value_only"] .related-listing-count__icon,
.related-listing-count[data-mode="value_only"] .related-listing-count__icon-svg {
    display: none !important;
}

.related-listing-popover {
    position: fixed;
    z-index: 2080;
    min-width: 220px;
    max-width: min(360px, calc(100vw - 24px));
    max-height: min(320px, 50vh);
    overflow: auto;
    padding: .4rem 0;
    margin: 0;
    list-style: none;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: .5rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
}
.related-listing-popover[hidden] {
    display: none !important;
}
.related-listing-popover__item {
    display: block;
    padding: .4rem .75rem;
    color: inherit;
    text-decoration: none;
    white-space: normal;
    line-height: 1.35;
    font-size: var(--app-font-size-sm, 12px);
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
}
.related-listing-popover__item:hover,
.related-listing-popover__item:focus {
    background: color-mix(in srgb, var(--tblr-primary, #066fd1) 8%, transparent);
    color: inherit;
    outline: none;
}
.related-listing-popover__empty {
    padding: .55rem .75rem;
    color: var(--tblr-secondary-color, #6b7280);
    font-size: var(--app-font-size-sm, 12px);
}

.print-form-buttons__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.print-form-buttons__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}
.print-form-buttons__icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Иконка в заголовке: не резать stroke, не сжимать, не наезжать на стрелки */
.app-page-table .table > thead > tr > th.app-table-col-icon-header,
.item-page-subentity__table > thead > tr > th.app-table-col-icon-header,
.matched-records__table > thead > tr > th.app-table-col-icon-header,
table.dataTable > thead > tr > th.app-table-col-icon-header {
    overflow: visible;
    text-overflow: clip;
}

.app-table-col-icon-header .app-listing-sort {
    gap: 8px;
    max-width: none;
    overflow: visible;
}

.app-table-col-icon-header .app-listing-sort__label {
    flex: 0 1 auto;
    overflow: visible;
    min-width: auto;
    line-height: 0;
}

.app-table-col-icon-header .app-listing-sort__ind {
    margin-left: auto;
}

.app-table-col-icon-header .app-table-col-icon {
    --list-icon-size: 14px;
}

.print-form-buttons__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.print-form-buttons__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}
.print-form-buttons__icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.app-table-col-icon {
    --list-icon-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    width: var(--list-icon-size);
    height: var(--list-icon-size);
    min-width: var(--list-icon-size);
    min-height: var(--list-icon-size);
    line-height: 0;
    /* Свои SVG без внутренних отступов — overflow:hidden срезает stroke */
    overflow: visible;
    color: var(--tblr-secondary);
}

.app-table-col-icon .icon-value-svg,
.app-table-col-icon .icon-svg,
.app-table-col-icon .icon-svg-custom,
.app-table-col-icon .app-table-col-icon__svg {
    width: var(--list-icon-size) !important;
    height: var(--list-icon-size) !important;
    min-width: var(--list-icon-size) !important;
    min-height: var(--list-icon-size) !important;
    max-width: var(--list-icon-size) !important;
    max-height: var(--list-icon-size) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
    overflow: visible !important;
}

.app-table-col-icon svg,
.app-table-col-icon svg.feather,
.app-table-col-icon .icon-value-svg svg,
.app-table-col-icon .icon-svg-custom svg,
.app-table-col-icon .app-table-col-icon__svg svg {
    /* Чуть меньше слота — stroke не упирается в край ячейки */
    width: calc(var(--list-icon-size) - 0.5px) !important;
    height: calc(var(--list-icon-size) - 0.5px) !important;
    min-width: calc(var(--list-icon-size) - 0.5px) !important;
    min-height: calc(var(--list-icon-size) - 0.5px) !important;
    max-width: calc(var(--list-icon-size) - 0.5px) !important;
    max-height: calc(var(--list-icon-size) - 0.5px) !important;
    display: block;
    flex-shrink: 0;
    overflow: visible !important;
}

.app-table-col-icon .icon-svg {
    fill: currentColor;
    color: var(--tblr-secondary);
}

/* Поля «Файлы» и «ЭЦП» — подпись не должна ложиться на контрол */
.form-label + .entity-files,
.form-label + .field-eds {
    margin-top: 4px;
}
.item-page .info-field-inner:has(.entity-files) > .info-field-label,
.item-page .info-field-cell:has(.entity-files) .info-field-label,
.item-page .info-field-inner:has(.field-eds) > .info-field-label,
.item-page .info-field-cell:has(.field-eds) .info-field-label {
    margin-bottom: 8px !important;
}
.entity-files {
    position: relative;
}
.entity-files.is-dragover::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed color-mix(in srgb, var(--brand-accent, #0B679E) 45%, var(--tblr-border-color, #e8ecf1));
    border-radius: var(--app-control-radius, 0.375rem);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, transparent);
    pointer-events: none;
    z-index: 1;
}
.entity-files__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 10px;
}
.entity-files__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    min-height: 28px;
}
.entity-files__head-title {
    min-width: 0;
    font-size: var(--app-font-size, 14px);
    font-weight: 500;
    line-height: 1.3;
    color: var(--tblr-body-color, #1f2d3a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.entity-files__head .entity-files__upload-btn {
    margin-left: auto;
}
.entity-files__toolbar + .entity-files__progress--inline,
.entity-files__head + .entity-files__progress--inline {
    margin-top: -6px;
}
.entity-files__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 10px;
}
.entity-files__section-head .entity-files__section-label {
    margin: 0;
}
.entity-files__gallery-wrap > .entity-files__section-head:first-child,
.entity-files__list-wrap > .entity-files__section-head:first-child {
    margin-top: 0;
}
.entity-files__upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 28px;
    padding: 0 10px;
    margin: 0;
    border: 1px solid var(--tblr-border-color, var(--app-table-border, #e8ecf1));
    border-radius: var(--app-control-radius, 0.375rem);
    background: #fff;
    color: #5a7388;
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.entity-files__upload-btn:hover,
.entity-files__upload-btn:focus-visible,
.entity-files.is-dragover .entity-files__upload-btn {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 45%, var(--tblr-border-color, #e8ecf1));
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #fff);
    color: var(--tblr-body-color, #1f2d3a);
    outline: none;
}
.entity-files__upload-btn > i,
.entity-files__upload-btn > svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    color: var(--brand-accent, #0B679E);
    pointer-events: none;
}
.entity-files__upload-btn > span {
    pointer-events: none;
}
.entity-files__list-wrap.is-dragover {
    outline: 2px solid color-mix(in srgb, var(--brand-accent, #0B679E) 35%, transparent);
    outline-offset: 2px;
    border-radius: var(--app-control-radius, 0.375rem);
}
.entity-files__drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--app-control-height, 36px);
    height: var(--app-control-height, 36px);
    padding: 0 12px;
    border: 1px solid var(--tblr-border-color, var(--app-table-border, #e8ecf1));
    border-radius: var(--app-control-radius, 0.375rem);
    background: #fff;
    color: var(--tblr-secondary-color, #6c7a91);
    font-size: var(--app-font-size, 14px);
    line-height: 1.25;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.entity-files__drop:hover,
.entity-files__drop.is-dragover,
.entity-files__drop:focus-visible {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 45%, var(--tblr-border-color, #e8ecf1));
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #fff);
    color: var(--tblr-body-color, #1f2d3a);
    box-shadow: none;
    outline: none;
}
.entity-files__drop.is-dragover {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 7%, #fff);
}
.entity-files__drop > i,
.entity-files__drop > svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: var(--tblr-secondary-color, #6c7a91);
}
.entity-files__drop:hover > i,
.entity-files__drop:hover > svg,
.entity-files__drop.is-dragover > i,
.entity-files__drop.is-dragover > svg,
.entity-files__drop:focus-visible > i,
.entity-files__drop:focus-visible > svg {
    color: var(--brand-accent, #0B679E);
}
.entity-files__drop-text {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tblr-body-color, #1f2d3a);
}
.entity-files__drop-hint {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--tblr-secondary-color, #6c7a91);
}
.entity-files--photos .entity-files__drop {
    display: none;
}
.entity-files--photos .entity-files__gallery-wrap {
    margin-top: 0;
}
.entity-files--photos .entity-files__gallery-wrap.is-dragover {
    outline: 2px solid color-mix(in srgb, var(--brand-accent) 40%, transparent);
    outline-offset: 2px;
    border-radius: var(--app-control-radius);
}
.entity-files__card--add {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 1px solid var(--tblr-border-color, var(--app-table-border));
    background: #fff;
    color: var(--tblr-secondary-color);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.entity-files__card--add:hover,
.entity-files__card--add:focus-visible {
    border-color: color-mix(in srgb, var(--brand-accent) 45%, var(--tblr-border-color, #e8ecf1));
    background: color-mix(in srgb, var(--brand-accent) 4%, #fff);
    color: var(--brand-accent, #0B679E);
    outline: none;
}
.entity-files__card-add-icon {
    width: 22px;
    height: 22px;
    display: block;
    flex-shrink: 0;
}
.entity-files__progress--inline {
    margin: 0 0 8px;
}
.entity-files__list-wrap > .entity-files__progress--inline {
    margin-top: -4px;
}
.entity-files__section-label--docs {
    margin-top: 14px;
}
.entity-files__gallery-wrap + .entity-files__list-wrap > .entity-files__section-label--docs {
    margin-top: 14px;
}
.entity-files__toolbar + .entity-files__gallery-wrap > .entity-files__section-head:first-child {
    margin-top: 0;
}
.entity-files__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.entity-files__drop > i,
.entity-files__drop > svg,
.entity-files__drop > span {
    pointer-events: none;
}
.entity-files__section-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--tblr-secondary-color);
    margin: 14px 0 10px;
    line-height: 1.3;
}
.entity-files__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
}
.entity-files__card {
    position: relative;
    border: 1px solid var(--app-table-border);
    border-radius: var(--app-control-radius);
    padding: 0;
    background-color: var(--app-table-zebra, #f1f5f9);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    cursor: pointer;
}
.entity-files__card--no-thumb {
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    background-image: none !important;
}
.entity-files__card-label {
    display: none;
    width: 100%;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.25;
    color: #334155;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid var(--app-table-border);
}
.entity-files__card--no-thumb .entity-files__card-label {
    display: block;
}
.entity-files__card-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid var(--app-table-border);
    line-height: 18px;
    text-align: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity .15s;
}
.entity-files__card:hover .entity-files__card-del { opacity: 1; }
.entity-files__card--no-thumb .entity-files__card-del { opacity: 1; }
.entity-files__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    height: auto;
    min-height: 0;
    align-self: flex-start;
    width: 100%;
}
.entity-files__empty {
    margin: 0;
    padding: 2px 0 0;
    font-size: var(--app-font-size, 14px);
}
.entity-files__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 1px solid var(--tblr-border-color, var(--app-table-border, #e8ecf1));
    border-radius: var(--app-control-radius, 0.375rem);
    background: #fff;
    min-height: var(--app-control-height, 36px);
    height: var(--app-control-height, 36px);
    transition: border-color .15s ease, background .15s ease;
}
.entity-files__row:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 30%, var(--tblr-border-color, #e8ecf1));
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 3%, #fff);
}
.entity-files__row-name,
button.entity-files__row-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    text-align: left;
    font: inherit;
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 1.3;
    color: var(--tblr-body-color, #1f2d3a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
}
button.entity-files__row-name:focus,
button.entity-files__row-name:focus-visible,
button.entity-files__row-name:active,
button.entity-files__row-name:hover {
    outline: none;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--tblr-body-color, #1f2d3a);
}
.entity-files__row-meta {
    font-size: 12px;
    color: var(--tblr-secondary-color);
    white-space: nowrap;
}
.entity-files__row-actions {
    flex-shrink: 0;
}

.files-access-rules-table__perm {
    width: 88px;
    white-space: nowrap;
}
.files-access-rules-table__actions {
    width: 44px;
}
.files-access-rules-table .form-select-sm {
    min-width: 140px;
}
.entity-files__q-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.entity-files__progress-bar {
    height: 3px;
    background: var(--app-table-border);
    border-radius: 4px;
    overflow: hidden;
}
.entity-files__progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand-accent);
    transition: width .2s;
}
.entity-files__queue-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.entity-files-modal {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: rgba(15, 23, 42, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.entity-files-modal[hidden] { display: none !important; }
.entity-files-modal__box {
    position: relative;
    z-index: 200001;
    width: min(1100px, 100%);
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--app-table-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.entity-files-modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--app-table-border);
    background: var(--app-table-header-bg);
}
.entity-files-modal__title {
    flex: 1;
    min-width: 0;
    font-size: var(--app-font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.entity-files-modal__image-tools {
    display: none;
    flex-shrink: 0;
}
.entity-files-modal--image .entity-files-modal__image-tools,
.entity-files-modal--pdf .entity-files-modal__image-tools {
    display: flex;
}
.entity-files-modal--pdf .entity-files-modal__zoom-in,
.entity-files-modal--pdf .entity-files-modal__zoom-out {
    display: none;
}
.entity-files-modal__rotate.is-busy {
    opacity: .45;
    pointer-events: none;
}
.entity-files-modal__toolbar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.entity-files-modal--image .entity-files-modal__head {
    border-bottom: none;
    padding-bottom: 6px;
}
.entity-files-modal--image .entity-files-modal__title {
    display: none !important;
}
.entity-files-modal__head-actions {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}
.entity-files-modal__body {
    padding: 16px;
    overflow: auto;
    background: var(--app-table-zebra);
}
.entity-files-modal--image .entity-files-modal__body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}
.entity-files-modal--image .entity-files-modal__viewport {
    padding: 4px 16px 16px;
}
.entity-files-modal--has-thumbs .entity-files-modal__box {
    width: min(1240px, 100%);
}
.entity-files-modal__thumbs {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 8px;
    width: 96px;
    padding: 12px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--app-table-header-bg, #f8fafc);
    border-right: 1px solid var(--app-table-border);
}
.entity-files-modal__thumbs[hidden] {
    display: none !important;
}
.entity-files-modal__thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background-color: var(--app-table-zebra, #e8eef4);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}
.entity-files-modal__thumb:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 45%, var(--tblr-border-color, #e8ecf1));
}
.entity-files-modal__thumb.is-active {
    border-color: var(--brand-accent, #0B679E);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0B679E) 22%, transparent);
}
.entity-files-modal__viewport {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: stretch;
}
.entity-files-modal__viewport .entity-files-modal__content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}
.entity-files-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-table-border, #e8ecf1);
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: #334155;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
    transform: translateY(-50%);
}
.entity-files-modal__nav[hidden] {
    display: none !important;
}
.entity-files-modal__nav--prev {
    left: 12px;
}
.entity-files-modal__nav--next {
    right: 12px;
}
.entity-files-modal__nav:hover,
.entity-files-modal__nav:focus-visible {
    background: #fff;
    color: var(--brand-accent, #0B679E);
    outline: none;
}
.entity-files-modal__nav svg {
    width: 20px;
    height: 20px;
    display: block;
}
.entity-files-modal__counter {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--app-table-border, #e8ecf1);
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
    pointer-events: none;
}
.entity-files-modal__counter[hidden] {
    display: none !important;
}
@media (max-width: 720px) {
    .entity-files-modal--has-thumbs .entity-files-modal__body {
        flex-direction: column;
    }
    .entity-files-modal__thumbs {
        flex-direction: row;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--app-table-border);
        padding: 10px 12px;
    }
    .entity-files-modal__thumb {
        width: 56px;
        height: 56px;
    }
}
.entity-files-modal__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
    max-height: 75vh;
    overflow: auto;
}
.entity-files-modal__img {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 8px;
    background: #fff;
    transform-origin: center center;
    transition: transform .15s ease;
}
.entity-files-modal__content iframe {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 8px;
    background: #fff;
    width: 100%;
    height: 75vh;
}


/* --- поле ЭЦП --- */
.field-eds {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    font-size: var(--app-font-size, 14px);
    font-weight: 400;
    line-height: 1.3;
}

.field-eds--has-doc {
    padding: 14px 16px 12px;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: var(--bs-card-bg);
    overflow: visible;
}

.field-eds--has-ribbon {
    padding-top: 16px;
}

.field-eds__ribbon {
    position: absolute;
    top: 0;
    right: 20px;
    z-index: 2;
    pointer-events: none;
    transform: translateY(-50%);
}

.field-eds__ribbon-text {
    display: inline-block;
    padding: 4px 11px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: .02em;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .1);
    white-space: nowrap;
}

.field-eds__ribbon--ready .field-eds__ribbon-text {
    background: var(--brand-accent, #0B679E);
}

.field-eds__ribbon--in_progress .field-eds__ribbon-text {
    color: #111;
    background: transparent;
    border: 1px solid #eab308;
    box-shadow: 0 0 0 3px var(--bs-card-bg, #fff);
}

.field-eds__ribbon--completed .field-eds__ribbon-text {
    background: var(--tblr-success, #2fb344);
}

.field-eds__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: inherit;
    color: #64748b;
}

.field-eds__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex: 0 0 auto;
}

.field-eds__status-dot--ready { background: var(--brand-accent, #0B679E); }
.field-eds__status-dot--in_progress { background: #f59e0b; }
.field-eds__status-dot--completed { background: var(--tblr-success); }

.field-eds__doc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.field-eds__doc-row > svg.feather,
.field-eds__doc-row > i[data-feather],
.field-eds__doc-row > .field-eds__doc-icon {
    width: 16px;
    height: 16px;
    color: var(--brand-accent, #0B679E);
    flex: 0 0 auto;
}

.field-eds__doc-row > .field-eds__doc-icon--signed,
.field-eds__doc-row.is-signed > .field-eds__doc-icon {
    color: var(--tblr-success, #2fb344);
}

.field-eds__doc-name {
    font-weight: 400;
    word-break: break-word;
    flex: 1 1 auto;
    min-width: 0;
    font-size: inherit;
}

.field-eds__doc-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
}

.field-eds__doc {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-eds__reset-confirm {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--tblr-danger) 28%, var(--tblr-border-color));
    border-radius: 10px;
    background: color-mix(in srgb, var(--tblr-danger) 5%, #fff);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.field-eds__reset-confirm[hidden] {
    display: none !important;
}

.field-eds__reset-confirm-text {
    font-size: 13px;
    font-weight: 500;
    color: #991b1b;
}

.field-eds__reset-confirm-label {
    margin-bottom: 0;
    font-size: 12px;
    color: #64748b;
}

.field-eds__reset-password {
    display: block !important;
    width: 100% !important;
    min-width: 0;
    max-width: none;
    min-height: var(--app-control-height, 36px);
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    pointer-events: auto !important;
    background: #fff;
}

.field-eds__reset-confirm-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.field-eds__empty {
    display: flex;
    align-items: center;
}

.field-eds__start-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.field-eds__start-btn .field-eds__start-icon,
.field-eds__start-btn svg.feather {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.field-eds__manage {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--tblr-border-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--tblr-border-color) 18%, #fff);
}

.field-eds__manage[hidden] {
    display: none !important;
}

.field-eds__manage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.field-eds__manage-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.field-eds__drop {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px dashed color-mix(in srgb, var(--brand-accent, #0B679E) 28%, var(--tblr-border-color));
    border-radius: 10px;
    color: var(--brand-accent, #0B679E);
    cursor: pointer;
    font-size: 13px;
    background: #fff;
}

.field-eds__drop:hover {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #fff);
}

.field-eds__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.field-eds__drop svg.feather {
    width: 16px;
    height: 16px;
}

.field-eds__signers-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.field-eds__signers-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

@media (max-width: 576px) {
    .field-eds__signers-list {
        grid-template-columns: 1fr;
    }
}

.field-eds__signer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    font-size: inherit;
    min-width: 0;
}

.field-eds__signer-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-eds__signer.is-signed {
    border-color: color-mix(in srgb, var(--tblr-success) 30%, transparent);
    background: color-mix(in srgb, var(--tblr-success) 6%, #fff);
}

.field-eds__signer-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    white-space: nowrap;
    font-size: inherit;
}

.field-eds__signer-signed-icon {
    width: 14px;
    height: 14px;
    color: var(--tblr-success, #2fb344);
    flex: 0 0 auto;
}

.field-eds__signer-date {
    color: #166534;
}

.field-eds__signer.is-signed .field-eds__signer-state {
    color: #166534;
}

.field-eds__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-eds__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.field-eds__actions .btn svg.feather {
    width: 14px;
    height: 14px;
}

.field-eds__msg {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.field-eds__msg--error {
    background: color-mix(in srgb, var(--tblr-danger) 8%, #fff);
    color: #991b1b;
}

.field-eds__msg--ok {
    background: color-mix(in srgb, var(--tblr-success) 8%, #fff);
    color: #166534;
}

.field-eds .app-table-icon-actions .btn-icon,
.field-eds .app-table-icon-actions .btn.btn-sm.btn-icon {
    width: 28px;
    height: 28px;
}

/* --- выбор пользователей (поиск + чипы) --- */
.users-picker {
    position: relative;
    width: 100%;
}

.users-picker__control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: var(--app-control-height, 36px);
    padding: 4px 8px;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--app-control-radius, 6px);
    background: #fff;
    cursor: text;
}

.users-picker__control:focus-within {
    border-color: var(--brand-accent, #0B679E);
    box-shadow: none;
}

/* Одиночный выбор списка с поиском — как обычный select, без чипов */
.users-picker--single .users-picker__chips {
    display: none !important;
}

.users-picker--single .users-picker__control {
    flex-wrap: nowrap;
    padding: 0 10px;
    min-height: var(--app-control-height, 36px);
}

.users-picker--single .users-picker__search {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0;
    height: calc(var(--app-control-height, 36px) - 2px);
    line-height: calc(var(--app-control-height, 36px) - 2px);
    font-size: inherit;
    color: inherit;
}

.users-picker--single .users-picker__search:focus {
    outline: none;
}

.users-picker--single.has-value .users-picker__search {
    font-weight: 400;
}

.users-picker__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.users-picker__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 8px 4px 10px;
    border-radius: 5px;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color, #d0d5dd) 80%, #94a3b8);
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary, #f1f5f9) 88%, #fff);
    color: #334155;
    font-size: 14px;
    line-height: 1.35;
    position: relative;
    z-index: 1;
}

.users-picker__chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-weight: 400;
}

.users-picker__chip-remove {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    width: 18px;
    height: 18px;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    flex: 0 0 auto;
}

.users-picker__chip-remove:hover {
    background: color-mix(in srgb, var(--tblr-danger) 12%, #fff);
    color: #991b1b;
}

.users-picker__search {
    flex: 1 1 140px;
    min-width: 120px;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 4px 2px !important;
    min-height: 26px;
    font-size: 14px;
    line-height: 1.35;
}

.users-picker__dropdown {
    position: absolute;
    z-index: 1055;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow: auto;
    padding: 4px;
    border: 1px solid var(--tblr-border-color);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.users-picker__dropdown--portal {
    position: fixed;
    right: auto;
    z-index: 20050;
}

.users-picker__option--clear {
    margin-top: 4px;
    border-top: 1px solid var(--tblr-border-color, #e6e8eb);
    border-radius: 0 0 6px 6px;
    color: #64748b;
    font-size: 13px;
}

.users-picker__options {
    display: none !important;
}

.users-picker__dropdown[hidden] {
    display: none !important;
}

.users-picker__option {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #16324a;
    cursor: pointer;
}

.users-picker__option:hover,
.users-picker__option.is-active {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 10%, #fff);
}

.users-picker__empty {
    padding: 10px;
    font-size: 12px;
    color: #64748b;
}

/* --- комментарии записи (чат) --- */
.item-comments {
    overflow: hidden;
}

.item-comments--in-layout {
    margin-top: 0;
    width: 100%;
}

.fd-comments-themes {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin-top: 4px;
}

.fd-comments-theme {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 5px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: color-mix(in srgb, #fff 70%, transparent);
    cursor: pointer;
    color: var(--bs-secondary-color);
    min-width: 0;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.fd-comments-theme:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 28%, var(--bs-border-color));
    background: #fff;
}

.fd-comments-theme.is-active {
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 45%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-accent, #0B679E) 12%, transparent);
    background: #fff;
    color: var(--bs-body-color);
}

.fd-comments-theme__preview {
    position: relative;
    height: 48px;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
    padding: 6px;
}

.fd-comments-theme__bar {
    display: none;
    position: absolute;
    background: var(--brand-accent, #0B679E);
}

.fd-comments-theme__bubble {
    position: absolute;
    height: 9px;
    border-radius: 6px;
    background: #e2e8f0;
}

.fd-comments-theme__bubble--a {
    left: 8px;
    top: 10px;
    width: 46%;
}

.fd-comments-theme__bubble--b {
    right: 8px;
    bottom: 10px;
    width: 40%;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 22%, #e2e8f0);
}

.fd-comments-theme__label {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Чат — пузыри слева/справа */
.fd-comments-theme__preview--plain {
    border: 1px solid #eef2f7;
    background: #fafbfc;
}

/* Лента — две полные строки */
.fd-comments-theme__preview--soft {
    border: 1px solid #e2e8f0;
}

.fd-comments-theme__preview--soft .fd-comments-theme__bubble {
    left: 6px;
    right: 6px;
    width: auto;
    height: 7px;
    border-radius: 2px;
}

.fd-comments-theme__preview--soft .fd-comments-theme__bubble--a { top: 12px; }
.fd-comments-theme__preview--soft .fd-comments-theme__bubble--b {
    bottom: 12px;
    top: auto;
    right: 6px;
    background: #cbd5e1;
}

/* Карточки */
.fd-comments-theme__preview--card {
    background: #f4f7fa;
    border: 0;
}

.fd-comments-theme__preview--card .fd-comments-theme__bubble {
    left: 6px;
    right: 6px;
    width: auto;
    height: 14px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    border: 1px solid #e8edf2;
}

.fd-comments-theme__preview--card .fd-comments-theme__bubble--a { top: 8px; }
.fd-comments-theme__preview--card .fd-comments-theme__bubble--b {
    bottom: 8px;
    top: auto;
    right: 6px;
    background: #fff;
}

/* Тикет — полоса слева */
.fd-comments-theme__preview--accent {
    border: 1px solid #e8edf2;
    background: #f8fafc;
}

.fd-comments-theme__preview--accent .fd-comments-theme__bar {
    display: block;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
}

.fd-comments-theme__preview--accent .fd-comments-theme__bubble {
    left: 10px;
    right: 6px;
    width: auto;
    height: 10px;
    border-radius: 0 3px 3px 0;
    background: #fff;
    border: 1px solid #e8edf2;
    border-left: 0;
}

.fd-comments-theme__preview--accent .fd-comments-theme__bubble--a { top: 10px; }
.fd-comments-theme__preview--accent .fd-comments-theme__bubble--b {
    bottom: 10px;
    top: auto;
    right: 6px;
    background: #fff;
}

/* Форум — разделители */
.fd-comments-theme__preview--band {
    border: 1px solid #e2e8f0;
}

.fd-comments-theme__preview--band .fd-comments-theme__bubble {
    left: 6px;
    right: 6px;
    width: auto;
    height: 1px;
    border-radius: 0;
    background: #e2e8f0;
}

.fd-comments-theme__preview--band .fd-comments-theme__bubble--a { top: 16px; }
.fd-comments-theme__preview--band .fd-comments-theme__bubble--b {
    bottom: auto;
    top: 28px;
    right: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 2px;
    width: 55%;
    left: 6px;
}

/* Компакт — тонкие строки */
.fd-comments-theme__preview--mist {
    background: #f4f7fa;
    border: 0;
}

.fd-comments-theme__preview--mist .fd-comments-theme__bubble {
    left: 6px;
    right: 6px;
    width: auto;
    height: 4px;
    border-radius: 1px;
    background: #cbd5e1;
}

.fd-comments-theme__preview--mist .fd-comments-theme__bubble--a { top: 14px; }
.fd-comments-theme__preview--mist .fd-comments-theme__bubble--b {
    bottom: auto;
    top: 26px;
    right: 6px;
    width: 70%;
    left: 6px;
    background: #94a3b8;
}

/* Таймлайн */
.fd-comments-theme__preview--well {
    background: #eef2f6;
    border: 0;
}

.fd-comments-theme__preview--well .fd-comments-theme__bar {
    display: block;
    left: 10px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #cbd5e1;
    border-radius: 2px;
}

.fd-comments-theme__preview--well .fd-comments-theme__bubble {
    left: 18px;
    right: 6px;
    width: auto;
    height: 12px;
    border-radius: 4px;
    background: #fff;
}

.fd-comments-theme__preview--well .fd-comments-theme__bubble--a { top: 10px; }
.fd-comments-theme__preview--well .fd-comments-theme__bubble--b {
    bottom: 10px;
    top: auto;
    right: 6px;
    background: #fff;
}

/* Мессенджер */
.fd-comments-theme__preview--frost {
    border: 1px solid #d5e6f0;
    background: #e8f1f7;
}

.fd-comments-theme__preview--frost .fd-comments-theme__bubble--a {
    border-radius: 8px 8px 8px 2px;
    background: #fff;
    height: 12px;
    top: 10px;
}

.fd-comments-theme__preview--frost .fd-comments-theme__bubble--b {
    border-radius: 8px 8px 2px 8px;
    background: var(--brand-accent, #0B679E);
    height: 12px;
    bottom: 10px;
}

/* Заметки */
.fd-comments-theme__preview--sky {
    border: 1px solid #efe6cf;
    background: #fffdf7;
}

.fd-comments-theme__preview--sky .fd-comments-theme__bar {
    display: block;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #d4a017;
}

.fd-comments-theme__preview--sky .fd-comments-theme__bubble {
    left: 10px;
    right: 6px;
    width: auto;
    height: 10px;
    border-radius: 1px;
    background: #fffef8;
    border: 1px solid #ebe1c8;
}

.fd-comments-theme__preview--sky .fd-comments-theme__bubble--a { top: 10px; }
.fd-comments-theme__preview--sky .fd-comments-theme__bubble--b {
    bottom: 10px;
    top: auto;
    right: 6px;
    background: #fffef8;
}

/* Диалог */
.fd-comments-theme__preview--chat {
    border: 1px solid #d7e3ec;
    background: #f0f5f9;
    border-radius: 10px;
}

.fd-comments-theme__preview--chat .fd-comments-theme__bubble {
    border-radius: 10px;
    height: 12px;
}

.fd-comments-theme__preview--chat .fd-comments-theme__bubble--a {
    left: 16px;
    border-bottom-left-radius: 2px;
}

.fd-comments-theme__preview--chat .fd-comments-theme__bubble--b {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 35%, #fff);
    border-bottom-right-radius: 2px;
}

.fd-comments-preview {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.fd-comments-preview.item-comments {
    overflow: hidden;
}

.fd-comments-preview .item-comments__list {
    max-height: 160px;
    overflow: hidden;
}

.fd-comments-preview .item-comments__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fd-comments-preview__head,
.fd-comments-preview__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.fd-comments-preview__title {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

.fd-comments-preview__badge {
    font-size: 11px;
    color: #94a3b8;
}

/* --- скины комментариев: layout сообщений --- */
.item-comments__avatar {
    display: none;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #64748b;
    background: #e2e8f0;
    margin-top: 2px;
}

.item-comments__item.is-mine .item-comments__avatar {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 18%, #e2e8f0);
    color: var(--brand-accent, #0B679E);
}

/* 1. Чат — текущий вид (пузыри слева/справа) */
.item-comments--skin-plain .item-comments__avatar {
    display: none;
}

/* 2. Лента — full-width feed с аватаром */
.item-comments--skin-soft .item-comments__list {
    gap: 0;
}

.item-comments--skin-soft .item-comments__item,
.item-comments--skin-soft .item-comments__item.is-mine {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eef2f7;
}

.item-comments--skin-soft .item-comments__item:last-child {
    border-bottom: 0;
}

.item-comments--skin-soft .item-comments__avatar {
    display: inline-flex;
}

.item-comments--skin-soft .item-comments__bubble {
    max-width: none;
    flex: 1;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.item-comments--skin-soft .item-comments__item.is-mine .item-comments__bubble {
    background: transparent;
    border: 0;
}

.item-comments--skin-soft .item-comments__author {
    color: #475569;
}

/* 3. Карточки — каждая запись отдельной карточкой */
.item-comments--skin-card .item-comments__list {
    gap: 10px;
}

.item-comments--skin-card .item-comments__item,
.item-comments--skin-card .item-comments__item.is-mine {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 10px;
}

.item-comments--skin-card .item-comments__avatar {
    display: inline-flex;
}

.item-comments--skin-card .item-comments__bubble {
    max-width: none;
    flex: 1;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8edf2;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.item-comments--skin-card .item-comments__item.is-mine .item-comments__bubble {
    background: #fff;
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 28%, #e8edf2);
}

/* 4. Тикет — полоса слева у каждого сообщения */
.item-comments--skin-accent .item-comments__list {
    gap: 8px;
}

.item-comments--skin-accent .item-comments__item,
.item-comments--skin-accent .item-comments__item.is-mine {
    justify-content: flex-start;
}

.item-comments--skin-accent .item-comments__bubble {
    max-width: none;
    width: 100%;
    border-radius: 0 8px 8px 0;
    border: 1px solid #e8edf2;
    border-left: 3px solid var(--brand-accent, #0B679E);
    background: #fff;
    padding: 10px 12px;
}

.item-comments--skin-accent .item-comments__item.is-mine .item-comments__bubble {
    border-left-color: #94a3b8;
    background: #fff;
}

/* 5. Форум — табличный вид автор/дата + текст */
.item-comments--skin-band .item-comments__head {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 2px;
}

.item-comments--skin-band .item-comments__list {
    gap: 0;
}

.item-comments--skin-band .item-comments__item,
.item-comments--skin-band .item-comments__item.is-mine {
    justify-content: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.item-comments--skin-band .item-comments__bubble {
    max-width: none;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.item-comments--skin-band .item-comments__item.is-mine .item-comments__bubble {
    background: transparent;
    border: 0;
}

.item-comments--skin-band .item-comments__meta {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px dashed #e8edf2;
}

.item-comments--skin-band .item-comments__author {
    color: var(--brand-accent, #0B679E);
    font-size: 13px;
}

.item-comments--skin-band .item-comments__text {
    font-size: 14px;
    line-height: 1.5;
}

/* 6. Компакт — плотный список без пузырей */
.item-comments--skin-mist .item-comments__body {
    gap: 6px;
    padding: 8px 10px 10px;
}

.item-comments--skin-mist .item-comments__list {
    gap: 4px;
}

.item-comments--skin-mist .item-comments__item,
.item-comments--skin-mist .item-comments__item.is-mine {
    justify-content: flex-start;
}

.item-comments--skin-mist .item-comments__bubble {
    max-width: none;
    width: 100%;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.item-comments--skin-mist .item-comments__item.is-mine .item-comments__bubble {
    background: transparent;
    border: 0;
}

.item-comments--skin-mist .item-comments__meta {
    margin-bottom: 0;
    gap: 6px;
}

.item-comments--skin-mist .item-comments__author {
    font-size: 13px;
}

.item-comments--skin-mist .item-comments__date {
    font-size: 12px;
    margin-top: 0;
}

.item-comments--skin-mist .item-comments__text {
    font-size: 14px;
    line-height: 1.35;
    color: #475569;
}

.item-comments--skin-mist .item-comments__text::before {
    content: '— ';
    color: #94a3b8;
}

/* 7. Таймлайн — вертикальная линия и точки */
.item-comments--skin-well .item-comments__list {
    position: relative;
    gap: 14px;
    padding-left: 18px;
}

.item-comments--skin-well .item-comments__list::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: #d0dae4;
    border-radius: 2px;
}

.item-comments--skin-well .item-comments__item,
.item-comments--skin-well .item-comments__item.is-mine {
    position: relative;
    justify-content: flex-start;
}

.item-comments--skin-well .item-comments__item::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--brand-accent, #0B679E);
    box-sizing: border-box;
    z-index: 1;
}

.item-comments--skin-well .item-comments__item.is-mine::before {
    border-color: var(--brand-accent, #0B679E);
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 18%, #fff);
}

.item-comments--skin-well .item-comments__bubble {
    max-width: none;
    width: 100%;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: none;
}

.item-comments--skin-well .item-comments__item.is-mine .item-comments__bubble {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 3%, #fff);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 14%, #eef2f7);
}

/* 8. Мессенджер — фон как у чата, крупные пузыри */
.item-comments--skin-frost .item-comments__body {
    background: transparent;
}

.item-comments--skin-frost .item-comments__list {
    gap: 10px;
}

.item-comments--skin-frost .item-comments__bubble {
    max-width: min(88%, 380px);
    border-radius: 16px 16px 16px 4px;
    padding: 9px 12px;
    background: #fff;
    border: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.item-comments--skin-frost .item-comments__item.is-mine .item-comments__bubble {
    border-radius: 16px 16px 4px 16px;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 88%, #fff);
    border: 0;
    color: #fff;
}

.item-comments--skin-frost .item-comments__item.is-mine .item-comments__author,
.item-comments--skin-frost .item-comments__item.is-mine .item-comments__date,
.item-comments--skin-frost .item-comments__item.is-mine .item-comments__text {
    color: rgba(255, 255, 255, .92);
}

.item-comments--skin-frost .item-comments__item.is-mine .item-comments__delete {
    color: rgba(255, 255, 255, .7);
}

.item-comments--skin-frost .item-comments__composer {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: 0;
}

/* 9. Заметки — бумажный вид, всегда слева */
.item-comments--skin-sky .item-comments__list {
    gap: 10px;
}

.item-comments--skin-sky .item-comments__item,
.item-comments--skin-sky .item-comments__item.is-mine {
    justify-content: flex-start;
}

.item-comments--skin-sky .item-comments__bubble {
    max-width: none;
    width: 100%;
    border-radius: 2px;
    background: #fffef8;
    border: 1px solid #ebe1c8;
    border-left: 3px solid #d4a017;
    box-shadow: 1px 2px 0 rgba(180, 150, 80, .08);
    padding: 10px 12px;
    font-family: Georgia, 'Times New Roman', serif;
}

.item-comments--skin-sky .item-comments__item.is-mine .item-comments__bubble {
    background: #fffef8;
    border-color: #ebe1c8;
    border-left-color: var(--brand-accent, #0B679E);
}

.item-comments--skin-sky .item-comments__author {
    font-family: system-ui, sans-serif;
    font-weight: 400;
    color: #7a6518;
    text-transform: none;
    font-size: 14px;
    letter-spacing: 0;
}

.item-comments--skin-sky .item-comments__text {
    font-size: 14px;
    line-height: 1.55;
    color: #3f3a2e;
}

/* 10. Диалог — аватары + сильный chat layout */
.item-comments--skin-chat .item-comments__list {
    gap: 12px;
}

.item-comments--skin-chat .item-comments__item {
    align-items: flex-end;
    gap: 8px;
}

.item-comments--skin-chat .item-comments__item.is-mine {
    flex-direction: row-reverse;
}

.item-comments--skin-chat .item-comments__avatar {
    display: inline-flex;
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.item-comments--skin-chat .item-comments__bubble {
    max-width: min(78%, 360px);
    border-radius: 18px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.item-comments--skin-chat .item-comments__item.is-mine .item-comments__bubble {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 12%, #fff);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 24%, #e2e8f0);
    border-bottom-right-radius: 6px;
}

.item-comments--skin-chat .item-comments__item:not(.is-mine) .item-comments__bubble {
    border-bottom-left-radius: 6px;
}

.item-comments--skin-chat .item-comments__composer {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: 0;
}

.item-comments--skin-chat .item-comments__author {
    color: #475569;
}

@media (max-width: 720px) {
    .fd-comments-themes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.item-comments__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 0;
}

.item-comments__title {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
}

.item-comments__count {
    font-size: 14px;
    color: #94a3b8;
}

.item-comments__count.is-empty {
    display: none;
}

.item-comments__trigger-wrap {
    padding: 10px 12px;
}

.item-comments__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    color: #334155;
    font-size: 14px;
    cursor: pointer;
}

.item-comments__trigger:hover {
    color: var(--brand-accent, #0B679E);
}

.item-comments__trigger-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: inherit;
}

.item-comments__trigger-label {
    font-weight: 500;
}

.item-comments--collapsed .item-comments__body[hidden],
.item-comments__body[hidden] {
    display: none !important;
}

/* --- плавающий чат справа --- */
.item-comments-chat {
    position: static;
}

.item-comments-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1040;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px;
    margin: 0;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color .15s ease;
}

.item-comments-fab:hover {
    color: #64748b;
}

.item-comments-chat.is-open .item-comments-fab,
.item-comments-fab.has-unread {
    color: var(--brand-accent, #0B679E);
}

.item-comments-fab.has-unread {
    animation: item-comments-fab-blink 1.4s ease-in-out infinite;
}

.item-comments-chat.is-open .item-comments-fab.has-unread {
    animation: none;
}

@keyframes item-comments-fab-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.item-comments-fab__icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.item-comments-fab__badge {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: inherit;
}

.item-comments-fab__badge.is-empty {
    display: none;
}

.item-comments-drawer {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
}

.item-comments-drawer.is-open {
    pointer-events: auto;
}

.item-comments-drawer[hidden] {
    display: none !important;
}

.item-comments-drawer.is-open[hidden] {
    display: block !important;
}

.item-comments-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .28);
    opacity: 0;
    transition: opacity .25s ease;
}

.item-comments-drawer.is-open .item-comments-drawer__backdrop {
    opacity: 1;
}

.item-comments-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100%;
    background: #fff;
    box-shadow: -12px 0 40px rgba(15, 23, 42, .18);
    display: flex;
    flex-direction: column;
    transform: translateX(104%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}

.item-comments-drawer.is-open .item-comments-drawer__panel {
    transform: translateX(0);
}

.item-comments-drawer__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}

.item-comments-drawer__title-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.item-comments-drawer__title {
    font-size: 15px;
    font-weight: 400;
    color: #0f172a;
}

.item-comments-drawer__count {
    font-size: 14px;
    color: #94a3b8;
}

.item-comments-drawer__count.is-empty {
    display: none;
}

.item-comments-drawer__close {
    appearance: none;
    border: 0;
    background: transparent;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.item-comments-drawer__close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.item-comments-drawer__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 14px;
    overflow: hidden;
    background:
        linear-gradient(180deg, #f8fafc 0%, #fff 48px);
}

.item-comments-drawer__body .item-comments__list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding: 2px 2px 8px;
}

.item-comments-drawer__footer {
    flex: 0 0 auto;
    padding: 12px 14px 14px;
    border-top: 1px solid #eef2f7;
    background: #fff;
}

.item-comments-drawer__footer .item-comments__composer {
    width: 100%;
    margin: 0;
}

@media (max-width: 575.98px) {
    .item-comments-fab {
        right: 12px;
        bottom: 12px;
    }

    .item-comments-drawer__panel {
        width: 100vw;
    }
}

.item-comments__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px 12px;
}

.item-comments__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 360px;
    overflow: auto;
}

.item-comments__list:empty {
    display: none;
}

.item-comments__body:has(> .item-comments__list:empty):not(:has([data-role="show-more"])) {
    padding-top: 0;
    padding-bottom: 0;
    gap: 0;
}

.item-comments__empty {
    display: none;
}

.item-comments__more {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--brand-accent, #0B679E);
    font-size: 14px;
    padding: 0;
    text-align: left;
    cursor: pointer;
    flex: 0 0 auto;
}

.item-comments__more:hover {
    text-decoration: underline;
}

.item-comments__older {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-comments__older[hidden] {
    display: none !important;
}

.item-comments__item {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
}

.item-comments__item.is-mine {
    justify-content: flex-end;
}

.item-comments__bubble {
    max-width: min(92%, 420px);
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-comments__item.is-mine .item-comments__bubble {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #fff);
    border-color: color-mix(in srgb, var(--brand-accent, #0B679E) 14%, #eef2f7);
}

.item-comments__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1px;
    min-height: 16px;
    min-width: 0;
    width: 100%;
}

.item-comments__author {
    font-size: 14px;
    font-weight: 400;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.item-comments__item.is-mine .item-comments__author {
    color: var(--brand-accent, #0B679E);
}

.item-comments__date {
    font-size: 12px;
    color: #94a3b8;
    flex: 0 0 auto;
    align-self: flex-end;
    margin-top: 2px;
    line-height: 1.2;
}

.item-comments__delete {
    appearance: none;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #94a3b8;
    width: 18px;
    height: 18px;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    flex: 0 0 auto;
}

.item-comments__item:hover .item-comments__delete,
.item-comments__item:focus-within .item-comments__delete {
    opacity: 1;
}

.item-comments__delete:hover {
    color: #dc2626;
}

.item-comments__text {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.item-comments__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: end;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, .06);
}

.item-comments__input {
    width: 100%;
    min-height: 32px;
    max-height: 110px;
    resize: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: #475569;
    outline: none;
    box-shadow: none;
}

.item-comments__input:focus {
    border-color: transparent;
    box-shadow: none;
    color: #0f172a;
}

.item-comments__input::placeholder {
    color: #94a3b8;
}

.item-comments__send {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 4px;
    margin: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: color .12s ease;
    flex: 0 0 auto;
}

.item-comments__send:hover,
.item-comments__send:focus-visible {
    color: var(--brand-accent, #0B679E);
    outline: none;
}

.item-comments__send:disabled {
    opacity: .45;
    cursor: default;
}

.item-comments__send-icon {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.item-comments__error {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 12px;
    color: #b91c1c;
}

/* SQL-поле на странице записи */
.field-sql-query__table-wrap {
    border: 1px solid rgba(15, 23, 42, .06);
    border-radius: 8px;
    overflow: auto;
    background: #fff;
}

.field-sql-query__table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    --bs-table-striped-bg: rgba(248, 250, 252, .65);
}

.field-sql-query__table thead th {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom-color: rgba(15, 23, 42, .06) !important;
    padding-top: .55rem;
    padding-bottom: .45rem;
}

.field-sql-query__table td {
    vertical-align: middle;
    overflow: hidden;
    color: #334155;
    border-bottom-color: rgba(15, 23, 42, .05) !important;
    padding-top: .42rem;
    padding-bottom: .42rem;
}

.field-sql-query__table tbody tr:last-child td {
    border-bottom-color: transparent !important;
}

.field-sql-query__cell {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-sql-query__th--num,
.field-sql-query__td--num,
.field-sql-query__total-value {
    text-align: right;
}

.field-sql-query__td--num .field-sql-query__cell,
.field-sql-query__total-value .field-sql-query__cell {
    font-variant-numeric: tabular-nums;
}

.field-sql-query__table tfoot td {
    border-top: 1px solid rgba(15, 23, 42, .08);
    background: transparent;
    font-size: 13px;
    vertical-align: middle;
    padding-top: .55rem;
    padding-bottom: .55rem;
}

.field-sql-query__total-label {
    font-weight: 500;
    color: #94a3b8;
}

.field-sql-query__total-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.field-sql-query__pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 0 2px;
    max-width: 100%;
    min-width: 0;
}

.field-sql-query__pager .pagination {
    flex: 1 1 auto;
    min-width: 0;
}

.field-sql-query__pager-info {
    font-size: 12px;
}

.field-sql-query__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.field-sql-query__stat {
    flex: 1 1 140px;
    min-width: 120px;
    max-width: 240px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--app-table-border, var(--tblr-border-color));
    border-radius: 8px;
}

.field-sql-query__stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.field-sql-query__stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--tblr-body-color);
    line-height: 1.25;
    word-break: break-word;
}

.field-sql-query__cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-sql-query__card {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--app-table-border, var(--tblr-border-color));
    border-radius: 8px;
}

.field-sql-query__card-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 13px;
}

.field-sql-query__card-key {
    color: #64748b;
    flex-shrink: 0;
}

.field-sql-query__card-val {
    text-align: right;
    font-weight: 500;
    word-break: break-word;
}

.info-field-cell--sql {
    min-width: 0;
}


/* --- каталог модулей --- */
.modules-catalog {
    --modules-ink: #0f2d42;
    --modules-muted: #6b8498;
    --modules-line: #e4edf3;
    --modules-accent: var(--brand-accent, #0b679e);
    margin: 4px 0 28px;
}

.modules-catalog__empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--modules-muted);
    font-size: 14px;
}

.modules-panel {
    border: 1px solid var(--modules-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 45, 66, .04);
    overflow: hidden;
}

.modules-panel__summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--modules-line);
    background: linear-gradient(180deg, #f8fbfd 0%, #fff 100%);
}

.modules-panel__summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex-shrink: 0;
}

.modules-panel__summary-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--modules-muted);
}

.modules-panel__summary-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--modules-ink);
}

.modules-panel__meter {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 999px;
    background: #e8f0f5;
    overflow: hidden;
    min-width: 120px;
}

.modules-panel__meter-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5a9fc4, var(--modules-accent));
    transition: width .35s ease;
}

.modules-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modules-panel__item {
    min-width: 0;
}

.modules-panel__item:not(:nth-child(3n)) {
    border-right: 1px solid var(--modules-line);
}

.modules-panel__item:nth-child(n + 4) {
    border-top: 1px solid var(--modules-line);
}

.modules-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 4px 12px;
    padding: 12px 14px;
    text-decoration: none !important;
    color: var(--modules-ink);
    transition: background .15s ease;
    height: 100%;
    box-sizing: border-box;
}

.modules-row:hover {
    background: #f6fafc;
    color: var(--modules-ink);
}

.modules-row:focus-visible {
    outline: 2px solid var(--modules-accent);
    outline-offset: -2px;
}

.modules-row__icon {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(11, 103, 158, .09);
    color: var(--modules-accent);
}

.modules-row.is-off .modules-row__icon {
    background: #eef3f7;
    color: #7a93a6;
}

.modules-row.is-on .modules-row__icon::after {
    content: '';
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22a05a;
    border: 1.5px solid #fff;
}

.modules-row__icon svg.feather,
.modules-row__icon .icon-svg {
    width: 18px;
    height: 18px;
}

.modules-row__icon .icon-svg--max {
    width: 22px !important;
    height: 15px !important;
}

.modules-row__main {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    align-self: center;
}

.modules-row__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--modules-ink);
}

.modules-row__desc {
    font-size: 12px;
    line-height: 1.35;
    color: var(--modules-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.modules-row__status {
    display: none;
}

.modules-row__chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #a8bcc9;
    transition: transform .15s ease, color .15s ease;
}

.modules-row__chevron svg.feather {
    width: 16px;
    height: 16px;
}

.modules-row:hover .modules-row__chevron {
    color: var(--modules-accent);
    transform: translateX(2px);
}

@media (max-width: 1100px) {
    .modules-panel__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modules-panel__item:not(:nth-child(3n)) {
        border-right: none;
    }

    .modules-panel__item:nth-child(n + 4) {
        border-top: none;
    }

    .modules-panel__item:nth-child(odd) {
        border-right: 1px solid var(--modules-line);
    }

    .modules-panel__item:nth-child(n + 3) {
        border-top: 1px solid var(--modules-line);
    }
}

@media (max-width: 768px) {
    .modules-panel__summary {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .modules-panel__list {
        grid-template-columns: 1fr;
    }

    .modules-panel__item:nth-child(odd) {
        border-right: none;
    }

    .modules-panel__item:nth-child(n + 3) {
        border-top: none;
    }

    .modules-panel__item + .modules-panel__item {
        border-top: 1px solid var(--modules-line);
    }
}

@media (prefers-reduced-motion: reduce) {
    .modules-row,
    .modules-row__chevron,
    .modules-panel__meter-fill {
        transition: none;
    }
}

/* --- визуальный редактор фильтров (entities/filters) --- */
.filter-editor {
    margin-bottom: 8px;
}

.filter-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.filter-editor__defaults-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-editor__defaults-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) minmax(120px, 0.9fr) minmax(160px, 1.4fr) auto;
    gap: 8px;
    align-items: start;
}

.filter-editor__defaults-value .cfg-field-picker,
.filter-editor__defaults-picker {
    width: 100%;
}

.filter-editor__defaults-value .cfg-field-picker__list {
    margin-top: 4px;
}

@media (max-width: 768px) {
    .filter-editor__defaults-row {
        grid-template-columns: 1fr;
    }
}

.items-filters__chip--default .items-filters__chip-val {
    font-weight: 500;
}

.filter-editor__toolbar-item {
    min-width: 200px;
}

.filter-editor__toolbar-item .form-label {
    margin-bottom: 4px;
}

.filter-editor__panel-width {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
}

.filter-editor__panel-width input[type="range"] {
    flex: 1 1 auto;
    min-width: 120px;
}

.filter-editor__panel-width output {
    min-width: 32px;
    font-size: 13px;
    font-weight: 600;
    color: #0f2d42;
    text-align: right;
}

.filter-editor__mock {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 12px 0 14px;
    align-items: start;
}

.filter-editor--placement-right .filter-editor__mock {
    grid-template-columns: minmax(0, 1fr) var(--fe-panel-width, 280px);
}

.filter-editor__mock-list {
    min-width: 0;
    border: 1px solid #e2eaf0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.filter-editor__mock-list-head {
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: #6b8498;
    background: #f7fafc;
    border-bottom: 1px solid #e8eef3;
}

.filter-editor__mock-empty {
    padding: 18px 12px;
    font-size: 13px;
}

.filter-editor__mock-table-wrap {
    overflow: auto;
    max-height: 340px;
}

.filter-editor__mock-table {
    font-size: 12.5px;
}

.filter-editor__mock-table th {
    white-space: nowrap;
    font-weight: 500;
    color: #5a7388;
    background: #fafcfd;
}

.filter-editor__mock-table td {
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-editor__mock-filters {
    position: relative;
    min-width: 0;
    border: 1px solid #e2eaf0;
    border-radius: 10px;
    background: #fafcfd;
    padding: 10px 12px 12px;
}

.filter-editor--placement-right .filter-editor__mock-filters {
    width: 100%;
    position: sticky;
    top: 12px;
}

.filter-editor:not(.filter-editor--placement-right) .filter-editor__mock-filters {
    order: -1;
}

.filter-editor__panel-resize {
    position: absolute;
    left: -5px;
    top: 12px;
    bottom: 12px;
    width: 10px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: ew-resize;
    z-index: 3;
}

.filter-editor__panel-resize::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 36px;
    border-radius: 2px;
    background: #c5d4e0;
}

.filter-editor__panel-resize:hover::after,
.filter-editor--panel-resizing .filter-editor__panel-resize::after {
    background: var(--brand-accent, #0b679e);
}

.filter-editor--panel-resizing {
    cursor: ew-resize;
    user-select: none;
}

.filter-editor__stage-label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #6b8498;
}

.filter-editor__preview-wrap {
    margin-bottom: 0;
}

.filter-editor__preview {
    margin-bottom: 0;
}

.filter-editor__empty {
    margin: 10px 0 0;
    font-size: 13px;
    color: #6b8498;
}

.filter-editor__preview .items-filters__form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.filter-editor__preview.items-filters--right .items-filters__form,
.filter-editor__preview.items-filters--right .filter-editor__form,
.filter-editor__preview.items-filters--right .items-filters__fields,
.filter-editor__preview.items-filters--right .filter-editor__fields {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}

.filter-editor__preview.items-filters--right .filter-editor__field,
.filter-editor__preview.items-filters--right .items-filters__field,
.filter-editor__preview.items-filters--right .items-filters__field--date,
.filter-editor__preview.items-filters--right .items-filters__field--period,
.filter-editor__preview.items-filters--right .items-filters__field--multi {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.filter-editor__preview.items-filters--right .items-filters__field--period {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
}

.filter-editor__preview.items-filters--right .filter-editor__resize {
    display: none !important;
}

.filter-editor--placement-right .filter-editor__preview {
    max-width: none;
    width: 100%;
    margin-left: 0;
}

.filter-editor__fields {
    flex-wrap: wrap;
}

.filter-editor__field {
    position: relative;
    cursor: grab;
    transition: box-shadow .15s ease, outline-color .15s ease;
}

/* disabled/readonly controls глотают click — клик должен попадать в поле для инспектора */
.filter-editor__preview .filter-editor__field input,
.filter-editor__preview .filter-editor__field select,
.filter-editor__preview .filter-editor__field textarea,
.filter-editor__preview .filter-editor__field .field-layout-input-addon,
.filter-editor__preview .filter-editor__field .items-filters__period-sep {
    pointer-events: none;
}

.filter-editor__field.is-selected {
    outline: 2px solid color-mix(in srgb, var(--brand-accent, #0b679e) 55%, transparent);
    outline-offset: 1px;
    border-radius: 8px;
    z-index: 2;
}

.filter-editor__field.is-dragging {
    opacity: .45;
}

.filter-editor__resize {
    position: absolute;
    top: 4px;
    right: 0;
    bottom: 4px;
    width: 8px;
    cursor: ew-resize;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--brand-accent, #0b679e) 18%, transparent));
    opacity: 0;
    transition: opacity .15s ease;
}

.filter-editor__field:hover .filter-editor__resize,
.filter-editor__field.is-selected .filter-editor__resize {
    opacity: 1;
}

.filter-editor__inspector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-editor__inspector-remove {
    border: none;
    background: transparent;
    color: #c45c5c;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.filter-editor__inspector-remove:hover {
    text-decoration: underline;
}

.filter-editor__inspector-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px 14px;
    align-items: center;
}

.filter-editor__label {
    margin: 0;
    font-size: 13px;
    color: #5a7388;
}

.filter-editor__width {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-editor__width input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
}

.filter-editor__width output {
    min-width: 36px;
    font-size: 13px;
    font-weight: 600;
    color: #0f2d42;
    text-align: right;
}

.filter-editor__pool {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e2eaf0;
    border-radius: 10px;
    background: #fafcfd;
}

.filter-editor__pool-label {
    font-size: 13px;
    color: #6b8498;
    font-weight: 500;
}

.filter-editor__pool-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-editor__pool-empty {
    font-size: 13px;
}

.filter-editor__pool-btn {
    border: 1px solid #d5e3ec;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.filter-editor__pool-btn:hover {
    border-color: color-mix(in srgb, var(--brand-accent, #0b679e) 35%, #d5e3ec);
    color: var(--brand-accent, #0b679e);
    background: #f6fbfe;
}

.filter-editor__pool-btn--nested {
    border-style: dashed;
    max-width: 100%;
    text-align: left;
}

.filter-editor__inspector {
    margin: 0 0 10px;
    padding: 12px 14px;
    border: 1px solid #e2eaf0;
    border-radius: 10px;
    background: #fff;
}

.filter-editor__footer {
    margin-top: 4px;
}

@media (max-width: 900px) {
    .filter-editor--placement-right .filter-editor__mock {
        grid-template-columns: 1fr;
    }

    .filter-editor--placement-right .filter-editor__mock-filters {
        width: 100%;
        position: static;
        order: -1;
    }

    .filter-editor__panel-resize {
        display: none;
    }
}

.filter-editor--resizing {
    cursor: ew-resize;
    user-select: none;
}

.filter-editor--resizing .filter-editor__field {
    cursor: ew-resize;
}

.items-filters__field .field-layout-input-icon-wrap--group {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: var(--app-control-height);
    min-height: var(--app-control-height);
    max-height: var(--app-control-height);
    margin: 0;
    --items-filter-control-height: var(--app-control-height);
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    padding: 0 .55rem;
    min-width: 2.1rem;
    line-height: 0;
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-body {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-body > .form-control,
.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-body > .form-select {
    min-height: 100% !important;
    height: 100% !important;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-body > .flatpickr-input-wrap {
    display: block;
    width: 100%;
    height: 100%;
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-body > .flatpickr-input-wrap > .form-control {
    min-height: 100% !important;
    height: 100% !important;
    padding-top: 0;
    padding-bottom: 0;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-addon .field-layout-icon-svg,
.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-addon .field-layout-icon,
.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-addon svg.feather {
    display: block;
    width: 15px;
    height: 15px;
    margin: 0;
    flex-shrink: 0;
}

.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-addon .field-layout-icon-svg svg,
.items-filters__field .field-layout-input-icon-wrap--group .field-layout-input-addon [data-feather] {
    width: 15px;
    height: 15px;
    display: block;
}

.items-filters .field-layout-input-icon-wrap--group .form-control.flatpickr-date {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Переключатель да/нет: подпись рисуется отдельно, без пустого label внутри */
.form-check.form-switch.form-switch--solo {
    display: inline-flex;
    align-items: center;
    align-self: center;
    padding-left: 0;
    min-height: 0;
    margin-bottom: 0;
}

.form-check.form-switch.form-switch--solo .form-check-input {
    margin: 0;
    float: none;
}

.form-check.form-check--boolean {
    display: inline-flex;
    align-items: center;
    padding-left: 0;
    min-height: var(--app-control-height, 30px);
    margin: 0;
}
.form-check.form-check--boolean .form-check-input {
    margin: 0;
    float: none;
}

/* Кастомные визуализации флажка (да/нет) */
.app-bool {
    --app-bool-on: var(--brand-accent, #0B679E);
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.app-bool.is-disabled {
    cursor: default;
    opacity: .55;
    filter: grayscale(35%);
}
.app-bool__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

/* iOS */
.app-bool--ios .app-bool__track {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    width: 44px;
    height: 26px;
    border: 1px solid color-mix(in srgb, var(--app-table-border, #e6ebf0) 80%, #94a3b8);
    border-radius: 999px;
    background: #e8edf2;
    transition: background .18s ease, border-color .18s ease;
}
.app-bool--ios .app-bool__track::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
    transition: transform .18s ease;
}
.app-bool--ios .app-bool__input:checked + .app-bool__track {
    background: var(--app-bool-on);
    border-color: var(--app-bool-on);
}
.app-bool--ios .app-bool__input:checked + .app-bool__track::before {
    transform: translateX(18px);
}
.app-bool--ios .app-bool__input:focus-visible + .app-bool__track {
    outline: 1px solid var(--app-bool-on);
    outline-offset: 2px;
}

/* Google / Android */
.app-bool--google .app-bool__track {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 14px;
    border-radius: 999px;
    background: #b0bac4;
    transition: background .18s ease;
}
.app-bool--google .app-bool__track::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .2);
    transition: transform .18s ease, background .18s ease;
}
.app-bool--google .app-bool__input:checked + .app-bool__track {
    background: color-mix(in srgb, var(--app-bool-on) 42%, #fff);
}
.app-bool--google .app-bool__input:checked + .app-bool__track::before {
    background: var(--app-bool-on);
    transform: translateX(18px);
}
.app-bool--google .app-bool__input:focus-visible + .app-bool__track::before {
    outline: 1px solid var(--app-bool-on);
    outline-offset: 2px;
}

/* Панель Да/Нет — активное значение на бегунке: Нет = серый, Да = синий */
.app-bool--panel .app-bool__track {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    width: 92px;
    height: 28px;
    border: 1px solid #c5ccd6;
    border-radius: 5px;
    background: #e8edf2;
    transition: background-color .2s ease, border-color .2s ease;
    overflow: hidden;
}
.app-bool--panel .app-bool__track::before {
    content: attr(data-on);
    position: absolute;
    top: 0;
    left: 46px;
    width: 44px;
    padding: 0 4px;
    box-sizing: border-box;
    text-align: center;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    line-height: 26px;
    color: #94a3b8;
}
.app-bool--panel .app-bool__track::after {
    content: attr(data-off);
    position: absolute;
    top: 2px;
    left: 2px;
    z-index: 2;
    width: 42px;
    height: 22px;
    border-radius: 3px;
    background: #8b97a5;
    text-align: center;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .03em;
    line-height: 22px;
    color: #fff;
    transition: transform .2s ease, background-color .2s ease, color .2s ease;
}
.app-bool--panel .app-bool__input:checked + .app-bool__track {
    background: color-mix(in srgb, var(--app-bool-on) 10%, #fff);
    border-color: color-mix(in srgb, var(--app-bool-on) 35%, #c5ccd6);
}
.app-bool--panel .app-bool__input:checked + .app-bool__track::before {
    content: attr(data-off);
    left: 2px;
    color: #94a3b8;
}
.app-bool--panel .app-bool__input:checked + .app-bool__track::after {
    content: attr(data-on);
    background: var(--app-bool-on);
    color: #fff;
    transform: translate3d(44px, 0, 0);
}
.app-bool--panel .app-bool__input:focus-visible + .app-bool__track {
    outline: 1px solid var(--app-bool-on);
    outline-offset: 2px;
}

/* Да / Нет — воздушный: серая обводка, чёрный текст, синий квадрат */
.app-bool--ya .app-bool__track,
.app-bool--onoff .app-bool__track {
    position: relative;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    width: 84px;
    height: 30px;
    padding: 3px;
    border: 1px solid #d0d7e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    transition: background .18s ease, border-color .18s ease;
}
.app-bool--ya .app-bool__label,
.app-bool--onoff .app-bool__label {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .01em;
    text-transform: none;
    line-height: 1;
    pointer-events: none;
    transition: opacity .15s ease;
}
.app-bool--ya .app-bool__label--on,
.app-bool--onoff .app-bool__label--on {
    left: 4px;
    width: 36px;
    color: #1e293b;
    opacity: 0;
}
.app-bool--ya .app-bool__label--off,
.app-bool--onoff .app-bool__label--off {
    right: 4px;
    width: 36px;
    color: #64748b;
    opacity: 1;
}
.app-bool--ya .app-bool__knob,
.app-bool--onoff .app-bool__knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 32px;
    height: 22px;
    border-radius: 5px;
    background: #fff;
    border: 1px solid #d0d7e0;
    box-shadow: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
    z-index: 1;
}
.app-bool--ya .app-bool__input:checked + .app-bool__track,
.app-bool--onoff .app-bool__input:checked + .app-bool__track {
    background: #fff;
    border-color: #d0d7e0;
}
.app-bool--ya .app-bool__input:checked + .app-bool__track .app-bool__knob,
.app-bool--onoff .app-bool__input:checked + .app-bool__track .app-bool__knob {
    background: var(--app-bool-on, var(--brand-accent, #0B679E));
    border-color: var(--app-bool-on, var(--brand-accent, #0B679E));
    transform: translateX(44px);
}
.app-bool--ya .app-bool__input:checked + .app-bool__track .app-bool__label--on,
.app-bool--onoff .app-bool__input:checked + .app-bool__track .app-bool__label--on {
    opacity: 1;
}
.app-bool--ya .app-bool__input:checked + .app-bool__track .app-bool__label--off,
.app-bool--onoff .app-bool__input:checked + .app-bool__track .app-bool__label--off {
    opacity: 0;
}
.app-bool--ya .app-bool__input:focus-visible + .app-bool__track,
.app-bool--onoff .app-bool__input:focus-visible + .app-bool__track {
    outline: 1px solid var(--app-bool-on, var(--brand-accent, #0B679E));
    outline-offset: 2px;
}

/* Список как переключатель (как numeric-quick: тихая «дорожка», активный — белый) */
.field-dropdown-switch {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    width: fit-content;
    min-width: 0;
    padding: 3px;
    border-radius: var(--app-control-radius, 6px);
    background: color-mix(in srgb, var(--tblr-border-color, #d8dee6) 28%, #fff);
    box-shadow: inset 0 1px 2px rgba(15, 45, 66, .06);
}

/*
 * Подпись слева / скрыта: в одной строке с «подпись сверху» ячейка тянется по высоте,
 * а контрол прижимаем вниз — к линии соседних инпутов (иначе список «висит» выше).
 * Селектор без `.app-modal-form.row > …`: поля часто внутри `.tab-pane > .row.g-3`.
 */
form.row.g-3,
form .row.g-3.app-modal-form,
.app-modal-form .row.g-3 {
    align-items: stretch;
}

/* Высокий виджет календаря не должен растягивать соседей и уводить switch вниз */
form .row.g-3:has([data-field-type="fieldtype_calendar_range"]),
form.row.g-3:has([data-field-type="fieldtype_calendar_range"]) {
    align-items: flex-start;
}

form .row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-left,
form .row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-hidden,
form.row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-left,
form.row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-hidden {
    align-self: flex-start;
}

form .row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-left > .field-layout-box,
form .row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-hidden > .field-layout-box,
form.row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-left > .field-layout-box,
form.row.g-3:has([data-field-type="fieldtype_calendar_range"]) > .field-col--label-hidden > .field-layout-box {
    justify-content: flex-start !important;
    height: auto;
    min-height: 0;
    flex: 0 1 auto;
}

form .row.g-3 > [data-field-type="fieldtype_calendar_range"],
form.row.g-3 > [data-field-type="fieldtype_calendar_range"] {
    align-self: flex-start;
}

form.row.g-3 > .field-col--label-left,
form.row.g-3 > .field-col--label-hidden,
form .row.g-3 > .field-col--label-left,
form .row.g-3 > .field-col--label-hidden {
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

form.row.g-3 > .field-col--label-left > .field-layout-box,
form.row.g-3 > .field-col--label-hidden > .field-layout-box,
form .row.g-3 > .field-col--label-left > .field-layout-box,
form .row.g-3 > .field-col--label-hidden > .field-layout-box {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end !important;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.field-form-label-left {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    min-height: var(--app-control-height, 34px);
}

.field-form-label-left--align-top {
    align-items: flex-start;
}

.field-form-label-left--align-center {
    align-items: center;
}

.field-form-label-left--align-bottom {
    align-items: flex-end;
}

.field-form-label-left__label {
    flex: 0 1 auto;
    max-width: 48%;
    min-width: 0;
    display: flex;
    align-items: center;
    min-height: var(--app-control-height, 34px);
    overflow: hidden;
}

.field-form-label-left__label .form-label {
    margin: 0 !important;
    padding: 0;
    white-space: nowrap;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
}

/* подпись слева у переключателя: одна высота с дорожкой, текст по центру */
.field-form-label-left--switch {
    align-items: center;
}

.field-form-label-left--switch .field-form-label-left__label,
.field-form-label-left--switch .field-form-label-left__control {
    min-height: var(--app-control-height, 34px);
}

.field-form-label-left--switch .field-dropdown-switch {
    height: var(--app-control-height, 34px);
    min-height: var(--app-control-height, 34px);
    padding: 2px;
    box-sizing: border-box;
}

.field-form-label-left--switch .field-dropdown-switch .btn-check + .field-dropdown-switch__btn {
    min-height: 0;
    height: calc(var(--app-control-height, 34px) - 4px);
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
}

.field-form-label-left__control {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.field-form-label-left > .info-field-value {
    flex: 1 1 auto;
    min-width: 0;
}

.field-dropdown-switch .btn-check + .field-dropdown-switch__btn {
    appearance: none;
    margin: 0;
    padding: 4px 11px;
    min-height: calc(var(--app-control-height, 30px) - 6px);
    border: 0 !important;
    border-radius: calc(var(--app-control-radius, 6px) - 2px);
    background: transparent !important;
    color: var(--tblr-secondary-color, #64748b) !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.field-dropdown-switch .btn-check + .field-dropdown-switch__btn:hover {
    color: var(--tblr-body-color, #334155) !important;
    background: color-mix(in srgb, #fff 55%, transparent) !important;
}

.field-dropdown-switch .btn-check:checked + .field-dropdown-switch__btn {
    background: #fff !important;
    color: var(--tblr-body-color, #1e293b) !important;
    font-weight: 500;
    box-shadow:
        0 1px 2px rgba(15, 45, 66, .08),
        0 3px 10px rgba(15, 45, 66, .14) !important;
}

.field-dropdown-switch .btn-check + .field-dropdown-switch__btn--empty {
    min-width: 2rem;
    padding-left: .55rem;
    padding-right: .55rem;
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
}

.field-dropdown-switch .btn-check:focus-visible + .field-dropdown-switch__btn {
    outline: 2px solid color-mix(in srgb, var(--brand-accent, #0B679E) 45%, transparent);
    outline-offset: 1px;
}

.field-form-boolean-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 28px;
    width: 100%;
}

.field-form-boolean-row.field-form-boolean-align--top,
.field-form-boolean-stack.field-form-boolean-align--top {
    align-items: flex-start;
}

.field-form-boolean-row.field-form-boolean-align--center,
.field-form-boolean-stack.field-form-boolean-align--center {
    align-items: center;
}

.field-form-boolean-row.field-form-boolean-align--bottom,
.field-form-boolean-stack.field-form-boolean-align--bottom {
    align-items: flex-end;
}

.field-form-boolean-stack {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    width: 100%;
}

.field-form-boolean-stack--label-top .field-form-boolean-row__label .form-label,
.field-form-boolean-stack--label-bottom .field-form-boolean-row__label .form-label {
    margin-bottom: 0;
}

.field-form-boolean-row__label {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    height: 28px;
    min-height: 28px;
}

.field-form-boolean-row__label .form-label {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 28px !important;
    height: 28px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.field-form-boolean-row__control {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 28px;
    min-height: 28px;
}

.fd-field-preview .field-form-boolean-row,
.fd-field-preview .field-form-boolean-stack {
    padding-right: 4px;
}

.fd-field-preview[data-label-position="left"] .form-check.form-switch {
    display: inline-flex;
    align-items: center;
    padding-left: 0;
    min-height: 0;
    margin-bottom: 0;
}

.fd-field-preview[data-label-position="left"] .form-check.form-switch .form-check-input {
    margin: 0;
    float: none;
}

.fd-field-preview[data-label-position="left"] .form-check.form-switch .form-check-label:empty {
    display: none;
}

/* Сетка полей 24 колонки (~4% шаг): форма и страница записи */
@media (min-width: 768px) {
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > [class*="col-grid-"] {
        flex: 0 0 auto;
    }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-1 { width: calc(100% / 24 * 1); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-2 { width: calc(100% / 24 * 2); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-3 { width: calc(100% / 24 * 3); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-4 { width: calc(100% / 24 * 4); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-5 { width: calc(100% / 24 * 5); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-6 { width: calc(100% / 24 * 6); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-7 { width: calc(100% / 24 * 7); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-8 { width: calc(100% / 24 * 8); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-9 { width: calc(100% / 24 * 9); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-10 { width: calc(100% / 24 * 10); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-11 { width: calc(100% / 24 * 11); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-12 { width: calc(100% / 24 * 12); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-13 { width: calc(100% / 24 * 13); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-14 { width: calc(100% / 24 * 14); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-15 { width: calc(100% / 24 * 15); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-16 { width: calc(100% / 24 * 16); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-17 { width: calc(100% / 24 * 17); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-18 { width: calc(100% / 24 * 18); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-19 { width: calc(100% / 24 * 19); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-20 { width: calc(100% / 24 * 20); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-21 { width: calc(100% / 24 * 21); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-22 { width: calc(100% / 24 * 22); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-23 { width: calc(100% / 24 * 23); }
    :is(
        form .row.g-3,
        .item-page .row.g-3,
        .item-page .row.g-1,
        .item-page .info-layout-section .row,
        .item-page .info-layout-collapsible__body .row,
        .item-page .info-layout-collapsible__pinned .row,
        .row.g-3
    ) > .col-grid-24 { width: 100%; }
}

/* Страница записи: доли col-grid без col-12, совпадают с редактором */
.item-page .info-field-col[class*="col-grid-"],
.item-page .row.g-1 > [class*="col-grid-"],
.item-page .info-layout-section .row > [class*="col-grid-"],
.item-page .info-layout-collapsible__body .row > [class*="col-grid-"],
.item-page .info-layout-collapsible__pinned .row > [class*="col-grid-"] {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}
@media (min-width: 768px) {
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-1 {
        flex: 0 0 calc(100% / 24 * 1);
        width: calc(100% / 24 * 1);
        max-width: calc(100% / 24 * 1);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-2 {
        flex: 0 0 calc(100% / 24 * 2);
        width: calc(100% / 24 * 2);
        max-width: calc(100% / 24 * 2);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-3 {
        flex: 0 0 calc(100% / 24 * 3);
        width: calc(100% / 24 * 3);
        max-width: calc(100% / 24 * 3);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-4 {
        flex: 0 0 calc(100% / 24 * 4);
        width: calc(100% / 24 * 4);
        max-width: calc(100% / 24 * 4);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-5 {
        flex: 0 0 calc(100% / 24 * 5);
        width: calc(100% / 24 * 5);
        max-width: calc(100% / 24 * 5);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-6 {
        flex: 0 0 calc(100% / 24 * 6);
        width: calc(100% / 24 * 6);
        max-width: calc(100% / 24 * 6);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-7 {
        flex: 0 0 calc(100% / 24 * 7);
        width: calc(100% / 24 * 7);
        max-width: calc(100% / 24 * 7);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-8 {
        flex: 0 0 calc(100% / 24 * 8);
        width: calc(100% / 24 * 8);
        max-width: calc(100% / 24 * 8);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-9 {
        flex: 0 0 calc(100% / 24 * 9);
        width: calc(100% / 24 * 9);
        max-width: calc(100% / 24 * 9);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-10 {
        flex: 0 0 calc(100% / 24 * 10);
        width: calc(100% / 24 * 10);
        max-width: calc(100% / 24 * 10);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-11 {
        flex: 0 0 calc(100% / 24 * 11);
        width: calc(100% / 24 * 11);
        max-width: calc(100% / 24 * 11);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-12 {
        flex: 0 0 calc(100% / 24 * 12);
        width: calc(100% / 24 * 12);
        max-width: calc(100% / 24 * 12);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-13 {
        flex: 0 0 calc(100% / 24 * 13);
        width: calc(100% / 24 * 13);
        max-width: calc(100% / 24 * 13);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-14 {
        flex: 0 0 calc(100% / 24 * 14);
        width: calc(100% / 24 * 14);
        max-width: calc(100% / 24 * 14);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-15 {
        flex: 0 0 calc(100% / 24 * 15);
        width: calc(100% / 24 * 15);
        max-width: calc(100% / 24 * 15);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-16 {
        flex: 0 0 calc(100% / 24 * 16);
        width: calc(100% / 24 * 16);
        max-width: calc(100% / 24 * 16);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-17 {
        flex: 0 0 calc(100% / 24 * 17);
        width: calc(100% / 24 * 17);
        max-width: calc(100% / 24 * 17);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-18 {
        flex: 0 0 calc(100% / 24 * 18);
        width: calc(100% / 24 * 18);
        max-width: calc(100% / 24 * 18);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-19 {
        flex: 0 0 calc(100% / 24 * 19);
        width: calc(100% / 24 * 19);
        max-width: calc(100% / 24 * 19);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-20 {
        flex: 0 0 calc(100% / 24 * 20);
        width: calc(100% / 24 * 20);
        max-width: calc(100% / 24 * 20);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-21 {
        flex: 0 0 calc(100% / 24 * 21);
        width: calc(100% / 24 * 21);
        max-width: calc(100% / 24 * 21);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-22 {
        flex: 0 0 calc(100% / 24 * 22);
        width: calc(100% / 24 * 22);
        max-width: calc(100% / 24 * 22);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-23 {
        flex: 0 0 calc(100% / 24 * 23);
        width: calc(100% / 24 * 23);
        max-width: calc(100% / 24 * 23);
    }
    :is(.item-page .row.g-1,
    .item-page .info-layout-section .row,
    .item-page .info-layout-collapsible__body .row,
    .item-page .info-layout-collapsible__pinned .row,
    .item-page .info-layout-root.row) > .col-grid-24 {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}

/* Форма: одинаковая высота соседних полей в строке */
form .row.g-3 > [class*="col-md-"],
form .row.g-3 > [class*="col-grid-"],
.item-page .row.g-3 > [class*="col-grid-"],
.item-page .row.g-1 > [class*="col-grid-"],
.item-page .info-layout-section .row > [class*="col-grid-"],
.item-page .info-layout-collapsible__body .row > [class*="col-grid-"],
.item-page .info-layout-collapsible__pinned .row > [class*="col-grid-"] {
    display: flex;
    flex-direction: column;
}

form .row.g-3 > [class*="col-md-"] > div,
form .row.g-3 > [class*="col-grid-"] > div {
    flex: 1 1 auto;
    min-width: 0;
}

.item-page .row.g-3 > [class*="col-grid-"] > div,
.item-page .row.g-1 > [class*="col-grid-"] > div,
.item-page .info-layout-section .row > [class*="col-grid-"] > div,
.item-page .info-layout-collapsible__body .row > [class*="col-grid-"] > div,
.item-page .info-layout-collapsible__pinned .row > [class*="col-grid-"] > div {
    flex: 0 1 auto;
    min-width: 0;
}

@media (max-width: 768px) {
    .filter-editor__inspector-grid {
        grid-template-columns: 1fr;
    }
}

/* --- редактор меню (дерево) --- */
.menu-tree-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.menu-tree,
.menu-tree-head {
    --menu-cols: 28px minmax(160px, 1.35fr) minmax(150px, 1fr) minmax(140px, 1fr) 168px 210px 36px;
}

.menu-tree {
    list-style: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.menu-tree__item,
.menu-tree__group {
    list-style: none;
}

.menu-tree-head,
.menu-tree__row,
.menu-tree__row--group,
.menu-tree__children .menu-tree__row {
    display: grid;
    grid-template-columns: var(--menu-cols);
    gap: 8px;
    align-items: center;
    padding: 8px 0;
}

.menu-tree-head {
    padding: 0 0 6px;
    font-size: 11px;
    color: #7a93a6;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid rgba(15, 45, 66, .1);
    margin-bottom: 4px;
}

.menu-tree__row {
    border-bottom: 1px solid rgba(15, 45, 66, .06);
    background: transparent;
}

.menu-tree__row--group {
    background: rgba(11, 103, 158, .04);
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
    margin: 2px 0;
    border-bottom-color: transparent;
}

.menu-tree__children {
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-bottom: none;
    min-height: 8px;
}

.menu-tree__children .menu-tree__row {
    background: transparent;
}

.menu-tree__row--nested .menu-tree__main {
    padding-left: 18px;
    position: relative;
}

.menu-tree__row--nested .menu-tree__main::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-left: 1px solid #b7c9d6;
    border-bottom: 1px solid #b7c9d6;
    transform: translateY(-30%);
}

.menu-tree__handle {
    cursor: grab;
    color: #8aa0b2;
    font-size: 14px;
    letter-spacing: -2px;
    user-select: none;
    text-align: center;
}

.menu-tree__item.is-dragging,
.menu-tree__group.is-dragging {
    opacity: .45;
}

.menu-tree__item.is-drop-before > .menu-tree__row,
.menu-tree__group.is-drop-before > .menu-tree__row {
    box-shadow: inset 0 2px 0 #0B679E;
}

.menu-tree__item.is-drop-after > .menu-tree__row,
.menu-tree__group.is-drop-after > .menu-tree__row {
    box-shadow: inset 0 -2px 0 #0B679E;
}

.menu-tree__group.is-drop-into {
    outline: 2px solid rgba(11, 103, 158, .45);
    outline-offset: -2px;
}

.menu-tree__main {
    min-width: 0;
}

.menu-tree__title {
    font-size: var(--app-font-size);
    font-weight: 400;
    color: #0f2d42;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-tree__meta {
    font-size: 11px;
    color: #7a93a6;
}

.menu-tree__group-label {
    font-weight: 600;
}

.menu-tree__field {
    min-width: 0;
}

.menu-tree__field .form-control,
.menu-tree__field .form-select {
    width: 100%;
}

.menu-tree__field--muted {
    color: #a0b3c2;
}

.menu-tree__placeholder {
    display: inline-block;
    padding: 0 4px;
    color: #a0b3c2;
}

.menu-tree__zones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.menu-tree__check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    color: #5a7388;
    white-space: nowrap;
    cursor: pointer;
}

.menu-tree__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

.menu-tree__field--label input {
    min-width: 0;
}

.menu-tree-hint {
    max-width: none;
    font-size: 13px;
}

.menu-help-steps {
    margin: 6px 0 0;
    padding-left: 1.25rem;
}

.menu-help-steps li {
    margin: 2px 0;
}

.menu-tree__group-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #0B679E;
    background: rgba(11, 103, 158, .1);
    border-radius: 4px;
    padding: 1px 6px;
    margin-bottom: 4px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.menu-tree__empty {
    list-style: none;
    padding: 10px 12px 12px 46px;
    font-size: 12px;
    color: #8aa0b2;
    font-style: italic;
}

.menu-tree__field--group .form-select {
    min-width: 0;
}

@media (max-width: 1100px) {
    .menu-tree,
    .menu-tree-head {
        --menu-cols: 28px 1fr;
    }

    .menu-tree-head span:nth-child(n+3) {
        display: none;
    }

    .menu-tree__field,
    .menu-tree__zones,
    .menu-tree__actions {
        grid-column: 2;
    }
}

/* --- настройки меню (карточки, как у сущностей) --- */
.menu-tree-editor {
    margin-bottom: 1rem;
}

.menu-tree--menu,
.menu-tree-head--menu,
.menu-tree--menu .menu-tree__row {
    --menu-cols: 28px minmax(140px, 1.2fr) minmax(120px, 0.85fr) minmax(120px, 0.85fr) minmax(120px, 0.9fr) max-content 36px;
}

.menu-tree-head--menu {
    padding: 0 12px 8px;
    margin: 0 0 8px;
    border-bottom: none;
    color: #8a9aab;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: none;
}

.menu-tree--menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-tree--menu > .menu-tree__item,
.menu-tree--menu > .menu-tree__group {
    background: #fff;
    border: 1px solid rgba(15, 45, 66, .08);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 45, 66, .04);
    overflow: visible;
}

.menu-tree--menu .menu-tree__row,
.menu-tree--menu .menu-tree__row--group,
.menu-tree--menu .menu-tree__children .menu-tree__row {
    position: relative;
    gap: 10px;
    padding: 6px 12px;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(15, 45, 66, .06);
    background: transparent;
    overflow: visible;
}

.menu-tree--menu > .menu-tree__item > .menu-tree__row,
.menu-tree--menu > .menu-tree__group > .menu-tree__row {
    border-bottom: none;
}

.menu-tree--menu > .menu-tree__group.menu-tree__group--parent > .menu-tree__row,
.menu-tree--menu > .menu-tree__group:has(.menu-tree__children .menu-tree__item) > .menu-tree__row {
    border-bottom: 1px solid rgba(15, 45, 66, .06);
}

.menu-tree--menu .menu-tree__row--group {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
}

.menu-tree--menu .menu-tree__row--group:hover {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 12%, #fff);
}

.menu-tree--menu .menu-tree__row--nested {
    background: transparent;
}

.menu-tree--menu .menu-tree__row--nested:hover {
    background: rgba(15, 45, 66, .025);
}

.menu-tree--menu .menu-tree__children {
    background: #f7fafc;
    min-height: 0;
    overflow: visible;
    border-radius: 0 0 10px 10px;
}

.menu-tree--menu .menu-tree__children > .menu-tree__item:last-child > .menu-tree__row {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.menu-tree--menu .menu-tree__handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 26px;
    color: #9aabb8;
    cursor: grab;
    user-select: none;
    font-size: 0;
    letter-spacing: 0;
}

.menu-tree--menu .menu-tree__grip {
    width: 10px;
    height: 14px;
    background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.25px);
    background-size: 5px 5px;
    background-position: 0 0;
    opacity: .55;
}

.menu-tree--menu .menu-tree__main {
    min-width: 0;
    display: flex;
    align-items: center;
}

.menu-tree--menu .menu-tree__title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
    width: 100%;
}

.menu-tree--menu .menu-tree__title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1f2d3a;
    line-height: 1.25;
}

.menu-tree--menu .menu-tree__meta {
    display: inline-flex;
    align-items: baseline;
    margin: 0;
    font-size: 12px;
    color: #8a9aab;
    line-height: 1.25;
}

.menu-tree--menu .menu-tree__group-badge {
    margin: 0;
    flex: 0 0 auto;
}

.menu-tree--menu .menu-tree__group-label {
    flex: 1 1 120px;
    min-width: 100px;
    max-width: 220px;
    height: 28px;
    min-height: 28px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
}

.menu-tree--menu .menu-tree__row--nested .menu-tree__main {
    padding-left: 22px;
    position: relative;
}

.menu-tree--menu .menu-tree__row--nested .menu-tree__main::before {
    content: '';
    position: absolute;
    left: 6px;
    top: -10px;
    bottom: 50%;
    width: 12px;
    border-left: 1.5px solid #c5d0db;
    border-bottom: 1.5px solid #c5d0db;
    border-bottom-left-radius: 3px;
    transform: none;
    height: auto;
}

.menu-tree--menu .menu-tree__field .form-control,
.menu-tree--menu .menu-tree__field .form-select,
.menu-tree--menu .menu-tree__field .form-control-sm,
.menu-tree--menu .menu-tree__field .form-select-sm {
    height: 28px;
    min-height: 28px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 12.5px;
    border-radius: 6px;
}

.menu-tree--menu .menu-tree__zones {
    gap: 6px 10px;
}

.menu-tree--menu .menu-tree__check {
    font-size: 12px;
    color: #5a7388;
}

.menu-tree--menu .menu-tree__actions {
    min-height: 28px;
}

.menu-tree--menu .menu-tree__actions .btn.btn-sm {
    box-sizing: border-box;
    min-width: 28px;
    width: 28px;
    min-height: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-tree--menu .app-menu-icon-fields {
    gap: 4px;
}

.menu-tree--menu .app-menu-icon-fields__feather,
.menu-tree--menu .app-menu-icon-fields__pick {
    height: 28px;
    min-height: 28px;
}

.menu-tree--menu .app-menu-icon-fields__pick {
    width: 28px;
    min-width: 28px;
    padding: 0;
}

.menu-tree--menu .menu-tree__empty {
    padding: 8px 12px 10px 46px;
    font-size: 12px;
    color: #8aa0b2;
    font-style: italic;
}

.menu-tree--menu .menu-tree__item.is-dragging,
.menu-tree--menu .menu-tree__group.is-dragging {
    opacity: .45;
}

.menu-tree--menu .menu-tree__item.is-drop-before > .menu-tree__row,
.menu-tree--menu .menu-tree__group.is-drop-before > .menu-tree__row {
    box-shadow: inset 0 2px 0 var(--brand-accent, #0B679E);
}

.menu-tree--menu .menu-tree__item.is-drop-after > .menu-tree__row,
.menu-tree--menu .menu-tree__group.is-drop-after > .menu-tree__row {
    box-shadow: inset 0 -2px 0 var(--brand-accent, #0B679E);
}

.menu-tree--menu .menu-tree__group.is-drop-into > .menu-tree__row {
    background: rgba(11, 103, 158, .1);
    outline: 2px solid rgba(11, 103, 158, .35);
    outline-offset: -2px;
}

@media (max-width: 1100px) {
    .menu-tree--menu,
    .menu-tree-head--menu,
    .menu-tree--menu .menu-tree__row {
        --menu-cols: 28px minmax(0, 1fr);
    }

    .menu-tree-head--menu span:nth-child(n+3) {
        display: none;
    }

    .menu-tree--menu .menu-tree__field,
    .menu-tree--menu .menu-tree__zones,
    .menu-tree--menu .menu-tree__actions {
        grid-column: 2;
    }
}

/* --- дерево сущностей --- */
.menu-tree--entities,
.menu-tree-head--entities,
.menu-tree--entities .menu-tree__row {
    --menu-cols: 32px minmax(160px, 1.4fr) minmax(120px, 0.9fr) max-content;
}

.entities-tree-editor {
    margin-bottom: 1rem;
}

.entities-tree-toolbar .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.entities-tree-toolbar #entities-filter-meta {
    display: inline-block;
    padding-bottom: 0.35rem;
}

.menu-tree-head--entities {
    padding: 0 14px 8px;
    margin: 0 0 10px;
    border-bottom: none;
    color: #8a9aab;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
}

.menu-tree--entities {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-tree--entities > .entities-admin-group {
    background: #fff;
    border: 1px solid rgba(15, 45, 66, .1);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 45, 66, .04);
    /* visible: иначе dropdown «⋯» у сущности в группе обрезается карточкой */
    overflow: visible;
    position: relative;
}

/* Открытое меню поднимает всю группу над соседними секциями */
.menu-tree--entities > .entities-admin-group:has(.dropdown.show),
.menu-tree--entities > .entities-admin-group:has(.dropdown-menu.show) {
    z-index: 40;
}

.menu-tree--entities > .menu-tree__item {
    background: #fff;
    border: 1px solid rgba(15, 45, 66, .08);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 45, 66, .04);
    overflow: visible;
}

.entities-admin-group__row {
    display: grid;
    grid-template-columns: 28px 22px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 7%, #fff);
    border-bottom: 1px solid rgba(15, 45, 66, .06);
}

.entities-admin-group--none > .entities-admin-group__row {
    background: #f4f7fa;
}

.entities-admin-group__row.is-group-drop {
    outline: 2px solid rgba(11, 103, 158, .45);
    outline-offset: -2px;
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 14%, #fff);
}

.entities-admin-group__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #6b8499;
    cursor: pointer;
}

.entities-admin-group__toggle:hover {
    background: rgba(15, 45, 66, .06);
    color: #1f2d3a;
}

.entities-admin-group__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform .15s ease;
}

.entities-admin-group.is-collapsed .entities-admin-group__toggle svg {
    transform: rotate(-90deg);
}

.entities-admin-group__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-accent, #0B679E);
}

.entities-admin-group__icon svg {
    width: 16px;
    height: 16px;
}

.entities-admin-group__main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.entities-admin-group__title {
    font-size: var(--app-font-size);
    font-weight: 600;
    color: #1f2d3a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entities-admin-group__count {
    flex: 0 0 auto;
    min-width: 1.5rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(15, 45, 66, .08);
    color: #5a7388;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

.entities-admin-group__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.entities-admin-group__body {
    list-style: none;
    margin: 0;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #f7fafc;
}

.entities-admin-group.is-collapsed > .entities-admin-group__body {
    display: none;
}

.entities-admin-group__empty {
    margin: 0;
    padding: 14px 12px;
    color: #8a9aab;
    font-size: 13px;
    text-align: center;
    border: 1px dashed rgba(15, 45, 66, .12);
    border-radius: 8px;
    background: rgba(255, 255, 255, .6);
}

.entities-admin-group__body > .menu-tree__item {
    background: #fff;
    border: 1px solid rgba(15, 45, 66, .08);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 45, 66, .03);
    overflow: visible;
}

.menu-tree--entities .menu-tree__row,
.menu-tree--entities .menu-tree__row--group,
.menu-tree--entities .menu-tree__children .menu-tree__row {
    position: relative;
    gap: 10px;
    padding: 8px 12px;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(15, 45, 66, .06);
    background: transparent;
    overflow: visible;
    align-items: center;
}

/* Пока открыт «⋯» — поднимаем строку и группу, иначе кнопки/соседние секции лезут поверх меню */
.menu-tree--entities .menu-tree__item:has(.dropdown.show),
.menu-tree--entities .menu-tree__item:has(.dropdown-menu.show) {
    position: relative;
    z-index: 30;
}

.menu-tree--entities .entities-admin-group__body > .menu-tree__item:has(.dropdown.show),
.menu-tree--entities .entities-admin-group__body > .menu-tree__item:has(.dropdown-menu.show) {
    z-index: 50;
}

.menu-tree--entities .entities-admin-group__body > .menu-tree__item > .menu-tree__row {
    border-bottom: none;
}

.menu-tree--entities .entities-admin-group__body > .menu-tree__item.menu-tree__item--parent > .menu-tree__row {
    border-bottom: 1px solid rgba(15, 45, 66, .06);
}

.menu-tree--entities .menu-tree__row--nested {
    background: transparent;
}

.menu-tree--entities .menu-tree__row--nested:hover {
    background: rgba(15, 45, 66, .025);
}

.menu-tree--entities .menu-tree__row--group {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 8%, #fff);
}

.menu-tree--entities .menu-tree__row--group:hover {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 12%, #fff);
}

.menu-tree--entities .menu-tree__children {
    background: #f7fafc;
    min-height: 0;
    overflow: visible;
    border-radius: 0 0 10px 10px;
}

.menu-tree--entities .menu-tree__children > .menu-tree__item:last-child > .menu-tree__row {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.menu-tree--entities .menu-tree__children[hidden] {
    display: none !important;
}

.menu-tree--entities .menu-tree__handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 28px;
    color: #9aabb8;
    cursor: grab;
    user-select: none;
}

.menu-tree--entities .menu-tree__grip {
    width: 10px;
    height: 14px;
    background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.25px);
    background-size: 5px 5px;
    background-position: 0 0;
    opacity: .55;
}

.menu-tree--entities .menu-tree__main {
    min-width: 0;
    display: flex;
    align-items: center;
}

.menu-tree--entities .menu-tree__title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
}

.menu-tree--entities .menu-tree__title {
    font-size: var(--app-font-size);
    font-weight: 400;
    color: #1f2d3a;
    line-height: 1.2;
    text-decoration: none;
}

.menu-tree--entities .menu-tree__title:hover {
    color: var(--brand-accent, #0B679E);
}

.menu-tree--entities .menu-tree__meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin: 0;
    font-size: 12px;
    color: #8a9aab;
    line-height: 1.2;
}

.menu-tree--entities .menu-tree__id {
    font-variant-numeric: tabular-nums;
}

.menu-tree--entities .menu-tree__meta-sep {
    opacity: .7;
}

.menu-tree--entities .menu-tree__row--nested .menu-tree__main {
    padding-left: calc(18px + (var(--nest-depth, 1) * 16px));
    position: relative;
}

.menu-tree--entities .menu-tree__row--nested .menu-tree__main::before {
    content: '';
    position: absolute;
    left: calc(4px + (var(--nest-depth, 1) - 1) * 16px);
    top: -10px;
    bottom: 50%;
    width: 14px;
    border-left: 1.5px solid #b7c5d3;
    border-bottom: 1.5px solid #b7c5d3;
    border-bottom-left-radius: 4px;
}

.menu-tree--entities .menu-tree__parent-chip {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(11, 103, 158, .08);
    color: #0b679e;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.menu-tree--entities .menu-tree__field--table {
    min-width: 0;
    display: flex;
    align-items: center;
}

.menu-tree--entities .menu-tree__field--table .entities-tree__code {
    display: block;
    max-width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #4a6578;
    background: #f3f5f7;
    border: 1px solid rgba(15, 45, 66, .08);
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.menu-tree--entities .menu-tree__field--actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.menu-tree--entities .menu-tree__btn-group {
    display: inline-flex;
    align-items: center;
}

.menu-tree--entities .menu-tree__field--actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: max-content;
    width: max-content;
    justify-self: end;
}

.menu-tree--entities .menu-tree__btn-group {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    width: max-content;
    max-width: none;
    overflow: visible;
}

.menu-tree--entities .menu-tree__btn-group > .btn.btn-sm,
.menu-tree--entities .menu-tree__btn-group > .menu-tree__actions > .btn.btn-sm {
    box-sizing: border-box;
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    min-height: 28px;
    height: 28px;
    margin: 0;
    padding: 0 10px;
    border-radius: 0;
    font-size: 12.5px;
    line-height: 26px;
    box-shadow: none;
    white-space: nowrap;
    overflow: visible;
}

.menu-tree--entities .menu-tree__btn-group > .btn.btn-sm:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.menu-tree--entities .menu-tree__btn-group > .menu-tree__actions:last-child > .btn.btn-sm {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    min-width: 34px;
    padding: 0 10px;
}

.menu-tree--entities .menu-tree__btn-group > .btn + .btn,
.menu-tree--entities .menu-tree__btn-group > .btn + .menu-tree__actions > .btn,
.menu-tree--entities .menu-tree__btn-group > .menu-tree__actions + .btn {
    margin-left: -1px;
}

.menu-tree--entities .menu-tree__actions.dropdown {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 28px;
    overflow: visible;
}

.menu-tree--entities .menu-tree__item.is-dragging {
    opacity: .45;
}

.menu-tree--entities .menu-tree__item.is-drop-before > .menu-tree__row {
    box-shadow: inset 0 2px 0 var(--brand-accent, #0B679E);
}

.menu-tree--entities .menu-tree__item.is-drop-after > .menu-tree__row {
    box-shadow: inset 0 -2px 0 var(--brand-accent, #0B679E);
}

.menu-tree--entities .menu-tree__item.is-drop-into > .menu-tree__row {
    background: rgba(11, 103, 158, .06);
    outline: 2px solid rgba(11, 103, 158, .35);
    outline-offset: -2px;
}

.entities-tree-status {
    margin-top: 8px;
    font-size: 12px;
    color: #6b8499;
}

.entities-tree-status.is-error {
    color: #c0392b;
}

.entities-tree-status.is-ok {
    color: #0f7a45;
}

@media (max-width: 1100px) {
    .menu-tree--entities,
    .menu-tree-head--entities,
    .menu-tree--entities .menu-tree__row {
        --menu-cols: 28px minmax(0, 1fr) max-content;
    }

    .menu-tree-head--entities span:nth-child(n+3) {
        display: none;
    }

    .menu-tree--entities .menu-tree__field--table {
        display: none;
    }

    .entities-admin-group__row {
        grid-template-columns: 28px 22px minmax(0, 1fr);
    }

    .entities-admin-group__actions {
        display: none;
    }
}

/* --- дерево сущностей (drag & drop) — legacy, удалить после миграции --- */
.entities-tree-wrap {
    --et-cols: 32px minmax(0, 1fr) 176px 176px 36px;
    --et-indent: 28px;
    background: #fff;
    border: 1px solid rgba(15, 45, 66, .08);
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
}

.entities-tree-wrap > .app-page-table__head {
    padding: 12px 16px 0;
    margin-bottom: 0;
}

.entities-tree-hint {
    margin: 0;
    padding: 6px 16px 10px;
    font-size: 12.5px;
    color: #6b8499;
}

.entities-tree-head,
.entities-tree__row {
    display: grid;
    grid-template-columns: var(--et-cols);
    column-gap: 12px;
    align-items: center;
    padding: 0 12px 0 8px;
    box-sizing: border-box;
    width: 100%;
}

.entities-tree-head {
    min-height: 32px;
    padding-top: 4px;
    padding-bottom: 6px;
    margin: 0;
    font-size: 10.5px;
    font-weight: 600;
    color: #7a93a6;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid rgba(15, 45, 66, .08);
}

.entities-tree {
    list-style: none;
    margin: 0;
    padding: 4px 0 8px;
}

.entities-tree__node {
    list-style: none;
    position: relative;
}

.entities-tree__row {
    min-height: 52px;
    margin: 2px 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    transition: background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.entities-tree__node.is-child > .entities-tree__row {
    background: #f3f7fa;
}

.entities-tree__row:hover {
    border-color: rgba(15, 45, 66, .08);
    background: #f3f8fb;
}

.entities-tree__node.is-child > .entities-tree__row:hover {
    background: #eaf2f7;
}

/*
 * Явная синяя ветка дерева (как раньше), только сдвиг названия
 * через guides — колонки Таблица/Действия остаются на месте.
 */
.entities-tree__children {
    list-style: none;
    margin: 0;
    padding: 0;
    min-height: 0;
}

.entities-tree__children[hidden] {
    display: none !important;
}

.entities-tree__handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    border-radius: 7px;
    cursor: grab;
    color: #9bb0c0;
    user-select: none;
}

.entities-tree__handle:hover {
    background: rgba(15, 45, 66, .05);
    color: #5f7b91;
}

.entities-tree__handle:active {
    cursor: grabbing;
}

.entities-tree__grip {
    width: 12px;
    height: 14px;
    background-image: radial-gradient(circle, currentColor 1.1px, transparent 1.2px);
    background-size: 5px 5px;
    background-position: 1px 1px;
    opacity: .9;
}

.entities-tree__main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.entities-tree__guides {
    flex: 0 0 calc(var(--depth, 0) * var(--et-indent));
    width: calc(var(--depth, 0) * var(--et-indent));
    min-width: calc(var(--depth, 0) * var(--et-indent));
    align-self: stretch;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Вертикаль + горизонталь — сплошной синий 3px */
.entities-tree__node.is-child > .entities-tree__row .entities-tree__guides::before {
    content: '';
    position: absolute;
    left: calc((var(--depth, 1) - 1) * var(--et-indent) + var(--et-indent) * .5 - 1.5px);
    top: -4px;
    bottom: -4px;
    width: 3px;
    background: #0b679e;
    border-radius: 2px;
    box-shadow: calc(var(--et-indent) * -1) 0 0 #0b679e;
}

.entities-tree__node.is-child > .entities-tree__row .entities-tree__guides::after {
    content: '';
    position: absolute;
    left: calc((var(--depth, 1) - 1) * var(--et-indent) + var(--et-indent) * .5 - 1.5px);
    top: 50%;
    width: calc(var(--et-indent) * .5 + 6px);
    height: 3px;
    background: #0b679e;
    border-radius: 2px;
    transform: translateY(-50%);
}

/* На 1-м уровне вторая тень не нужна */
.entities-tree__node.is-child > .entities-tree__row[style*="--depth: 1"] .entities-tree__guides::before,
.entities-tree__node.is-child > .entities-tree__row[style*="--depth:1"] .entities-tree__guides::before {
    box-shadow: none;
}

.entities-tree__icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex-shrink: 0;
    border-radius: 9px;
    background: #d9eaf4 !important;
    color: #0b679e !important;
    border: 1px solid #b7d3e4;
}

.entities-tree__icon svg {
    width: 16px !important;
    height: 16px !important;
    display: block !important;
    stroke: currentColor !important;
    fill: none !important;
}

.entities-tree__icon--folder {
    background: #cfe3f0 !important;
}

.entities-tree__icon--corner {
    background: #e2e9ef !important;
    color: #3d6f8f !important;
    border-color: #c5d3de;
}

.entities-tree__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.entities-tree__title {
    font-weight: 500;
    font-size: 13.5px;
    line-height: 1.25;
    color: #16324a;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entities-tree__title:hover {
    color: #0b679e;
}

.entities-tree__meta {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.entities-tree__id {
    color: #8aa0b2;
    font-size: 11.5px;
    font-weight: 400;
    flex-shrink: 0;
}

.entities-tree__nest {
    display: inline-flex;
    align-items: center;
    max-width: 220px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #dce8f0;
    color: #0b679e;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entities-tree__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d9eaf4;
    color: #0b679e;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
}

.entities-tree__table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f8;
    border: 1px solid rgba(15, 45, 66, .06);
    font-size: 11.5px;
    font-weight: 400;
    color: #4a667a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.entities-tree__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.entities-tree__btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: .45rem;
    padding-right: .45rem;
    font-weight: 400;
}

.entities-tree__actions {
    display: flex;
    justify-content: center;
}

.entities-tree__more {
    color: #6b8499;
}

.entities-tree__node.is-dragging {
    opacity: .45;
}

.entities-tree__node.is-dragging > .entities-tree__row {
    box-shadow: 0 8px 20px rgba(15, 45, 66, .12);
}

.entities-tree__node.is-drop-before > .entities-tree__row {
    box-shadow: inset 0 2px 0 #0b679e;
}

.entities-tree__node.is-drop-after > .entities-tree__row {
    box-shadow: inset 0 -2px 0 #0b679e;
}

.entities-tree__node.is-drop-into > .entities-tree__row {
    background: #e3eef6;
    border-color: #7eb0cc;
    outline: 1px dashed #0b679e;
    outline-offset: -2px;
}

.entities-tree-status {
    padding: 8px 16px 12px;
    font-size: 13px;
    color: #0b679e;
}

.entities-tree-status.is-error {
    color: #b42318;
}

.entities-tree-status.is-ok {
    color: #0f7a45;
}

@media (max-width: 900px) {
    .entities-tree-wrap {
        --et-cols: 28px minmax(0, 1fr) 36px;
    }

    .entities-tree-head span:nth-child(3),
    .entities-tree-head span:nth-child(4) {
        display: none;
    }

    .entities-tree__table,
    .entities-tree__links {
        display: none;
    }
}

/* --- Вложенная сущность: в стиле обычных полей формы --- */
.subentity-table {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.subentity-table__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 0 0 .5rem;
    margin: 0 0 .55rem;
    border: 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 85%, transparent);
    background: transparent;
}

.subentity-table__head-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
}

.subentity-table__fill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: var(--app-control-height, 30px);
    padding: .15rem .55rem;
    font-size: var(--app-font-size-sm, 12px);
    line-height: 1.2;
}

.subentity-table__fill i,
.subentity-table__fill svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.subentity-table__title {
    font-weight: 500;
    font-size: var(--app-font-size, 14px);
    line-height: 1.3;
    color: var(--tblr-body-color, inherit);
    min-width: 0;
}

.subentity-table__add.related-entity-picker__create {
    flex: 0 0 auto;
    align-self: center;
    width: var(--app-control-height, 30px);
    min-width: var(--app-control-height, 30px);
    min-height: var(--app-control-height, 30px);
    height: var(--app-control-height, 30px);
    margin-top: -2px;
}

.subentity-table__scroll {
    overflow-x: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.subentity-table__grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: .5rem 0;
    table-layout: fixed;
    margin: 0;
}

.subentity-table__grid thead th {
    padding: 0 0 .35rem;
    border: 0;
    background: transparent;
    vertical-align: bottom;
    font-weight: inherit;
    color: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
}

.subentity-table__grid thead th .form-label {
    display: block;
    margin: 0;
}

.subentity-table__grid tbody td {
    padding: 0 0 .65rem;
    border: 0;
    vertical-align: top;
    background: transparent;
}

.subentity-table__grid .subentity-related-picker,
.subentity-table__grid .subentity-users-picker {
    min-width: 160px;
    max-width: 100%;
}

.subentity-table__grid .subentity-related-picker .related-entity-picker__search,
.subentity-table__grid .subentity-related-picker .form-control {
    min-height: var(--app-control-height, 30px);
    font-size: .875rem;
}

.subentity-table__grid .subentity-match-value .form-control {
    min-height: var(--app-control-height, 30px);
    font-size: .875rem;
}

.subentity-table__grid tbody tr:last-child td {
    padding-bottom: 0;
}

.subentity-table__grid tbody tr:hover td {
    background: transparent;
}

.subentity-table__col-actions {
    width: calc(var(--app-control-height, 30px) + .25rem);
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.subentity-table__remove {
    color: #94a3b8 !important;
    margin-top: 0;
}

.subentity-table__remove:hover,
.subentity-table__remove:focus {
    color: #dc2626 !important;
    background: rgba(220, 38, 38, 0.06) !important;
}

.subentity-table__empty {
    padding: .15rem 0 .25rem;
    font-size: var(--app-font-size-sm, 12px);
}

.subentity-table--readonly .subentity-table__grid tbody td {
    padding-bottom: .55rem;
}

.subentity-table--readonly .form-control-plaintext {
    min-height: var(--app-control-height, 30px);
    display: flex;
    align-items: center;
    font-size: var(--app-font-size, 14px);
}

.subentity-table .form-control,
.subentity-table .form-select {
    width: 100%;
}

.subentity-cfg-columns {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.subentity-cfg-columns__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto 36px;
    gap: .5rem;
    align-items: center;
}

.subentity-cfg-columns__sum {
    display: flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
    min-height: 30px;
}

.subentity-cfg-columns__sum.is-disabled {
    opacity: .35;
    pointer-events: none;
}

.subentity-fill-maps {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.subentity-fill-maps__row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 18px minmax(0, .95fr) minmax(0, 1.2fr) 36px;
    gap: .4rem;
    align-items: center;
}

.subentity-fill-maps__value {
    min-width: 0;
}

.subentity-fill-maps__arrow {
    text-align: center;
    color: #7a93a6;
    font-weight: 600;
}

@media (max-width: 768px) {
    .subentity-fill-maps__row {
        grid-template-columns: minmax(0, 1fr) 36px;
    }
    .subentity-fill-maps__arrow {
        display: none;
    }
}

@media (max-width: 576px) {
    .subentity-cfg-columns__row {
        grid-template-columns: minmax(0, 1fr) 90px auto 36px;
    }

    .subentity-table__grid {
        border-spacing: .35rem 0;
    }
}

.subentity-table__sum-row td {
    padding-top: .35rem !important;
    padding-bottom: 0 !important;
    border-top: 1px dashed color-mix(in srgb, var(--tblr-border-color, #e6e7e9) 90%, transparent);
    vertical-align: middle;
    white-space: nowrap;
}

.subentity-table__sum-label {
    font-size: var(--app-font-size-sm, 12px);
    font-weight: 500;
    white-space: nowrap;
}

.subentity-table__sum-value {
    font-weight: 600;
    font-size: var(--app-font-size, 14px);
    text-align: right;
    min-height: var(--app-control-height, 30px);
    min-width: 5.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 2px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.subentity-table__sum-value[data-text-align="left"] {
    text-align: left;
    justify-content: flex-start;
}

.subentity-table__sum-value[data-text-align="center"] {
    text-align: center;
    justify-content: center;
}

.subentity-table__sum-value[data-text-align="right"] {
    text-align: right;
    justify-content: flex-end;
}

/* Журнал изменений: панель фильтров и меню очистки */
.change-log-toolbar .form-label {
    font-size: var(--app-font-size-sm, 12px);
    color: var(--tblr-secondary, #6c7a91);
}

.change-log-cleanup-menu {
    min-width: 16.5rem;
    max-width: 20rem;
}

.change-log-item-picker {
    position: relative;
}

.change-log-item-picker__control {
    position: relative;
}

.change-log-item-picker__control .form-control {
    padding-right: 1.75rem;
}

.change-log-item-picker__clear {
    position: absolute;
    right: .35rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--tblr-secondary, #6c7a91);
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1;
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
}

.change-log-item-picker__clear:hover {
    color: var(--tblr-body-color, #1e293b);
}

.change-log-item-picker__dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    z-index: 30;
    max-height: 240px;
    overflow: auto;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: .375rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}

.change-log-item-picker__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: .4rem .65rem;
    font-size: var(--app-font-size-sm, 12px);
    color: inherit;
    cursor: pointer;
}

.change-log-item-picker__option:hover,
.change-log-item-picker__option.is-active {
    background: color-mix(in srgb, var(--tblr-primary, #206bc4) 12%, transparent);
}

.change-log-item-picker__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-log-item-picker__id {
    flex-shrink: 0;
    color: var(--tblr-secondary, #6c7a91);
    font-size: 11px;
}

.change-log-item-picker__empty {
    padding: .55rem .65rem;
    font-size: var(--app-font-size-sm, 12px);
    color: var(--tblr-secondary, #6c7a91);
}

/* Совпадающие записи */
.matched-records-widget [data-role="matched-body"].is-loading {
    opacity: .55;
    pointer-events: none;
}

.matched-records__table th,
.matched-records__table td {
    vertical-align: middle;
    font-size: var(--app-font-size-sm, 12px);
}

.matched-records__link {
    text-decoration: none;
}

.matched-records__link:hover {
    text-decoration: underline;
}

.matched-records--empty {
    padding: .5rem 0;
}

/* Скрыть весь блок поля (с заголовком), если нет совпадений */
[id^="field-row-"]:has([data-matched-records][data-hide-when-empty="1"][data-has-rows="0"]),
.info-field-cell--matched:has([data-matched-records][data-hide-when-empty="1"][data-has-rows="0"]) {
    display: none !important;
}

/* Массовые действия списка */
.listing-bulk-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-bottom: .65rem;
    padding: .55rem .75rem;
    border: 1px solid var(--app-table-border, #e6ebf1);
    border-radius: 8px;
    background: color-mix(in srgb, var(--brand-accent, #0b679e) 6%, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

/* Отмеченные строки списка — очень светлый жёлтый */
.table > tbody > tr.is-listing-selected > *,
.table-striped > tbody > tr.is-listing-selected > td,
.table-hover > tbody > tr.is-listing-selected:hover > td {
    --bs-table-bg-type: transparent;
    --bs-table-accent-bg: transparent;
    background-color: #fffceb !important;
}

.listing-bulk-bar.is-loading {
    opacity: .7;
    pointer-events: none;
}

.listing-bulk-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem .75rem;
}

.listing-bulk-bar__count {
    font-size: 13px;
    color: #334155;
}

.listing-bulk-bar__scope {
    color: #64748b;
    font-weight: 500;
}

.listing-bulk-bar__select-all {
    margin-top: .45rem;
    padding-top: .45rem;
    border-top: 1px solid color-mix(in srgb, var(--brand-accent, #0b679e) 12%, #e6ebf1);
    font-size: 13px;
    color: #475569;
}

.listing-bulk-bar__select-all-btn {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand-accent, #0b679e);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.listing-bulk-bar__select-all-btn:hover {
    color: color-mix(in srgb, var(--brand-accent, #0b679e) 80%, #000);
}

.listing-bulk-bar.is-filtered-scope {
    background: color-mix(in srgb, var(--brand-accent, #0b679e) 10%, #fff);
}

.listing-bulk-bar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}

.listing-bulk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 31px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: #5a7388;
    background: #fff;
    border: 1px solid var(--app-table-border, #e6ebf1);
    box-shadow: none;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.listing-bulk-btn:hover {
    color: var(--brand-accent, #0b679e);
    background: #fff;
    border-color: color-mix(in srgb, var(--brand-accent, #0b679e) 32%, var(--app-table-border, #e6ebf1));
}

.listing-bulk-btn:focus-visible {
    color: var(--brand-accent, #0b679e);
    background: #fff;
    border-color: var(--brand-accent, #0b679e);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent, #0b679e) 12%, transparent);
    outline: none;
}

.listing-bulk-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.listing-bulk-btn--danger {
    color: #b42318;
    border-color: color-mix(in srgb, #b42318 28%, var(--app-table-border, #e6ebf1));
}

.listing-bulk-btn--danger:hover,
.listing-bulk-btn--danger:focus-visible {
    color: #912018;
    border-color: #b42318;
    background: color-mix(in srgb, #b42318 6%, #fff);
}

.subentity-bulk-bar {
    margin: .5rem .65rem .35rem;
    padding: .5rem .65rem;
    border: 1px solid var(--app-table-border, #e6ebf1);
    border-radius: 8px;
    background: color-mix(in srgb, var(--brand-accent, #0b679e) 6%, #fff);
}

.subentity-bulk-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .45rem .65rem;
}

.subentity-bulk-bar__count {
    font-size: 13px;
    color: #334155;
}

.subentity-bulk-bar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
}

.item-page-subentity__th--select,
.item-page-subentity__td--select {
    width: 28px;
    min-width: 28px;
    max-width: 28px;
    padding-left: .4rem;
    padding-right: .2rem;
    vertical-align: middle;
    text-align: center;
}

.listing-bulk-btn--ghost {
    min-width: 0;
    border-color: transparent;
    background: transparent;
    color: #64748b;
}

.listing-bulk-btn--ghost:hover,
.listing-bulk-btn--ghost:focus-visible {
    color: #334155;
    border-color: transparent;
    background: color-mix(in srgb, #64748b 8%, #fff);
    box-shadow: none;
}


/* --- Сервисное меню: замер скорости браузер ↔ сервер --- */
/* --- Сервис: замер скорости (в стиле карточек настроек) --- */
.svc-speed .svc-stat {
    padding: 0.85rem 0.95rem;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color) 55%, transparent);
    border-radius: var(--app-control-radius, 0.375rem);
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary) 65%, #fff);
    height: 100%;
}

.svc-speed .svc-stat__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tblr-secondary-color);
    margin-bottom: 0.35rem;
}

.svc-speed .svc-stat__value {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.svc-speed .svc-stat__value strong {
    font-size: 1.35rem;
    font-weight: 650;
    line-height: 1.1;
    color: var(--tblr-body-color);
    font-variant-numeric: tabular-nums;
}

.svc-speed .svc-stat__value span {
    font-size: 0.75rem;
    color: var(--tblr-secondary-color);
}

.svc-speed .svc-stat__hint {
    font-size: 0.75rem;
    color: var(--tblr-secondary-color);
    font-variant-numeric: tabular-nums;
}

.svc-speed .svc-stat__chart {
    height: 48px;
    margin: 0.35rem 0 0.4rem;
    color: var(--tblr-secondary-color);
}

.svc-speed .svc-stat__chart svg {
    display: block;
    width: 100%;
    height: 100%;
}

.svc-speed .svc-chart-panel {
    padding: 0.75rem 0.85rem 0.55rem;
    border: 1px solid color-mix(in srgb, var(--tblr-border-color) 45%, transparent);
    border-radius: var(--app-control-radius, 0.375rem);
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary) 55%, #fff);
}

.svc-speed .svc-chart-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.45rem;
}

.svc-speed .svc-chart-panel__title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tblr-secondary-color);
}

.svc-speed .svc-chart-panel__legend {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.72rem;
    color: var(--tblr-secondary-color);
}

.svc-speed .svc-chart-panel__swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 0.25rem;
    border-radius: 2px;
    vertical-align: middle;
}

.svc-speed .svc-chart-panel__swatch--down { background: var(--tblr-primary); }
.svc-speed .svc-chart-panel__swatch--up { background: var(--tblr-azure, #4299e1); }
.svc-speed .svc-chart-panel__swatch--ping { background: var(--tblr-green, #2fb344); }

.svc-speed .svc-chart-panel__svg {
    display: block;
    width: 100%;
    height: 140px;
    color: var(--tblr-secondary-color);
}

.svc-speed .svc-chart-panel__empty {
    margin-top: 0.15rem;
}

.svc-speed .progress {
    background: color-mix(in srgb, var(--tblr-border-color) 55%, transparent);
}

/* --- Сервер: сводка окружения --- */
.svc-info__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.svc-info__stamp {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.75rem;
    color: var(--tblr-secondary-color);
}

.svc-info__stamp strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    font-variant-numeric: tabular-nums;
}

.svc-info__summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.svc-info__stat {
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius, 0.5rem);
    background: var(--tblr-bg-surface);
}

.svc-info__stat-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tblr-secondary-color);
    margin-bottom: 0.25rem;
}

.svc-info__stat-value {
    display: block;
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace);
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1.25;
    color: var(--tblr-body-color);
    word-break: break-word;
}

.svc-info__stat-hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--tblr-secondary-color);
}

.svc-info__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.svc-info__card {
    padding: 1rem 1.05rem 1.05rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius, 0.5rem);
    background: var(--tblr-bg-surface);
}

.svc-info__card--wide {
    grid-column: 1 / -1;
}

.svc-info__card-title {
    margin: 0 0 0.75rem;
    font-size: 0.92rem;
    font-weight: 650;
}

.svc-info__list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.svc-info__row {
    display: grid;
    grid-template-columns: minmax(7rem, 38%) 1fr;
    gap: 0.5rem 0.75rem;
    align-items: start;
    font-size: 0.84rem;
}

.svc-info__label {
    color: var(--tblr-secondary-color);
}

.svc-info__value {
    color: var(--tblr-body-color);
    font-weight: 550;
    word-break: break-word;
}

.svc-info__value small {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--tblr-secondary-color);
}

.svc-info__value--ok {
    color: var(--tblr-success, #2fb344);
}

.svc-info__value--warn {
    color: var(--tblr-warning, #f59f00);
}

.svc-info__ext {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--tblr-border-color-translucent);
}

.svc-info__ext-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
    font-size: 0.84rem;
    font-weight: 650;
}

.svc-info__ext-head span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tblr-secondary-color);
}

.svc-info__ext-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.svc-info__pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 0.3rem;
    font-size: 0.72rem;
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace);
    border: 1px solid var(--tblr-border-color-translucent);
    color: var(--tblr-secondary-color);
    background: var(--tblr-bg-surface-secondary);
}

.svc-info__pill.is-on {
    color: var(--tblr-success, #2fb344);
    border-color: color-mix(in srgb, var(--tblr-success, #2fb344) 35%, var(--tblr-border-color-translucent));
    background: color-mix(in srgb, var(--tblr-success, #2fb344) 8%, var(--tblr-bg-surface));
}

.svc-info__pill.is-off {
    opacity: 0.55;
    text-decoration: line-through;
}

.svc-info__tables {
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--tblr-border-color-translucent);
}

.svc-info__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.svc-info__table th,
.svc-info__table td {
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid var(--tblr-border-color-translucent);
    vertical-align: top;
}

.svc-info__table th {
    font-weight: 600;
    color: var(--tblr-secondary-color);
}

.svc-info__table code {
    font-size: 0.76rem;
}

.svc-info__note {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--tblr-secondary-color);
}

.svc-info__modules {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.svc-info__module {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--tblr-border-color-translucent);
    border-radius: var(--app-control-radius, 0.375rem);
    background: color-mix(in srgb, var(--tblr-bg-surface-secondary) 55%, var(--tblr-bg-surface));
}

.svc-info__module-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.svc-info__module-main strong {
    font-size: 0.88rem;
}

.svc-info__module-main code {
    font-size: 0.72rem;
    color: var(--tblr-secondary-color);
}

.svc-info__module-side {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.svc-info__empty {
    font-size: 0.84rem;
    color: var(--tblr-secondary-color);
}

@media (max-width: 900px) {
    .svc-info__summary,
    .svc-info__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .svc-info__intro {
        flex-direction: column;
    }

    .svc-info__stamp {
        text-align: left;
    }

    .svc-info__summary,
    .svc-info__grid {
        grid-template-columns: 1fr;
    }

    .svc-info__row {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .svc-info__module {
        flex-direction: column;
        align-items: flex-start;
    }
}

.svc-info--locked {
    max-width: none;
}

.svc-lock {
    margin-top: 0.25rem;
}

.svc-lock__status {
    margin-bottom: 0.75rem;
    font-size: 0.84rem;
    color: var(--tblr-secondary-color);
}

.svc-lock__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.svc-lock__code {
    width: 9.5rem;
    max-width: 100%;
    font-family: 'Geist Mono', var(--tblr-font-monospace, monospace);
    letter-spacing: 0.12em;
    text-align: center;
}

.svc-lock__error {
    margin-top: 0.65rem;
    font-size: 0.84rem;
    color: var(--tblr-danger, #d63939);
}

@media (max-width: 640px) {
    .svc-lock__row {
        flex-direction: column;
        align-items: stretch;
    }

    .svc-lock__code {
        width: 100%;
    }
}

/* --- Импорт записей: сопоставление колонок --- */
.items-import-mode {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.items-import-map__table td,
.items-import-preview td,
.items-import-preview th {
    vertical-align: middle;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.items-import-map__table .form-select {
    min-width: 12rem;
}

.items-import-preview {
    font-size: 12.5px;
}


/* Кнопки бланков на карточке / в списке — общий soft-стиль выше */
.order-blanks-actions__icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    display: block;
    color: inherit;
    fill: currentColor;
}

.order-blanks-actions__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    line-height: 0;
}

.order-blanks-actions__icon-wrap svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: currentColor;
}

.order-blanks-ui-form__block {
    height: 100%;
    padding: 12px 14px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-tertiary-bg);
}

.order-blanks-ui-form__preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--bs-border-color);
    background: #fff;
    color: var(--bs-body-color);
}

.order-blanks-ui-form__preview svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.order-blanks-actions__menu {
    min-width: 12rem;
    max-width: min(22rem, 90vw);
}

.order-blanks-actions__menu .dropdown-item {
    white-space: normal;
    line-height: 1.35;
}

.order-blank-upload-dropdown .dropdown-item {
    cursor: pointer;
}

/* Кнопка загрузки бланка XLSX */
.order-blank-upload {
    position: relative;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease, opacity .15s ease;
}

.order-blank-upload .order-blank-upload__icon,
.order-blank-upload .order-blank-upload__spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    vertical-align: -2px;
}

.order-blank-upload .order-blank-upload__spinner {
    display: none;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: .85;
    animation: order-blank-spin .7s linear infinite;
}

.order-blank-upload.is-loading {
    pointer-events: none;
    opacity: .92;
}

.order-blank-upload.is-loading .order-blank-upload__icon {
    display: none;
}

.order-blank-upload.is-loading .order-blank-upload__spinner {
    display: inline-flex;
}

@keyframes order-blank-spin {
    to { transform: rotate(360deg); }
}

/* Rich-text textarea (как тулбар шаблонов / печатных форм) */
.rt-wysiwyg {
    border: 1px solid var(--bs-border-color, #dce1e7);
    border-radius: .4rem;
    background: #fff;
    overflow: hidden;
}
.rt-wysiwyg__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    align-items: center;
    padding: .4rem .5rem;
    border-bottom: 1px solid var(--bs-border-color, #dce1e7);
    background: #f8fafc;
}
.rt-wysiwyg__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid var(--bs-border-color, #dce1e7);
    border-radius: .3rem;
    background: #fff;
    color: #334155;
    cursor: pointer;
}
.rt-wysiwyg__btn:hover {
    background: #e8eef8;
    border-color: #c7d2fe;
    color: #1e3a8a;
}
.rt-wysiwyg__btn svg { display: block; }
.rt-wysiwyg__sep {
    width: 1px;
    height: 1.4rem;
    background: var(--bs-border-color, #dce1e7);
    margin: 0 .15rem;
}
.rt-wysiwyg__select-wrap { margin: 0; }
.rt-wysiwyg__select {
    width: auto;
    min-width: 5.5rem;
    height: 1.9rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: .75rem;
}
.rt-wysiwyg__select-wrap--font .rt-wysiwyg__select { min-width: 9rem; }
.rt-wysiwyg__select-wrap--size .rt-wysiwyg__select { min-width: 4.5rem; }
.rt-wysiwyg__select-wrap--table .rt-wysiwyg__select,
.rt-wysiwyg__select-wrap--border .rt-wysiwyg__select { min-width: 6.5rem; }
.rt-wysiwyg__color {
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 1px solid var(--bs-border-color, #dce1e7);
    border-radius: .3rem;
    background: #fff;
    cursor: pointer;
}
.rt-wysiwyg__editor {
    min-height: 9rem;
    max-height: 28rem;
    overflow: auto;
    padding: .65rem .75rem;
    font-size: .875rem;
    line-height: 1.45;
    outline: none;
}
.rt-wysiwyg__editor:focus {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, .18);
}
.rt-wysiwyg__editor p,
.rt-wysiwyg__editor div {
  margin: 0 0 .45em;
  min-height: 1.25em;
}
.rt-wysiwyg__editor p:empty,
.rt-wysiwyg__editor div:empty {
  min-height: 1.25em;
}
.rt-wysiwyg__editor p:last-child,
.rt-wysiwyg__editor div:last-child { margin-bottom: 0; }
.rt-wysiwyg__editor table,
.rt-wysiwyg-view table {
    border-collapse: collapse;
    width: 100%;
    margin: .35em 0;
}
.rt-wysiwyg__editor td,
.rt-wysiwyg__editor th,
.rt-wysiwyg-view td,
.rt-wysiwyg-view th {
    padding: 2px 4px;
    vertical-align: top;
}
.rt-wysiwyg-view {
    line-height: 1.45;
    word-break: break-word;
}
.rt-wysiwyg-view p { margin: 0 0 .45em; }
.rt-wysiwyg-view p:last-child { margin-bottom: 0; }
.modal .rt-wysiwyg__editor { max-height: 18rem; }

/* Матрица прав: персональный доступ и права на поля */
.access-personal-cfg td {
    background: color-mix(in srgb, var(--brand-accent, #0B679E) 4%, #fff);
    padding-top: 8px;
    padding-bottom: 10px;
    border-top: 0;
}
.access-personal-cfg__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.access-personal-cfg__label {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 600;
}
.access-personal-cfg__arrow {
    color: #94a3b8;
}
.access-personal-cfg .form-select {
    width: auto;
    min-width: 180px;
    max-width: 280px;
}
.access-personal-fields {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--app-table-border, #e8ecf1);
}
.access-personal-fields__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}
.access-personal-fields__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 4px 16px;
}
.access-personal-fields__tab {
    margin-top: 10px;
    padding: 8px 10px 10px;
    border: 1px solid var(--app-table-border, #e8ecf1);
    border-radius: 8px;
    background: #fff;
}
.access-personal-fields__tab-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--app-table-border, #eef1f5);
}
.access-personal-fields__tab-name {
    flex: 1 1 auto;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.access-personal-fields__item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.access-personal-fields__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.access-personal-fields__flag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}
.fields-access-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.fields-access-cell__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

/* ——— Отчёты по записи ——— */
.entity-reports-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 720px;
}
.entity-reports-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.entity-reports-list__item:hover {
    border-color: #94a3b8;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .06);
    color: inherit;
}
.entity-reports-list__icon {
    display: inline-flex;
    color: #64748b;
    flex-shrink: 0;
}
.entity-reports-list__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.entity-reports-list__title {
    font-weight: 600;
    font-size: 15px;
}
.entity-reports-list__notes {
    font-size: 13px;
    color: #64748b;
}
.entity-reports-list__meta {
    font-size: 12px;
    color: #94a3b8;
    flex-shrink: 0;
}
.entity-reports-list__chevron {
    display: inline-flex;
    color: #cbd5e1;
    flex-shrink: 0;
}

.entity-report-empty {
    border: 1px solid var(--tblr-border-color);
    box-shadow: none;
}

.entity-report-empty__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    padding: 40px 24px;
}

.entity-report-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--tblr-bg-surface-secondary, #f1f5f9);
    color: var(--tblr-secondary-color);
    opacity: 0.9;
}

.entity-report-empty__icon svg.feather {
    width: 26px;
    height: 26px;
    stroke-width: 1.6;
}

.entity-report-empty__title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--tblr-body-color);
}

.entity-report-empty__text {
    max-width: 420px;
    margin: 0;
    font-size: var(--app-font-size);
    line-height: 1.45;
    color: var(--tblr-secondary-color);
}

.entity-report__widget-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
}
.entity-report__widget-value {
    font-size: 1.75rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.entity-report__html {
    overflow-x: auto;
}

.entity-report__table-wrap {
    max-width: 100%;
    max-height: min(72vh, calc(100vh - 200px));
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    /* Резерв под полосу прокрутки — иначе на macOS overlay-скролл перекрывает «Итого» */
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: #fff;
}

.entity-report__table-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.entity-report__table-wrap::-webkit-scrollbar-thumb {
    background-color: rgba(15, 45, 66, 0.22);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.entity-report__table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.entity-report__table-wrap--wide {
    box-shadow: inset -12px 0 12px -12px rgba(15, 45, 66, .18);
}

.entity-report__table {
    --er-sticky-bg: #fff;
    --er-sticky-bg-stripe: #f8fafc;
    --er-sticky-bg-hover: #eef2f6;
    --er-sticky-bg-head: #f1f5f9;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.entity-report__table > :not(caption) > * > * {
    border-bottom-width: 1px;
}

.entity-report__table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background-color: var(--er-sticky-bg-head);
    white-space: nowrap;
    vertical-align: bottom;
    font-weight: 400;
}

.entity-report__table th,
.entity-report__table td {
    font-weight: 400;
}

.entity-report__table th.entity-report__col--sticky,
.entity-report__table td.entity-report__col--sticky {
    position: sticky;
    left: 0;
    z-index: 3;
    background-color: var(--er-sticky-bg);
    background-clip: padding-box;
    box-shadow: 1px 0 0 var(--bs-border-color);
    white-space: nowrap;
    width: max-content;
    max-width: none;
    min-width: max-content;
}

.entity-report__table thead th.entity-report__col--sticky {
    z-index: 6;
    background-color: var(--er-sticky-bg-head);
    white-space: nowrap;
    vertical-align: bottom;
    cursor: default;
    padding-top: .4rem;
    padding-right: 1.15rem;
    min-width: 0;
    position: sticky;
}

.entity-report__table thead th.entity-report__col--filterable {
    cursor: pointer;
}

.entity-report__table thead th.entity-report__col--filterable .entity-report__th-label {
    display: block;
    padding-right: .15rem;
    white-space: nowrap;
}

.entity-report__table thead th.has-filter .entity-report__th-label {
    color: var(--bs-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.entity-report__sort-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
    opacity: .45;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.entity-report__sort-btn:hover,
.entity-report__sort-btn.is-asc,
.entity-report__sort-btn.is-desc {
    opacity: .95;
}

.entity-report__sort-btn .entity-report__sort-ind {
    margin-left: 0;
}

.entity-report__sort-btn.is-asc .entity-report__sort-ind {
    opacity: .9;
    border-bottom-color: currentColor;
    border-top: 0;
}

.entity-report__sort-btn.is-desc .entity-report__sort-ind {
    opacity: .9;
    border-bottom: 0;
    border-top: 5px solid currentColor;
}

.entity-report__filter-pop {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 9rem;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(15, 45, 66, .12);
}

.entity-report__filter-pop[hidden] {
    display: none !important;
}

.entity-report__col-filter {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    font-size: 12px;
    padding: .2rem .4rem;
    line-height: 1.3;
    cursor: text;
}

.entity-report__filter-close {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.entity-report__filter-close:hover {
    background: var(--bs-tertiary-bg, #f1f5f9);
    color: var(--bs-body-color);
}

.entity-report__table thead th.is-filtering {
    cursor: default;
    z-index: 9;
}

.entity-report__table th.entity-report__col--sort {
    cursor: pointer;
    user-select: none;
}

.entity-report__table th.entity-report__col--sort:hover {
    color: var(--bs-primary);
}

.entity-report__sort-ind {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
    opacity: .25;
}

.entity-report__table th.entity-report__col--sort.is-asc .entity-report__sort-ind {
    opacity: .85;
    border-bottom-color: currentColor;
    border-top: 0;
}

.entity-report__table th.entity-report__col--sort.is-desc .entity-report__sort-ind {
    opacity: .85;
    border-bottom: 0;
    border-top: 5px solid currentColor;
}

.entity-report__table tbody tr:nth-of-type(odd) > td.entity-report__col--sticky {
    background-color: var(--er-sticky-bg-stripe);
}

.entity-report__table tbody tr:nth-of-type(even) > td.entity-report__col--sticky {
    background-color: var(--er-sticky-bg);
}

.entity-report__table tbody tr:hover > td.entity-report__col--sticky {
    background-color: var(--er-sticky-bg-hover);
}

.entity-report__table th.entity-report__col--date,
.entity-report__table td.entity-report__col--date {
    text-align: center;
    white-space: nowrap;
    min-width: 2.6rem;
    max-width: 3.2rem;
    padding-left: .2rem;
    padding-right: .2rem;
    font-variant-numeric: tabular-nums;
}

.entity-report__table th.entity-report__col--date {
    font-size: 11px;
    line-height: 1.15;
}

.entity-report__table td.entity-report__col--zero {
    color: var(--bs-secondary-color);
    opacity: .4;
}

/* Сб/вс — только если включено в настройках отчёта */
.entity-report-root--weekends th.entity-report__col--weekend {
    background-color: #fdf2f2 !important;
    color: #a86a6a;
}

.entity-report-root--weekends td.entity-report__col--weekend {
    background-color: #fdf2f2 !important;
}

.entity-report-root--weekends tbody tr:nth-of-type(odd) > td.entity-report__col--weekend {
    background-color: #fceeee !important;
}

.entity-report-root--weekends tbody tr:hover > td.entity-report__col--weekend {
    background-color: #f8e4e4 !important;
}

/* Строка с Итого = 0 — только если включено */
.entity-report-root--dim-zero-rows tbody tr.entity-report__row--inactive > td {
    color: var(--bs-secondary-color);
    opacity: .4;
}

.entity-report-root--dim-zero-rows tbody tr.entity-report__row--inactive:hover > td {
    opacity: .55;
}

.entity-report__table th.entity-report__col--total,
.entity-report__table td.entity-report__col--total {
    position: sticky;
    right: 0;
    z-index: 3;
    text-align: right;
    font-weight: 400;
    background-color: var(--er-sticky-bg);
    background-clip: padding-box;
    box-shadow: -1px 0 0 var(--bs-border-color);
    white-space: nowrap;
    padding-right: 0.65rem;
    padding-left: 0.75rem;
}

.entity-report__table thead th.entity-report__col--total {
    z-index: 6;
    background-color: var(--er-sticky-bg-head);
}

.entity-report__table tbody tr:nth-of-type(odd) > td.entity-report__col--total {
    background-color: var(--er-sticky-bg-stripe);
}

.entity-report__table tbody tr:nth-of-type(even) > td.entity-report__col--total {
    background-color: var(--er-sticky-bg);
}

.entity-report__table tbody tr:hover > td.entity-report__col--total {
    background-color: var(--er-sticky-bg-hover);
}

.entity-report-builder__cols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.entity-report-builder__filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.entity-report-widgets__item .form-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.entity-report-builder__step {
    padding: 16px 0;
    border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
}
.entity-report-builder__step:last-of-type {
    border-bottom: 0;
}
.entity-report-builder__step-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
}
.entity-report-builder__hint {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}
.entity-report-builder__modes {
    display: grid;
    gap: 10px;
}
@media (min-width: 768px) {
    .entity-report-builder__modes {
        grid-template-columns: 1fr 1fr;
    }
}
.entity-report-builder__mode {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
}
.entity-report-builder__mode:has(input:checked) {
    border-color: #206bc4;
    background: color-mix(in srgb, #206bc4 6%, #fff);
}
.entity-report-builder__mode input {
    margin-top: 3px;
}
.entity-report-builder__mode strong {
    display: block;
    font-size: 14px;
}
.entity-report-builder__mode small {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}
.entity-report-builder__metric,
.entity-report-builder__filter {
    padding: 10px 12px;
    border: 1px solid var(--tblr-border-color, #e6e7e9);
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 8px;
}
.entity-report-builder__sql-preview {
    border-top: 1px dashed #cbd5e1;
    padding-top: 10px;
}
.entity-report-builder__sql-code {
    margin-top: 8px;
    padding: 10px 12px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.entity-report-filters {
    margin-bottom: var(--app-section-gap, 1rem);
}
.entity-report-uifilters__item .form-label {
    font-size: 12px;
    margin-bottom: 4px;
}
