/* Global Styling */
body.login-page {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../images/background.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background-color: rgba(255, 255, 255, 0.9); /* translucent background */
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 400px;
    width: 100%;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.login-card img.logo {
    width: 80px;
    margin-bottom: 15px;
}

.login-card h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.login-card p {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background-color: #27ae60;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-card button:hover {
    background-color: #219150;
}

.error-msg {
    background: #e74c3c;
    color: white;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    font-size: 13px;
}

/* Add these styles to your existing style.css */

:root {
    --primary: #4361ee;
    --primary-light: #4cc9f0;
    --secondary: #f72585;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --gray: #6b7280;
    --gray-light: #e5e7eb;
    --sidebar-bg: #ffffff;
    --sidebar-hover: rgba(67, 97, 238, 0.08);
    --sidebar-active: rgba(67, 97, 238, 0.12);
    --sidebar-border: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; /* Ensure Poppins is linked in HTML or fallback */
}

/* Dashboard Page Layout */
body.dashboard-page {
    background-color: #f5f7fa;
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex; /* Crucial for sidebar and main content layout */
}

/* Enhanced Sidebar - Standardized */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--sidebar-bg);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    padding: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.02), rgba(76, 201, 240, 0.02));
}

.logo-small {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-small:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 500;
}

.nav-menu {
    margin: 0;
    padding: 16px 12px;
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: var(--gray);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.25rem;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-link span {
    flex: 1;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.15);
}

.nav-link.active {
    background: var(--sidebar-active);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-link:hover i,
.nav-link.active i {
    transform: scale(1.1);
}

/* Main Content - Enhanced */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
}

/* Enhanced Top Bar */
.top-bar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.4);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn i {
    font-size: 1.1rem;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Enhanced Card Styling */
.dashboard-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-content1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.card, .analisis-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card::before, .analisis-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover, .analisis-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card:hover::before, .analisis-card:hover::before {
    opacity: 1;
}

.card h3, .analisis-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.card p, .analisis-card p {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Enhanced Button Styling */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn i {
    margin-right: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: linear-gradient(to right, var(--secondary), #f59e0b);
}

.btn-secondary:hover {
    box-shadow: 0 8px 20px rgba(247, 37, 133, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #22c55e);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #f59e0b);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ef4444);
    color: white;
}

/* File Upload Styling */
.file-upload {
    margin-top: 20px;
}

.file-upload-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--gray);
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.file-input {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--gray-light);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-input:hover {
    border-color: var(--primary);
    background-color: rgba(67, 97, 238, 0.05);
}

.file-input::file-selector-button {
    display: none;
}

.file-input-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 15px;
    text-align: center;
}

.file-input-info i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.file-input-info span {
    font-size: 0.9rem;
    color: var(--gray);
}

.warninglo {
    color: #ef4444;
    font-weight: 600;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--success), #10b981);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.4);
}

.progress-bar-container {
    width: 100%;
    margin-top: 15px;
    display: none;
}

.progress-bar {
    width: 0;
    height: 20px;
    background-color: var(--success);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-content {
        padding: 20px;
    }
    
    .dashboard-content1 {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .top-bar {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .page-title h1 {
        font-size: 1.5rem;
    }
}

/* Animations */
.animate-delay-1 {
    animation-delay: 0.1s;
}
.animate-delay-2 {
    animation-delay: 0.2s;
}
.animate-delay-3 {
    animation-delay: 0.3s;
}

/* Floating Elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* Game Button Styles - Ensure clickability */
.start-btn, .leaderboard-btn, .try-again-btn, .login-btn {
    position: relative;
    z-index: 10;
    cursor: pointer;
    pointer-events: auto;
}

.button-group, .button-group-gameover {
    position: relative;
    z-index: 10;
}

/* Cloud Animation */
@keyframes moveCloud {
    from { transform: translateX(100vw); }
    to { transform: translateX(-100px); }
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    z-index: 1;
}

/* Leaderboard Modal Styles */
.leaderboard-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1001;
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

.leaderboard-modal h3 {
    font-size: 1.5rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.leaderboard-modal h3 i {
    color: #FFD700;
    margin-right: 10px;
    animation: bounce 2s infinite;
}

.leaderboard-modal ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-modal li {
    background: linear-gradient(135deg, rgba(67,97,238,0.1), rgba(255,159,67,0.1));
    margin: 10px 0;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary);
}

.leaderboard-modal li:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.leaderboard-modal li:nth-child(1) {
    background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,193,7,0.2));
    border-left-color: #FFD700;
}

.leaderboard-modal li:nth-child(2) {
    background: linear-gradient(135deg, rgba(192,192,192,0.2), rgba(169,169,169,0.2));
    border-left-color: #C0C0C0;
}

.leaderboard-modal li:nth-child(3) {
    background: linear-gradient(135deg, rgba(205,127,50,0.2), rgba(184,115,51,0.2));
    border-left-color: #CD7F32;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    line-height: 1;
}

.close-btn:hover {
    background: linear-gradient(135deg, #ff5252, #d32f2f);
    transform: scale(1.1);
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
}

.floating-element {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(40px);
    animation: float 15s infinite linear;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(50px, 50px) rotate(180deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

/* Notification Badge */
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
}


/* --- NEW: Badge Status untuk Tabel (Penting untuk Ringkasan.php) --- */
.status-badge {
    padding: 4px 8px; /* Ukuran padding */
    border-radius: 12px; /* Membuat sudut membulat */
    font-size: 0.8rem; /* Ukuran font */
    font-weight: 600; /* Ketebalan font */
    display: inline-flex; /* Penting untuk centering teks dan tetap dalam aliran teks */
    align-items: center; /* Pusatkan vertikal */
    justify-content: center; /* Pusatkan horizontal */
    min-width: 60px; /* Beri lebar minimum agar konsisten */
    text-align: center; /* Fallback text align */
}

/* Warna untuk Status Badge */
.status-badge.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.badge-warning {
    background-color: #fef08a;
    color: #854d0e;
}

.status-badge.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Specific styles for ringkasan.php (move from inline to here if desired) */
.analisis-container {
    display: grid;
    grid-template-columns: 1fr; /* Changed to 1 column for simplicity or adjust as needed */
    gap: 30px;
    margin-top: 20px;
}

/* .analisis-card (already combined with .card above) */

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #4361ee;
}

tr:hover {
    background-color: #f9f9f9;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef08a;
    color: #854d0e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

/* Filter styles */
.filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-form select, .filter-form button {
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.filter-form button {
    background: #4361ee;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-form button:hover {
    background: #3a56d4;
    transform: translateY(-2px);
}

.no-data {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    font-style: italic;
}

/* Dalam assets/css/style.css */

.class-distribution-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}
.class-distribution-table th,
.class-distribution-table td {
    border: 1px solid #e0e0e0; /* Border sedikit lebih terang */
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
}
.class-distribution-table thead th {
    background-color: #f8f8f8; /* Background header tabel */
    font-weight: 600;
    color: var(--dark);
}
.class-distribution-table tbody tr:nth-child(even) {
    background-color: #fcfcfc; /* Warna striping baris */
}
.class-distribution-table tbody tr:hover {
    background-color: #f0f8ff; /* Hover effect */
}

/* Loader spinner (jika belum ada) */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary); /* Warna loader */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.class-distribution-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
.class-distribution-table th, .class-distribution-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
.class-distribution-table th {
    background-color: #f2f2f2;
}

.file-input-info .warninglo {
    color: red;
    font-weight: bold;
}

/* Style untuk modal detail */
.custom-swal-popup {
    border-radius: 16px;
    max-height: 80vh;
    overflow-y: auto;
}

.highlight {
    background-color: #fff3cd !important;
    font-weight: bold;
}

.info-box {
    background-color: #e9f7fe;
    border-left: 4px solid #3498db;
    padding: 12px;
    margin: 15px 0;
    border-radius: 4px;
}

.info-box h4 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.chart-container {
    position: relative;
    height: 400px; /* atau tinggi yang cukup */
    width: 100%;
}

/* ==================== MANAJEMEN SISWA SPECIFIC STYLES ==================== */
.daftar-siswa-container {
    width: 100%;
    margin-top: 20px;
}

.daftar-siswa-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.daftar-siswa-table th,
.daftar-siswa-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.daftar-siswa-table th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    font-weight: 600;
    color: var(--primary);
}

.daftar-siswa-table tr:hover {
    background-color: #f5f5f5;
}

/* Column widths */
.daftar-siswa-table td:nth-child(1),
.daftar-siswa-table th:nth-child(1) {
    width: 5%;
    min-width: 50px;
}

.daftar-siswa-table td:nth-child(2),
.daftar-siswa-table th:nth-child(2) {
    width: 15%;
    min-width: 120px;
}

.daftar-siswa-table td:nth-child(3),
.daftar-siswa-table th:nth-child(3) {
    width: 30%;
    min-width: 200px;
    white-space: normal;
}

.daftar-siswa-table td:nth-child(4),
.daftar-siswa-table th:nth-child(4) {
    width: 15%;
    min-width: 100px;
}

.daftar-siswa-table td:nth-child(5),
.daftar-siswa-table th:nth-child(5) {
    width: 10%;
    min-width: 80px;
}

.daftar-siswa-table td:nth-child(6),
.daftar-siswa-table th:nth-child(6) {
    width: 25%;
    min-width: 150px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .daftar-siswa-table td:nth-child(3),
    .daftar-siswa-table th:nth-child(3) {
        width: 25%;
    }
    
    .daftar-siswa-table td:nth-child(6),
    .daftar-siswa-table th:nth-child(6) {
        width: 20%;
    }
}

@media (max-width: 992px) {
    .daftar-siswa-table th,
    .daftar-siswa-table td {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .daftar-siswa-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .daftar-siswa-table td {
        white-space: nowrap;
    }
}

/* Filter form adjustments */
.filter-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--gray);
}

.form-group select,
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.no-data {
    text-align: center;
    padding: 30px;
    color: var(--gray);
    font-style: italic;
}

.no-data i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
    color: var(--primary-light);
}
/* ==================== STATS CARDS ==================== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    font-size: 1rem;
    color: var(--gray);
    margin-bottom: 10px;
    font-weight: 500;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: var(--dark);
    transition: all 0.3s ease;
    border: 1px solid #ddd;
}

.pagination a:hover {
    background: var(--primary-light);
    color: white;
}

.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==================== EXPORT BUTTON ==================== */
.btn-export {
    background: linear-gradient(to right, #10b981, #059669) !important;
    margin-left: auto;
}

.btn-export:hover {
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4) !important;
}

/* ==================== SORTING HEADERS ==================== */
.daftar-siswa-table th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.daftar-siswa-table th i {
    font-size: 16px;
}

/* ==================== LOADER SPINNER ==================== */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-form {
        flex-direction: column;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .btn-export {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
    
    .daftar-siswa-table th, 
    .daftar-siswa-table td {
        padding: 8px;
        font-size: 14px;
    }
    
    .daftar-siswa-table th:nth-child(6),
    .daftar-siswa-table td:nth-child(6) {
        min-width: 120px;
    }
}

/* Loading indicator during search */
.search-loading {
    position: relative;
}

.search-loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.search-loading.active::after {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Style khusus untuk statistik rata-rata */
.stat-card.rata-rata {
    border-left-color: var(--success);
}

.stat-card.rata-rata p {
    color: var(--success);
    font-size: 1.3rem;
}

.stat-card.rata-rata small {
    font-size: 0.8rem;
    color: var(--gray);
    display: block;
    margin-top: 5px;
}

.student-info-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        
        .highlight-box {
            background-color: #f8f9fa;
            border-left: 4px solid var(--primary);
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 20px;
        }
        
        .highlight-box p {
            margin-bottom: 10px;
            font-size: 1.05em;
            line-height: 1.6;
        }
        
        .highlight-box p strong {
            color: var(--primary);
        }
        
        .recommendations {
            margin-top: 20px;
        }
        
        .recommendations h4 {
            color: var(--primary);
            margin-bottom: 15px;
            font-size: 1.1em;
        }
        
        .recommendations ul {
            padding-left: 20px;
        }
        
        .recommendations li {
            margin-bottom: 8px;
            line-height: 1.5;
        }
        
        .btn-export {
            margin-top: 20px;
            display: inline-flex;
            align-items: center;
        }
        
        .btn-export i {
            margin-right: 8px;
        }

        .chart-container {
            height: 400px;
            width: 100%;
        }
        
        .alert-error {
    padding: 15px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #b71c1c;
    margin: 20px 0;
}

.alert-error pre {
    background: white;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

/* Chart Styles */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin: 20px 0;
}

.chart-error {
    padding: 20px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #b71c1c;
    border-radius: 8px;
    margin: 20px 0;
}

.chart-error pre {
    background: white;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 13px;
}

/* Ensure canvas renders properly */
canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
}

/* Submenu styles */
.submenu {
    list-style: none;
    padding-left: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-top: 5px;
    overflow: hidden;
}

.submenu-link {
    display: flex !important;
    align-items: center !important;
    padding: 10px 16px !important;
    color: var(--gray) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent !important;
}

.submenu-link:hover {
    background: var(--sidebar-hover) !important;
    color: var(--primary) !important;
    border-left-color: var(--primary) !important;
}

.submenu-link.active {
    background: var(--sidebar-active) !important;
    color: var(--primary) !important;
    border-left-color: var(--primary) !important;
    font-weight: 600 !important;
}

.submenu-link i {
    margin-right: 8px !important;
    font-size: 0.8rem !important;
}

/* Fallback untuk icon yang tidak muncul */
.upload-icon {
    position: relative;
}

.upload-icon::before {
    content: "📤";
    position: absolute;
    left: 0;
    top: 0;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Jika Boxicons tidak ter-load, tampilkan emoji */
.bx.bxs-file-import:not([style*="font-family"])::before,
.bx.bxs-file-import[style*="font-family: 'boxicons'"]:not([style*="font-family: 'boxicons'"]):before {
    content: "📤";
    opacity: 1;
}

/* Fallback untuk semua icon Boxicons */
.bx:not([style*="font-family"])::before,
.bx[style*="font-family: 'boxicons'"]:not([style*="font-family: 'boxicons'"]):before {
    font-family: inherit;
}