/* ============================================================
   МАРШРУТИЗАТОР ЭТП — Основные стили (светлая тема)
   Современный dashboard (Linear / Notion стиль)
   ============================================================ */

/* === CSS ПЕРЕМЕННЫЕ === */
:root {
    /* Основные цвета */
    --bg-primary: #fafbfc;
    --bg-secondary: #f1f3f9;
    --bg-tertiary: #e8ebf2;
    --bg-sidebar: #1a1d23;
    --bg-sidebar-hover: #2a2d35;
    --bg-sidebar-active: #33363f;
    --bg-card: #ffffff;
    --bg-modal: #ffffff;
    --bg-input: #ffffff;
    --bg-overlay: rgba(0, 0, 0, 0.45);

    /* Текст */
    --text-primary: #1a1d23;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: #a0a4b0;
    --text-sidebar-active: #ffffff;
    --text-inverse: #ffffff;

    /* Границы */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #4f46e5;

    /* Акценты */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.08);
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.08);

    /* ЭТП цвета */
    --etp-1: #E53935;
    --etp-2: #1E88E5;
    --etp-3: #43A047;
    --etp-4: #FB8C00;
    --etp-5: #8E24AA;
    --etp-6: #00ACC1;
    --etp-7: #F4511E;
    --etp-8: #6D4C41;
    --etp-9: #546E7A;

    /* Дни недели */
    --day-pn: #E53935;
    --day-vt: #1E88E5;
    --day-sr: #43A047;
    --day-cht: #FB8C00;
    --day-pt: #8E24AA;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;

    /* Typography */
    --text-xs: 10px;
    --text-sm: 11px;
    --text-base: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --text-xl: 18px;

    /* Размеры */
    --sidebar-width: 240px;
    --topbar-height: 52px;
    --filter-panel-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Тени с цветовым оттенком */
    --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.04), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(99, 102, 241, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 8px 32px rgba(99, 102, 241, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 16px 48px rgba(99, 102, 241, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);

    /* Glass эффекты */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(20px);
    --surface-elevated: rgba(255, 255, 255, 0.9);
    --surface-sunken: rgba(0, 0, 0, 0.02);

    /* Dashboard */
    --dashboard-height-collapsed: 48px;
    --dashboard-height-peek: 120px;
    --dashboard-height-normal: 300px;
    --dashboard-height-expanded: 65vh;

    /* Dashboard opening animations */
    --dashboard-transition-duration: 0.5s;
    --dashboard-transition-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dashboard-transition-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Переходы */
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        --glass-blur: blur(0px) !important;
    }
}

/* === СБРОС И БАЗОВЫЕ === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Focus-visible для клавиатурной навигации */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Reduced motion для пользователей с настройкой "уменьшить движение" */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === КАСТОМНЫЙ SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* === ЛЭЙАУТ === */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition-slow);
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-header .title {
    color: var(--text-sidebar-active);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-divider {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 16px 16px 6px;
    margin-top: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    margin: 0 8px;
    color: var(--text-sidebar);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    width: calc(100% - 16px);
    text-align: left;
    position: relative;
    height: auto;
    border-radius: var(--radius-md);
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-sidebar-active);
    transform: translateX(4px);
}


.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--text-sidebar-active);
    border-left: none;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.nav-item i {
    width: 18px;
    height: 18px;
    text-align: center;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-footer {
    padding: 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-sidebar);
    font-size: 12px;
}

.sidebar-footer .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Sidebar user info classes */
.sidebar-user-name {
    color: #e5e7eb;
    font-weight: 500;
    font-size: 13px;
}

.sidebar-user-login {
    font-size: 11px;
    color: #6b7280;
}

.sidebar-user-role {
    font-size: 10px;
    color: #9ca3af;
}

/* Notification bell */
.notif-bell {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    color: #9ca3af;
    font-size: 13px;
    transition: var(--transition);
}

.notif-bell:hover {
    color: var(--text-sidebar-active);
}

.notif-count {
    display: none;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    align-items: center;
    justify-content: center;
}

.notif-count.show {
    display: flex;
}

/* Logout button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-sidebar);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 4px;
}

.logout-btn:hover {
    color: #ef4444;
}

.logout-btn i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sidebar);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 8px;
}

.theme-toggle i {
    font-size: 14px;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* === TOPBAR === */
.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    box-shadow: none;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 14px;
    z-index: 50;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.2px;
}

.topbar-title:hover {
    color: var(--accent);
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition);
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 0 1px var(--accent);
    background: var(--bg-primary);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.search-results.show { display: block; }

.search-result-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item:hover .search-edit-btn {
    background: var(--accent-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3), 0 0 0 1px var(--accent-glow) !important;
}

.search-result-item .result-name {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 4px;
}

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

.search-edit-btn {
    transition: all var(--transition) !important;
}

.search-edit-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2) !important;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* === СТРАНИЦЫ / КОНТЕНТ === */
.page-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.page {
    display: none;
    height: 100%;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* Страница карты: панель фильтров рядом с картой (строка) */
#page-map {
    flex-direction: row;
}

.page-padded {
    padding: 24px;
}

/* === КАРТА === */
.map-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.map-filter-panel {
    width: var(--filter-panel-width);
    min-width: var(--filter-panel-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
}

#ymap {
    width: 100%;
    height: 100%;
}

.filter-section {
    padding: 16px var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.filter-section:first-child {
    padding-top: 20px;
}

.filter-section:last-child {
    border-bottom: none;
    padding-bottom: 20px;
}

.filter-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
}

.filter-item:hover {
    background: var(--bg-secondary);
}

.filter-item input[type="checkbox"] {
    accent-color: var(--accent);
}

.filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-day-bar {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.filter-actions {
    display: flex;
    gap: 6px;
}

.filter-actions button {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: 11px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text-secondary);
    min-height: 32px;
}

.filter-actions button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Мини-статистика ЭТП */
.etp-mini-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.etp-mini-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.etp-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: var(--transition);
}

/* === ПАНЕЛЬ ЗОНИРОВАНИЯ === */
.zone-panel {
    width: 320px;
    min-width: 320px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zone-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.zone-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.zone-panel-title i {
    color: var(--accent);
}

.zone-stats {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.zone-stat {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.zone-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.zone-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.zone-group-toggle {
    display: flex;
    padding: 8px 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
}

.zone-group-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.zone-group-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.zone-group-btn.active {
    background: var(--accent);
    color: white;
}

.zone-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.zone-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.zone-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.zone-empty-hint {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.7;
}

/* Группа зон по ЭТП */
.zone-group {
    margin-bottom: 8px;
}

.zone-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    margin-bottom: 4px;
}

.zone-group-header:hover {
    background: var(--bg-tertiary);
}

.zone-group-toggle-icon {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
    transition: transform 0.2s;
}

.zone-group.collapsed .zone-group-toggle-icon {
    transform: rotate(-90deg);
}

.zone-group-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.zone-group-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.zone-group-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 10px;
}

.zone-group-items {
    padding-left: 8px;
}

.zone-group.collapsed .zone-group-items {
    display: none;
}

/* Карточка зоны */
.zone-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.zone-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.zone-card.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.zone-card-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.zone-card-info {
    flex: 1;
    min-width: 0;
}

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

.zone-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.zone-card-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.zone-card:hover .zone-card-actions {
    opacity: 1;
}

.zone-card-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 12px;
}

.zone-card-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.zone-card-btn.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Зона без ЭТП */
.zone-group-no-etp .zone-group-header {
    background: var(--warning-bg);
}

.zone-group-no-etp .zone-group-name {
    color: var(--warning);
}

/* Действия внизу панели */
.zone-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.zone-actions .btn {
    flex: 1;
    justify-content: center;
}

.zone-actions .btn-secondary {
    flex: 0 0 auto;
    min-width: auto;
}

/* Форма редактирования зоны */
.zone-edit-form {
    padding: 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.zone-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.zone-edit-close {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.zone-edit-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.zone-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.zone-edit-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Кнопка закрытия зоны на мобильном */
.zone-mobile-close {
    display: none;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition);
}

.zone-mobile-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input {
    width: 40px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

.color-presets-small {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.color-preset-sm {
    width: 24px;
    height: 24px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.color-preset-sm:hover {
    transform: scale(1.1);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* === НИЖНЯЯ ПАНЕЛЬ — ДАШБОРД МАРШРУТОВ (РЕДИЗАЙН 2024) === */
.dashboard-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: var(--dashboard-height-normal);
    overflow: hidden;
    transition: max-height var(--dashboard-transition-duration) var(--dashboard-transition-spring), box-shadow 0.3s ease;
    box-shadow: 0 -4px 24px rgba(99, 102, 241, 0.06), 0 -1px 4px rgba(0, 0, 0, 0.04);
    padding-top: 28px;
}

/* Свёрнутое состояние */
.dashboard-panel.collapsed {
    max-height: var(--dashboard-height-collapsed);
    box-shadow: none;
}

.dashboard-panel.collapsed .dashboard-header,
.dashboard-panel.collapsed .dashboard-stats,
.dashboard-panel.collapsed .dashboard-mode {
    display: none;
}

/* Peek состояние (промежуточное) */
.dashboard-panel.peek {
    max-height: var(--dashboard-height-peek);
    box-shadow: 0 -2px 12px rgba(99, 102, 241, 0.04), 0 -1px 2px rgba(0, 0, 0, 0.02);
}

.dashboard-panel.peek .dashboard-stats,
.dashboard-panel.peek .dashboard-mode {
    opacity: 0.5;
    pointer-events: none;
}

/* Развёрнутое состояние (максимум) */
.dashboard-panel.expanded {
    max-height: var(--dashboard-height-expanded);
    box-shadow: 0 -8px 40px rgba(99, 102, 241, 0.1), 0 -2px 8px rgba(0, 0, 0, 0.06);
}

.dashboard-panel.expanded .route-list-scroll {
    max-height: calc(60vh - 140px);
}

.dashboard-panel.expanded .unassigned-detail-body {
    max-height: calc(60vh - 120px);
}

.dashboard-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    -webkit-tap-highlight-color: transparent;
    pointer-events: none;
}

.dashboard-handle:hover {
    pointer-events: auto;
}

.dashboard-handle-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--text-muted);
    opacity: 0.3;
    transition: all var(--transition);
    pointer-events: auto;
}

.dashboard-handle:hover .dashboard-handle-bar {
    opacity: 0.6;
    width: 48px;
    background: var(--accent);
}

.dashboard-handle:active .dashboard-handle-bar {
    opacity: 0.8;
    width: 52px;
}

/* === DASHBOARD OPENING ANIMATIONS === */

/* Iteration 2: Progressive content reveal animations */
@keyframes slideInHeader {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInContent {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply staggered animations when panel opens */
.dashboard-panel:not(.collapsed) .dashboard-header {
    animation: slideInHeader 0.5s var(--dashboard-transition-spring) 0.05s both;
}

.dashboard-panel:not(.collapsed) .dashboard-stats {
    animation: slideInStats 0.5s var(--dashboard-transition-spring) 0.15s both;
}

.dashboard-panel:not(.collapsed) .dashboard-mode {
    animation: slideInContent 0.5s var(--dashboard-transition-spring) 0.25s both;
}

.dashboard-mode {
    display: block;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg) var(--space-md);
    gap: var(--space-md);
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.dashboard-title-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.dashboard-title i {
    color: var(--accent);
}

.dashboard-header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(79, 140, 247, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
}

.dashboard-summary-mini {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: 0 var(--space-lg);
    flex-wrap: wrap;
}

.dashboard-summary-mini span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--surface-elevated);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.dashboard-summary-mini span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.dashboard-summary-mini i {
    font-size: 11px;
    opacity: 0.7;
}

.dashboard-summary-mini b {
    color: var(--text-primary);
    font-weight: 600;
}

/* === STAT CARDS — НОВЫЙ ДИЗАЙН === */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
    padding: 0 var(--space-lg) var(--space-md);
}

.stat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    cursor: default;
    min-width: 0;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.stat-card::before {
    display: none;
}

.stat-card:hover {
    border-color: var(--glass-border);
    border-left-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow), 0 4px 12px rgba(99, 102, 241, 0.15);
}

.stat-card.warning {
    border-left-color: var(--warning);
    background: var(--warning-bg);
}

.stat-card.danger {
    border-left-color: var(--danger);
    background: var(--danger-bg);
}

@keyframes danger-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1); }
    50% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2); }
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.2s ease;
}

.stat-card:hover .stat-icon {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.stat-card.warning .stat-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(251, 191, 36, 0.3) 100%);
    color: var(--warning);
}

.stat-card.danger .stat-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4) 0%, rgba(248, 113, 113, 0.3) 100%);
    color: var(--danger);
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-alert {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: none;
}

.stat-alert.show {
    display: block;
    animation: alert-pulse 1.5s ease-in-out infinite;
}

.stat-alert.warning {
    background: var(--warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.stat-alert.danger {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

@keyframes alert-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* === ROUTE LIST (scrollable) === */
.route-list-scroll {
    max-height: 180px;
    overflow-y: auto;
    padding: 0 var(--space-lg) var(--space-md);
}

.route-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border-light);
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: var(--text-base);
    transition: all 0.2s ease;
    cursor: pointer;
}

.route-list-item:hover {
    border-left-color: var(--accent);
    background: var(--accent-light);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.route-list-item:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.route-list-item:nth-child(even):hover {
    background: var(--accent-light);
}

.route-list-item .route-order {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25);
}

.route-list-item .route-info {
    flex: 1;
    min-width: 0;
}

.route-list-item .route-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-list-item .route-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.route-list-item .route-distance {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.route-list-item.op-mismatch {
    border-left: 3px solid var(--danger);
}

.route-list-item.manual-override {
    border-left: 3px solid var(--warning);
}

/* === DETAIL GRID (for assigned point) === */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-sm);
    padding: 0 var(--space-lg) var(--space-md);
    max-height: 130px;
    overflow-y: auto;
}

.detail-item {
    padding: var(--space-sm);
    background: var(--surface-sunken);
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border-light);
}

.detail-item label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-item span {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.dashboard-panel .detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* === UNASSIGNED DETAIL === */
.unassigned-detail-body {
    padding: 0 var(--space-lg) var(--space-md);
    max-height: 210px;
    overflow-y: auto;
}

.unassigned-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.unassigned-info .detail-grid {
    padding: 0;
    margin-bottom: 8px;
    max-height: none;
    grid-template-columns: 1fr;
    gap: 6px;
}

.unassigned-info {
    font-size: 13px;
}

.unassigned-info .info-row {
    display: grid;
    grid-template-columns: 85px 1fr;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 1px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
    font-size: 12px;
}

.unassigned-info .info-row:hover {
    background: var(--bg-secondary);
}

.unassigned-info .info-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

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

.unassigned-reason-box {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(4px);
}

.unassigned-reason-box .reason-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #b91c1c;
    margin-bottom: 4px;
    font-size: 12px;
}

.unassigned-reason-box .reason-label i {
    font-size: 12px;
}

.unassigned-reason-box .reason-text {
    color: #7f1d1d;
    font-size: 12px;
    line-height: 1.4;
}

.unassigned-reason-box .reason-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.unassigned-reason-box .reason-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.quick-assign-form {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.04) 100%);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(4px);
}

.quick-assign-form h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.quick-assign-form h4 i {
    color: var(--success);
    font-size: 13px;
}

.quick-assign-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.quick-assign-row .form-group {
    flex: 1;
    margin: 0;
}

.quick-assign-row .form-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
}

.quick-assign-row .form-select {
    padding: 6px 8px;
    font-size: 11px;
    height: 32px;
}

.quick-assign-row .btn {
    white-space: nowrap;
    padding: 8px 14px;
}

/* === ТП-only detail (режим сравнения) === */
.tp-only-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tp-only-info {
    font-size: 13px;
}

.tp-only-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.tp-only-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tp-only-day-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tp-only-info .detail-grid {
    padding: 0;
    margin-bottom: 8px;
    max-height: none;
    grid-template-columns: 1fr;
    gap: 6px;
}

/* === СРАВНЕНИЕ ТП / ЭТП === */
.comparison-detail-body {
    padding: 0 var(--space-lg) var(--space-md);
    max-height: 210px;
    overflow-y: auto;
}

.comparison-detail-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

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

.comparison-status-box {
    border-radius: var(--radius-md);
    padding: 10px 12px;
    backdrop-filter: blur(4px);
}

.comparison-status-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-status-label i {
    font-size: 13px;
}

.comparison-info .detail-grid {
    padding: 0;
    max-height: none;
    grid-template-columns: 1fr;
    gap: 6px;
}

.comparison-etp-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comparison-etp-info {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(79, 70, 229, 0.02) 100%);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-md);
    padding: 12px;
    backdrop-filter: blur(4px);
}

.comparison-etp-header {
    font-weight: 700;
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-only-info .info-row {
    display: grid;
    grid-template-columns: 85px 1fr;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 1px;
    border-radius: var(--radius-sm);
    transition: background-color var(--transition);
    font-size: 12px;
}

.tp-only-info .info-row:hover {
    background: var(--bg-secondary);
}

.tp-only-info .info-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tp-only-info .info-value {
    font-weight: 600;
    color: var(--text-primary);
}

.tp-only-reason-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-only-reason-box {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    backdrop-filter: blur(4px);
}

.tp-only-reason-box .reason-label {
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.tp-only-reason-box .reason-label i {
    font-size: 12px;
}

.tp-only-reason-box .reason-text {
    font-size: 12px;
    line-height: 1.4;
}

.tp-only-reason-excluded {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.08) 100%);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #7f1d1d;
}

.tp-only-reason-excluded .reason-label {
    color: #b91c1c;
}

.tp-only-reason-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #78350f;
}

.tp-only-reason-warning .reason-label {
    color: #d97706;
}

.tp-only-reason-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #1e3a8a;
}

.tp-only-reason-info .reason-label {
    color: #2563eb;
}

/* === UNASSIGNED SUMMARY BODY (scrollable) === */
.unassigned-summary-body {
    padding: 0;
    overflow-y: auto;
    max-height: calc(var(--dashboard-height-normal) - 70px);
}

.dashboard-panel.expanded .unassigned-summary-body {
    max-height: calc(60vh - 80px);
}

/* === UNASSIGNED DUAL SLIDER (ua-) === */
.ua-sliders {
    padding: 16px 18px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 10px 16px;
    position: relative;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.04), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Строка: badge + select | invert + value */
.ua-slider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.ua-slider-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ua-slider-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ua-slider-badge {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ua-type-select {
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.ua-type-select:focus { border-color: var(--accent); }

/* Текущее значение */
.ua-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    min-width: 52px;
    text-align: right;
    white-space: nowrap;
}
.ua-val.inv { color: #e67e22; }

/* Инверсия тоггл */
.ua-invert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.ua-invert input { display: none; }

.ua-invert-track {
    position: relative;
    width: 28px; height: 16px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    transition: background .2s;
    flex-shrink: 0;
}
.ua-invert-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.ua-invert input:checked ~ .ua-invert-track {
    background: #e67e22;
}
.ua-invert input:checked ~ .ua-invert-track::after {
    transform: translateX(12px);
}

.ua-invert-icon {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    transition: color .2s;
    line-height: 1;
}
.ua-invert input:checked ~ .ua-invert-icon {
    color: #e67e22;
}

/* Обёртка: ползунок + шкала */
.ua-track-wrap {
    position: relative;
    padding: 6px 0 0;
}

/* Ползунок */
.ua-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    cursor: pointer;
    transition: background .15s;
}
.ua-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35), 0 0 0 1px rgba(99, 102, 241, 0.1);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.ua-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.45), 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.ua-range::-webkit-slider-thumb:active {
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3), 0 0 0 5px rgba(99, 102, 241, 0.08);
}
.ua-range::-moz-range-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    cursor: pointer;
}

/* Шкала-линейка */
.ua-scale {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0 0;
    pointer-events: none;
    position: relative;
    min-height: 30px;
}
.ua-scale::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}
.ua-scale-tick {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
}
.ua-scale-tick-line {
    width: 1px;
    height: 10px;
    background: var(--border-color);
    transition: background .15s, height .15s, width .15s;
    position: relative;
    z-index: 1;
}
.ua-scale-tick:first-child .ua-scale-tick-line,
.ua-scale-tick:last-child .ua-scale-tick-line {
    height: 14px;
    width: 1.5px;
    background: var(--text-muted);
}
.ua-scale-tick.on .ua-scale-tick-line {
    background: var(--accent);
    height: 14px;
    width: 2px;
    border-radius: 1px;
}
.ua-scale-tick:first-child.on .ua-scale-tick-line,
.ua-scale-tick:last-child.on .ua-scale-tick-line {
    height: 16px;
    width: 2px;
}
.ua-scale-tick.on.inv .ua-scale-tick-line {
    background: #e67e22;
    height: 14px;
    width: 2px;
    border-radius: 1px;
}
.ua-scale-tick-label {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color .15s, font-weight .15s;
    font-variant-numeric: tabular-nums;
}
.ua-scale-tick:first-child .ua-scale-tick-label,
.ua-scale-tick:last-child .ua-scale-tick-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
}
.ua-scale-tick.on .ua-scale-tick-label {
    color: var(--accent);
    font-weight: 700;
    font-size: 10px;
}
.ua-scale-tick.on.inv .ua-scale-tick-label {
    color: #e67e22;
    font-weight: 700;
    font-size: 10px;
}

/* Подпись под ползунком */
.ua-desc {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    padding: 5px 0 0;
    min-height: 20px;
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* Разделитель + */
.ua-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}
.ua-divider::before,
.ua-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}
.ua-divider span {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    margin: 0 10px;
    background: var(--bg-primary);
}

.unassigned-filter-summary {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: 6px 12px;
    text-align: center;
    margin: 8px 16px 4px;
    background: var(--accent-light);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-sm);
}
.filter-summary-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-summary-text i {
    color: var(--accent);
    font-size: 11px;
}

/* === DASHBOARD NAV ACTIONS === */
.dashboard-nav-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* === DASHBOARD HEADER ACTIONS (кнопки справа в заголовке режимов 3, 3.1) === */
.dashboard-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* === RESPONSIVE === */
/* Tablet breakpoint: 600px-900px */
@media (max-width: 900px) and (min-width: 601px) {
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }

    .stat-card {
        padding: var(--space-md);
    }
}

/* Desktop down to tablet: up to 900px */
@media (max-width: 900px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .unassigned-detail-cols,
    .tp-only-detail-cols {
        grid-template-columns: 1fr;
    }

    .quick-assign-row {
        flex-wrap: wrap;
    }
    
    .quick-assign-row .form-group {
        flex: 1 1 45%;
    }
    
    .quick-assign-row .btn {
        flex: 1 1 100%;
    }
    
    /* Адаптация дашборда для планшетов */
    .dashboard-panel {
        max-height: 220px;
    }
    
    .dashboard-panel.expanded {
        max-height: 50vh;
    }
}

/* Мобильная адаптация дашборда */
@media (max-width: 600px) {
    /* Дашборд на мобильном: компактнее + safe area */
    .dashboard-panel {
        max-height: 200px;
        padding: 16px 12px;
        padding-top: 28px; /* место для кнопки */
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .dashboard-panel.collapsed {
        max-height: 44px;
        padding: 8px 12px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .dashboard-panel.expanded {
        max-height: 75vh;
    }
    
    /* Статистика в 2 колонки на мобильном */
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }

    .stat-card {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-sm);
        gap: var(--space-xs);
    }

    .stat-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .stat-content {
        flex: 1;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 11px;
    }
    
    /* Заголовок дашборда на мобильном */
    .dashboard-panel .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .dashboard-panel .dashboard-title {
        font-size: 14px;
    }
    
    .dashboard-panel .dashboard-title-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .dashboard-panel .dashboard-summary-mini {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 11px;
    }
    
    .dashboard-panel .dashboard-summary-mini span {
        padding: 3px 8px;
    }
    
    /* Кнопка toggle на мобильном */
    .dashboard-toggle-btn {
        display: none; /* Скрываем стандартную кнопку на мобильном */
    }
    
    /* FAB кнопка для toggle дашборда на мобильном */
    .fab-add-point.fab-dashboard-toggle {
        background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
        box-shadow: 0 4px 16px rgba(79, 140, 247, 0.4);
        bottom: calc(220px + env(safe-area-inset-bottom, 0px)); /* Над дашбордом */
        transition: transform 0.2s, box-shadow 0.2s, bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Когда дашборд свёрнут - кнопка опускается вниз */
    body:has(.dashboard-panel.collapsed) .fab-add-point.fab-dashboard-toggle {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }
    
    .fab-add-point.fab-dashboard-toggle:hover {
        transform: scale(1.08);
        box-shadow: 0 8px 24px rgba(79, 140, 247, 0.5);
    }
    
    .fab-add-point.fab-dashboard-toggle i {
        transition: transform 0.3s ease;
    }
    
    /* Режим маршрутного листа */
    .dashboard-panel .route-list-scroll {
        max-height: 100px;
    }
    
    .dashboard-panel.expanded .route-list-scroll {
        max-height: calc(75vh - 160px);
    }
    
    /* Детали ТТ на мобильном */
    .dashboard-panel .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px 12px;
        max-height: 80px;
    }
    
    .dashboard-panel.expanded .detail-grid {
        max-height: 200px;
    }
    
    /* Нераспределённые на мобильном */
    .dashboard-panel .unassigned-detail-cols {
        grid-template-columns: 1fr;
    }
    
    .dashboard-panel .unassigned-detail-body {
        max-height: 140px;
    }
    
    .dashboard-panel.expanded .unassigned-detail-body {
        max-height: calc(70vh - 100px);
    }
    
    /* Форма быстрого назначения */
    .dashboard-panel .quick-assign-row {
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-panel .quick-assign-row .form-group {
        flex: 1 1 100%;
    }

    /* Прокручиваемое тело сводки нераспределённых */
    .unassigned-summary-body {
        max-height: 120px;
    }

    .dashboard-panel.expanded .unassigned-summary-body {
        max-height: calc(70vh - 80px);
    }

    /* Навигатор: кнопки вертикально на узких экранах */
    .dashboard-nav-actions {
        flex-direction: column;
    }

    .dashboard-nav-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Кнопки в заголовке режимов: растянуть на мобильном */
    .dashboard-header-actions .btn {
        flex: 1;
        justify-content: center;
        min-height: 36px;
    }
}

/* === EDIT FORM (редактирование ТТ) === */
.edit-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-lg);
}

.edit-form-grid .form-input,
.edit-form-grid .form-select {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
    height: 36px;
    transition: all var(--transition);
}

.edit-form-grid .form-input:hover,
.edit-form-grid .form-select:hover {
    border-color: var(--border-color);
}

.edit-form-grid .form-input:focus,
.edit-form-grid .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 0 1px var(--accent);
    background: var(--bg-card);
}

.edit-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.form-group.compact {
    margin: 0;
}

.form-group.compact .form-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.form-group.compact .form-input,
.form-group.compact .form-select {
    padding: 6px 10px;
    font-size: 13px;
}

.edit-actions {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.edit-actions button {
    flex: 1;
}

.edit-actions .btn-danger {
    margin-left: auto;
}

@media (max-width: 800px) {
    .edit-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === COLUMN MAPPING GRID === */
.column-mapping-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.mapping-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.mapping-select {
    font-size: 13px;
    padding: 6px 8px;
}

@media (max-width: 700px) {
    .column-mapping-grid {
        grid-template-columns: 1fr;
    }
}

/* === МОДАЛКА РЕДАКТИРОВАНИЯ ТТ — Полный редизайн === */

/* Контейнер модалки */
.ep-modal {
    max-width: 720px;
    max-height: 88vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Шапка модалки */
.ep-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(139, 92, 246, 0.03) 100%);
}

.ep-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ep-header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.ep-header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ep-header-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.ep-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s ease;
}

.ep-close-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* Тело модалки — прокручиваемое */
.ep-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

/* Секция формы */
.ep-section {
    border-bottom: 1px solid var(--border-light);
}

.ep-section:last-child {
    border-bottom: none;
}

.ep-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.ep-section-header i {
    color: var(--accent);
    font-size: 12px;
}

.ep-section-body {
    padding: 12px 24px 18px;
}

/* Сетка полей */
.ep-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ep-field-grid--3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.ep-field-grid--2 {
    grid-template-columns: 1fr 1fr;
    margin-top: 14px;
}

.ep-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ep-field--full {
    grid-column: 1 / -1;
}

.ep-field + .ep-field-grid {
    margin-top: 14px;
}

/* Лейблы */
.ep-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    display: block;
}

/* Инпуты и селекты */
.ep-input,
.ep-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
    height: 38px;
}

.ep-input:hover,
.ep-select:hover {
    border-color: var(--accent);
}

.ep-input:focus,
.ep-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-primary);
}

.ep-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Группа инпут + кнопка */
.ep-input-group {
    display: flex;
    gap: 8px;
}

.ep-input-group .ep-input {
    flex: 1;
}

.ep-geo-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ep-geo-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ep-geo-status {
    font-size: 11px;
    margin-top: 4px;
    color: var(--text-muted);
    min-height: 16px;
}

/* === Бейдж текущего назначения к ТП === */
.ep-tp-current {
    margin-bottom: 14px;
}

.ep-tp-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
}

.ep-tp-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.ep-tp-badge-content {
    flex: 1;
    min-width: 0;
}

.ep-tp-badge-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ep-tp-badge-value {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ep-tp-badge-day {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ep-tp-badge-day i {
    color: var(--accent);
    font-size: 11px;
}

/* === Кнопки действий ТП === */
.ep-tp-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.ep-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 36px;
}

.ep-action-btn--add {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.ep-action-btn--add:hover {
    background: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.ep-action-btn--move {
    background: var(--warning);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.ep-action-btn--move:hover {
    background: #d97706;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.ep-action-btn--remove {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.ep-action-btn--remove:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* === Статус (toggle) === */
.ep-section--status {
    background: var(--bg-secondary);
}

.ep-status-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ep-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.ep-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ep-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 24px;
    transition: all 0.25s ease;
    border: 2px solid var(--border-color);
}

.ep-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 1px;
    left: 1px;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ep-toggle input:checked + .ep-toggle-slider {
    background: var(--success);
    border-color: var(--success);
}

.ep-toggle input:checked + .ep-toggle-slider::before {
    transform: translateX(20px);
}

.ep-status-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ep-status-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.ep-status-hint {
    font-size: 11px;
    color: var(--text-muted);
}

/* === Футер модалки === */
.ep-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
}

.ep-footer-right {
    display: flex;
    gap: 10px;
}

.ep-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 40px;
}

.ep-footer-btn--danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ep-footer-btn--danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.ep-footer-btn--cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.ep-footer-btn--cancel:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.ep-footer-btn--save {
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.ep-footer-btn--save:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.ep-footer-btn--save:active {
    transform: translateY(0);
}

/* === Адаптив === */
@media (max-width: 768px) {
    .ep-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .ep-header {
        padding: 16px 18px;
    }

    .ep-section-header {
        padding: 12px 18px 0;
    }

    .ep-section-body {
        padding: 10px 18px 16px;
    }

    .ep-field-grid,
    .ep-field-grid--2,
    .ep-field-grid--3 {
        grid-template-columns: 1fr;
    }

    .ep-field-grid--2,
    .ep-field-grid--3 {
        margin-top: 0;
    }

    .ep-field-grid + .ep-field-grid {
        margin-top: 0;
    }

    .ep-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ep-footer-right {
        width: 100%;
        justify-content: stretch;
    }

    .ep-footer-btn--cancel,
    .ep-footer-btn--save {
        flex: 1;
    }

    .ep-tp-badge {
        flex-wrap: wrap;
    }

    .ep-tp-actions {
        flex-direction: column;
    }

    .ep-action-btn {
        justify-content: center;
    }
}

/* === КНОПКИ === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    height: 36px;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #6366f1 100%);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border-color: var(--border-light);
}
.btn-secondary:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    height: 28px;
}

/* === Вкладки массовых операций === */
.bulk-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 8px;
    width: fit-content;
}
.bulk-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bulk-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
.bulk-tab.active {
    background: var(--accent);
    color: white;
}
.bulk-tab i {
    font-size: 13px;
}

.btn-icon {
    padding: 6px 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



.filter-summary-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* === КАРТОЧКИ === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

/* === СЕТКА ЭТП КАРТОЧЕК === */
.etp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding: 24px;
}

.etp-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.etp-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.etp-card-stripe {
    height: 4px;
}

.etp-card-body {
    padding: 16px;
}

.etp-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.etp-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.etp-card-name {
    font-weight: 600;
    font-size: 14px;
}

.etp-card-city {
    font-size: 12px;
    color: var(--text-secondary);
}

.etp-zones {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}

.etp-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.etp-badge.ok { background: var(--success-bg); color: var(--success); }
.etp-badge.warning { background: var(--warning-bg); color: var(--warning); }
.etp-badge.error { background: var(--danger-bg); color: var(--danger); }

.etp-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.etp-metric {
    text-align: center;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.etp-metric-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

.etp-metric-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.etp-day-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 40px;
}

.etp-day-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    position: relative;
    min-height: 4px;
    transition: var(--transition);
}

.etp-day-bar-label {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--text-muted);
}

/* === ТАБЛИЦЫ === */
.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-sm);
}

/* Градиент-индикатор скролла */
.data-table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, var(--bg-primary));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.data-table-wrap.has-scroll::after {
    opacity: 1;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    background: var(--bg-secondary);
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color var(--transition);
}

.data-table th:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background: var(--accent-light);
}

.data-table tr.inactive {
    opacity: 0.5;
}

.sort-icon {
    margin-left: 4px;
    font-size: 10px;
}

/* === DRAG & DROP ЗОНА === */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-light);
}

.drop-zone i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.drop-zone .drop-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.drop-zone .drop-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* === МОДАЛЬНЫЕ ОКНА === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.modal {
    background: var(--bg-modal);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.12), 0 10px 24px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    overflow: hidden;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

/* Modal drag handle for mobile */
.modal-drag-handle {
    padding: 12px 0;
    text-align: center;
    cursor: grab;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-bar {
    width: 40px;
    height: 5px;
    background: var(--text-muted);
    border-radius: 3px;
    margin: 0 auto;
    opacity: 0.4;
    transition: all var(--transition);
}

.modal-drag-handle:active .drag-bar {
    opacity: 0.8;
}

/* Hide drag handle on desktop, show only on mobile */
@media (min-width: 768px) {
    .modal-drag-handle {
        display: none !important;
    }
}

.modal-header {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.modal-close:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.modal-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-light);
}

/* === TOAST УВЕДОМЛЕНИЯ === */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    font-size: 13px;
    font-weight: 500;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast .toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast .toast-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px;
}

/* === КНОПКА "НАВЕРХ" === */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 40;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 18px;
}

.scroll-top-btn.show {
    display: flex;
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

@media (max-width: 768px) {
    .scroll-top-btn {
        bottom: 16px;
        right: 16px;
    }
}

/* === ФОРМЫ === */
.form-group {
    margin-bottom: 16px;
}

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition);
    height: 36px;
    outline: none;
    font-family: inherit;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--border-color);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 0 1px var(--accent);
    background: var(--bg-card);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    height: auto;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
}

.form-check input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.form-hint {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: -4px;
    margin-bottom: var(--space-md);
    line-height: 1.4;
}

/* === PROGRESS BAR === */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #818cf8 100%);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }

/* === АЛЕРТЫ / ПРЕДУПРЕЖДЕНИЯ === */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 12px;
    backdrop-filter: blur(4px);
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* === МЕТРИКИ (большие карточки) === */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

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

.metric-card-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.metric-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === ВЕРСИИ (карточки) === */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.version-card.active-version {
    border-color: var(--success);
    box-shadow: 0 0 0 1px var(--success);
}

.version-card .v-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.version-card .v-status.active { background: var(--success); }
.version-card .v-status.inactive { background: var(--text-muted); }

.version-card .v-info { flex: 1; }
.version-card .v-name { font-weight: 600; font-size: 14px; }
.version-card .v-desc { font-size: 12px; color: var(--text-secondary); }
.version-card .v-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.version-card .v-actions {
    display: flex;
    gap: 6px;
}

/* === TIMELINE (История) === */
.timeline {
    padding: 0 24px;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 39px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    position: relative;
}

.timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    z-index: 1;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
}

.timeline-icon.create { border-color: var(--success); color: var(--success); }
.timeline-icon.move { border-color: var(--info); color: var(--info); }
.timeline-icon.exclude { border-color: var(--danger); color: var(--danger); }
.timeline-icon.include { border-color: var(--warning); color: var(--warning); }
.timeline-icon.reorder { border-color: var(--accent); color: var(--accent); }
.timeline-icon.clone { border-color: var(--etp-5); color: var(--etp-5); }

.timeline-content {
    flex: 1;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.timeline-desc {
    font-size: 13px;
    font-weight: 500;
}

.timeline-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.timeline-details {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* === СВОДНАЯ ТАБЛИЦА ЭТП x ДНИ === */
.pivot-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pivot-table th,
.pivot-table td {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.pivot-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.pivot-table .cell-ok { background: var(--success-bg); }
.pivot-table .cell-warn { background: var(--warning-bg); }
.pivot-table .cell-danger { background: var(--danger-bg); }

/* === СТРАНИЦА ЛОГИНА === */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-card .login-logo {
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 16px;
}

.login-card h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-card .login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-card .form-group {
    text-align: left;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    display: none;
}

.login-error.show { display: block; }

/* === АНИМАЦИИ === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    transition: all var(--transition);
}

.badge-a  { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.3); }
.badge-a1 { background: rgba(52, 211, 153, 0.1); color: #059669; border-color: rgba(52, 211, 153, 0.3); }
.badge-b  { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border-color: rgba(59, 130, 246, 0.3); }
.badge-b1 { background: rgba(99, 179, 237, 0.1); color: #2563eb; border-color: rgba(99, 179, 237, 0.3); }
.badge-c  { background: rgba(251, 191, 36, 0.1); color: #d97706; border-color: rgba(251, 191, 36, 0.3); }
.badge-c1 { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border-light); }

.badge-etp {
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

.badge-day {
    padding: 1px 6px;
    border-radius: 4px;
    color: white;
    font-size: 10px;
    font-weight: 600;
}

/* === ОП МАРКЕРЫ === */
.op-mismatch {
    color: var(--danger);
    font-weight: 600;
}

.manual-override {
    color: var(--warning);
}

/* === IMPORT PAGE === */
.import-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1200px;
}

.import-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.import-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.import-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.import-stat {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.import-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.import-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* === PROGRESS STAGES === */
.progress-stages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.progress-stage {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.progress-stage-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.progress-stage.active .progress-stage-icon {
    background: var(--accent);
    color: white;
}

.progress-stage.done .progress-stage-icon {
    background: var(--success);
    color: white;
}

/* === SETTINGS PAGE === */

/* Settings header */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.settings-page-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.settings-legend {
    margin-top: var(--space-xs);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.settings-legend-item {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.settings-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

.settings-legend-dot--hard { background: var(--danger); }
.settings-legend-dot--soft { background: var(--warning); }
.settings-legend-dot--info { background: var(--success); }

.settings-restore-wrapper {
    position: relative;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-xl);
    max-width: 1400px;
}

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.settings-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* === ОВЕРЛЕЙ ПОСТРОЕНИЯ МАРШРУТОВ === */
#buildModal {
    z-index: 1100;   /* выше карты Яндекс (z-index ~1000) */
}

/* Hide buildModal when minimized (use class instead of inline display:none) */
#buildModal.minimized {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

.build-modal {
    max-width: 680px;
    width: 92%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 20px;
    gap: 0;
}


.settings-section h3 {
    font-size: var(--text-md);
    font-weight: 600;
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
}

.settings-section h3 i {
    color: var(--accent);
    font-size: var(--text-md);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
}

/* Settings row with badge */
.sett-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.sett-field {
    flex: 1;
}
.sett-badge {
    font-size: var(--text-xs);
    padding: 4px 12px;
    border-radius: 12px;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.sett-badge.hard {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.2);
}

.sett-badge.soft {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.2);
}

.sett-badge.info {
    background: rgba(16, 185, 129, 0.08);
    color: #16a34a;
    border-color: rgba(16, 185, 129, 0.2);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .import-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* ETP grid - mobile */
    .etp-grid { grid-template-columns: 1fr; }
}
/* === НОВЫЙ UI: ЧИПЫ И ПЕРЕКЛЮЧАТЕЛИ === */

/* Режимы отображения (табы) */
.view-mode-tabs {
    display: flex;
    gap: 2px;
    background: var(--glass-bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.view-mode-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px var(--space-md);
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    white-space: nowrap;
}

.view-mode-tab:hover {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
}

.view-mode-tab.active {
    background: var(--bg-card);
    color: var(--accent);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2), 0 2px 8px rgba(99, 102, 241, 0.1);
}

.view-mode-tab.active i {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Чипы для ЭТП */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.filter-chip:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

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

.filter-chip.active {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    border-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.filter-chip .chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
    flex-shrink: 0;
}

.filter-chip .chip-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-chip.active .chip-dot {
    opacity: 1;
    background: white;
}

/* Чипы для дней недели */
.filter-chips-days {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.day-chip {
    padding: 10px 8px;
    text-align: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    letter-spacing: 0.2px;
    position: relative;
}

.day-chip:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.day-chip.active {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    font-weight: 700;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

/* Переключатели слоёв */
.layer-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-toggle:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.layer-toggle.active {
    background: var(--glass-bg);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--accent-glow), inset 0 0 0 1px var(--accent-glow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}


.layer-toggle i {
    font-size: 12px;
    width: 16px;
    text-align: center;
    opacity: 0.8;
}

.layer-toggle.active i {
    opacity: 1;
}

/* Сравнение ЭТП vs ТП */
.compare-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.compare-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    padding: 2px 0;
}

/* Единая иконка легенды */
.compare-legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

/* Статистика сравнения */
.compare-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.compare-stat {
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.compare-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.compare-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Страница ТП - улучшения */
.tp-detail-panel {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    padding: 24px;
}

.tp-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.tp-comparison-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.tp-comparison-header {
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp-comparison-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-light);
}

.tp-comparison-stat {
    padding: 16px;
    background: var(--bg-card);
    text-align: center;
}

.tp-comparison-stat .value {
    font-size: 24px;
    font-weight: 700;
}

.tp-comparison-stat .label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.tp-comparison-stat.match { border-top: 3px solid var(--success); }
.tp-comparison-stat.different { border-top: 3px solid var(--warning); }
.tp-comparison-stat.only-tp { border-top: 3px solid var(--danger); }
.tp-comparison-stat.only-etp { border-top: 3px solid var(--info); }

/* Адаптивность */
@media (max-width: 900px) {
    .tp-detail-panel {
        grid-template-columns: 1fr;
    }
    
    .tp-comparison-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Активные состояния чипов с цветом */
.filter-chip.active {
    background: var(--chip-color, var(--accent));
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.day-chip.active {
    background: var(--day-color, var(--accent));
    color: white;
}

/* Кнопки действий в заголовках фильтров */

.filter-action-btn {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.filter-action-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* ===== COLLAPSIBLE FILTER SECTIONS ===== */
.filter-collapsible {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-collapsible.has-active {
    border-color: rgba(79, 140, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(79, 140, 247, 0.1);
}

/* Заголовок */
.filter-coll-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    cursor: pointer;
    user-select: none;
    background: var(--bg-secondary);
    transition: background 0.15s;
}

.filter-coll-header:hover {
    background: var(--bg-tertiary);
}

.filter-collapsible.has-active .filter-coll-header {
    background: rgba(79, 140, 247, 0.08);
}

.filter-coll-title {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.filter-collapsible.has-active .filter-coll-title {
    color: var(--accent);
}

/* Счётчик активных */
.filter-coll-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--accent);
    color: white;
    min-width: 20px;
    text-align: center;
    line-height: 16px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.filter-collapsible.has-active .filter-coll-badge {
    opacity: 1;
    transform: scale(1);
}

/* Кнопки Все/None — видны только в открытом состоянии */
.filter-coll-controls {
    display: flex;
    gap: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.filter-collapsible.open .filter-coll-controls {
    opacity: 1;
    pointer-events: auto;
}

/* Chevron */
.filter-coll-chevron {
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
}

.filter-collapsible.open .filter-coll-chevron {
    transform: rotate(180deg);
}

.filter-collapsible.has-active .filter-coll-chevron {
    color: var(--accent);
}

/* Тело — max-height анимация */
.filter-coll-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-collapsible.open .filter-coll-body {
    max-height: 500px;
}

.filter-coll-body-inner {
    padding: 10px 12px 12px;
}

/* === ДАШБОРД - РАСШИРЕННАЯ СТАТИСТИКА === */

.dashboard-warnings {
    margin-bottom: 20px;
}

.dashboard-warnings .alert {
    margin-bottom: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Dashboard-specific metric card overrides */
.dashboard-metrics .metric-card {
    text-align: center;
    padding: 16px;
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ABC Distribution */
.abc-distribution {
    padding: 16px;
}

.abc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.abc-card {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
}

.abc-card.abc-a {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.abc-card.abc-a1 {
    background: rgba(52, 211, 153, 0.08);
    border-color: #34d399;
}

.abc-card.abc-b {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.abc-card.abc-b1 {
    background: rgba(99, 179, 237, 0.08);
    border-color: #60a5fa;
}

.abc-card.abc-c {
    background: rgba(251, 191, 36, 0.1);
    border-color: #f59e0b;
}

.abc-card.abc-c1 {
    background: rgba(239, 68, 68, 0.08);
    border-color: #ef4444;
}

.abc-card.abc-none {
    background: rgba(156, 163, 175, 0.1);
    border-color: #9ca3af;
}

.abc-header {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.abc-a  .abc-header { color: #10b981; }
.abc-a1 .abc-header { color: #34d399; }
.abc-b  .abc-header { color: #3b82f6; }
.abc-b1 .abc-header { color: #60a5fa; }
.abc-c  .abc-header { color: #f59e0b; }
.abc-c1 .abc-header { color: #ef4444; }
.abc-none .abc-header { color: #9ca3af; }

.abc-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.abc-percent {
    font-size: 14px;
    color: var(--text-muted);
}

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

.abc-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dashboard Grid 2 columns */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

/* Stat box */
.stat-box {
    text-align: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-box .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-box .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Import progress box */
#importProgressBox {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

#importResultBox {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

/* Cell status */
.cell-ok { background: rgba(16, 185, 129, 0.15); color: #059669; }
.cell-danger { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.cell-warn { background: rgba(245, 158, 11, 0.15); color: #d97706; }

/* ============================================================
   ИМПОРТ — Результат (улучшенный дизайн)
   ============================================================ */

.import-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.import-result-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
}

.import-result-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.import-result-main {
    font-weight: 600;
    font-size: 17px;
}

.import-result-summary {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Статистика — сетка карточек */
.import-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-color);
    margin: 1px;
    border-bottom: 1px solid var(--border-color);
}

.import-stat-card {
    background: var(--bg-card);
    padding: 18px 12px;
    text-align: center;
}

.import-stat-card .stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.import-stat-card .stat-card-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.import-stat-card.stat-card-success {
    background: var(--success-bg);
}

.import-stat-card.stat-card-success .stat-card-value {
    color: var(--success);
}

.import-stat-card.stat-card-info {
    background: var(--info-bg);
}

.import-stat-card.stat-card-info .stat-card-value {
    color: var(--info);
}

.import-stat-card.stat-card-danger {
    background: var(--danger-bg);
}

.import-stat-card.stat-card-danger .stat-card-value {
    color: var(--danger);
}

/* Секция координат */
.import-coords-section {
    padding: 14px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.coords-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.coords-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.coord-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.coord-value {
    font-size: 18px;
    font-weight: 700;
}

.coord-label {
    font-size: 12px;
    color: var(--text-muted);
}

.coord-success .coord-value { color: var(--success); }
.coord-info .coord-value { color: var(--info); }
.coord-warning .coord-value { color: var(--warning); }

/* Дополнительная информация */
.import-extra-info {
    padding: 12px 20px;
    background: var(--bg-card);
}

.extra-info-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 4px;
}

.extra-info-abc {
    background: var(--info-bg);
    color: var(--info);
}

.extra-info-delete {
    background: var(--warning-bg);
    color: #b45309;
}

/* Предупреждение о геокодировании */
.import-geocode-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid var(--warning);
}

.geocode-warning-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.geocode-warning-icon {
    width: 44px;
    height: 44px;
    background: var(--warning);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.geocode-warning-title {
    font-weight: 600;
    color: #92400e;
    font-size: 15px;
}

.geocode-warning-hint {
    font-size: 12px;
    color: #a16207;
    margin-top: 2px;
}

.btn-geocode {
    background: var(--warning);
    color: #fff;
    border: none;
    white-space: nowrap;
}

.btn-geocode:hover {
    background: #d97706;
    color: #fff;
}

/* Прогресс геокодирования */
.geocode-progress-box {
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.geocode-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.geocode-progress-icon {
    color: var(--warning);
    font-size: 16px;
}

.geocode-progress-title {
    font-weight: 500;
    flex: 1;
}

.geocode-progress-count {
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.geocode-progress-bar-wrap {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.geocode-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.geocode-progress-stats {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Результат геокодирования */
.geocode-result {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.geocode-result-icon {
    width: 36px;
    height: 36px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.geocode-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.geocode-result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.geocode-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.geocode-stat-success { color: var(--success); }
.geocode-stat-info { color: var(--info); }
.geocode-stat-danger { color: var(--danger); }

/* Адаптивность для импорта */
@media (max-width: 600px) {
    .import-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .import-geocode-warning {
        flex-direction: column;
        align-items: stretch;
    }
    
    .geocode-warning-content {
        margin-bottom: 12px;
    }
    
    .btn-geocode {
        width: 100%;
        justify-content: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .abc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Tabs */
.dashboard-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dashboard-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dashboard-tab.active {
    background: var(--accent);
    color: white;
}

.dashboard-tab i {
    font-size: 12px;
}

/* Unassigned Stats Grid */
.unassigned-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.unassigned-category-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--border-color);
    transition: transform 0.2s;
}

.unassigned-category-card:hover {
    transform: translateX(4px);
}

.unassigned-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.unassigned-category-icon i {
    font-size: 16px;
    color: white;
}

.unassigned-category-content {
    flex: 1;
    min-width: 0;
}

.unassigned-category-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.unassigned-category-count {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.unassigned-category-metrics {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.unassigned-category-metrics span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Unassigned Exclude Toggle */
.unassigned-exclude-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

.unassigned-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    min-height: 36px;
}

.filter-btn i {
    font-size: 13px;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.filter-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.filter-btn .filter-count,
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 10px;
    font-weight: 600;
}

.filter-btn.active .filter-count {
    background: var(--accent);
    color: white;
}

/* Supervisor Stats Grid */
.sv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px;
}

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

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

.sv-card-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.sv-card-zones {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sv-card-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.sv-card-status.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.sv-card-status.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.sv-card-status.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sv-card-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.sv-metric {
    text-align: center;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 6px;
}

.sv-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sv-metric-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.sv-warnings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.sv-warning-item {
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    margin-bottom: 4px;
    color: #ef4444;
}

/* Compact Warnings Table */
.warnings-compact {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.warnings-table th {
    font-weight: 500;
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.warnings-table td {
    text-align: center;
}

/* ============================================================
   УЛУЧШЕННЫЕ МОДАЛЬНЫЕ ОКНА (Linear/Notion стиль)
   ============================================================ */

/* === Modal Header with Avatar === */
.modal-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* === User Modal Avatar === */
.user-modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 140, 247, 0.25);
}

/* === TP Modal Avatar === */
.tp-modal-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* === Modal Sections === */
.modal-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 16px;
    overflow: hidden;
}

.modal-section:last-child {
    margin-bottom: 0;
}

.modal-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.modal-section-header i {
    color: var(--accent);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.modal-section-body {
    padding: 16px;
}

.section-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
}

/* === Form Row 2 Column Layout === */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-2 .form-group {
    margin-bottom: 12px;
}

.form-row-2 .form-group:last-child {
    margin-bottom: 12px;
}

/* === Input with Icon === */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
    transition: var(--transition);
}

.input-with-icon .form-input,
.input-with-icon .form-select {
    padding-left: 36px;
}

.input-with-icon .form-input:focus + i,
.input-with-icon .form-input:focus ~ i {
    color: var(--accent);
}

/* === Role Selector === */
.role-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.role-option:hover {
    border-color: var(--border-focus);
    background: var(--bg-secondary);
}

.role-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.role-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.role-tp { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.role-supervisor { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.role-rop { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.role-admin { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.role-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

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

.role-desc {
    font-size: 10px;
    color: var(--text-muted);
}

.role-option.selected .role-name {
    color: var(--accent);
}

/* === Checkbox Grid === */
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    font-weight: 500;
    user-select: none;
}

.checkbox-item:hover {
    border-color: var(--border-focus);
    background: var(--bg-secondary);
}

.checkbox-item.checked {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-indicator {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-item.checked .checkbox-indicator {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-indicator i {
    color: white;
    font-size: 10px;
    opacity: 0;
    transition: var(--transition);
}

.checkbox-item.checked .checkbox-indicator i {
    opacity: 1;
}

/* ETP color indicators in checkboxes */
.etp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Color Picker Styling === */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-preview-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
}

.color-input-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.color-preview-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    pointer-events: none;
}

.color-preview-wrapper:hover .color-preview-circle {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.color-input-text-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.color-hash {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: monospace;
    pointer-events: none;
}

.color-text-input {
    padding-left: 28px !important;
    font-family: monospace;
    text-transform: uppercase;
}

/* === Color Presets === */
.color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.color-preset {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.color-preset:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-preset.selected {
    border-color: var(--text-primary);
}

.color-preset.selected::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* === Role Badges (for table display) === */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.role-badge.tp { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.role-badge.supervisor { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.role-badge.rop { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.role-badge.admin { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.role-badge i {
    font-size: 10px;
}

/* === Status Badge === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.inactive {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* === Modal User Specific === */
.modal-user .modal-body {
    max-height: calc(80vh - 140px);
    overflow-y: auto;
}

.modal-tp .modal-body {
    padding: 20px 24px;
}

/* === ЭТП Модальное окно === */
.modal-etp {
    max-width: 480px;
}

.modal-etp .modal-body {
    padding: 20px 24px;
}

.etp-modal-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #10b981);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

/* === Dark Theme Adjustments === */
body.dark-theme .modal-section {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.dark-theme .modal-section-header {
    background: rgba(0, 0, 0, 0.2);
    border-color: var(--border-color);
}

body.dark-theme .role-option {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-theme .role-option:hover {
    background: var(--bg-tertiary);
}

body.dark-theme .role-option.selected {
    background: rgba(79, 140, 247, 0.15);
}

body.dark-theme .checkbox-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-theme .checkbox-item:hover {
    background: var(--bg-tertiary);
}

body.dark-theme .checkbox-item.checked {
    background: rgba(79, 140, 247, 0.15);
}

body.dark-theme .color-preview-circle {
    border-color: var(--border-color);
}

body.dark-theme .color-preset.selected {
    border-color: var(--text-primary);
}

body.dark-theme .input-with-icon .form-input:focus ~ i {
    color: var(--accent);
}

/* === Responsive === */
@media (max-width: 600px) {
    /* Mobile-specific dashboard heights */
    :root {
        --dashboard-height-peek: 90px;
        --dashboard-height-normal: 180px;
        --dashboard-height-expanded: 70vh;
    }

    .dashboard-panel {
        max-height: var(--dashboard-height-normal);
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }

    .dashboard-panel.expanded {
        max-height: var(--dashboard-height-expanded);
    }

    .dashboard-panel.expanded .route-list-scroll {
        max-height: calc(70vh - 140px);
    }

    .dashboard-panel.expanded .unassigned-detail-body {
        max-height: calc(70vh - 120px);
    }

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

    .role-selector {
        grid-template-columns: 1fr;
    }

    .modal-header-content {
        flex-direction: column;
        text-align: center;
    }

    .modal-header-text {
        align-items: center;
    }
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

/* === Mobile Sidebar === */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* === Mobile Panel Toggles (hidden on desktop) === */
.panel-toggle {
    display: none;
}

.panel-backdrop {
    display: none;
}

/* Mobile Search Button */
.mobile-search-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.mobile-search-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 300;
    flex-direction: column;
}

.mobile-search-overlay.show {
    display: flex;
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.mobile-search-input-wrap {
    flex: 1;
    position: relative;
}

.mobile-search-input-wrap input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

.mobile-search-input-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.mobile-search-close {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
}

.mobile-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.mobile-search-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* === Responsive Breakpoints === */
@media (max-width: 1024px) {
    /* Tables - horizontal scroll */
    .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    /* Cards grid - smaller cards */
    .etp-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        padding: 16px;
    }
    
    /* Dashboard stats */
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Settings grid */
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Sidebar - hidden by default, slides in */
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 100;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .sidebar-backdrop.show {
        display: block;
    }
    
    /* User info - увеличенный шрифт */
    .sidebar-footer .user-info {
        font-size: 13px;
    }
    
    .sidebar-footer #userName {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 180px;
    }
    
    .sidebar-footer #userRole,
    .sidebar-footer #userLogin {
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 180px;
    }
    
    .sidebar-footer .user-info > div {
        min-width: 0;
        overflow: hidden;
    }
    
    /* Main content - full width */
    .main-content {
        width: 100%;
    }
    
    /* Topbar */
    .topbar {
        padding: 0 16px;
        padding-left: 60px; /* Space for menu button */
    }
    
    .topbar-title {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        min-width: 0;
        flex: 1;
        max-width: calc(100vw - 200px);
    }
    
    .search-box {
        display: none;
    }
    
    .mobile-search-btn {
        display: flex;
    }
    
    .topbar-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    
    .topbar-actions .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .topbar-actions .btn span {
        display: none;
    }
    
    /* Скрываем кнопку Экспорт на маленьких экранах */
    .topbar-actions .btn-secondary {
        display: none;
    }
    
    /* Page padding */
    .page-padded {
        padding: 16px;
    }
    
    /* Cards */
    .card {
        padding: 16px;
    }
    
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Modals - fullscreen on mobile */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
        overscroll-behavior: contain;
    }
    
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px));
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 16px 16px 0;
    }
    
    .modal-body {
        padding: 16px;
        max-height: calc(100dvh - 200px);
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-footer {
        padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* ETP grid */
    .etp-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    
    /* Dashboard stats */
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .stat-card {
        padding: 8px 10px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    /* Metrics */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    /* Filter panel */
    .map-filter-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: calc(-300px - env(safe-area-inset-left, 0px));
        width: 280px;
        max-width: 85vw;
        z-index: 80;
        overflow-y: auto;
        transition: left 0.3s ease;
    }

    .map-filter-panel.open {
        left: env(safe-area-inset-left, 0px);
    }

    /* Zone panel - mobile slide-in */
    .zone-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: calc(-320px - env(safe-area-inset-left, 0px));
        width: 300px;
        max-width: 85vw;
        z-index: 80;
        transition: left 0.3s ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }

    .zone-panel.open {
        left: env(safe-area-inset-left, 0px);
    }
    
    .zone-mobile-close {
        display: flex;
    }
    
    /* Panel toggle buttons */
    .panel-toggle {
        display: flex;
        position: fixed;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        z-index: 90;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--accent);
        color: white;
        border: none;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .panel-toggle:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
    }
    
    .panel-toggle:active {
        transform: scale(0.97);
    }
    
    .filter-toggle {
        left: 20px;
    }
    
    .zone-toggle {
        left: 88px;
    }
    
    /* Подписи к FAB-кнопкам */
    .panel-toggle::after {
        content: attr(data-label);
        position: absolute;
        bottom: -20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        white-space: nowrap;
        color: var(--text-muted);
        opacity: 0;
        transition: opacity 0.2s;
        pointer-events: none;
    }
    
    .panel-toggle:first-open::after {
        opacity: 1;
    }
    
    /* FAB для добавления ТТ */
    .fab-add-point {
        display: flex;
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        z-index: 90;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--success);
        color: white;
        border: none;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
        align-items: center;
        justify-content: center;
        font-size: 20px;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .fab-add-point:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 24px rgba(34, 197, 94, 0.5);
    }
    
    .fab-add-point:active {
        transform: scale(0.97);
    }
    
    /* Panel backdrops */
    .panel-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 75;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .panel-backdrop.show {
        display: block;
        opacity: 1;
    }
    
    /* Dashboard panel - три состояния: свёрнуто, норма (60vh), развёрнуто (85vh) */
    .dashboard-panel {
        max-height: 60vh;
        padding: 12px;
        transition: max-height 0.3s ease;
    }

    .dashboard-panel.expanded {
        max-height: 85vh;
    }

    /* Синхронизируем calc() вложенных скролл-областей с 85vh */
    .dashboard-panel.expanded .route-list-scroll {
        max-height: calc(85vh - 140px);
    }

    .dashboard-panel.expanded .unassigned-detail-body {
        max-height: calc(85vh - 120px);
    }

    .dashboard-panel.expanded .unassigned-summary-body {
        max-height: calc(85vh - 80px);
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dashboard-summary-mini {
        flex-wrap: wrap;
        gap: 4px 12px;
        font-size: 11px;
    }
    
    /* Кнопка сворачивания dashboard */
    .dashboard-toggle-btn {
        display: flex;
    }
    
    .dashboard-toggle-btn:hover {
        background: var(--bg-secondary);
        color: var(--text-primary);
    }
    
    .dashboard-panel.collapsed {
        max-height: 0;
        padding: 0 12px;
        overflow: hidden;
    }
    
    .dashboard-panel.collapsed .dashboard-toggle-btn {
        top: 0;
        border-radius: 12px;
    }
    
    /* FAB-кнопки - позиция выше, чтобы не конфликтовали с fab-add-point */
    .panel-toggle {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    /* Фильтры нераспределённых ТТ */
    .unassigned-filters {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 11px;
        min-height: 44px;
    }

    .filter-actions button {
        min-height: 40px;
    }

    /* Version cards */
    .version-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .version-card .v-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Timeline */
    .timeline {
        padding: 0 12px;
    }
    
    .timeline::before {
        left: 19px;
    }
    
    .timeline-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    /* Filter chips - горизонтальный скролл */
    .filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        margin: 0 -16px;
        padding: 0 16px 4px;
        scrollbar-width: none;
    }
    
    .filter-chips::-webkit-scrollbar {
        display: none;
    }
    
    .filter-chip {
        flex-shrink: 0;
    }
    
    /* Data tables - улучшения для мобилок */
    .data-table-wrap {
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table-wrap.has-scroll::after {
        opacity: 1;
    }
    
    .data-table-wrap.scrolled-end::after {
        opacity: 0;
    }
    
    /* Forms */
    .form-row-2 {
        grid-template-columns: 1fr;
    }
    
    .edit-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Role selector */
    .role-selector {
        grid-template-columns: 1fr;
    }
    
    .role-option {
        padding: 8px 10px;
    }
    
    .role-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .role-name {
        font-size: 13px;
    }
    
    .role-desc {
        display: none;
    }
    
    /* Checkbox grid */
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Modal sections */
    .modal-section {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .modal-section:first-child {
        margin-top: -16px;
    }
    
    /* Modal header with avatar */
    .modal-header-content {
        flex-direction: row;
    }
    
    .user-modal-avatar,
    .tp-modal-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .modal-header-text {
        align-items: flex-start;
    }
    
    .modal-header-text h3 {
        font-size: 16px;
    }
    
    .modal-subtitle {
        font-size: 12px;
    }
    
    /* Pivot table */
    .pivot-table {
        font-size: 11px;
    }
    
    .pivot-table th,
    .pivot-table td {
        padding: 6px 4px;
    }
    
    /* Buttons */
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    /* Toast - внизу на мобильном */
    .toast-container {
        top: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
    }
    
    .toast {
        max-width: 100%;
        font-size: 12px;
    }
    
    /* Color presets */
    .color-presets {
        justify-content: flex-start;
    }
    
    /* Settings sections */
    .settings-section {
        padding: 16px;
    }
    
    .sett-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .sett-badge {
        align-self: flex-start;
    }
    
    /* Import drop zone */
    .drop-zone {
        padding: 24px 16px;
    }
    
    .drop-zone i {
        font-size: 32px;
    }
    
    .drop-zone .drop-text {
        font-size: 13px;
    }
    
    /* Замена текста на мобильных */
    .drop-zone .desktop-text {
        display: none;
    }
    
    .drop-zone .mobile-text {
        display: block !important;
    }
    
    /* Login page - адаптация */
    .login-page {
        padding: 16px;
    }
    
    .login-card {
        width: auto;
        max-width: 100%;
        margin: 0;
    }
    
    /* Modal drag handle - visible on mobile */
    .modal-drag-handle {
        display: block;
    }
}

@media (max-width: 480px) {
    /* Extra small devices */
    .etp-grid {
        padding: 8px;
    }
    
    .page-padded {
        padding: 8px;
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
    
    .card {
        padding: 12px;
        border-radius: var(--radius-md);
    }
    
    .topbar-title {
        font-size: 14px;
    }
    
    .dashboard-stats {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        grid-template-columns: unset;
    }
    
    .stat-card {
        min-width: 120px;
        flex-shrink: 0;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    /* Buttons - icon only */
    .topbar-actions .btn {
        padding: 8px;
    }
    
    .topbar-actions .btn i {
        margin: 0;
    }
    
    /* Checkbox grid - single column */
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    /* Modal */
    .modal {
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .modal-footer {
        gap: 6px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    
    /* Главное действие первым на мобильном */
    .modal-footer .btn-primary,
    .modal-footer .btn-success {
        order: -1;
    }
    
    /* Forms - single column */
    .edit-form-row {
        grid-template-columns: 1fr;
    }
    
    /* Tables */
    .pivot-table {
        font-size: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Toast - внизу экрана */
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 8px;
        left: 8px;
    }
    
    /* Metrics - single column */
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-card-value {
        font-size: 24px;
    }
    
    /* Zone panel - fullscreen */
    .zone-panel {
        width: 100vw;
        max-width: 100vw;
        left: -100vw;
    }
    
    .zone-panel.open {
        left: 0;
    }
}

/* === Touch Optimizations === */
@media (hover: none) and (pointer: coarse) {
    /* Remove tap highlight */
    *,
    *::before,
    *::after {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Larger touch targets */
    .nav-item {
        min-height: 48px;
    }
    
    .btn {
        min-height: 44px;
    }
    
    .btn:active {
        transform: scale(0.97);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .modal-close {
        width: 44px;
        height: 44px;
    }
    
    .checkbox-item {
        min-height: 44px;
        padding: 12px;
    }
    
    .color-preset {
        width: 36px;
        height: 36px;
    }
    
    .role-option {
        min-height: 56px;
    }
    
    /* Smooth scrolling */
    .data-table-wrap,
    .zone-list-container,
    .modal-body,
    .page-content,
    [overflow-y="auto"] {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* === Landscape orientation fixes === */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        max-height: 95vh;
    }
    
    .modal-body {
        max-height: 50vh;
        overflow-y: auto;
    }
    
    .login-card {
        padding: 24px;
    }
    
    .login-logo {
        font-size: 32px;
        height: 48px;
    }
    
    /* Dashboard panel - больше места в landscape */
    .dashboard-panel {
        max-height: 60vh;
    }
}

/* === Safe Area Insets for modern devices === */
@supports (padding: max(0px)) {
    .sidebar {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
    
    .sidebar-footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .sidebar.open {
        width: calc(280px + env(safe-area-inset-left));
    }
    
    .topbar {
        padding-left: max(60px, calc(60px + env(safe-area-inset-left)));
        padding-right: max(16px, env(safe-area-inset-right));
    }
    
    /* panel-toggle position handled in 768px media query for mobile */
    
    .modal {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .dashboard-panel {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    .mobile-search-header {
        padding-top: max(12px, env(safe-area-inset-top));
    }
    
    .mobile-search-results {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* === Торговые представители: карточки и табы === */
.tp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tp-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.tp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tp-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tp-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tp-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.tp-card-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
}

.tp-card-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.tp-card-stats {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.tp-stat-item {
    text-align: center;
}

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

.tp-stat-item .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tp-stat-item.success .value { color: var(--success); }
.tp-stat-item.danger .value { color: var(--danger); }
.tp-stat-item.warning .value { color: var(--warning); }

/* Табы в деталях ТП */
.tp-detail-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
    margin-bottom: 16px;
}

.tp-detail-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.tp-detail-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tp-detail-tab.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tp-tab-content {
    /* Контент табов */
}

/* История импорта ТП */
.tp-import-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tp-import-history-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px 16px;
}

.tp-import-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tp-import-history-date {
    font-size: 12px;
    color: var(--text-muted);
}

.tp-import-history-filename {
    font-size: 13px;
    font-weight: 500;
}

.tp-import-history-stats {
    display: flex;
    gap: 16px;
}

.tp-import-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.tp-import-stat i {
    font-size: 10px;
}

.tp-import-stat.success { color: var(--success); }
.tp-import-stat.danger { color: var(--danger); }
.tp-import-stat.warning { color: var(--warning); }

.tp-import-history-errors {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.tp-import-history-errors summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 4px;
}

.tp-import-history-errors[open] summary {
    margin-bottom: 8px;
}

.tp-import-history-errors ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    max-height: 120px;
    overflow-y: auto;
}

.tp-import-history-errors li {
    margin: 2px 0;
}

/* === Адаптивные классы для инлайн-стилей === */

/* Сетка статистики ТП - адаптивная */
.metrics-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

/* Select с адаптивной шириной */
.form-select-mobile {
    width: 180px;
}

/* Табы с горизонтальным скроллом на мобильном */
.tabs-scrollable {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 10px;
}

/* Шапка настроек - легенда */
.settings-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.settings-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Шапка настроек - кнопки */
.settings-actions {
    display: flex;
    gap: 10px;
}

/* Подсказка рисования зон */
.zone-draw-hint {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    z-index: 10;
    pointer-events: none;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Zone actions */
.zone-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* === Мобильные стили для адаптивных классов === */
@media (max-width: 768px) {
    /* Сетка статистики ТП - 2 колонки на мобильном */
    .metrics-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Select на всю ширину */
    .form-select-mobile {
        width: 100%;
    }
    
    /* Табы с горизонтальным скроллом */
    .tabs-scrollable {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tabs-scrollable::-webkit-scrollbar {
        display: none;
    }
    
    /* Шапка настроек - легенда вертикально */
    .settings-legend {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Шапка настроек - кнопки только иконки */
    .settings-actions .btn span {
        display: none;
    }
    
    .settings-actions .btn i {
        margin: 0;
    }
    
    /* Zone actions - wrap на мобильном */
    .zone-actions {
        flex-wrap: wrap;
    }
    
    /* Login card padding */
    .login-card {
        padding: 24px;
    }
    
    /* Индивидуальные настройки ЭТП - колонка */
    .etp-settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .etp-settings-header .form-group {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    /* Сетка статистики ТП - 2 колонки на очень маленьких */
    .metrics-grid-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* === Print styles === */
@media print {
    .sidebar,
    .topbar,
    .modal-overlay,
    .toast-container,
    .btn,
    .sidebar-toggle {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .page-content {
        overflow: visible;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ================================================================
   ПРОДАЖИ ПО ПРОДУКТАМ
   ================================================================ */

/* Drop-zone */
.sales-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--border-color, #d1d5db);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s);
    margin: 16px;
    min-height: 160px;
}
.sales-drop-zone:hover,
.sales-drop-zone.drag-over {
    border-color: var(--accent, #3b82f6);
    background: rgba(59, 130, 246, 0.04);
}
.sales-drop-icon {
    font-size: 40px;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 12px;
}
.sales-drop-zone:hover .sales-drop-icon,
.sales-drop-zone.drag-over .sales-drop-icon {
    color: var(--accent, #3b82f6);
}
.sales-drop-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}
.sales-drop-hint {
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
}

/* Preview */
.sales-preview-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.sales-preview-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.sales-preview-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.sales-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: var(--radius-sm, 6px);
}
.sales-preview-label {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}
.sales-preview-value {
    font-size: 14px;
    font-weight: 600;
}
.sales-preview-actions {
    padding: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

/* Progress */
.sales-progress-bar {
    margin: 16px;
    height: 8px;
    background: var(--bg-secondary, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}
.sales-progress-fill {
    height: 100%;
    background: var(--accent, #3b82f6);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0;
}
.sales-progress-text {
    padding: 0 16px 16px;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
    text-align: center;
}

/* Metrics */
.sales-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.sales-metric-card {
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    padding: 20px;
    text-align: center;
}
.sales-metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}
.sales-metric-label {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

/* Top products/TT grid */
.sales-top-grid {
    padding: 12px 16px;
}
.sales-top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #f3f4f6);
}
.sales-top-item:last-child {
    border-bottom: none;
}
.sales-top-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-muted, #6b7280);
    flex-shrink: 0;
}
.sales-top-item:nth-child(1) .sales-top-rank { background: #fef3c7; color: #92400e; }
.sales-top-item:nth-child(2) .sales-top-rank { background: #e5e7eb; color: #374151; }
.sales-top-item:nth-child(3) .sales-top-rank { background: #fed7aa; color: #9a3412; }
.sales-top-info {
    flex: 1;
    min-width: 0;
}
.sales-top-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sales-top-details {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin-top: 2px;
}
.sales-top-bar-wrap {
    width: 120px;
    height: 6px;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}
.sales-top-bar {
    height: 100%;
    background: var(--accent, #3b82f6);
    border-radius: 3px;
    transition: width 0.3s ease;
}
/* Sales dashboard charts grid */
.sales-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.sales-charts-grid .card-body {
    padding: 16px;
    position: relative;
    min-height: 300px;
}
.sales-charts-grid canvas {
    max-width: 100%;
}

/* Sales metric delta badges */
.sales-metric-delta {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}
.sales-metric-delta.delta-up {
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
}
.sales-metric-delta.delta-down {
    color: #DC2626;
    background: rgba(239, 68, 68, 0.12);
}
.sales-metric-delta.delta-stable {
    color: #6B7280;
    background: rgba(107, 114, 128, 0.12);
}
.sales-metric-delta i {
    font-size: 10px;
    margin-right: 2px;
}

/* Forecast card */
.sales-forecast-card {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.sales-forecast-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sales-forecast-header i {
    color: #4F46E5;
}
.sales-forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.sales-forecast-item {
    text-align: center;
}
.sales-forecast-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sales-forecast-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.sales-forecast-value.delta-up {
    color: #059669;
}
.sales-forecast-value.delta-down {
    color: #DC2626;
}
.sales-forecast-value.delta-stable {
    color: #6B7280;
}
.sales-forecast-value i {
    margin-right: 4px;
}

.sales-top-value {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

/* Table helpers */
.text-right {
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .sales-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .sales-preview-grid {
        grid-template-columns: 1fr;
    }
    .sales-top-bar-wrap {
        display: none;
    }
    .sales-charts-grid {
        grid-template-columns: 1fr;
    }
    .sales-forecast-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Metric switcher buttons */
.sales-metric-btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--text-secondary);
}
.sales-metric-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.sales-metric-btn.active {
    background: var(--accent);
    color: white;
}
.sales-metric-btn i {
    font-size: 12px;
}

/* Metric card active state */
.sales-metric-card.metric-active {
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    transform: translateY(-2px);
}

/* ── Оверлей загрузки приложения ── */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}
.app-loader-card { text-align: center; padding: 40px; }
.app-loader-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 16px;
    animation: loaderPulse 1.5s ease-in-out infinite;
}
@keyframes loaderPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}
.app-loader-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.app-loader-status {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    min-height: 20px;
}
.app-loader-bar {
    width: 240px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}
.app-loader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #7eb3ff);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.app-loader.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* ── Селектор типа маршрута ── */
.route-type-selector {
    margin-top: 8px;
}
.route-type-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}
.route-type-select:hover {
    border-color: var(--accent);
}
.route-type-select:focus,
.route-type-select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.route-type-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 4px;
    margin-left: auto;
}
.route-type-description {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    line-height: 1.4;
}

/* ============================================================
   СТИЛИ ДЛЯ ИНДИВИДУАЛЬНЫХ НАСТРОЕК ЭТП
   ============================================================ */

/* Мини-статистика маршрута в модальном окне ЭТП */
.route-stats-mini {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.route-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

/* Форм-чекбокс */
.form-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ============================================================
   СТИЛИ ДЛЯ СРАВНЕНИЯ ТИПОВ МАРШРУТОВ
   ============================================================ */

/* Метрики для страницы сравнения */
.metrics-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 20px;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

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

/* Бейджи для типов маршрутов */
.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* Адаптивность для метрик */
@media (max-width: 768px) {
    .metrics-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-value {
        font-size: 24px;
    }
}

/* ============================================================
   ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ
   ============================================================ */

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.etp-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    border-radius: var(--radius-sm);
}

/* ============================================================
   АНИМАЦИИ ПЕРЕХОДА СТРАНИЦ
   ============================================================ */

/* Страницы с анимацией появления */
.page {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.page.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Анимация появления контента внутри страницы */
.page.active > * {
    animation: fadeInUp 0.35s ease forwards;
}

.page.active > *:nth-child(1) { animation-delay: 0.05s; }
.page.active > *:nth-child(2) { animation-delay: 0.1s; }
.page.active > *:nth-child(3) { animation-delay: 0.15s; }
.page.active > *:nth-child(4) { animation-delay: 0.2s; }
.page.active > *:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация для карточек */
.page.active .card,
.page.active .etp-card,
.page.active .version-card,
.page.active .tp-card {
    animation: scaleIn 0.3s ease forwards;
}

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

/* Анимация для элементов списков */
.page.active .data-table tbody tr {
    animation: slideInRight 0.25s ease forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================
   ОВЕРЛЕЙ ЗАГРУЗКИ
   ============================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-top: 16px;
    text-align: center;
}

/* ============================================================
   УЛУЧШЕННЫЕ БАЛЛУНЫ ТТ НА КАРТЕ
   ============================================================ */

/* Стили для баллуна Яндекс.Карт - переопределение inline стилей */
.ymaps-2-1-79-balloon__content {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.tt-balloon {
    min-width: 280px;
    max-width: 360px;
}

.tt-balloon-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tt-balloon-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.tt-balloon-title {
    flex: 1;
}

.tt-balloon-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1d23;
    line-height: 1.3;
    margin-bottom: 4px;
}

.tt-balloon-code {
    font-size: 11px;
    color: #6b7280;
    font-family: monospace;
}

.tt-balloon-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
}

.tt-balloon-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-balloon-row.full-width {
    grid-column: 1 / -1;
}

.tt-balloon-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tt-balloon-value {
    font-size: 13px;
    color: #1a1d23;
    font-weight: 500;
}

.tt-balloon-value.highlight {
    color: #3b82f6;
}

.tt-balloon-value.success {
    color: #10b981;
}

.tt-balloon-value.warning {
    color: #f59e0b;
}

.tt-balloon-value.danger {
    color: #ef4444;
}

/* Бейджи в баллуне */
.tt-balloon-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.tt-balloon-badge.abc-a {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.tt-balloon-badge.abc-a1 {
    background: rgba(52, 211, 153, 0.1);
    color: #059669;
}

.tt-balloon-badge.abc-b {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tt-balloon-badge.abc-b1 {
    background: rgba(99, 179, 237, 0.1);
    color: #2563eb;
}

.tt-balloon-badge.abc-c {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
}

.tt-balloon-badge.abc-c1 {
    background: rgba(156, 163, 175, 0.15);
    color: #6b7280;
}

/* Адрес в баллуне */
.tt-balloon-address {
    grid-column: 1 / -1;
    padding: 10px 12px;
    background: #f8f9fb;
    border-radius: 6px;
    margin-top: 4px;
}

.tt-balloon-address i {
    color: #9ca3af;
    margin-right: 6px;
    font-size: 12px;
}

/* Множественные ТТ по одному адресу */
.tt-balloon-multi {
    padding: 12px;
    background: #fef3c7;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid #f59e0b;
}

.tt-balloon-multi-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.tt-balloon-multi-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tt-balloon-multi-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.tt-balloon-multi-item:hover {
    background: #fefce8;
}

.tt-balloon-multi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === STANDARDIZED DETAIL PANELS === */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
}

.detail-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.detail-item-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-item-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    line-height: 1.3;
}

.detail-item-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
}

/* ============================================================
   АДАПТИВНОСТЬ ДЛЯ АНИМАЦИЙ
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .page {
        transition: opacity 0.15s ease;
        transform: none !important;
    }
    
    .page.active {
        transform: none !important;
    }
    
    .page.active > * {
        animation: none;
        opacity: 1;
    }
    
    .page.active .card,
    .page.active .etp-card,
    .page.active .version-card,
    .page.active .tp-card,
    .page.active .data-table tbody tr {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .loading-spinner {
        animation: none;
        border-color: white;
        border-top-color: white;
    }
}

/* Мобильные устройства - более быстрая анимация */
@media (max-width: 768px) {
    .page {
        transition-duration: 0.2s;
    }
    
    .page.active > * {
        animation-duration: 0.25s;
    }
    
    .page.active > *:nth-child(n) {
        animation-delay: 0s !important;
    }
}
