/* --- 1. CORE CONFIG & VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --rk-bg: #060910;
    --rk-sidebar: #080c14;
    --rk-card: #0c121d;
    --rk-pink: #ff2d55;
    --rk-pink-glow: rgba(255, 45, 85, 0.3);
    --rk-border: rgba(255, 45, 85, 0.15);
    --rk-text-muted: #64748b;
    --rk-glass: rgba(255, 255, 255, 0.03);
}

body {
    background-color: var(--rk-bg);
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* --- 2. SIDEBAR (STRICT FLEX LAYOUT) --- */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--rk-sidebar);
    border-right: 1px solid var(--rk-border);
    position: fixed;
    left: 0; 
    top: 0;
    padding: 1.5rem;
    z-index: 1000;
    
    /* Flex Setup to push footer down */
    display: flex;
    flex-direction: column;
}

.brand-box {
    padding: 0 1rem 2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

nav {
    flex-grow: 1; /* This takes up all available space */
    overflow-y: auto; /* Scrollable menu if too many items */
}

/* Hide scrollbar for Chrome/Safari in the nav */
nav::-webkit-scrollbar { display: none; }

.sidebar-footer {
    margin-top: auto; /* The Magic: Pushes footer to the bottom */
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

/* --- 3. NAVIGATION LINKS --- */
.nav-link {
    color: var(--rk-text-muted);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.4rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.nav-link.active {
    background: rgba(255, 45, 85, 0.1);
    color: var(--rk-pink);
    box-shadow: inset 4px 0 0 var(--rk-pink);
    border-radius: 0 12px 12px 0;
}

.nav-link i { font-size: 1.25rem; }

/* --- 4. MAIN CONTENT AREA --- */
.main-content {
    margin-left: 260px;
    padding: 2.5rem 3.5rem;
    min-height: 100vh;
}

/* --- 5. DASHBOARD & FORM COMPONENTS --- */
.stat-card, .data-section, .glass-card {
    background: var(--rk-card);
    border: 1px solid var(--rk-border);
    border-radius: 20px;
    padding: 1.8rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--rk-pink);
    box-shadow: 0 10px 30px -10px var(--rk-pink-glow);
}

.stat-label {
    color: var(--rk-text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.stat-val {
    font-size: 2.4rem;
    font-weight: 800;
    margin-top: 0.5rem;
}

/* Forms (Used in teams.php) */
.form-control, .form-select {
    background: var(--rk-glass);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff !important;
    border-radius: 10px;
    padding: 0.7rem 1rem;
}

.form-control:focus, .form-select:focus {
    background: rgba(255,255,255,0.05);
    border-color: var(--rk-pink);
    box-shadow: 0 0 0 4px var(--rk-pink-glow);
}

/* Tables */
.table { color: #f8fafc; border-color: rgba(255,255,255,0.05); }
.table thead th {
    color: var(--rk-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 1px;
    border-top: none;
}

/* --- 6. RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
    .sidebar { width: 85px; padding: 1.5rem 0.5rem; text-align: center; }
    .sidebar span, .brand-box small, .sidebar-footer small { display: none; }
    .brand-box { padding: 0 0 1.5rem 0; }
    .main-content { margin-left: 85px; padding: 2rem; }
    .nav-link { justify-content: center; padding: 1rem; }
    .nav-link i { margin: 0; }
}

/* Custom Scrollbar for the page */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--rk-bg); }
::-webkit-scrollbar-thumb { background: #1a1f2e; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--rk-pink); }