/* ==========================================================================
   PREMIUM DESIGN SYSTEM - ONLINE GRADUATION SYSTEM (SKL)
   ========================================================================== */

/* 1. Root Variables & Theme Setup */
:root {
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    
    /* Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --info: #06b6d4;
    --info-light: #cffafe;
    
    /* Neutrals */
    --bg-app: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(226, 232, 240, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
    
    /* Glassmorphism Styles */
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --backdrop-blur: blur(12px);
    
    /* Layout Variables */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. Global Resets & Body */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Background Gradients for Public Pages */
.public-container, .login-container {
    background: linear-gradient(135deg, #e0e7ff 0%, #fae8ff 50%, #e0f2fe 100%);
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 3. Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.text-muted { color: var(--text-muted); }

/* 4. Glassmorphism Card Style */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    padding: 24px;
    transition: var(--transition-normal);
}

.card.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--glass-shadow);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

/* 5. Buttons Styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}
.btn-success:hover {
    background-color: var(--success-hover);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}
.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}
.btn-warning:hover {
    background-color: #d97706;
}

.btn-icon-sm {
    padding: 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* 6. Form Fields */
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #cbd5e1;
    background-color: var(--white);
    outline: none;
    transition: var(--transition-fast);
    color: #1e293b;
    width: 100%;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.required {
    color: var(--danger);
}

/* Checkbox alignment */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.form-group-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.form-group-checkbox label {
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

/* File Upload Button wrapper */
.btn-file-upload {
    border: 2px dashed var(--primary);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background-color: rgba(79, 70, 229, 0.02);
    transition: var(--transition-fast);
}

.btn-file-upload:hover {
    background-color: rgba(79, 70, 229, 0.08);
}

.btn-file-upload i {
    font-size: 2rem;
    color: var(--primary);
}

.btn-file-upload input[type="file"] {
    display: none;
}

/* 7. Tables Styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: var(--white);
    font-size: 0.9rem;
}

.table th, .table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

.table-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

/* Student Photo Thumbnail in table */
.student-photo-thumb {
    width: 36px;
    height: 48px;
    max-width: 36px;
    max-height: 48px;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    display: block;
}
.photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 48px;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
}
.photo-preview img {
    border: 2px solid var(--border-color);
    object-fit: cover;
    width: 120px;
    height: 120px;
    border-radius: 8px;
}

/* Photo upload wrapper in table */
.photo-upload-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 48px;
}
.photo-upload-form {
    display: contents;
}
.photo-upload-label {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.photo-upload-label:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}
.photo-upload-input {
    display: none;
}

/* Photo column specific styling to keep table row height perfect */
.table th.col-photo,
.table td.col-photo {
    width: 85px !important;
    min-width: 85px !important;
    max-width: 85px !important;
    padding: 6px 12px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

/* Category Badge in tables */
.badge-category {
    background-color: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

/* 8. Alert Banners */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.alert-success {
    background-color: var(--success-light);
    color: #047857;
    border: 1px solid #6ee7b7;
}

.alert-info {
    background-color: var(--info-light);
    color: #0e7490;
    border: 1px solid #67e8f9;
}

.alert-dismissible {
    justify-content: space-between;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}
.alert-close:hover {
    opacity: 1;
}

/* 9. Badges */
.badge {
    display: inline-flex;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success-hover);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger-hover);
}

/* 10. Public Portal Layout */
.public-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.public-header {
    text-align: center;
    margin-bottom: 30px;
}

.school-logo-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    margin-bottom: 16px;
}

.school-logo-img {
    height: 90px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.public-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(to right, #1e293b, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.school-address {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.portal-wrapper {
    width: 100%;
    max-width: 750px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-card {
    text-align: center;
    width: 100%;
}

.search-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.search-form {
    margin: 20px 0;
    width: 100%;
}

.search-form .input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--white);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid #cbd5e1;
    overflow: hidden;
    padding: 4px;
    transition: var(--transition-fast);
}

.search-form .input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-form input {
    border: none;
    outline: none;
    padding: 14px 14px 14px 48px;
    font-size: 1.05rem;
    font-family: var(--font-primary);
    flex-grow: 1;
    color: #1e293b;
    background: transparent;
}

.search-form button {
    border-radius: 12px;
    padding: 12px 24px;
}

/* Countdown Timer */
.countdown-wrapper {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.countdown-wrapper h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 30px 0;
}

.timer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-md);
    width: 90px;
    padding: 14px 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255,255,255,0.5);
    transition: var(--transition-fast);
}

.timer-box:hover {
    transform: translateY(-3px);
    background: var(--white);
}

.timer-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.timer-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.announcement-date-text {
    font-size: 0.9rem;
}

/* Result Card */
.result-card {
    width: 100%;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.student-meta h3 {
    font-size: 1.6rem;
    margin-bottom: 4px;
    color: #0f172a;
}

.student-meta p {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 10px 24px;
    border-radius: var(--border-radius-md);
    letter-spacing: 0.02em;
}

.status-lulus {
    background-color: var(--success);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.status-tidak-lulus {
    background-color: var(--danger);
    color: var(--white);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.grades-section {
    margin: 24px 0;
}

.grades-section h4 {
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.table-grades {
    box-shadow: none;
    border: none;
}

.table-grades th {
    background: transparent;
    border-bottom: 2px solid #e2e8f0;
}

.table-grades td {
    padding: 12px 16px;
}

.score-val {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1e293b;
}

.row-average {
    background-color: #f8fafc;
}

.row-average td {
    border-top: 2px solid #cbd5e1;
    font-size: 1rem;
}

.score-avg {
    font-size: 1.15rem;
    color: var(--primary);
}

.result-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* 11. Admin Authentication Card */
.login-card {
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.admin-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 1.8rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.login-footer a:hover {
    color: var(--primary-hover);
}

/* 12. Admin Dashboard Layout */
.admin-body {
    background-color: #f1f5f9;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background-color: #0f172a;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--white);
    border-bottom: 1px solid #1e293b;
}

.sidebar-brand i {
    color: #818cf8;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 24px 12px;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sidebar-nav li a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav li:hover > a, 
.sidebar-nav li.active > a {
    color: var(--white);
    background-color: #1e293b;
}

.sidebar-nav li.active > a i {
    color: #818cf8;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #1e293b;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    padding: 12px;
    color: #94a3b8;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    text-align: left;
    transition: var(--transition-fast);
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.admin-content-wrapper {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    height: var(--topbar-height);
    background-color: var(--white);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left h2 {
    font-size: 1.4rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-main {
    padding: 32px;
    flex-grow: 1;
    background-color: #f8fafc;
}

/* Dashboard Home */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-icon {
    font-size: 2.2rem;
    opacity: 0.8;
}

.border-left-primary { border-left: 4px solid var(--primary); }
.border-left-success { border-left: 4px solid var(--success); }
.border-left-danger { border-left: 4px solid var(--danger); }
.border-left-info { border-left: 4px solid var(--info); }
.border-left-warning { border-left: 4px solid var(--warning); }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }

.dashboard-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.recent-students-card .card-header, 
.quick-actions-card .card-header,
.control-card .control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.recent-students-card .card-header h3,
.quick-actions-card .card-header h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #475569;
}

.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Control card in students and subjects list */
.control-card {
    padding: 16px 24px;
    margin-bottom: 20px;
}

.control-card .control-header {
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-search-form {
    margin: 0;
    flex-grow: 1;
    max-width: 450px;
    width: 100%;
}

.admin-search-form .input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1.5px solid #e2e8f0;
    border-radius: var(--border-radius-md);
    padding: 3px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    width: 100%;
}

.admin-search-form .input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.admin-search-form input {
    border: none;
    outline: none;
    padding: 9px 14px 9px 38px;
    font-size: 0.9rem;
    font-family: var(--font-primary);
    width: 0;
    min-width: 120px;
    flex-grow: 1;
    background: transparent;
    color: var(--text-dark);
    line-height: 1.4;
}

.admin-search-form input::placeholder {
    color: #94a3b8;
    font-weight: 400;
    opacity: 1;
}

.admin-search-form .search-icon {
    left: 14px;
    font-size: 0.95rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.admin-search-form .input-group:focus-within .search-icon {
    color: var(--primary);
}

.admin-search-form .input-group .btn {
    height: 36px;
    padding: 0 18px;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

.admin-search-form .input-group .btn-secondary {
    height: 36px;
    padding: 0 14px;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

.control-actions {
    display: flex;
    gap: 8px;
}

/* Pagination Custom */
.pagination-wrapper {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-wrapper .pagination {
    display: flex;
    list-style: none;
    gap: 6px;
}

/* Settings Form Sections */
.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-size: 1.1rem;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    background-color: rgba(248, 250, 252, 0.5);
}

.upload-box label:first-child {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #334155;
}

.image-preview-container {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #cbd5e1;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
}

.setting-img-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.setting-img-placeholder {
    font-size: 2.5rem;
    color: #94a3b8;
}

.file-input-hidden {
    display: none;
}

.file-input-label {
    cursor: pointer;
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 13. Modals Styling (Custom Overlay) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 0;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: var(--white) !important;
    border: 1px solid #cbd5e1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.close-modal {
    font-size: 1.8rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
}

.modal-body.scrollable-y {
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form layouts in Modals */
.form-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.col-span-2 {
    grid-column: span 2;
}

.scores-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-group-score {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px;
    transition: var(--transition-fast);
}

.form-group-score:focus-within {
    border-color: var(--primary);
    background-color: var(--white);
}

.form-group-score label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
}

.form-group-score input {
    border: none;
    background: transparent;
    padding: 4px 0;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
    color: #1e293b;
}

/* 14. Keyframes & Animations */
@keyframes modalSlideIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .8; transform: scale(1.02); }
}

/* 15. Responsive Styling */
@media (max-width: 991px) {
    .dashboard-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Layout */
    .admin-sidebar {
        width: 60px;
    }
    .sidebar-brand span, 
    .sidebar-nav span, 
    .btn-logout span {
        display: none;
    }
    .admin-content-wrapper {
        margin-left: 60px;
    }
    .sidebar-brand {
        justify-content: center;
        padding: 20px 0;
    }
    .sidebar-nav {
        padding: 24px 4px;
    }
    .sidebar-nav li a {
        justify-content: center;
        padding: 12px 0;
    }
    .sidebar-nav li a i {
        font-size: 1.3rem;
    }
    .btn-logout {
        justify-content: center;
        padding: 12px 0;
    }
    
    /* Stats & Grids */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .upload-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }
    .countdown-timer {
        flex-wrap: wrap;
    }
    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .timer-box {
        width: 75px;
        padding: 10px 0;
    }
    .timer-num {
        font-size: 1.6rem;
    }
}

/* ==========================================================================
   SIDEBAR DROPDOWN & SUBMENU STYLES
   ========================================================================== */
.nav-item-dropdown {
    display: flex;
    flex-direction: column;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between !important;
    width: 100%;
}

.dropdown-arrow {
    display: inline-block !important;
    font-size: 0.8rem !important;
    transition: transform 0.3s ease;
}

.nav-item-dropdown.open .dropdown-arrow {
    transform: rotate(180deg) !important;
}

.sidebar-nav .submenu-list {
    list-style: none !important;
    padding-left: 24px !important;
    margin-top: 4px;
    display: none !important;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav .submenu-list.show {
    display: flex !important;
}

.sidebar-nav .submenu-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
    border-radius: var(--border-radius-sm);
    color: #94a3b8 !important;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sidebar-nav .submenu-list li a i {
    font-size: 0.95rem !important;
    width: 18px;
    text-align: center;
}

.sidebar-nav .submenu-list li:hover a,
.sidebar-nav .submenu-list li.active-sub a {
    color: var(--white) !important;
    background-color: #1e293b !important;
}

.sidebar-nav .submenu-list li.active-sub a i {
    color: #818cf8 !important;
}

/* ==========================================================================
   SIDEBAR COLLAPSE / HIDE-UNHIDE STYLES
   ========================================================================== */
.admin-sidebar {
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.admin-content-wrapper {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-collapsed .admin-sidebar {
    left: -260px !important;
}

.sidebar-collapsed .admin-content-wrapper {
    margin-left: 0 !important;
}

.btn-sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.btn-sidebar-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}
