:root {
    --bg-dark: #07090f; /* Глубокий темный фон, не чисто черный */
    --panel-bg: #11151c; /* Чуть светлее для карточек */
    --matrix-green: #00ff41; /* Тот самый цвет */
    --matrix-green-dim: rgba(0, 255, 65, 0.15);
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --glow-subtle: 0 0 10px rgba(0, 255, 65, 0.2);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Едва заметный эффект ЭЛТ-монитора (Scanlines) */
.crt-scanlines {
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.15; /* Очень прозрачно, только для атмосферы */
}

/* --- Боковая панель (Десктоп) --- */
.sidebar {
    background-color: var(--panel-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    height: 100vh;
    position: fixed;
    width: 260px;
    z-index: 100;
}

.sidebar-brand {
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 1px;
}

.sidebar-brand i { color: var(--matrix-green); }

.nav-link {
    color: var(--text-muted);
    padding: 16px 24px;
    font-size: 0.95rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover { color: #fff; }

.nav-link.active {
    color: var(--matrix-green);
    background: linear-gradient(90deg, var(--matrix-green-dim) 0%, transparent 100%);
    border-left: 3px solid var(--matrix-green);
    text-shadow: var(--glow-subtle);
}

.nav-link i { width: 30px; font-size: 1.1rem; }

/* --- Основной контент (Десктоп) --- */
.main-content {
    margin-left: 260px;
    padding: 40px;
}

/* --- Карточки (Дашборд) --- */
.tech-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 24px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tech-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-color: rgba(0, 255, 65, 0.3);
}

/* Тонкая зеленая полоска сверху карточки */
.tech-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: var(--matrix-green);
    opacity: 0.5;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Цифры в карточках */
.data-value {
    font-family: 'Space Mono', monospace;
    color: var(--matrix-green);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: var(--glow-subtle);
    margin: 15px 0;
}

/* --- Таблицы --- */
.table { color: var(--text-main); }
.table thead th {
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.table tbody td {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    font-family: 'Space Mono', monospace; 
    font-size: 0.9rem;
}
.table-hover tbody tr:hover td { background: rgba(255,255,255,0.02); color: #fff; }


/* =========================================================
   АДАПТАЦИЯ ДЛЯ СМАРТФОНОВ И ПЛАНШЕТОВ (Responsive Design)
   ========================================================= */
@media (max-width: 991px) {
    /* 1. Превращаем боковую панель в верхнюю прилипающую менюшку */
    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(0, 255, 65, 0.2);
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    }

    .sidebar-brand {
        padding: 15px 20px;
        font-size: 1.1rem;
        text-align: left;
    }

    /* Меню становится горизонтальным и скроллится вправо-влево */
    .sidebar .nav {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        margin-top: 0 !important;
        background: var(--bg-dark);
    }

    /* Кастомизация полосы прокрутки меню на мобильных */
    .sidebar .nav::-webkit-scrollbar {
        height: 2px;
    }
    .sidebar .nav::-webkit-scrollbar-thumb {
        background: rgba(0, 255, 65, 0.5);
    }

    /* Изменяем логику подсветки кнопок в меню */
    .nav-link {
        padding: 12px 20px;
        white-space: nowrap; /* Запрет переноса текста */
        border-left: none;
        border-bottom: 2px solid transparent;
    }

    .nav-link.active {
        border-left: none;
        border-bottom: 2px solid var(--matrix-green);
        background: linear-gradient(0deg, var(--matrix-green-dim) 0%, transparent 100%);
    }

    /* Блок с юзером и кнопкой ВЫХОД переносим в строку меню */
    .sidebar > div:last-child {
        display: none; /* Скрываем старый нижний блок, чтобы не ломал верстку */
    }

    /* 2. Освобождаем контент */
    .main-content {
        margin-left: 0;
        padding: 20px 15px; /* Уменьшаем отступы на мобильном */
    }

    /* 3. Оптимизация карточек */
    .tech-card {
        padding: 15px;
    }

    .data-value {
        font-size: 2rem; /* Чуть меньше цифры */
    }
    
    /* 4. Оптимизация таблиц (чтобы можно было скроллить пальцем) */
    .table-responsive {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    /* Уменьшаем шрифты в заголовках */
    h4 {
        font-size: 1.25rem;
    }
}