/**
 * ERP Velvet — 3D-оформление, 2026
 * Лёгкий код, CSS-переменные, perspective-эффекты
 */
:root {
    /* Высота блока над таблицей (навбар + отступы вкладки + карточка фильтров + зазоры); при необходимости подкрутите */
    --erp-table-area-offset: 168px;
    /* Высота nav + полоски вкладок окон (синхронизируется из JS, fallback 42px) */
    --erp-shell-top: 42px;
    /* Геометрия правой рабочей колонки (sync из JS по .erp-main-column) */
    --erp-main-left: 16.67%;
    --erp-main-width: 83.33%;
    /* Единый горизонтальный отступ: вкладки, полоска модалок, shell-окна */
    --erp-shell-inset-x: 1.25rem;
    --erp-primary: #3498db;
    --erp-primary-dark: #2980b9;
    --erp-success: #27ae60;
    --erp-warning: #f39c12;
    --erp-danger: #e74c3c;
    --erp-sidebar: #1e2a38;
    --erp-sidebar-light: #2c3e50;
    --erp-shadow: 0 4px 14px rgba(0,0,0,0.12);
    --erp-shadow-3d: 0 8px 24px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.08);
    --erp-radius: 10px;
    --erp-transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html {
    /* Резерв под скроллбар на экране входа; в приложении прокрутка внутри вкладок */
    scrollbar-gutter: stable;
}

html:has(body.erp-viewport-locked) {
    scrollbar-gutter: auto;
}

* { box-sizing: border-box; }

/* Мягкий фокус для полей и кнопок — без резкой синей обводки */
.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:focus-visible,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(52,152,219,0.5);
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--erp-primary);
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    perspective: 1200px;
}

/* === 3D SIDEBAR === */
.sidebar {
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.92);
    background: linear-gradient(180deg, var(--erp-sidebar-light) 0%, var(--erp-sidebar) 100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.25);
    z-index: 1000;
    transform-style: preserve-3d;
}
.sidebar.offcanvas-lg {
    border-right: none;
    z-index: 1080;
}

/* Шапка и поиск всегда видны при прокрутке меню */
.sidebar-sticky-top {
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--erp-sidebar-light) 0%, var(--erp-sidebar) 100%);
    z-index: 2;
}

/* Прокручиваемая область меню: плавный скролл и минималистичный скроллбар (как в Slack, VS Code, Linear) */
.sidebar-nav-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
/* Нижний закреплённый блок сайдбара: пользователь + бренд (меню скроллится только выше) */
.sidebar-bottom-dock {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Раньше было светлее — делаем ближе к прежнему ощущению */
    background: rgba(0, 0, 0, 0.12);
    padding-bottom: 6px;
}
.sidebar-user-dropdown {
    position: relative;
    padding: 6px 10px 4px;
}
.sidebar-user-dropdown .sidebar-user-toggle {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 6px 2px;
    box-shadow: none;
}
.sidebar-user-dropdown .sidebar-user-toggle:hover,
.sidebar-user-dropdown .sidebar-user-toggle:focus,
.sidebar-user-dropdown .sidebar-user-toggle:focus-visible,
.sidebar-user-dropdown .sidebar-user-toggle:active,
.sidebar-user-dropdown .sidebar-user-toggle.show {
    color: #fff;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.sidebar-user-dropdown .dropdown-menu.sidebar-user-menu {
    width: 100%;
    min-width: 0;
    z-index: 1065;
    inset: auto 0 100% 0;
    margin-bottom: 0.25rem;
}
.sidebar-user-menu-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    opacity: 0.8;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}
.sidebar-user-dropdown .sidebar-user-toggle:hover .sidebar-user-menu-icon,
.sidebar-user-dropdown .sidebar-user-toggle:focus .sidebar-user-menu-icon {
    opacity: 1;
}
.sidebar-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.72rem;
    background: rgba(52, 152, 219, 0.35);
    color: rgba(255, 255, 255, 0.95);
}
/* Небольшой подвал/отступ снизу у левой панели с вкладками */
.sidebar-footer {
    margin-top: 6px;
    padding: 8px 12px 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Нижний dock: без margin-top (иначе «оранжевый» зазор и admin съезжает вверх) */
.sidebar-footer.sidebar-footer--dock {
    margin-top: 0;
    padding: 6px 12px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
}
.sidebar-footer.sidebar-footer--dock .sidebar-footer-brand {
    margin-bottom: 2px;
    font-size: 0.78rem;
}
.sidebar-footer.sidebar-footer--dock .sidebar-footer-copy {
    margin-top: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
}

.sidebar-footer-brand {
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}

.sidebar-footer-subtitle,
.sidebar-footer-version,
.sidebar-footer-copy {
    font-size: 0.78rem;
    line-height: 1.45;
}

.sidebar-footer-subtitle {
    color: rgba(255,255,255,0.78);
    margin-bottom: 4px;
}

.sidebar-footer-version {
    color: rgba(255,255,255,0.62);
    margin-bottom: 10px;
}

.sidebar-footer-copy {
    color: rgba(255,255,255,0.5);
}
/* Тонкий скроллбар в Chrome/Safari: виден при наведении на сайдбар */
.sidebar-nav-wrap::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav-wrap::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
.sidebar:hover .sidebar-nav-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
}
.sidebar-nav-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.45);
}

.sidebar-header {
    padding: 34px 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
    text-align: left;
}

.sidebar-header-logo {
    display: block;
    width: 100%;
    max-width: 195px;
    height: auto;
    margin: 0 auto 12px 5px;
}

.sidebar-header h5 {
    color: #fff;
    font-weight: 600;
    font-size: 1.15em;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sidebar-header small {
    color: #fff;
    font-size: 0.88em;
    display: block;
    font-weight: 600;
    margin-left: 7px;
}

.navbar-organization-context {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    font-size: 0.68rem;
    line-height: 1.2;
    color: rgba(255,255,255,0.88);
}
.navbar-organization-context span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.28rem;
    min-width: 0;
}
.navbar-organization-context b {
    font-weight: 700;
    color: rgba(255,255,255,0.72);
}
.navbar-organization-context em {
    max-width: 10rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: normal;
}

/* 3D nav links */
.sidebar .nav-link {
    padding: 8px 14px;
    color: rgba(255, 255, 255, 0.88);
    border-left: 3px solid transparent;
    transition: var(--erp-transition);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.sidebar .nav-link:hover {
    background: rgba(52,152,219,0.2);
    border-left-color: var(--erp-primary);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(52,152,219,0.25);
    border-left-color: var(--erp-primary);
    color: #fff;
    box-shadow: inset 0 0 20px rgba(52,152,219,0.15);
}

.sidebar .nav-link i {
    width: 22px;
    margin-right: 10px;
    opacity: 0.95;
}

.sidebar-section {
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 6px;
    padding-top: 6px;
}

.sidebar-section .section-title {
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 20px 4px;
    color: rgba(255, 255, 255, 0.62);
}

.sidebar-section .section-title i {
    color: rgba(130, 195, 255, 0.95);
    margin-right: 6px;
    opacity: 1;
}

/* === 3D CARDS & CONTENT === */
.card {
    border: none;
    border-radius: var(--erp-radius);
    box-shadow: var(--erp-shadow);
    transition: var(--erp-transition);
    transform: translateZ(0);
    background: #fff;
}

.card:hover {
    box-shadow: var(--erp-shadow-3d);
}

/* Верхняя панель — мягкий тон */
.navbar-light.bg-light {
    background: #fafbfc !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Stat cards 3D lift */
.stat-card {
    text-align: center;
    padding: 18px 12px;
    border-radius: var(--erp-radius);
    transition: var(--erp-transition);
    transform: translateZ(0);
}

.stat-card:hover {
    box-shadow: var(--erp-shadow-3d);
}

/* Таблицы — читаемо и спокойно */
.table thead th { font-size: 0.75rem;
    background: #f8f9fa;
}
.table-hover tbody tr:hover {
    background: rgba(52,152,219,0.04);
}

/* Основная кнопка — спокойный акцент */
.btn-primary {
    background: var(--erp-primary);
    border: none;
    box-shadow: 0 1px 3px rgba(52,152,219,0.2);
    transition: var(--erp-transition);
}
.btn-primary:hover {
    background: var(--erp-primary-dark);
    box-shadow: 0 2px 6px rgba(52,152,219,0.25);
}

/* Унифицированные action-кнопки для таблиц/карточек */
.erp-action-btn {
    min-width: 34px;
}

.erp-action-btn.btn-outline-info:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: #fff;
}

.erp-action-btn.btn-outline-success:hover {
    background-color: var(--erp-success);
    border-color: var(--erp-success);
    color: #fff;
}

.erp-action-btn.btn-outline-danger:hover {
    background-color: var(--erp-danger);
    border-color: var(--erp-danger);
    color: #fff;
}

.erp-action-btn.btn-outline-warning:hover {
    color: #212529;
}

/* Унифицированные empty/error/loading-состояния в таблицах */
.erp-table-state {
    text-align: center;
    padding: 14px 10px !important;
    font-size: 0.92rem;
}

.erp-table-state-empty {
    color: #6c757d;
}

.erp-table-state-error {
    color: #dc3545;
}

/* Modals — аккуратный деловой стиль: подписи компактные, данные читаемые */
.modal-content {
    /* Шаг 1 (визуал): строже карточка модалки — без смены сетки / JS */
    border-radius: 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #dee2e6;
    overflow: hidden;
    background: #fff;
}
/* Shell-панель: без скругления, стык с полоской вкладок как рабочее окно */
.modal-panel.modal:not([data-erp-modal-tier="child"]) .modal-content {
    border-radius: 0;
    border-top: none;
    box-shadow: none;
}
.modal-panel.modal:not([data-erp-modal-tier="child"]) .modal-header {
    border-radius: 0;
    padding-left: var(--erp-shell-inset-x);
    padding-right: var(--erp-shell-inset-x);
}
.modal-panel.modal:not([data-erp-modal-tier="child"]) .modal-body {
    padding-left: var(--erp-shell-inset-x);
    padding-right: var(--erp-shell-inset-x);
}
.modal-panel.modal:not([data-erp-modal-tier="child"]) .modal-footer {
    padding-left: var(--erp-shell-inset-x);
    padding-right: var(--erp-shell-inset-x);
}
.modal-panel.modal:not([data-erp-modal-tier="child"]) .modal-header .btn-close {
    /* Bootstrap тянет крестик отрицательным margin — у shell-панели до края колонки */
    margin: 0;
    padding: 0.35rem;
    flex-shrink: 0;
}
.modal-panel.modal:not([data-erp-modal-tier="child"]) .modal-header .modal-header-buttons {
    margin-right: 0;
    gap: 0.35rem;
}
/* Подготовка формы до показа — без «прыжка» внутренностей */
.modal-panel .modal-dialog.erp-modal--preparing .modal-content {
    visibility: hidden;
}
.modal-panel .modal-dialog.erp-modal--preparing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 1;
}
.modal-panel .modal-dialog.erp-modal--preparing::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 42%;
    width: 1.75rem;
    height: 1.75rem;
    margin: -0.875rem 0 0 -0.875rem;
    border: 2px solid #dee2e6;
    border-top-color: var(--erp-primary, #3498db);
    border-radius: 50%;
    animation: erp-modal-preparing-spin 0.65s linear infinite;
    z-index: 2;
}
@keyframes erp-modal-preparing-spin {
    to { transform: rotate(360deg); }
}
/* Вкладки внутри shell-модалок — без fade Bootstrap */
.modal-panel .tab-pane.fade {
    transition: none !important;
}
.modal-panel .tab-pane.fade:not(.show) {
    opacity: 0;
}
.modal-panel .tab-pane.fade.show {
    opacity: 1;
}
/* Модалки: без анимации появления (без сдвига сверху) и без затемнения фона — ближе к 1С */
.modal.fade .modal-dialog,
.modal.show .modal-dialog {
    transform: none !important;
    transition: none !important;
}
.modal.fade,
.modal.show {
    transition: none !important;
}
.modal-header {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0.625rem 1rem;
    min-height: 2.75rem;
}
.modal-header .modal-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #374151;
    letter-spacing: 0.01em;
}
.modal-body { font-size: 0.85rem;
}
.modal-footer { padding: 0.4rem 0.75rem;
}

/* Просмотр документа: действия в футере без отдельной кнопки закрытия */
#documentDetailsModal .modal-footer {
    padding-top: 0.65rem;
    padding-bottom: 1rem;
    min-height: 84px;
}
#documentDetailsModal #document-details-footer-actions {
    width: 100%;
    padding: 0.1rem 0;
    row-gap: 0.5rem;
}
#documentDetailsModal .document-details-actions-group {
    justify-content: flex-end;
}

/* Подписи в модалках — мелко и спокойно, не перебивают данные */
.modal .form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}
/* Поля ввода в модалках — нормальный размер для чтения данных */
.modal .form-control,
.modal .form-select { padding: 0.28rem 0.5rem;
    border-radius: 6px;
    border-color: #dee2e6;
    color: #111827;
}
.modal .form-control-sm,
.modal .form-select-sm {
    font-size: 0.875rem;
    min-height: 1.875rem;
    padding: 0.25rem 0.5rem;
}
.modal .form-control::placeholder {
    color: #9ca3af;
}
/* Текстовые области в модалках */
.modal textarea.form-control { min-height: 2.1rem;
}

/* Таблицы внутри модалок — данные хорошо читаются */
.modal .table,
.modal .table-responsive .table {
    font-size: 0.875rem;
}
.modal .table thead th { padding: 0.3rem 0.4rem;
    border-bottom-color: #e5e7eb;
    background: #f9fafb;
}
.modal .table tbody td { padding: 0.3rem 0.4rem;
    vertical-align: middle;
}

/* Компактные отступы между блоками в модалках */
.modal .mb-3 { margin-bottom: 0.75rem !important; }
.modal .row.g-2 { --bs-gutter-y: 0.5rem; --bs-gutter-x: 0.5rem; }
.modal .row.g-3 { --bs-gutter-y: 0.5rem; --bs-gutter-x: 0.75rem; }
.modal .card { margin-bottom: 0.75rem; }
.modal .card .card-header { padding: 0.3rem 0.6rem; font-size: 0.8125rem; font-weight: 600; color: #4b5563; }
.modal .alert { font-size: 0.8125rem; padding: 0.5rem 0.75rem; }

/* Кнопки в футере модалок — компактно */
.modal-footer .btn { padding: 0.28rem 0.6rem;
}
.modal-footer .btn-sm { font-size: 0.8125rem; padding: 0.25rem 0.5rem; }
/* Кнопки Свернуть и Закрыть — справа */
.modal-header .modal-header-buttons {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.modal-header .btn-modal-minimize,
.modal-header .btn-close {
    opacity: 0.8;
    transition: var(--erp-transition);
    color: #6b7280;
}
.modal-header .btn-modal-minimize {
    padding: 0.35rem 0.6rem;
    margin-right: 0;
    border: none;
    background: transparent;
    color: inherit;
}
.modal-header .btn-modal-minimize:hover,
.modal-header .btn-close:hover {
    opacity: 1;
    color: #374151;
}
.modal-header .btn-modal-minimize:hover {
    background-color: rgba(0,0,0,0.08);
    border-radius: 6px;
}
/* Модалки xl — максимум ширины в правой области */
.modal-dialog.modal-xl {
    max-width: min(1140px, calc(100vw - 2rem));
}

/* Документ: компактная шапка реквизитов (подпись слева, поле справа — как в 1С, но легче) */
#addDocumentModal {
    --erp-doc-label-width: 9.25rem;
    --erp-doc-control-max: 17.5rem;
    --erp-doc-control-gap: 0.5rem;
}
#addDocumentModal .erp-doc-meta-panel {
    --erp-doc-label-width: 9.25rem;
}
#addDocumentModal .erp-doc-meta-panel--nested {
    --erp-doc-label-width: 8.5rem;
    --erp-doc-control-max: 15rem;
}
#addDocumentModal .erp-doc-field-row {
    display: flex;
    align-items: center;
    gap: var(--erp-doc-control-gap);
    margin-bottom: 0.3rem;
    min-height: 1.875rem;
}
/* editor.js показывает поля через style.display = 'block' — сохраняем flex-строку */
#addDocumentModal .erp-doc-field-row[style*="display: block"],
#addDocumentModal .erp-doc-field-row[style*="display:block"] {
    display: flex !important;
}
#addDocumentModal .erp-doc-field-row[style*="display: none"],
#addDocumentModal .erp-doc-field-row[style*="display:none"] {
    display: none !important;
}
#addDocumentModal .erp-doc-field-row:last-child {
    margin-bottom: 0;
}
#addDocumentModal .erp-doc-field-label {
    flex: 0 0 var(--erp-doc-label-width);
    width: var(--erp-doc-label-width);
    text-align: left;
    margin-bottom: 0;
    padding-right: 0;
    padding-left: 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}
#addDocumentModal .erp-doc-field-control {
    flex: 1 1 auto;
    min-width: 0;
    max-width: var(--erp-doc-control-max);
}
#addDocumentModal .erp-doc-meta-col .erp-doc-field-control,
#addDocumentModal .erp-doc-field-control--wide {
    max-width: 100%;
}
#addDocumentModal .erp-doc-field-control .form-control,
#addDocumentModal .erp-doc-field-control .form-select {
    width: 100%;
}
#addDocumentModal .erp-doc-field-control--date {
    max-width: 10.5rem;
}
#addDocumentModal .erp-doc-field-control--datetime {
    max-width: 13.5rem;
}
#addDocumentModal .erp-doc-field-control--select {
    max-width: 14rem;
}
#addDocumentModal .erp-doc-field-control--split {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 20rem;
}
#addDocumentModal .erp-doc-field-control--split .form-control:first-child {
    flex: 1 1 auto;
    min-width: 0;
}
#addDocumentModal .erp-doc-field-control-date-part {
    flex: 0 0 8.75rem;
    width: 8.75rem;
}
#addDocumentModal .erp-doc-field-control--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    max-width: 14rem;
}
#addDocumentModal .erp-doc-field-hint-icon {
    font-size: 0.65rem;
    vertical-align: 0.05em;
}
#addDocumentModal .erp-doc-meta-grid--header {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
    row-gap: 0.15rem;
    margin-bottom: 0.25rem;
}
#addDocumentModal .erp-doc-meta-grid--header .erp-doc-field-control {
    max-width: 100%;
}
@media (min-width: 992px) {
    #addDocumentModal .erp-doc-meta-grid--header {
        grid-template-columns: 1.4fr 1fr 0.95fr;
    }
    #addDocumentModal .erp-doc-meta-grid--header:has(#doc-receipt-invoice-row:not([style*="display: none"]):not([style*="display:none"])) {
        grid-template-columns: 1.35fr 0.95fr 0.85fr 1.15fr;
    }
}
#addDocumentModal .erp-doc-meta-grid--two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
    row-gap: 0.1rem;
    margin-bottom: 0.2rem;
}
#addDocumentModal .erp-doc-meta-grid--financial {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
    row-gap: 0.1rem;
}
#addDocumentModal .erp-doc-field-row--wide {
    grid-column: 1 / -1;
}
@media (max-width: 767.98px) {
    #addDocumentModal .erp-doc-meta-grid--header,
    #addDocumentModal .erp-doc-meta-grid--two-col,
    #addDocumentModal .erp-doc-meta-grid--financial {
        grid-template-columns: 1fr;
    }
    #addDocumentModal .erp-doc-field-label {
        flex-basis: var(--erp-doc-label-width);
    }
    #addDocumentModal .erp-doc-field-control,
    #addDocumentModal .erp-doc-meta-col .erp-doc-field-control {
        max-width: 100%;
    }
}
#addDocumentModal .erp-doc-field-row--actions .btn-group .btn { font-size: 0.78rem;
    padding: 0.2rem 0.45rem;
}
#addDocumentModal .employee-typeahead-wrap,
#addDocumentModal .individual-typeahead-wrap {
    width: 100%;
}

/* Документ: позиции — вертикальный скролл только у таблицы; кнопки «режим скана» остаются в шапке карточки */
/* Комментарий к позиции: панель под таблицей (без оверлея — стабильный фокус в shell-модалке) */
#addDocumentModal .doc-item-comment-editor {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
}
#addDocumentModal .doc-item-comment-editor[hidden] {
    display: none !important;
}
#addDocumentModal .doc-item-comment-editor .doc-item-comment-textarea {
    min-height: 140px;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.45;
}
#addDocumentModal .doc-item-condition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(18rem, 1fr));
    gap: 0.9rem 2rem;
    align-items: start;
}
#addDocumentModal .doc-item-condition-group {
    min-width: 0;
}
#addDocumentModal .doc-item-condition-group .small {
    font-size: 0.82rem;
}
#addDocumentModal .doc-item-condition-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}
#addDocumentModal .doc-item-condition-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.75rem;
    margin: 0;
    padding: 0.16rem 0.38rem;
    border-radius: 0.35rem;
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
}
#addDocumentModal .doc-item-condition-option .small {
    font-size: 0.8rem;
}
#addDocumentModal .doc-item-condition-option:hover {
    background: rgba(13, 110, 253, 0.06);
}
#addDocumentModal .doc-item-condition-form .doc-item-condition-radio {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0;
    margin-left: 0;
    flex: 0 0 auto;
    cursor: pointer;
}
@media (max-width: 900px) {
    #addDocumentModal .doc-item-condition-grid {
        grid-template-columns: 1fr;
    }
}
#addDocumentModal .document-item.doc-item-comment-active > td {
    background-color: #eef6ff;
}
#addDocumentModal .document-item.doc-scan-flash > td {
    background-color: rgba(25, 135, 84, 0.18) !important;
    transition: background-color 600ms ease;
}

#addDocumentModal .doc-items-table-scroll {
    max-height: min(48vh, 26rem);
    overflow-y: auto;
    overflow-x: auto;
}
/*
 * table-layout: auto — принципиально важно. При table-layout:fixed браузер резервирует
 * ширину колонки по <th>, даже если сама ячейка скрыта через display:none (проверено:
 * несколько попыток "занулить" ширину через CSS-классы не давали стабильного результата
 * и на некоторых переходах между типами документов давали рассинхронизацию классов).
 * С table-layout:auto скрытая (display:none) ячейка гарантированно не участвует
 * в расчёте ширины столбца — это базовое, кросс-браузерное поведение спецификации,
 * не требующее никакой дополнительной JS-логики поверх уже существующего display:none.
 * Узкие колонки получают white-space:nowrap + небольшую ширину-подсказку, а колонка
 * «Номенклатура» — width:100% (стандартный приём: «резиновая» колонка забирает весь
 * остаток, остальные ужимаются до содержимого).
 */
#addDocumentModal .doc-items-table-scroll table {
    table-layout: auto;
    width: 100%;
}
#addDocumentModal .doc-items-table-scroll th,
#addDocumentModal .doc-items-table-scroll td {
    white-space: nowrap;
}
#addDocumentModal .doc-items-table-scroll .doc-col-nom {
    width: 100%;
    white-space: normal;
}
#addDocumentModal .doc-items-table-scroll .doc-col-select {
    width: 2rem;
    text-align: center;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}
/* СИЗ-журнал: шире hit-area чекбокса без увеличения самого input */
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal .doc-col-select {
    width: 2.75rem;
    min-width: 2.75rem;
    vertical-align: middle;
    padding: 0;
}
#addDocumentModal .doc-items-table-scroll .doc-item-select-hit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    width: 100%;
    margin: 0;
    cursor: pointer;
}
#addDocumentModal .doc-items-table-scroll .doc-item-select-hit .form-check-input {
    margin: 0;
    cursor: pointer;
}
#addDocumentModal .doc-items-table-scroll .doc-col-num,
#addDocumentModal .doc-items-table-scroll td.doc-number {
    width: 2rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    font-size: 0.75rem;
}
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal td.doc-number,
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal td.doc-siz-tab-cell,
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal td.doc-siz-fio-cell,
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal td.doc-siz-warehouse-cell,
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal td.doc-siz-barcode-cell {
    cursor: pointer;
    user-select: none;
}
#addDocumentModal .doc-items-table-scroll .doc-col-char {
    width: 6.5rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-tab {
    /* min-width, а не width: в auto-layout вместе с "резиновой" .doc-col-nom (width:100%)
     * простой width на узкой колонке — не жёсткий пол, браузер может ужать её сильнее.
     * min-width гарантирует минимальную ширину независимо от перетягивания места. */
    width: 5.5rem;
    min-width: 5.5rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-fio {
    width: 11rem;
    min-width: 11rem;
    max-width: 11rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-warehouse {
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-barcode {
    width: 7.5rem;
    min-width: 7.5rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-qty {
    width: 4.25rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-unit {
    width: 3.5rem;
}
#addDocumentModal .doc-items-table-scroll .doc-money-col {
    width: 5.5rem;
}
/* Цена/НДС — чуть шире базовой .doc-money-col (не задевая «Сумму»). min-width — жёсткий пол. */
#addDocumentModal .doc-items-table-scroll .doc-col-price {
    width: 6.25rem;
    min-width: 6.25rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-vat {
    width: 6rem;
    min-width: 6rem;
}
#addDocumentModal .doc-items-table-scroll .doc-batch-expires-col {
    width: 6.5rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-actions {
    width: 4.5rem;
}
#addDocumentModal .doc-items-table-scroll .doc-col-num + td .form-control,
#addDocumentModal .doc-items-table-scroll .doc-col-qty .form-control {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
#addDocumentModal .doc-items-table-scroll td.doc-siz-tab-cell,
#addDocumentModal .doc-items-table-scroll td.doc-siz-fio-cell,
#addDocumentModal .doc-items-table-scroll td.doc-siz-warehouse-cell,
#addDocumentModal .doc-items-table-scroll td.doc-siz-barcode-cell {
    vertical-align: middle;
}
#addDocumentModal .doc-items-table-scroll td.doc-siz-fio-cell {
    max-width: 11rem;
}
#addDocumentModal .doc-items-table-scroll td.doc-siz-warehouse-cell {
    max-width: 8rem;
}
#addDocumentModal .doc-items-table-scroll .doc-siz-employee-fio,
#addDocumentModal .doc-items-table-scroll .doc-siz-warehouse-name {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}
#addDocumentModal .doc-items-table-scroll table.doc-items-table--siz-journal .doc-col-nom {
    min-width: 10rem;
}
#addDocumentModal tfoot .doc-discount-percent-input {
    display: inline-block;
    width: 4.25rem;
    max-width: 100%;
    margin-left: auto;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}
#addDocumentModal tfoot td.text-end .doc-discount-percent-input {
    vertical-align: middle;
}
.modal-backdrop {
    /* Нет затемнения; не перехватываем клики (поверх всё равно слой .modal) */
    background-color: transparent !important;
    opacity: 0 !important;
    pointer-events: none !important;
    --bs-backdrop-opacity: 0 !important;
}
.modal-backdrop.fade,
.modal-backdrop.show {
    opacity: 0 !important;
    transition: none !important;
}

/* Spinner placeholder */
.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

/* Badges */
.badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    font-weight: 500;
}

/* Tab content area */
.tab-content:not(.erp-main-tab-content) {
    min-height: 60vh;
}

/* Reports: make card/table area fill viewport height immediately */
.reports-siz-card-body,
.reports-siz-tab-content,
.reports-ops-table-wrap {
    min-height: 0; /* critical for flex children with overflow */
}
.reports-siz-tab-content {
    display: flex;
    flex-direction: column;
}
.reports-ops-table-wrap {
    flex: 1 1 auto;
}

/* Отчёты: shell скрыт до раскладки вкладок под отрасль (без «прыжка» дефолтного UI). */
.reports-app-shell {
    min-height: 50vh;
}
.reports-app-shell--booting {
    visibility: hidden;
}

/* Поиск по маркировке: карточка экземпляра */
.siz-trace-instance-card .siz-trace-instance-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.65rem;
}
.siz-trace-instance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem 1.25rem;
}
@media (max-width: 767.98px) {
    .siz-trace-instance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.siz-trace-instance-grid .siz-trace-field-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    margin-bottom: 0.1rem;
}
.siz-trace-instance-grid .siz-trace-field-value {
    font-size: 0.875rem;
    line-height: 1.35;
    word-break: break-word;
}
.siz-trace-owner-link {
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Итоговая ведомость ПТК: переключение листов */
.erp-ptk-statement-sheets .nav-link {
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
}

/* Подробный отчёт: div-виртуализация (без гигантской table-layout) */
.ptk-sheet4-grid-shell {
    --ptk-sheet4-cols: 56px 180px 120px 140px 240px 130px 155px 155px 165px 175px;
    --ptk-sheet4-width: 1516px;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    background: #fff;
}
.ptk-sheet4-track {
    width: var(--ptk-sheet4-width);
    min-width: 100%;
}
.ptk-sheet4-grid {
    display: grid;
    grid-template-columns: var(--ptk-sheet4-cols);
    width: 100%;
    box-sizing: border-box;
}
.ptk-sheet4-header-row {
    border-bottom: 1px solid var(--bs-border-color);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bs-body-color);
}
.ptk-sheet4-header-sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f1f3f5;
    box-shadow: 0 1px 0 var(--bs-border-color), 0 2px 6px rgba(0, 0, 0, 0.06);
}
.ptk-sheet4-header-cell {
    padding: 0.5rem 0.5rem;
    vertical-align: middle;
    white-space: nowrap;
    border-right: 1px solid var(--bs-border-color-translucent);
    background-color: #f1f3f5;
}
.ptk-sheet4-header-cell:last-child {
    border-right: 0;
}
.ptk-statement-sheet4-scroll {
    max-height: min(70vh, 720px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.ptk-virt-body {
    position: relative;
    min-height: 2rem;
    width: 100%;
    background: #fff;
}
.ptk-virt-row {
    position: absolute;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    background-color: #fff;
}
.ptk-virt-row.ptk-virt-odd {
    background-color: #f8f9fa;
}
.ptk-grid-cell {
    padding: 0.35rem 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    line-height: 1.35;
    border-right: 1px solid var(--bs-border-color-translucent);
    user-select: text;
}
.ptk-grid-cell:last-child {
    border-right: 0;
}
.ptk-grid-cell-start {
    text-align: start;
}
.ptk-virt-empty {
    padding: 1.5rem 0.75rem;
}

/* Итоговая ведомость ПТК: автофильтр столбцов «Подробный отчёт» (как в Excel) */
.ptk-col-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    width: 100%;
}
.ptk-col-header-label {
    line-height: 1.2;
}
.ptk-col-filterable {
    cursor: pointer;
    user-select: none;
}
.ptk-col-filterable:hover {
    background-color: #e9ecef;
}
.ptk-col-filterable.ptk-col-filter-active {
    background-color: #dee7f8;
}
.ptk-col-filter-caret {
    color: var(--bs-secondary-color);
    line-height: 1;
    font-size: 0.7rem;
    opacity: 0.75;
    pointer-events: none;
}
.ptk-col-filterable:hover .ptk-col-filter-caret,
.ptk-col-filterable.ptk-col-filter-active .ptk-col-filter-caret {
    color: var(--bs-primary);
    opacity: 1;
}
.ptk-col-filter-dropdown {
    position: fixed;
    z-index: 1060;
    width: 260px;
    max-height: min(420px, calc(100vh - 24px));
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.55rem;
    display: flex;
    flex-direction: column;
}
.ptk-col-filter-sort {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.ptk-col-filter-sort-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 0.3rem 0.4rem;
    font-size: 0.8125rem;
    border-radius: 0.25rem;
    color: inherit;
}
.ptk-col-filter-sort-btn:hover {
    background: var(--bs-light);
}
.ptk-col-filter-list {
    overflow-y: auto;
    max-height: 200px;
    margin-top: 0.15rem;
}
.ptk-col-filter-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0.3rem;
    margin: 0;
    cursor: pointer;
    font-size: 0.8125rem;
    border-radius: 0.2rem;
}
.ptk-col-filter-item:hover {
    background: var(--bs-light);
}
.ptk-col-filter-item input[type="checkbox"] {
    flex-shrink: 0;
    margin: 0;
}
.ptk-col-filter-item-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ptk-col-filter-all-item {
    border-bottom: 1px solid var(--bs-border-color-translucent);
    margin-bottom: 0.15rem;
    padding-bottom: 0.35rem;
}

/* Reports root tab pane must be a flex column, otherwise h-100 inside won't work */
.erp-main-tab-content > #reports.tab-pane.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
/* The internal reports tab-content should take remaining height */
.erp-main-tab-content > #reports.tab-pane.active #mainReportsTabContent {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.erp-main-tab-content > #reports.tab-pane.active #mainReportsTabContent > .tab-pane {
    flex: 1 1 auto;
    min-height: 0;
}

/* Главная колонка: на всю высоту окна, без прокрутки всей страницы */
body.erp-viewport-locked {
    overflow: hidden;
    height: 100%;
}

body.erp-viewport-locked > .container-fluid {
    padding-right: 0;
    max-width: 100%;
}

body.erp-viewport-locked .container-fluid > .row {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
}

.container-fluid > .row {
    min-height: 100vh;
}
.col-md-10.erp-main-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100vh;
}
body.erp-viewport-locked .col-md-10.erp-main-column {
    overflow: hidden;
}
.erp-main-column > nav.navbar {
    flex-shrink: 0;
}
/* Полоска под свёрнутые окна: на всю ширину колонки + стабильная высота */
.erp-main-column > nav.navbar.navbar-with-modal-tabs {
    position: relative;
    z-index: 1070;
    box-sizing: border-box;
    margin-left: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    margin-right: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
    width: calc(100% + var(--bs-gutter-x, 1.5rem));
    max-width: none;
    min-height: 42px;
    border-bottom: 1px solid #b0bec5;
}

/* Тонкая бегущая полоса загрузки — поверх нижней границы nav, без сдвига layout */
.erp-app-loading-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.12s ease;
}
body.erp-app-loading .erp-app-loading-bar {
    opacity: 1;
}
.erp-app-loading-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 36%;
    background: #2f9be6;
    border-radius: 0 999px 999px 0;
    transform: translateX(-120%);
    animation: erp-app-loading-slide 1.05s ease-in-out infinite;
}
@keyframes erp-app-loading-slide {
    0% {
        transform: translateX(-120%);
    }
    100% {
        transform: translateX(320%);
    }
}
.erp-main-column > nav.navbar.navbar-with-modal-tabs > .container-fluid {
    max-width: none;
    padding-left: var(--erp-shell-inset-x);
    padding-right: var(--erp-shell-inset-x);
}
/* Полоска только под свёрнутые окна: стабильная высота → меньше «прыжков» при появлении вкладок */
.erp-modal-tabs-toolbar {
    min-height: 42px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
}
.erp-modal-tabs-toolbar #modal-tabs-bar {
    min-width: 0;
}
.erp-main-tab-content {
    flex: 1 1 auto;
    min-height: 0;
}

body.erp-viewport-locked .erp-main-tab-content.p-3 {
    padding-left: var(--erp-shell-inset-x);
    padding-right: var(--erp-shell-inset-x);
}

body.erp-viewport-locked .erp-main-tab-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.erp-viewport-locked .erp-main-tab-content > .tab-pane.active {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* Вкладки без «таблица внизу»: прокрутка внутри pane, не у body */
body.erp-viewport-locked .erp-main-tab-content > #dashboard.tab-pane.active,
body.erp-viewport-locked .erp-main-tab-content > #postamats.tab-pane.active,
body.erp-viewport-locked .erp-main-tab-content > #configuration.tab-pane.active,
body.erp-viewport-locked .erp-main-tab-content > #reports.tab-pane.active,
body.erp-viewport-locked .erp-main-tab-content > #uav.tab-pane.active,
body.erp-viewport-locked .erp-main-tab-content > #laundry.tab-pane.active,
body.erp-viewport-locked .erp-main-tab-content > #factory-integrations.tab-pane.active {
    overflow-x: hidden;
    overflow-y: auto;
}

body.erp-viewport-locked .erp-main-tab-content > .tab-pane.active > .card:first-child {
    flex-shrink: 0;
}

body.erp-viewport-locked .erp-main-tab-content > .tab-pane.active > .card + .card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.erp-viewport-locked .erp-main-tab-content > .tab-pane.active > .card + .card > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Единая область: таблица занимает оставшуюся высоту экрана, прокрутка внутри, шапка таблицы закреплена */
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll),
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll),
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) {
    max-height: calc(100vh - var(--erp-table-area-offset));
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.erp-viewport-locked .erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll),
body.erp-viewport-locked .erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll),
body.erp-viewport-locked .erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll),
body.erp-viewport-locked .erp-main-tab-content .tab-pane.active .erp-table-scroll-wrap:not(.no-erp-table-scroll) {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll) thead th,
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll) thead th,
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) thead th,
.erp-main-tab-content .tab-pane.active .erp-table-scroll-wrap:not(.no-erp-table-scroll) thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
/* Фон у закреплённой шапки — иначе строки «просвечивают» при прокрутке */
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll) thead.table-light th,
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll) thead.table-light th,
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) thead.table-light th,
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll) thead.bg-light th,
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll) thead.bg-light th,
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) thead.bg-light th,
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll) thead tr.table-secondary th,
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll) thead tr.table-secondary th,
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) thead tr.table-secondary th,
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll) thead:not(.table-light):not(.bg-light) th,
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll) thead:not(.table-light):not(.bg-light) th,
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) thead:not(.table-light):not(.bg-light) th {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    background-clip: padding-box;
}
.erp-main-tab-content .tab-pane.active .table-responsive:not(.no-erp-table-scroll) thead tr.table-secondary th,
.erp-main-tab-content .tab-pane.active .documents-table-wrap:not(.no-erp-table-scroll) thead tr.table-secondary th,
.erp-main-tab-content .tab-pane.active .barcoding-table-wrap:not(.no-erp-table-scroll) thead tr.table-secondary th {
    background-color: var(--bs-secondary-bg, #e9ecef);
}

/* Таблицы в модалках с id (напр. #viewEmployeeModal) задают свою max-height — id сильнее правила вкладки */

/* Existing overrides */
.table-sm th { font-size: 0.8rem; font-weight: 600; }
.table-sm td { font-size: 0.85rem; vertical-align: middle; }
.table th, .table td { text-align: center; vertical-align: middle; }
.card {
    border-radius: var(--erp-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow var(--erp-transition);
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.card-header, .card-footer { border-radius: var(--erp-radius) var(--erp-radius) 0 0; }
.card-footer { border-radius: 0 0 var(--erp-radius) var(--erp-radius); }
.form-check-input:checked { background-color: var(--erp-primary); border-color: var(--erp-primary); }
/* Поля ввода — единое скругление и граница */
.form-control, .form-select {
    border-radius: 6px;
    border-color: rgba(0,0,0,0.12);
}
.btn-outline-secondary.active-tab { background-color: #6c757d; color: #fff; }
/* Кнопки — лёгкий hover */
.btn {
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
}
.btn:hover:not(:disabled) {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
#journal-table { table-layout: fixed; width: 100%; }
#journal-table th, #journal-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Документооборот: тулбар фильтров + панель над таблицей (без нижней пагинации) */
.erp-main-tab-content > #documents.tab-pane.active {
    --erp-table-area-offset: 268px;
}

/* Штрихкодирование: тулбар + пагинация над таблицей (offset ≈ высота блоков над .barcoding-table-wrap) */
.erp-main-tab-content > #barcoding.tab-pane.active {
    --erp-table-area-offset: 203px;
}

/* Панель над таблицей: выбор + bulk слева, страницы справа */
.documents-table-toolbar {
    min-height: 36px;
    row-gap: 0.35rem;
}
.documents-table-toolbar-start {
    display: grid;
    grid-template-columns: 7.5rem auto;
    column-gap: 0.85rem;
    align-items: center;
}
.documents-table-toolbar .documents-toolbar-selection {
    width: 7.5rem;
    flex: 0 0 7.5rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.documents-table-toolbar-actions {
    flex-shrink: 0;
}
.documents-table-toolbar .documents-toolbar-page-info {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.documents-table-toolbar-actions .btn {
    padding-left: 0.45rem;
    padding-right: 0.5rem;
}
.documents-toolbar-page-nav .btn {
    min-width: 2rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

/* Таблицы документооборота на всю ширину */
.documents-card,
.documents-card > .card-body {
    min-width: 0;
}
.documents-card, .documents-table-wrap { width: 100%; }
.documents-table-wrap {
    min-width: 0;
}
.barcoding-card, .barcoding-table-wrap { width: 100%; }
.barcoding-table-toolbar {
    min-height: 36px;
    row-gap: 0.35rem;
}
.barcoding-table-toolbar .barcoding-toolbar-page-info {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.barcoding-toolbar-page-nav .btn {
    min-width: 2rem;
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}
.documents-table {
    width: 100%;
    table-layout: fixed;
}
/* Список документов: фикс. чекбокс/номер/действия; тип/склад/орг — с ellipsis; при нехватке места — гориз. скролл */
.documents-list-table {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}
.documents-list-table col.documents-col-check { width: 36px; }
.documents-list-table col.documents-col-num { width: 14rem; }
.documents-list-table col.documents-col-date { width: 6.5rem; }
.documents-list-table col.documents-col-time { width: 4.75rem; }
.documents-list-table col.documents-col-amount { width: 5.5rem; }
.documents-list-table col.documents-col-meta { width: 4.25rem; }
.documents-list-table col.documents-col-status { width: 7rem; }
.documents-list-table col.documents-col-actions { width: 7rem; }
/* type, warehouse, organization — без width в colgroup: забирают остаток на широком экране */
.documents-table tbody tr.documents-data-row {
    cursor: pointer;
}
.documents-table th,
.documents-table td {
    vertical-align: middle;
    white-space: nowrap;
}
.documents-list-table .documents-col-type,
.documents-list-table .documents-col-warehouse,
.documents-list-table .documents-col-organization {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 0;
}
.documents-list-table th.documents-col-check,
.documents-list-table td.documents-col-check {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    box-sizing: border-box;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    text-align: center;
}
.documents-list-table .documents-col-num {
    overflow: visible;
    text-overflow: clip;
}
.documents-list-table th.documents-col-actions,
.documents-list-table td.documents-col-actions {
    overflow: visible;
    text-overflow: clip;
}
.documents-table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.2rem;
    align-items: center;
    justify-content: flex-start;
}
/* Empty/error row: single cell, no actions wrapper */
.documents-table td.erp-table-state {
    display: table-cell !important;
}

/* Hide documents amount column (header + cells) */
.documents-col-amount--hidden {
    display: none !important;
}

/* Компактные таблицы во всех вкладках — порядковый номер, читаемость */
.erp-ref-toolbar ~ .card table.table,
.card .table-responsive table.table { font-size: 0.9rem; }
.table th, .table td { padding: 0.4rem 0.5rem; vertical-align: middle !important; }
/* Журнал документов — таблица на всю ширину */
#journal-table { min-width: 100%; }
/* Футер приказов — фиксированный порядок кнопок */
.modal-footer.d-flex.justify-content-between { flex-wrap: nowrap; }
/* Панель документов — в одну линию */
.documents-toolbar { min-width: 0; }
.documents-toolbar .btn-group .btn { padding-left: 0.5rem; padding-right: 0.5rem; }
/* Выпадающий список «Новый документ» поверх таблицы */
.documents-toolbar .dropdown .dropdown-menu { z-index: 1090 !important; }
.card:has(.documents-toolbar) { position: relative; z-index: 2; }
.documents-card { position: relative; z-index: 1; }
.documents-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.documents-toolbar .erp-ref-title {
    flex: 0 0 auto;
}
.documents-toolbar .erp-ref-search {
    flex: 1 1 280px;
    min-width: 220px;
}
.documents-toolbar .btn-group {
    flex: 1 1 100%;
    overflow-x: auto;
    display: inline-flex;
    white-space: nowrap;
}
.documents-toolbar .documents-filters .btn-group {
    flex: 0 0 auto;
    overflow-x: visible;
    white-space: normal;
}
.documents-toolbar .dropdown {
    margin-left: auto !important;
    flex: 0 0 auto;
}
.documents-toolbar-divider {
    height: 1px;
    width: 100%;
    background: #e9ecef;
    opacity: 1;
}

.documents-vat-upd-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    justify-content: center;
    overflow: hidden;
}

.documents-vat-upd-badges .badge {
    white-space: nowrap;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.tab-pane { animation: fadeIn 0.3s ease-out; }

/* === Единый блок поиска во всех вкладках === */
.erp-search-block {
    min-width: 280px;
    max-width: 400px;
}
.erp-search-block .input-group-text {
    background: #fff;
    color: #6c757d;
    border-right: 0;
}
.erp-search-block .form-control {
    border-left: 0;
    min-width: 0;
}
.erp-search-block .form-control::placeholder {
    color: #adb5bd;
}
/* Чтобы длинный placeholder не обрезался в узких блоках (МБ-7 и др.) */
.erp-search-block .form-control {
    flex: 1;
    min-width: 180px;
}

/* Badge colors */
.bg-primary { background: linear-gradient(135deg,#3498db,#2980b9)!important; }
.bg-success { background: linear-gradient(135deg,#27ae60,#219653)!important; }
.bg-warning { background: linear-gradient(135deg,#f39c12,#e67e22)!important; }
.bg-danger { background: linear-gradient(135deg,#e74c3c,#c0392b)!important; }
.bg-info { background: linear-gradient(135deg,#17a2b8,#148ea1)!important; }
.bg-secondary { background: linear-gradient(135deg,#7f8c8d,#6c757d)!important; }

/* Cell cards (postamats) */
.cell-card { transition: var(--erp-transition); border-radius: var(--erp-radius); }
.cell-card:hover { transform: translateY(-4px); box-shadow: var(--erp-shadow-3d); }
.cell-occupied { border: 2px solid #27ae60!important; }
.cell-empty { border: 2px solid #95a5a6!important; }

/* Карточка постамата: полоска занятости ячеек */
.postamat-occupancy-bar {
    display: flex;
    width: 100%;
    height: 0.5rem;
    border-radius: 0.25rem;
    overflow: hidden;
    background: #e9ecef;
}
.postamat-occupancy-seg {
    display: block;
    min-width: 0;
    height: 100%;
    transition: width 0.2s ease;
}
.postamat-occupancy-seg--empty { background: #adb5bd; }
.postamat-occupancy-seg--occupied { background: #198754; }
.postamat-occupancy-seg--reserved_laundry_preload { background: #0dcaf0; }
.postamat-occupancy-seg--reserved_factory_preload { background: #ffc107; }
.postamat-occupancy-inner {
    min-height: 2rem;
}
.postamat-occupancy-bar--skeleton {
    background: #e9ecef;
}
.postamat-occupancy-skeleton .small {
    visibility: hidden;
}
.postamat-occupancy-legend {
    line-height: 1.3;
}

.postamat-schematic {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.65rem;
    margin: 0.35rem 0 0.75rem;
    min-height: 4.25rem;
}
.postamat-schematic--empty {
    min-height: 0;
    margin-bottom: 0.5rem;
}
.postamat-schematic-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    max-width: 4.5rem;
}
.postamat-schematic-svg {
    display: block;
    height: 3.5rem;
    width: auto;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}
.postamat-schematic-caption {
    font-size: 0.65rem;
    line-height: 1.15;
    color: #6c757d;
    text-align: center;
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Postamat hub modal */
.postamat-card-body {
    cursor: pointer;
}
.postamat-card-body .btn-group,
.postamat-card-body .btn {
    cursor: pointer;
}
.postamat-card-title {
    cursor: pointer;
}
.postamat-hub-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.postamat-hub-tabs .nav-link {
    font-size: 0.9rem;
}
.postamat-hub-info-value {
    font-size: 0.95rem;
    word-break: break-word;
}
.postamat-hub-schematic-wrap .postamat-schematic-svg {
    height: 4.5rem;
}
.postamat-hub-schematic-wrap--large .postamat-schematic-svg {
    height: 7rem;
}
.postamat-hub-photo {
    max-width: 120px;
    max-height: 90px;
    object-fit: cover;
}
#postamat-hub-state-subtabs .nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

/* Hub — Статистика станции */
.postamat-hub-stats-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.postamat-hub-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.postamat-hub-stats-block {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.65rem;
    background: #fff;
    overflow: hidden;
}
.postamat-hub-stats-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.postamat-hub-stats-block-body {
    padding: 0.85rem 0.9rem 1rem;
}
.postamat-hub-stats-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 5.5rem;
    padding: 0.75rem 1rem;
    text-align: center;
    background: linear-gradient(180deg, #fafbfc, #f3f5f7);
    border-radius: 0.45rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}
.postamat-hub-stats-placeholder-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #868e96;
    font-size: 0.85rem;
}
.postamat-hub-stats-avail {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 28rem;
}
.postamat-hub-stats-avail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.postamat-hub-stats-table-wrap {
    max-height: 16rem;
    overflow: auto;
}
.postamat-hub-stats-lead {
    line-height: 1.45;
    max-width: 52rem;
}
.postamat-hub-stats-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.postamat-hub-stats-kpi {
    min-width: 7.5rem;
    flex: 1 1 7.5rem;
    max-width: 12rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.postamat-hub-stats-kpi-val {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.postamat-hub-stats-trend {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 5.5rem;
    padding: 0.25rem 0;
}
.postamat-hub-stats-trend-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}
.postamat-hub-stats-trend-bar {
    flex: 1;
    width: 100%;
    max-width: 2rem;
    display: flex;
    align-items: flex-end;
    background: #e9ecef;
    border-radius: 0.25rem 0.25rem 0 0;
    overflow: hidden;
}
.postamat-hub-stats-trend-bar > span {
    display: block;
    width: 100%;
    background: linear-gradient(180deg, #74c0fc, #228be6);
    border-radius: 0.25rem 0.25rem 0 0;
}
.postamat-hub-stats-trend-lbl {
    font-size: 0.65rem;
    color: #868e96;
    margin-top: 0.2rem;
}
.postamat-hub-stats-heatmap-wrap {
    overflow-x: auto;
}
.postamat-hub-stats-heatmap {
    display: grid;
    grid-template-columns: 2rem repeat(var(--heat-cols, 16), minmax(0.85rem, 1.1rem));
    gap: 0.15rem;
    width: max-content;
}
.postamat-hub-stats-heatmap-corner,
.postamat-hub-stats-heatmap-h,
.postamat-hub-stats-heatmap-d {
    font-size: 0.62rem;
    color: #868e96;
    text-align: center;
    line-height: 1.1;
}
.postamat-hub-stats-heatmap-d {
    text-align: right;
    padding-right: 0.2rem;
}
.postamat-hub-stats-heat-cell {
    aspect-ratio: 1;
    border-radius: 0.15rem;
    background: #e9ecef;
}
.postamat-hub-stats-heat-cell.is-empty { background: #f1f3f5; }
.postamat-hub-stats-heat-cell.is-low { background: #d0ebff; }
.postamat-hub-stats-heat-cell.is-cool { background: #74c0fc; }
.postamat-hub-stats-heat-cell.is-warm { background: #ffc078; }
.postamat-hub-stats-heat-cell.is-hot { background: #ff6b6b; }
.postamat-hub-stats-module-grid {
    display: grid;
    grid-template-columns: repeat(var(--m-cols, 6), minmax(1.6rem, 2.2rem));
    gap: 0.25rem;
    width: max-content;
    max-width: 100%;
    padding: 0.65rem;
    background: linear-gradient(180deg, #f4f6f9, #eef1f5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.55rem;
}
.postamat-hub-stats-module-col {
    display: grid;
    grid-template-rows: repeat(var(--m-rows, 8), minmax(1.35rem, 1.55rem));
    gap: 0.2rem;
}
.postamat-hub-stats-module-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-size: 0.62rem;
    line-height: 1;
    background: #edf2f7;
    color: #495057;
    min-width: 0;
}
.postamat-hub-stats-module-cell.is-empty { background: #f8f9fa; color: #adb5bd; }
.postamat-hub-stats-module-cell.is-low { background: #d0ebff; color: #1864ab; }
.postamat-hub-stats-module-cell.is-cool { background: #74c0fc; color: #fff; }
.postamat-hub-stats-module-cell.is-warm { background: #ffc078; color: #d9480f; }
.postamat-hub-stats-module-cell.is-hot { background: #ff6b6b; color: #fff; }
.postamat-hub-stats-module-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.65rem;
    background: linear-gradient(180deg, #f4f6f9, #eef1f5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.55rem;
}
.postamat-hub-stats-module-slots .postamat-hub-stats-module-cell {
    width: 2.35rem;
    min-height: 2.35rem;
}
.postamat-hub-stats-module-size {
    font-size: 0.5rem;
    opacity: 0.85;
    font-weight: 600;
}
.postamat-hub-stats-module-n {
    font-weight: 700;
    font-size: 0.68rem;
}
.postamat-hub-stats-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.45rem;
}
.postamat-hub-stats-uptime-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.postamat-hub-stats-uptime-pct {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}
.postamat-hub-stats-uptime-pct-sign {
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0.1rem;
    color: #868e96;
}
.postamat-hub-stats-uptime-now {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 0.4rem;
    background: #f1f3f5;
}
.postamat-hub-stats-uptime-now.is-ok { background: #ebfbee; color: #2b8a3e; }
.postamat-hub-stats-uptime-now.is-degraded { background: #fff9db; color: #e67700; }
.postamat-hub-stats-uptime-now.is-down { background: #fff5f5; color: #c92a2a; }
.postamat-hub-stats-uptime-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: currentColor;
}
.postamat-hub-stats-uptime-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.18rem;
    overflow-x: auto;
    padding: 0.15rem 0;
}
.postamat-hub-stats-uptime-day {
    width: 0.55rem;
    height: 1.65rem;
    border-radius: 0.12rem;
    flex: 0 0 auto;
    display: inline-block;
}
.postamat-hub-stats-uptime-day.is-ok { background: #40c057; }
.postamat-hub-stats-uptime-day.is-degraded { background: #fab005; }
.postamat-hub-stats-uptime-day.is-down { background: #fa5252; }
.postamat-hub-stats-uptime-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
}
.postamat-hub-stats-uptime-legend .postamat-hub-stats-uptime-day {
    height: 0.85rem;
    width: 0.85rem;
    vertical-align: middle;
}

/* State schematic (hub → Состояние → Схема) */
.postamat-state-schematic-root {
    max-width: 100%;
    overflow-x: auto;
}
.postamat-state-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: #6c757d;
}
.postamat-state-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.postamat-state-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid;
}
.postamat-state-section {
    margin-bottom: 1.5rem;
}
.postamat-state-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.postamat-state-cabinets-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
    padding: 0.5rem 0;
}
.postamat-state-cabinets-row--module {
    align-items: flex-start;
    gap: 1.5rem 2rem;
    padding: 0.75rem 0 1rem;
    overflow-x: auto;
}
.postamat-state-cabinet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.postamat-state-cabinet--module {
    gap: 0.5rem;
}
.postamat-state-cabinet-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    max-width: 10rem;
    line-height: 1.25;
}
.postamat-state-cabinet--module .postamat-state-cabinet-label {
    max-width: 12rem;
    font-size: 0.8rem;
}
.postamat-state-svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}
.postamat-state-svg--module {
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.16));
}
.postamat-state-section--module {
    margin-bottom: 2rem;
}
.postamat-state-section--drums {
    opacity: 0.95;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 1rem;
}
.postamat-state-drums-row {
    align-items: flex-start;
    gap: 1.75rem;
}
.postamat-state-cabinet--drum .postamat-state-drum-nav {
    margin-bottom: 0.35rem;
}
.postamat-state-door {
    cursor: help;
    transition: filter 0.12s ease;
}
.postamat-state-door:hover,
.postamat-state-door:focus {
    filter: brightness(1.12);
    outline: none;
}
.postamat-state-drum-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.postamat-hub-header {
    min-height: 2.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.postamat-hub-unit-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
}
.postamat-hub-unit-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.4rem;
    background: #e9ecef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    flex-shrink: 0;
}
.postamat-hub-station-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    padding: 0.75rem 0.25rem 0.5rem;
    min-height: 12rem;
}
.postamat-hub-station-unit {
    appearance: none;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 0.65rem;
    padding: 0.55rem 0.2rem 0.4rem;
    margin: 0;
    cursor: pointer;
    text-align: center;
    color: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    position: relative;
    flex: 0 0 auto;
}
.postamat-hub-station-unit:hover,
.postamat-hub-station-unit:focus-visible {
    outline: none;
    z-index: 2;
    transform: translateY(-6px);
    background: rgba(13, 110, 253, 0.07);
    border-color: rgba(13, 110, 253, 0.4);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.postamat-hub-station-unit--drums {
    cursor: default;
}
.postamat-hub-station-unit--drums .postamat-hub-station-cab {
    cursor: pointer;
    border-radius: 0.35rem;
    transition: transform 0.14s ease, filter 0.14s ease;
}
.postamat-hub-station-unit--drums .postamat-hub-station-cab:hover {
    transform: translateY(-4px);
    filter: brightness(1.05);
}
.postamat-hub-station-unit--drums:hover {
    transform: none;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.postamat-hub-station-unit--vending:hover {
    transform: translateY(-6px);
    background: rgba(13, 110, 253, 0.07);
    border-color: rgba(13, 110, 253, 0.4);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.postamat-hub-station-unit-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.postamat-hub-module-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: center;
    opacity: 0.85;
}
.postamat-hub-station-unit-wrap:hover .postamat-hub-module-tools {
    opacity: 1;
}
.postamat-hub-vending-wrap {
    position: relative;
}
.postamat-hub-vending-cab {
    position: relative;
    display: inline-block;
}
.postamat-hub-vending-hit {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.postamat-hub-vending-hit--left {
    left: 0;
    width: 42%;
}
.postamat-hub-vending-hit--right {
    right: 0;
    width: 42%;
}
.postamat-hub-vending-hit--full {
    inset: 0;
    width: auto;
}
.postamat-hub-vending-hit:hover {
    background: rgba(59, 130, 246, 0.12);
}
.postamat-hub-vending-hit--left:hover {
    border-radius: 0.35rem 0 0 0.35rem;
}
.postamat-hub-vending-hit--right:hover {
    border-radius: 0 0.35rem 0.35rem 0;
}
.postamat-hub-station-unit-cabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
}
.postamat-hub-station-cab .postamat-schematic-svg {
    display: block;
    height: 11rem;
    width: auto;
}
.postamat-hub-station-unit-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.postamat-hub-edit-form-host {
    max-height: min(70vh, 720px);
    overflow: auto;
    padding-right: 0.25rem;
}
.postamat-hub-cfg-section .card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.hub-cfg-tabs .nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}
.hub-cfg-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
}
.hub-cfg-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0;
    font-size: 0.875rem;
}
.hub-cfg-segment-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.hub-cfg-drum-table th,
.hub-cfg-drum-table td {
    text-align: center;
    vertical-align: middle;
    padding: 0.15rem;
}
.hub-cfg-drum-rowh {
    font-size: 0.72rem;
    white-space: nowrap;
}
.hub-cfg-drum-cell {
    display: block;
    width: 2rem;
    height: 2rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}
.hub-cfg-drum-cell--empty { background: #f8f9fa; color: #adb5bd; }
.hub-cfg-drum-cell--block { background: #495057; color: #fff; }
.hub-cfg-drum-cell--stock { background: #fff3cd; color: #856404; cursor: not-allowed; }
.hub-cfg-legend {
    display: inline-block;
    margin-right: 0.75rem;
    font-size: 0.75rem;
}
.hub-cfg-legend--free::before { content: '■'; color: #f8f9fa; border: 1px solid #dee2e6; margin-right: 0.25rem; }
.hub-cfg-legend--block::before { content: '■'; color: #495057; margin-right: 0.25rem; }
.hub-cfg-legend--stock::before { content: '■'; color: #fff3cd; margin-right: 0.25rem; }
.hub-cfg-module-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.hub-cfg-module-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    min-height: 3.5rem;
    border: 2px solid transparent;
    border-radius: 0.35rem;
    background: var(--mc-bg, #334155);
    color: var(--mc-fg, #f1f5f9);
    font-size: 0.65rem;
    line-height: 1.15;
    padding: 0.2rem;
    cursor: pointer;
}
.hub-cfg-module-cell--selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}
.hub-cfg-module-cell--stock {
    opacity: 0.55;
    cursor: not-allowed;
}
.hub-cfg-module-cell-num { font-weight: 700; font-size: 0.75rem; }
.hub-cfg-module-cell-type { font-size: 0.85rem; font-weight: 600; }
.hub-cfg-module-cell-dat { opacity: 0.75; font-size: 0.6rem; }
.hub-cfg-brush-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}
.hub-cfg-brush-btn {
    min-width: 1.75rem;
    height: 1.75rem;
    border: 2px solid transparent;
    border-radius: 0.25rem;
    background: var(--mc-bg);
    color: var(--mc-fg);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.hub-cfg-brush-btn--active {
    border-color: #0d6efd;
}
.postamat-hub-station-unit-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    margin-top: 0.4rem;
    line-height: 1.2;
}
.postamat-hub-station-unit-title {
    font-size: 0.8rem;
    font-weight: 600;
}
.postamat-hub-station-unit-occ {
    font-size: 0.72rem;
    color: #6c757d;
}

/* Unit child modal — contents / history visuals */
#postamatUnitModal .postamat-unit-dialog {
    height: calc(100vh - 1.5rem);
    max-height: calc(100vh - 1.5rem);
    margin: 0.75rem auto;
}
#postamatUnitModal .modal-content {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#postamatUnitModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem 0.5rem;
}
#postamatUnitModal .modal-footer {
    flex: 0 0 auto;
}
.postamat-unit-modal-header {
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 0.75rem;
}
.postamat-unit-modal-heading {
    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    padding-right: 0.35rem;
}
.postamat-unit-modal-identity {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}
.postamat-unit-modal-icon {
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.55rem;
    background: #eef3f8;
    color: #4b5d72;
    font-size: 0.95rem;
}
.postamat-unit-modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}
.postamat-unit-modal-meta {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    max-width: min(100%, 26rem);
    margin-right: 0.35rem;
}
.postamat-unit-snapshot-card {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 9.5rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid #e4e9f0;
    border-radius: 0.55rem;
    background: #f7f9fb;
}
.postamat-unit-snapshot-label {
    color: #8a93a0;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.postamat-unit-snapshot-time {
    color: #1f2d3d;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.postamat-unit-modal-header .btn-close {
    margin: 0.15rem 0 0 0.15rem;
    flex: 0 0 auto;
}
.postamat-unit-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #f1f3f5;
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.postamat-unit-online-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}
.postamat-unit-online-badge.is-online {
    background: #e7f8ed;
    color: #1f7a3d;
}
.postamat-unit-online-badge.is-degraded {
    background: #fff4e0;
    color: #9a6700;
}
.postamat-unit-online-badge.is-offline {
    background: #fdecec;
    color: #b42318;
}
.postamat-unit-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}
.postamat-unit-tabs {
    flex: 0 0 auto;
}
.postamat-unit-tabs .nav-link {
    color: #6b7785;
    font-size: 0.9rem;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 0.55rem 0.85rem;
}
.postamat-unit-tabs .nav-link.active {
    color: #0d6efd;
    background: transparent;
    border-bottom-color: #0d6efd;
    font-weight: 600;
}
.postamat-unit-tab-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.postamat-unit-tab-content > .tab-pane {
    flex: 1 1 auto;
    min-height: 0;
}
.postamat-unit-tab-content > .tab-pane.show.active {
    display: flex !important;
    flex-direction: column;
}
#postamat-unit-pane-now.active {
    overflow: hidden;
}
#postamat-unit-pane-now > [data-unit-contents-root] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
#postamat-unit-pane-signals.active,
#postamat-unit-pane-service.active {
    overflow: auto;
}
#postamat-unit-pane-operations.active {
    overflow: hidden;
}
#postamat-unit-pane-operations > [data-unit-history-root] {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.postamat-unit-contents-root {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.postamat-unit-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    margin: 0.85rem 0 0.75rem;
    flex: 0 0 auto;
}
.postamat-unit-toolbar-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}
.postamat-unit-view-toggle .btn.active {
    color: #0d6efd;
    background: #eef5ff;
    border-color: #0d6efd;
}
.postamat-unit-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    border: 1px solid #e1e6ee;
    border-radius: 999px;
    background: #f7f8fa;
    color: #4b5563;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}
.postamat-unit-chip-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #94a3b8;
}
.postamat-unit-chip.is-ok {
    background: #e9f8ef;
    border-color: #c6ebd4;
    color: #1f7a3d;
}
.postamat-unit-chip.is-ok .postamat-unit-chip-dot {
    background: #22c55e;
}
.postamat-unit-chip.is-warn {
    background: #fff7e8;
    border-color: #f0d9a8;
    color: #9a6700;
}
.postamat-unit-chip.is-warn .postamat-unit-chip-dot {
    background: #f59e0b;
}
.postamat-unit-chip.is-muted .postamat-unit-chip-dot {
    background: #94a3b8;
}
.postamat-unit-toolbar-stat {
    margin-left: auto;
}
.postamat-unit-now-summary {
    display: none;
}
.postamat-unit-collector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.postamat-unit-collector-metric,
.postamat-unit-collector-note {
    display: flex;
    min-height: 9rem;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem;
    border: 1px solid #e1e7ef;
    border-radius: 0.75rem;
    background: #fff;
}
.postamat-unit-collector-value {
    color: #1769c2;
    font-size: 2rem;
    font-weight: 700;
}
.postamat-unit-collector-value--small {
    font-size: 1.15rem;
}
.postamat-unit-collector-label {
    margin-top: 0.2rem;
    color: #6c757d;
    font-size: 0.82rem;
}
.postamat-unit-collector-note {
    grid-column: 1 / -1;
    min-height: auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.65rem;
    background: #f5f9fd;
    color: #526172;
    font-size: 0.84rem;
}
.postamat-unit-service {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 1rem;
}
.postamat-unit-service-card {
    padding: 1.1rem;
    border: 1px solid #e3e8ef;
    border-radius: 0.7rem;
    background: #fff;
}
.postamat-unit-service-card--identity {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8fbff 0%, #fff 70%);
}
.postamat-unit-passport-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.7rem;
}
.postamat-unit-passport-model {
    color: #1f2d3d;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
}
.postamat-unit-passport-vin {
    padding: 0.4rem 0.65rem;
    border: 1px solid #dce6f1;
    border-radius: 0.45rem;
    background: #fff;
    white-space: nowrap;
}
.postamat-unit-section-title {
    margin-bottom: 0.9rem;
    color: #26364a;
    font-size: 0.95rem;
    font-weight: 700;
}
.postamat-unit-passport {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
}
.postamat-unit-passport > div {
    padding: 0.65rem 0;
    border-top: 1px solid #eef1f5;
}
.postamat-unit-passport > div:nth-child(odd) {
    padding-right: 1rem;
}
.postamat-unit-passport dt {
    margin: 0 0 0.2rem;
    color: #858e99;
    font-size: 0.7rem;
    font-weight: 500;
}
.postamat-unit-passport dd {
    margin: 0;
    color: #273444;
    font-size: 0.86rem;
}
.postamat-unit-service-state {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 0.6rem;
    background: #f5f7fa;
}
.postamat-unit-service-icon {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #e4ebf3;
    color: #68798c;
}
.postamat-unit-contents {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.postamat-unit-contents-visual {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 1rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}
.postamat-unit-contents-stage,
.postamat-unit-history-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.75rem 0.85rem;
    background: #f7f9fb;
    border: 1px solid #e6ebf1;
    border-radius: 0.75rem;
    overflow: hidden;
}
.postamat-unit-history-stage {
    min-height: 22rem;
    align-items: center;
    justify-content: center;
}
.postamat-unit-history-stage:not(.postamat-unit-history-stage--drum) {
    align-items: stretch;
    justify-content: flex-start;
}
.postamat-unit-contents.is-visual .postamat-unit-contents-stage {
    flex: 1 1 auto;
}
.postamat-unit-stage-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    margin-bottom: 0.55rem;
}
.postamat-unit-stage-title {
    color: #1f2d3d;
    font-size: 0.92rem;
    font-weight: 650;
}
.postamat-unit-stage-meta {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 0.35rem;
    background: #e8eef5;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 500;
}
.postamat-unit-stage-body {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}
.postamat-unit-visual,
.postamat-unit-visual-row,
.postamat-unit-cabinet {
    height: 100%;
    min-height: 0;
}
.postamat-unit-visual-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 0;
}
.postamat-unit-cabinet {
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.postamat-unit-cabinet .postamat-unit-svg {
    display: block;
    height: 100%;
    width: auto;
    max-width: 100%;
    max-height: 100%;
}
.postamat-unit-history-stage .postamat-unit-visual,
.postamat-unit-history-stage .postamat-unit-visual-row,
.postamat-unit-history-stage .postamat-unit-cabinet {
    height: auto;
    min-height: 0;
    max-height: none;
}
.postamat-unit-history-stage .postamat-unit-visual-row {
    align-items: flex-end;
}
.postamat-unit-history-stage .postamat-unit-cabinet .postamat-unit-svg,
.postamat-unit-cabinet[data-fit="fixed"] .postamat-unit-svg {
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: min(62vh, 560px);
}
.postamat-unit-door.is-dimmed {
    opacity: 0.28;
}
.postamat-unit-door:hover {
    filter: brightness(1.03);
}
.postamat-unit-contents-aside {
    min-height: 0;
    overflow: auto;
}
.postamat-unit-detail {
    height: 100%;
    border: 1px solid #e6ebf1;
    border-radius: 0.75rem;
    padding: 1rem 1.05rem;
    background: #fff;
}
.postamat-unit-detail--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 10rem;
    color: #6c757d;
}
.postamat-unit-lock-wear {
    border: 1px solid #e6ebf1;
    border-radius: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: #f8f9fb;
}
.postamat-unit-lock-wear.is-ok {
    border-color: #b2f2bb;
    background: #ebfbee;
}
.postamat-unit-lock-wear.is-warning {
    border-color: #ffec99;
    background: #fff9db;
}
.postamat-unit-lock-wear.is-danger {
    border-color: #ffc9c9;
    background: #fff5f5;
}
.postamat-unit-lock-wear-title {
    font-weight: 600;
    color: #343a40;
}
.postamat-unit-detail-head {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #eef1f5;
}
.postamat-unit-detail-title {
    color: #1f2d3d;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.4rem;
}
.postamat-unit-state-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.postamat-unit-state-badge.is-empty {
    background: #eef1f4;
    color: #64748b;
}
.postamat-unit-state-badge.is-busy {
    background: #e8f1fb;
    color: #1d4f91;
}
.postamat-unit-state-badge.is-reserved {
    background: #fff4e0;
    color: #9a6700;
}
.postamat-unit-detail-section + .postamat-unit-detail-section {
    margin-top: 1rem;
}
.postamat-unit-detail-section-title {
    margin-bottom: 0.35rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.postamat-unit-detail-dl {
    display: grid;
    gap: 0;
    margin: 0;
}
.postamat-unit-detail-dl > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.55rem 0;
    border-top: 1px solid #eef1f5;
}
.postamat-unit-detail-dl dt {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.postamat-unit-detail-dl dd {
    margin: 0;
    color: #1f2d3d;
    font-size: 0.88rem;
    text-align: right;
    word-break: break-word;
}
.postamat-unit-detail-empty {
    color: #94a3b8;
}
.postamat-unit-table-wrap {
    max-height: min(62vh, 560px);
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
}
@media (max-width: 991.98px) {
    #postamatUnitModal .postamat-unit-dialog {
        height: 100%;
        max-height: 100%;
        margin: 0;
    }
    .postamat-unit-contents-visual {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }
    .postamat-unit-contents-aside {
        max-height: 40vh;
    }
    .postamat-unit-modal-heading {
        flex-direction: column;
        gap: 0.55rem;
    }
    .postamat-unit-modal-meta {
        justify-content: flex-start;
        max-width: none;
        margin-right: 0;
    }
}
.postamat-unit-history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 1rem;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
}
.postamat-unit-history {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}
.postamat-unit-history-aside {
    min-height: 0;
    overflow: auto;
    border: 1px solid #e6ebf1;
    border-radius: 0.75rem;
    padding: 1rem 1.05rem;
    background: #fff;
}
@media (min-width: 992px) {
    .postamat-unit-history-stage .postamat-unit-visual,
    .postamat-unit-history-stage .postamat-unit-visual-row,
    .postamat-unit-history-stage .postamat-unit-cabinet {
        height: 100%;
        max-height: 100%;
    }
    .postamat-unit-history-stage .postamat-unit-visual-row {
        align-items: stretch;
    }
    .postamat-unit-history-stage .postamat-unit-cabinet .postamat-unit-svg {
        height: 100%;
        max-height: 100%;
    }
}
.postamat-unit-insights {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.postamat-unit-insight {
    font-size: 0.82rem;
    line-height: 1.35;
    padding: 0.55rem 0.65rem;
    border-radius: 0.45rem;
    background: #f1f3f5;
}
.postamat-unit-insight--warn {
    background: #fff4e6;
    color: #9c5a00;
}
.postamat-unit-insight--ok {
    background: #ebfbee;
    color: #2b8a3e;
}
.postamat-unit-insight--info {
    background: #e7f5ff;
    color: #1864ab;
}
.postamat-unit-insight--muted {
    background: #f8f9fa;
    color: #495057;
}
.postamat-unit-signal-note {
    margin-bottom: 0.75rem;
    color: #7a8592;
    font-size: 0.7rem;
    line-height: 1.35;
}
.postamat-unit-signals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.postamat-unit-signal {
    display: grid;
    grid-template-columns: 0.65rem minmax(0, 1fr);
    gap: 0.65rem;
    min-height: 8rem;
    padding: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: #fff;
}
.postamat-unit-signal-marker {
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.25rem;
    border-radius: 50%;
    background: #8b96a3;
}
.postamat-unit-signal.is-warning .postamat-unit-signal-marker {
    background: #d98218;
}
.postamat-unit-signal.is-info .postamat-unit-signal-marker {
    background: #2878cf;
}
.postamat-unit-signal.is-muted .postamat-unit-signal-marker {
    background: #8b96a3;
}
.postamat-unit-signal h6 {
    margin: 0 0 0.35rem;
    color: #24364a;
    font-size: 0.92rem;
}
.postamat-unit-signal p {
    margin: 0 0 0.5rem;
    color: #405064;
    font-size: 0.82rem;
    line-height: 1.35;
}
.postamat-unit-signal-meta {
    color: #7a8592;
    font-size: 0.72rem;
}
.postamat-unit-signal-action {
    margin-top: 0.5rem;
    color: #536170;
    font-size: 0.75rem;
    line-height: 1.35;
}
.postamat-unit-history-rank {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.postamat-unit-history-rank-row {
    display: grid;
    grid-template-columns: 2rem 1fr 2rem;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.78rem;
}
.postamat-unit-history-rank-bar {
    height: 0.45rem;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
}
.postamat-unit-history-rank-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #8fc7f7, #2878cf);
    border-radius: 99px;
}
.postamat-unit-history-rank-no {
    font-weight: 600;
    text-align: right;
}
.postamat-unit-heat-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    justify-content: center;
}
.postamat-unit-heat-legend .postamat-hub-heat-swatch.is-warm {
    background: #4f91d5;
}
.postamat-unit-heat-legend .postamat-hub-heat-swatch.is-hot {
    background: #1f5fa7;
}
@media (max-width: 991.98px) {
    #postamat-unit-pane-operations.active {
        overflow: auto;
    }
    #postamat-unit-pane-operations > [data-unit-history-root],
    .postamat-unit-history,
    .postamat-unit-history-layout {
        flex: 0 0 auto;
    }
    .postamat-unit-history-aside {
        overflow: visible;
    }
    .postamat-unit-now-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .postamat-unit-contents-visual,
    .postamat-unit-history-layout,
    .postamat-unit-service {
        grid-template-columns: 1fr;
    }
    .postamat-unit-detail {
        position: static;
    }
}
@media (max-width: 575.98px) {
    .postamat-unit-now-summary,
    .postamat-unit-collector,
    .postamat-unit-passport,
    .postamat-unit-signals {
        grid-template-columns: 1fr;
    }
    .postamat-unit-passport > div:nth-child(odd) {
        padding-right: 0;
    }
}

/* Drum cylinder unwrap (vending contents / history) */
.postamat-unit-contents-stage--drum,
.postamat-unit-history-stage--drum {
    align-items: stretch;
    overflow-x: auto;
}
.postamat-drum-visual {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
}
.postamat-drum-cylinder {
    position: relative;
    border-radius: 1.1rem;
    padding: 0.55rem 0.7rem 0.75rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 28%),
        radial-gradient(ellipse at 18% 40%, rgba(255, 255, 255, 0.35), transparent 42%),
        radial-gradient(ellipse at 82% 55%, rgba(0, 0, 0, 0.12), transparent 45%),
        linear-gradient(90deg, #3a4556 0%, #5a6578 12%, #8a93a3 50%, #5a6578 88%, #3a4556 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 8px rgba(0, 0, 0, 0.18),
        0 10px 28px rgba(15, 23, 42, 0.18);
}
.postamat-drum-cylinder-cap {
    height: 0.55rem;
    margin: 0 0.35rem 0.45rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #2b3340, #6b7585 50%, #2b3340);
    opacity: 0.85;
}
.postamat-drum-cylinder-cap--bottom {
    margin: 0.45rem 0.35rem 0;
}
.postamat-drum-unwrap {
    display: grid;
    grid-template-columns: repeat(var(--drum-cols, 14), minmax(1.55rem, 1fr));
    gap: 0.22rem 0.18rem;
    padding: 0.2rem 0.1rem;
}
.postamat-drum-col {
    display: grid;
    grid-template-rows: repeat(var(--drum-rows, 18), minmax(1.15rem, 1.45rem));
    gap: 0.18rem;
}
.postamat-drum-cell {
    appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 0.28rem;
    padding: 0.08rem 0.1rem;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    cursor: pointer;
    line-height: 1.05;
    background: #edf1f5;
    color: #343a40;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease, opacity 0.15s ease;
}
.postamat-drum-cell:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    z-index: 1;
}
.postamat-drum-cell.is-selected {
    outline: 0;
    filter: brightness(1.08) saturate(1.04);
    box-shadow: inset 0 0 0 1px rgba(40, 120, 207, 0.2);
    z-index: 1;
}
.postamat-drum-cell.is-dimmed {
    opacity: 0.28;
}
.postamat-drum-cell.is-empty {
    background: linear-gradient(180deg, #f8fafc, #e8edf3);
    color: #868e96;
}
.postamat-drum-cell.is-busy {
    background: linear-gradient(180deg, #60a5fa, #3b82f6);
    border-color: rgba(30, 64, 175, 0.35);
    color: #fff;
}
.postamat-drum-cell.is-low {
    background: #dbe4ff;
    color: #364fc7;
}
.postamat-drum-cell.is-cool {
    background: #a5d8ff;
    color: #1864ab;
}
.postamat-drum-cell.is-warm {
    background: #4f91d5;
    color: #fff;
}
.postamat-drum-cell.is-hot {
    background: linear-gradient(180deg, #357dc8, #1f5fa7);
    color: #fff;
    border-color: rgba(23, 75, 145, 0.4);
}
.postamat-drum-cell-no {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.postamat-drum-cell-sub {
    font-size: 0.5rem;
    opacity: 0.9;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.postamat-drum-caption {
    text-align: center;
}

.postamat-hub-history-chart {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px 6px;
    min-height: 110px;
    padding: 0.75rem 0.5rem 0.25rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}
.postamat-hub-history-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 28px;
    gap: 2px;
}
.postamat-hub-history-bar-fill {
    width: 14px;
    background: #74c0fc;
    border-radius: 2px 2px 0 0;
    display: block;
}
.postamat-hub-history-bar-fill.is-low { background: #a5d8ff; }
.postamat-hub-history-bar-fill.is-cool { background: #74c0fc; }
.postamat-hub-history-bar-fill.is-warm { background: #ffc078; }
.postamat-hub-history-bar-fill.is-hot { background: #ff8787; }
.postamat-hub-history-bar-label,
.postamat-hub-history-bar-count {
    font-size: 0.65rem;
    line-height: 1.1;
    color: #6c757d;
}

.postamat-hub-heat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 6px;
    max-width: 520px;
}
.postamat-hub-heat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 0.35rem;
    border: 1px solid rgba(0,0,0,0.06);
    background: #f1f3f5;
    padding: 4px 2px;
}
.postamat-hub-heat-cell.is-empty { background: #f1f3f5; color: #adb5bd; }
.postamat-hub-heat-cell.is-low { background: #e7f5ff; color: #1864ab; }
.postamat-hub-heat-cell.is-cool { background: #a5d8ff; color: #1864ab; }
.postamat-hub-heat-cell.is-warm { background: #ffd8a8; color: #d9480f; }
.postamat-hub-heat-cell.is-hot { background: #ffa8a8; color: #c92a2a; }
.postamat-hub-heat-num {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.1;
}
.postamat-hub-heat-count {
    font-size: 0.7rem;
    opacity: 0.85;
}
.postamat-hub-heat-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}
.postamat-hub-heat-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.08);
    vertical-align: middle;
}
.postamat-hub-heat-swatch.is-empty { background: #f1f3f5; }
.postamat-hub-heat-swatch.is-low { background: #e7f5ff; }
.postamat-hub-heat-swatch.is-cool { background: #a5d8ff; }
.postamat-hub-heat-swatch.is-warm { background: #ffd8a8; }
.postamat-hub-heat-swatch.is-hot { background: #ffa8a8; }
.postamat-history-schematic {
    margin-top: 0.25rem;
}
.postamat-history-schematic-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}
.postamat-history-cabinet {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.postamat-history-cabinet-label {
    font-size: 0.75rem;
    color: #6c757d;
}
.postamat-history-svg {
    display: block;
    max-width: 100%;
    height: auto;
}
.postamat-history-heat-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}

/* Постаматы: парк, новый обзор станции и real-only аналитика */
.postamat-park {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.postamat-park-heading,
.postamat-park-list-card,
.postamat-park-kpi,
.postamat-hub-panel,
.postamat-hub-kpi,
.postamat-passport-section {
    border: 1px solid #e3e8ef;
    box-shadow: 0 2px 10px rgba(32, 50, 68, 0.04);
}
.postamat-park-heading,
.postamat-park-list-card {
    border-radius: 0.75rem;
}
.postamat-park-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.postamat-park-kpi {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.9rem 1rem;
    border-radius: 0.7rem;
    background: #fff;
}
.postamat-park-kpi-icon,
.postamat-hub-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: #eaf3ff;
    color: #1677d2;
}
.postamat-park-kpi-icon.is-success,
.postamat-hub-kpi-icon.is-success {
    background: #e9f8ef;
    color: #20834d;
}
.postamat-park-kpi-icon.is-warning,
.postamat-hub-kpi-icon.is-warning {
    background: #fff4df;
    color: #b76a00;
}
.postamat-park-kpi-icon.is-info,
.postamat-hub-kpi-icon.is-info {
    background: #e8f7fb;
    color: #147d94;
}
.postamat-park-kpi-label,
.postamat-hub-kpi-label {
    color: #66717e;
    font-size: 0.75rem;
    line-height: 1.2;
}
.postamat-park-kpi-value {
    margin-top: 0.15rem;
    color: #1f2d3d;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
}
.postamat-park-kpi-note,
.postamat-hub-kpi-note {
    margin-top: 0.2rem;
    color: #87919d;
    font-size: 0.68rem;
    line-height: 1.25;
}
.postamat-park-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(155px, 200px)) auto;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}
.postamat-park-search {
    position: relative;
}
.postamat-park-search > i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 0.75rem;
    color: #8b96a3;
    transform: translateY(-50%);
    pointer-events: none;
}
.postamat-park-search .form-control {
    padding-left: 2.15rem;
}
.postamat-park-filter-result {
    justify-self: end;
    white-space: nowrap;
}
.postamat-park-table-wrap {
    overflow: visible;
}
.postamat-park-table {
    min-width: 1030px;
    font-size: 0.82rem;
}
.postamat-park-table thead th {
    padding: 0.55rem 0.65rem;
    border-bottom-color: #dfe5ec;
    color: #697481;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.postamat-park-table tbody td {
    padding: 0.7rem 0.65rem;
    border-color: #edf0f4;
}
.postamat-park-row {
    cursor: pointer;
    transition: background-color 0.12s ease;
}
.postamat-park-row:hover {
    background: #f7fbff;
}
.postamat-park-row:focus-visible {
    outline: 2px solid #1683e8;
    outline-offset: -2px;
}
.postamat-park-station-cell {
    width: 27%;
    min-width: 260px;
}
.postamat-park-station-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.45rem;
    background: #eaf3ff;
    color: #1677d2;
}
.postamat-park-station-link {
    max-width: 100%;
    color: #24364a;
    font-size: 0.84rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
}
.postamat-park-station-link:hover {
    color: #0d6efd;
    text-decoration: none;
}
.postamat-park-link-mode {
    display: inline;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
}
.postamat-park-link-mode.is-direct,
.postamat-park-link-mode.is-remote {
    color: #334155;
}
.postamat-module-kind {
    color: #334155;
    font-size: 0.84rem;
    font-weight: 500;
}
.postamat-module-kind.is-cells { color: #1d4f91; }
.postamat-module-kind.is-drum { color: #8a6d1d; }
.postamat-module-kind.is-collector { color: #475569; }
.postamat-module-kind.is-control { color: #0f766e; }
.postamat-module-kind.is-muted { color: #64748b; }
.postamat-module-vin {
    color: #24364a;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.postamat-module-location-link {
    color: #24364a;
    font-size: 0.84rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none !important;
}
.postamat-module-location-link:hover {
    color: #0d6efd;
    text-decoration: none !important;
}
.postamat-park-organization {
    display: block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.postamat-park-health {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.22rem;
}
.postamat-park-state,
.postamat-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.69rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.postamat-park-state {
    padding: 0.3rem 0.5rem;
}
.postamat-park-state-dot,
.postamat-status-chip-dot {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: currentColor;
}
.postamat-park-state.is-success,
.postamat-status-chip.is-success {
    border-color: #b9e6ca;
    background: #edf9f1;
    color: #237b49;
}
.postamat-park-state.is-warning,
.postamat-status-chip.is-warning {
    border-color: #f1d29a;
    background: #fff8e9;
    color: #9b6208;
}
.postamat-park-state.is-danger,
.postamat-status-chip.is-danger {
    border-color: #efb8be;
    background: #fff1f2;
    color: #b13a47;
}
.postamat-park-state.is-muted,
.postamat-status-chip.is-muted {
    border-color: #dce1e7;
    background: #f6f7f9;
    color: #66717e;
}
.postamat-park-freshness,
.postamat-occupancy-meta {
    color: #8a949f;
    font-size: 0.65rem;
    line-height: 1.2;
}
.postamat-park-capacity-cell {
    width: 175px;
}
.postamat-park-capacity-cell .postamat-occupancy-inner {
    min-height: 0;
}
.postamat-park-capacity-cell .postamat-occupancy-bar {
    height: 0.35rem;
}
.postamat-occupancy-meta {
    margin-top: 0.22rem;
}
.postamat-park-metric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.postamat-park-metric strong {
    color: #27384b;
    font-size: 0.92rem;
}
.postamat-park-metric span {
    color: #87919d;
    font-size: 0.65rem;
}
.postamat-park-metric.is-partial span {
    color: #9b6208;
}
.postamat-park-metric.is-missing strong,
.postamat-park-metric.is-missing span {
    color: #929ba5;
}
.postamat-park-signals {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 185px;
}
.postamat-park-signal {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #536170;
    font-size: 0.66rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.postamat-park-signal::before {
    content: "";
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    margin-right: 0.35rem;
    border-radius: 50%;
    background: #9aa4ae;
    vertical-align: 0.05rem;
}
.postamat-park-signal.is-warning::before { background: #e89a22; }
.postamat-park-signal.is-danger::before { background: #dc5260; }
.postamat-row-actions {
    width: 3.25rem;
}
.postamat-row-menu-toggle {
    width: 2rem;
    height: 2rem;
    color: #5e6976;
}
.postamat-row-menu .dropdown-menu {
    z-index: 1080;
    min-width: 13.5rem;
    font-size: 0.8rem;
}

.postamat-hub-header {
    align-items: flex-start;
    min-height: 5.25rem;
    padding: 0.8rem 1rem !important;
}
.postamat-hub-header-main {
    min-width: 0;
}
.postamat-hub-header-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.postamat-status-chip {
    padding: 0.32rem 0.55rem;
}
.postamat-hub-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}
.postamat-hub-kpi {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.75rem;
    border-radius: 0.65rem;
    background: #fff;
}
.postamat-hub-kpi-value {
    margin-top: 0.1rem;
    overflow: hidden;
    color: #213247;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.postamat-hub-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(245px, 0.8fr);
    gap: 0.8rem;
    align-items: stretch;
}
.postamat-hub-panel {
    min-width: 0;
    border-radius: 0.7rem;
    background: #fff;
}
.postamat-hub-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem 0;
}
.postamat-hub-composition-panel {
    overflow: hidden;
}
.postamat-hub-station-row {
    justify-content: flex-start;
    gap: 0.35rem;
    min-height: 10rem;
    padding: 0.65rem 0.85rem 0.8rem;
    scroll-padding-inline: 0.85rem;
    scrollbar-color: #c8d1dc transparent;
    scrollbar-width: thin;
}
.postamat-hub-station-row.is-reordering {
    background: #f7fbff;
}
.postamat-hub-station-unit-wrap {
    flex: 0 0 7.5rem;
}
.postamat-hub-station-unit-wrap:has(.postamat-hub-station-unit--vending) {
    flex-basis: 8.5rem;
}
.postamat-hub-station-unit {
    width: 100%;
    padding-inline: 0.35rem;
}
.postamat-hub-station-cab .postamat-schematic-svg {
    height: 8.25rem;
    max-width: 7.7rem;
}
.postamat-hub-station-unit:hover,
.postamat-hub-station-unit:focus-visible,
.postamat-hub-station-unit--vending:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}
.postamat-hub-module-tools {
    min-height: 1.55rem;
}
.postamat-hub-signals-panel {
    padding-bottom: 0.8rem;
}
.postamat-hub-signal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem 0;
}
.postamat-hub-signal {
    display: grid;
    grid-template-columns: 0.55rem minmax(0, 1fr);
    gap: 0.55rem;
    padding: 0.65rem;
    border: 1px solid #e7ebf0;
    border-radius: 0.55rem;
    background: #fafbfc;
}
.postamat-hub-signal-dot {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.25rem;
    border-radius: 50%;
    background: #9aa4ae;
}
.postamat-hub-signal.is-warning .postamat-hub-signal-dot { background: #e99b24; }
.postamat-hub-signal.is-danger .postamat-hub-signal-dot { background: #dc5260; }
.postamat-hub-signal.is-info .postamat-hub-signal-dot { background: #2786dc; }
.postamat-hub-all-clear {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem;
    color: #267c4b;
}
.postamat-hub-all-clear > i {
    margin-top: 0.15rem;
}
.postamat-hub-uptime-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
}
.postamat-hub-uptime-panel {
    padding: 0.7rem 0.9rem 0.55rem;
}
.postamat-hub-uptime-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.postamat-hub-uptime-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: #677482;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}
.postamat-hub-uptime-status > span {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 50%;
    background: #a4adb7;
}
.postamat-hub-uptime-status.is-online { color: #26824d; }
.postamat-hub-uptime-status.is-online > span { background: #37b24d; }
.postamat-hub-uptime-status.is-degraded { color: #9a7215; }
.postamat-hub-uptime-status.is-degraded > span { background: #f59f00; }
.postamat-hub-uptime-status.is-offline { color: #c23b4a; }
.postamat-hub-uptime-status.is-offline > span { background: #e03131; }
.postamat-hub-uptime-status.is-unknown { color: #7a8592; }
.postamat-hub-uptime-status.is-unknown > span { background: #adb5bd; }
.postamat-hub-uptime-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    margin-top: 0.55rem;
    color: #7a8592;
    font-size: 0.66rem;
}
.postamat-hub-uptime-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.postamat-hub-uptime-legend i {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: #adb5bd;
}
.postamat-hub-uptime-legend .is-online i { background: #40c057; }
.postamat-hub-uptime-legend .is-degraded i { background: #fab005; }
.postamat-hub-uptime-legend .is-incident i { background: #fd7e14; }
.postamat-hub-uptime-legend .is-offline i { background: #fa5252; }
.postamat-hub-uptime-legend .is-unknown i { background: #ced4da; }
.postamat-hub-uptime-bars {
    display: grid;
    grid-template-columns: repeat(90, minmax(0, 1fr));
    gap: 2px;
    height: 1.15rem;
    margin-top: 0.55rem;
}
.postamat-uptime-bar {
    min-width: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    border-radius: 2px;
    background: #ced4da;
    cursor: pointer;
}
.postamat-uptime-bar.is-online { background: #40c057; }
.postamat-uptime-bar.is-degraded { background: #fab005; }
.postamat-uptime-bar.is-incident { background: #fd7e14; }
.postamat-uptime-bar.is-offline { background: #fa5252; }
.postamat-uptime-bar.is-unknown { background: #dee2e6; }
.postamat-uptime-bar.is-selected {
    outline: 2px solid #1c7ed6;
    outline-offset: 1px;
    position: relative;
    z-index: 1;
}
.postamat-hub-uptime-day {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}
.postamat-hub-uptime-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.postamat-hub-uptime-day-title {
    font-weight: 600;
    color: #343a40;
}
.postamat-hub-uptime-day-badge {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #495057;
}
.postamat-hub-uptime-day-badge.is-online { background: #d3f9d8; color: #2b8a3e; }
.postamat-hub-uptime-day-badge.is-degraded { background: #fff3bf; color: #e67700; }
.postamat-hub-uptime-day-badge.is-incident { background: #ffe8cc; color: #d9480f; }
.postamat-hub-uptime-day-badge.is-offline { background: #ffe3e3; color: #c92a2a; }
.postamat-hub-uptime-day-badge.is-unknown { background: #e9ecef; color: #868e96; }
.postamat-hub-uptime-day-meta {
    margin-bottom: 0.45rem;
}
.postamat-hub-uptime-day-events {
    padding-left: 1.1rem;
    margin: 0;
    font-size: 0.82rem;
    color: #495057;
}
.postamat-hub-uptime-day-events li + li {
    margin-top: 0.2rem;
}
.postamat-hub-uptime-axis {
    position: relative;
    height: 1rem;
    margin-top: 0.28rem;
    color: #8a95a1;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.postamat-hub-uptime-axis > span {
    position: absolute;
    top: 0;
    transform: translateX(0);
    white-space: nowrap;
}
.postamat-hub-uptime-axis > span.is-today {
    right: 0;
    left: auto;
    text-transform: none;
    letter-spacing: 0;
}
.postamat-hub-uptime-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.35rem;
    color: #7a8592;
    font-size: 0.68rem;
}
.postamat-hub-uptime-foot strong {
    color: #5c6773;
    font-weight: 600;
    white-space: nowrap;
}
.postamat-hub-uptime-foot > span {
    text-align: right;
}

.postamat-passport {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.postamat-passport-section {
    padding: 0.9rem;
    border-radius: 0.7rem;
    background: #fff;
}
.postamat-passport-section > h6 {
    margin-bottom: 0.8rem;
}
.postamat-passport-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem 1rem;
}
.postamat-passport-field {
    min-width: 0;
}
.postamat-passport-field-label {
    margin-bottom: 0.18rem;
    color: #7a8592;
    font-size: 0.68rem;
}
.postamat-passport-field-value {
    overflow-wrap: anywhere;
    color: #26384c;
    font-size: 0.84rem;
    font-weight: 600;
}
.postamat-passport-field-value.is-empty {
    color: #9aa3ad;
    font-weight: 400;
}

.postamat-data-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.45rem;
    border: 1px solid #dce2e9;
    border-radius: 999px;
    background: #f6f8fa;
    color: #66717e;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
.postamat-data-badge.is-live {
    border-color: #b9e6ca;
    background: #edf9f1;
    color: #237b49;
}
.postamat-data-badge.is-estimate {
    border-color: #f1d29a;
    background: #fff8e9;
    color: #966009;
}
.postamat-data-badge.is-error {
    border-color: #efb8be;
    background: #fff1f2;
    color: #b13a47;
}
.postamat-journal-list {
    display: flex;
    flex-direction: column;
}
.postamat-journal-event {
    display: grid;
    grid-template-columns: 0.8rem minmax(130px, 170px) minmax(0, 1fr) minmax(80px, auto);
    gap: 0.65rem;
    align-items: start;
    padding: 0.75rem 0.25rem;
    border-bottom: 1px solid #e8ecf1;
}
.postamat-journal-marker {
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.25rem;
    border-radius: 50%;
    background: #8b96a3;
}
.postamat-journal-event.is-success .postamat-journal-marker { background: #2e9b5e; }
.postamat-journal-event.is-warning .postamat-journal-marker { background: #e99b24; }
.postamat-journal-event.is-danger .postamat-journal-marker { background: #dc5260; }
.postamat-journal-event.is-primary .postamat-journal-marker { background: #2786dc; }
.postamat-journal-time,
.postamat-journal-source {
    color: #778391;
    font-size: 0.7rem;
}
.postamat-journal-source {
    text-align: right;
}
.postamat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 7rem;
    padding: 1rem;
    border: 1px dashed #d8dee6;
    border-radius: 0.55rem;
    background: #fafbfc;
    color: #75808d;
    text-align: center;
}
.postamat-empty-state > i {
    margin-bottom: 0.45rem;
    color: #9aa4ae;
    font-size: 1.15rem;
}
.postamat-empty-state > strong {
    color: #4d5967;
    font-size: 0.8rem;
}
.postamat-empty-state > span {
    max-width: 28rem;
    margin-top: 0.2rem;
    font-size: 0.7rem;
}

.postamat-hub-stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}
.postamat-hub-stats-kpi-grid .postamat-hub-stats-kpi {
    display: block;
    min-width: 0;
    max-width: none;
    padding: 0.75rem;
    border: 1px solid #e3e8ef;
    border-left: 3px solid #2b82d8;
    border-radius: 0.6rem;
    background: #fff;
}
.postamat-hub-stats-kpi-grid .postamat-hub-stats-kpi.is-warning {
    border-left-color: #e99b24;
}
.postamat-hub-stats-kpi-grid .postamat-hub-stats-kpi.is-danger {
    border-left-color: #dc5260;
}
.postamat-hub-stats-kpi-grid .postamat-hub-stats-kpi.is-muted {
    border-left-color: #a7b0ba;
}
.postamat-hub-stats-kpi-label {
    color: #6f7b88;
    font-size: 0.7rem;
}
.postamat-hub-stats-kpi-value {
    margin-top: 0.18rem;
    color: #23364a;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
}
.postamat-hub-stats-kpi-note {
    margin-top: 0.22rem;
    overflow: hidden;
    color: #8a949f;
    font-size: 0.66rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.postamat-hub-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
.postamat-hub-stats-block--wide {
    grid-column: 1 / -1;
}
.postamat-analytics-operation-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}
.postamat-analytics-operation-summary > div {
    padding: 0.7rem;
    border: 1px solid #e6eaf0;
    border-radius: 0.55rem;
    background: #f9fbfd;
}
.postamat-analytics-operation-value,
.postamat-analytics-lead-value {
    color: #20364d;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.15;
}
.postamat-analytics-rank {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}
.postamat-analytics-rank-row {
    display: grid;
    grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    gap: 0.55rem;
    align-items: center;
    font-size: 0.72rem;
}
.postamat-analytics-rank-cell {
    color: #536170;
    font-weight: 600;
    text-align: right;
}
.postamat-analytics-rank-track {
    height: 0.45rem;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf3;
}
.postamat-analytics-rank-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #3288db;
}
.postamat-analytics-risk-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.postamat-analytics-risk-list > div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.55rem;
    border-radius: 0.4rem;
    background: #fff8e9;
    color: #6f552b;
    font-size: 0.72rem;
}

@media (max-width: 1199.98px) {
    .postamat-park-kpis,
    .postamat-hub-kpis,
    .postamat-hub-stats-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .postamat-hub-overview-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 991.98px) {
    .postamat-park-table-wrap {
        overflow-x: auto;
        overflow-y: hidden;
    }
    .postamat-passport-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .postamat-hub-uptime-row {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 767.98px) {
    .postamat-park-kpis,
    .postamat-hub-kpis,
    .postamat-hub-stats-kpi-grid,
    .postamat-hub-stats-grid,
    .postamat-analytics-operation-summary,
    .postamat-passport-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .postamat-park-filters {
        grid-template-columns: minmax(0, 1fr);
    }
    .postamat-park-filter-result {
        justify-self: start;
    }
    .postamat-unit-passport-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .postamat-unit-passport-vin {
        white-space: normal;
    }
    .postamat-hub-stats-block--wide {
        grid-column: auto;
    }
    .postamat-hub-uptime-bars {
        height: 1rem;
    }
    .postamat-hub-uptime-foot {
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
    }
    .postamat-hub-uptime-legend {
        gap: 0.4rem 0.7rem;
    }
    .postamat-journal-event {
        grid-template-columns: 0.8rem minmax(0, 1fr);
    }
    .postamat-journal-time,
    .postamat-journal-content,
    .postamat-journal-source {
        grid-column: 2;
        text-align: left;
    }
}

/* Modal warehouse fullscreen */
.modal-warehouse-full {
    position: fixed;
    top: var(--erp-shell-top, 56px);
    left: var(--erp-main-left, 16.67%);
    width: var(--erp-main-width, 83.33%);
    height: calc(100vh - var(--erp-shell-top, 56px));
    z-index: 1050;
    display: flex;
    flex-direction: column;
}
.modal-warehouse-full .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.modal-warehouse-full .modal-body {
    flex: 1;
    overflow-y: auto;
}

/* === Правая рабочая панель: одна фиксированная область справа, все модалки открываются в ней === */
.erp-right-panel {
    display: none;
    position: fixed;
    top: var(--erp-shell-top, 56px);
    left: var(--erp-main-left, 16.67%);
    width: var(--erp-main-width, 83.33%);
    height: calc(100vh - var(--erp-shell-top, 56px));
    z-index: 1050;
    pointer-events: none;
}
.erp-right-panel.erp-right-panel--open {
    display: block;
    pointer-events: auto;
}
.erp-right-panel .modal {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    z-index: 1;
}
.erp-right-panel .modal .modal-dialog {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}
.erp-right-panel .modal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.erp-right-panel .modal .modal-body {
    flex: 1;
    overflow-y: auto;
}
.erp-right-panel .modal .modal-backdrop {
    display: none !important;
}

/* Модалки-панели: только правая область, сайдбар остаётся кликабельным */
.modal-panel.modal {
    position: fixed !important;
    z-index: 1060 !important;
    top: 0 !important;
    left: var(--erp-main-left, 16.67%) !important;
    right: auto !important;
    width: var(--erp-main-width, 83.33%) !important;
    bottom: 0 !important;
    margin: 0 !important;
    /* Клики по полоске вкладок (nav z-index 1070) не попадают в Bootstrap hide-on-modal-root */
    pointer-events: none;
}
.modal-panel .modal-dialog {
    position: fixed !important;
    top: var(--erp-shell-top, 42px) !important;
    left: var(--erp-main-left, 16.67%) !important;
    width: var(--erp-main-width, 83.33%) !important;
    max-width: none !important;
    height: calc(100vh - var(--erp-shell-top, 42px)) !important;
    margin: 0 !important;
    z-index: 1061 !important;
    display: flex !important;
    flex-direction: column !important;
    pointer-events: auto;
}
.modal-panel .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.modal-panel .modal-body {
    flex: 1;
    overflow-y: auto;
}
.modal-panel.modal .modal-backdrop {
    display: none !important;
}
/* Дочерние модалки поверх документа (метки, полотенце) — выше shell, ниже полоски вкладок */
.modal-panel.modal[data-erp-modal-tier="child"] {
    z-index: 1072 !important;
}
.modal-panel.modal[data-erp-modal-tier="child"] .modal-dialog {
    z-index: 1073 !important;
}
/* Те же отступы от краёв, что у shell-модалок */
.modal-panel.modal[data-erp-modal-tier="child"] .modal-content {
    border-radius: 0;
    border-top: none;
    box-shadow: none;
}
.modal-panel.modal[data-erp-modal-tier="child"] .modal-header,
.modal-panel.modal[data-erp-modal-tier="child"] .modal-body,
.modal-panel.modal[data-erp-modal-tier="child"] .modal-footer {
    padding-left: var(--erp-shell-inset-x);
    padding-right: var(--erp-shell-inset-x);
}
.modal-panel.modal[data-erp-modal-tier="child"] .modal-header .btn-close {
    margin: 0;
    padding: 0.35rem;
    flex-shrink: 0;
}
.modal-panel.modal[data-erp-modal-tier="child"] .modal-header .modal-header-buttons {
    margin-left: auto;
    margin-right: 0;
    gap: 0.35rem;
    flex-shrink: 0;
}
.modal-panel.modal[data-erp-modal-tier="child"] .modal-header > .btn-close {
    /* если свернуть ещё не обернуло крестик — всё равно справа */
    margin-left: auto;
}

/* Окно входа — поверх любых shell/child модалок, если что-то осталось открытым */
#loginModal.modal {
    z-index: 1100 !important;
}
#loginModal.modal .modal-dialog {
    z-index: 1101 !important;
}

/* Панель свёрнутых модалок: одна строка, как в 1С — полный текст пока влезает, затем сжатие с «…» */
.modal-tabs-bar-inline {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 4px 10px;
    min-height: 34px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.modal-tabs-bar-inline.d-none {
    min-height: 0;
    padding: 0;
}
.modal-tabs-bar-inline .modal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 3.5rem;
    max-width: none;
    padding: 4px 10px;
    background: #eceff1;
    border: 1px solid #b0bec5;
    border-radius: 2px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #263238;
    cursor: pointer;
    transition: background-color 0.08s ease, border-color 0.08s ease;
    min-height: 30px;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: none;
}
.modal-tabs-bar-inline .modal-tab:hover {
    background: #dfe5e8;
    border-color: #90a4ae;
    color: #102027;
}
.modal-tabs-bar-inline .modal-tab--active {
    background: #fff;
    border-color: #78909c;
    border-bottom-color: #fff;
    color: #102027;
    box-shadow: inset 0 -2px 0 #3498db;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}
.modal-tabs-bar-inline .modal-tab--active:hover {
    background: #fff;
    border-color: #607d8b;
}
.modal-tabs-bar-inline .modal-tab .modal-tab-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: inherit;
}
.modal-tabs-bar-inline .modal-tab .modal-tab-close {
    padding: 0 4px;
    margin-right: -2px;
    opacity: 0.75;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 2px;
    color: inherit;
}
.modal-tabs-bar-inline .modal-tab .modal-tab-close:hover {
    opacity: 1;
    color: var(--erp-danger);
    background: rgba(231, 76, 60, 0.12);
}

/* === Единая шапка справочников (без скачка шрифта и поиска) === */
.erp-ref-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    min-height: 2.5rem;
    padding: 0.35rem 0;
    line-height: 1.4;
}
.erp-ref-toolbar .erp-ref-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--bs-secondary);
    margin: 0;
    flex-shrink: 0;
    line-height: inherit;
    align-self: center;
}
.erp-ref-toolbar .erp-ref-search {
    flex: 1 1 240px;
    min-width: min(100%, 200px);
    max-width: 440px;
    width: auto;
}
.erp-ref-toolbar .erp-ref-actions {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.erp-ref-toolbar .form-label.small {
    font-size: 0.8125rem;
    margin: 0;
    flex-shrink: 0;
    line-height: inherit;
}
.erp-ref-toolbar .form-control-sm,
.erp-ref-toolbar input[type="date"] {
    width: 130px;
    min-width: 130px;
    flex-shrink: 0;
}
/* Фильтры документов: typeahead на всю ширину колонки (как был form-select) */
.documents-filters .form-control-sm {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
/* Документооборот: своя плотная панель (кнопки + поиск в одной линии) */
.erp-ref-toolbar.documents-toolbar {
    align-items: center;
}
/* Единая высота карточки-шапки справочников */
.card:has(.erp-ref-toolbar) .card-body { min-height: 2.5rem;
}

/* Alert */
.alert { border-radius: var(--erp-radius); border: none; }

/* Печать личной карточки СИЗ: показываем только контент для печати (не зависит от модалок).
   Не действует при body.erp-printing — иначе Tauri/WebView2 прячет #erp-print-host (квитанции, этикетки). */
.print-only-content { display: none !important; }
@media print {
    body:not(.erp-printing) * { visibility: hidden; }
    body:not(.erp-printing) #print-employee-card,
    body:not(.erp-printing) #print-employee-card * { visibility: visible; }
    body:not(.erp-printing) #print-employee-card {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
        font-size: 12pt;
        background: #fff;
    }
}

@media print {
    .erp-main-tab-content .tab-pane .table-responsive,
    .erp-main-tab-content .tab-pane .documents-table-wrap {
        max-height: none !important;
        overflow: visible !important;
    }
    .erp-main-tab-content .tab-pane .table-responsive thead th,
    .erp-main-tab-content .tab-pane .documents-table-wrap thead th {
        position: static !important;
        box-shadow: none !important;
    }
}

/* Блок типовых размеров в номенклатуре: сетка по порядку, компактно */
.nomenclature-sizes-box {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem 1rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    align-content: start;
}
.nomenclature-sizes-box .form-check {
    margin: 0;
    min-height: auto;
}
.nomenclature-sizes-box .form-check-label {
    font-size: 0.875rem;
}
@media (max-width: 768px) {
    .nomenclature-sizes-box {
        grid-template-columns: repeat(4, 1fr);
    }
    .documents-toolbar {
        align-items: stretch;
    }
    .documents-toolbar .erp-ref-title,
    .documents-toolbar .erp-ref-search,
    .documents-toolbar .dropdown,
    .documents-toolbar .btn-group {
        width: 100%;
        flex: 1 1 100%;
    }
    .documents-toolbar .dropdown .btn {
        width: 100%;
    }
    .documents-card .table-responsive {
        overflow-x: auto;
    }
    .documents-table {
        min-width: 880px;
    }
    /* Номенклатура: контраст заголовка и явная горизонтальная прокрутка таблицы */
    #nomenclature .erp-ref-toolbar .erp-ref-title {
        color: var(--bs-emphasis-color, #212529);
        font-weight: 700;
    }
    #nomenclature .erp-table-scroll-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #nomenclature .erp-table-scroll-wrap .table {
        min-width: 36rem;
    }
    #nomenclature .erp-table-scroll-hint {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        margin: 0 0 0.35rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 500;
        color: #495057;
        background: rgba(13, 110, 253, 0.08);
        border: 1px solid rgba(13, 110, 253, 0.15);
        border-radius: 0.375rem;
    }
}

.erp-sidebar-toggle {
    flex: 0 0 auto;
}

.sidebar.offcanvas-lg .offcanvas-body {
    padding: 0;
}

.sidebar.offcanvas-lg .sidebar-sticky-top,
.sidebar.offcanvas-lg .sidebar-nav-wrap,
.sidebar.offcanvas-lg .sidebar-bottom-dock {
    width: 100%;
}

.sidebar.offcanvas-lg .sidebar-bottom-dock {
    margin-top: auto;
}

@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(320px, 92vw);
        height: 100dvh;
        max-height: 100dvh;
        visibility: hidden;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .sidebar.offcanvas-lg.show {
        visibility: visible;
    }
    .sidebar.offcanvas-lg .sidebar-nav-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* Телефон в альбомной ориентации: компактная шапка сайдбара, больше места для прокрутки вкладок */
@media (max-width: 991.98px) and (orientation: landscape),
       (max-width: 991.98px) and (max-height: 520px) {
    .sidebar.offcanvas-lg .sidebar-header {
        padding: 6px 10px 4px;
    }
    .sidebar.offcanvas-lg .sidebar-header-logo {
        max-height: 26px;
        margin-bottom: 2px;
    }
    .sidebar.offcanvas-lg .sidebar-header small {
        font-size: 0.72rem;
    }
    .sidebar.offcanvas-lg .sidebar-sticky-top > .px-2.pt-2 {
        padding-top: 0.35rem !important;
        padding-bottom: 0.25rem !important;
    }
    .sidebar.offcanvas-lg .navbar-organization-context {
        display: none;
    }
    .sidebar.offcanvas-lg .sidebar-search-wrap {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }
    .sidebar.offcanvas-lg .sidebar-bottom-dock {
        padding-bottom: 2px;
    }
    .sidebar.offcanvas-lg .sidebar-footer.sidebar-footer--dock {
        display: none;
    }
    .sidebar.offcanvas-lg .sidebar-user-dropdown {
        padding: 4px 10px 2px;
    }
    .sidebar.offcanvas-lg .nav-link {
        padding: 6px 12px;
    }
    .sidebar.offcanvas-lg .sidebar-section {
        margin-top: 4px;
    }
    .sidebar.offcanvas-lg .sidebar-section .section-title {
        padding: 4px 12px 2px;
        font-size: 0.68rem;
    }
}

/* Typeahead выбора сотрудника: список под полем ввода */
.employee-typeahead-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.employee-typeahead-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: none;
    background: #fff;
    color: #212529;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.employee-typeahead-item:hover {
    background: #f8f9fa;
}
.employee-typeahead-item--empty,
.employee-typeahead-item--error {
    color: #6c757d;
    cursor: default;
}
.employee-typeahead-item--error {
    color: var(--erp-danger, #e74c3c);
}

/* Список typeahead, прикреплённый к body (всегда поверх модалки) */
.employee-typeahead-list--fixed {
    margin-top: 2px;
}

.typeahead-dropdown-shell {
    display: none;
    flex-direction: column;
}
.typeahead-dropdown-header {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}
.typeahead-dropdown-close-btn {
    display: block;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    line-height: 1.2;
}
.typeahead-dropdown-close-btn:hover,
.typeahead-dropdown-close-btn:focus {
    background: #e9ecef;
    color: #212529;
    outline: none;
}
.typeahead-dropdown-results {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-height: 200px;
}
.typeahead-dropdown-footer {
    flex-shrink: 0;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}
.typeahead-dropdown-create-btn {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #0d6efd;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.typeahead-dropdown-create-btn:hover {
    background: #e9ecef;
    color: #0a58ca;
}

/* Нормы: поле «срок» (число + ед.) — чтобы число не обрезалось */
.norm-period-value {
    min-width: 4rem;
    max-width: 5rem;
}
.input-group .norm-period-unit {
    min-width: 5.5rem;
}

/* Модалки сотрудников: компактные формы (Личные + размеры СИЗ в одной вкладке) */
.erp-employee-form-compact .form-label.small { margin-bottom: 0.2rem; }
.erp-employee-form-compact .row.g-2 .col-md-2 .form-control-sm { max-width: 5rem; }
/* Внутренние вкладки shell-модалки (сотрудник и др.) — под шапкой, не в header */
.modal-panel .erp-modal-shell-subnav.nav-pills .nav-link { font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
}

/* Модалка просмотра сотрудника — компактные блоки как в редактировании */
#viewEmployeeModal .modal-body { font-size: 0.85rem; }
#viewClientModal .modal-body { font-size: 0.85rem; }
.erp-view-employee-compact .text-muted.small { font-size: 0.75rem; margin-bottom: 0.15rem; }
.erp-view-employee-compact .fw-medium { font-weight: 500; }
.erp-view-employee-compact .row.g-2 .col-md-2 span:last-child { min-width: 2.5rem; display: inline-block; }
.erp-view-compact-card {
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(30, 42, 56, 0.08);
    border-radius: 0.65rem;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
#viewEmployeeModal .table-responsive:not(.view-employee-long-siz-table):not(.view-employee-siz-movement-table):not(.fitness-view-tmc-table) { max-height: 18rem; }
#viewClientModal .table-responsive:not(.fitness-view-tmc-table) { max-height: 18rem; }
#viewEmployeeModal .nav-tabs .nav-link { padding: 0.4rem 0.5rem; font-size: 0.875rem; }
#viewClientModal .nav-tabs .nav-link { padding: 0.4rem 0.5rem; font-size: 0.875rem; }

/* Fitness: вкладка "Полотенца на руках" (бывш. ТМЦ) — растянуть таблицу по высоте модалки */
#viewClientModal .fitness-view-tmc-search,
#viewEmployeeModal .fitness-view-tmc-search {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
}
#viewClientModal .fitness-view-tmc-search .form-control,
#viewEmployeeModal .fitness-view-tmc-search .form-control {
    border-left: 0;
}
#viewClientModal .fitness-view-tmc-search .input-group-text,
#viewEmployeeModal .fitness-view-tmc-search .input-group-text {
    border-right: 0;
}
#viewClientModal .fitness-view-tmc-table,
#viewEmployeeModal .fitness-view-tmc-table {
    max-height: calc(100vh - 320px); /* было 18rem глобально */
    overflow: auto;
    border-radius: 0.5rem;
}

/* Выданные СИЗ (просмотр сотрудника): высокая прокрутка без flex на tab-pane */
#viewEmployeeModal .view-employee-long-siz-search {
    width: 100%;
    max-width: 320px;
}
#viewEmployeeModal .view-employee-long-siz-search .form-control {
    border-left: 0;
}
#viewEmployeeModal .view-employee-long-siz-search .input-group-text {
    border-right: 0;
}
#viewEmployeeModal .view-employee-long-siz-table {
    max-height: calc(100vh - 300px);
    min-height: 14rem;
    overflow: auto;
    border-radius: 0.5rem;
}
#viewEmployeeModal .view-employee-long-siz-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    background-clip: padding-box;
}

/* Движение СИЗ (просмотр сотрудника): прокрутка таблицы + итог сразу под последней строкой */
#viewEmployeeModal .view-employee-siz-movement-table {
    max-height: calc(100vh - 300px);
    overflow: auto;
    border-radius: 0.5rem;
}
#viewEmployeeModal .view-employee-siz-movement-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    background-clip: padding-box;
}
#viewEmployeeModal .view-employee-siz-movement-stats {
    padding: 0.35rem 0.5rem 0.5rem;
    border-top: 1px solid rgba(30, 42, 56, 0.08);
    background: #fff;
}

/* Штрихкодирование */
.barcoding-toolbar .dropdown .dropdown-menu {
    z-index: 1090 !important; /* поверх таблицы */
}

.card:has(.barcoding-toolbar) {
    position: relative;
    z-index: 2;
}

/* === Фильтрация полей сотрудников для типа "Фитнес" === */
.fitness-hide {
    display: none !important;
}

/* убираем стрелку */
.btn-no-caret::after {
    display: none !important;
}

/* убираем лишний отступ под стрелку */
.btn-no-caret {
    padding-right: 0.5rem !important;
}

/* Дашборд фитнес: горизонтальные полосы оборота (масштаб = всего в обороте) */
.fitness-bars-compact .fitness-towel-hbar-track {
    height: 34px !important;
}
.fitness-bars-compact {
    display: flex;
    height: 100%;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
.fitness-bars-compact .fitness-towels-bars-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    height: 100%;
}

.fitness-towels-hbars-card .fitness-towel-hbar-track {
    height: 34px;
    background: #f1f3f5;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    position: relative;
}
.fitness-towels-hbars-card .fitness-towel-hbar-fill {
    flex-shrink: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    padding-right: 4px;
    box-sizing: border-box;
    transition: width 0.2s ease;
    position: relative;
    overflow: hidden;
}
.fitness-towels-hbars-card .fitness-towel-hbar-fill .fitness-towel-hbar-fill-label {
    font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    width: 100%;
    text-align: center;
    overflow: hidden;
    pointer-events: none;
}
.fitness-towels-hbars-card .fitness-towel-hbar-fill.is-narrow .fitness-towel-hbar-fill-label {
    font-size: 0.6rem;
    letter-spacing: -0.02em;
}
.fitness-towels-hbars-card .fitness-towel-hbar-rest {
    flex-shrink: 0;
    min-width: 0;
    background: #ced4da;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 6px;
    box-sizing: border-box;
    transition: width 0.2s ease;
}
.fitness-towels-hbars-card .fitness-towel-hbar-rest .fitness-towel-hbar-rest-empty {
    font-size: 0.65rem;
    color: #adb5bd;
    opacity: 0.85;
}
.fitness-towels-hbars-card .fitness-towel-hbar-zero {
    font-size: 0.72rem;
    font-weight: 700;
    color: #868e96;
}
.fitness-towels-hbars-card .fitness-towel-hbar-value {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    line-height: 1;
}
.fitness-towels-hbars-card .fitness-towel-hbar-row-zero .fitness-towel-hbar-rest {
    width: 100% !important;
    background: #dee2e6;
}

/* Отчёты → Комплаенс ОТ: подвкладка «Отчёты и печать» — панель кнопок при прокрутке */
.ot-compliance-sticky-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
}

/* —— Фитнес-дашборд (React) —— */
#dashboard-fitness {
    --fitness-accent: #0d6efd;
    --fitness-accent-soft: rgba(13, 110, 253, 0.1);
    --fitness-surface: #f8f9fa;
    --fitness-card: #ffffff;
    --fitness-ink: #212529;
    /* Шкала эффективности (SVG gradients) — те же hex, что были в JSX */
    --fitness-gauge-track-start: #e9ecef;
    --fitness-gauge-track-end: #dee2e6;
    --fitness-gauge-val-start: #22c55e;
    --fitness-gauge-val-mid: #f59e0b;
    --fitness-gauge-val-end: #ef4444;
    background: var(--fitness-surface);
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem 0.5rem;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
}

/* Компактный дашборд: по возможности без внутреннего скролла */
#dashboard-fitness.fitness-dashboard-root {
    max-height: none;
    overflow: visible;
    padding-bottom: 0.25rem;
}

.fitness-react-mount {
    min-height: 120px;
}

/* Шапка дашборда — как карточка Bootstrap, без тяжёлого градиента */
.fitness-react-shell {
    color: var(--fitness-ink);
}

.fitness-react-hero--soft {
    background: #fff;
    border: 1px solid #dee2e6;
    border-left: 4px solid var(--fitness-accent);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.06);
}

.fitness-react-hero__title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

#dashboard-fitness .fitness-react-hero__title {
    font-size: 1.22rem;
}

#dashboard-fitness .fitness-react-hero__subtitle {
    font-size: 0.92rem !important;
    line-height: 1.4;
}

/* Статистика в нижнем блоке: числа и подписи по центру ячейки прямоугольника */
#dashboard-fitness .fitness-react-hero__stats.row {
    align-items: stretch;
}

#dashboard-fitness .fitness-react-hero__stats > [class*="col-"] {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.75rem;
}

#dashboard-fitness .fitness-react-hero__stats .fitness-hero-stat {
    width: 100%;
    max-width: 100%;
    padding: 0.35rem 0.25rem;
    justify-content: center;
}

.fitness-hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.25rem 0;
}

.fitness-hero-stat__val {
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 800;
    line-height: 1.15;
}

.fitness-hero-stat__lbl {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.2;
}

.fitness-quick-actions {
    max-width: 100%;
}

/* Чуть крупнее зона нажатия, без «стекла» на тёмном фоне */
.fitness-quick-actions .fitness-quick-btn {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem !important;
    border-radius: 0.375rem !important;
}

.letter-spacing-tight {
    letter-spacing: 0.04em;
}

.fitness-metrics-strip .card-header h6 {
    font-size: 0.65rem;
}

.fitness-metric-tile {
    padding: 0.65rem 0.4rem;
    border-radius: 10px;
    background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.fitness-metric-tile__label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #343a40;
    margin-bottom: 0.2rem;
}

.fitness-metric-tile__hint {
    font-size: 0.65rem !important;
    line-height: 1.25;
    margin-bottom: 0.35rem;
}

.fitness-metric-tile__value {
    font-size: clamp(1.35rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1.1;
}

.fitness-dash-toolbar .btn-group .btn {
    border-radius: 0.375rem;
}

.fitness-dash-toolbar .btn-group .btn + .btn {
    margin-left: 2px;
}

#dashboard-fitness .fitness-dashboard-top-row .card {
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    min-height: 260px;
}
@media (max-width: 991.98px) {
    #dashboard-fitness .fitness-dashboard-top-row .card {
        min-height: 220px;
    }
}

.fitness-kpi-card__body {
    min-height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fitness-kpi-card__inner {
    flex: 1 1 auto;
    max-width: none;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.fitness-kpi-card__inner > .col-6 {
    flex: 0 0 50%;
    max-width: 50%;
}
.fitness-kpi-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 0;
    padding: 0.25rem 0;
}

/* Кольца KPI: клиенты (изумруд) / полотенца (синий) */
.fitness-react-shell--compact .fitness-kpi-ring {
    width: min(96px, 38vw);
    height: min(96px, 38vw);
}
.fitness-kpi-ring {
    width: min(168px, 48vw);
    height: min(168px, 48vw);
    max-width: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
}
.fitness-kpi-ring--clients {
    border: 7px solid #10b981;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.fitness-kpi-ring--towels {
    border: 7px solid #1e40af;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.fitness-react-shell--compact .fitness-kpi-ring__value {
    font-size: clamp(1.1rem, 3.5vw, 1.45rem);
}
.fitness-kpi-ring__value {
    font-size: clamp(2.2rem, 5.8vw, 3.2rem);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}
.fitness-react-shell--compact .fitness-kpi-ring-title {
    font-size: 0.65rem;
    margin-top: 0.35rem;
}
.fitness-kpi-ring-title {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #212529;
    margin-top: 1rem;
    margin-bottom: 0.15rem;
}
.fitness-kpi-ring-sub {
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.25;
    color: #6c757d;
    max-width: 160px;
    margin-left: auto;
    margin-right: auto;
}

/* KPI mini block (rewritten) */
.fitness-kpi2-card__body {
    height: 100%;
    display: flex;
    align-items: stretch;
}
.fitness-kpi2-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 6px;
    align-items: center;
}
.fitness-kpi2-item {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.fitness-kpi2-ring {
    width: min(148px, 40vw);
    height: min(148px, 40vw);
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.fitness-kpi2-ring--clients {
    border: 10px solid #10b981;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.fitness-kpi2-ring--towels {
    border: 10px solid #1e40af;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.fitness-kpi2-ring__value {
    font-size: clamp(1.7rem, 4.8vw, 2.4rem);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}
.fitness-kpi2-title {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #343a40;
}

/* Заголовок блока статуса */
.fitness-status-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e9ecef !important;
    border-radius: 10px 10px 0 0;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
}
.fitness-status-header__title {
    font-size: 1.08rem;
    font-weight: 700;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #2f3640;
    margin-left: 10px;
}
.fitness-status-header__hint {
    font-size: 0.65rem !important;
    font-weight: 500;
    line-height: 1.35;
}

/* Станции: звёзды как на макете */
.fitness-stations-card__heading {
    font-size: 0.92rem;
    font-weight: 700;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #495057;
}
.fitness-stations-card .card-body { padding: 0.6rem 0.4rem !important;
    justify-content: space-evenly !important;
}
.fitness-stations-card__star {
    font-size: 1.75rem;
    display: block;
    margin-bottom: 0.45rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}
.fitness-stations-card__star--issue {
    color: #2563eb;
}
.fitness-stations-card__star--return {
    color: #dc2626;
}
.fitness-stations-card__value {
    font-size: clamp(2.1rem, 5.8vw, 3rem);
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}
.fitness-stations-card__caption {
    font-size: 0.82rem;
    font-weight: 500;
    color: #6c757d;
    line-height: 1.2;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}
.fitness-stations-card__block {
    padding: 0.15rem 0.1rem;
}

.fitness-towels-bars-container .fitness-towel-hbar:last-child {
    margin-bottom: 0 !important;
}
.fitness-towels-bars-container .fitness-towel-hbar {
    margin-bottom: 0 !important;
}

.fitness-towels-hbars-card .fitness-towel-hbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fitness-towels-hbars-card .fitness-towel-hbar-label-wrap {
    width: 165px;
    min-width: 165px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin-left: 10px;
}
.fitness-towels-hbars-card .fitness-towel-hbar-row {
    position: relative;
}
.fitness-towels-hbars-card .fitness-towel-hbar-row.has-separator::after {
    content: "";
    position: absolute;
    left: 10px;
    bottom: -4px;
    width: 160px;
    border-bottom: 1px solid #ced4da;
}
@media (max-width: 991.98px) {
    .fitness-towels-hbars-card .fitness-towel-hbar-label-wrap {
        width: 140px;
        min-width: 140px;
    }
}

/* Эффективность + инциденты (фитнес-дашборд) */
#dashboard-fitness .fitness-efficiency-card,
#dashboard-fitness .fitness-incidents-card {
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    height: 320px !important;
    min-height: 320px !important;
}
@media (max-width: 991.98px) {
    #dashboard-fitness .fitness-efficiency-card,
    #dashboard-fitness .fitness-incidents-card {
        height: 300px !important;
        min-height: 300px !important;
    }
}
#dashboard-fitness .fitness-efficiency-card__main-title {
    font-size: 1.42rem;
    font-weight: 700;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #2f3640;
    width: 100%;
    text-align: center;
    transform: translateX(18px);
    margin-top: 0.35rem;
    margin-bottom: 0.8rem !important;
}
#dashboard-fitness .fitness-efficiency-card .card-body {
    position: relative;
}
#dashboard-fitness .fitness-efficiency-gauge {
    max-width: 320px;
    width: 100%;
}

#dashboard-fitness .fitness-react-shell--compact .fitness-efficiency-gauge {
    max-width: 260px;
}
#dashboard-fitness .fitness-efficiency-gauge--v2 {
    max-width: 360px;
    width: 100%;
    transform: translateY(40px) scale(1.3);
    transform-origin: left center;
    margin-left: 60px !important;
    margin-right: 0 !important;
}

.fitness-react-shell--compact .fitness-efficiency-metric__value {
    font-size: clamp(1.35rem, 4vw, 1.85rem) !important;
}

.fitness-react-shell--compact .fitness-efficiency-footer__title--compact {
    font-size: 0.72rem;
    margin-bottom: 0.15rem;
}

.fitness-react-shell--compact .fitness-efficiency-footer__nums {
    font-size: 0.72rem;
    line-height: 1.35;
}

.fitness-react-shell--compact .fitness-incidents-card__icon-wrap {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
}

.fitness-react-shell--compact .fitness-incidents-card__total-num {
    font-size: 1.35rem;
}

.fitness-react-shell--compact .fitness-stations-card__value {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.fitness-react-shell--compact .fitness-stations-card__star {
    font-size: 1rem;
    margin-bottom: 0.15rem;
}
#dashboard-fitness .fitness-efficiency-gauge__svg {
    width: 100%;
    height: auto;
    display: block;
}
#dashboard-fitness .fitness-efficiency-gauge__needle {
    transition: x2 0.35s ease, y2 0.35s ease;
}
#dashboard-fitness .fitness-efficiency-gauge__progress {
    transition: stroke-dasharray 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#dashboard-fitness .fitness-towel-hbar-fill {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
    #dashboard-fitness .fitness-efficiency-gauge__needle,
    #dashboard-fitness .fitness-efficiency-gauge__progress,
    #dashboard-fitness .fitness-towel-hbar-fill {
        transition: none !important;
    }
}
@media (prefers-color-scheme: dark) {
    #dashboard-fitness {
        --fitness-gauge-track-start: #374151;
        --fitness-gauge-track-end: #4b5563;
        --fitness-gauge-val-start: #4ade80;
        --fitness-gauge-val-mid: #fbbf24;
        --fitness-gauge-val-end: #f87171;
    }
}
#dashboard-fitness .fitness-efficiency-metric__value {
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 800;
    line-height: 1;
    color: #dc3545;
}
#dashboard-fitness .fitness-efficiency-metric--norm .fitness-efficiency-metric__value {
    color: #212529;
}
#dashboard-fitness .fitness-efficiency-metric__value--norm {
    color: #212529;
}
#dashboard-fitness .fitness-efficiency-metric__suffix {
    font-size: 1.35rem;
    font-weight: 800;
    vertical-align: top;
}
#dashboard-fitness .fitness-efficiency-metric--excess .fitness-efficiency-metric__suffix {
    color: #dc3545;
}
#dashboard-fitness .fitness-efficiency-metric--norm .fitness-efficiency-metric__suffix {
    color: #212529;
}
#dashboard-fitness .fitness-efficiency-metric__label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 0.35rem;
}
#dashboard-fitness .fitness-efficiency-metric--excess .fitness-efficiency-metric__label {
    color: #dc3545;
}
#dashboard-fitness .fitness-efficiency-metric--ok .fitness-efficiency-metric__value {
    color: #198754;
}
#dashboard-fitness .fitness-efficiency-metric--ok .fitness-efficiency-metric__suffix {
    color: #198754;
}
#dashboard-fitness .fitness-efficiency-metric--ok .fitness-efficiency-metric__label {
    color: #198754;
}
#dashboard-fitness .fitness-efficiency-metric--norm .fitness-efficiency-metric__label {
    color: #6c757d;
}
#dashboard-fitness .fitness-efficiency-metrics-row {
    position: relative;
    justify-content: center;
    gap: 60px;
    transform: translateX(44px) scale(1.7);
    transform-origin: center top;
    margin-top: 10px;
}
#dashboard-fitness .fitness-efficiency-metrics-row::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 1px;
    height: 72%;
    background: #dee2e6;
}
#dashboard-fitness .fitness-efficiency-metrics-col {
    flex: 0 0 auto;
    width: auto;
    padding-left: 4px;
    padding-right: 4px;
}
#dashboard-fitness .fitness-efficiency-note {
    margin-left: 0;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: #495057;
    position: absolute;
    right: 142px;
    bottom: 50px;
    transform: none;
}
#dashboard-fitness .fitness-efficiency-note__text {
    font-size: 1.08rem;
    font-weight: 600;
}
#dashboard-fitness .fitness-efficiency-note__info {
    color: #9ca3af;
    font-size: 0.95rem;
    cursor: pointer;
    line-height: 1;
}
#dashboard-fitness .fitness-efficiency-footer__title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
}
#dashboard-fitness .fitness-efficiency-footer__text {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.4;
}
#dashboard-fitness .fitness-incidents-card__icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(145deg, #ef4444, #dc2626);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.25);
}
#dashboard-fitness .fitness-incidents-card__body {
    gap: 0.2rem;
}
#dashboard-fitness .fitness-incidents-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fecaca;
}
#dashboard-fitness .fitness-incidents-card__title {
    font-size: 1.02rem;
    font-weight: 700;
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #2f3640;
}
#dashboard-fitness .fitness-incidents-card__subtitle {
    font-size: 0.81rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #6c757d;
}
#dashboard-fitness .fitness-incidents-card__kpi-label {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}
#dashboard-fitness .fitness-incidents-card__kpi-value {
    line-height: 1;
    margin: 0.1rem 0 0.15rem;
}
#dashboard-fitness .fitness-incidents-card__kpi-caption {
    font-size: 0.96rem;
    font-weight: 500;
    color: #4b5563;
}
#dashboard-fitness .fitness-incidents-card__total-num {
    font-size: 2.72rem;
    font-weight: 800;
    color: #dc3545;
    margin: 0;
}
#dashboard-fitness .fitness-incidents-card__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}
#dashboard-fitness .fitness-incidents-card__stat-tile {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.4rem 0.45rem;
    text-align: center;
}
#dashboard-fitness .fitness-incidents-card__stat-value {
    font-size: 0.92rem;
    font-weight: 800;
    color: #dc2626;
    line-height: 1.1;
}
#dashboard-fitness .fitness-incidents-card__stat-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #6b7280;
    margin-top: 0.1rem;
}
#dashboard-fitness .fitness-incidents-card__footer-gap {
    height: 2px;
}

#dashboard-fitness .fitness-active-clients-card {
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Подписи строк горизонтальных полос — ближе к макету */
.fitness-towels-hbars-card .fitness-towel-hbar .text-muted.small {
    font-size: 0.8rem !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #343a40 !important;
    margin: 0 !important;
}

/* Единый шрифт для ключевых текстов фитнес-дашборда (без изменения размеров) */
#dashboard-fitness .fitness-kpi2-title,
#dashboard-fitness .fitness-status-header__title,
#dashboard-fitness .fitness-towels-hbars-card .fitness-towel-hbar .text-muted.small,
#dashboard-fitness .fitness-stations-card__heading,
#dashboard-fitness .fitness-efficiency-card__main-title,
#dashboard-fitness .fitness-incidents-card__title,
#dashboard-fitness .fitness-incidents-card__subtitle {
    font-family: Montserrat, Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==================== Инциденты (вкладка) ==================== */
.incidents-table th,
.incidents-table td {
    /* В номенклатуре визуально строки выше из-за экшен-кнопок.
       Для инцидентов задаём такой же "воздух", чтобы строки не казались тоньше. */
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.incidents-table tr.incidents-unread-row > td {
    background-color: rgba(13, 110, 253, 0.06); /* мягкое выделение как "непрочитано" */
    font-weight: 600;
}
.incidents-table tr.incidents-unread-row > td:first-child {
    position: relative;
}
.incidents-table tr.incidents-unread-row > td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #0d6efd; /* bootstrap primary */
    border-radius: 2px;
}
.incidents-table tr.incidents-unread-row:hover > td {
    background-color: rgba(13, 110, 253, 0.10);
}

/* Закрепление категории — форма полотенца (дилер) */
.nom-category-input-group {
    flex-wrap: nowrap;
}
.nom-category-input-group .nom-category-select {
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.nom-category-input-group .nom-category-lock-btn {
    flex-shrink: 0;
    width: 2.125rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
    font-size: 0.8rem;
    line-height: 1;
    z-index: 2;
}
.nom-category-input-group .nom-category-lock-btn:focus {
    z-index: 3;
}
.nom-category-lock-btn--active {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: rgba(13, 110, 253, 0.1);
}
.nom-category-select--locked {
    pointer-events: none;
    background-color: var(--bs-secondary-bg, #e9ecef);
    cursor: not-allowed;
    color: var(--bs-secondary-color);
}
.nom-category-input-group:focus-within .nom-category-select--locked {
    border-color: var(--bs-border-color);
    box-shadow: none;
}

/* Плавающая карточка — быстрое добавление полотенца (дилер) */
.nom-towel-float {
    position: fixed;
    top: 50%;
    left: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 1035;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: min(300px, calc(100vw - 1.5rem));
    padding: 0.625rem 0.75rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(13, 110, 253, 0.35);
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}
.nom-towel-float__close {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    margin-top: 0.1rem;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.2;
}
.nom-towel-float__close i {
    font-size: 0.7rem;
}
.nom-towel-float__close span {
    font-size: 0.72rem;
}
.nom-towel-float__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.nom-towel-float__field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.nom-towel-float__label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--bs-secondary-color, #6c757d);
}
.nom-towel-float__input {
    text-align: left;
    font-size: 1.05rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
}
.nom-towel-float__input.font-monospace {
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}
.nom-towel-float__meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.nom-towel-float__meta .form-select {
    font-size: 0.78rem;
}
.nom-towel-float .nom-category-input-group .nom-category-lock-btn {
    width: 1.85rem;
    font-size: 0.72rem;
}
#quickLaundryBarcodeFloat.nom-towel-float {
    width: min(440px, calc(100vw - 1.5rem));
    padding: 0.85rem 1rem 1rem;
    gap: 0.55rem;
}
#sizLabelCreateFloat.nom-towel-float,
#sizExistingBarcodeFloat.nom-towel-float,
#sizChangeOwnerFloat.nom-towel-float,
#sizInstanceEditFloat.nom-towel-float {
    z-index: 1065;
    width: min(620px, calc(100vw - 1.5rem));
    max-height: min(92vh, 720px);
    padding: 0.95rem 1.1rem 1.05rem;
    gap: 0.6rem;
}
.siz-journal-float__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--bs-body-color, #212529);
}
.siz-journal-float__form {
    max-height: min(58vh, 520px);
    overflow-y: auto;
    gap: 0.5rem;
}
.siz-journal-float .nom-towel-float__label {
    font-size: 0.8rem;
}
.siz-journal-float .form-control {
    font-size: 0.95rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
}
.siz-journal-float .form-control.font-monospace {
    font-size: 0.9rem;
}
.siz-journal-float .nom-towel-float__nav .btn {
    font-size: 0.86rem;
    padding: 0.5rem 0.65rem;
}
.siz-journal-float .nom-towel-float__close {
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
}
.siz-journal-float #siz-label-counterparty-hint,
.siz-journal-float #siz-exist-counterparty-hint,
.siz-journal-float #siz-owner-counterparty-hint,
.siz-journal-float #siz-owner-sides-hint,
.siz-journal-float #siz-edit-counterparty-hint {
    font-size: 0.8rem;
}
#addDocumentModal > #sizLabelCreateFloat.nom-towel-float,
#addDocumentModal > #sizExistingBarcodeFloat.nom-towel-float,
#addDocumentModal > #sizChangeOwnerFloat.nom-towel-float,
#addDocumentModal > #sizInstanceEditFloat.nom-towel-float {
    position: fixed;
}
.nom-towel-float__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}
.nom-towel-float__nav .btn {
    flex: 1 1 0;
    border-radius: 8px;
    font-size: 0.82rem;
    padding: 0.45rem 0.6rem;
}
.nom-towel-float__nav .btn:disabled {
    opacity: 0.45;
}
.nom-towel-float__hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
}
#nomenclature-table tr.nom-row--just-created > td {
    animation: nom-row-created-flash 2.2s ease-out;
}
@keyframes nom-row-created-flash {
    0% { background-color: rgba(25, 135, 84, 0.35); }
    100% { background-color: transparent; }
}

.postamat-map-wrap {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f8f9fa;
}
.postamat-map {
    height: 360px;
    width: 100%;
    z-index: 0;
}
.postamat-address-suggestions-float {
    display: none;
    position: fixed;
    z-index: 2000;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.postamat-address-suggestion-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    background: transparent;
    text-align: left;
    white-space: normal;
    cursor: pointer;
}
.postamat-address-suggestion-item:hover,
.postamat-address-suggestion-item:focus {
    background: rgba(13, 110, 253, 0.08);
}
.postamat-address-suggestion-empty {
    padding: 0.5rem 0.75rem;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.85rem;
}
.postamat-map .leaflet-control-attribution {
    display: none !important;
}
.postamat-address-geocoding {
    background-image: linear-gradient(90deg, rgba(13, 110, 253, 0.06), rgba(13, 110, 253, 0.02));
}
.postamat-image-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Desktop auto-scan (COM + HID wedge): manual «режим скана» buttons are redundant. */
html.erp-desktop-auto-scan #doc-scan-mode-btn,
html.erp-desktop-auto-scan #barcode-fitness-scan-mode-btn,
html.erp-desktop-auto-scan #nom-fitness-scan-mode-btn,
html.erp-desktop-auto-scan #fitness-towel-scan-mode-btn,
html.erp-desktop-auto-scan #barcode-fitness-scan-buffer-hint,
html.erp-desktop-auto-scan #nom-fitness-scan-buffer-hint,
html.erp-desktop-auto-scan #fitness-towel-scan-buffer-hint {
    display: none !important;
}

.desktop-serial-scanner-status {
    position: fixed;
    right: 0.75rem;
    bottom: 0.75rem;
    z-index: 2140;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.35rem 0.6rem;
    border: 1px solid rgba(108, 117, 125, 0.35);
    border-radius: 999px;
    background: rgba(33, 37, 41, 0.92);
    color: #fff;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.18);
    font-size: 0.78rem;
    line-height: 1.2;
}

.desktop-serial-scanner-status.is-connected {
    border-color: rgba(25, 135, 84, 0.7);
    background: rgba(20, 108, 67, 0.94);
}

.desktop-serial-scanner-status.is-waiting {
    border-color: rgba(255, 193, 7, 0.7);
    background: rgba(94, 72, 8, 0.94);
}

.desktop-serial-scanner-status.is-error {
    border-color: rgba(220, 53, 69, 0.75);
    background: rgba(132, 32, 41, 0.94);
}
