/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-dark: #09090b;       
    --card-bg: #121216;       
    --sidebar-bg: #0c0c0e;
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-bright: #e2e8f0; 
    --text-muted: #94a3b8; 
    
    /* Brand Colors */
    --accent-blue: #3b82f6;   
    --accent-purple: #8b5cf6; 
    --accent-green: #10b981;  
    --accent-red: #ef4444;    
    
    /* Borders & Shadows */
    --card-border: 1px solid rgba(255, 255, 255, 0.12);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* Text Utilities Overrides */
.text-muted { color: var(--text-muted) !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.6) !important; }
.small, small { font-size: 0.85em; }

/* =========================================
   2. SIDEBAR STYLES
   ========================================= */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    padding: 20px;
    border-right: var(--card-border);
    z-index: 1050;
    transition: transform 0.3s ease-in-out;
}

.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 0 10px; margin-bottom: 30px;
    text-decoration: none;
}

.sidebar .brand h4 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700; color: var(--text-main);
    margin: 0; letter-spacing: 1px;
}

/* Navigation Links */
.nav-link {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    color: var(--text-bright) !important;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
    margin-bottom: 4px;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-link i {
    font-size: 1.1rem; width: 24px; text-align: center;
    color: var(--text-muted); transition: 0.2s;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.nav-link:hover i, .nav-link.active i {
    color: var(--accent-blue) !important;
    transform: scale(1.1);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), transparent);
    color: #fff !important;
    border-left-color: var(--accent-blue);
}

/* Nav Headers */
.nav .text-muted.small {
    padding-left: 16px; margin-top: 15px; margin-bottom: 8px;
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1.2px;
    color: #64748b !important; font-weight: 700; opacity: 1;
}

/* =========================================
   3. LAYOUT & MOBILE
   ========================================= */
.main-content {
    margin-left: 260px;
    padding: 25px;
    transition: margin-left 0.3s ease-in-out;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 1040; display: none;
    backdrop-filter: blur(3px);
}
.mobile-overlay.active { display: block; }

/* Mobile Responsive Logic */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
    .main-content { margin-left: 0; padding: 15px; }
}

/* =========================================
   4. CARDS & WIDGETS
   ========================================= */
.admin-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.card-title {
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-muted); margin-bottom: 8px;
}

.card-value {
    font-size: 26px; font-weight: 700;
    margin-bottom: 0; line-height: 1.2;
    color: #fff;
}

.icon-box {
    width: 45px; height: 45px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Filter Box */
.filter-box {
    background: var(--card-bg);
    border: var(--card-border);
    padding: 15px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

/* =========================================
   5. TABLES
   ========================================= */
.table-responsive { border-radius: 12px; overflow: hidden; }
.custom-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.custom-table th {
    background: rgba(255,255,255,0.08);
    color: #fff !important;
    font-weight: 700; padding: 15px;
    font-size: 13px; text-transform: uppercase;
    border-bottom: var(--card-border);
}

.custom-table td {
    padding: 15px;
    color: var(--text-bright);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.custom-table tr:hover td { background: rgba(255,255,255,0.03); }
.custom-table tr:last-child td { border-bottom: none; }

/* =========================================
   6. FORMS & BUTTONS
   ========================================= */
.form-control {
    background-color: #1a1a20;
    border-color: rgba(255,255,255,0.2);
    color: #fff !important;
    padding: 10px 15px;
    border-radius: 8px;
}
.form-control::placeholder { color: #64748b !important; }
.form-control:focus {
    background-color: #1a1a20;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Dark Button Override */
.btn-dark.border-secondary, .bg-dark.border-secondary {
    background-color: var(--card-bg) !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: #fff !important;
}

/* Icon Buttons (Edit, Delete, etc.) */
.btn-icon {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: none;
    transition: 0.2s; color: #fff; cursor: pointer;
}
.btn-icon:hover { transform: scale(1.1); filter: brightness(1.2); }

/* Topbar Notification Badge */
.position-absolute.bg-danger {
    border: 2px solid var(--card-bg) !important;
    background-color: var(--accent-red) !important;
    width: 10px; height: 10px; padding: 0;
}

/* =========================================
   7. UTILITY COLORS
   ========================================= */
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-blue { color: var(--accent-blue) !important; }

.bg-blue-soft { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.bg-green-soft { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.bg-red-soft { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }
.bg-purple-soft { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }

.badge { padding: 6px 10px; border-radius: 6px; font-weight: 600; font-size: 11px; }

/* =========================================
   8. LOGIN PAGE SPECIFIC
   ========================================= */
body.login-page {
    height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background-image: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 40%);
    overflow: hidden;
}

.login-card {
    background: var(--card-bg);
    border: var(--card-border);
    padding: 40px; border-radius: 20px;
    width: 100%; max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative; overflow: hidden;
}

.login-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
}

.btn-login {
    background: linear-gradient(135deg, var(--accent-blue), #2563eb);
    border: none; padding: 12px;
    font-weight: bold; letter-spacing: 1px;
    color: white; width: 100%;
    margin-top: 10px; transition: 0.3s;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Table Scroll Fix for Mobile */
        .table-responsive {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        
        /* Modal Custom Dark Style */
        .modal-content {
            background-color: #1a1a20;
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #fff;
        }
        .modal-header, .modal-footer {
            border-color: rgba(255, 255, 255, 0.1);
        }
        .form-label {
            color: #94a3b8;
            font-size: 0.9rem;
        }
        .form-control:disabled, .form-control[readonly] {
            background-color: #0f0f12;
            opacity: 0.7;
            border-color: rgba(255,255,255,0.05);
        }