/* --- 1. GLOBAL SETTINGS --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

.fade-in { animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   MAGIC LIGHT MODE OVERRIDE (SUPER COMPLETE)
   ========================================= */

/* 1. Body & Background Dasar */
body.light-mode {
    background-color: #f1f5f9 !important; /* slate-100 */
    color: #1e293b !important; /* slate-800 */
}

/* 2. Paksa Main Content jadi Terang */
body.light-mode #main-content {
    background-color: #f1f5f9 !important;
}

/* 3. Sidebar & Header (Putih Bersih) */
body.light-mode .bg-slate-950,
body.light-mode .bg-slate-900,
body.light-mode header {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important; /* Border jadi abu muda */
}

/* 4. KARTU & CONTAINER (Search, Tombol Wrapper, Tabel Wrapper) */
/* Ini kunci agar container search & tabel jadi putih */
body.light-mode .bg-slate-800 {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important; /* slate-300 */
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.05) !important;
}

/* 5. Text Color Swap */
body.light-mode .text-white {
    color: #0f172a !important; /* Putih -> Hitam */
}
body.light-mode .text-slate-200,
body.light-mode .text-slate-300,
body.light-mode .text-slate-400,
body.light-mode .text-slate-500 {
    color: #475569 !important; /* Abu -> Abu Gelap */
}

/* 6. Border Gelap jadi Terang */
body.light-mode .border-slate-700,
body.light-mode .border-slate-800 {
    border-color: #e2e8f0 !important;
}

/* 7. Input Field (Search Bar & Form) */
body.light-mode input, 
body.light-mode select, 
body.light-mode textarea {
    background-color: #f8fafc !important; /* slate-50 */
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
/* Placeholder Input biar kebaca */
body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: #94a3b8 !important;
}

/* 8. Tabel */
body.light-mode tr:hover {
    background-color: #f1f5f9 !important; /* Hover jadi abu sangat muda */
}
body.light-mode thead {
    background-color: #f8fafc !important; /* Header tabel jadi terang */
    color: #475569 !important;
}

/* 9. Tom Select (Dropdown) */
body.light-mode .ts-control,
body.light-mode .ts-dropdown {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
body.light-mode .ts-dropdown .active {
    background-color: #f1f5f9 !important;
}

/* 10. KPI Cards Specific */
body.light-mode .kpi-card {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

/* 11. MOBILE NAVBAR OVERRIDES */
/* Mengubah container utama jadi putih transparan (glass) */
body.light-mode #mobileNavContainer > div {
    background-color: rgba(255, 255, 255, 0.92) !important;
    border-color: #e2e8f0 !important; /* slate-200 */
}

/* Mengubah kotak hijau pelindung menu aktif (Pill) jadi terang */
body.light-mode #mobileNavContainer .bg-cyan-900\/40 {
    background-color: #ecfdf5 !important; /* cyan-50 */
    border-color: #d1fae5 !important; /* cyan-100 */
}

/* Mengubah tombol toggle (X) saat ditutup (transparan) jadi terang */
body.light-mode #mobileNavToggle.bg-slate-800\/40 {
    background-color: rgba(255, 255, 255, 0.6) !important;
    color: #475569 !important; /* slate-600 */
    border-color: #cbd5e1 !important; /* slate-300 */
}

/* =========================================
   ANIMASI: BLUB / JELLY POP (Untuk Mobile Nav)
   ========================================= */
@keyframes blub {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.animate-blub {
    /* cubic-bezier ini yang bikin efeknya membal kayak karet/jelly */
    animation: blub 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* =========================================
   ANIMASI: EXPAND PILL (Background Mekar)
   ========================================= */
@keyframes expandPill {
    0% { 
        transform: scaleX(0.3) scaleY(0.5); /* Mulai dari kecil dan pipih di tengah */
        opacity: 0; 
    }
    60% { 
        transform: scaleX(1.05) scaleY(1.05); /* Membal kebesaran sedikit */
        opacity: 1; 
    }
    100% { 
        transform: scaleX(1) scaleY(1); /* Kembali ke ukuran pas (normal) */
        opacity: 1; 
    }
}

.animate-expand-pill {
    transform-origin: center; /* Titik awal mekarnya persis dari tengah */
    animation: expandPill 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* =========================================
   TURBO DRIVE: Hilangkan Progress Bar
   ========================================= */
.turbo-progress-bar {
    display: none !important;
}

/* Kustomisasi kecepatan View Transition (Opsional) 
   Biar transisinya gak kelamaan (kita set 0.3 detik) */
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
}