:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    overflow-x: hidden;
}

/* --- САЙДБАР (БОКОВОЕ МЕНЮ) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    background: #fdfdfe;
}

/* --- ССЫЛКИ В МЕНЮ --- */
.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
    border-left-color: var(--primary-color);
}

.nav-link i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

/* --- ОСНОВНОЙ КОНТЕНТ --- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease-in-out;
}

/* --- ВЕРХНЯЯ ПАНЕЛЬ (ХЕДЕР) --- */
.topbar {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.toggle-sidebar-btn {
    border: none;
    background: transparent;
    color: #495057;
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
    display: none; /* Скрыт на десктопе */
}

/* --- КАРТОЧКИ --- */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    background: #fff;
    margin-bottom: 1.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem;
    font-weight: 600;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .toggle-sidebar-btn {
        display: block;
    }

    /* Затемнение фона при открытом меню */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1035;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.show {
        display: block;
        opacity: 1;
    }
}