/* Глобальные переменные и цветовая палитра (в красно-серых тонах) */
:root {
    --bg-primary: #121214; /* Угольный темно-серый */
    --bg-secondary: #1E1E22; /* Темно-серый для карточек и блоков */
    --bg-tertiary: #2D2D34; /* Для полей ввода и кнопок */
    --accent-color: #DC2626; /* Фирменный красный акцент */
    --accent-hover: #B91C1C;
    --gpa-color: #38BDF8; /* Небесно-голубой цвет для номеров ГЗП */
    --text-primary: #F8FAFC; /* Белый/светло-серый */
    --text-secondary: #94A3B8; /* Приглушенный серый */
    --border-color: #2D2D34;
    --error-color: #EF4444; /* Мягкий красный */
    --success-color: #10B981; /* Мягкий зеленый */
    --warning-color: #F59E0B; /* Мягкий оранжевый */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Общие стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Стилизация скроллбаров */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--bg-tertiary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) transparent;
}

/* Стили авторизации */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 5px;
}

/* Формы */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="number"],
input[type="email"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
    font-family: var(--font-family);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--error-color);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-large {
    padding: 16px 20px;
    font-size: 16px;
}

/* Ошибки */
.error-message {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 24px;
    text-align: center;
}

/* Мобильный интерфейс инженера */
.mobile-body {
    background-color: var(--bg-primary);
    min-height: 100vh;
    padding-bottom: 30px;
}

.mobile-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    min-height: 60px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    z-index: 1000;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.header-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-mobile-nav {
    width: auto;
    height: 32px;
    font-size: 13px;
    font-weight: 500;
    padding: 0 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-mobile-nav-logout {
    width: auto;
    height: 32px;
    font-size: 13px;
    font-weight: 600;
    padding: 0 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-back {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    height: 44px;
    min-width: 44px;
    padding: 0 12px 0 0;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.user-id {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.btn-logout {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
}


.mobile-content {
    padding: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.scanner-section, .manual-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

/* QR Сканер контейнер */
.qr-reader-container {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 16px auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background-color: #000000;
}

#reader__scan_region video {
    border-radius: 10px;
    object-fit: contain !important;
}

.divider {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin: 20px 0;
    position: relative;
}

.divider::before, .divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--border-color);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

/* Автоподбор инвентарных номеров */
.search-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 6px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    min-height: 48px; /* Touch target */
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--bg-tertiary);
}

.autocomplete-no-results {
    padding: 16px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 14px;
}

.item-info {
    display: flex;
    flex-direction: column;
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.item-inv {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Статусы-бейджи */
.status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge-free {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-badge-busy {
    background-color: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

.status-badge-damaged {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
}

.status-badge-maintenance {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

/* Карточка СНО */
.equipment-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.eq-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.eq-type-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.eq-name-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.eq-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.eq-inv-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.eq-info-block {
    margin-bottom: 24px;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Баннеры текущих владельцев СНО */
.current-holder-banner {
    padding: 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.info-holder-own {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--text-primary);
}

.info-holder-other {
    background-color: rgba(220, 38, 38, 0.1);
    border-left: 4px solid var(--accent-color);
    color: var(--text-primary);
}

.info-holder-damaged {
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
    color: var(--text-primary);
}

.holder-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.holder-detail {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.holder-detail strong {
    color: var(--text-primary);
}

/* Дашборд Склада */
.dashboard-body {
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Ограничиваем высоту и скрываем скроллбары страницы только для дашборда на десктопах */
body:has(.dashboard-layout) {
    height: 100vh;
    overflow: hidden;
}

.dashboard-header {
    height: 60px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.dashboard-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.85;
}

.logo-badge {
    background-color: var(--accent-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-user {
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-header-action {
    padding: 6px 12px;
    font-size: 13px;
    width: auto;
    font-weight: 500;
    height: 32px;
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
}

.btn-header-action:hover {
    background-color: #475569;
}

.btn-header-logout {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-tertiary);
    height: 32px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.btn-header-logout:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-header-home {
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-header-home:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(88, 166, 255, 0.1);
}

.btn-header-home .home-arrow {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.btn-header-home:hover .home-arrow {
    transform: translateX(-2px);
}

.dashboard-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 60px);
    overflow: hidden;
    flex: 1;
}

/* Специальные переопределения для элементов дашборда, чтобы они скроллились вертикально и вписывались в экран */
.dashboard-layout .db-table-section {
    height: 100%;
}

.dashboard-layout .table-wrapper {
    height: 0;
}

.dashboard-layout .db-log-aside {
    height: 100%;
}

.dashboard-layout .aside-queue-widget {
    height: 100%;
    min-height: 0;
}

.dashboard-layout .aside-tab-pane {
    height: 100%;
    min-height: 0;
}

/* Левая секция - Таблица СНО */
.db-table-section {
    flex: 1;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.db-section-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
    flex-shrink: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.db-section-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.db-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    min-width: 0;
    word-break: break-word;
}

.db-status-summary {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.summary-item strong {
    color: var(--text-primary);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-free { background-color: var(--success-color); }
.dot-busy { background-color: var(--accent-color); }
.dot-labeled { background-color: #38bdf8; }

.db-admin-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.db-admin-actions .btn {
    padding: 8px 14px;
    font-size: 13px;
    width: auto;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    box-sizing: border-box;
    flex: 0 1 auto;
}

.btn-checkout-accent {
    color: var(--text-primary) !important;
}

.table-wrapper {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 0;
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.db-table th {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.db-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.db-table td.col-inv_number {
    white-space: nowrap;
}

.db-table tbody tr:last-child td {
    border-bottom: none;
}

.db-table tbody tr:hover {
    background-color: rgba(51, 65, 85, 0.3);
}

.table-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0 !important;
}

/* Правая секция - Оперативные задачи (Возвраты, Поломки, Заявки) */
.db-log-aside {
    width: 380px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 0;
}

.aside-queue-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.aside-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.aside-tabs-header {
    display: flex;
    gap: 4px;
    background-color: var(--bg-primary);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 14px;
    flex-shrink: 0;
}

.aside-tab-btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    user-select: none;
}

.aside-tab-btn:hover {
    color: var(--text-primary);
}

.aside-tab-btn.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.aside-tab-pane {
    flex: 1;
    height: 100%;
    min-height: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.aside-tab-pane.active {
    display: flex !important;
}

.pending-returns-container,
.active-issues-container,
.active-prep-container,
.active-orders-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.pending-returns-empty,
.active-issues-empty,
.active-prep-empty,
.active-orders-empty {
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    padding: 20px 16px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    text-align: center;
    margin: 4px 0 0 0;
}

/* Карточки оперативных задач (Возвраты, Поломки, Подготовка, Заявки) */
.pending-return-card,
.active-issue-card,
.active-prep-card,
.active-order-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideInRight 0.3s ease-out;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    user-select: none;
    position: relative;
}

.pending-return-card:hover,
.active-issue-card:hover,
.active-prep-card:hover,
.active-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    background-color: #32323a;
    border-color: rgba(255, 255, 255, 0.16);
}

.pending-return-card:active,
.active-issue-card:active,
.active-prep-card:active,
.active-order-card:active {
    transform: translateY(0);
}

.pending-return-card {
    border-left: 4px solid #f59e0b;
}

.active-issue-card {
    border-left: 4px solid var(--error-color);
}

.active-prep-card {
    border-left: 4px solid #f59e0b;
}

.active-prep-card.status-ready {
    border-left: 4px solid #10b981;
}

.active-order-card.status-ordered {
    border-left: 4px solid #38bdf8;
}

.active-order-card.status-pending {
    border-left: 4px solid #f59e0b;
}

.pending-return-card .card-header,
.active-issue-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pending-return-card .action-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f59e0b;
}

.active-issue-card .action-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--error-color);
}

.pending-return-card .btn-confirm {
    margin-top: 4px;
    width: 100%;
    background-color: var(--success-color);
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 38px;
}

.pending-return-card .btn-confirm:hover {
    background-color: #059669;
}

.pending-return-card .btn-confirm:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.active-issue-card .btn-resolve {
    margin-top: 4px;
    width: 100%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    min-height: 38px;
}

.active-issue-card .btn-resolve:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: #ffffff;
}

.active-issue-card .btn-resolve:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Кнопки действий карточек подготовки материалов */
.active-prep-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 6px;
}

.active-prep-card .btn-prep-ready {
    flex: 1;
    min-height: 40px;
    background-color: #0284c7;
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.3;
    transition: background-color 0.2s, transform 0.1s;
}

.active-prep-card .btn-prep-ready:hover {
    background-color: #0369a1;
}

.active-prep-card .btn-prep-ready:active {
    transform: scale(0.98);
}

.active-prep-card .btn-prep-complete {
    flex: 1;
    min-height: 40px;
    background-color: var(--success-color);
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    line-height: 1.3;
    transition: background-color 0.2s, transform 0.1s;
}

.active-prep-card .btn-prep-complete:hover {
    background-color: #059669;
}

.active-prep-card .btn-prep-complete:active {
    transform: scale(0.98);
}

.active-prep-card .btn-prep-cancel-wh {
    width: 40px;
    min-width: 40px;
    height: 40px;
    flex: 0 0 40px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
}

.active-prep-card .btn-prep-cancel-wh:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
}

.active-prep-card .btn-prep-cancel-wh:active {
    transform: scale(0.95);
}

/* Стили модального окна подробностей задачи */
.queue-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    background-color: var(--bg-primary);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.queue-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.queue-detail-item.full-width {
    grid-column: span 2;
}

.queue-detail-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.queue-detail-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.queue-detail-block {
    background-color: var(--bg-primary);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.queue-detail-block-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.queue-detail-desc {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    background-color: var(--bg-tertiary);
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.queue-detail-link {
    font-size: 13px;
    color: var(--gpa-color);
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    word-break: break-all;
}

.queue-detail-link:hover {
    color: #7dd3fc;
}

/* Анимации */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes rowFlash {
    0% {
        background-color: rgba(14, 165, 233, 0.25);
    }
    100% {
        background-color: transparent;
    }
}

.row-highlight td {
    animation: rowFlash 2.5s ease-out;
}

/* Карточки СНО на мобильном дашборде */
.equipment-cards-container {
    display: none;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

.equipment-card-mobile {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.equipment-card-mobile.status-border-free {
    border-left: 4px solid var(--success-color);
}
.equipment-card-mobile.status-border-busy {
    border-left: 4px solid var(--accent-color);
}
.equipment-card-mobile.status-border-returning {
    border-left: 4px solid var(--warning-color);
}
.equipment-card-mobile.status-border-damaged {
    border-left: 4px solid var(--error-color);
}
.equipment-card-mobile.status-border-maintenance {
    border-left: 4px solid var(--warning-color);
}

.eq-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.eq-card-inv {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.eq-card-name {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.eq-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    font-size: 13px;
}

.eq-card-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eq-card-item.full-width {
    grid-column: span 2;
}

.eq-card-label {
    color: var(--text-secondary);
    font-size: 11px;
}

.eq-card-value {
    font-weight: 500;
    color: var(--text-primary);
}

.eq-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.eq-card-actions .btn {
    flex: 1;
    min-width: 100px;
    height: 44px;
    font-size: 13px;
    padding: 0 10px;
    margin: 0 !important;
}

/* Адаптивность для экранов мобильных устройств и планшетов */
@media (max-width: 768px) {
    body:has(.dashboard-layout),
    .dashboard-body {
        overflow: visible !important;
        height: auto !important;
    }

    /* Мобильная шапка */
    .mobile-header {
        position: sticky;
        top: 0;
        padding: 8px 12px;
        min-height: 56px;
    }

    .header-top-row {
        width: 100%;
        min-height: 44px;
        height: auto;
        margin-right: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        justify-content: space-between;
    }

    .header-actions-row {
        width: 100%;
        margin-top: 8px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .btn-mobile-nav {
        flex: 1 1 auto;
        min-width: 80px;
        height: 44px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        padding: 0 10px !important;
        border-radius: 8px !important;
    }

    .btn-mobile-nav-logout {
        flex: 1 1 auto;
        min-width: 80px;
        height: 44px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        padding: 0 10px !important;
        border-radius: 8px !important;
    }

    .btn-back {
        height: 44px !important;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Шапка дашборда на мобильных */
    .dashboard-header {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px;
        gap: 12px;
    }

    .dashboard-header-left {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }

    .logo-area {
        width: auto;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-header-home {
        height: 38px;
        padding: 6px 12px;
        font-size: 13px;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
    }

    .dashboard-user {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .dashboard-user-actions {
        display: flex;
        gap: 8px;
        width: 100%;
        flex-wrap: wrap;
    }

    .dashboard-user-actions .btn-header-action,
    .dashboard-user-actions .btn-header-logout {
        flex: 1 1 auto;
        min-width: 110px;
        justify-content: center;
        height: 44px !important;
        font-size: 13px !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        box-sizing: border-box;
    }

    .dashboard-user-actions .btn-push-bell {
        width: 44px !important;
        height: 44px !important;
        flex-shrink: 0;
    }

    /* Расположение колонок и сброс высот */
    .dashboard-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 12px;
        gap: 16px;
    }

    .dashboard-layout .db-table-section {
        height: auto;
        overflow: visible;
    }

    .dashboard-layout .table-wrapper {
        height: auto;
        overflow: visible;
    }

    .dashboard-layout .db-log-aside {
        height: auto;
        overflow: visible;
    }

    .dashboard-layout .log-feed-container {
        height: auto;
        max-height: 350px;
        overflow-y: auto;
    }

    /* Секция таблицы СНО */
    .db-table-section {
        padding: 16px;
        height: auto;
        overflow: visible;
    }

    .db-table-section .table-wrapper {
        display: none !important; /* Полностью скрываем громоздкую таблицу СНО на мобильных */
    }

    .equipment-cards-container {
        display: flex; /* Показываем карточки вместо таблицы */
        padding-bottom: 75px; /* Запас места под плавающую панель действий */
    }

    /* Мобильная панель быстрого выбора всех СНО */
    .mobile-cards-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .mobile-select-all-label {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        color: var(--text-primary);
        user-select: none;
    }

    /* Стили шапки мобильной карточки и чекбокса */
    .eq-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 12px;
    }

    .eq-card-header-left {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    .eq-card-checkbox-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 36px;
        min-height: 36px;
        margin: -6px -4px -6px -6px;
        cursor: pointer;
        user-select: none;
        flex-shrink: 0;
    }

    .eq-card-checkbox-label .eq-card-checkbox {
        width: 20px;
        height: 20px;
    }

    .eq-card-title-group {
        flex: 1;
        min-width: 0;
    }

    /* Подсветка выбранной карточки СНО */
    .equipment-card-mobile.card-selected {
        background-color: rgba(220, 38, 38, 0.08) !important;
        border-color: rgba(220, 38, 38, 0.6) !important;
        box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.4);
    }

    /* Плавающая панель пакетных действий внизу экрана на мобильных */
    .batch-action-bar {
        position: fixed !important;
        bottom: 16px !important;
        left: 16px !important;
        right: 16px !important;
        z-index: 1050;
        margin: 0 !important;
        padding: 10px 14px !important;
        border-radius: 12px !important;
        background: rgba(22, 27, 34, 0.96) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(220, 38, 38, 0.5) !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .batch-bar-left {
        font-size: 12px;
        font-weight: 600;
        gap: 8px;
    }

    .batch-bar-badge {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .batch-bar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .batch-bar-actions .btn {
        height: 40px !important;
        padding: 6px 14px !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .db-section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
        width: 100%;
        min-width: 0;
    }

    .db-section-header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        min-width: 0;
    }

    .db-status-summary {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .db-admin-actions {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .db-admin-actions .dropdown-wrapper,
    .db-admin-actions .dropdown-data-wrapper {
        width: 100% !important;
        min-width: 0 !important;
    }

    .db-admin-actions .btn,
    .db-admin-actions a.btn,
    .db-admin-actions button.btn {
        width: 100% !important;
        min-width: 0 !important;
        justify-content: center !important;
        padding: 8px 10px !important;
        font-size: 13px !important;
        height: 42px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    /* Выпадающий список колонок и меню данных на весь экран по ширине */
    .dropdown-menu-custom,
    .dropdown-data-menu {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        box-sizing: border-box;
    }

    /* Правая колонка с лентой событий */
    .db-log-aside {
        width: 100%;
        height: auto;
        padding: 16px;
        overflow: visible;
    }

    .log-feed-container {
        max-height: 350px; /* Ограничиваем высоту ленты на мобильном, чтобы она не растягивала страницу */
        overflow-y: auto;
    }

    /* Предотвращение автозума на iOS */
    input[type="text"],
    input[type="password"],
    input[type="date"],
    input[type="url"],
    input[type="search"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Адаптивность карточки СНО и контента */
    .mobile-content {
        padding: 12px;
    }

    .equipment-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    .eq-name-title {
        font-size: 18px !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .eq-meta-row {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .my-eq-item {
        padding: 12px;
        gap: 10px;
    }

    .my-eq-info {
        min-width: 0;
        overflow: hidden;
        padding-right: 8px;
    }

    .my-eq-name {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .my-eq-meta {
        word-break: break-word;
    }

    .btn-return-quick {
        min-height: 44px !important;
        height: 44px !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
        flex-shrink: 0;
    }

    .btn-text-action {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
    }

    .btn-order-cancel {
        min-height: 36px;
        padding: 6px 12px;
        display: inline-flex;
        align-items: center;
    }

    /* Адаптивность модальных окон */
    .modal-overlay {
        padding: 12px;
        align-items: center;
    }

    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        max-height: calc(100vh - 24px) !important;
        margin: auto !important;
        padding: 18px 16px !important;
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-actions .btn {
        width: 100% !important;
        height: 44px;
    }

    /* Адаптивная сетка для модального окна печати СНО */
    .modal-print-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        flex-direction: unset !important;
        gap: 8px !important;
    }

    .modal-print-actions .btn {
        width: 100% !important;
        min-width: 0 !important;
        height: 44px !important;
        font-size: 12px !important;
        padding: 6px 8px !important;
    }

    .modal-print-zpl-group {
        grid-column: span 2;
        width: 100%;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sticker-preview {
        max-width: 100% !important;
    }

    .pending-return-card .btn-confirm,
    .active-issue-card .btn-resolve {
        min-height: 44px;
        font-size: 14px;
    }
}

/* Стили для логотипа компании */
.company-logo {
    max-width: 160px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.header-logo-wrapper:hover {
    opacity: 0.85;
}

.header-logo {
    max-height: 30px;
    width: auto;
    object-fit: contain;
}

.dashboard-logo {
    max-height: 32px;
    width: auto;
    object-fit: contain;
    margin-right: 10px;
}

/* Сно в работе у инженера */
.my-equipment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.my-eq-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-eq-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-right: 12px;
    min-width: 0;
    overflow: hidden;
}

/* Стили для модальных окон (редактирование СНО) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.65);
    display: none; /* Скрыто по умолчанию */
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.25s ease-out;
    margin: auto;
    box-sizing: border-box;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    border-radius: 8px;
    transition: color 0.15s, background-color 0.15s;
}

.modal-close-close:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-form input[type="text"],
.modal-form input[type="password"],
.modal-form input[type="url"],
.modal-form input[type="date"],
.modal-form input[type="number"],
.modal-form input[type="email"],
.modal-form textarea,
.modal-form select {
    width: 100%;
    height: 44px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    color-scheme: dark;
    cursor: pointer;
}

.modal-form select option,
select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.modal-form input:focus,
.modal-form textarea:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Адаптивный текст для кнопок на мобильных */
.mobile-text {
    display: none;
}

@media (max-width: 480px) {
    .desktop-text {
        display: none;
    }
    .mobile-text {
        display: inline;
    }
    .user-info .user-name {
        display: none;
    }

    .dashboard-header-left {
        gap: 8px;
    }

    .logo-badge {
        font-size: 11px;
        padding: 2px 6px;
    }

    .btn-header-home {
        height: 34px;
        padding: 4px 8px;
        font-size: 12px;
    }

    .header-user-actions {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .batch-action-bar {
        bottom: 12px !important;
        left: 10px !important;
        right: 10px !important;
        padding: 8px 12px !important;
        gap: 6px;
    }

    .batch-bar-left {
        font-size: 11px;
    }

    .batch-bar-actions .btn {
        height: 36px !important;
        padding: 4px 10px !important;
        font-size: 12px !important;
    }

    .push-modal-box {
        width: calc(100% - 24px) !important;
        padding: 16px 14px !important;
    }

    .modal-print-actions .btn {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }

    .login-body {
        padding: 12px !important;
    }

    .login-card {
        padding: 24px 18px !important;
        border-radius: 12px !important;
    }

    .equipment-card {
        padding: 14px !important;
    }

    .dashboard-user-actions .btn-header-action,
    .dashboard-user-actions .btn-header-logout {
        flex: 1 1 100%;
        width: 100%;
    }

    .db-admin-actions {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .db-admin-actions .btn,
    .db-admin-actions a.btn,
    .db-admin-actions button.btn {
        height: 38px !important;
        font-size: 12px !important;
        padding: 0 6px !important;
    }
}

/* Настройка видимости колонок таблицы */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu-custom {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    z-index: 1000;
    min-width: 260px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.dropdown-menu-custom.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-column-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
    min-height: 44px; /* Touch target (Mobile First) */
}

.dropdown-item:hover {
    background-color: var(--bg-tertiary);
}

.dropdown-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Скрытие колонок таблицы */
.db-table.hide-col-inv_number .col-inv_number { display: none; }
.db-table.hide-col-is_labeled .col-is_labeled { display: none; }
.db-table.hide-col-name .col-name { display: none; }
.db-table.hide-col-type .col-type { display: none; }
.db-table.hide-col-factory_number .col-factory_number { display: none; }
.db-table.hide-col-serial_number .col-serial_number { display: none; }
.db-table.hide-col-batch_number .col-batch_number { display: none; }
.db-table.hide-col-status .col-status { display: none; }
.db-table.hide-col-location .col-location { display: none; }
.db-table.hide-col-current_user .col-current_user { display: none; }
.db-table.hide-col-current_aircraft .col-current_aircraft { display: none; }
.db-table.hide-col-last_inspection_date .col-last_inspection_date { display: none; }

/* Чекбокс маркировки (этикетка) */
.eq-label-checkbox:checked {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}
.eq-label-checkbox:hover {
    border-color: var(--success-color) !important;
    background-color: rgba(35, 134, 54, 0.15) !important;
    box-shadow: 0 0 0 3px rgba(35, 134, 54, 0.25) !important;
}

/* Компактная кнопка меню маркировки и радио-фильтры */
.btn-label-menu-toggle {
    transition: all 0.2s ease;
}
.btn-label-menu-toggle.filter-active {
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.12) !important;
}
.dropdown-item input[type="radio"] {
    accent-color: var(--accent-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}


/* Стили для карточек активных неисправностей СНО */
.active-issue-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--error-color);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: slideInRight 0.3s ease-out;
}

.active-issue-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.active-issue-card .action-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--error-color);
}

.active-issue-card .btn-resolve {
    margin-top: 4px;
    width: 100%;
    background-color: var(--success-color);
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-issue-card .btn-resolve:hover {
    background-color: #059669;
}

.active-issue-card .btn-resolve:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

/* Панель поиска и фильтрации */
.db-filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.db-filter-bar .filter-search-wrapper {
    flex: 2;
    min-width: 250px;
}

.db-filter-bar .filter-select-wrapper {
    flex: 1;
    min-width: 160px;
}

.db-filter-bar input[type="text"],
.db-filter-bar select {
    width: 100%;
    height: 44px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.db-filter-bar input[type="text"]:focus,
.db-filter-bar select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.db-filter-bar .btn-secondary {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    width: auto;
    white-space: nowrap;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Сортировка таблицы */
.db-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    padding-right: 24px;
    transition: background-color 0.2s, color 0.2s;
}

.db-table th[data-sort]:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.db-table th[data-sort]::after {
    content: "";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    opacity: 0.3;
    transition: opacity 0.2s, border-color 0.2s;
}

.db-table th[data-sort].sort-asc::after {
    border-bottom-color: var(--text-primary);
    transform: translateY(-75%);
    opacity: 1;
}

.db-table th[data-sort].sort-desc::after {
    border-top-color: var(--text-primary);
    transform: translateY(-25%);
    opacity: 1;
}

@media (max-width: 768px) {
    .db-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .db-filter-bar .filter-search-wrapper,
    .db-filter-bar .filter-select-wrapper,
    .db-filter-bar .dropdown-wrapper,
    .db-filter-bar .btn-secondary,
    .db-filter-bar .btn {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }
    .db-filter-bar .dropdown-wrapper .btn {
        width: 100% !important;
        justify-content: center;
    }
}

/* Выравнивание кнопок-иконок в таблице СНО */
.db-table td.col-actions {
    padding: 8px 6px;
}

.actions-cell-wrapper {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.actions-cell-wrapper .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 !important;
    justify-content: center;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
}

/* Стили для системы заказов оборудования */
.btn-order-trigger {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.btn-order-trigger:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.08);
}

.status-badge-pending {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-badge-ordered {
    background-color: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.status-badge-received {
    background-color: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.status-badge-completed {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}


.status-badge-cancelled {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
}

.my-order-card {
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.my-order-card:hover {
    border-color: #475569;
}

.aside-tab-btn {
    transition: all 0.2s ease;
}

.aside-tab-btn:hover {
    color: var(--text-primary);
}

.aside-tab-btn.active {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

.active-order-card {
    transition: transform 0.15s ease;
}

.active-order-card:hover {
    border-color: #475569;
}

/* ==========================================================================
   UI Feedback, Toast, Confirm Modal, Spinners, Eye Toggle, Empty State, Data Dropdown
   ========================================================================== */

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 440px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.toast-item.toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-item.toast-hide {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    word-break: break-word;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: currentColor;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 2px 6px;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    background-color: #065f46;
    color: #ecfdf5;
    border: 1px solid #10b981;
}

.toast-error {
    background-color: #7f1d1d;
    color: #fef2f2;
    border: 1px solid #ef4444;
}

.toast-warning {
    background-color: #78350f;
    color: #fffbeb;
    border: 1px solid #f59e0b;
}

.toast-info {
    background-color: #1e1e24;
    color: #f8fafc;
    border: 1px solid #3b4252;
}

/* Button Loading Spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* Password Eye Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    padding-right: 48px !important;
}

.btn-toggle-password {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-toggle-password:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Empty State Card */
.empty-state-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    text-align: center;
    gap: 12px;
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 44px;
    height: 44px;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-bottom: 2px;
}

.empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-text {
    font-size: 13px;
    max-width: 340px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.empty-state-btn {
    margin-top: 6px;
    width: auto !important;
    padding: 8px 18px !important;
    font-size: 13px !important;
    height: 36px !important;
}

/* Data Dropdown in Dashboard Actions */
.dropdown-data-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-data-menu {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    z-index: 1050;
    min-width: 250px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    gap: 4px;
}

.dropdown-data-menu.active {
    display: flex !important;
}

.dropdown-data-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--text-primary) !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.15s;
    box-sizing: border-box;
}

.dropdown-data-item:hover {
    background-color: var(--bg-tertiary) !important;
    color: #ffffff !important;
}

/* Undo Timer Button Badge */
.btn-undo-timer-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 7px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    margin-left: 6px;
    font-weight: 700;
    font-size: 12px;
}

/* --- ПАНЕЛЬ ПАКЕТНЫХ ДЕЙСТВИЙ (BATCH ACTION BAR) --- */
.batch-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.14) 0%, rgba(30, 30, 34, 0.95) 100%);
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 10px;
    padding: 8px 16px;
    margin-bottom: 12px;
    gap: 12px;
    animation: fadeIn 0.2s ease-out;
}

.batch-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.batch-bar-badge {
    background-color: var(--accent-color);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.batch-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- ВЫБОР СТРОК И КАСТОМНЫЕ ЧЕКБОКСЫ В ТАБЛИЦЕ СНО --- */

.col-select,
.db-table th.col-select,
.db-table td.col-select {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    text-align: center;
    vertical-align: middle;
    padding: 10px 0 !important;
    user-select: none;
    cursor: pointer;
}

/* Гармоничные чекбоксы для темного интерфейса FLAGBOT */
.eq-row-checkbox,
#select-all-eq,
.dropdown-item input[type="checkbox"],
.custom-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin: 0;
    width: 18px;
    height: 18px;
    background-color: var(--bg-primary);
    border: 1.5px solid #3F3F46;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Эффект при наведении */
.eq-row-checkbox:hover,
#select-all-eq:hover,
.dropdown-item input[type="checkbox"]:hover,
.custom-checkbox:hover {
    border-color: var(--accent-color);
    background-color: rgba(220, 38, 38, 0.08);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

/* Фокус с клавиатуры (доступность a11y) */
.eq-row-checkbox:focus-visible,
#select-all-eq:focus-visible,
.dropdown-item input[type="checkbox"]:focus-visible,
.custom-checkbox:focus-visible {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
}

/* Микро-анимация клика */
.eq-row-checkbox:active,
#select-all-eq:active,
.dropdown-item input[type="checkbox"]:active,
.custom-checkbox:active {
    transform: scale(0.92);
}

/* Состояние: Отмечено (Checked) */
.eq-row-checkbox:checked,
#select-all-eq:checked,
.dropdown-item input[type="checkbox"]:checked,
.custom-checkbox:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 11px;
}

/* Состояние: Промежуточное (Indeterminate) */
#select-all-eq:indeterminate,
.custom-checkbox:indeterminate {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='3.5' y1='8' x2='12.5' y2='8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 11px;
}

/* Подсветка выделенной строки в таблице СНО */
.db-table tbody tr.row-selected {
    background-color: rgba(220, 38, 38, 0.08) !important;
}

.db-table tbody tr.row-selected:hover {
    background-color: rgba(220, 38, 38, 0.14) !important;
}

/* --- КНОПКА И МОДАЛЬНОЕ ОКНО WEB PUSH УВЕДОМЛЕНИЙ --- */

.btn-push-bell {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-push-bell:hover {
    background-color: var(--border-color);
    color: var(--accent-color);
}

.push-status-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    pointer-events: none;
}

.push-dot-active {
    background-color: #238636;
    box-shadow: 0 0 6px rgba(35, 134, 54, 0.8);
}

.push-dot-inactive {
    background-color: #8b949e;
}

.push-dot-denied {
    background-color: #da3633;
}

.push-modal-box {
    max-width: 440px;
    width: 90%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.push-modal-body {
    margin-top: 14px;
}

.push-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

.push-status-label {
    color: var(--text-secondary);
}

.push-ios-hint {
    background-color: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #58a6ff;
    margin-bottom: 14px;
}

.push-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}

.push-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-push-action {
    width: 100%;
    height: 40px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

/* ==========================================================================
   Адаптивные поля ввода с подсказками (Searchable Combobox) для модального окна выдачи СНО
   ========================================================================== */

.modal-content-checkout {
    max-width: 520px;
    width: 100%;
}

.form-group-combobox {
    position: relative;
    margin-bottom: 16px;
}

.form-group-combobox.is-open {
    z-index: 1050;
}

.combobox-wrapper {
    position: relative;
    width: 100%;
}

.combobox-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.combobox-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
    opacity: 0.9;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-form input[type="text"].combobox-input,
.modal-form input.combobox-input,
.modal-form .combobox-input,
.combobox-input {
    width: 100%;
    height: 44px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 54px 0 44px !important;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    cursor: text;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.modal-form input[type="text"].combobox-input:focus,
.modal-form input.combobox-input:focus,
.modal-form .combobox-input:focus,
.combobox-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.modal-form input[type="text"].combobox-input.is-invalid,
.modal-form input.combobox-input.is-invalid,
.modal-form .combobox-input.is-invalid,
.combobox-input.is-invalid {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 2px rgba(218, 54, 51, 0.25) !important;
}

.modal-form input[type="text"].combobox-input:disabled,
.modal-form input[type="text"].combobox-input.is-locked,
.modal-form input.combobox-input:disabled,
.modal-form input.combobox-input.is-locked,
.modal-form .combobox-input:disabled,
.modal-form .combobox-input.is-locked,
.combobox-input:disabled,
.combobox-input.is-locked {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed !important;
    opacity: 0.85;
}

.combobox-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.65;
}

.combobox-actions {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.combobox-clear-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.combobox-clear-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.combobox-caret {
    font-size: 10px;
    color: var(--text-secondary);
    pointer-events: auto;
    cursor: pointer;
    padding: 6px;
    transition: transform 0.2s ease, color 0.2s ease;
    user-select: none;
}

.combobox-wrapper.is-open .combobox-caret {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.combobox-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    z-index: 1100;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

/* Кастомный скроллбар для выпадающего списка */
.combobox-dropdown::-webkit-scrollbar {
    width: 6px;
}
.combobox-dropdown::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 8px;
}
.combobox-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
}
.combobox-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.combobox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    user-select: none;
}

.combobox-item:last-child {
    border-bottom: none;
}

.combobox-item:hover,
.combobox-item.is-focused {
    background-color: var(--bg-tertiary);
}

.combobox-item.is-selected {
    background-color: rgba(88, 166, 255, 0.15);
}

/* Стили карточки сотрудника в подсказках */
.combobox-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.combobox-user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 3px 6px;
    border-radius: 6px;
    background-color: rgba(88, 166, 255, 0.15);
    color: var(--accent-color);
    font-family: monospace;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.combobox-user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.combobox-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combobox-user-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Стили карточки оборудования в подсказках */
.combobox-eq-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
}

.combobox-eq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.combobox-eq-inv {
    display: inline-block;
    font-family: monospace;
    font-weight: 700;
    font-size: 13px;
    color: var(--accent-color);
    background-color: rgba(88, 166, 255, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.combobox-eq-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.combobox-eq-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Простые элементы (Локации, ВС) */
.combobox-simple-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.combobox-simple-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Подсветка совпадений в результатах поиска */
.combobox-match-highlight {
    color: #58a6ff;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(88, 166, 255, 0.5);
}

/* Пустое состояние выпадающего списка */
.combobox-empty {
    padding: 14px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.combobox-error-hint {
    font-size: 12px;
    color: var(--error-color);
    margin-top: 4px;
    display: none;
}

.form-group-combobox.has-error .combobox-error-hint {
    display: block;
}


/* ==========================================================================
   КАРТОЧКА СНО ДЛЯ ПАНЕЛИ СКЛАДА (ИНТЕРФЕЙС СКЛАДА И ЖУРНАЛ ЛОГОВ)
   ========================================================================== */

/* Основной контейнер карточки СНО склада */
.wh-container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 20px 80px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Кнопка "В панель склада" в шапке */
.btn-header-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
}

.home-arrow {
    font-size: 14px;
}

/* Иконки в кнопках интерфейса */
.wh-btn-icon {
    vertical-align: -2px;
    margin-right: 6px;
    flex-shrink: 0;
}

/* 1. Карточка сводки (Hero Card) */
.wh-hero-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.wh-hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.wh-hero-badges-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wh-type-badge {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Кликабельный бейдж номера оборудования / всплывающий свитчер */
.wh-inv-badge-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.wh-inv-badge {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.wh-inv-badge.is-clickable {
    cursor: pointer;
    user-select: none;
}

.wh-inv-badge.is-clickable:hover {
    border-color: #475569;
    background-color: rgba(255, 255, 255, 0.08);
}

.wh-inv-badge.is-gpa {
    border-color: rgba(56, 189, 248, 0.4);
    background-color: rgba(56, 189, 248, 0.08);
    color: var(--gpa-color);
}

.wh-inv-badge.is-gpa.is-clickable:hover {
    border-color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.16);
}

.wh-inv-badge-label {
    opacity: 0.85;
}

.wh-inv-caret-icon {
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.wh-inv-badge-container:focus-within .wh-inv-caret-icon,
.wh-inv-badge.is-clickable:active .wh-inv-caret-icon {
    transform: rotate(180deg);
}

/* Всплывающее окно быстрого переключения СНО / смены номера */
.wh-inv-switcher-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 340px;
    background-color: #1a1a20;
    border: 1px solid #33333d;
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
    z-index: 1050;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wh-switcher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wh-switcher-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.wh-switcher-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.wh-switcher-close:hover {
    color: #ffffff;
}

.wh-switcher-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.wh-switcher-input,
input[type="text"].wh-switcher-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 38px !important;
    padding: 0 12px !important;
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    font-family: inherit !important;
    outline: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    box-sizing: border-box !important;
}

.wh-switcher-input:focus,
input[type="text"].wh-switcher-input:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

.wh-switcher-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    height: 38px !important;
    padding: 0 16px !important;
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.15s, transform 0.1s !important;
    box-sizing: border-box !important;
}

.wh-switcher-btn:hover {
    background-color: var(--accent-hover) !important;
}

.wh-switcher-btn:active {
    transform: scale(0.98) !important;
}

.wh-switcher-dropdown {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background-color: var(--bg-primary);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wh-switcher-item {
    padding: 6px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.12s;
}

.wh-switcher-item:hover {
    background-color: var(--bg-tertiary);
}

.wh-switcher-item.is-current {
    background-color: rgba(56, 189, 248, 0.12);
}

.wh-switcher-item-inv {
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}

.wh-switcher-item-name {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.wh-switcher-item-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    white-space: nowrap;
}

.wh-switcher-empty {
    padding: 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

.wh-switcher-actions-row {
    display: flex;
    justify-content: flex-end;
}

.wh-btn-rename {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    text-align: center;
}

.wh-btn-rename:hover {
    border-color: var(--warning-color);
    color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.08);
}

.wh-switcher-hint {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.wh-hero-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wh-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}

/* Сетка мета-параметров */
.wh-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.wh-meta-item {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wh-meta-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.wh-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.wh-text-muted {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Баннер неисправности */
.wh-issue-alert {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 4px;
}

.wh-issue-alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}

.wh-issue-alert-title {
    color: var(--error-color);
    font-weight: 700;
    font-size: 14px;
}

.wh-issue-alert-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.wh-issue-alert-body {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.wh-issue-alert-footer {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 2. Карточка фильтров */
.wh-filter-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.wh-filter-card-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wh-filter-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.wh-filter-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.wh-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.wh-filter-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.wh-control-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Кастомные выпадающие списки (Custom Select) */
.wh-custom-select-container {
    position: relative;
    width: 100%;
    user-select: none;
}

.wh-custom-select-trigger {
    width: 100%;
    height: 42px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    outline: none;
    font-family: inherit;
    text-align: left;
}

.wh-custom-select-trigger:hover {
    border-color: #475569;
    background-color: #16181d;
}

.wh-custom-select-container.is-open .wh-custom-select-trigger {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.wh-custom-select-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.wh-custom-select-label.has-value {
    color: var(--text-primary);
    font-weight: 500;
}

.wh-cs-arrow {
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.wh-custom-select-container.is-open .wh-cs-arrow {
    transform: rotate(180deg);
    color: var(--accent-color);
}

.wh-custom-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: #1a1a20;
    border: 1px solid #33333d;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    padding: 4px;
}

.wh-custom-select-container.is-open .wh-custom-select-menu {
    display: block;
}

.wh-custom-select-option {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.12s;
}

.wh-custom-select-option:hover {
    background-color: var(--bg-tertiary);
    color: #ffffff;
}

.wh-custom-select-option.is-selected {
    background-color: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    font-weight: 600;
}

.wh-opt-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-opt-check {
    display: none;
    font-size: 12px;
    color: var(--accent-color);
    font-weight: 700;
    margin-left: 8px;
}

.wh-custom-select-option.is-selected .wh-opt-check {
    display: inline-block;
}

/* Кастомный поиск сотрудника */
.wh-user-search-box {
    position: relative;
    width: 100%;
}

.wh-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
    pointer-events: none;
    color: var(--text-secondary);
}

.wh-custom-input,
input[type="text"].wh-custom-input {
    width: 100% !important;
    height: 42px !important;
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0 34px !important;
    color: var(--text-primary) !important;
    font-size: 13px !important;
    font-family: inherit !important;
    outline: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    box-sizing: border-box !important;
}

.wh-custom-input:focus,
input[type="text"].wh-custom-input:focus {
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

.wh-search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s;
}

.wh-search-clear-btn:hover {
    background-color: #475569;
    color: #ffffff;
}

/* Выпадающий автокомплит сотрудников */
.wh-autocomplete-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: #1a1a20;
    border: 1px solid #33333d;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    padding: 4px;
}

.wh-autocomplete-item {
    padding: 8px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.12s;
}

.wh-autocomplete-item:hover,
.wh-autocomplete-item.is-active {
    background-color: var(--bg-tertiary);
}

.wh-user-init-badge {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.12);
    padding: 3px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.wh-user-item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.wh-user-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wh-user-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.wh-user-ops-count {
    font-size: 11px;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.wh-search-mark {
    background-color: rgba(220, 38, 38, 0.35);
    color: #ffffff;
    padding: 0 2px;
    border-radius: 2px;
}

.wh-autocomplete-empty {
    padding: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Единый блок диапазона дат: пресеты выбора вписаны в блок «С — До» */
.wh-date-range-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.wh-date-range-unified-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 12px;
    gap: 14px;
    flex-wrap: wrap;
}

.wh-period-presets-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wh-period-chip {
    height: 30px;
    padding: 0 12px;
    border-radius: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    outline: none;
    font-family: inherit;
}

.wh-period-chip:hover {
    border-color: #475569;
    color: var(--text-primary);
    background-color: #1e222a;
}

.wh-period-chip.is-active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.wh-date-range-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
}

.wh-date-inputs-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.wh-date-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 32px;
    padding: 0 8px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wh-date-input-wrap:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.wh-date-input-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    user-select: none;
    flex-shrink: 0;
}

/* Полный сброс глобальных стилей input[type="date"] для гармоничного размещения внутри плашки */
.wh-date-input-wrap input[type="date"].wh-date-input,
.wh-date-input-wrap input[type="date"] {
    all: unset !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    color: var(--text-primary) !important;
    font-size: 12px !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    line-height: 30px !important;
    height: 30px !important;
    width: 115px !important;
    min-width: 115px !important;
    cursor: pointer !important;
    color-scheme: dark !important;
    display: inline-flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.wh-date-input-wrap input[type="date"]:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.wh-date-input-wrap input[type="date"]::-webkit-datetime-edit {
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 100% !important;
    color: var(--text-primary) !important;
}

.wh-date-input-wrap input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0 !important;
}

.wh-date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer !important;
    opacity: 0.65 !important;
    padding: 0 !important;
    margin-left: 4px !important;
    filter: invert(0.8) !important;
    transition: opacity 0.15s !important;
}

.wh-date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1 !important;
}

.wh-date-separator {
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.7;
    user-select: none;
    flex-shrink: 0;
}

.wh-btn-reset {
    height: 32px;
    padding: 0 12px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    box-sizing: border-box;
}

.wh-btn-reset:hover {
    border-color: #ef4444;
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.08);
}

/* 3. Карточка таблицы журнала */
.wh-table-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.wh-table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.wh-table-title-area {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.wh-table-main-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.wh-table-counter {
    font-size: 12px;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 12px;
}

.wh-table-tools-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Полоса активных фильтров */
.wh-active-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
}

.wh-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 16px;
}

.wh-chip-remove {
    background: transparent;
    border: none;
    color: #7dd3fc;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
}

.wh-chip-remove:hover {
    color: #ffffff;
}

/* Таблица логов */
.wh-table-responsive-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
}

.wh-log-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.wh-log-table thead {
    background-color: #18181c;
    border-bottom: 2px solid var(--border-color);
}

.wh-log-table th {
    padding: 12px 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.wh-log-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
    color: var(--text-primary);
}

.wh-table-row:hover {
    background-color: rgba(255, 255, 255, 0.025);
}

.wh-col-datetime {
    width: 140px;
    white-space: nowrap;
}

.wh-datetime-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wh-date-main {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
}

.wh-time-sub {
    color: var(--text-secondary);
    font-size: 11px;
}

.wh-col-action {
    width: 140px;
}

.wh-action-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.wh-badge-checkout {
    background-color: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.4);
    color: #fca5a5;
}

.wh-badge-checkin {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.wh-badge-undo {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}

.wh-badge-damaged {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #f87171;
}

.wh-badge-resolve {
    background-color: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.6);
    color: #34d399;
}

.wh-badge-create {
    background-color: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.wh-badge-edit {
    background-color: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: #d8b4fe;
}

.wh-badge-import {
    background-color: rgba(100, 116, 139, 0.2);
    border: 1px solid rgba(100, 116, 139, 0.4);
    color: #cbd5e1;
}

.wh-badge-default {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.wh-col-equipment {
    min-width: 170px;
}

.wh-eq-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wh-table-eq-badge {
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    outline: none;
}

.wh-table-eq-badge:hover {
    background-color: rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
    color: #fde68a;
    transform: translateY(-1px);
}

.wh-eq-cell-link {
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 130px;
    display: inline-block;
}

.wh-eq-cell-name {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}

.wh-eq-cell-name:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.wh-col-user {
    min-width: 170px;
}

.wh-user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wh-table-user-badge {
    font-size: 11px;
    font-weight: 700;
    color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.wh-table-user-badge:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.wh-user-cell-name {
    font-weight: 500;
}

.wh-col-aircraft {
    width: 120px;
}

.wh-aircraft-pill {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #38bdf8;
    background-color: rgba(56, 189, 248, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.wh-aircraft-pill:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.wh-col-location {
    min-width: 140px;
}

.wh-loc-pill {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.wh-loc-pill:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.wh-col-notes {
    min-width: 220px;
}

.wh-notes-content {
    font-size: 12px;
    color: #cbd5e1;
    line-height: 1.4;
    word-break: break-word;
}

/* Пустое состояние */
.wh-empty-state {
    padding: 48px 24px;
    text-align: center;
    background-color: var(--bg-primary);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.wh-empty-icon {
    margin-bottom: 10px;
    opacity: 0.6;
    color: var(--text-secondary);
}

.wh-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.wh-empty-desc {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
}

/* Адаптивность для мобильных и планшетов */
@media (max-width: 1280px) {
    .wh-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .db-section-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .db-status-summary {
        width: 100%;
        justify-content: flex-start;
        gap: 12px 18px;
    }
}

@media (max-width: 1024px) {
    .wh-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wh-container {
        padding: 14px 12px 60px 12px;
        gap: 14px;
    }

    .wh-hero-card,
    .wh-filter-card,
    .wh-table-card {
        padding: 16px;
        border-radius: 10px;
    }

    .wh-hero-top-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .wh-hero-actions-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .wh-hero-actions-group .btn {
        flex: 1 1 calc(50% - 8px);
        min-width: 130px;
        justify-content: center;
        height: 38px;
        font-size: 12px;
        padding: 0 8px;
    }

    .wh-inv-switcher-popup {
        width: 100%;
        max-width: calc(100vw - 32px);
        left: 0;
        right: 0;
        box-sizing: border-box;
    }

    .wh-filter-grid {
        grid-template-columns: 1fr;
    }

    .wh-date-range-unified-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .wh-period-presets-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .wh-period-chip {
        flex: 1 1 auto;
        text-align: center;
        padding: 0 8px;
        height: 32px;
        font-size: 12px;
    }

    .wh-date-range-divider,
    .wh-date-separator {
        display: none !important;
    }

    .wh-date-inputs-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .wh-date-input-wrap {
        width: 100%;
        justify-content: space-between;
    }

    .wh-date-input-wrap input[type="date"].wh-date-input,
    .wh-date-input-wrap input[type="date"] {
        flex: 1;
        width: 100% !important;
        min-width: 0 !important;
        font-size: 16px !important;
    }

    .wh-btn-reset {
        width: 100%;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .wh-hero-actions-group .btn {
        flex: 1 1 100%;
        width: 100%;
    }
    .wh-hero-title {
        font-size: 20px !important;
    }
}

/* ==========================================================================
   АВТОМАТИЗИРОВАННЫЙ СБОР ОШИБОК (ERROR TRACKER MODAL)
   ========================================================================== */

.client-error-modal-overlay {
    z-index: 99999;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.client-error-modal-box {
    max-width: 520px;
    width: 92%;
    background-color: var(--bg-secondary);
    border: 1px solid rgba(239, 68, 68, 0.45);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(239, 68, 68, 0.15);
    border-radius: 16px;
    padding: 22px;
    animation: modalFadeIn 0.22s ease-out;
}

.client-error-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.client-error-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-error-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    flex-shrink: 0;
}

.client-error-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}

.client-error-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: monospace;
    margin-top: 3px;
}

.client-error-close-btn {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease;
}

.client-error-close-btn:hover {
    color: var(--text-primary);
}

.client-error-desc {
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.client-error-comment-form {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}

.client-error-comment-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.client-error-comment-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 10px;
    resize: none;
    box-sizing: border-box;
    min-height: 52px;
}

.client-error-comment-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.client-error-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.btn-sm-comment {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
    width: auto;
}

.client-error-comment-status {
    font-size: 12px;
    color: var(--success-color);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.client-error-details {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.client-error-summary {
    padding: 9px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.client-error-summary:hover {
    color: var(--text-primary);
}

.client-error-details[open] .client-error-arrow {
    transform: rotate(90deg);
}

.client-error-arrow {
    transition: transform 0.15s ease;
    font-size: 11px;
}

.client-error-tech-content {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--border-color);
    font-size: 11.5px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-error-tech-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.client-error-tech-label {
    color: var(--text-secondary);
    font-size: 10.5px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.client-error-tech-content code {
    background-color: var(--bg-tertiary);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: #e2e8f0;
    word-break: break-all;
}

.client-error-msg-code {
    color: var(--error-color) !important;
}

.client-error-stack {
    max-height: 120px;
    overflow-y: auto;
    background-color: var(--bg-tertiary);
    padding: 6px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.client-error-stack code {
    padding: 0;
    background: none;
    font-size: 10.5px;
    white-space: pre-wrap;
    word-break: break-all;
}

.client-error-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.client-error-footer .btn {
    width: auto;
    font-size: 13px;
    padding: 8px 16px;
}

/* Стили для таблицы журнала ошибок на складе */
.client-errors-table-wrap {
    max-height: 550px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 12px;
}

.client-errors-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.client-errors-table th {
    background-color: var(--bg-primary);
    padding: 10px 12px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.client-errors-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.client-errors-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Адаптивность модального окна подтверждения действий */
.confirm-modal-content {
    border-radius: 14px !important;
}

@media (max-width: 768px) {
    .confirm-modal-content {
        max-width: calc(100vw - 24px) !important;
        width: 100% !important;
        padding: 20px 16px !important;
        box-sizing: border-box;
    }
    .confirm-modal-content .modal-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }
    .confirm-modal-content .modal-actions .btn {
        width: 100% !important;
        min-height: 44px !important;
        height: 44px !important;
        font-size: 15px !important;
        justify-content: center !important;
        margin: 0 !important;
        box-sizing: border-box;
    }
    .confirm-modal-content .modal-actions .confirm-modal-ok {
        order: 1;
    }
    .confirm-modal-content .modal-actions .confirm-modal-cancel {
        order: 2;
    }
}



/* === Дашборд склада: плотная раскладка (этап 1) === */

/* Колонка действий всегда на виду, даже при горизонтальном скролле таблицы */
.db-table th.col-actions,
.db-table td.col-actions {
    position: sticky;
    right: 0;
    background-color: var(--bg-secondary);
    box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.6);
}

.db-table th.col-actions {
    background-color: var(--bg-tertiary);
    z-index: 11;
}

.db-table tbody tr:hover td.col-actions {
    background-color: #1f2430;
}

/* Тулбар и фильтры помещаются в одну строку на 1440 px */
.db-filter-bar {
    gap: 8px;
    margin-bottom: 14px;
}

.db-filter-bar .filter-search-wrapper {
    min-width: 200px;
}

.db-filter-bar .filter-select-wrapper {
    min-width: 130px;
}

.db-admin-actions .btn-icon-only {
    width: 38px;
    padding: 0;
}

/* Компактные карточки задач в правой панели */
.queue-card-title {
    font-size: 14px;
    line-height: 1.35;
    color: var(--text-primary);
}

.queue-card-title strong {
    margin-right: 4px;
}

.queue-card-meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
}

.pending-return-card {
    padding: 12px 14px;
    gap: 6px;
}


.dashboard-layout .db-table th,
.dashboard-layout .db-table td {
    padding: 10px 8px;
}

.dashboard-layout .db-table th {
    font-size: 11px;
    letter-spacing: 0.03em;
}

.dashboard-layout .db-table td.col-actions {
    padding: 6px;
}

.dashboard-layout .db-log-aside {
    width: 360px;
}

/* Подпись кнопки с иконкой: только на узких экранах, где кнопки растянуты */
.btn-label-sm {
    display: none;
}

@media (max-width: 768px) {
    .db-admin-actions .btn-icon-only {
        width: auto;
        padding: 8px 14px;
    }

    .db-admin-actions .btn-icon-only .btn-label-sm {
        display: inline;
    }
}

/* Красный — только для опасных действий: печать нейтральная, удаление с контуром на карточках */
.actions-cell-wrapper .btn-print-row,
.eq-card-actions .btn-print-row {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.actions-cell-wrapper .btn-print-row:hover,
.eq-card-actions .btn-print-row:hover {
    background-color: #3a3a44;
}

.eq-card-actions .btn-delete-row {
    background-color: transparent;
    border: 1px solid var(--error-color);
    color: var(--error-color);
}

.eq-card-actions .btn-delete-row:hover {
    background-color: rgba(239, 68, 68, 0.12);
}

/* Мобильная шапка склада: кнопки в компактный ряд вместо стопки на всю ширину */
@media (max-width: 768px) {
    .dashboard-header {
        gap: 8px;
    }

    .dashboard-user > span {
        font-size: 13px;
        color: var(--text-secondary);
    }

    .dashboard-user-actions {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .dashboard-user-actions .btn-header-action,
    .dashboard-user-actions .btn-header-logout {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        width: auto !important;
        height: 40px !important;
        font-size: 12px !important;
        padding: 6px 8px !important;
        white-space: nowrap;
    }

    .dashboard-user-actions .btn-push-bell {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Фильтры на телефоне: сетка 2 колонки вместо стопки из шести полей */
@media (max-width: 768px) {
    .db-filter-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 12px;
    }

    .db-filter-bar .filter-search-wrapper,
    .db-filter-bar #btn-reset-filters {
        grid-column: 1 / -1;
    }

    .db-filter-bar .filter-select-wrapper,
    .db-filter-bar .dropdown-wrapper {
        min-width: 0;
        width: 100%;
    }

    .db-filter-bar select,
    .db-filter-bar .btn {
        width: 100%;
        height: 44px;
        font-size: 14px;
    }
}

/* === Доступность === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-color) !important;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Раскрывающийся список СНО в таблице пользователей */
.eq-more summary {
    cursor: pointer;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.eq-more[open] {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.eq-more[open] summary {
    flex-basis: 100%;
    margin-top: 6px;
}


/* === Нижняя таб-панель (мобильные, общий компонент) === */
.bottom-nav {
    display: none;
}

.profile-view {
    display: none;
}

.profile-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.profile-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-id {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.profile-logout {
    color: var(--error-color);
}

@media (max-width: 768px) {
    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        height: calc(58px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: rgba(30, 30, 34, 0.88);
        -webkit-backdrop-filter: blur(16px) saturate(1.4);
        backdrop-filter: blur(16px) saturate(1.4);
        border-top: 1px solid var(--border-color);
    }

    .bottom-nav-item {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-family: inherit;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease;
    }

    .bottom-nav-item.active {
        color: var(--accent-color);
    }

    .bottom-nav-item::before {
        content: "";
        position: absolute;
        top: 6px;
        left: 50%;
        width: 52px;
        height: 30px;
        border-radius: 15px;
        background: rgba(220, 38, 38, 0.16);
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
        transition: transform 0.2s ease, opacity 0.2s ease;
        pointer-events: none;
    }

    .bottom-nav-item.active::before {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    .bottom-nav-icon,
    .bottom-nav-label {
        position: relative;
    }

    .bottom-nav-item:active .bottom-nav-icon {
        transform: scale(0.88);
    }

    .bottom-nav-icon {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform 0.15s ease;
    }

    .bottom-nav-label {
        font-size: 10px;
        font-weight: 600;
        line-height: 1;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bottom-nav-badge {
        position: absolute;
        top: 6px;
        left: calc(50% + 6px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: var(--accent-color);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
    }

    .bottom-nav-badge[hidden] {
        display: none;
    }

    /* Место под панель и тосты над ней */
    body:has(.bottom-nav) {
        padding-bottom: calc(58px + env(safe-area-inset-bottom));
    }

    body:has(.bottom-nav) .toast-container {
        bottom: calc(70px + env(safe-area-inset-bottom));
    }

    /* Шапка: липкая, уезжает вверх при прокрутке вниз */
    body:has(.bottom-nav) .dashboard-header,
    body:has(.bottom-nav) .mobile-header {
        position: sticky;
        top: 0;
        z-index: 800;
        padding-top: calc(12px + env(safe-area-inset-top));
        transition: transform 0.25s ease;
    }

    body.header-hidden:has(.bottom-nav) .dashboard-header,
    body.header-hidden:has(.bottom-nav) .mobile-header {
        transform: translateY(-100%);
    }

    /* Страницы с data-nav-view: показываем только блоки активной вкладки */
    [data-nav-view]:not(.nav-view-active) {
        display: none !important;
    }

    /* Инженер: кнопки шапки переехали во вкладку «Профиль» */
    body:has(.bottom-nav) .mobile-header .header-user-actions {
        display: none !important;
    }

    .profile-view.nav-view-active {
        display: block;
    }

    /* Админка: верхние вкладки заменены нижней панелью */
    body:has(.bottom-nav) .admin-nav-tabs {
        display: none;
    }

    /* Склад: один раздел на экран, переключатель очередей заменён панелью */
    body[data-view] .aside-queue-header,
    body[data-view] .aside-tabs-header {
        display: none;
    }

    body[data-view="equipment"] .db-log-aside,
    body[data-view]:not([data-view="equipment"]) .db-table-section {
        display: none;
    }

    /* Очередь занимает весь экран, пустое состояние стоит по центру */
    body[data-view]:not([data-view="equipment"]) .dashboard-layout {
        flex: 1;
    }

    body[data-view]:not([data-view="equipment"]) .db-log-aside {
        flex: 1;
        width: 100%;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    body[data-view] .db-log-aside .aside-queue-widget,
    body[data-view] .db-log-aside .aside-tab-pane.active {
        flex: 1;
        height: auto;
        overflow: visible;
    }

    body[data-view] .db-log-aside .pending-returns-container,
    body[data-view] .db-log-aside .active-issues-container,
    body[data-view] .db-log-aside .active-prep-container,
    body[data-view] .db-log-aside .active-orders-container {
        flex: 1;
        overflow: visible;
        padding-right: 0;
    }

    body[data-view] .pending-returns-empty,
    body[data-view] .active-issues-empty,
    body[data-view] .active-prep-empty,
    body[data-view] .active-orders-empty {
        margin: auto;
        padding: 24px 16px;
        font-size: 14px;
        font-style: normal;
        background: transparent;
        border: none;
        text-align: center;
    }

    /* Кнопки шапки: по ширине текста, при нехватке места переносятся */
    body:has(.bottom-nav) .dashboard-user-actions {
        flex-wrap: wrap;
    }

    body:has(.bottom-nav) .dashboard-user-actions .btn-header-action,
    body:has(.bottom-nav) .dashboard-user-actions .btn-header-logout {
        flex: 1 1 auto !important;
        min-width: max-content !important;
        padding: 6px 12px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav-item,
    .bottom-nav-item::before,
    .bottom-nav-icon,
    body:has(.bottom-nav) .dashboard-header,
    body:has(.bottom-nav) .mobile-header {
        transition: none;
    }
}


/* === Карточки очередей склада: единая схема ===
   Шапка (чип этапа + время) → тело → индикатор этапа → одно главное действие.
   Цвет этапа задаёт --stage-color / --stage-bg. Кнопки: advance — следующий этап
   (синяя), final — завершающее действие (зелёная), cancel — отмена (контурная красная). */
.pending-return-card,
.active-issue-card,
.active-prep-card,
.active-order-card {
    --stage-color: #f59e0b;
    --stage-bg: rgba(245, 158, 11, 0.15);
    border-left: 4px solid var(--stage-color);
    gap: 10px;
}

.active-issue-card {
    --stage-color: var(--error-color);
    --stage-bg: rgba(239, 68, 68, 0.15);
}

.active-prep-card.status-ready {
    --stage-color: #10b981;
    --stage-bg: rgba(16, 185, 129, 0.15);
}

.active-order-card.status-ordered {
    --stage-color: #38bdf8;
    --stage-bg: rgba(56, 189, 248, 0.15);
}

.active-order-card.status-received {
    --stage-color: #c084fc;
    --stage-bg: rgba(168, 85, 247, 0.15);
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.queue-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.queue-chip,
:is(.pending-return-card, .active-issue-card) .action-title {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--stage-bg);
    color: var(--stage-color);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.3;
}

.queue-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .log-time {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

:is(.active-issue-card, .active-prep-card, .active-order-card) .log-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

:is(.active-issue-card, .active-prep-card, .active-order-card) .queue-card-title {
    font-weight: 600;
    word-break: break-word;
}

.queue-order-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 12px;
    color: #38bdf8;
    text-decoration: underline;
}

.queue-card-note {
    margin-top: 2px;
    font-size: 12px;
    font-style: italic;
    color: var(--text-secondary);
}

/* Индикатор этапа */
.queue-steps {
    display: flex;
    gap: 4px;
}

.queue-steps i {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
}

.queue-steps i.on {
    background: var(--stage-color);
}

/* Строка действий */
.queue-actions,
.active-prep-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 0;
}

/* Кнопки действий */
:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn {
    flex: 1;
    width: 100%;
    min-height: 44px;
    height: auto;
    margin: 0;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn svg {
    flex-shrink: 0;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn--advance {
    background-color: #0284c7;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn--advance:hover {
    background-color: #0369a1;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn--final {
    background-color: #059669;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn--final:hover {
    background-color: #047857;
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn:active {
    transform: scale(0.98);
}

:is(.pending-return-card, .active-issue-card, .active-prep-card, .active-order-card) .q-btn:disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.active-prep-card .q-btn-cancel {
    width: 44px;
    min-width: 44px;
    height: auto;
    min-height: 44px;
    flex: 0 0 44px;
    border-radius: 10px;
}


/* === Инженер: создание заявок (две одинаковые плитки) и пустые состояния === */
.request-create {
    margin-top: 4px;
}

.request-create-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.request-create-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 14px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.2s, background-color 0.2s, transform 0.1s;
}

.request-create-btn:hover {
    border-color: rgba(220, 38, 38, 0.5);
}

.request-create-btn:active {
    transform: scale(0.98);
}

.request-create-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.15);
    color: var(--accent-color);
}

.request-create-title {
    font-size: 15px;
    font-weight: 700;
}

.request-create-caption {
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-secondary);
}

.request-empty {
    margin-top: 10px;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}


/* Колонка действий: четыре фиксированных слота, кнопки стоят ровно во всех строках */
.actions-cell-wrapper .btn-slot {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
}

/* Вкладки очередей: поровну по ширине, бейдж-счётчик поверх угла, а не внутри кнопки */
.aside-tabs-header .aside-tab-btn {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 2px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.aside-tabs-header .tab-badge {
    position: absolute;
    top: -7px;
    right: -1px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 0 0 2px var(--bg-primary);
}

/* Строка с чекбоксом в формах админки */
.form-check-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: 400 !important;
    margin-bottom: 10px !important;
    cursor: pointer;
}
.form-check-hint { font-size: 12px; color: var(--text-secondary); margin-top: -4px; }
.role-badge.role-inactive {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    border: 1px dashed rgba(148, 163, 184, 0.5);
}
