/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4e54c8;
    --secondary: #8f94fb;
    --accent: #ff416c;
    --dark: #1f2937;
    --light: #f9fafb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f3f4f6;
    color: var(--dark);
    overflow-x: hidden;
}

/* --- Preloader --- */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.spinner {
    width: 50px; height: 50px;
    border: 4px solid #f3f3f3; border-top: 4px solid var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Layout & Sidebar --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.05);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    z-index: 999;
}

/* Sidebar Links */
.sidebar-link {
    display: flex; align-items: center;
    padding: 12px 15px;
    color: #6b7280;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 5px;
    font-weight: 500;
    transition: all 0.3s;
}
.sidebar-link i { margin-right: 12px; width: 25px; text-align: center; font-size: 1.1rem; }
.sidebar-link:hover { background: #f3f4f6; color: var(--primary); transform: translateX(5px); }
.sidebar-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(78, 84, 200, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left 0.3s ease-in-out;
}

/* --- Header / Navbar --- */
.navbar-custom {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    height: var(--header-height);
    box-shadow: var(--shadow-sm);
}

/* --- Premium Components --- */
/* Cards */
.custom-card {
    background: white; border: none; border-radius: 16px;
    box-shadow: var(--shadow-sm); transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}
.custom-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none; border-radius: 8px;
    padding: 10px 24px; font-weight: 500;
    transition: 0.3s;
}
.btn-primary:hover { box-shadow: 0 5px 15px rgba(78, 84, 200, 0.4); transform: translateY(-2px); }

/* Form Floating Inputs (Premium Look) */
.form-floating > .form-control { border-radius: 10px; border: 1px solid #e5e7eb; }
.form-floating > .form-control:focus { box-shadow: 0 0 0 4px rgba(78, 84, 200, 0.1); border-color: var(--primary); }

/* Table Styles */
.table thead th { 
    font-weight: 600; text-transform: uppercase; 
    font-size: 0.75rem; letter-spacing: 0.05em; color: #6b7280; 
}
.table td { vertical-align: middle; }

/* Scrollbar Customization */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* --- Mobile Responsiveness --- */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .main-content { margin-left: 0; }
    
    /* Overlay for mobile sidebar */
    .sidebar-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 998;
        display: none;
    }
    .sidebar-overlay.active { display: block; }
}