:root {
    --primary: #2563eb; --primary-hover: #1d4ed8;
    --bg: #f8fafc; --card: #ffffff;
    --dark: #1e293b; --border: #e2e8f0;
    --text: #0f172a; --sub: #64748b;
    --success: #10b981; --danger: #ef4444; --warning: #f59e0b;
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --input-bg: #f1f5f9;
    
    /* Стили бокового меню (СВЕТЛАЯ ТЕМА) */
    --nav-bg: #ffffff;
    --nav-text: #64748b;
    --nav-hover-bg: #f8fafc;
    --nav-active-bg: rgba(37, 99, 235, 0.1);
    --nav-active-text: #2563eb;
    --nav-active-shadow: inset 4px 0 0 #2563eb;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #3b82f6; --primary-hover: #60a5fa;
        --bg: #0f172a; --card: #1e293b; 
        --border: #334155; --text: #f8fafc; --sub: #94a3b8;
        --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
        --shadow-md: 0 10px 25px rgba(0,0,0,0.5);
        --glass-bg: rgba(30, 41, 59, 0.85);
        --input-bg: #0f172a;

        /* Стили бокового меню (ТЕМНАЯ ТЕМА КАК НА СКРИНЕ) */
        --nav-bg: #1e293b;
        --nav-text: #94a3b8;
        --nav-hover-bg: #334155;
        --nav-active-bg: #2563eb; /* Сплошной синий фон */
        --nav-active-text: #ffffff; /* Белый текст */
        --nav-active-shadow: none; /* Без боковой полоски */
    }
}

/* Общий стиль для навигации */
.universal-nav {
    position: fixed; bottom: 0; width: 100%; height: 65px;
    background: var(--nav-bg); border-top: 1px solid var(--border);
    display: flex; align-items: center; overflow-x: auto; 
    scrollbar-width: none; z-index: 100; padding: 0 10px;
}
.universal-nav::-webkit-scrollbar { display: none; }

.nav-item {
    flex: 0 0 auto; min-width: 75px; text-align: center;
    color: var(--nav-text); text-decoration: none; font-size: 0.75rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    transition: 0.2s; height: 100%;
}
.nav-item.active { color: var(--nav-active-text); font-weight: bold; }
.nav-icon { font-size: 1.3rem; margin-bottom: 2px; }

.nav-divider { width: 1px; height: 30px; background: var(--border); margin: 0 10px; flex-shrink: 0; }

/* Десктоп-версия: сайдбар */
@media (min-width: 768px) {
    .universal-nav {
        left: 0; top: 0; width: 260px; height: 100vh;
        flex-direction: column; border-top: none; border-right: 1px solid var(--border);
        padding-top: 20px; justify-content: flex-start; overflow-y: auto;
    }
    .nav-item {
        flex-direction: row; width: calc(100% - 30px); margin: 4px 15px; height: auto;
        padding: 12px 20px; border-radius: 12px; font-size: 0.95rem; text-align: left; gap: 15px; font-weight: 500;
    }
    .nav-item:hover { background: var(--nav-hover-bg); color: var(--text); }
    .nav-item.active { 
        background: var(--nav-active-bg); 
        color: var(--nav-active-text); 
        box-shadow: var(--nav-active-shadow);
        font-weight: 600;
    }
    .nav-divider { width: 80%; height: 1px; margin: 15px 0; }
    .desktop-logo { display: flex; margin-bottom: 30px; text-align: center; justify-content: center; align-items: center; width: 100%; min-height: 60px;}
    .desktop-logo img { height: 50px; max-width: 100%; object-fit: contain; }
}
@media (max-width: 767px) { .desktop-logo { display: none; } }