/* 
   SIKAP - Sistem Informasi Kinerja & Administrasi Sekolah
   Theme: Executive Future (Glassmorphism + Gradients)
   Author: Antigravity Agent
*/

/* --- 1. VARIABLES & RESET --- */
/* Responsive Student Stats Grid */
.student-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 991px) {
    .student-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .student-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Main Gradients */
    --primary-gradient: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
    /* Deep Professional Blue */
    --accent-gradient: linear-gradient(135deg, #F2994A 0%, #F2C94C 100%);
    /* Golden */

    /* Solids */
    --primary: #2C5364;
    --primary-rgb: 44, 83, 100;
    --primary-gradient: linear-gradient(135deg, #2C5364 0%, #203A43 100%);
    --secondary: #0F2027;
    --accent: #F2994A;
    --accent-rgb: 242, 153, 74;
    --success: #27ae60;
    --success-rgb: 39, 174, 96;
    --warning: #d35400;
    --warning-rgb: 211, 84, 0;
    --danger: #c0392b;
    --danger-rgb: 192, 57, 43;
    --info: #2980b9;
    --info-rgb: 41, 128, 185;
    --text-main: #2D3748;
    --text-muted: #718096;

    /* Backgrounds */
    --bg-body: #cbd5e0;
    /* Significantly darker (Slate-300 level) for high contrast */
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    /* Darker surface to match */
    --bg-glass: rgba(255, 255, 255, 0.9);
    /* High opacity for readability */
    --bg-sidebar: #1a202c;

    /* Borders & Shadows */
    --border-light: #cbd5e0;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-float: 0 10px 30px rgba(0, 0, 0, 0.1);

    /* Text */
    --text-main: #2d3748;
    --text-muted: #718096;

    /* Misc */
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #38B2AC;
    --primary-rgb: 56, 178, 172;
    --primary-gradient: linear-gradient(135deg, #38B2AC 0%, #319795 100%);
    --bg-body: #121212;
    --bg-glass: rgba(30, 30, 30, 0.75);
    /* More transparent for blur */
    --bg-sidebar: #000000;
    --border-light: rgba(255, 255, 255, 0.08);
    --bg-card: #1e1e1e;
    --bg-surface: #262626;
    --text-main: #FFFFFF;
    --text-muted: #CBD5E0;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.5);
    /* Heavier shadow for depth */
    --glow-primary: 0 0 20px rgba(56, 178, 172, 0.3);
    /* New Glow Var */
}

/* UI/UX Pro Max: Global Smoothness */
html {
    scroll-behavior: smooth;
}

/* Spotlight Effect Base */
.spotlight-group {
    position: relative;
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* MENCEGAH LAYAR MELEBAR KE SAMPING */
    width: 100%;
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- 2. COMPONENTS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect on hover */
.btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4),
        0 0 20px rgba(var(--primary-rgb), 0.2);
}

.btn-accent {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(var(--accent-rgb), 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.4);
}

/* Premium Mini Action Buttons */
.action-btn {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    font-size: 0.9rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

/* UI/UX Pro Max: Spotlight Gradients */
.card-spotlight {
    position: relative;
    z-index: 1;
}

.card-spotlight::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-spotlight:hover::before {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 3rem !important;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

.card {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Gradient Accent Bar */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 1;
}

/* Enhanced Floating Effect */
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15),
        0 6px 12px -4px rgba(0, 0, 0, 0.1);
}

/* Section Header Icon Glow */
.section-header i {
    filter: drop-shadow(0 2px 4px rgba(var(--primary-rgb), 0.3));
    transition: filter 0.3s ease;
}

.section-header:hover i {
    filter: drop-shadow(0 4px 8px rgba(var(--primary-rgb), 0.5));
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-main);
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.95);
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1),
        0 4px 12px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-1px);
}

/* Dark mode adjustments */
[data-theme="dark"] .form-input {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .form-input:focus {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2),
        0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* UI/UX Pro Max: Custom Select */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23718096%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8rem;
    padding-right: 2.5rem !important;
    /* Space for arrow */
}

/* Fix Dark Mode Options */
[data-theme="dark"] select.form-input option {
    background-color: var(--bg-surface);
    color: var(--text-main);
    padding: 0.5rem;
}

[data-theme="dark"] select.form-input {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23e2e8f0%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

/* --- 3. LAYOUT & SIDEBAR --- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: white;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-circle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.2rem;
}

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(56, 178, 172, 0.15), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    box-shadow: inset 10px 0 20px -10px rgba(56, 178, 172, 0.3);
}

.nav-link i {
    width: 24px;
    text-align: center;
}

/* --- 4. MAIN CONTENT & TOPBAR --- */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* --- 4. TOPBAR (PRO MAX TASKBAR) --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 10px;
    z-index: 500;
    border: 1px solid var(--border-light);
    margin: 0.5rem 0.5rem 1.5rem 0.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar>div {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.topbar::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    opacity: 0.3;
}

.topbar:hover {
    box-shadow: var(--shadow-float);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
}

@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

.action-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.action-icon:hover {
    background: var(--bg-surface);
    color: var(--primary);
    transform: translateY(-3px) scale(1.1);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* --- 5. NOTIFICATIONS --- */
.notification-wrapper {
    position: relative;
}

.notification-wrapper {
    position: relative;
}

.notification-bell {
    position: relative;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 10;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 100px;
    pointer-events: none;
}

.notification-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Shadow Soft */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
}

[data-theme="dark"] .notification-dropdown {
    background: #1e1e1e;
    /* Solid dark background */
    border-color: #333;
}

/* Header Notif */
.notification-dropdown>div:first-child {
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-surface);
    /* Subtle contrast for header */
    border-bottom: 1px solid var(--border-light);
}

.notification-dropdown::before {
    display: none;
    /* Remove flashy gradient bar */
}

/* IMPORTANT: Background color fix for dark mode */
[data-theme="dark"] .notification-dropdown {
    background: #1a202c;
    border-color: rgba(255, 255, 255, 0.1);
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    /* Center align for cleaner look */
    transition: background 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.notification-item:hover {
    background: var(--bg-surface);
    /* Subtle hover only */
}

/* Icon container styling within notification item */
.notification-item>div:first-child {
    background: transparent !important;
    /* Remove grey circle bg */
    width: auto !important;
    height: auto !important;
    margin-top: 2px;
}

.notification-item i {
    font-size: 1rem !important;
    /* Slightly larger icon */
}

/* Typography refinements */
.notification-item strong {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

.notification-item small {
    color: var(--text-muted);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* --- 6. Stats & Charts --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Teacher Stats Grid Override */
.teacher-stats-grid {
    display: flex !important;
    gap: 1.5rem;
}

.teacher-stats-grid .stat-card {
    flex: 1;
    width: auto;
    /* Ensure no fixed width interferes */
}

.stat-card {
    background: var(--bg-glass);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Gradient overlay on hover */
.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 28px -8px rgba(var(--primary-rgb), 0.25),
        0 6px 16px -4px rgba(0, 0, 0, 0.1);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--accent-rgb), 0.1));
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    filter: drop-shadow(0 4px 8px rgba(var(--primary-rgb), 0.2));
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 6px 12px rgba(var(--primary-rgb), 0.4));
}

/* --- 7. MOBILE RESPONSIVE --- */
/* (Redundant Mobile Logic Removed - Handled by Mobile-Fix / End of File) */

/* --- 8. PRINT --- */
@media print {

    .sidebar,
    .menu-toggle,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
        break-inside: avoid;
    }

    .topbar {
        box-shadow: none;
        border-bottom: 2px solid #000;
        padding: 0;
        margin-bottom: 2rem;
    }
}

/* --- 9. REACTIVE TABLES (PREMIUM) --- */
.table-container,
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    background: var(--bg-glass);
    position: relative;
    margin-bottom: 1rem;
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    /* Ensures scrolling on mobile */
}

.table-premium td,
.table-premium th {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Custom Scrollbar for Premium Look */
.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb, 44, 83, 100), 0.2);
    border-radius: 10px;
}

.table-premium {
    width: 100%;
    min-width: 1000px;
    /* Force minimum width to guarantee scrolling on mobile and prevent squeezing */
    border-collapse: separate;
    border-spacing: 0;
}

.table-premium th {
    background: rgba(0, 0, 0, 0.02);
    padding: 1.2rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    /* Keep headers on one line */
}

.table-premium td {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-main);
    transition: background 0.2s, transform 0.2s;
}

.table-premium tr:last-child td {
    border-bottom: none;
}

.table-premium tr:hover td {
    background: rgba(44, 83, 100, 0.03);
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .table-premium tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

/* Badge Styles */
.badge {
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-block;
}

.badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(211, 84, 0, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(41, 128, 185, 0.1);
    color: var(--info);
}

/* --- 10. AUTH PAGES (LOGIN) --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
    position: relative;
    padding: 1rem;
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    text-align: left;
    z-index: 10;
}

[data-theme="dark"] .login-card {
    background: #1a202c;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header .logo-circle {
    margin: 0 auto 1rem;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    background: var(--primary-gradient);
    color: white;
}

/* --- 11. ANIMATIONS --- */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- 12. SWEETALERT CUSTOM & SAFETY --- */
body .swal2-container {
    z-index: 999999 !important;
    /* Force ABSOLUTE TOP */
    pointer-events: auto !important;
}

.swal2-popup {
    z-index: 1000000 !important;
    pointer-events: auto !important;
}

div:where(.swal2-container) div:where(.swal2-popup) {
    background: var(--bg-glass) !important;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-light);
    border-radius: 20px !important;
    box-shadow: var(--shadow-float) !important;
}

div:where(.swal2-container) h2:where(.swal2-title) {
    color: var(--text-main) !important;
    font-family: 'Outfit', sans-serif !important;
}

div:where(.swal2-icon.swal2-success) {
    border-color: var(--success) !important;
    color: var(--success) !important;
}

div:where(.swal2-html-container) {
    color: var(--text-muted) !important;
}

button:where(.swal2-confirm) {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    border-radius: 12px !important;
    font-weight: bold !important;
    padding: 12px 24px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3) !important;
}

/* Scrollbar Formatting */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}


::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.mobile-only {
    display: none !important;
}


/* --- 13. GLOBAL MODAL STYLES (RESPONSIVE) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 1rem;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-surface);
    margin: 2% auto;
    padding: 2rem;
    border: 1px solid var(--border-light);
    width: 45%;
    max-width: 600px;
    border-radius: 20px;
    box-shadow: var(--shadow-float);
    position: relative;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    /* Auto dark mode support via existing variables, but ensuring specifics */
    background-color: #ffffff;
}

[data-theme="dark"] .modal-content {
    background-color: #1a202c;
    border-color: rgba(255, 255, 255, 0.1);
}

@keyframes slideDown {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close Button in Modal */
.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
    transform: rotate(90deg);
}

/* --- MOBILE OVERRIDES UNIFIED (991px) --- */
@media (max-width: 991px) {
    .dashboard-layout {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 1rem !important;
    }

    .sidebar {
        z-index: 1100 !important;
        width: 85%;
        max-width: 300px;
        /* Transform removed - using left property from mobile-fix.css */
    }

    .topbar {
        margin: 0.5rem 0 1.5rem 0 !important;
        border-radius: 0;
        width: 100% !important;
        top: 0 !important;
    }

    .sidebar-overlay {
        z-index: 1050 !important;
    }
}

/* SEARCH BAR ENHANCEMENT */
.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    margin: 0 2rem;
}

.topbar-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.topbar-search input:focus {
    background: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.1);
    outline: none;
    transform: scale(1.02);
}

.topbar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}