:root {
    /* Dark Theme (Default) */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;
    --accent-color: #8b5cf6;
    --background-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.3s ease;
    --input-bg: rgba(15, 23, 42, 0.6);
    --panel-bg: rgba(15, 23, 42, 0.6);
    
    /* Jenjang Theme Variables (akan di-override oleh JavaScript) */
    --jenjang-color: #6366f1;
    --jenjang-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    
    /* Dynamic Background Gradients */
    --bg-grad-1: rgba(99, 102, 241, 0.15);
    --bg-grad-2: rgba(236, 72, 153, 0.15);
    --bg-grad-3: rgba(139, 92, 246, 0.15);
    --bg-grad-4: rgba(16, 185, 129, 0.15);
}

/* Light Theme Variables */
body.light-mode {
    --background-color: #f1f5f9;
    --surface-color: rgba(255, 255, 255, 0.85);
    /* More opaque for light mode */
    --glass-border: rgba(0, 0, 0, 0.05);
    /* Subtle dark border */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --input-bg: rgba(255, 255, 255, 0.9);
    --panel-bg: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--background-color);
    /* Dynamic background for both modes */
    background-image:
        radial-gradient(at 0% 0%, var(--bg-grad-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--bg-grad-2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-grad-3) 0px, transparent 50%),
        radial-gradient(at 0% 100%, var(--bg-grad-4) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    /* Changed to variable for theme switching */
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Form Groups & Fieldsets */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(var(--surface-color), 0.3);
}

.form-section-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--primary-color);
    font-weight: 600;
}

/* Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Form Readonly Override */
.form-control[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.05);
}

/* Layouts */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    /* Darkened slightly for contrast */
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

body.light-mode .data-table th {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: rgba(148, 163, 184, 0.1);
}

.rekap-school-row:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    transition: background 0.2s ease;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.autocomplete-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.autocomplete-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.autocomplete-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Login Specific */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

/* Dashboard Specific */
.navbar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .nav-brand {
    background: linear-gradient(135deg, #1e293b, #64748b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-item {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 0.25rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading .loader {
    display: inline-block;
}

/* Responsive Grid for Form */
.grid-cols-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

.hidden {
    display: none !important;
}

/* School Info Badge */
.school-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-color);
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    color: var(--text-primary);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Stats Grid */
.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.5rem 0;
    /* Gradient Text */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    padding: 1rem;
    overflow: hidden;
    /* Cegah grafik keluar dari container */
    box-sizing: border-box;
}

/* Pastikan canvas tidak pernah melewati parent-nya */
.chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Khusus doughnut: izinkan label di luar lingkaran tidak terpotong */
.chart-container--doughnut {
    overflow: visible !important;
}

/* ── Responsif Chart Row di Mobile ─────────────────────────────────────── */
/* Bar chart Kecamatan: tinggi auto agar bar tidak terhimpit */
.chart-bar-kec {
    height: 320px;
    padding: 0;
}

@media (max-width: 768px) {

    /* Stack panel chart menjadi satu kolom */
    .charts-row-grid {
        grid-template-columns: 1fr !important;
    }

    /* Bar chart: tinggi mengikuti jumlah bar (di-set via JS),
       default min-height agar tetap terlihat */
    .chart-bar-kec {
        min-height: 280px;
        height: auto !important;
    }
}

/* Search & Filter Toolbar */
.toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.toolbar-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 10;
    font-size: 0.85rem;
}

.search-input {
    width: 100%;
    padding-left: 3.25rem !important;
    height: 42px;
    border-radius: 12px;
    font-size: 0.875rem;
}

/* Seragamkan height semua control di toolbar */
.toolbar .form-control,
.toolbar select.form-control {
    height: 42px;
    border-radius: 12px;
    font-size: 0.85rem;
    padding-top: 0;
    padding-bottom: 0;
    padding-right: 0.85rem;
    padding-left: 0.85rem;
    /* akan di-override oleh .search-input !important */
    flex: 1;
    min-width: 130px;
    cursor: pointer;
}

.toolbar .btn-danger {
    height: 42px;
    border-radius: 12px;
    padding: 0 1.1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-success,
.toolbar .btn-success {
    height: 42px;
    border-radius: 12px;
    padding: 0 1.1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-success:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn-success:active {
    transform: translateY(0);
}

.btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 600px) {
    .toolbar-row {
        flex-wrap: wrap;
    }

    .toolbar .form-control,
    .toolbar select.form-control {
        min-width: calc(50% - 0.4rem);
        flex: 1 1 calc(50% - 0.4rem);
    }

    .toolbar .btn-danger {
        flex: 1;
        justify-content: center;
    }
}

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Modern Modal Redesign */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: #ffffff;
    /* Fallback */
    background: var(--surface-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 24px;
    padding: 0;
    /* Remove default padding, use header/body specific padding */
    width: 95%;
    max-width: 1000px;
    height: 85vh;
    overflow: hidden;
    /* Header fixed, body scrolls */
    display: flex;
    flex-direction: column;
}

body.light-mode .modal-content {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        /* padding: 1rem; -- Removed as padding is now handled by header/body */
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

.modal-header-bg {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    padding: 2.5rem 2.5rem 4rem 2.5rem;
    /* Extra bottom padding for tabs overlap */
    color: white;
    position: relative;
    margin: 0;
    border-radius: 0;
    flex-shrink: 0;
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Floating Tabs */
.modal-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2.5rem 0.75rem 2.5rem;
    margin-top: -2.5rem;
    margin-bottom: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    /* Tambahkan scroll indicator */
    position: relative;
}

.modal-tabs::after {
    content: '';
    position: absolute;
    right: 2.5rem;
    top: 0;
    bottom: 0.75rem;
    width: 30px;
    background: linear-gradient(to right, transparent, var(--surface-color));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-tabs.has-scroll::after {
    opacity: 1;
}

.modal-tabs::-webkit-scrollbar {
    height: 4px;
}

.modal-tabs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.modal-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.modal-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.modal-tab-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.75rem;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
    min-width: fit-content;
}

body.light-mode .modal-tab-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #475569;
    border-color: rgba(0, 0, 0, 0.05);
}

.modal-tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
}

body.light-mode .modal-tab-btn:hover {
    background: white;
    color: var(--primary-color);
}

.modal-tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-bottom: none;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

body.light-mode .modal-tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.modal-tab-btn i {
    font-size: 0.85rem;
}

/* Modal Body Scroll Area */
.modal-body-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    background: var(--background-color);
}

body.light-mode .modal-body-scroll {
    background: #f8fafc;
}

/* Grid Improvements */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.detail-item {
    background: var(--surface-color);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
    box-shadow: var(--shadow);
}

body.light-mode .detail-item {
    background: white;
    border-color: #e2e8f0;
}

.detail-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

/* URL Link di dalam detail card */
.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.25);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.detail-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    border-color: transparent;
}

.detail-link i {
    font-size: 0.8rem;
}

body.light-mode .detail-link {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

.detail-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.detail-section.active {
    display: block;
}

/* Specific Section Colors */
.tab-profil .detail-item {
    border-left: 4px solid #6366f1;
}

.tab-kondisi .detail-item {
    border-left: 4px solid #ec4899;
}

.tab-bangun .detail-item {
    border-left: 4px solid #10b981;
}

.tab-rehab .detail-item {
    border-left: 4px solid #f59e0b;
}

.tab-pengadaan .detail-item {
    border-left: 4px solid #8b5cf6;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border: 1px dashed var(--glass-border);
}

.modal-footer {
    display: none !important;
}

body.light-mode .modal-footer {
    display: none !important;
}

/* ─── Nav Input Locked State ─────────────────────────────────────────── */
/* Digunakan ketika sekolah (USER) sudah pernah input data */
.nav-input-locked {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    /* klik diblokir sepenuhnya */
    border: 1px dashed rgba(239, 68, 68, 0.4) !important;
    background: rgba(239, 68, 68, 0.05) !important;
    position: relative;
}

/* Ikon kunci kecil di pojok kanan atas nav item */
.nav-input-locked::after {
    content: '\f023';
    /* FontAwesome fa-lock unicode */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    position: absolute;
    top: 6px;
    right: 8px;
    color: rgba(239, 68, 68, 0.7);
    line-height: 1;
}

/* Mobile bottom nav: apply same lock style */
.bottom-nav .nav-item.nav-input-locked {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════════
   MARQUEE ANIMATION
   ═══════════════════════════════════════════════════════════════════════ */

.marquee-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 0.5rem 0;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 4050s linear infinite;
    padding-left: 100%;
}

.marquee-content:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.marquee-item {
    display: inline-block;
    padding: 0.4rem 1rem;
    margin: 0 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.marquee-item:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.marquee-item i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.marquee-item .school-name {
    font-weight: 600;
    color: var(--text-primary);
}

.marquee-item .timestamp {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   JENJANG THEME SYSTEM
   ═══════════════════════════════════════════════════════════════════════ */

/* Sidebar user display name - auto adjust for long names */
#userDisplayName {
    max-width: 100% !important;
    overflow: visible !important; /* Allow multi-line */
    max-height: none !important; /* Remove height restriction */
    height: auto !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    hyphens: auto;
}

#userDisplayName div {
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
}

/* Dashboard info card dengan tema jenjang */
#dashboardInfoCard {
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
}

/* Ensure text is readable on colored background */
#dashboardInfoCard h2,
#dashboardInfoCard p,
#dashboardInfoCard div,
#dashboardInfoCard label {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#dashboardInfoCard i {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Jenjang badge colors */
.jenjang-badge-sd {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.jenjang-badge-smp {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.jenjang-badge-tk {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.jenjang-badge-pnf {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR POSITION CONTROL (LEFT, RIGHT, TOP, BOTTOM)
   ═══════════════════════════════════════════════════════════════════════ */

/* Default: Sidebar Left */
.dashboard-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dashboard-grid.sidebar-hidden {
    grid-template-columns: 0px 1fr;
}

/* Sidebar Right */
.dashboard-grid.sidebar-right {
    grid-template-columns: 1fr 220px;
}

.dashboard-grid.sidebar-right.sidebar-hidden {
    grid-template-columns: 1fr 0px;
}

.dashboard-grid.sidebar-right .main-sidebar {
    order: 2;
}

/* Sidebar Top */
.dashboard-grid.sidebar-top {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

.dashboard-grid.sidebar-top .main-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 0.35rem 0.75rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    position: sticky;
    top: 0;
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    z-index: 50;
    overflow-x: auto;
    overflow-y: hidden;
}

.dashboard-grid.sidebar-top .main-sidebar > div:first-child {
    margin-bottom: 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-right: 0.5rem;
    margin-right: 0.5rem;
    border-right: 1px solid var(--glass-border);
    height: 100%;
    max-width: 140px;
}

.dashboard-grid.sidebar-top .main-sidebar > div:first-child img {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
}

.dashboard-grid.sidebar-top .main-sidebar > div:first-child h2 {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.7rem !important;
    line-height: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-grid.sidebar-top .main-sidebar > div:first-child h2 br {
    display: none;
}

.dashboard-grid.sidebar-top .main-sidebar > div:first-child h2 span {
    display: none;
}

.dashboard-grid.sidebar-top .main-sidebar nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    margin: 0 !important;
    align-items: center;
    padding: 0;
    height: 100%;
}

.dashboard-grid.sidebar-top .main-sidebar nav::-webkit-scrollbar {
    display: none;
}

/* Compact horizontal nav items - Professional style */
.dashboard-grid.sidebar-top .main-sidebar nav .nav-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 0.35rem !important;
    white-space: nowrap;
    min-width: auto !important;
    width: auto !important;
    padding: 0.35rem 0.5rem !important;
    margin: 0 !important;
    font-size: 0.7rem !important;
    font-weight: 500;
    flex-shrink: 0;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    text-align: left !important;
    border-radius: 6px !important;
    height: auto;
    line-height: 1.2 !important;
}

.dashboard-grid.sidebar-top .main-sidebar nav .nav-item i {
    font-size: 0.8rem !important;
    margin: 0 !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.dashboard-grid.sidebar-top .main-sidebar nav .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-bottom-color: var(--primary-color) !important;
    border-left: none !important;
}

.dashboard-grid.sidebar-top .main-sidebar > div:last-child {
    display: none !important;
}

/* Sidebar Bottom */
.dashboard-grid.sidebar-bottom {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    min-height: 100vh;
}

.dashboard-grid.sidebar-bottom .main-sidebar {
    border-right: none;
    border-top: 1px solid var(--glass-border);
    padding: 0.35rem 0.75rem;
    order: 2;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    position: sticky;
    bottom: 0;
    background: var(--surface-color);
    backdrop-filter: blur(12px);
    z-index: 50;
    overflow-x: auto;
    overflow-y: hidden;
}

.dashboard-grid.sidebar-bottom .main-sidebar > div:first-child {
    margin-bottom: 0 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-right: 0.5rem;
    margin-right: 0.5rem;
    border-right: 1px solid var(--glass-border);
    height: 100%;
    max-width: 140px;
}

.dashboard-grid.sidebar-bottom .main-sidebar > div:first-child img {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
}

.dashboard-grid.sidebar-bottom .main-sidebar > div:first-child h2 {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    white-space: nowrap;
    font-size: 0.7rem !important;
    line-height: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-grid.sidebar-bottom .main-sidebar > div:first-child h2 br {
    display: none;
}

.dashboard-grid.sidebar-bottom .main-sidebar > div:first-child h2 span {
    display: none;
}

.dashboard-grid.sidebar-bottom .main-sidebar nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    margin: 0 !important;
    align-items: center;
    padding: 0;
    height: 100%;
}

.dashboard-grid.sidebar-bottom .main-sidebar nav::-webkit-scrollbar {
    display: none;
}

/* Compact horizontal nav items - Professional style */
.dashboard-grid.sidebar-bottom .main-sidebar nav .nav-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 0.35rem !important;
    white-space: nowrap;
    min-width: auto !important;
    width: auto !important;
    padding: 0.35rem 0.5rem !important;
    margin: 0 !important;
    font-size: 0.7rem !important;
    font-weight: 500;
    flex-shrink: 0;
    border-left: none !important;
    border-top: 2px solid transparent !important;
    text-align: left !important;
    border-radius: 6px !important;
    height: auto;
    line-height: 1.2 !important;
}

.dashboard-grid.sidebar-bottom .main-sidebar nav .nav-item i {
    font-size: 0.8rem !important;
    margin: 0 !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.dashboard-grid.sidebar-bottom .main-sidebar nav .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary-color) !important;
    border-left: none !important;
}

.dashboard-grid.sidebar-bottom .main-sidebar > div:last-child {
    display: none !important;
}

/* Position Toggle Button */
.sidebar-position-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    user-select: none;
}

.sidebar-position-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.sidebar-position-toggle:active {
    transform: scale(0.95);
}

.sidebar-position-toggle i {
    font-size: 1.2rem;
    pointer-events: none;
}

/* Position Menu */
.position-menu {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 101;
    background: var(--surface-color);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.position-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    color: var(--text-primary);
}

.position-menu-header i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.position-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.position-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    user-select: none;
    pointer-events: auto;
}

.position-option:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.position-option:active {
    transform: translateY(0);
}

.position-option.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.position-option i {
    font-size: 1.2rem;
    pointer-events: none;
}

.position-option span {
    pointer-events: none;
}

/* Mobile: Hide position toggle */
@media (max-width: 900px) {
    .sidebar-position-toggle {
        display: none;
    }
    
    .position-menu {
        display: none;
    }
    
    /* Force left sidebar on mobile */
    .dashboard-grid.sidebar-right,
    .dashboard-grid.sidebar-top,
    .dashboard-grid.sidebar-bottom {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   COLORFUL SIDEBAR NAVIGATION - ELEGANT EDITION
   ═══════════════════════════════════════════════════════════════════════ */

/* Base nav-item transition for smooth press effect */
.nav-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

/* Dashboard - Blue */
.nav-item[data-target="dashboard-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="dashboard-view"]:hover {
    background: rgba(99, 102, 241, 0.08);
}
.nav-item[data-target="dashboard-view"].active {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: #6366f1;
}
.nav-item[data-target="dashboard-view"] i {
    color: #6366f1;
}

/* Input Data - Green */
.nav-item[data-target="input-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="input-view"]:hover {
    background: rgba(16, 185, 129, 0.08);
}
.nav-item[data-target="input-view"].active {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}
.nav-item[data-target="input-view"] i {
    color: #10b981;
}

/* Data Sarpras - Teal */
.nav-item[data-target="data-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="data-view"]:hover {
    background: rgba(20, 184, 166, 0.08);
}
.nav-item[data-target="data-view"].active {
    background: rgba(20, 184, 166, 0.1);
    border-left-color: #14b8a6;
}
.nav-item[data-target="data-view"] i {
    color: #14b8a6;
}

/* Input Inklusi - Purple */
.nav-item[data-target="inklusi-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="inklusi-view"]:hover {
    background: rgba(139, 92, 246, 0.08);
}
.nav-item[data-target="inklusi-view"].active {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: #8b5cf6;
}
.nav-item[data-target="inklusi-view"] i {
    color: #8b5cf6;
}

/* Data Inklusi - Orange */
.nav-item[data-target="data-inklusi-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="data-inklusi-view"]:hover {
    background: rgba(245, 158, 11, 0.08);
}
.nav-item[data-target="data-inklusi-view"].active {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}
.nav-item[data-target="data-inklusi-view"] i {
    color: #f59e0b;
}

/* Infografis - Pink */
.nav-item[data-target="infografis-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="infografis-view"]:hover {
    background: rgba(236, 72, 153, 0.08);
}
.nav-item[data-target="infografis-view"].active {
    background: rgba(236, 72, 153, 0.1);
    border-left-color: #ec4899;
}
.nav-item[data-target="infografis-view"] i {
    color: #ec4899;
}

/* Analisis Data - Indigo */
.nav-item[data-target="analisis-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="analisis-view"]:hover {
    background: rgba(99, 102, 241, 0.08);
}
.nav-item[data-target="analisis-view"].active {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: #6366f1;
}
.nav-item[data-target="analisis-view"] i {
    color: #6366f1;
}

/* Deteksi Anomali - Gray */
.nav-item[data-target="anomali-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="anomali-view"]:hover {
    background: rgba(107, 114, 128, 0.08);
}
.nav-item[data-target="anomali-view"].active {
    background: rgba(107, 114, 128, 0.1);
    border-left-color: #6b7280;
}
.nav-item[data-target="anomali-view"] i {
    color: #6b7280;
}

/* Estimasi Anggaran - Slate */
.nav-item[data-target="estimasi-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="estimasi-view"]:hover {
    background: rgba(100, 116, 139, 0.08);
}
.nav-item[data-target="estimasi-view"].active {
    background: rgba(100, 116, 139, 0.1);
    border-left-color: #64748b;
}
.nav-item[data-target="estimasi-view"] i {
    color: #64748b;
}

/* Rekap Progres - Cyan */
.nav-item[data-target="rekap-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="rekap-view"]:hover {
    background: rgba(6, 182, 212, 0.08);
}
.nav-item[data-target="rekap-view"].active {
    background: rgba(6, 182, 212, 0.1);
    border-left-color: #06b6d4;
}
.nav-item[data-target="rekap-view"] i {
    color: #06b6d4;
}

/* Rekap Hasil - Emerald */
.nav-item[data-target="rekap-hasil-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="rekap-hasil-view"]:hover {
    background: rgba(16, 185, 129, 0.08);
}
.nav-item[data-target="rekap-hasil-view"].active {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}
.nav-item[data-target="rekap-hasil-view"] i {
    color: #10b981;
}

/* Rekap Detail - Lime */
.nav-item[data-target="rekap-detail-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="rekap-detail-view"]:hover {
    background: rgba(132, 204, 22, 0.08);
}
.nav-item[data-target="rekap-detail-view"].active {
    background: rgba(132, 204, 22, 0.1);
    border-left-color: #84cc16;
}
.nav-item[data-target="rekap-detail-view"] i {
    color: #84cc16;
}

/* Rekap Hasil Inklusi - Violet */
.nav-item[data-target="rekap-hasil-inklusi-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="rekap-hasil-inklusi-view"]:hover {
    background: rgba(168, 85, 247, 0.08);
}
.nav-item[data-target="rekap-hasil-inklusi-view"].active {
    background: rgba(168, 85, 247, 0.1);
    border-left-color: #a855f7;
}
.nav-item[data-target="rekap-hasil-inklusi-view"] i {
    color: #a855f7;
}

/* Tentang - Sky Blue */
.nav-item[data-target="tentang-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="tentang-view"]:hover {
    background: rgba(14, 165, 233, 0.08);
}
.nav-item[data-target="tentang-view"].active {
    background: rgba(14, 165, 233, 0.1);
    border-left-color: #0ea5e9;
}
.nav-item[data-target="tentang-view"] i {
    color: #0ea5e9;
}

/* Ganti Password - Amber */
.nav-item[data-target="password-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="password-view"]:hover {
    background: rgba(251, 191, 36, 0.08);
}
.nav-item[data-target="password-view"].active {
    background: rgba(251, 191, 36, 0.1);
    border-left-color: #fbbf24;
}
.nav-item[data-target="password-view"] i {
    color: #fbbf24;
}

/* Admin Panel - Red */
.nav-item[data-target="admin-view"] {
    border-left: 3px solid transparent;
}
.nav-item[data-target="admin-view"]:hover {
    background: rgba(239, 68, 68, 0.08);
}
.nav-item[data-target="admin-view"].active {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}
.nav-item[data-target="admin-view"] i {
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTON PRESS EFFECT
   ═══════════════════════════════════════════════════════════════════════ */

/* Button press effect for all buttons */
.btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* Specific effect for refresh/action buttons */
.btn-secondary:active,
.btn-primary:active,
.btn-success:active,
.btn-danger:active,
.btn-warning:active {
    transform: scale(0.95) translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.1s ease;
}

/* Add ripple effect on click */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
    transition: 0s;
}


/* ═══════════════════════════════════════════════════════════════════════
   DETAIL ANOMALI MODAL
   ═══════════════════════════════════════════════════════════════════════ */

.detail-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.detail-modal-content {
    background: var(--surface-color);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.3s ease;
}

body.light-mode .detail-modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.modal-close:hover,
.modal-close:focus {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    transform: rotate(90deg);
}

/* Scrollbar styling for modal */
.detail-modal-content::-webkit-scrollbar {
    width: 8px;
}

.detail-modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.detail-modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.detail-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}


/* ═══════════════════════════════════════════════════════════════════════
   SIDEBAR NAV GROUP (COLLAPSIBLE SUB-MENU)
   ═══════════════════════════════════════════════════════════════════════ */

.nav-group {
    margin-bottom: 0.35rem;
}

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
}

.nav-group-header:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.nav-group-header i:first-child {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

.nav-group-header span {
    flex: 1;
}

.nav-group-arrow {
    font-size: 0.7rem !important;
    transition: transform 0.3s ease;
    width: auto !important;
}

.nav-group.expanded .nav-group-arrow {
    transform: rotate(180deg);
}

.nav-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0.5rem;
    display: block !important;
}

.nav-group-content > * {
    display: block !important;
    width: 100%;
}

.nav-group.expanded .nav-group-content {
    max-height: 500px;
}

.nav-sub-item {
    font-size: 0.8rem !important;
    padding: 0.5rem 0.75rem 0.5rem 2rem !important;
    margin: 0.2rem 0;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    display: block !important;
    width: 100%;
}

.nav-sub-item:hover {
    border-left-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.08);
}

.nav-sub-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-sub-item i {
    font-size: 0.75rem !important;
    width: 16px !important;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Active state for nav-group-header when any sub-item is active */
.nav-group.has-active .nav-group-header {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Ensure nav-group works correctly in all sidebar positions */
.dashboard-grid:not(.sidebar-top):not(.sidebar-bottom) .nav-group-content {
    display: flex !important;
    flex-direction: column !important;
}

.dashboard-grid:not(.sidebar-top):not(.sidebar-bottom) .nav-sub-item {
    display: flex !important;
    flex-direction: row !important;
}

/* Override for sidebar-top and sidebar-bottom - flatten the menu structure */
/* Hide nav-group wrapper and header in horizontal mode */
.dashboard-grid.sidebar-top .nav-group,
.dashboard-grid.sidebar-bottom .nav-group {
    display: contents !important; /* This makes children appear as if nav-group doesn't exist */
}

.dashboard-grid.sidebar-top .nav-group-header,
.dashboard-grid.sidebar-bottom .nav-group-header {
    display: none !important;
}

/* Show sub-items as regular items in horizontal mode */
.dashboard-grid.sidebar-top .nav-group-content,
.dashboard-grid.sidebar-bottom .nav-group-content {
    display: contents !important;
    max-height: none !important;
    overflow: visible !important;
    padding-left: 0 !important;
}

.dashboard-grid.sidebar-top .nav-sub-item,
.dashboard-grid.sidebar-bottom .nav-sub-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 0.35rem 0.5rem !important;
    margin: 0 !important;
    border-left: none !important;
    border-bottom: 2px solid transparent !important;
    min-width: auto !important;
    width: auto !important;
    white-space: nowrap !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    height: auto !important;
    line-height: 1.2 !important;
    text-align: left !important;
}

.dashboard-grid.sidebar-top .nav-sub-item i,
.dashboard-grid.sidebar-bottom .nav-sub-item i {
    font-size: 0.8rem !important;
    margin: 0 !important;
    width: auto !important;
    flex-shrink: 0 !important;
}

.dashboard-grid.sidebar-top .nav-sub-item.active,
.dashboard-grid.sidebar-bottom .nav-sub-item.active {
    background: rgba(99, 102, 241, 0.1) !important;
    border-left: none !important;
    border-bottom-color: var(--primary-color) !important;
}

.dashboard-grid.sidebar-top .nav-sub-item:hover,
.dashboard-grid.sidebar-bottom .nav-sub-item:hover {
    border-left: none !important;
    background: rgba(99, 102, 241, 0.08) !important;
}
