/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Премиум-палитра сайдбара (портал) — синхрон с токенами --crm-sidebar-* в темах */
:root {
    --sidebar-text: #eaf2ff;
    --sidebar-text-secondary: #c7d2e6;
    --sidebar-text-muted: #94a3b8;
    --sidebar-icon: #76e4f7;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
    --sidebar-active-bg: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --sidebar-active-text: #08263a;
    --sidebar-logo: #f5f1ff;

    /* Центральные панели / формы (glass, едино с sidebar) */
    --panel-text-primary: #f5f7ff;
    --panel-text-secondary: #d8e4f8;
    --panel-text-muted: #9fb2c9;
    --panel-text-placeholder: #8fa3bc;
    --panel-link: #7dd3fc;
    --panel-link-hover: #bae6fd;
    --panel-heading: #f3f7ff;
    --panel-glass-bg: rgba(255, 255, 255, 0.1);
    --panel-glass-border: rgba(255, 255, 255, 0.14);
    --panel-glass-shadow: 0 10px 40px rgba(15, 23, 42, 0.28);
    --panel-input-bg: rgba(255, 255, 255, 0.12);
    --panel-input-border: rgba(255, 255, 255, 0.18);
    /* Только нативный выпадающий список (option): светлый текст на тёмно-сером */
    --panel-select-option-bg: #1e293b;
    --panel-select-option-color: #f8fafc;
    --panel-input-readonly-bg: rgba(255, 255, 255, 0.07);
    --panel-focus-ring: rgba(125, 211, 252, 0.55);
    --panel-btn-gradient: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --panel-btn-shadow: 0 10px 24px rgba(41, 182, 246, 0.22);
}

body {
    font-family: 'Inter', sans-serif;
    background: url('/static/img/backgrounds/4f97fb03-d9aa-4be1-b287-5120c21ecf84.png') no-repeat center center fixed;
    background-size: cover;
    background-color: #e8e4f0;
    color: #1f2937;
    overflow-x: hidden;
}

/* Макет страницы */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Сайдбар — премиум-стиль «Мелодия флаконов» */
@media (min-width: 1024px) {
    .sidebar {
        width: 280px;
        background: linear-gradient(to right, rgba(45, 30, 65, 0.32), rgba(45, 30, 65, 0.1));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: white;
        padding: 1.25rem 0;
        position: fixed;
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 1000;
        border-radius: 0 1rem 1rem 0;
        border: 1px solid rgba(212, 175, 55, 0.35);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.08);
    }
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

.sidebar-brand-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    align-items: center;
    text-align: center;
}

.sidebar-brand-line1,
.sidebar-brand-line2 {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: #f4e4a6;
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.sidebar-profile {
    margin-bottom: 0.5rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(240,240,245,0.9) 100%);
    color: #2d1e41;
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-username {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
}

/* Полоса прокрутки сайдбара — тонкая и малозаметная */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, 0.35) transparent;
}
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Навигация сайдбара — только старый макет (не портал app-body-luxury) */
body:not(.app-body-luxury) .sidebar .nav-link {
    color: #e8d9a8;
    padding: 0.6rem 1rem 0.6rem 1.25rem;
    border-left: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 0.5rem;
    margin: 0 0.5rem 0.15rem;
    position: relative;
}

body:not(.app-body-luxury) .sidebar .nav-link:hover {
    color: #fff;
    background: rgba(80, 60, 100, 0.28);
}

body:not(.app-body-luxury) .sidebar .nav-link.active {
    color: #f4e4a6;
    background: transparent;
    border-left: none;
}

body:not(.app-body-luxury) .sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 28px;
    background: rgba(80, 50, 90, 0.7);
    border-radius: 14px;
    z-index: -1;
}

body:not(.app-body-luxury) .sidebar-nav .nav-link {
    color: #e8d9a8;
    padding: 0.6rem 1rem 0.6rem 1.25rem;
    border-left: none;
}

body:not(.app-body-luxury) .sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(80, 60, 100, 0.28);
}

body:not(.app-body-luxury) .sidebar-nav .nav-link.active {
    color: #f4e4a6;
    background: transparent;
    border-left: none;
}

body:not(.app-body-luxury) .sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 28px;
    background: rgba(80, 50, 90, 0.7);
    border-radius: 14px;
    z-index: -1;
}

body:not(.app-body-luxury) .sidebar .nav-icon {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    color: #d4af37;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

body:not(.app-body-luxury) .sidebar .nav-link:hover .nav-icon,
body:not(.app-body-luxury) .sidebar .nav-link.active .nav-icon {
    color: #f4e4a6;
}

body:not(.app-body-luxury) .sidebar .collapse .nav-link {
    margin: 0.2rem 0.5rem 0.2rem 1.5rem;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
}

body:not(.app-body-luxury) .sidebar .collapse .nav-link .nav-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

body:not(.app-body-luxury) .sidebar .collapse .nav-link.active::before {
    left: 0.5rem;
    right: 0.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
}

/* Основной контент - только для десктопа */
@media (min-width: 1024px) {
    .main-content {
        flex: 1;
        margin-left: 280px;
        display: flex;
        flex-direction: column;
    }
}

/* Верхняя панель */
.topbar,
.topbar.border-bottom {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Glossy metallic gold pill — кнопки «Найти», «В заказ», «Добавить» и т.д. */
.btn-golden-glossy,
.btn-topbar-golden {
    border-radius: 50px !important;
    padding: 0.5rem 1.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3d2914 !important;
    background: linear-gradient(180deg, #f5e6b3 0%, #e8c547 25%, #d4af37 50%, #b8860b 75%, #8b6914 100%) !important;
    border: none !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 -1px 0 rgba(0, 0, 0, 0.2) inset,
        0 0 0 1px #8b6914,
        0 0 0 2px rgba(212, 175, 55, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.35);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}
.btn-golden-glossy:hover,
.btn-topbar-golden:hover {
    background: linear-gradient(180deg, #ffe066 0%, #f0d040 25%, #e6c229 50%, #d4af37 75%, #b8860b 100%) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 -1px 0 rgba(0, 0, 0, 0.15) inset,
        0 0 0 1px #8b6914,
        0 0 0 2px rgba(212, 175, 55, 0.6),
        0 6px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}
.btn-golden-glossy:active,
.btn-topbar-golden:active {
    box-shadow:
        0 -1px 0 rgba(255, 255, 255, 0.3) inset,
        0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
}
.btn-golden-glossy.btn-sm,
.btn-topbar-golden.btn-sm {
    padding: 0.35rem 1rem !important;
    font-size: 0.875rem;
}

.search-form {
    width: 300px;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #6366f1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
}

/* Карточки статистики */
.stat-card {
    background: rgba(230, 230, 235, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0.5rem 0;
}

.stat-growth {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Текст в блоках дашборда — белый */
.dashboard-page .stat-card .card-title,
.dashboard-page .stat-card .stat-value,
.dashboard-page .stat-card .stat-growth,
.dashboard-page .card .card-title,
.dashboard-page .card-header,
.dashboard-page .table th,
.dashboard-page .table td {
    color: #ffffff !important;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

/* Сетка для карточек статистики */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-grid-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stats-grid-item {
    display: flex;
}

/* Адаптивность для сетки карточек */
@media (max-width: 1023px) and (min-width: 768px) {
    .stats-grid-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .stats-grid-row {
        grid-template-columns: 1fr;
    }
}

/* Карточки */
.card {
    background: rgba(230, 230, 235, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card-header {
    background: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Модальные окна */
.modal-content {
    background: rgba(230, 230, 235, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(209, 213, 219, 0.6);
}

/* Выпадающие меню */
.dropdown-menu {
    background: rgba(230, 230, 235, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(209, 213, 219, 0.6);
}

/* Списки */
.list-group-item {
    background: rgba(230, 230, 235, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(209, 213, 219, 0.6);
}

/* Внутренние блоки: формы, таблицы, заголовки */
.form-control,
.form-select {
    background: rgba(230, 230, 235, 0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(209, 213, 219, 0.6);
}

.input-group-text {
    background: rgba(229, 231, 235, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(209, 213, 219, 0.6);
}

.table th,
.table td {
    background: rgba(230, 230, 235, 0.4) !important;
}

.table-hover tbody tr:hover {
    background: rgba(229, 231, 235, 0.65) !important;
}

.card-header {
    background: rgba(230, 230, 235, 0.35) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card-footer {
    background: rgba(230, 230, 235, 0.35) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-header,
.modal-footer {
    background: rgba(230, 230, 235, 0.4) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-body {
    background: rgba(230, 230, 235, 0.3) !important;
}

.alert-light,
.alert-secondary {
    background: rgba(230, 230, 235, 0.6) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(209, 213, 219, 0.6);
}

.dropdown-item:hover {
    background: rgba(230, 230, 235, 0.5) !important;
}

.accordion-item {
    background: rgba(230, 230, 235, 0.45) !important;
}

.accordion-button {
    background: rgba(230, 230, 235, 0.5) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.accordion-button:not(.collapsed) {
    background: rgba(230, 230, 235, 0.6) !important;
}

.accordion-body {
    background: rgba(230, 230, 235, 0.35) !important;
}

/* Таблицы */
.table {
    margin-bottom: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    width: 100%;
    min-width: 600px;
    /* Позволяет таблице прокручиваться на маленьких экранах */
}

.table th {
    font-weight: 700;
    color: #5c4033;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: none;
    text-align: center;
}

/* Бейджи для статусов */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
}

.badge.bg-info {
    background-color: #3b82f6 !important;
}

.badge.bg-warning {
    background-color: #f59e0b !important;
    color: white;
}

.badge.bg-success {
    background-color: #10b981 !important;
}

.badge.bg-primary {
    background-color: #6366f1 !important;
}

/* Стили для статусов заказов */
.order-status {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: inherit;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.order-status.status-pending-client-approval {
    background-color: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.order-status.status-new {
    background-color: #3b82f6;
    color: white;
}

.order-status.status-waiting-payment {
    background-color: #f59e0b;
    color: white;
}

.order-status.status-paid {
    background-color: #10b981;
    color: white;
}

.order-status.status-packing {
    background-color: #06b6d4;
    color: white;
}

.order-status.status-shipped {
    background-color: #8b5cf6;
    color: white;
}

.order-status.status-delivered {
    background-color: #059669;
    color: white;
}

.order-status.status-cancelled {
    background-color: #ef4444;
    color: white;
}

.order-status.status-returned {
    background-color: #f97316;
    color: white;
}

/* Стили для select статуса заказа в списке */
.order-status-select {
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.order-status-select:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.order-status-select option {
    background-color: #e8e8ec;
    color: #1f2937;
    padding: 0.5rem;
}

/* Подсветка строки при смене статуса */
.order-row.status-changing {
    background-color: #fef3c7 !important;
    transition: background-color 0.3s ease;
    animation: statusChangePulse 2s ease-in-out;
}

@keyframes statusChangePulse {
    0% {
        background-color: #fef3c7;
    }
    50% {
        background-color: #fde68a;
    }
    100% {
        background-color: transparent;
    }
}

/* График-заглушка */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-placeholder {
    text-align: center;
    color: #6b7280;
}

.chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    margin-top: 1rem;
    padding: 0 2rem;
}

.chart-bar {
    width: 30px;
    background: linear-gradient(to top, #818cf8, #6366f1);
    border-radius: 4px 4px 0 0;
    margin: 0 5px;
}

/* Список клиентов */
.customers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.customer-item {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

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

.customer-name {
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.customer-channel {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.customer-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Адаптивность для планшетов */
@media (max-width: 1023px) and (min-width: 768px) {
    /* Планшет (768–1023px) */
    .sidebar {
        flex: 0 0 200px;
    }

    .topbar-title {
        font-size: 1.25rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Мобильное меню - бургер кнопка */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #1e293b;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.mobile-menu-toggle:hover {
    color: #6366f1;
}

@media (min-width: 1024px) {
    .topbar .mobile-menu-toggle {
        display: none !important;
    }
}

/* Бэкдроп для мобильного меню */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
}

/* Планшет 768–1023: бургер виден (как и на телефоне), т.к. сайдбар в режиме drawer — см. блок max-width 1023px ниже */
@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-menu-toggle {
        display: block !important;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        border: none;
        background: transparent;
        color: #1e293b;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 1031;
    }
}

@media (max-width: 767px) {
    /* Телефон (< 768px) */
    .mobile-menu-toggle {
        display: block !important;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        border: none;
        background: transparent;
        color: #1e293b;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 1031;
    }

    .app-shell {
        position: relative;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Сайдбар скрыт по умолчанию на мобильных */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        flex: none !important;
    }

    .sidebar.show {
        left: 0 !important;
    }

    .app-main {
        width: 100% !important;
        margin-left: 0 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Topbar для мобильных */
    .topbar {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1030;
        background: transparent;
    }

    .topbar-content {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .topbar-title {
        font-size: 1.1rem;
        font-weight: 600;
        flex: 1;
        min-width: 0;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
        max-width: 42vw;
    }

    .topbar-actions .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .search-form {
        display: none; /* Скрываем поиск на мобильных в topbar */
    }

    body.app-body-luxury .topbar-user-chip {
        max-width: 30vw;
        padding: 0.25rem 0.4rem;
    }

    body.app-body-luxury .topbar-user-meta {
        display: none;
    }

    body.app-body-luxury .topbar-user-avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .theme-switcher-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.3rem 0.45rem;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
        min-width: 36px;
        min-height: 36px;
    }

    /* Контент */
    .app-content {
        padding: 0.75rem;
    }

    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card {
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    /* Статистика */
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stats-grid-row {
        grid-template-columns: 1fr;
    }

    .stat-card {
        margin-bottom: 0;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-growth {
        font-size: 0.8rem;
    }

    /* Таблицы - улучшенная адаптивность */
    .table-responsive {
        margin: -0.75rem;
        padding: 0.75rem;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        overflow-y: visible;
    }

    .table-responsive .table {
        min-width: 600px;
        font-size: 0.875rem;
        width: 100%;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
        white-space: nowrap;
        font-size: 0.875rem;
    }

    .table th {
        font-size: 0.75rem;
        font-weight: 600;
    }

    /* Альтернативный вид таблиц на мобильных - карточки */
    .table-mobile-card {
        display: none;
    }

    /* Формы */
    .form-control,
    .form-select,
    textarea.form-control {
        font-size: 16px !important; /* Предотвращает зум на iOS */
        padding: 0.625rem 0.75rem;
        border-radius: 0.375rem;
        border: 1px solid #d1d5db;
        width: 100%;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
        outline: none;
    }

    .form-label {
        font-size: 0.9rem;
        font-weight: 500;
        margin-bottom: 0.375rem;
        display: block;
    }

    .form-row,
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .form-row > *,
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        margin-bottom: 0.75rem;
    }

    /* Кнопки */
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
        white-space: nowrap;
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.375rem;
        font-weight: 500;
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        min-height: 40px;
    }

    .btn-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .btn-group .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }

    /* Фильтры и поиск */
    .d-flex.flex-wrap.gap-2,
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .d-flex.flex-wrap.gap-2 .form-control,
    .d-flex.flex-wrap.gap-2 .form-select,
    .d-flex.gap-2 .form-control,
    .d-flex.gap-2 .form-select {
        width: 100%;
        margin-bottom: 0;
    }

    /* Бейджи */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        display: inline-block;
    }

    /* Каталог */
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Модальные окна - улучшения для мобильных */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .modal-content {
        border-radius: 0.5rem;
        max-height: calc(100vh - 1rem);
        display: flex;
        flex-direction: column;
    }

    .modal-header {
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
        flex-shrink: 0;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 1rem;
        border-top: 1px solid #e5e7eb;
        flex-shrink: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }

    /* Навигация в сайдбаре — старый макет */
    body:not(.app-body-luxury) .sidebar .nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    body:not(.app-body-luxury) .sidebar .nav-icon {
        width: 1.25rem;
        flex-shrink: 0;
    }

    body:not(.app-body-luxury) .sidebar-brand {
        padding: 1rem;
        font-size: 1.1rem;
        border-bottom: 1px solid #334155;
    }

    body:not(.app-body-luxury) .sidebar-footer {
        padding: 1rem;
        border-top: 1px solid #334155;
    }

    /* Портал: касание + без чужих границ шапки/футера сайдбара */
    body.app-body-luxury .sidebar .nav-link {
        min-height: 44px;
        padding: 0.65rem 1rem;
    }

    body.app-body-luxury .sidebar .nav-link .nav-icon {
        flex-shrink: 0;
    }

    body.app-body-luxury .sidebar-footer {
        padding: 0.5rem 0.75rem 1rem;
    }

    .sidebar-footer .btn {
        width: 100%;
        min-height: 44px;
    }

    /* Пагинация */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Формы */
    .form-label {
        font-size: 0.9rem;
        font-weight: 500;
        margin-bottom: 0.375rem;
    }

    .form-control,
    .form-select {
        padding: 0.625rem 0.75rem;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
    }

    /* Карточки форм */
    .card {
        margin-bottom: 1rem;
    }

    /* Кнопки действий */
    .btn-group {
        flex-wrap: wrap;
    }

    .btn-group .btn {
        flex: 1;
        min-width: auto;
    }

    /* Списки */
    .list-group-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Алерты */
    .alert {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }

    /* Модальные окна - улучшения */
    .modal-header .btn-close {
        margin: -0.5rem -0.5rem -0.5rem auto;
        padding: 0.5rem;
    }

    /* Улучшение читаемости текста */
    p, li, span {
        line-height: 1.6;
    }

    /* Оптимизация для touch-устройств */
    a, button, .btn, .nav-link {
        min-height: 44px; /* Минимальный размер для удобного нажатия */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    /* Очень маленькие экраны */
    .topbar-title {
        font-size: 0.95rem;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.375rem 0.25rem;
        font-size: 0.8rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-growth {
        font-size: 0.75rem;
    }

    .table-responsive .table {
        min-width: 500px;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    /* Сайдбар на планшетах - скрыт, открывается по клику */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        width: 280px !important;
        max-width: 85vw !important;
    }
    
    .sidebar.show {
        left: 0 !important;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .app-content {
        padding: 0.5rem;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Дополнительные улучшения для планшетов */
@media (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }

    .main-content {
        margin-left: 280px;
    }

    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-responsive .table {
        min-width: 700px;
    }
}

/* Улучшения для всех мобильных устройств */
@media (max-width: 1024px) {
    /* Улучшение читаемости текста */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    h1, .h1 {
        font-size: 1.5rem;
    }

    h2, .h2 {
        font-size: 1.25rem;
    }

    h3, .h3 {
        font-size: 1.1rem;
    }

    h4, .h4 {
        font-size: 1rem;
    }

    /* Улучшение пагинации */
    .pagination {
        font-size: 0.875rem;
    }

    .page-link {
        padding: 0.5rem 0.75rem;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Улучшение списков */
    .list-group-item {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    /* Улучшение алертов */
    .alert {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
        border-radius: 0.5rem;
    }

    /* Улучшение dropdown меню */
    .dropdown-menu {
        font-size: 0.875rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .dropdown-item {
        padding: 0.625rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Улучшение input групп */
    .input-group {
        flex-wrap: wrap;
    }

    .input-group .form-control,
    .input-group .form-select {
        flex: 1;
        min-width: 0;
    }

    /* Улучшение карточек с действиями */
    .card-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .card-actions .btn {
        width: 100%;
    }
}

/* Стили для страниц авторизации */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

/* Нейтральная тема портала (как у вошедшего пользователя): фон на body.auth-portal-body */
body.auth-portal-body .auth-page {
    background: transparent;
    min-height: min(100vh, 100dvh);
    padding: 1.25rem;
}

body.auth-portal-body .app-main {
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-card {
    background: rgba(230, 230, 235, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 1rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    text-align: center;
}

body.auth-portal-body .auth-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    box-shadow:
        0 8px 40px rgba(15, 23, 42, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    text-align: center;
}

.auth-logo {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-logo .auth-brand-name {
    margin: 0;
    color: #6366f1;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.25;
}

body.auth-portal-body .auth-logo .auth-brand-name {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-weight: 600;
    font-size: 1.65rem;
    letter-spacing: 0.02em;
    color: #f8fafc;
    text-shadow: var(--crm-sidebar-brand-text-shadow, 0 0 24px rgba(94, 234, 212, 0.25), 0 1px 2px rgba(15, 23, 42, 0.5));
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

body.auth-portal-body .auth-title {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    color: #f8fafc;
    margin-top: 0.25rem;
    text-shadow: 0 2px 16px rgba(15, 23, 42, 0.28);
}

.auth-subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1rem;
}

body.auth-portal-body .auth-subtitle {
    color: #cfe3ff;
    font-weight: 500;
}

body.auth-portal-body .auth-page .form-label {
    color: #eef4ff;
    font-weight: 600;
    text-shadow: 0 1px 10px rgba(15, 23, 42, 0.2);
}

body.auth-portal-body .auth-page .form-text {
    color: rgba(255, 255, 255, 0.45);
}

body.auth-portal-body .auth-page .text-danger {
    color: #fecaca !important;
}

body.auth-portal-body .auth-page h5 {
    color: rgba(248, 250, 252, 0.95);
    font-size: 1rem;
    font-weight: 600;
}

body.auth-portal-body .auth-page hr {
    border-color: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.auth-input {
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

body.auth-portal-body .auth-input {
    background: linear-gradient(180deg, rgba(210, 222, 248, 0.22) 0%, rgba(173, 189, 222, 0.18) 100%);
    border: 1px solid rgba(255, 255, 255, 0.26);
    color: #f8fafc;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 8px 20px rgba(15, 23, 42, 0.12);
}

body.auth-portal-body .auth-input::placeholder {
    color: rgba(226, 238, 255, 0.72);
}

body.auth-portal-body .auth-input:focus {
    background: linear-gradient(180deg, rgba(221, 232, 255, 0.26) 0%, rgba(184, 201, 235, 0.2) 100%);
    border-color: rgba(94, 234, 212, 0.55);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.auth-input:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-button {
    background: linear-gradient(to right, #6366f1, #8b5cf6);
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

body.auth-portal-body .auth-button {
    background: linear-gradient(135deg, #5eead4 0%, #22d3ee 45%, #38bdf8 100%);
    border: none;
    color: #08263a;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 18px rgba(34, 211, 238, 0.35);
}

body.auth-portal-body .auth-button:hover {
    color: #0f172a;
    box-shadow: 0 8px 28px rgba(34, 211, 238, 0.45);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(9, 102, 241, 0.3);
    color: white;
}

.auth-button:active {
    transform: translateY(0);
}

.auth-link {
    color: #6366f1;
    text-decoration: none;
    font-size: 0.875rem;
}

body.auth-portal-body .auth-link {
    color: #b9f2ff;
    font-weight: 500;
}

body.auth-portal-body .auth-link:hover {
    color: #fff;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-footer {
    margin-top: 1.5rem;
}

.auth-2fa-hint {
    background: rgba(229, 231, 235, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    color: #475569;
}

body.auth-portal-body .auth-2fa-hint {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(226, 232, 240, 0.88);
    text-align: left;
}

/* Стили для страницы настройки 2FA */
.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.qr-code {
    width: 200px;
    height: 200px;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    background: rgba(230, 230, 235, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 0.5rem;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.backup-code {
    background: rgba(229, 231, 235, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.75rem;
    text-align: center;
    font-family: monospace;
    font-size: 0.875rem;
}

.setup-steps .step {
    display: none;
}

.setup-steps .step.active {
    display: block;
}

.setup-steps .step h5 {
    margin-bottom: 1rem;
}

.setup-steps .step p {
    margin-bottom: 1rem;
}

.setup-steps .step ul {
    margin-bottom: 1.5rem;
}

.setup-steps .step button {
    margin-right: 0.5rem;
}



/* Переключаемый сайдбар — старый стиль (портал задаёт токены в .app-body-luxury) */
body:not(.app-body-luxury) .sidebar-toggle {
    position: absolute;
    right: 0.5rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(80, 60, 100, 0.4);
    color: #e8d9a8;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    cursor: pointer;
}

body:not(.app-body-luxury) .sidebar-toggle:hover {
    background: rgba(80, 60, 100, 0.6);
    color: #f4e4a6;
}

/* Состояние свернутого меню — только иконки (десктоп 1024px+) */
@media (min-width: 1024px) {
    .app-shell.sidebar-collapsed .sidebar {
        width: 72px !important;
        min-width: 72px !important;
    }

    .app-shell.sidebar-collapsed .sidebar-header-row {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 0.5rem;
    }

    .app-shell.sidebar-collapsed .sidebar-brand {
        display: none;
    }

    .app-shell.sidebar-collapsed .sidebar-header-row .sidebar-toggle {
        position: static;
        margin: 0 auto;
        right: auto;
    }

    .app-shell.sidebar-collapsed .sidebar-brand-title,
    .app-shell.sidebar-collapsed .sidebar-brand-line1,
    .app-shell.sidebar-collapsed .sidebar-brand-line2 {
        display: none !important;
    }

    .app-shell.sidebar-collapsed .sidebar-toggle {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        right: 0.35rem;
    }


    .app-shell.sidebar-collapsed .nav-label {
        display: none !important;
    }

    .app-shell.sidebar-collapsed .sidebar .nav {
        align-items: center;
        padding: 0 0.5rem;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-item {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-link {
        justify-content: center;
        align-items: center;
        padding: 0.6rem;
        margin: 0.15rem 0;
        width: 44px;
        min-width: 44px;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-link .nav-icon,
    .app-shell.sidebar-collapsed .sidebar .nav-link i {
        margin-right: 0 !important;
        margin-left: 0 !important;
        width: 1.25rem;
        text-align: center;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-link .me-2 {
        margin-right: 0 !important;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-link > span {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .app-shell.sidebar-collapsed .sidebar-chevron {
        display: none !important;
    }

    .app-shell.sidebar-collapsed .sidebar .collapse {
        display: none !important;
    }

    .app-shell.sidebar-collapsed .sidebar #settingsMenu {
        display: none !important;
    }

    .app-shell.sidebar-collapsed .sidebar .nav-link[data-bs-toggle="collapse"] {
        pointer-events: auto;
    }

    .app-shell.sidebar-collapsed .main-content,
    .app-shell.sidebar-collapsed .app-main {
        margin-left: 72px !important;
    }

    .app-shell.sidebar-collapsed .sidebar {
        flex: 0 0 72px !important;
        overflow: visible !important;
    }

    .app-shell.sidebar-collapsed .sidebar-inner {
        overflow: visible !important;
    }
}

.sidebar-settings-item {
    position: relative;
}

.sidebar-settings-item .nav-link {
    display: flex;
    align-items: center;
}

/* Settings dictionaries: browser-like tabs */
.settings-dictionaries-page .dict-title,
.settings-dictionaries-page .dict-subtitle {
    color: #ffffff;
}

.settings-dictionaries-page .dictionaries-tabs-header {
    background: #f3f4f6;
    border-bottom: 1px solid #d7dde6;
}

.settings-dictionaries-page #dictionaries-tabs.browser-like-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #b8c2d0 transparent;
    padding-bottom: 0;
}

.settings-dictionaries-page #dictionaries-tabs.browser-like-tabs .nav-item {
    flex: 0 0 auto;
}

.settings-dictionaries-page #dictionaries-tabs.browser-like-tabs .nav-link {
    margin-right: 4px;
    border: 1px solid #c5ceda;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #e9eef5;
    color: #3a4a60;
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
}

.settings-dictionaries-page #dictionaries-tabs.browser-like-tabs .nav-link:hover {
    background: #f3f6fb;
    color: #1f2d3d;
}

.settings-dictionaries-page #dictionaries-tabs.browser-like-tabs .nav-link.active {
    background: #ffffff;
    color: #0f172a;
    border-color: #c5ceda;
    position: relative;
    top: 1px;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs {
    counter-reset: dictsteps;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item {
    width: auto;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .dictionary-inline-panel-host {
    display: none;
    margin: 12px 14px 8px 72px;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .dictionary-inline-panel-host.open {
    display: block;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px 8px 54px;
    border: 0;
    border-radius: 12px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.1px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
    white-space: nowrap;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-link::before {
    counter-increment: dictsteps;
    content: counter(dictsteps, decimal-leading-zero);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    color: #0f172a;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-link::after {
    content: none;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(15, 23, 42, 0.26);
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-link.active {
    outline: 2px solid rgba(255, 255, 255, 0.95);
    outline-offset: 1px;
}

.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(1) .nav-link { background: linear-gradient(90deg, #0ea5a6, #14b8a6); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(2) .nav-link { background: linear-gradient(90deg, #f59e0b, #fb923c); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(3) .nav-link { background: linear-gradient(90deg, #f97316, #ef4444); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(4) .nav-link { background: linear-gradient(90deg, #e11d48, #db2777); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(5) .nav-link { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(6) .nav-link { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(7) .nav-link { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(8) .nav-link { background: linear-gradient(90deg, #b45309, #f59e0b); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(9) .nav-link { background: linear-gradient(90deg, #be123c, #f43f5e); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(10) .nav-link { background: linear-gradient(90deg, #4338ca, #6366f1); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(11) .nav-link { background: linear-gradient(90deg, #1d4ed8, #0ea5e9); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(12) .nav-link { background: linear-gradient(90deg, #0f766e, #22c55e); }
.settings-dictionaries-page #dictionaries-tabs.infographic-tabs .nav-item:nth-child(13) .nav-link { background: linear-gradient(90deg, #7c3aed, #c026d3); }

.dashboard-layout.sidebar-collapsed .sidebar,
.dashboard-layout.sidebar-collapsed .main-content {
    /* fallback для совместимости */
}

/* Выравнивание — старый макет; портал: flex-start через .app-body-luxury */
body:not(.app-body-luxury) .sidebar-nav .nav-link,
body:not(.app-body-luxury) .sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-short {
    display: none;
}

/* Catalog grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 576px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .catalog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .catalog-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .catalog-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1400px) {
    .catalog-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
.app-shell {
    min-height: 100vh;
    display: flex;
}

/* Базовые стили сайдбара для десктопа */
@media (min-width: 768px) {
    .sidebar {
        flex: 0 0 280px;
        background: linear-gradient(to right, rgba(45, 30, 65, 0.32), rgba(45, 30, 65, 0.1));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: #ffffff;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        position: sticky;
        top: 0;
        overflow-y: auto;
        overflow-x: hidden;
        border-radius: 0 1rem 1rem 0;
        border: 1px solid rgba(212, 175, 55, 0.35);
        box-shadow: 0 0 20px rgba(212, 175, 55, 0.08);
    }
}

/* Закрытие сайдбара на мобильных при клике на ссылку */
@media (max-width: 767px) {
    .sidebar {
        flex: none !important;
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 1050 !important;
    }
    
    body:not(.app-body-luxury) .sidebar .nav-link:active,
    body:not(.app-body-luxury) .sidebar .nav-link:focus {
        outline: none;
    }
}

.app-main {
    min-height: 100vh;
    background: transparent;
    flex: 1 1 auto;
    min-width: 0;
}

.app-content {
    flex: 1 1 auto;
}

/* Форма заказа: область таблицы позиций заполняет оставшуюся высоту экрана */
@media (min-width: 768px) {
    body.order-form-route .app-shell {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
    }

    body.order-form-route .app-main {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
    }

    body.order-form-route .app-content.order-form-page-content {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    body.order-form-route .topbar {
        flex-shrink: 0;
    }
}

.order-form-page {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.order-form-page .order-form-card-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Не растягиваем область таблицы на всю высоту — итоги остаются сразу под прайсом, граница видна */
.order-form-page .order-form-items-grow {
    flex: 0 1 auto;
    min-height: 0;
}

.order-form-page .order-form-items-table-wrap {
    overflow: auto;
    min-height: 8rem;
    max-height: min(48vh, 26rem);
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
    .order-form-page .order-form-items-table-wrap {
        max-height: min(52vh, 32rem);
    }
}

.order-form-page .order-form-card > .card-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.app-body-luxury .order-form-page .order-form-totals-section {
    margin-top: 0.35rem;
    padding: 0.5rem 0.65rem 0.6rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] body.app-body-luxury .order-form-page .order-form-totals-section {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(248, 250, 252, 0.85);
}

@media (max-width: 767px) {
    .order-form-page .order-form-items-table-wrap {
        max-height: min(55vh, 22rem);
    }

    .auth-page {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }

    body.auth-portal-body .auth-card {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    body.auth-portal-body .auth-title {
        font-size: 1.45rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }
}

/* Дополнительные улучшения для мобильных устройств */

/* Улучшение для таблиц - альтернативный вид на мобильных */
@media (max-width: 767px) {
    /* Скрываем некоторые колонки на мобильных */
    .table th:nth-child(n+4),
    .table td:nth-child(n+4) {
        display: none;
    }

    /* Показываем важные колонки */
    .table th:first-child,
    .table td:first-child,
    .table th:nth-child(2),
    .table td:nth-child(2),
    .table th:nth-child(3),
    .table td:nth-child(3) {
        display: table-cell;
    }

    /* Улучшение для таблиц с действиями */
    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .table-actions .btn {
        width: 100%;
    }
}

/* Улучшение для форм поиска и фильтров */
@media (max-width: 767px) {
    .search-filters {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-filters .form-control,
    .search-filters .form-select {
        width: 100%;
        margin-bottom: 0;
    }

    .search-filters .btn {
        width: 100%;
    }
}

/* Улучшение для карточек товаров/продуктов */
@media (max-width: 767px) {
    .product-card,
    .item-card {
        margin-bottom: 1rem;
    }

    .product-card .card-body,
    .item-card .card-body {
        padding: 1rem;
    }

    .product-card .card-title,
    .item-card .card-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .product-card .card-text,
    .item-card .card-text {
        font-size: 0.875rem;
    }
}

/* Улучшение для навигации */
@media (max-width: 767px) {
    .breadcrumb {
        font-size: 0.875rem;
        flex-wrap: wrap;
    }

    .breadcrumb-item {
        padding: 0.25rem 0;
    }
}

/* Улучшение для футера */
@media (max-width: 767px) {
    .app-footer {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    .app-footer .container-fluid {
        padding: 0;
    }
}

/* Улучшение для сайдбара на мобильных — только старый макет */
@media (max-width: 767px) {
    body:not(.app-body-luxury) .sidebar-inner {
        padding: 0;
    }

    body:not(.app-body-luxury) .sidebar .nav-link {
        border-radius: 0;
        margin: 0;
    }

    body:not(.app-body-luxury) .sidebar .nav-link.active {
        background: transparent;
        border-left: none;
    }
    body:not(.app-body-luxury) .sidebar .nav-link.active::before {
        height: 24px;
    }
}

/* Улучшение для topbar на мобильных */
@media (max-width: 767px) {
    .topbar .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .topbar-actions .btn-sm {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Улучшение для модальных окон на мобильных */
@media (max-width: 767px) {
    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
        margin: 0.5rem;
    }

    .modal-fullscreen-sm-down {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
}

/* Улучшение для пагинации на мобильных */
@media (max-width: 767px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pagination .page-item {
        margin: 0.25rem;
    }

    .pagination .page-link {
        min-width: 40px;
        min-height: 40px;
        padding: 0.375rem 0.5rem;
    }
}

/* КРИТИЧЕСКИ ВАЖНО: Строгие правила для мобильных устройств - должны быть в конце файла */
@media (max-width: 1023px) {
    /* На планшетах и телефонах сайдбар должен быть скрыт по умолчанию */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        z-index: 1050 !important;
        flex: none !important;
        transition: left 0.3s ease !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Выше выпадающих фильтров прайса/заказов/клиентов (z-index ~3100 внутри контента) */
    .sidebar.show {
        left: 0 !important;
        z-index: 4000 !important;
    }

    .sidebar-backdrop.show {
        z-index: 3990 !important;
    }
    
    /* Основной контент занимает всю ширину */
    .app-main {
        width: 100% !important;
        margin-left: 0 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .app-shell {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* Панель поиска прайса */
.search-panel {
    background: rgba(230, 230, 235, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.04);
}

.search-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    align-items: flex-end;
}

.search-row .search-field {
    flex: 1;
    min-width: 0;
}

.search-row .search-chip,
.search-row .search-toggle {
    flex-shrink: 0;
}

.search-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.search-toggle .chip-title {
    font-size: 12px;
    opacity: .7;
    margin-bottom: 6px;
    display: block;
}

.search-row .search-toggle .neumorphic-toggle-container {
    height: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.search-row .search-actions {
    flex-shrink: 0;
}

.search-field .input-group .form-control,
.search-field .input-group .input-group-text {
    border-radius: 12px;
}

.search-field .input-group .input-group-text {
    background: rgba(229, 231, 235, 0.6);
    border: 1px solid rgba(0,0,0,.10);
}

.search-field .form-control {
    border: 1px solid rgba(0,0,0,.10);
    padding: 10px 12px;
    height: 42px;
    box-sizing: border-box;
}

.search-field .form-control:focus {
    box-shadow: 0 0 0 .20rem rgba(13,110,253,.12);
}

.search-field .chip-title {
    font-size: 12px;
    opacity: .7;
    margin-bottom: 6px;
    display: block;
}

.search-chip {
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(230, 230, 235, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 10px 12px;
    min-width: 170px;
}

.search-row .search-chip {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.search-chip .chip-title {
    font-size: 12px;
    opacity: .7;
    margin-bottom: 6px;
}

.search-chip .form-select {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.10);
    padding: 8px 12px;
    background: rgba(230, 230, 235, 0.6);
}

.search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.search-actions .btn {
    width: 250px;
    min-width: 250px;
    height: 42px;
    box-sizing: border-box;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

@media (max-width: 576px) {
    .search-row {
        flex-wrap: wrap;
    }
    .search-row .search-field {
        flex: 1 1 100%;
    }
    .search-actions {
        flex: 1 1 100%;
        justify-content: stretch;
    }
    .search-actions .btn {
        flex: 1;
    }
}

/* =============================================================================
   Фон портала «Мелодия флаконов» — морская / glass-референс (только фон)
   Слева пурпур, справа бирюза/циан; мягкая дымка, «отражение» снизу
   Хук: body.app-body-luxury  |  опционально: .app-shell.app-shell-background
   ============================================================================= */

body.app-body-luxury,
body.auth-portal-body {
    font-family: var(--crm-font-sans, 'Inter', system-ui, -apple-system, sans-serif);
    min-height: 100vh;
    color: var(--crm-text-primary, #fff);
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
    /* Морской сумеречный градиент: пурпур → сине-бирюзовый */
    background:
        radial-gradient(ellipse 92% 78% at 50% 44%, rgba(15, 23, 42, 0.28) 0%, transparent 60%),
        radial-gradient(ellipse 140% 60% at 50% 118%, rgba(45, 212, 191, 0.2) 0%, transparent 52%),
        radial-gradient(ellipse 95% 100% at 94% 32%, rgba(79, 209, 197, 0.42) 0%, transparent 50%),
        radial-gradient(ellipse 90% 95% at 6% 48%, rgba(107, 33, 168, 0.38) 0%, transparent 48%),
        linear-gradient(
            118deg,
            #2e1064 0%,
            #4c1d95 18%,
            #312e81 38%,
            #134e4a 62%,
            #0e7490 82%,
            #164e63 100%
        );
    background-attachment: fixed;
}

/* Морская дымка: циан справа, фиолет слева, мягкие «волны» света */
body.app-body-luxury::before,
body.auth-portal-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 100% 55% at 86% 24%, rgba(94, 234, 212, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse 85% 65% at 10% 58%, rgba(192, 132, 252, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 70% 45% at 50% 8%, rgba(224, 242, 254, 0.15) 0%, transparent 38%),
        linear-gradient(
            128deg,
            transparent 0%,
            rgba(45, 212, 191, 0.14) 32%,
            transparent 48%,
            rgba(167, 139, 250, 0.12) 68%,
            transparent 100%
        );
    mix-blend-mode: screen;
    opacity: 0.72;
    animation: marine-glow-drift 90s ease-in-out infinite alternate;
}

/* Лёгкая «брызга / соль» — не звёзды, а морская пыль */
body.app-body-luxury::after,
body.auth-portal-body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        radial-gradient(rgba(200, 250, 255, 0.55) 0.4px, transparent 0.4px),
        radial-gradient(rgba(255, 255, 255, 0.5) 0.35px, transparent 0.35px),
        radial-gradient(rgba(165, 243, 252, 0.4) 0.85px, transparent 0.85px);
    background-size: 19px 21px, 34px 36px, 58px 62px;
    background-position: 0 0, 12px 18px, 5px 9px;
    opacity: 0.055;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.1));
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.1));
    animation: marine-sparkle 16s ease-in-out infinite;
}

@keyframes marine-glow-drift {
    0% {
        filter: hue-rotate(-6deg) saturate(1.05);
        transform: scale(1);
    }
    100% {
        filter: hue-rotate(10deg) saturate(1.12);
        transform: scale(1.015);
    }
}

@keyframes marine-sparkle {
    0%,
    100% {
        opacity: 0.04;
    }
    40% {
        opacity: 0.075;
    }
    70% {
        opacity: 0.05;
    }
}

/* Опционально: тот же фон на #appShell */
.app-shell.app-shell-background {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse 92% 78% at 50% 44%, rgba(15, 23, 42, 0.28) 0%, transparent 60%),
        radial-gradient(ellipse 140% 60% at 50% 118%, rgba(45, 212, 191, 0.2) 0%, transparent 52%),
        radial-gradient(ellipse 95% 100% at 94% 32%, rgba(79, 209, 197, 0.42) 0%, transparent 50%),
        radial-gradient(ellipse 90% 95% at 6% 48%, rgba(107, 33, 168, 0.38) 0%, transparent 48%),
        linear-gradient(118deg, #2e1064 0%, #4c1d95 18%, #312e81 38%, #134e4a 62%, #0e7490 82%, #164e63 100%);
    background-attachment: fixed;
}

.app-shell.app-shell-background::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(ellipse 100% 55% at 86% 24%, rgba(94, 234, 212, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse 85% 65% at 10% 58%, rgba(192, 132, 252, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse 70% 45% at 50% 8%, rgba(224, 242, 254, 0.15) 0%, transparent 38%),
        linear-gradient(
            128deg,
            transparent 0%,
            rgba(45, 212, 191, 0.14) 32%,
            transparent 48%,
            rgba(167, 139, 250, 0.12) 68%,
            transparent 100%
        );
    mix-blend-mode: screen;
    opacity: 0.72;
    animation: marine-glow-drift 90s ease-in-out infinite alternate;
}

.app-shell.app-shell-background::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        radial-gradient(rgba(200, 250, 255, 0.55) 0.4px, transparent 0.4px),
        radial-gradient(rgba(255, 255, 255, 0.5) 0.35px, transparent 0.35px),
        radial-gradient(rgba(165, 243, 252, 0.4) 0.85px, transparent 0.85px);
    background-size: 19px 21px, 34px 36px, 58px 62px;
    background-position: 0 0, 12px 18px, 5px 9px;
    opacity: 0.055;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.1));
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.1));
    animation: marine-sparkle 16s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    body.app-body-luxury::before,
    body.auth-portal-body::before,
    .app-shell.app-shell-background::before {
        animation: none;
    }
    body.app-body-luxury::after,
    body.auth-portal-body::after,
    .app-shell.app-shell-background::after {
        animation: none;
        opacity: 0.05;
    }
}

body.app-body-luxury .app-footer {
    background: rgba(15, 5, 17, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.45) !important;
}

body.app-body-luxury .app-footer-luxury {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.app-body-luxury .app-footer-link {
    color: rgba(212, 175, 55, 0.85);
}

body.app-body-luxury .app-footer-link:hover {
    color: #f4e4a6;
}

.font-display {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
}

/* --- Topbar --- */
.topbar-luxury {
    background: transparent !important;
    border-bottom: none !important;
    padding: 1rem 0 0.5rem;
}

body.app-body-luxury .topbar-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600;
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    color: var(--crm-topbar-title-color, #fff);
    letter-spacing: 0.02em;
    text-shadow: var(--crm-topbar-title-shadow, 0 0 24px rgba(233, 30, 99, 0.15));
}

.btn-icon-glass {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.6;
}

/* Пользователь в топбаре — те же токены, что у бывшей карточки в сайдбаре */
body.app-body-luxury .topbar-user-chip {
    max-width: min(220px, 42vw);
    padding: 0.35rem 0.65rem 0.35rem 0.4rem;
    border-radius: 999px;
    border: var(--crm-sidebar-user-card-border, 1px solid rgba(255, 255, 255, 0.18));
    background: var(--crm-sidebar-user-card-bg, rgba(255, 255, 255, 0.1));
    box-shadow: var(--crm-sidebar-user-card-shadow, 0 4px 16px rgba(15, 23, 42, 0.2));
}

body.app-body-luxury .topbar-user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    background: var(--crm-sidebar-avatar-bg, linear-gradient(145deg, rgba(94, 234, 212, 0.35) 0%, rgba(167, 139, 250, 0.4) 100%));
    border: var(--crm-sidebar-avatar-border, 1px solid rgba(255, 255, 255, 0.35));
    color: var(--crm-sidebar-avatar-color, #f8fafc);
    box-shadow: var(--crm-sidebar-avatar-shadow, 0 0 16px rgba(45, 212, 191, 0.2));
}

body.app-body-luxury .topbar-user-name {
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.2;
    color: var(--crm-sidebar-username-color, #f8fafc);
}

body.app-body-luxury .topbar-user-role {
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--crm-sidebar-role-color, rgba(204, 251, 241, 0.65));
}

/* --- Sidebar: токены темы (--crm-sidebar-*) --- */
body.app-body-luxury .sidebar {
    background: var(--crm-sidebar-bg) !important;
    border: var(--crm-sidebar-border) !important;
    border-radius: 0 1.35rem 1.35rem 0 !important;
    box-shadow: var(--crm-sidebar-shadow) !important;
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
}

body.app-body-luxury .sidebar-inner {
    position: relative;
    z-index: 1;
}

/* Логотипное название — золото + объём (премиум, только .sidebar-premium) */
body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-line1,
body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-line2 {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-weight: 600;
    font-size: clamp(1.75rem, 1.35rem + 1.1vw, 2.125rem);
    line-height: 1.08;
    letter-spacing: 0.02em;
    /* Золотой градиент в буквах */
    background: linear-gradient(
        168deg,
        #fff9e8 0%,
        #f4e4a6 14%,
        #e8c547 32%,
        #d4af37 48%,
        #b8860b 64%,
        #8b6914 82%,
        #5c4a0f 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    /* Объём: блик сверху, тень снизу, глубина */
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35)) drop-shadow(0 2px 1px rgba(40, 28, 8, 0.55))
        drop-shadow(0 5px 14px rgba(0, 0, 0, 0.35));
}

/* Браузеры без background-clip: text — сплошное золото + тени */
@supports not (background-clip: text) {
    body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-line1,
    body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-line2 {
        background: none;
        color: #d4af37;
        -webkit-text-fill-color: currentColor;
        text-shadow:
            0 1px 0 rgba(255, 250, 230, 0.65),
            0 2px 0 rgba(139, 105, 20, 0.45),
            0 4px 6px rgba(0, 0, 0, 0.4),
            0 6px 20px rgba(212, 175, 55, 0.35);
        filter: none;
    }
}

html[data-theme="light"] body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-line1,
html[data-theme="light"] body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-line2 {
    background: linear-gradient(
        168deg,
        #fffef8 0%,
        #f0e0a8 18%,
        #d4af37 45%,
        #a67c1a 70%,
        #6b5410 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.65)) drop-shadow(0 2px 2px rgba(60, 48, 12, 0.4))
        drop-shadow(0 4px 12px rgba(139, 105, 20, 0.25));
}

body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.02em;
}

body.app-body-luxury .sidebar .sidebar-premium .sidebar-brand-row {
    margin-bottom: 0.25rem;
}

/* Пункты меню — Inter, ровная сетка, больше воздуха */
body.app-body-luxury .sidebar .sidebar-premium .sidebar-nav-primary > .nav-item {
    margin-bottom: 0.45rem;
}

body.app-body-luxury .sidebar .sidebar-premium .sidebar-nav-primary > .nav-item:last-child {
    margin-bottom: 0;
}

body.app-body-luxury .sidebar .sidebar-premium .nav-link {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    min-height: 50px;
    padding: 0.65rem 1.15rem;
    gap: 0.8rem;
    border-radius: 15px;
    align-items: center;
    margin-bottom: 0;
}

body.app-body-luxury .sidebar .sidebar-premium .nav-link .nav-icon {
    width: 1.35rem;
    font-size: 1.05rem;
    opacity: 0.95;
}

body.app-body-luxury .sidebar .sidebar-premium .nav-link[data-bs-toggle='collapse'] {
    gap: 0.5rem;
}

body.app-body-luxury .sidebar .nav-link {
    color: var(--crm-sidebar-nav-color, rgba(248, 250, 252, 0.88));
    border-radius: 0.85rem;
    padding: 0.55rem 0.95rem;
    gap: 0.65rem;
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    /* Bootstrap nav-pills: не подсвечивать неактивные как «таб» */
    background: transparent;
}

body.app-body-luxury .sidebar .nav-pills .nav-link:not(.active) {
    background: transparent;
}

body.app-body-luxury .sidebar a.nav-link:focus-visible {
    outline: 2px solid rgba(94, 234, 212, 0.55);
    outline-offset: 2px;
}

html[data-theme="light"] body.app-body-luxury .sidebar a.nav-link:focus-visible {
    outline-color: rgba(13, 148, 136, 0.55);
}

html[data-theme="dark"] body.app-body-luxury .sidebar a.nav-link:focus-visible {
    outline-color: rgba(148, 163, 184, 0.65);
}

body.app-body-luxury .sidebar a.nav-link:focus:not(:focus-visible) {
    outline: none;
}

body.app-body-luxury .sidebar .nav-link:hover {
    color: var(--crm-sidebar-nav-hover-color, #fff);
    background: var(--crm-sidebar-nav-hover-bg, rgba(255, 255, 255, 0.1));
    border-color: var(--crm-sidebar-nav-hover-border, rgba(255, 255, 255, 0.12));
}

body.app-body-luxury .sidebar .nav-link .nav-icon {
    margin-right: 0;
    color: var(--crm-sidebar-nav-icon-color, rgba(94, 234, 212, 0.9));
    width: 1.35rem;
    text-align: center;
    filter: var(--crm-sidebar-nav-icon-filter, drop-shadow(0 0 6px rgba(45, 212, 191, 0.25)));
}

body.app-body-luxury .sidebar .nav-link:hover .nav-icon {
    color: var(--crm-sidebar-nav-icon-hover-color, #ccfbf1);
}

body.app-body-luxury .sidebar .nav-link.active .nav-icon {
    color: var(--crm-sidebar-nav-active-icon-color, #0f172a);
    filter: var(--crm-sidebar-nav-active-icon-filter, none);
}

body.app-body-luxury .sidebar .nav-link.active {
    color: var(--crm-sidebar-nav-active-color, #0f172a);
    font-weight: 600;
    background: var(--crm-sidebar-nav-active-bg, linear-gradient(135deg, #5eead4 0%, #22d3ee 45%, #38bdf8 100%));
    border-color: var(--crm-sidebar-nav-active-border, rgba(255, 255, 255, 0.45));
    box-shadow: var(--crm-sidebar-nav-active-shadow, 0 4px 18px rgba(34, 211, 238, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5));
}

body.app-body-luxury .sidebar .nav-link.active::before {
    display: none;
}

body.app-body-luxury .sidebar .collapse .nav-link.active::before {
    display: none !important;
    content: none;
}

body.app-body-luxury .sidebar .nav-link.nav-link-logout {
    color: var(--crm-sidebar-logout-color, rgba(254, 202, 202, 0.9));
}

body.app-body-luxury .sidebar .nav-link.nav-link-logout .nav-icon {
    color: var(--crm-sidebar-logout-icon, rgba(252, 165, 165, 0.95));
}

body.app-body-luxury .sidebar .nav-link.nav-link-logout:hover {
    background: var(--crm-sidebar-logout-hover-bg, rgba(248, 113, 113, 0.15));
    border-color: var(--crm-sidebar-logout-hover-border, rgba(248, 113, 113, 0.25));
    color: var(--crm-sidebar-logout-hover-color, #fff);
}

body.app-body-luxury .sidebar .sidebar-subnav .nav-link {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.25;
    padding: 0.5rem 0.85rem 0.5rem 1rem;
    margin-left: 0.5rem;
    margin-top: 0.2rem;
    min-height: 44px;
    border-left: 2px solid var(--crm-sidebar-subnav-border, rgba(125, 211, 252, 0.22));
    border-radius: 0 14px 14px 0;
    color: var(--crm-sidebar-subnav-color, #c7d2e6);
}

body.app-body-luxury .sidebar .sidebar-subnav .nav-link:hover {
    color: var(--crm-sidebar-nav-hover-color, #fff);
}

body.app-body-luxury .sidebar .sidebar-subnav .nav-link.active {
    font-weight: 600;
    color: var(--crm-sidebar-subnav-active-color, #08263a);
    border-left-color: transparent;
}

body.app-body-luxury .sidebar .sidebar-premium .sidebar-subnav {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

body.app-body-luxury .sidebar .sidebar-subnav .nav-link .nav-icon {
    width: 1.1rem;
    font-size: 0.92rem;
    opacity: 0.92;
}

body.app-body-luxury .sidebar .sidebar-toggle {
    color: var(--crm-sidebar-toggle-color, rgba(226, 232, 240, 0.85));
    border: var(--crm-sidebar-toggle-border, 1px solid rgba(255, 255, 255, 0.2));
    border-radius: 12px;
    background: var(--crm-sidebar-toggle-bg, rgba(255, 255, 255, 0.06));
}

body.app-body-luxury .sidebar .sidebar-toggle:hover {
    color: var(--crm-sidebar-toggle-hover-color, #fff);
    border-color: var(--crm-sidebar-toggle-hover-border, rgba(94, 234, 212, 0.45));
    background: var(--crm-sidebar-toggle-hover-bg, rgba(94, 234, 212, 0.12));
}

body.app-body-luxury .sidebar-footer {
    border-top: var(--crm-sidebar-footer-border, 1px solid rgba(255, 255, 255, 0.12));
    box-shadow: var(--crm-sidebar-footer-shadow, 0 -1px 0 rgba(45, 212, 191, 0.06));
}

body.app-body-luxury .sidebar {
    scrollbar-color: var(--crm-sidebar-scrollbar-thumb, rgba(94, 234, 212, 0.35)) transparent;
}

body.app-body-luxury .sidebar::-webkit-scrollbar {
    width: 6px;
}

body.app-body-luxury .sidebar::-webkit-scrollbar-track {
    background: transparent;
}

body.app-body-luxury .sidebar::-webkit-scrollbar-thumb {
    background: var(--crm-sidebar-scrollbar-gradient, rgba(125, 211, 252, 0.28));
    border-radius: 6px;
}

body.app-body-luxury .sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(125, 211, 252, 0.45);
}

body.app-body-luxury .sidebar-chevron {
    color: var(--crm-sidebar-chevron-color, rgba(226, 232, 240, 0.65));
}

/* Свернутый сайдбар: активная «капсула» — компактный круг */
@media (min-width: 1024px) {
    body.app-body-luxury .app-shell.sidebar-collapsed .sidebar .nav-link.active {
        border-radius: 12px;
        padding: 0.6rem;
    }

    body.app-body-luxury .app-shell.sidebar-collapsed .sidebar .nav-link.active .nav-icon {
        color: var(--crm-sidebar-nav-active-icon-color, #0f172a);
    }
}

/* --- Glass cards (дашборд + CRM-панели) --- */
body.app-body-luxury .glass-panel {
    background: var(--panel-glass-bg, rgba(255, 255, 255, 0.1));
    backdrop-filter: var(--panel-glass-backdrop-filter, blur(18px) saturate(1.4));
    -webkit-backdrop-filter: var(--panel-glass-backdrop-filter, blur(18px) saturate(1.4));
    border: 1px solid var(--panel-glass-border, rgba(255, 255, 255, 0.14));
    border-radius: 22px;
    box-shadow: var(--panel-glass-shadow, 0 10px 40px rgba(15, 23, 42, 0.28));
}

body.app-body-luxury .glass-panel-header {
    background: transparent;
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.app-body-luxury .glass-panel .card-title {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-size: clamp(1.75rem, 1.4rem + 1vw, 2rem);
    line-height: 1.2;
    color: var(--panel-heading, #f3f7ff);
    font-weight: 700;
}

body.app-body-luxury .glass-panel .card-title--section {
    font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.5rem);
    font-weight: 700;
}

body.app-body-luxury .glass-panel h5.card-title {
    font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
}

/* Контент портала: Inter + токены панелей */
body.app-body-luxury .app-content {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    color: var(--panel-text-primary, #f5f7ff);
}

/* Отступы области контента (переопределяются из настроек портала) */
body.app-body-luxury .app-content.container-fluid {
    padding-left: var(--crm-app-content-padding-x, 0.75rem);
    padding-right: var(--crm-app-content-padding-x, 0.75rem);
    padding-top: var(--crm-app-content-padding-y, 1rem);
    padding-bottom: var(--crm-app-content-padding-y, 1rem);
}

/* Выпадающие меню Bootstrap (тема, действия и т.д.) */
body.app-body-luxury .dropdown-menu {
    background: var(--crm-dropdown-menu-bg, rgba(15, 23, 42, 0.96)) !important;
    border: var(--crm-dropdown-menu-border, 1px solid rgba(255, 255, 255, 0.12)) !important;
    box-shadow: var(--crm-dropdown-menu-shadow, 0 12px 40px rgba(0, 0, 0, 0.35)) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Заказ: выпадающие списки (клиент, оплата, доставка) — одна панель */
body.app-body-luxury .app-content .order-form-dropdown-menu.dropdown-menu {
    background: var(--panel-select-option-bg, #1e293b) !important;
    background-color: var(--panel-select-option-bg, #1e293b) !important;
    border: 1px solid var(--panel-input-border, rgba(255, 255, 255, 0.18)) !important;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.35rem 0;
    margin-top: 0.25rem;
}

body.app-body-luxury .app-content .order-form-dropdown-menu .list-group {
    background: transparent !important;
}

body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item,
body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--panel-select-option-color, var(--panel-text-primary, #f5f7ff)) !important;
    border-color: rgba(255, 255, 255, 0.08);
}

body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item:hover,
body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item:focus,
body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item:hover,
body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item:focus {
    background: rgba(56, 189, 248, 0.22) !important;
    background-color: rgba(56, 189, 248, 0.22) !important;
    color: var(--panel-select-option-color, var(--panel-text-primary, #f5f7ff)) !important;
}

body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item:hover .text-muted,
body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item:hover .text-muted {
    color: rgba(224, 242, 254, 0.92) !important;
}

body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item.text-muted {
    color: var(--panel-text-muted, #9fb2c9) !important;
}

body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item.text-danger {
    color: #fecaca !important;
}

html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu.dropdown-menu {
    background: var(--panel-select-option-bg, #f8fafc) !important;
    background-color: var(--panel-select-option-bg, #f8fafc) !important;
    border-color: var(--panel-input-border, rgba(15, 23, 42, 0.12)) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item,
html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item {
    color: var(--panel-select-option-color, var(--panel-text-primary, #0f172a)) !important;
}

html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item:hover,
html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item:focus,
html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item:hover,
html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item:focus {
    background: rgba(14, 165, 233, 0.16) !important;
    background-color: rgba(14, 165, 233, 0.16) !important;
    color: var(--panel-select-option-color, var(--panel-text-primary, #0f172a)) !important;
}

html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu .list-group-item:hover .text-muted,
html[data-theme="light"] body.app-body-luxury .app-content .order-form-dropdown-menu button.list-group-item:hover .text-muted {
    color: rgba(30, 41, 59, 0.78) !important;
}

body.app-body-luxury .app-content button.order-form-dropdown-toggle.form-control {
    cursor: pointer;
    user-select: none;
}

/* Единый стиль выпадающих списков во всех формах app-content */
body.app-body-luxury .app-content .dropdown-menu {
    background: var(--panel-select-option-bg, #1e293b) !important;
    background-color: var(--panel-select-option-bg, #1e293b) !important;
    border: 1px solid var(--panel-input-border, rgba(255, 255, 255, 0.18)) !important;
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.35rem 0;
}

body.app-body-luxury .app-content .dropdown-menu .dropdown-item,
body.app-body-luxury .app-content .dropdown-menu .list-group-item,
body.app-body-luxury .app-content .dropdown-menu button.list-group-item {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--panel-select-option-color, var(--panel-text-primary, #f5f7ff)) !important;
    border-color: rgba(255, 255, 255, 0.08);
}

body.app-body-luxury .app-content .dropdown-menu .dropdown-item:hover,
body.app-body-luxury .app-content .dropdown-menu .dropdown-item:focus,
body.app-body-luxury .app-content .dropdown-menu .list-group-item:hover,
body.app-body-luxury .app-content .dropdown-menu .list-group-item:focus,
body.app-body-luxury .app-content .dropdown-menu button.list-group-item:hover,
body.app-body-luxury .app-content .dropdown-menu button.list-group-item:focus {
    background: rgba(56, 189, 248, 0.22) !important;
    background-color: rgba(56, 189, 248, 0.22) !important;
    color: var(--panel-select-option-color, var(--panel-text-primary, #f5f7ff)) !important;
}

body.app-body-luxury .app-content button.form-control[aria-haspopup="listbox"] {
    cursor: pointer;
    user-select: none;
}

html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu {
    background: var(--panel-select-option-bg, #f8fafc) !important;
    background-color: var(--panel-select-option-bg, #f8fafc) !important;
    border-color: var(--panel-input-border, rgba(15, 23, 42, 0.12)) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu .dropdown-item,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu .list-group-item,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu button.list-group-item {
    color: var(--panel-select-option-color, var(--panel-text-primary, #0f172a)) !important;
}

html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu .dropdown-item:hover,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu .dropdown-item:focus,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu .list-group-item:hover,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu .list-group-item:focus,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu button.list-group-item:hover,
html[data-theme="light"] body.app-body-luxury .app-content .dropdown-menu button.list-group-item:focus {
    background: rgba(14, 165, 233, 0.16) !important;
    background-color: rgba(14, 165, 233, 0.16) !important;
    color: var(--panel-select-option-color, var(--panel-text-primary, #0f172a)) !important;
}

/* Orders list filters: dropdown must render above cards/table */
body.app-body-luxury .app-content #ordersFilterPanel {
    position: relative;
    z-index: 30;
}

body.app-body-luxury .app-content #ordersFilterPanel .card,
body.app-body-luxury .app-content #ordersFilterPanel .card-body,
body.app-body-luxury .app-content #ordersFilterPanel .position-relative {
    overflow: visible;
}

body.app-body-luxury .app-content #ordersFilterPanel .order-form-dropdown-menu {
    z-index: 3100 !important;
}

/* Clients list filters: dropdown above table */
body.app-body-luxury .app-content #clientsFilterPanel {
    position: relative;
    z-index: 30;
}

body.app-body-luxury .app-content #clientsFilterPanel .card,
body.app-body-luxury .app-content #clientsFilterPanel .card-body,
body.app-body-luxury .app-content #clientsFilterPanel .position-relative {
    overflow: visible;
}

body.app-body-luxury .app-content #clientsFilterPanel .order-form-dropdown-menu {
    z-index: 3100 !important;
}

/* Partners list filters: dropdown above table */
body.app-body-luxury .app-content #partnersFilterPanel {
    position: relative;
    z-index: 30;
}

body.app-body-luxury .app-content #partnersFilterPanel .card,
body.app-body-luxury .app-content #partnersFilterPanel .card-body,
body.app-body-luxury .app-content #partnersFilterPanel .position-relative {
    overflow: visible;
}

body.app-body-luxury .app-content #partnersFilterPanel .order-form-dropdown-menu {
    z-index: 3100 !important;
}

/* Price search filters: dropdown above results table */
body.app-body-luxury .app-content #priceFiltersCollapse {
    position: relative;
    z-index: 30;
}

body.app-body-luxury .app-content #priceFiltersCollapse,
body.app-body-luxury .app-content #priceFiltersCollapse .row,
body.app-body-luxury .app-content #priceFiltersCollapse .position-relative,
body.app-body-luxury .app-content .price-filters-panel {
    overflow: visible;
}

body.app-body-luxury .app-content #priceFiltersCollapse .order-form-dropdown-menu {
    z-index: 3100 !important;
}

/* Scrollbar inside custom dropdowns (status/partner/payment/etc.) */
body.app-body-luxury .app-content .order-form-dropdown-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.72) rgba(255, 255, 255, 0.06);
}

body.app-body-luxury .app-content .order-form-dropdown-menu::-webkit-scrollbar {
    width: 10px;
}

body.app-body-luxury .app-content .order-form-dropdown-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

body.app-body-luxury .app-content .order-form-dropdown-menu::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.6), rgba(148, 163, 184, 0.72));
    border: 2px solid rgba(15, 23, 42, 0.35);
    border-radius: 10px;
}

body.app-body-luxury .app-content .order-form-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(125, 211, 252, 0.85));
}

body.app-body-luxury .dropdown-item {
    color: inherit;
}

body.app-body-luxury .dropdown-item:hover,
body.app-body-luxury .dropdown-item:focus {
    background: var(--crm-dropdown-item-hover-bg, rgba(255, 255, 255, 0.08)) !important;
    color: var(--crm-dropdown-item-color, inherit) !important;
}

body.app-body-luxury .app-content h4 {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-weight: 700;
    font-size: clamp(1.25rem, 1.1rem + 0.4vw, 1.5rem);
    color: var(--panel-heading, #f3f7ff);
}

body.app-body-luxury .app-content .crm-panel-card .card-body {
    padding: 1.35rem 1.5rem;
}

body.app-body-luxury .app-content .form-label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--panel-text-secondary, #d8e4f8);
}

body.app-body-luxury .app-content .form-text {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.45;
    margin-top: 0.5rem;
    color: var(--panel-text-muted, #9fb2c9);
}

body.app-body-luxury .app-content .form-control,
body.app-body-luxury .app-content .form-select {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--panel-text-primary, #f5f7ff) !important;
    background: var(--panel-input-bg, rgba(255, 255, 255, 0.12)) !important;
    border: 1px solid var(--panel-input-border, rgba(255, 255, 255, 0.18)) !important;
    border-radius: 14px;
    padding: 0.65rem 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

/* Только открытый список option (нейтральная/тёмная): не чёрный текст на светлом */
body.app-body-luxury .form-select option {
    background-color: var(--panel-select-option-bg, #1e293b);
    color: var(--panel-select-option-color, var(--panel-text-primary, #f5f7ff));
}

body.app-body-luxury .app-content .form-control::placeholder {
    color: var(--panel-text-placeholder, #8fa3bc);
    opacity: 1;
}

body.app-body-luxury .app-content .form-control:focus,
body.app-body-luxury .app-content .form-select:focus {
    border-color: var(--panel-focus-ring, rgba(125, 211, 252, 0.55)) !important;
    box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.2);
    background: var(--panel-input-bg, rgba(255, 255, 255, 0.14)) !important;
    color: var(--panel-text-primary, #f5f7ff) !important;
}

body.app-body-luxury .app-content .form-control:disabled,
body.app-body-luxury .app-content .form-control[readonly] {
    background: var(--panel-input-readonly-bg, rgba(255, 255, 255, 0.07)) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: var(--panel-text-secondary, #d8e4f8) !important;
    opacity: 1;
}

body.app-body-luxury .app-content .btn-primary {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--crm-btn-primary-text-color, #ffffff) !important;
    border: none;
    border-radius: var(--crm-btn-primary-border-radius, 14px);
    padding: var(--crm-btn-primary-padding-y, 0.65rem) var(--crm-btn-primary-padding-x, 1.35rem);
    background: var(--panel-btn-gradient, linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%)) !important;
    box-shadow: var(--panel-btn-shadow, 0 10px 24px rgba(41, 182, 246, 0.22));
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

body.app-body-luxury .app-content .btn-primary:hover {
    color: #ffffff !important;
    filter: brightness(1.05);
    box-shadow: 0 12px 28px rgba(41, 182, 246, 0.3);
    transform: translateY(-1px);
}

body.app-body-luxury .app-content .btn-primary:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

/* Алерты на стекле */
body.app-body-luxury .app-content .alert {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

body.app-body-luxury .app-content .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
}

body.app-body-luxury .app-content .alert-danger {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

/* Быстрые ссылки */
body.app-body-luxury .app-content .crm-quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

body.app-body-luxury .app-content .crm-quick-links li {
    margin-bottom: 0 !important;
}

body.app-body-luxury .app-content .crm-quick-links a {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--panel-link, #7dd3fc) !important;
    text-decoration: none;
    padding: 0.4rem 0;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

body.app-body-luxury .app-content .crm-quick-links a:hover {
    color: var(--panel-link-hover, #bae6fd) !important;
    background: rgba(255, 255, 255, 0.05);
}

body.app-body-luxury .app-content .crm-quick-links a .fas,
body.app-body-luxury .app-content .crm-quick-links a .far {
    color: rgba(125, 211, 252, 0.85);
    width: 1.35rem;
    text-align: center;
}

body.app-body-luxury .app-content .crm-quick-links a:hover .fas,
body.app-body-luxury .app-content .crm-quick-links a:hover .far {
    color: var(--panel-link-hover, #bae6fd);
}

body.app-body-luxury .app-content .text-muted {
    color: var(--panel-text-muted, #9fb2c9) !important;
}

body.app-body-luxury .app-content .card h5.card-title {
    font-family: var(--crm-font-sans, 'Inter', system-ui, sans-serif);
    font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--panel-heading, #f3f7ff);
}

/* Карточки без glass-panel в контенте — подтянуть к glass */
body.app-body-luxury .app-content .card:not(.glass-panel):not(.stat-card-luxury) {
    background: var(--panel-glass-bg, rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--panel-glass-border, rgba(255, 255, 255, 0.14));
    border-radius: 22px;
    box-shadow: var(--panel-glass-shadow, 0 10px 40px rgba(15, 23, 42, 0.28));
    color: var(--panel-text-primary, #f5f7ff);
}

body.app-body-luxury .app-content .card:not(.glass-panel):not(.stat-card-luxury) .card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--panel-heading, #f3f7ff);
}

body.app-body-luxury .stat-card-luxury {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(212, 175, 55, 0.08) inset;
    position: relative;
    overflow: hidden;
}

body.app-body-luxury .stat-card-luxury::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    background: radial-gradient(ellipse 120% 80% at 50% 100%, rgba(212, 175, 55, 0.12), transparent 70%);
    pointer-events: none;
}

body.app-body-luxury .stat-card-luxury .card-body {
    position: relative;
    z-index: 1;
}

/* Кнопки в стиле экрана прайса: золото / синий (!important — перебивают Bootstrap и ссылки в .app-content) */
body.app-body-luxury .app-content .btn.btn-crm-gold,
body.app-body-luxury .btn.btn-crm-gold {
    --bs-btn-color: #3d2914;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #8b6914;
    color: #3d2914 !important;
    background: linear-gradient(180deg, #f5e6b3 0%, #e8c547 25%, #d4af37 50%, #b8860b 75%, #8b6914 100%) !important;
    border: 1px solid #8b6914 !important;
    border-radius: 14px;
    text-decoration: none !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 -1px 0 rgba(0, 0, 0, 0.12) inset,
        0 4px 14px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    padding: 0.65rem 1.35rem;
}
body.app-body-luxury .app-content .btn.btn-crm-gold:hover,
body.app-body-luxury .btn.btn-crm-gold:hover {
    color: #2d1f0c !important;
    background: linear-gradient(180deg, #ffe066 0%, #f0d040 22%, #e6c229 50%, #d4af37 78%, #a67c1a 100%) !important;
    border-color: #8b6914 !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 -1px 0 rgba(0, 0, 0, 0.1) inset,
        0 6px 18px rgba(0, 0, 0, 0.28);
}
body.app-body-luxury .app-content .btn.btn-crm-gold:focus,
body.app-body-luxury .btn.btn-crm-gold:focus {
    color: #2d1f0c !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 0 0 3px rgba(212, 175, 55, 0.4);
}

body.app-body-luxury .app-content .btn.btn-crm-blue,
body.app-body-luxury .btn.btn-crm-blue {
    --bs-btn-color: #fff;
    color: #fff !important;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%) !important;
    border: 1px solid rgba(14, 116, 144, 0.85) !important;
    border-radius: 14px;
    text-decoration: none !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 4px 16px rgba(14, 165, 233, 0.35);
    font-weight: 600;
    padding: 0.65rem 1.35rem;
}
body.app-body-luxury .app-content .btn.btn-crm-blue:hover,
body.app-body-luxury .btn.btn-crm-blue:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 40%, #0284c7 100%) !important;
    border-color: #0369a1 !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.28) inset,
        0 5px 20px rgba(14, 165, 233, 0.42);
}
body.app-body-luxury .app-content .btn.btn-crm-blue:focus,
body.app-body-luxury .btn.btn-crm-blue:focus {
    color: #fff !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 0 0 3px rgba(14, 165, 233, 0.4);
}

/* CRM нейтральная (отмена, вторичное): серый градиент, тот же силуэт что у gold/blue */
body.app-body-luxury .app-content .btn.btn-crm-gray,
body.app-body-luxury .btn.btn-crm-gray {
    --bs-btn-color: #f1f5f9;
    color: #f1f5f9 !important;
    background: linear-gradient(180deg, #64748b 0%, #475569 40%, #334155 100%) !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    border-radius: 14px;
    text-decoration: none !important;
    font-weight: 600;
    padding: 0.65rem 1.35rem;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 4px 14px rgba(15, 23, 42, 0.35);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

body.app-body-luxury .app-content .btn.btn-crm-gray:hover,
body.app-body-luxury .btn.btn-crm-gray:hover {
    color: #ffffff !important;
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 45%, #475569 100%) !important;
    border-color: rgba(226, 232, 240, 0.35) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 6px 18px rgba(15, 23, 42, 0.4);
}

body.app-body-luxury .app-content .btn.btn-crm-gray:focus,
body.app-body-luxury .btn.btn-crm-gray:focus {
    color: #ffffff !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 0 0 3px rgba(148, 163, 184, 0.45);
}

html[data-theme="light"] body.app-body-luxury .app-content .btn.btn-crm-gray,
html[data-theme="light"] body.app-body-luxury .btn.btn-crm-gray {
    color: #334155 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 45%, #cbd5e1 100%) !important;
    border: 1px solid rgba(15, 23, 42, 0.14) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 4px 12px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .app-content .btn.btn-crm-gray:hover,
html[data-theme="light"] body.app-body-luxury .btn.btn-crm-gray:hover {
    color: #0f172a !important;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 50%, #e2e8f0 100%) !important;
    border-color: rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="light"] body.app-body-luxury .app-content .btn.btn-crm-gray:focus,
html[data-theme="light"] body.app-body-luxury .btn.btn-crm-gray:focus {
    color: #0f172a !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 0 0 3px rgba(100, 116, 139, 0.35);
}

/* CRM danger (delete): same chip style as gold/blue, red gradient */
body.app-body-luxury .app-content .btn.btn-crm-danger,
body.app-body-luxury .btn.btn-crm-danger {
    color: #fff !important;
    background: linear-gradient(135deg, #f87171 0%, #ef4444 45%, #b91c1c 100%) !important;
    border: 1px solid #991b1b !important;
    border-radius: 14px;
    text-decoration: none !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 4px 16px rgba(185, 28, 28, 0.35);
    font-weight: 600;
    padding: 0.65rem 1.35rem;
}
body.app-body-luxury .app-content .btn.btn-crm-danger:hover,
body.app-body-luxury .btn.btn-crm-danger:hover {
    color: #fff !important;
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 40%, #dc2626 100%) !important;
    border-color: #7f1d1d !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 5px 20px rgba(185, 28, 28, 0.42);
}
body.app-body-luxury .app-content .btn.btn-crm-danger:focus,
body.app-body-luxury .btn.btn-crm-danger:focus {
    color: #fff !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18) inset,
        0 0 0 3px rgba(239, 68, 68, 0.45);
}
body.app-body-luxury .app-content .btn.btn-crm-danger.btn-sm,
body.app-body-luxury .btn.btn-crm-danger.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 12px;
}

/* Прайс: модалка «Добавить товар в заказ» — плотный тёмный фон, читаемый текст */
body.app-body-luxury #addToOrderModal .modal-content {
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
}
body.app-body-luxury #addToOrderModal .modal-header,
body.app-body-luxury #addToOrderModal .modal-footer {
    background: rgba(15, 23, 42, 0.99) !important;
    border-color: rgba(255, 255, 255, 0.1);
}
body.app-body-luxury #addToOrderModal .modal-body {
    background: rgba(30, 41, 59, 0.96) !important;
    color: #e2e8f0;
}
body.app-body-luxury #addToOrderModal .modal-title {
    color: #f8fafc;
}
body.app-body-luxury #addToOrderModal .form-check-label,
body.app-body-luxury #addToOrderModal .form-check-label strong {
    color: #e2e8f0;
}
body.app-body-luxury #addToOrderModal .form-check-input {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: rgba(15, 23, 42, 0.8);
}
body.app-body-luxury #addToOrderModal .form-check-input:checked {
    background-color: #0ea5e9;
    border-color: #38bdf8;
}
body.app-body-luxury #addToOrderModal .btn-close {
    filter: invert(1);
    opacity: 0.85;
}
body.app-body-luxury #addToOrderModal #existingOrdersList {
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    color: #e2e8f0;
}
body.app-body-luxury #addToOrderModal #existingOrdersList .text-muted {
    color: rgba(226, 232, 240, 0.65) !important;
}

html[data-theme="light"] body.app-body-luxury #addToOrderModal .modal-content {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] body.app-body-luxury #addToOrderModal .modal-header,
html[data-theme="light"] body.app-body-luxury #addToOrderModal .modal-footer {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] body.app-body-luxury #addToOrderModal .modal-body {
    background: #fff !important;
    color: #0f172a;
}
html[data-theme="light"] body.app-body-luxury #addToOrderModal .modal-title {
    color: #0f172a;
}
html[data-theme="light"] body.app-body-luxury #addToOrderModal .form-check-label,
html[data-theme="light"] body.app-body-luxury #addToOrderModal .form-check-label strong {
    color: #334155;
}
html[data-theme="light"] body.app-body-luxury #addToOrderModal .btn-close {
    filter: none;
    opacity: 1;
}
html[data-theme="light"] body.app-body-luxury #addToOrderModal #existingOrdersList {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a;
}

body.app-body-luxury .stat-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.35rem;
}

body.app-body-luxury .stat-card-luxury .stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 24px rgba(233, 30, 99, 0.15);
}

body.app-body-luxury .stat-card-luxury .stat-growth {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
}

body.app-body-luxury .table-luxury {
    --bs-table-bg: transparent;
    --bs-table-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
}

body.app-body-luxury .table-luxury thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

body.app-body-luxury .table-luxury td {
    border-color: rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

body.app-body-luxury .badge-luxury-gold {
    background: linear-gradient(180deg, #c9a227 0%, #8b6914 100%);
    color: #1a1208;
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.35em 0.65em;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chart-luxury-wrap {
    min-height: 200px;
}

.chart-luxury-placeholder {
    padding: 0.5rem 0.25rem;
}

.chart-luxury-svg {
    width: 100%;
    height: auto;
    max-height: 180px;
    display: block;
}

.chart-luxury-caption {
    text-align: center;
    margin-top: 0.5rem;
}

body.app-body-luxury .chart-placeholder-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 160px;
    padding: 1rem 0;
}

body.app-body-luxury .chart-placeholder-bars .chart-bar {
    background: linear-gradient(180deg, rgba(233, 30, 99, 0.45), rgba(212, 175, 55, 0.35));
    border-radius: 6px 6px 0 0;
    width: 100%;
    max-width: 32px;
    margin: 0 0.35rem;
}

body.app-body-luxury .dashboard-ref .dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

body.app-body-luxury .app-content {
    padding: 0 1rem 2rem;
}

@media (min-width: 992px) {
    body.app-body-luxury .app-content {
        padding: 0 1.5rem 2rem;
    }
}

/* Прочие страницы: базовые карточки и таблицы в тёмной теме */
body.app-body-luxury .card:not(.stat-card-luxury):not(.glass-panel) {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

body.app-body-luxury .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

body.app-body-luxury .table {
    --bs-table-bg: transparent;
    --bs-table-color: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.08);
}

body.app-body-luxury .table th,
body.app-body-luxury .table td {
    border-color: rgba(255, 255, 255, 0.08);
}

body.app-body-luxury .text-muted {
    color: var(--crm-text-muted, rgba(255, 255, 255, 0.45)) !important;
}

body.app-body-luxury .form-control,
body.app-body-luxury .form-select {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.app-body-luxury .form-control::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

body.app-body-luxury .sidebar-backdrop.show {
    background: rgba(5, 0, 10, 0.6);
    backdrop-filter: blur(4px);
}

/* =============================================================================
   Темы: светлая / нейтральная / тёмная
   Нейтральная = базовый морской glass (body.app-body-luxury выше, без префикса html).
   Тёмная = серо-синий блок ниже (html[data-theme="dark"]).
   Переключатель: html[data-theme="light|neutral|dark"], localStorage crm-app-theme
   Токены: шрифты + сайдбар + топбар (--crm-*)
   ============================================================================= */

/* Нейтральная (морской glass) — по умолчанию для портала */
html,
html[data-theme="neutral"] {
    --crm-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --crm-font-display: var(--crm-font-sans);
    --crm-font-sidebar-ui: var(--crm-font-sans);
    --crm-font-sidebar-logo: var(--crm-font-sans);
    --crm-text-primary: #ffffff;
    --crm-text-muted: rgba(255, 255, 255, 0.5);
    --crm-topbar-title-color: #ffffff;
    --crm-topbar-title-shadow: 0 0 24px rgba(233, 30, 99, 0.15);
    --crm-topbar-menu-btn-color: rgba(248, 250, 252, 0.75);
    --crm-sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, transparent 42%),
        linear-gradient(165deg, rgba(55, 32, 95, 0.58) 0%, rgba(28, 32, 78, 0.78) 48%, rgba(12, 20, 42, 0.88) 100%);
    --crm-sidebar-border: 1px solid rgba(255, 255, 255, 0.14);
    --crm-sidebar-shadow: 0 8px 40px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        -4px 0 28px rgba(41, 182, 246, 0.06);
    --crm-sidebar-brand-color: #f5f1ff;
    --crm-sidebar-brand-text-shadow: 0 0 28px rgba(186, 200, 255, 0.18);
    --crm-sidebar-user-card-bg: rgba(255, 255, 255, 0.1);
    --crm-sidebar-user-card-border: 1px solid rgba(255, 255, 255, 0.18);
    --crm-sidebar-user-card-shadow: 0 4px 16px rgba(15, 23, 42, 0.2);
    --crm-sidebar-avatar-bg: linear-gradient(145deg, rgba(94, 234, 212, 0.35) 0%, rgba(167, 139, 250, 0.4) 100%);
    --crm-sidebar-avatar-border: 1px solid rgba(255, 255, 255, 0.35);
    --crm-sidebar-avatar-color: #f8fafc;
    --crm-sidebar-avatar-shadow: 0 0 16px rgba(45, 212, 191, 0.2);
    --crm-sidebar-username-color: #f8fafc;
    --crm-sidebar-role-color: rgba(204, 251, 241, 0.65);
    --crm-sidebar-nav-color: #eaf2ff;
    --crm-sidebar-nav-hover-color: #ffffff;
    --crm-sidebar-nav-hover-bg: rgba(255, 255, 255, 0.06);
    --crm-sidebar-nav-hover-border: rgba(255, 255, 255, 0.08);
    --crm-sidebar-nav-icon-color: #76e4f7;
    --crm-sidebar-nav-icon-filter: none;
    --crm-sidebar-nav-icon-hover-color: #a5f3fc;
    --crm-sidebar-nav-active-color: #08263a;
    --crm-sidebar-nav-active-bg: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --crm-sidebar-nav-active-border: rgba(255, 255, 255, 0.35);
    --crm-sidebar-nav-active-shadow: 0 8px 24px rgba(41, 182, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    --crm-sidebar-nav-active-icon-color: #08263a;
    --crm-sidebar-nav-active-icon-filter: none;
    --crm-sidebar-subnav-border: rgba(125, 211, 252, 0.22);
    --crm-sidebar-subnav-color: #c7d2e6;
    --crm-sidebar-subnav-active-color: #08263a;
    --crm-sidebar-toggle-color: rgba(226, 232, 240, 0.85);
    --crm-sidebar-toggle-border: 1px solid rgba(255, 255, 255, 0.2);
    --crm-sidebar-toggle-bg: rgba(255, 255, 255, 0.06);
    --crm-sidebar-toggle-hover-color: #ffffff;
    --crm-sidebar-toggle-hover-border: rgba(94, 234, 212, 0.45);
    --crm-sidebar-toggle-hover-bg: rgba(94, 234, 212, 0.12);
    --crm-sidebar-footer-border: 1px solid rgba(255, 255, 255, 0.12);
    --crm-sidebar-footer-shadow: 0 -1px 0 rgba(45, 212, 191, 0.06);
    --crm-sidebar-chevron-color: rgba(186, 230, 253, 0.55);
    --crm-sidebar-scrollbar-thumb: rgba(125, 211, 252, 0.28);
    --crm-sidebar-scrollbar-gradient: rgba(125, 211, 252, 0.28);
    --crm-sidebar-logout-color: rgba(254, 202, 202, 0.9);
    --crm-sidebar-logout-icon: rgba(252, 165, 165, 0.95);
    --crm-sidebar-logout-hover-bg: rgba(248, 113, 113, 0.15);
    --crm-sidebar-logout-hover-border: rgba(248, 113, 113, 0.25);
    --crm-sidebar-logout-hover-color: #ffffff;
}

html[data-theme="light"] {
    --crm-font-sidebar-ui: var(--crm-font-sans);
    --crm-font-sidebar-logo: var(--crm-font-sans);
    --crm-text-primary: #0f172a;
    --crm-text-muted: #64748b;
    --crm-topbar-title-color: #0f172a;
    --crm-topbar-title-shadow: none;
    --crm-topbar-menu-btn-color: #475569;
    --panel-text-primary: #0f172a;
    --panel-text-secondary: #334155;
    --panel-text-muted: #64748b;
    --panel-text-placeholder: #94a3b8;
    --panel-link: #0284c7;
    --panel-link-hover: #0369a1;
    --panel-heading: #0f172a;
    --panel-glass-bg: rgba(255, 255, 255, 0.94);
    --panel-glass-border: rgba(15, 23, 42, 0.08);
    --panel-glass-shadow: 0 10px 36px rgba(15, 23, 42, 0.08);
    --panel-input-bg: #ffffff;
    --panel-input-border: rgba(15, 23, 42, 0.12);
    --panel-select-option-bg: #f8fafc;
    --panel-select-option-color: #0f172a;
    --panel-input-readonly-bg: rgba(248, 250, 252, 0.96);
    --panel-focus-ring: rgba(14, 165, 233, 0.45);
    --panel-btn-gradient: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --panel-btn-shadow: 0 10px 24px rgba(41, 182, 246, 0.2);
    --crm-sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.95) 100%);
    --crm-sidebar-border: 1px solid rgba(15, 23, 42, 0.08);
    --crm-sidebar-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
    --crm-sidebar-brand-color: #0f172a;
    --crm-sidebar-brand-text-shadow: none;
    --crm-sidebar-user-card-bg: rgba(241, 245, 249, 0.9);
    --crm-sidebar-user-card-border: 1px solid rgba(15, 23, 42, 0.08);
    --crm-sidebar-user-card-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    --crm-sidebar-avatar-bg: linear-gradient(145deg, #ccfbf1 0%, #e9d5ff 100%);
    --crm-sidebar-avatar-border: 1px solid rgba(15, 23, 42, 0.1);
    --crm-sidebar-avatar-color: #0f172a;
    --crm-sidebar-avatar-shadow: none;
    --crm-sidebar-username-color: #0f172a;
    --crm-sidebar-role-color: #64748b;
    --crm-sidebar-nav-color: #334155;
    --crm-sidebar-nav-hover-color: #0f172a;
    --crm-sidebar-nav-hover-bg: rgba(45, 212, 191, 0.12);
    --crm-sidebar-nav-hover-border: transparent;
    --crm-sidebar-nav-icon-color: #0d9488;
    --crm-sidebar-nav-icon-filter: none;
    --crm-sidebar-nav-icon-hover-color: #0f766e;
    --crm-sidebar-nav-active-color: #08263a;
    --crm-sidebar-nav-active-bg: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --crm-sidebar-nav-active-border: rgba(255, 255, 255, 0.35);
    --crm-sidebar-nav-active-shadow: 0 8px 22px rgba(41, 182, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    --crm-sidebar-nav-active-icon-color: #08263a;
    --crm-sidebar-nav-active-icon-filter: none;
    --crm-sidebar-subnav-border: rgba(13, 148, 136, 0.28);
    --crm-sidebar-subnav-color: #475569;
    --crm-sidebar-subnav-active-color: #08263a;
    --crm-sidebar-toggle-color: #475569;
    --crm-sidebar-toggle-border: 1px solid rgba(15, 23, 42, 0.12);
    --crm-sidebar-toggle-bg: rgba(255, 255, 255, 0.8);
    --crm-sidebar-toggle-hover-color: #0f766e;
    --crm-sidebar-toggle-hover-border: rgba(45, 212, 191, 0.45);
    --crm-sidebar-toggle-hover-bg: #f0fdfa;
    --crm-sidebar-footer-border: 1px solid rgba(15, 23, 42, 0.08);
    --crm-sidebar-footer-shadow: none;
    --crm-sidebar-chevron-color: #64748b;
    --crm-sidebar-scrollbar-thumb: rgba(13, 148, 136, 0.35);
    --crm-sidebar-scrollbar-gradient: linear-gradient(180deg, rgba(45, 212, 191, 0.55), rgba(56, 189, 248, 0.45));
    --crm-sidebar-logout-color: #b91c1c;
    --crm-sidebar-logout-icon: #dc2626;
    --crm-sidebar-logout-hover-bg: rgba(254, 226, 226, 0.8);
    --crm-sidebar-logout-hover-border: rgba(248, 113, 113, 0.25);
    --crm-sidebar-logout-hover-color: #991b1b;
}

html[data-theme="dark"] {
    --crm-font-sidebar-ui: var(--crm-font-sans);
    --crm-font-sidebar-logo: var(--crm-font-sans);
    --crm-text-primary: #e2e8f0;
    --crm-text-muted: rgba(148, 163, 184, 0.92);
    --crm-topbar-title-color: #f1f5f9;
    --crm-topbar-title-shadow: 0 1px 2px rgba(15, 23, 42, 0.4);
    --crm-topbar-menu-btn-color: rgba(226, 232, 240, 0.85);
    --panel-text-primary: #f5f7ff;
    --panel-text-secondary: #d8e4f8;
    --panel-text-muted: #9fb2c9;
    --panel-text-placeholder: #8fa3bc;
    --panel-link: #7dd3fc;
    --panel-link-hover: #bae6fd;
    --panel-heading: #f3f7ff;
    --panel-glass-bg: rgba(30, 41, 59, 0.55);
    --panel-glass-border: rgba(255, 255, 255, 0.1);
    --panel-glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --panel-input-bg: rgba(255, 255, 255, 0.1);
    --panel-input-border: rgba(255, 255, 255, 0.16);
    --panel-select-option-bg: #0f172a;
    --panel-select-option-color: #f1f5f9;
    --panel-input-readonly-bg: rgba(255, 255, 255, 0.06);
    --panel-focus-ring: rgba(125, 211, 252, 0.5);
    --panel-btn-gradient: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --panel-btn-shadow: 0 10px 24px rgba(41, 182, 246, 0.2);
    --crm-sidebar-bg: linear-gradient(180deg, rgba(42, 52, 72, 0.82) 0%, rgba(22, 30, 48, 0.92) 100%);
    --crm-sidebar-border: 1px solid rgba(255, 255, 255, 0.1);
    --crm-sidebar-shadow: 4px 0 28px rgba(0, 0, 0, 0.2);
    --crm-sidebar-brand-color: #f5f1ff;
    --crm-sidebar-brand-text-shadow: 0 0 24px rgba(186, 200, 255, 0.12);
    --crm-sidebar-user-card-bg: rgba(15, 23, 42, 0.35);
    --crm-sidebar-user-card-border: 1px solid rgba(255, 255, 255, 0.1);
    --crm-sidebar-user-card-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    --crm-sidebar-avatar-bg: linear-gradient(145deg, #64748b 0%, #475569 100%);
    --crm-sidebar-avatar-border: 1px solid rgba(255, 255, 255, 0.2);
    --crm-sidebar-avatar-color: #f8fafc;
    --crm-sidebar-avatar-shadow: none;
    --crm-sidebar-username-color: #f8fafc;
    --crm-sidebar-role-color: rgba(148, 163, 184, 0.85);
    --crm-sidebar-nav-color: #eaf2ff;
    --crm-sidebar-nav-hover-color: #ffffff;
    --crm-sidebar-nav-hover-bg: rgba(255, 255, 255, 0.06);
    --crm-sidebar-nav-hover-border: rgba(255, 255, 255, 0.08);
    --crm-sidebar-nav-icon-color: #76e4f7;
    --crm-sidebar-nav-icon-filter: none;
    --crm-sidebar-nav-icon-hover-color: #a5f3fc;
    --crm-sidebar-nav-active-color: #08263a;
    --crm-sidebar-nav-active-bg: linear-gradient(135deg, #35d3ff 0%, #29b6f6 100%);
    --crm-sidebar-nav-active-border: rgba(255, 255, 255, 0.22);
    --crm-sidebar-nav-active-shadow: 0 8px 24px rgba(41, 182, 246, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    --crm-sidebar-nav-active-icon-color: #08263a;
    --crm-sidebar-nav-active-icon-filter: none;
    --crm-sidebar-subnav-border: rgba(125, 211, 252, 0.2);
    --crm-sidebar-subnav-color: #c7d2e6;
    --crm-sidebar-subnav-active-color: #08263a;
    --crm-sidebar-toggle-color: rgba(226, 232, 240, 0.85);
    --crm-sidebar-toggle-border: 1px solid rgba(255, 255, 255, 0.15);
    --crm-sidebar-toggle-bg: rgba(255, 255, 255, 0.06);
    --crm-sidebar-toggle-hover-color: #f8fafc;
    --crm-sidebar-toggle-hover-border: rgba(148, 163, 184, 0.35);
    --crm-sidebar-toggle-hover-bg: rgba(255, 255, 255, 0.1);
    --crm-sidebar-footer-border: 1px solid rgba(255, 255, 255, 0.1);
    --crm-sidebar-footer-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15);
    --crm-sidebar-chevron-color: rgba(148, 163, 184, 0.85);
    --crm-sidebar-scrollbar-thumb: rgba(125, 211, 252, 0.3);
    --crm-sidebar-scrollbar-gradient: rgba(125, 211, 252, 0.3);
    --crm-sidebar-logout-color: rgba(254, 202, 202, 0.95);
    --crm-sidebar-logout-icon: rgba(252, 165, 165, 0.95);
    --crm-sidebar-logout-hover-bg: rgba(127, 29, 29, 0.25);
    --crm-sidebar-logout-hover-border: rgba(248, 113, 113, 0.35);
    --crm-sidebar-logout-hover-color: #fecaca;
}

body.app-body-luxury .topbar-menu-btn {
    color: var(--crm-topbar-menu-btn-color, rgba(248, 250, 252, 0.75)) !important;
}

.theme-switcher-btn {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 250, 252, 0.95);
    padding: 0.4rem 0.65rem;
}

.theme-switcher-btn:hover {
    border-color: rgba(94, 234, 212, 0.45);
    background: rgba(94, 234, 212, 0.12);
    color: #fff;
}

.theme-switcher-menu .dropdown-item {
    cursor: pointer;
}

.topbar-menu-btn {
    color: rgba(248, 250, 252, 0.75) !important;
}

/* ---------- Нейтральная тема: фон с меньшей долей бирюзы (спокойнее, ближе к сине-фиолету и slate) ---------- */
html[data-theme="neutral"] body.app-body-luxury,
html[data-theme="neutral"] body.auth-portal-body {
    background:
        radial-gradient(ellipse 92% 78% at 50% 44%, rgba(15, 23, 42, 0.32) 0%, transparent 60%),
        radial-gradient(ellipse 140% 60% at 50% 118%, rgba(76, 29, 149, 0.14) 0%, transparent 52%),
        radial-gradient(ellipse 95% 100% at 94% 32%, rgba(51, 65, 85, 0.32) 0%, transparent 50%),
        radial-gradient(ellipse 90% 95% at 6% 48%, rgba(107, 33, 168, 0.36) 0%, transparent 48%),
        linear-gradient(
            118deg,
            #2e1064 0%,
            #4c1d95 20%,
            #312e81 42%,
            #1e293b 62%,
            #1e3a5f 82%,
            #172554 100%
        );
    background-attachment: fixed;
}

html[data-theme="neutral"] body.app-body-luxury::before,
html[data-theme="neutral"] body.auth-portal-body::before {
    opacity: 0.55;
    background:
        radial-gradient(ellipse 100% 55% at 86% 24%, rgba(148, 163, 184, 0.2) 0%, transparent 42%),
        radial-gradient(ellipse 85% 65% at 10% 58%, rgba(192, 132, 252, 0.3) 0%, transparent 45%),
        radial-gradient(ellipse 70% 45% at 50% 8%, rgba(224, 231, 255, 0.12) 0%, transparent 38%),
        linear-gradient(
            128deg,
            transparent 0%,
            rgba(99, 102, 241, 0.09) 32%,
            transparent 48%,
            rgba(167, 139, 250, 0.11) 68%,
            transparent 100%
        );
    mix-blend-mode: screen;
}

html[data-theme="neutral"] body.app-body-luxury::after,
html[data-theme="neutral"] body.auth-portal-body::after {
    opacity: 0.048;
    background-image:
        radial-gradient(rgba(226, 232, 240, 0.5) 0.4px, transparent 0.4px),
        radial-gradient(rgba(255, 255, 255, 0.45) 0.35px, transparent 0.35px),
        radial-gradient(rgba(199, 210, 254, 0.38) 0.85px, transparent 0.85px);
}

/* ---------- Светлая тема ---------- */
html[data-theme="light"] body.app-body-luxury {
    background:
        radial-gradient(ellipse 90% 70% at 50% 40%, rgba(255, 255, 255, 0.9) 0%, transparent 55%),
        linear-gradient(165deg, #f8fafc 0%, #e2e8f0 40%, #f1f5f9 70%, #e0f2fe 100%);
    background-attachment: fixed;
}

html[data-theme="light"] body.app-body-luxury::before {
    opacity: 0.45;
    background:
        radial-gradient(circle at 88% 18%, rgba(45, 212, 191, 0.25) 0%, transparent 35%),
        radial-gradient(circle at 10% 70%, rgba(167, 139, 250, 0.18) 0%, transparent 38%),
        linear-gradient(125deg, transparent 0%, rgba(56, 189, 248, 0.08) 45%, transparent 70%);
    mix-blend-mode: multiply;
    animation: none;
}

html[data-theme="light"] body.app-body-luxury::after {
    opacity: 0.035;
    background-image: radial-gradient(rgba(15, 23, 42, 0.25) 0.5px, transparent 0.5px);
    animation: none;
}

html[data-theme="light"] body.app-body-luxury .theme-switcher-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.85);
    color: #334155;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .theme-switcher-btn:hover {
    border-color: rgba(45, 212, 191, 0.5);
    background: #f0fdfa;
    color: #0f766e;
}

html[data-theme="light"] body.app-body-luxury .btn-icon-glass {
    border-color: rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.7);
    color: #64748b;
}

/* Светлая тема: чуть мягче размытие сайдбара (токены — выше) */
html[data-theme="light"] body.app-body-luxury .sidebar {
    backdrop-filter: blur(20px) saturate(1.08);
    -webkit-backdrop-filter: blur(20px) saturate(1.08);
}

html[data-theme="light"] body.app-body-luxury .glass-panel,
html[data-theme="light"] body.app-body-luxury .stat-card-luxury {
    background: var(--panel-glass-bg, rgba(255, 255, 255, 0.94));
    border: 1px solid var(--panel-glass-border, rgba(15, 23, 42, 0.08));
    box-shadow: var(--panel-glass-shadow, 0 10px 36px rgba(15, 23, 42, 0.08));
}

html[data-theme="light"] body.app-body-luxury .glass-panel .card-title,
html[data-theme="light"] body.app-body-luxury .stat-card-luxury .stat-value {
    color: var(--panel-heading, #0f172a);
    text-shadow: none;
}

html[data-theme="light"] body.app-body-luxury .stat-card-label,
html[data-theme="light"] body.app-body-luxury .stat-card-luxury .stat-growth {
    color: #64748b;
}

html[data-theme="light"] body.app-body-luxury .stat-card-luxury::after {
    background: radial-gradient(ellipse 120% 80% at 50% 100%, rgba(45, 212, 191, 0.12), transparent 70%);
}

html[data-theme="light"] body.app-body-luxury .table-luxury {
    --bs-table-color: #334155;
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .table-luxury thead th {
    color: #64748b;
}

html[data-theme="light"] body.app-body-luxury .card:not(.stat-card-luxury):not(.glass-panel) {
    background: var(--panel-glass-bg, #fff);
    border: 1px solid var(--panel-glass-border, rgba(15, 23, 42, 0.08));
    color: var(--panel-text-primary, #0f172a);
}

html[data-theme="light"] body.app-body-luxury .card-header {
    color: #0f172a;
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .table {
    --bs-table-color: #334155;
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] body.app-body-luxury .form-control,
html[data-theme="light"] body.app-body-luxury .form-select {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

html[data-theme="light"] body.app-body-luxury .app-content .form-control,
html[data-theme="light"] body.app-body-luxury .app-content .form-select {
    background: var(--panel-input-bg, #fff) !important;
    border-color: var(--panel-input-border, rgba(15, 23, 42, 0.12)) !important;
    color: var(--panel-text-primary, #0f172a) !important;
}

html[data-theme="light"] body.app-body-luxury .form-control::placeholder {
    color: #94a3b8;
}

html[data-theme="light"] body.app-body-luxury .app-content .form-control::placeholder {
    color: var(--panel-text-placeholder, #94a3b8);
}

html[data-theme="light"] body.app-body-luxury .app-content .alert-success {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.28);
}

html[data-theme="light"] body.app-body-luxury .app-content .alert-danger {
    background: rgba(248, 113, 113, 0.1);
    color: #b91c1c;
    border-color: rgba(248, 113, 113, 0.25);
}

html[data-theme="light"] body.app-body-luxury .app-footer {
    background: rgba(248, 250, 252, 0.92) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    color: #64748b !important;
}

html[data-theme="light"] body.app-body-luxury .app-footer-link {
    color: #0d9488;
}

html[data-theme="light"] body.app-body-luxury .sidebar-backdrop.show {
    background: rgba(15, 23, 42, 0.35);
}

html[data-theme="light"] body.app-body-luxury .chart-placeholder-bars .chart-bar {
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.55), rgba(56, 189, 248, 0.45));
}

/* ---------- Тёмная тема (спокойный серо-синий, темнее нейтральной) ---------- */
html[data-theme="dark"] body.app-body-luxury {
    background:
        radial-gradient(ellipse 100% 80% at 50% 45%, rgba(30, 41, 59, 0.5) 0%, transparent 58%),
        linear-gradient(145deg, #334155 0%, #475569 35%, #3f3f46 65%, #292524 100%);
    background-attachment: fixed;
}

html[data-theme="dark"] body.app-body-luxury::before {
    opacity: 0.55;
    background:
        radial-gradient(circle at 80% 22%, rgba(148, 163, 184, 0.2) 0%, transparent 32%),
        radial-gradient(circle at 15% 65%, rgba(100, 116, 139, 0.22) 0%, transparent 36%),
        linear-gradient(118deg, transparent 0%, rgba(203, 213, 225, 0.06) 50%, transparent 100%);
    mix-blend-mode: screen;
    animation: marine-glow-drift 100s ease-in-out infinite alternate;
}

html[data-theme="dark"] body.app-body-luxury::after {
    opacity: 0.05;
    animation: marine-sparkle 20s ease-in-out infinite;
}

html[data-theme="dark"] body.app-body-luxury .theme-switcher-btn {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

html[data-theme="dark"] body.app-body-luxury .theme-switcher-btn:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] body.app-body-luxury .glass-panel,
html[data-theme="dark"] body.app-body-luxury .stat-card-luxury {
    background: var(--panel-glass-bg, rgba(30, 41, 59, 0.55));
    border: 1px solid var(--panel-glass-border, rgba(255, 255, 255, 0.1));
    box-shadow: var(--panel-glass-shadow, 0 12px 40px rgba(0, 0, 0, 0.35));
}

html[data-theme="dark"] body.app-body-luxury .glass-panel .card-title {
    color: var(--panel-heading, #f3f7ff);
}

html[data-theme="dark"] body.app-body-luxury .stat-card-luxury .stat-value {
    color: #f8fafc;
}

html[data-theme="dark"] body.app-body-luxury .stat-card-label,
html[data-theme="dark"] body.app-body-luxury .stat-card-luxury .stat-growth {
    color: rgba(226, 232, 240, 0.65);
}

html[data-theme="dark"] body.app-body-luxury .card:not(.stat-card-luxury):not(.glass-panel) {
    background: var(--panel-glass-bg, rgba(30, 41, 59, 0.55));
    border-color: var(--panel-glass-border, rgba(255, 255, 255, 0.1));
    color: var(--panel-text-primary, #f5f7ff);
}

html[data-theme="dark"] body.app-body-luxury .card-header {
    color: #f1f5f9;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] body.app-body-luxury .table {
    --bs-table-color: rgba(241, 245, 249, 0.92);
}

html[data-theme="dark"] body.app-body-luxury .form-control,
html[data-theme="dark"] body.app-body-luxury .form-select {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

html[data-theme="dark"] body.app-body-luxury .app-content .form-control,
html[data-theme="dark"] body.app-body-luxury .app-content .form-select {
    background: var(--panel-input-bg, rgba(255, 255, 255, 0.1)) !important;
    border-color: var(--panel-input-border, rgba(255, 255, 255, 0.16)) !important;
    color: var(--panel-text-primary, #f5f7ff) !important;
}

html[data-theme="dark"] body.app-body-luxury .app-content .form-control::placeholder {
    color: var(--panel-text-placeholder, #8fa3bc);
}

html[data-theme="dark"] body.app-body-luxury .app-footer {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] body.app-body-luxury .app-footer-link {
    color: #94a3b8;
}

html[data-theme="dark"] body.app-body-luxury .app-footer-link:hover {
    color: #e2e8f0;
}

html[data-theme="dark"] body.app-body-luxury .btn-icon-glass {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

/* CRM: карточные списки на экранах < lg — без горизонтальной прокрутки таблиц */
@media (max-width: 991.98px) {
    .crm-mobile-stack .card {
        word-break: break-word;
    }
    .crm-mobile-stack .crm-mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .crm-mobile-stack .crm-mobile-actions .btn,
    .crm-mobile-stack .crm-mobile-actions form .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
}
