:root { 
    --primary: #4361ee; 
    --secondary: #3f37c9; 
    --dark-bg: #1e1e2d; 
    --light-bg: #f3f4f6; 
    --sidebar-width: 260px;
    --header-height: 60px;
}

body { 
    background-color: var(--light-bg); 
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    font-size: 0.95rem; 
    color: #444; 
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

/* =========================================
   Sidebar Styling
   ========================================= */
.sidebar { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: var(--sidebar-width); 
    height: 100vh; 
    background: var(--dark-bg); 
    color: #fff; 
    z-index: 1050; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
}

.sidebar-header { 
    padding: 24px; 
    display: flex; 
    align-items: center; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    height: 80px;
    flex-shrink: 0;
}

.sidebar-nav { 
    flex: 1; 
    padding: 20px 0; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

/* Group Title */
.nav-group-title {
    width: 240px;
    padding: 0 16px;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Nav Links */
.nav-link { 
    width: 240px; 
    height: 48px;
    color: rgba(255,255,255,0.7); 
    padding: 0 16px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    text-decoration: none; 
    margin-bottom: 4px; 
    transition: all 0.2s ease; 
    font-weight: 500;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nav-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.nav-link i { 
    margin-right: 14px; 
    font-size: 1.2rem; 
    width: 24px; 
    text-align: center; 
    opacity: 0.8; 
    flex-shrink: 0;
}

.nav-link:hover { 
    background: rgba(255,255,255,0.05); 
    color: #fff; 
    transform: translateX(3px); 
}

.nav-link.active { 
    background: var(--primary); 
    color: #fff; 
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3); 
}

.sidebar-footer { 
    padding: 20px; 
    border-top: 1px solid rgba(255,255,255,0.05); 
    background: rgba(0,0,0,0.1); 
    margin-top: auto;
}

/* =========================================
   Main Content Area
   ========================================= */
.main-content { 
    margin-left: var(--sidebar-width); 
    padding: 30px; 
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    min-height: 100vh; 
    position: relative;
    z-index: 1;
}

/* =========================================
   Mobile Header (Hidden on Desktop)
   ========================================= */
.mobile-header {
    display: none; /* Default hidden */
    background: #fff;
    padding: 0 20px;
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    align-items: center;
    justify-content: space-between;
    margin: -30px -30px 30px -30px; /* Offset padding */
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 991.98px) {
    /* Hide Sidebar by default on mobile */
    .sidebar { 
        transform: translateX(-100%); 
        box-shadow: none;
    }
    
    /* Show Sidebar when active */
    .sidebar.active { 
        transform: translateX(0); 
        box-shadow: 10px 0 30px rgba(0,0,0,0.2); 
    }
    
    /* Reset Main Content margin */
    .main-content { 
        margin-left: 0; 
        padding: 20px; 
    }
    
    /* Show Mobile Header */
    .mobile-header { 
        display: flex; 
        margin: -20px -20px 20px -20px;
    }
    
    /* Overlay for mobile sidebar */
    .sidebar-overlay { 
        display: none; 
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100%; 
        background: rgba(0,0,0,0.4); 
        z-index: 1040; 
        backdrop-filter: blur(2px);
        opacity: 0; 
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.active { 
        display: block; 
        opacity: 1; 
    }
}

/* =========================================
   Components & Utilities
   ========================================= */
.card { 
    border: none; 
    border-radius: 16px; 
    background: #fff; 
    box-shadow: 0 2px 12px rgba(0,0,0,0.02); 
    transition: all 0.3s ease; 
    overflow: hidden; 
    margin-bottom: 20px;
}

.card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
}

.card-header { 
    background: #fff; 
    border-bottom: 1px solid #f4f4f4; 
    padding: 1.25rem 1.5rem; 
    font-weight: 700; 
    color: #2d3436; 
}

.card-body { 
    padding: 1.5rem; 
}

.avatar { 
    width: 42px; 
    height: 42px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid #fff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

.badge { 
    font-weight: 600; 
    padding: 0.5em 0.8em; 
    border-radius: 6px; 
}

.admin-item { 
    padding: 1rem 1.25rem; 
    border-bottom: 1px solid #f8f9fa;
}
.admin-item:last-child { border-bottom: none; }
.admin-item:hover { background: #f8f9fa; }

.todo-item { 
    padding: 1rem 1.25rem; 
    border-left: 4px solid transparent; 
    transition: 0.2s; 
}

.todo-item:hover { 
    border-left-color: var(--primary); 
    background: #fafafa; 
}

/* Scrollbar Beautification */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }