        :root { --primary: #2c3e50; --accent: #18bc9c; --sidebar-width: 260px; }
        /* --- PERBAIKAN BACKGROUND UTAMA (WAJIB AGAR KACA TERLIHAT) --- */
        body { 
            background-color: #f4f7f6 !important; /* Warna abu-abu sangat muda yang bersih */
            background-image: none !important; /* Hilangkan semua efek bercak/gradasi */
            font-family: 'Segoe UI', sans-serif; 
            margin: 0; 
            padding: 0;
            overflow-x: hidden; 
        }
        
        /* --- PERBAIKAN SIDEBAR (GLASSMORPHISM) --- */
        .sidebar { 
            width: var(--sidebar-width);
            height: 100vh;
            /* Gradasi elegan dari Hijau Gelap ke Hijau Tosca */
            background: linear-gradient(160deg, #103c30 0%, #178a69 100%) !important; 
            backdrop-filter: none !important; 
            -webkit-backdrop-filter: none !important;
            border-right: none !important;
            box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1) !important;
            color: white; 
            transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
            position: fixed; 
            z-index: 1050; 
            display: flex;
            flex-direction: column;
        }
        
        /* Area Menu Tengah yang Bisa Di-Scroll */
        .sidebar-menu-scroll {
            flex-grow: 1;              /* Mengambil sisa ruang layar */
            overflow-y: auto;          /* Mengaktifkan scroll vertikal */
            overflow-x: hidden;
            padding-right: 5px;
        }

        /* Mempercantik Scrollbar agar tipis dan elegan */
        .sidebar-menu-scroll::-webkit-scrollbar { width: 5px; }
        .sidebar-menu-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 10px; }
        .sidebar-menu-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
        .sidebar-menu-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

        /* Area Profil & Keluar di Bawah */
        .sidebar-footer {
            margin-top: auto;          /* Dorong otomatis ke paling bawah */
            padding-top: 15px;
            padding-bottom: 15px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }
        .sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-width)); }
        .main-content { margin-left: var(--sidebar-width); transition: 0.3s; min-height: 100vh; width: calc(100% - var(--sidebar-width)); }
        .main-content.expanded { margin-left: 0; width: 100%; }
        /* --- PERCANTIK MENU SIDEBAR --- */
        .sidebar-category {
            font-size: 0.65rem;
            text-transform: uppercase;
            font-weight: 800;
            letter-spacing: 1.5px;
            /* Warna teks kategori dibuat putih transparan */
            color: rgba(255,255,255,0.5);
            margin: 20px 0 8px 15px;
        }
        
        .nav-link { 
            color: rgba(255,255,255,0.8); /* Teks sedikit lebih redup */
            cursor: pointer; 
            border-radius: 10px; 
            margin: 0 10px 4px 10px; /* Jarak samping */
            padding: 10px 15px; 
            display: flex; 
            align-items: center; 
            transition: all 0.3s ease; 
        }
        
        /* Efek saat menu disorot (hover) atau sedang aktif di mode Glass */
        .nav-link:hover, .nav-link.active { 
            color: white; 
            background: rgba(255,255,255,0.15); 
            border-left: 4px solid #ffffff !important; /* Diubah jadi garis putih agar kontras dengan hijau */
            transform: translateX(5px);
            font-weight: 600;
            box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
        }
        .card { border: none; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
        /* --- MODERN LOADING OVERLAY --- */
        .loading-overlay { 
            position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
            background: rgba(255, 255, 255, 0.6); 
            backdrop-filter: blur(6px); /* Efek Kaca Buram Modern */
            -webkit-backdrop-filter: blur(6px);
            z-index: 9999; display: none; flex-direction: column; 
            justify-content: center; align-items: center; 
        }
        
        /* --- ANIMASI GEOMETRIK BERGESER & BERDENYUT --- */
        .geometric-container {
            width: 55px; 
            height: 55px; 
            position: relative; 
            margin: 0 auto;
        }
        
        /* Bungkusan luar: Bertugas untuk menggeser posisi (Sliding) */
        .box-mover {
            position: absolute; 
            width: 24px; 
            height: 24px;
            animation: move-around 4s infinite cubic-bezier(0.25, 0.1, 0.25, 1);
        }
        
        /* Mengatur posisi awal agar membentuk formasi kotak 2x2 */
        .mover-1 { animation-delay: 0s; }
        .mover-2 { animation-delay: -1s; } /* Mulai dari kanan atas */
        .mover-3 { animation-delay: -2s; } /* Mulai dari kanan bawah */
        .mover-4 { animation-delay: -3s; } /* Mulai dari kiri bawah */

        @keyframes move-around {
            0%, 20%   { top: 0; left: 0; }
            25%, 45%  { top: 0; left: 31px; }
            50%, 70%  { top: 31px; left: 31px; }
            75%, 95%  { top: 31px; left: 0; }
            100%      { top: 0; left: 0; }
        }

        /* Kotak dalam: Bertugas untuk animasi membesar-mengecil (Pulse) dan Warna */
        .box-pulser {
            width: 100%; 
            height: 100%; 
            border-radius: 4px;
            animation: geo-pulse 1.2s infinite ease-in-out;
        }
        
        /* Warna-warni instansi profesional */
        .color-1 { background-color: #18bc9c; animation-delay: 0.1s; } /* Tosca */
        .color-2 { background-color: #3498db; animation-delay: 0.3s; } /* Biru */
        .color-3 { background-color: #f39c12; animation-delay: 0.4s; } /* Oranye */
        .color-4 { background-color: #e74c3c; animation-delay: 0.2s; } /* Merah */

        @keyframes geo-pulse {
            0%, 100% { transform: scale(1); opacity: 1; border-radius: 4px; }
            50%      { transform: scale(0.3); opacity: 0.5; border-radius: 50%; }
        }
        
        /* --- UI LOGIN MODERN --- */
        #auth-container {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            /* Background gradien menyesuaikan tema aplikasi */
            background: linear-gradient(135deg, #2c3e50 0%, #18bc9c 100%);
            padding: 20px;
            position: relative;
            overflow: hidden;
        }
        /* Ornamen Lingkaran Estetik di Belakang */
        #auth-container::before, #auth-container::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
        }
        #auth-container::before {
            width: 400px; height: 400px;
            top: -100px; left: -100px;
        }
        #auth-container::after {
            width: 300px; height: 300px;
            bottom: -50px; right: -50px;
        }

        .auth-card {
            width: 100%;
            max-width: 450px;
            /* Efek Glassmorphism (Kaca Transparan) */
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 24px;
            border: 1px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
            padding: 40px !important;
            display: none;
            transform: translateY(20px);
            opacity: 0;
            z-index: 10;
        }
        .auth-card.active {
            display: block;
            animation: fadeUpModern 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }
        @keyframes fadeUpModern {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .auth-logo-box {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, var(--primary), var(--accent));
            border-radius: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: -80px auto 20px; /* Logo mengambang di atas form */
            box-shadow: 0 10px 25px rgba(24, 188, 156, 0.4);
            color: white;
            font-size: 2.5rem;
            border: 3px solid #fff;
        }
        .auth-btn {
            border-radius: 50px;
            padding: 12px;
            font-weight: 700;
            letter-spacing: 1px;
            background: linear-gradient(135deg, var(--primary), var(--accent));
            border: none;
            transition: all 0.3s ease;
        }
        .auth-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(24, 188, 156, 0.4);
        }
        .auth-input {
            border-radius: 12px !important;
            background: #f8f9fa;
            border: 1px solid #e9ecef;
        }
        .auth-input:focus {
            background: #fff;
            border-color: var(--accent);
            box-shadow: 0 0 0 4px rgba(24, 188, 156, 0.1) !important;
        }

        .swal-select-custom { display: block; width: 100%; padding: .375rem 2.25rem .375rem .75rem; font-size: 1rem; border: 1px solid #ced4da; border-radius: .375rem; margin-bottom: 15px; }
        .scrollable-history { max-height: 120px; overflow-y: auto; border: 1px solid #dee2e6; border-radius: 6px; padding: 5px; background: #fff; }
        .heatmap-cell { cursor: pointer; transition: 0.2s; font-weight: bold; }
        .heatmap-cell:hover { background-color: #e9ecef !important; transform: scale(1.1); }

        .fc-toolbar-title { font-size: 1.2rem !important; font-weight: bold; color: var(--primary); }
        .fc-event { cursor: pointer; border: none; padding: 2px 4px; border-radius: 4px; }

        @keyframes badge-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.15); box-shadow: 0 0 8px rgba(0,0,0,0.3); } 100% { transform: scale(1); } }
        .badge-animated { animation: badge-pulse 1.5s infinite; transition: all 0.3s ease; }
        
        /* Auto-logout Banner alert */
        .logout-warning { position: fixed; bottom: 20px; right: 20px; z-index: 1060; display: none; }

        @media (max-width: 768px) { .sidebar { margin-left: calc(-1 * var(--sidebar-width)); } .sidebar.show { margin-left: 0; } .main-content { margin-left: 0; width: 100%; } }
        
        /* Animasi Khusus Widget Pengumuman */
        @keyframes glow-pengumuman {
            0% { box-shadow: 0 0 5px rgba(13, 110, 253, 0.2); border-color: rgba(13, 110, 253, 0.1); }
            50% { box-shadow: 0 0 20px rgba(13, 110, 253, 0.6); border-color: rgba(13, 110, 253, 0.6); }
            100% { box-shadow: 0 0 5px rgba(13, 110, 253, 0.2); border-color: rgba(13, 110, 253, 0.1); }
        }
        .pengumuman-animasi {
            animation: glow-pengumuman 2s infinite ease-in-out;
            border: 2px solid transparent;
            background: linear-gradient(to right, #cfe2ff, #e1f0ff) !important;
        }
        @keyframes wiggle-toa {
            0%, 100% { transform: rotate(-15deg); }
            50% { transform: rotate(15deg) scale(1.15); }
        }
        .toa-bergerak {
            display: inline-block;
            animation: wiggle-toa 1.2s infinite ease-in-out;
            color: #0a58ca;
        }
        .teks-pengumuman-fokus {
            font-size: 1.05rem;
            color: #084298;
            font-weight: 500;
            line-height: 1.5;
        }
        /* --- PERBAIKAN TAMPILAN SELECT2 MODERN --- */
        .select2-container--bootstrap-5 .select2-selection {
            border-radius: 12px !important;
            background-color: #f8f9fa !important;
            border: 1px solid #e9ecef !important;
            min-height: 50px !important;
            display: flex;
            align-items: center;
        }
        .select2-container--bootstrap-5.select2-container--focus .select2-selection {
            background-color: #fff !important;
            border-color: var(--accent) !important;
            box-shadow: 0 0 0 4px rgba(24, 188, 156, 0.1) !important;
        }
        .select2-container--bootstrap-5 .select2-selection__rendered {
            color: #6c757d !important; 
            padding-left: 0.5rem !important;
        }
        .select2-container--bootstrap-5 .select2-selection__clear {
            margin-right: 10px;
        }
        /* --- PERBAIKAN KALENDER (HARI MINGGU MERAH) --- */
        .fc-day-sun .fc-col-header-cell-cushion, 
        .fc-day-sun .fc-daygrid-day-number {
            color: #dc3545 !important; /* Warna Merah */
            font-weight: bold;
        }
        .fc-day-sun {
            background-color: rgba(220, 53, 69, 0.04) !important; /* Latar belakang kemerahan tipis */
        }
        /* --- TAMPILAN ALA MOBILE APP (PEGAWAI) --- */
        .mobile-dashboard-wrapper {
            max-width: 500px; /* Menjaga ukuran tetap proporsional seperti layar HP */
            margin: 0 auto;
        }
        .menu-icon-btn {
            cursor: pointer;
            transition: all 0.3s ease;
            border: 1px solid rgba(0,0,0,0.05);
        }
        .menu-icon-btn:hover, .menu-icon-btn:active {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 10px 20px rgba(0,0,0,0.08) !important;
            background-color: #f8f9fa !important;
        }
        .curved-header {
            border-radius: 0 0 30px 30px;
            margin: -1.5rem -1.5rem 2.5rem -1.5rem; /* Menabrak batas padding bawaan */
            padding-bottom: 60px !important; /* Memberi ruang untuk kartu melayang */
            background: linear-gradient(135deg, #2c3e50 0%, #18bc9c 100%);
        }
        
        /* --- STYLING HEADER MODERN (PC) --- */
        .top-header-modern {
            background: #ffffff; border-bottom: 1px solid rgba(0,0,0,0.05); padding: 10px 0; transition: all 0.3s ease;
        }
        .user-name-text { font-size: 1.1rem; color: #2c3e50; }
        .greeting-text { display: none; }
        .badge-role { color: #18bc9c; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
        .badge-jabatan { color: #7f8c8d; font-size: 0.75rem; font-weight: 500; }
        .user-location { font-size: 0.75rem; color: #7f8c8d; font-weight: 600; }
        .avatar-box {
            width: 50px; height: 50px; background: linear-gradient(135deg, #18bc9c 0%, #2c3e50 100%);
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
            color: white; font-size: 1.5rem; box-shadow: 0 4px 10px rgba(24, 188, 156, 0.3);
        }

       /* --- HYBRID UI KHUSUS HP (MOBILE BANKING STYLE) --- */
        @media (max-width: 768px) {
            .sidebar { display: none !important; }
            #page-title { display: none !important; } /* Hilangkan teks DASHBOARD */
            
            .main-content { margin-left: 0 !important; width: 100% !important; }
            .p-4 { padding: 15px !important; padding-bottom: 90px !important; } 

            /* 1. Header Melengkung & Penambahan Space Jarak Bawah */
                        
            .user-name-text { color: #ffffff !important; font-size: 1.25rem; }
            .greeting-text { display: block !important; color: rgba(255,255,255,0.8); font-size: 0.75rem; margin-bottom: 2px;}
            .user-location { color: rgba(255,255,255,0.9) !important; font-weight: 400;}
            
            /* 2. Teks Jabatan Elegan dengan Garis Pemisah (Pipe) */
            .badge-role { background: transparent !important; color: #f1c40f !important; padding: 0 !important; }
            .badge-jabatan { background: transparent !important; color: rgba(255,255,255,0.9) !important; padding: 0 !important; border-left: 2px solid rgba(255,255,255,0.4); padding-left: 8px !important; margin-left: 6px !important; }
            
            .avatar-box { 
                width: 55px; height: 55px; font-size: 1.8rem; 
                background: white !important; color: #18bc9c !important; 
                border: 3px solid rgba(255,255,255,0.3);
            }

            .mobile-bottom-nav {
                display: flex !important; 
                position: fixed; 
                bottom: 0; left: 0; width: 100%;
                background: rgba(255,255,255,0.98); 
                backdrop-filter: blur(10px);
                justify-content: space-around; align-items: center;
                padding: 10px 0 15px 0 !important; 
                border-radius: 20px 20px 0 0; 
                z-index: 9999 !important;
                box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
                transform: translateZ(0); /* Trik jitu agar browser HP tidak menyembunyikannya saat scroll */
            }
            .mobile-bottom-nav .nav-item { 
                text-align: center; 
                color: #adb5bd; 
                text-decoration: none; 
                font-size: 0.7rem; 
                font-weight: bold; 
                transition: 0.3s; 
                flex-grow: 1;
                /* PERBAIKAN: Menggeser sedikit elemen ke atas agar sejajar */
                transform: translateY(8px) !important;
            }
            .mobile-bottom-nav .nav-item.active { color: var(--accent); }
            .mobile-bottom-nav .nav-item i { font-size: 1.4rem; display: block; margin-bottom: 2px; }
        }
        
        /* --- EFEK PODIUM PEGAWAI TERBAIK --- */
        .podium-box {
            border-radius: 15px 15px 0 0;
            padding: 20px 10px;
            color: white;
            box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
            transition: transform 0.3s;
        }
        .podium-box:hover { transform: translateY(-10px); }
        .podium-1 { background: linear-gradient(135deg, #f1c40f, #f39c12); height: 180px; z-index: 3;}
        .podium-2 { background: linear-gradient(135deg, #bdc3c7, #95a5a6); height: 140px; z-index: 2;}
        .podium-3 { background: linear-gradient(135deg, #d35400, #e67e22); height: 110px; z-index: 1;}
        .podium-rank { font-size: 2.5rem; font-weight: 900; opacity: 0.5; margin-bottom: 5px; line-height: 1;}
        .podium-name { font-size: 1rem; font-weight: bold; line-height: 1.2;}
        .podium-pts { font-size: 0.8rem; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; display: inline-block; margin-top: 5px;}
        /* Styling Khusus Pop-up Ulang Tahun (Elegan & Frosted Glass) */
        .swal2-popup.birthday-modal {
            background: rgba(24, 188, 156, 0.25) !important; /* Sedikit ditebalkan transparansinya */
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-radius: 30px !important;
            border: 1px solid rgba(24, 188, 156, 0.4) !important;
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1) !important;
        }

        /* PERBAIKAN: Teks Judul Putih dengan Glow/Stroke Gelap */
        .birthday-modal .swal2-title {
            color: #ffffff !important; 
            text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.6), 0px 0px 8px rgba(0, 0, 0, 0.3) !important; 
            font-weight: 800 !important;
        }

        /* PERBAIKAN: Teks Deskripsi Putih dengan Bayangan Lembut */
        .birthday-modal .swal2-html-container {
            color: #f8f9fa !important;
            text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.7) !important;
        }

        /* PERBAIKAN: Kotak Daftar Nama Tetap Putih Susu namun Sedikit Transparan */
        .birthday-list-container {
            background: rgba(255, 255, 255, 0.85) !important; 
            border: 1px solid rgba(255, 255, 255, 0.5);
            padding: 15px;
            border-radius: 20px;
            box-shadow: 0 8px 15px rgba(0,0,0,0.1);
            color: #2c3e50 !important; /* Teks di dalam kotak nama tetap gelap agar super terbaca */
            text-shadow: none !important; /* Teks di dalam kotak nama tidak perlu glow */
        }

        /* --- PERBAIKAN TOMBOL LOGIN (TEMA HIJAU TOSCA) --- */
        .btn-masuk-hijau {
            background: linear-gradient(135deg, #18bc9c 0%, #128c7e 100%);
            border: none;
            color: #ffffff !important;
            transition: all 0.3s ease;
        }
        .btn-masuk-hijau:hover {
            background: linear-gradient(135deg, #128c7e 0%, #0e6b5f 100%);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(24, 188, 156, 0.4);
        }

        /* Tombol Fingerprint: Awal Hijau, Disorot Hitam */
        .btn-finger-hijau {
            background-color: #ffffff;
            border: 2px solid #18bc9c !important;
            color: #18bc9c !important; /* Warna icon awal hijau */
            transition: all 0.3s ease;
        }
        .btn-finger-hijau:hover {
            background-color: #ffffff !important;
            border-color: #1a252f !important; /* Garis tepi jadi hitam */
            color: #1a252f !important; /* Icon berubah jadi hitam */
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        /* --- SPLASH SCREEN MODERN --- */
        #splash-screen {
            position: fixed;
            top: 0; left: 0; width: 100vw; height: 100vh;
            background: linear-gradient(135deg, #18bc9c 0%, #0e6b5f 100%);
            display: flex; flex-direction: column;
            justify-content: center; align-items: center;
            z-index: 999999; /* Paling atas menutupi semuanya */
            transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
        }
        #splash-screen.hidden {
            opacity: 0;
            visibility: hidden;
        }
        .splash-logo {
            font-size: 5rem; color: #ffffff;
            animation: pulseLogo 1.5s infinite alternate;
        }
        .splash-title {
            color: #ffffff; font-weight: 800; letter-spacing: 2px;
            margin-top: 15px; font-size: 2rem;
            animation: fadeUp 1s ease-out forwards;
        }
        @keyframes pulseLogo {
            0% { transform: scale(0.9); opacity: 0.8; }
            100% { transform: scale(1.1); opacity: 1; text-shadow: 0 0 30px rgba(255,255,255,0.6); }
        }
        @keyframes fadeUp {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        /* --- PERCANTIK CAROUSEL PINTAR --- */
        /* .carousel-indicators dipindahkan ke bawah (versi final) */
        .carousel-indicators [data-bs-target] {
            background-color: #adb5bd !important;
            width: 8px !important;
            height: 8px !important;
            border-radius: 50%;
            margin: 0 4px;
        }
        .carousel-indicators .active {
            background-color: #18bc9c !important;
            width: 16px !important; /* Memanjang seperti pil saat aktif */
            border-radius: 10px;
            transition: all 0.3s ease;
        }
        /* .carousel-item-box dipindahkan ke bawah (versi final dengan !important) */
        /* .carousel-text-clamp dipindahkan ke bawah (versi final dengan !important) */
        /* =========================================================
   1. PERBAIKAN HEADER MOBILE & EFEK KARTU MELAYANG (FLOATING)
   ========================================================= */
@media (max-width: 768px) {
    
    .user-name-text { 
        font-size: 1.35rem !important; /* Lebih besar & proporsional */
        font-weight: 800 !important; 
        letter-spacing: 0.5px;
    }
    .user-location { 
        font-size: 0.75rem !important; 
        opacity: 0.85; 
        margin-top: 2px;
    }
    /* Sembunyikan tombol keluar merah di header HP (Opsional jika pakai class ini di HTML) */
    .btn-keluar-header { display: none !important; }
}

/* =========================================================
   2. PERBAIKAN PROPORSI CAROUSEL (RESPONSIF)
   ========================================================= */
#pengumumanCarousel {
    position: relative;
    z-index: 5;
    margin-bottom: 35px !important;
}

/* ── Kotak Carousel: tinggi otomatis, batas minimum agar tidak gepeng ── */
.carousel-item-box {
    height: 140px !important;
    min-height: 110px;
    max-height: 160px;          /* Batasi agar teks panjang tidak membuat kotak terlalu besar */
    padding: 1rem 1.25rem !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08) !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
}

/* ── Teks pengumuman: ukuran proporsional, potong jika terlalu panjang ── */
.carousel-text-clamp {
    font-size: 1rem !important; /* Responsif: min 12px, max 14.4px */
    font-weight: 500 !important;
    line-height: 1.45 !important;
    /* Batasi teks maksimal 3 baris lalu potong dengan "..." */
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: break-word;
}

/* --- ANIMASI SCROLL KARTU LIBURAN --- */
@keyframes slideVerticalFade {
    0% { opacity: 0; transform: translateY(15px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-15px); }
}
.slide-vertical-anim {
    animation: slideVerticalFade 3.5s infinite ease-in-out;
}

/* =========================================================
   3. FRAMELESS BENTO GRID (MENU CEPAT)
   ========================================================= */
.bento-icon-box {
    width: 60px !important;
    height: 60px !important;
    border: none !important; /* Hilangkan garis kasar! */
    box-shadow: 0 6px 15px rgba(0,0,0,0.04) !important;
    border-radius: 18px !important; /* Bentuk Squircle modern */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bento-icon-box:active {
    transform: scale(0.95); /* Efek membal saat ditekan */
}
.bento-text-label {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: #495057 !important;
    margin-top: 8px !important;
}
/* #widget-pengumuman — dibiarkan dikontrol oleh JavaScript, bukan CSS */

@media (max-width: 768px) {
    /* 1. Lepas tarikan header hijau agar info libur turun & punya jarak legas */
    
    /* 2. Lepas tarikan carousel agar turun & tidak menempel dengan info libur */
    #pengumumanCarousel {
        margin-top: 20px !important;
        margin-bottom: 45px !important; /* Memberi jarak aman ke Menu Bento di bawahnya */
        position: relative;
        z-index: 10;
    }

    /* 3. Turunkan posisi titik indikator putih agar tidak menabrak menu cepat */
    .carousel-indicators {
        bottom: -25px !important;
    }

    /* 4. Beri jarak renggang untuk judul STATUS PENGAJUAN */
    #page-dashboard h6.text-secondary.mb-3 {
        margin-top: 30px !important;
        margin-bottom: 15px !important;
    }
}
/* =========================================================
   PERBAIKAN MOBILE - TAMBAHAN (Juni 2026)
   ========================================================= */

/* 1. Perbesar tap area menu cepat agar nyaman dijangkau jari */
@media (max-width: 768px) {
    .bento-icon-box {
        width: 64px !important;
        height: 64px !important;
        min-width: 48px;
        min-height: 48px;
    }

    /* 2. Ganti warna merah "Keluar" di bottom nav jadi abu netral */
    .mobile-bottom-nav .nav-item.keluar-item {
        color: #adb5bd !important;
    }
    .mobile-bottom-nav .nav-item.keluar-item.active,
    .mobile-bottom-nav .nav-item.keluar-item:active {
        color: #e74c3c !important;
    }

    /* 3. Kartu STATUS PENGAJUAN tidak terpotong — stack vertikal di HP kecil */
    .status-pengajuan-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .status-pengajuan-grid .status-card {
        flex: 1 1 calc(50% - 5px);
        min-width: 130px;
    }

    /* 4. Lokasi/puskesmas di header tidak kosong — tampilkan tanda strip jika kosong */
    .user-location:empty::after {
        content: 'Lokasi belum diset';
        opacity: 0.6;
        font-style: italic;
    }

    /* 5. Safe area untuk HP dengan notch/punch-hole (iPhone, Android modern) */
    .mobile-bottom-nav {
        padding-bottom: max(20px, env(safe-area-inset-bottom)) !important;
    }
    .p-4 {
        padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
    }

    /* 7. Kartu cuti tahunan lebih compact di HP */
    .carousel-item-box {
        padding: 1rem 1.25rem !important;
    }

    /* 8. Tombol di form tidak terlalu kecil di HP */
    .btn {
        min-height: 40px;
    }
}

/* 6. Teks username lebih proporsional di layar sangat kecil (< 380px) */
/* DIPINDAHKAN ke luar @media 768px karena nested @media tidak valid */
@media (max-width: 380px) {
    .user-name-text {
        font-size: 1.1rem !important;
    }
    .bento-icon-box {
        width: 54px !important;
        height: 54px !important;
    }
    .bento-text-label {
        font-size: 0.65rem !important;
    }
}


/* Holiday banner — tidak makan ruang saat kosong */
#holiday-banner-dashboard:empty,
#holiday-banner-area:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* =========================================================
   DASHBOARD: GRAFIK & MATRIKS — SATU BLOK DEFINITIF (v4)
   Menggantikan semua blok sebelumnya yang saling bertabrakan.
   ========================================================= */

/* --- Baris utama: sejajarkan dua kartu agar sama tinggi --- */
.dash-chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}
.dash-chart-row .dash-col-chart {
    flex: 1 1 55%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.dash-chart-row .dash-col-matrix {
    flex: 1 1 35%;
    min-width: 240px;
    display: flex;
    flex-direction: column;
}

/* --- Kartu grafik & matriks sama tinggi --- */
.dash-chart-row .card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important;
    overflow: hidden;
}

/* --- Wrapper canvas: INI kunci utama — tinggi tetap agar tidak melar --- */
.dash-chart-wrapper {
    position: relative;
    width: 100%;
    height: 260px;        /* tinggi tetap di desktop */
    flex-shrink: 0;
}
.dash-chart-wrapper canvas {
    position: absolute !important;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* --- Matriks tabel: scroll jika banyak baris --- */
.dash-matrix-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 260px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
}
.dash-matrix-scroll::-webkit-scrollbar { width: 5px; }
.dash-matrix-scroll::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 10px; }
.dash-matrix-scroll::-webkit-scrollbar-track { background: transparent; }

/* --- Tabel matriks bersih dan proporsional --- */
.dash-matrix-scroll .table {
    margin-bottom: 0;
    font-size: 0.82rem;
}
.dash-matrix-scroll .table thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
    font-size: 0.78rem;
    padding: 8px 10px;
}
.dash-matrix-scroll .table td {
    padding: 7px 10px;
    vertical-align: middle;
}

/* --- Heatmap cell klik --- */
.heatmap-cell { cursor: pointer; transition: 0.2s; font-weight: bold; }
.heatmap-cell:hover { background-color: #e9ecef !important; transform: scale(1.1); }

/* --- Scrollable history (riwayat cuti pegawai) --- */
.scrollable-history {
    max-height: 260px;
    overflow-y: auto;
}

/* --- RESPONSIVE: mobile stack vertikal --- */
@media (max-width: 767px) {
    .dash-chart-row {
        flex-direction: column;
    }
    .dash-chart-row .dash-col-chart,
    .dash-chart-row .dash-col-matrix {
        flex: 1 1 auto;
        min-width: unset;
    }
    .dash-chart-wrapper {
        height: 200px;   /* lebih pendek di HP */
    }
    .dash-matrix-scroll {
        max-height: 220px;
    }
}
/* =========================================================
   MODE CETAK (PRINT MEDIA QUERY) - WAJIB UNTUK SURAT RESMI
   ========================================================= */
@media print {
    /* Sembunyikan elemen UI yang tidak perlu dicetak */
    .sidebar, .top-header-modern, .mobile-bottom-nav, 
    .btn, .form-check, .alert, .carousel-indicators,
    #holiday-banner-dashboard, .dataTables_filter, .dataTables_paginate, .dataTables_info {
        display: none !important;
    }
    
    /* Bebaskan margin agar konten menggunakan seluruh ruang kertas */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* Hilangkan background dan shadow untuk menghemat tinta */
    body, .card {
        background: transparent !important;
        background-color: white !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Pastikan warna teks tabel dan cetakan terlihat jelas (Hitam) */
    * {
        color: black !important;
    }
    
    /* Hindari halaman terpotong di tengah-tengah tabel */
    table { page-break-inside: auto; }
    tr    { page-break-inside: avoid; page-break-after: auto; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
}

/* =========================================================
   PERCANTIK DATATABLES & PAGINATION
   ========================================================= */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.3em 0.8em;
    border-radius: 8px;
    border: none !important;
    background: #f8f9fa !important;
    margin: 0 3px;
    font-weight: 600;
    font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(24, 188, 156, 0.2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
    background: #e9ecef !important;
    color: var(--primary) !important;
}

/* =========================================================
   SKELETON LOADING PLACEHOLDER
   ========================================================= */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton-box,
.skeleton-label {
    background: linear-gradient(90deg, #e8ecef 25%, #f4f6f8 50%, #e8ecef 75%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
    border-radius: 10px;
    display: block;
}
.skeleton-label {
    border-radius: 6px;
}

/* =========================================================
   FAB TOMBOL PRESENSI (BOTTOM NAV TENGAH MENONJOL)
   ========================================================= */
.nav-item-fab-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    flex-grow: 1;
    padding-bottom: 4px;
}
.nav-item-fab {
    position: absolute;
    bottom: 14px;   /* Melayang di atas bar */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #18bc9c 0%, #0e8c74 100%);
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 20px rgba(24, 188, 156, 0.45);
    text-decoration: none;
    border: 3px solid #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
}
.nav-item-fab:active,
.nav-item-fab.active {
    transform: scale(0.93);
    box-shadow: 0 3px 10px rgba(24, 188, 156, 0.35);
    background: linear-gradient(135deg, #0e8c74 0%, #0a6b58 100%);
}
.nav-item-fab-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 2px;
    position: relative;
    top: 18px;   /* Turunkan label agar tidak tertimpa FAB */
}
/* Pastikan bottom nav cukup tinggi untuk menampung FAB */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        height: 72px !important;
        padding-top: 0 !important;
        align-items: flex-end !important;
    }
    .mobile-bottom-nav .nav-item {
        padding-bottom: 8px;
        align-self: flex-end;
    }
}

/* =========================================================
   BENTO MENU ACTIVE STATE
   ========================================================= */
.bento-icon-box.bento-active {
    background: linear-gradient(135deg, #e8faf5 0%, #d0f4ea 100%) !important;
    box-shadow: 0 4px 14px rgba(24, 188, 156, 0.25) !important;
    transform: translateY(-3px);
}
.bento-icon-box.bento-active::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
/* Pastikan bento wrapper punya position:relative untuk dot */
.bento-icon-box {
    position: relative;
}
/* --- DESAIN LACI MENU LAINNYA --- */
#menuLainnyaSheet .bento-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
#menuLainnyaSheet .bento-icon-box i {
    font-size: 1.5rem;
}
/* =========================================================
   5. FITUR DAYLIGHT & MIDNIGHT (DARK MODE OVERRIDES)
   ========================================================= */
/* Transisi halus saat berganti mode seperti di iOS */
body, .card, .mobile-bottom-nav, .bento-icon-box, .offcanvas, .auth-card {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease !important;
}

/* Mengatur Latar Belakang Utama */
[data-bs-theme="dark"] body { background-color: #121212 !important; color: #e0e0e0; }

/* Menggelapkan Komponen UI Khusus */
@media (min-width: 769px) {
    /* Header PC menjadi gelap (Header HP biarkan hijau bawaan karena sudah elegan) */
    [data-bs-theme="dark"] .top-header-modern { background: #1e1e1e !important; border-bottom: 1px solid rgba(255,255,255,0.05); }
}

[data-bs-theme="dark"] .mobile-bottom-nav { background: rgba(30,30,30,0.95) !important; border-top: 1px solid rgba(255,255,255,0.05); }
[data-bs-theme="dark"] .card { background-color: #1e1e1e !important; border: 1px solid rgba(255,255,255,0.05) !important; }
[data-bs-theme="dark"] .auth-card { background: rgba(30, 30, 30, 0.85); border: 1px solid rgba(255, 255, 255, 0.1); color: #fff;}

/* Bento Grid Menu Cepat di Mode Malam */
[data-bs-theme="dark"] .bento-icon-box.bg-white,
[data-bs-theme="dark"] .bento-icon-box.bg-light { background-color: #2c2c2c !important; border-color: rgba(255,255,255,0.08) !important; }
[data-bs-theme="dark"] .bento-text-label { color: #bbb !important; }

/* Menimpa Kelas Warna Cerah Bawaan Bootstrap agar Nyaman di Mata */
[data-bs-theme="dark"] .bg-white, 
[data-bs-theme="dark"] .bg-light { background-color: #2c2c2c !important; }
[data-bs-theme="dark"] .text-dark { color: #f8f9fa !important; }
[data-bs-theme="dark"] .text-muted { color: #9e9e9e !important; }

/* Kolom Input Form & Select2 Dropdown */
[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select, 
[data-bs-theme="dark"] .auth-input { 
    background-color: #2c2c2c !important; color: #fff !important; border-color: #444 !important; 
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: #2c2c2c !important; border-color: #444 !important; color: #fff !important;
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection__rendered { color: #e0e0e0 !important; }
[data-bs-theme="dark"] .select2-dropdown { background-color: #2c2c2c !important; border-color: #444 !important; }

/* Komponen Laci (Offcanvas) & SweetAlert */
[data-bs-theme="dark"] .offcanvas { background-color: #1e1e1e; }
[data-bs-theme="dark"] .swal2-popup { background-color: #1e1e1e !important; color: #fff !important; border: 1px solid #333; }
[data-bs-theme="dark"] .swal2-title, 
[data-bs-theme="dark"] .swal2-html-container { color: #e0e0e0 !important; }

/* Menyesuaikan Tabel Data */
[data-bs-theme="dark"] .table { color: #e0e0e0; border-color: #444; }
[data-bs-theme="dark"] .table-light th { background-color: #2c2c2c !important; color: #fff !important; border-color: #444; }
[data-bs-theme="dark"] .table-hover tbody tr:hover td { background-color: #333 !important; color: #fff !important;}

/* Jam Mesin Presensi & Kalender */
[data-bs-theme="dark"] #clock-display { color: #fff !important; }
[data-bs-theme="dark"] .fc-theme-standard td, 
[data-bs-theme="dark"] .fc-theme-standard th { border-color: #444; }
[data-bs-theme="dark"] .fc .fc-toolbar-title { color: #f8f9fa !important; }

/* Membalikkan warna tombol close (X) dari hitam ke putih */
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* =========================================================
   6. ANIMASI TOMBOL TOGGLE DAYLIGHT / MIDNIGHT
   ========================================================= */
/* Wadah Tombol Switch */
.theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 65px;
    height: 34px;
}

/* Sembunyikan Checkbox Asli */
.theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Latar Belakang (Slider) */
.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #87CEEB; /* Warna Langit Siang */
    transition: .5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 34px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

/* Lingkaran Bergerak (Matahari / Bulan) */
.theme-icon-container {
    position: absolute;
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Ikon Matahari & Bulan */
.sun-icon, .moon-icon {
    position: absolute;
    font-size: 1.1rem;
    transition: .5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.sun-icon { color: #f39c12; transform: translateY(0) rotate(0deg); opacity: 1; }
.moon-icon { color: #f1c40f; transform: translateY(-30px) rotate(-90deg); opacity: 0; }

/* KETIKA SAKLAR DITEKAN (MODE MALAM AKTIF) */
.theme-toggle-switch input:checked + .theme-slider {
    background-color: #2c3e50; /* Warna Langit Malam */
}

/* Menggeser Lingkaran ke Kanan */
.theme-toggle-switch input:checked + .theme-slider .theme-icon-container {
    transform: translateX(31px);
    background-color: #1e1e1e;
}

/* Menenggelamkan Matahari, Memunculkan Bulan */
.theme-toggle-switch input:checked + .theme-slider .sun-icon {
    transform: translateY(30px) rotate(90deg);
    opacity: 0;
}
.theme-toggle-switch input:checked + .theme-slider .moon-icon {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

/* Mengubah warna border dan background modal saat dark mode agar serasi dengan saklar */
[data-bs-theme="dark"] .bg-secondary.bg-opacity-10 { background-color: #2c2c2c !important; border-color: rgba(255,255,255,0.08) !important; }

/* =========================================================
   7. KONSOLIDASI HEADER MOBILE (ANIMASI GRADASI BERSIH)
   ========================================================= */
@keyframes gradientPanFluid {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (max-width: 768px) {
    #main-content .top-header-modern {
        /* 1. Animasi Warna Gradasi Berjalan (Super Ringan) */
        background-color: transparent !important;
        background-image: linear-gradient(135deg, #0e3b2f 0%, #18bc9c 50%, #0e6b5f 100%) !important;
        background-size: 200% 200% !important;
        animation: gradientPanFluid 8s ease infinite !important;
        
        /* 2. Tata Letak Lengkungan & Jarak (SAMA SEPERTI GLASSMORPHISM - JANGAN DIHAPUS) */
        border-radius: 0 0 25px 25px !important;
        padding: 25px 15px 30px 15px !important;
        margin-bottom: 20px !important; /* Jarak lega agar Carousel aman */
        box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
        border: none !important;
        z-index: 1040;
    }
}