/* public/css/global.css */

/* ==========================================================================
   👑 PUSAT KENDALI PRESISI (MASTER CONTROL PANEL) 👑
   ========================================================================== */
:root {
  --global-zoom: 0.8; 
  --sidebar-lebar: 260px;
  
  /* VARIABEL KUNCI SIMETRIS! Semua elemen akan patuh pada padding ini */
  --padding-x: 35px;    
  --topbar-tinggi: 65px;
  
  /* 🚀 SUDAH DI-NOL-KAN! MENTOK ATAP! */
  --topbar-jarak-atas: 0px; 

  --tirta-blue: #30528A;
  --tirta-blue-dark: #172a4f;
  --tirta-red: #EC363A;
  --tirta-gold: #A78759;
  --bg-body: #f4f6f9; 
  --bg-card: #ffffff; 
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
}

html { background-color: var(--bg-body); overflow: hidden; }

body { 
    zoom: var(--global-zoom); 
    height: calc(100vh / var(--global-zoom)); 
    width: calc(100vw / var(--global-zoom));
    font-size: 15px !important; 
    overflow: hidden !important; 
    margin: 0; padding: 0; 
    background-color: var(--bg-body);
    font-family: 'Poppins', sans-serif !important;
    color: var(--text-main); box-sizing: border-box;
}

*, *::before, *::after { box-sizing: border-box; }
i[class*="fa-"] { font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important; font-weight: 900 !important; }

/* LOADING SPINNER */
#app-loading { position: absolute !important; inset: 0 !important; background: var(--bg-body) !important; z-index: 9999 !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; }
#app-loading::before { content: ''; width: 5rem !important; height: 5rem !important; border-radius: 50% !important; border: 5px solid rgba(48, 82, 138, 0.1) !important; border-top-color: var(--tirta-blue) !important; border-right-color: var(--tirta-red) !important; animation: tmc-spin-1 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite !important; position: absolute !important; box-shadow: 0 0 20px rgba(48, 82, 138, 0.1) !important; }
#app-loading::after { content: ''; position: absolute !important; width: calc(5rem - 10px) !important; height: calc(5rem - 10px) !important; border-radius: 50% !important; border: 4px solid transparent !important; border-top-color: var(--tirta-gold) !important; border-left-color: var(--tirta-gold) !important; animation: tmc-spin-2 0.7s linear infinite reverse !important; }
@keyframes tmc-spin-1 { to { transform: rotate(360deg); } }
@keyframes tmc-spin-2 { to { transform: rotate(360deg); } }

/* SIDEBAR */
.sidebar { 
    background: linear-gradient(160deg, #1e3661 0%, #0f172a 100%) !important; 
    width: var(--sidebar-lebar) !important; 
    position: fixed !important; top: 0 !important; bottom: 0 !important; height: 100% !important; left: 0; 
    z-index: 2000; display: flex; flex-direction: column; 
    border-radius: 0 24px 24px 0;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.08); 
    overflow: hidden !important; 
    /* 🔥 FIX 1: Tambahkan transisi 'width' biar mulus dan hitbox tombol gak nyangkut 🔥 */
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease !important; 
}
.sidebar.hide { 
    transform: translateX(-105%); 
    box-shadow: none !important;
}

.sidebar-header { 
    height: var(--topbar-tinggi); 
    display: flex; align-items: center; padding: 0 24px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.06); 
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0; 
}
.sidebar-brand-text { color: #ffffff; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.5px; margin-left: 14px; line-height: 1.1; }
.sidebar-brand-text span { color: var(--tirta-gold); font-weight: 700; display: block; font-size: 0.8rem; letter-spacing: 2.5px;} 
.sidebar-scroll { flex-grow: 1; padding: 24px 16px; overflow-y: auto; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
.menu-label { display: block; font-size: 0.65rem; font-weight: 800; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 2px; margin: 20px 0 10px 12px; }
.menu-label:first-child { margin-top: 0; }

/* MENU ITEMS PERFECTION */
.nav-item-modern { display: flex; align-items: center; padding: 11px 18px !important; color: rgba(255,255,255,0.6); text-decoration: none !important; border-radius: 14px; margin-bottom: 4px !important; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.nav-item-modern i { width: 26px; font-size: 1.15rem; text-align: center; margin-right: 12px; transition: all 0.3s ease; }
.nav-item-modern:hover { background: rgba(255, 255, 255, 0.06); color: #ffffff; transform: translateX(4px); }
.nav-item-modern:hover i { transform: scale(1.15); color: var(--tirta-gold); } 
.nav-item-modern.active { 
    background: linear-gradient(90deg, rgba(167, 135, 89, 0.85) 0%, transparent 100%); 
    color: #ffffff; 
    font-weight: 700; 
    border-left: 4px solid var(--tirta-gold);
    box-shadow: none;
    transform: translateX(6px); 
}
.nav-item-modern.active i { color: #ffffff; }

/* SIDEBAR FOOTER */
.sidebar-footer {
    margin-top: auto !important;
    padding: 15px 20px; 
    background: rgba(0, 0, 0, 0.15); 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.mini-icon-btn {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
}
.mini-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--tirta-gold);
    transform: translateY(-4px);
    border-color: rgba(167, 135, 89, 0.4);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* GLOBAL SCROLL FIX & MAIN CONTENT TRANSITION */
.main-wrapper-container {
    margin-left: var(--sidebar-lebar); height: calc(100vh / var(--global-zoom)); 
    width: calc(100vw / var(--global-zoom) - var(--sidebar-lebar)) !important;
    display: flex; flex-direction: column; background-color: var(--bg-body);
    /* 🔥 DASHBOARD SEMBUH: BUKA KUNCI SCROLL GLOBAL 🔥 */
    overflow-y: auto !important; 
    overflow-x: hidden !important; 
    transition: margin-left 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* ==========================================================================
   🔥 FIX AUTO-EXPAND KONTEN SAAT SIDEBAR MENGECIL 🔥
   ========================================================================== */
body:has(.sidebar.hide) .main-wrapper-container { 
    margin-left: var(--sidebar-mini) !important; 
    width: calc(100vw / var(--global-zoom) - var(--sidebar-mini)) !important; 
}

.content-canvas { 
    flex-grow: 1; display: flex; flex-direction: column; 
    /* 🔥 DASHBOARD SEMBUH: BEBASKAN TINGGINYA 🔥 */
    overflow: visible !important; height: auto !important; min-height: 100% !important;
    padding: 0; width: 100% !important; position: relative; 
}

/* 🚀 FIX MUTLAK GAP PUTIH LOGIN (SIBLING DETECTOR) 🚀 */
/* Kalau Sidebar Beneran Mati (Di Halaman Login), Baru Mentok Kiri 0px */
#sidebar.d-none + #mainContent {
    margin-left: 0 !important;
    width: calc(100vw / var(--global-zoom)) !important;
}

/* TOP HEADER */
.top-header {
    height: var(--topbar-tinggi);
    background: rgba(255, 255, 255, 0.8) !important; 
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 25px; flex-shrink: 0; 
    position: sticky !important; top: 0 !important; z-index: 1500; 
    margin: 0 var(--padding-x) 0 25px !important; 
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.02); border-top: none;
}

#pageTitle { margin-left: 0 !important; font-size: 1.25rem; font-weight: 800; color: var(--tirta-blue); letter-spacing: -0.5px;}

.content-canvas { flex-grow: 1; display: flex; flex-direction: column; overflow: visible !important; height: auto !important; padding: 0; width: 100% !important; position: relative; }

/* BUTTONS & DROPDOWN */
.btn-sidebar-toggle { 
    width: 40px; height: 40px; border: none; background: transparent; color: var(--tirta-blue); 
    font-size: 1.2rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); margin-right: 16px; 
    /* 🔥 FIX 2: Kasih z-index super tinggi biar tombolnya maju ke paling depan & gak ketutupan div lain 🔥 */
    position: relative; z-index: 9999; 
}
.btn-sidebar-toggle:hover { background: rgba(48, 82, 138, 0.08); color: var(--tirta-gold); transform: scale(1.05); }
.btn-header-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid var(--border-color); color: var(--text-muted); transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); cursor: pointer; font-size: 0.95rem; }
.btn-header-icon:hover { background: #ffffff; transform: translateY(-3px); box-shadow: 0 4px 10px rgba(48, 82, 138, 0.04); }
.icon-gold:hover { border-color: var(--tirta-gold); color: var(--tirta-gold); }
.icon-blue:hover { border-color: var(--tirta-blue); color: var(--tirta-blue); }
.icon-red:hover { border-color: var(--tirta-red); color: var(--tirta-red); }
.user-profile-tag { display: flex; align-items: center; gap: 12px; padding: 5px 14px 5px 5px; background: #ffffff; border: 1px solid rgba(0,0,0,0.05); border-radius: 50px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: all 0.3s ease; cursor: pointer; }
.user-profile-tag:hover { box-shadow: 0 5px 15px rgba(48, 82, 138, 0.08); border-color: rgba(48, 82, 138, 0.15); transform: translateY(-2px); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--tirta-gold) 0%, #8c714a 100%); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; box-shadow: 0 4px 10px rgba(167, 135, 89, 0.3); overflow: hidden;}
.user-text-info strong { font-size: 0.85rem; color: #1e293b; }
.user-text-info span { font-size: 0.7rem; color: #64748b; font-weight: 600; letter-spacing: 0.5px; }

/* DROPDOWN PROFIL */
.profile-dropdown-menu { 
    border-radius: 16px !important; 
    border: 1px solid var(--border-color) !important; 
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.15) !important; 
    padding: 0 !important; 
    overflow: hidden; 
    margin-top: 70px !important; 
    min-width: 280px !important; 
    display: none; 
    z-index: 9999; 
}
.dropdown-menu.show { display: block; transform-origin: top right; animation: smoothDropdown 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important; }
@keyframes smoothDropdown { 0% { opacity: 0; transform: scale(0.95) translateY(-15px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

.profile-dropdown-item { padding: 12px 20px; font-weight: 600; color: var(--text-main); display: flex; align-items: center; transition: all 0.2s; cursor: pointer; text-decoration: none; font-size: 0.85rem;}
.profile-dropdown-item:hover { background-color: #f8fafc !important; padding-left: 1.5rem !important; color: var(--tirta-red); }

/* TOMBOL GANTI FOTO PROFIL */
.btn-change-photo-badge {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 32px;
    height: 32px;
    border-radius: 50% !important; 
    background-color: #ffffff;
    color: #64748b; 
    border: 3px solid #ffffff !important; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); 
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
    outline: none;
}
.btn-change-photo-badge:hover {
    background-color: #f8fafc;
    color: var(--tirta-blue);
    transform: scale(1.1);
}

/* OVERLAY HP FULL SCREEN */
.sidebar-overlay { position: fixed; top: -50vh; left: -50vw; width: 200vw; height: 200vh; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 995; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* MINI SIDEBAR (RAIL NAVIGATION) */
:root {
    --sidebar-mini: 85px; 
}
.sidebar.hide {
    width: var(--sidebar-mini) !important;
    transform: none !important; 
    overflow: visible !important; 
}
.sidebar.hide .sidebar-scroll { overflow: visible !important; }
.sidebar.hide .sidebar-brand-text, .sidebar.hide .menu-label { display: none !important; }
.sidebar.hide .sidebar-header { padding: 0 !important; justify-content: center !important; }
.sidebar.hide .sidebar-header .d-flex { justify-content: center !important; }
.sidebar.hide .sidebar-header img { margin: 0 !important; }
.sidebar.hide .nav-item-modern {
    justify-content: center !important; padding: 0 !important;
    margin: 0 auto 10px auto !important; width: 50px !important;  height: 50px !important; 
    border-radius: 14px !important; border-left: none !important; transform: none !important;
    position: relative; overflow: visible !important;
}
.sidebar.hide .nav-item-modern i { margin: 0 !important; width: auto !important; font-size: 1.4rem !important; }
.sidebar.hide .nav-item-modern.active {
    background: linear-gradient(135deg, var(--tirta-gold) 0%, #8c714a 100%) !important;
    box-shadow: 0 4px 15px rgba(167, 135, 89, 0.4) !important;
}
.sidebar.hide .sidebar-footer {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    flex-direction: column !important; 
    align-items: center !important;
    padding: 15px 0 !important; 
    gap: 10px !important;
    background: rgba(0, 0, 0, 0.25) !important; /* Ditebelin dikit warnanya biar elegan */
    z-index: 100 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.sidebar.hide .mini-icon-btn {
    width: 42px !important; 
    height: 42px !important; 
    margin: 0 !important;
}

.sidebar.hide .sidebar-scroll {
    padding-bottom: 140px !important; 
}

/* FLOATING TOOLTIPS UNTUK MINI SIDEBAR */
.sidebar.hide .nav-text {
    display: block !important; 
    position: absolute; left: 70px;
    background: #1e293b; color: #ffffff;
    padding: 6px 12px; border-radius: 8px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap;
    opacity: 0; visibility: hidden; transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    pointer-events: none; z-index: 99999;
}
.sidebar.hide .nav-text::before {
    content: ''; position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
    border-width: 5px 5px 5px 0; border-style: solid; border-color: transparent #1e293b transparent transparent;
}
.sidebar.hide .nav-item-modern:hover .nav-text {
    opacity: 1; visibility: visible; transform: translateX(0);
}
.sidebar.hide .mini-icon-btn::after {
    content: attr(title); position: absolute; left: 60px;
    background: #1e293b; color: #fff; padding: 6px 12px; border-radius: 8px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap;
    opacity: 0; visibility: hidden; transform: translateX(-10px); transition: all 0.3s ease;
    z-index: 99999; pointer-events: none; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.sidebar.hide .mini-icon-btn::before {
    content: ''; position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
    border-width: 5px 5px 5px 0; border-style: solid; border-color: transparent #1e293b transparent transparent;
    opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 99999;
}
.sidebar.hide .mini-icon-btn:hover::after,
.sidebar.hide .mini-icon-btn:hover::before {
    opacity: 1; visibility: visible; transform: translateX(0);
}

/* SMART DIVIDER */
.sidebar.hide .menu-label {
    display: block !important;
    color: transparent !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 15px 20px 15px 20px !important;
    padding: 0 !important;
    overflow: hidden;
    letter-spacing: 0;
}

/* ANIMASI PAGE TRANSITION */
@keyframes smoothSlideUp {
    0% { opacity: 0; transform: translateY(35px) scale(0.99); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.page-transition-active {
    animation: smoothSlideUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.3); border-radius: 10px; border: 2px solid var(--bg-body); }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.6); }

/* SKELETON SHIMMER LOADING */
.skeleton-box { display: inline-block; height: 1em; position: relative; overflow: hidden; background-color: #e2e8f0; border-radius: 6px; width: 100%; }
.skeleton-box::after { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: translateX(-100%); background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.6) 20%, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0)); animation: shimmer 1.5s infinite; content: ''; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-card { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px; border: 1px solid #f1f5f9; }

/* FIX MODAL & Z-INDEX (DIPERKUAT) */
.modal-backdrop { display: none !important; }
.modal { background: rgba(15, 23, 42, 0.7) !important; backdrop-filter: blur(4px); z-index: 100000 !important; }
.modal-content { box-shadow: 0 15px 50px rgba(0,0,0,0.3) !important; border: none; }

/* MOBILE RESPONSIVE */
@media (max-width: 991.98px) {
    :root { --global-zoom: 1 !important; --padding-x: 12px !important; --topbar-tinggi: 52px !important; }
    * { -webkit-tap-highlight-color: transparent !important; }
    body, html { zoom: 1 !important; overflow-x: clip !important; background-color: var(--bg-body) !important; font-size: 12px !important; }
    ::-webkit-scrollbar { display: none !important; }
    * { scrollbar-width: none !important; }

    .sidebar, .sidebar-overlay { display: none !important; }
    
    .main-wrapper-container { 
        margin-left: 0 !important; width: 100vw !important; height: auto !important; min-height: 100vh !important;
        padding-bottom: 100px !important; 
        /* 🔥 TAMBAHIN INI BIAR KONTEN GAK KETABRAK HEADER 🔥 */
        padding-top: calc(var(--topbar-tinggi) + env(safe-area-inset-top)) !important; 
        display: block !important; overflow: visible !important;
    }
    
    .top-header { 
        /* 🔥 GANTI JADI FIXED & TAMBAH LEFT RIGHT 🔥 */
        position: fixed !important; 
        top: 0 !important; 
        left: 0 !important; 
        right: 0 !important; 
        width: 100% !important;
        z-index: 2000 !important; 
        height: calc(var(--topbar-tinggi) + env(safe-area-inset-top)) !important;
        padding: env(safe-area-inset-top) 16px 0 16px !important; margin: 0 !important;
        background: rgba(255, 255, 255, 0.98) !important; backdrop-filter: blur(15px) !important; -webkit-backdrop-filter: blur(15px) !important;
        border-radius: 0 0 20px 20px !important; border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }
    #pageTitle, .top-header .d-none.d-lg-flex { display: none !important; }
    .top-header > div.justify-content-end { width: 100%; display: flex; justify-content: space-between !important; flex-wrap: nowrap !important; }
    
    .btn-header-icon { width: 32px !important; height: 32px !important; font-size: 0.8rem !important; }
    .user-profile-tag { padding: 4px !important; border: none !important; box-shadow: none !important; background: transparent !important;}
    .user-text-info { display: none !important; }
    .user-avatar { width: 28px !important; height: 28px !important; font-size: 0.75rem !important; }

    /* MOBILE BOTTOM NAV (VERSI BIRU ELEGAN) */
    .mobile-bottom-nav {
        position: fixed !important; bottom: 0 !important; left: 0 !important; width: 100% !important;
        /* 🔥 Background Biru Navy Gradient 🔥 */
        background: linear-gradient(160deg, #1e3661 0%, #0f172a 100%) !important; 
        box-shadow: 0 -5px 25px rgba(0,0,0,0.2) !important;
        display: flex !important; justify-content: space-around !important; align-items: center !important;
        padding: 12px 5px calc(8px + env(safe-area-inset-bottom)) 5px !important; 
        z-index: 2500 !important;
        border-top-left-radius: 24px !important; border-top-right-radius: 24px !important;
        border-top: 1px solid rgba(255,255,255,0.05) !important;
    }
    
    .m-nav-item { 
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; 
        color: rgba(255, 255, 255, 0.4) !important; 
        font-size: 9px !important; font-weight: 600; cursor: pointer; 
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important; gap: 4px;
    }
    
    .m-nav-item i { font-size: 18px !important; margin: 0 !important; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
    
    .m-nav-item.active { 
        color: #ffffff !important; 
        font-weight: 800;
    }
    .m-nav-item.active i { 
        color: var(--tirta-gold) !important; 
        transform: translateY(-3px) scale(1.15) !important; 
    }

    /* 👇👇 INI KODINGAN LU YANG AMAN, JANGAN DIHAPUS 👇👇 */
    .modal-dialog:not(.modal-dialog-centered) { display: flex !important; align-items: flex-end !important; min-height: 100% !important; margin: 0 !important; padding: 0 !important; }
    .modal-content { border-radius: 24px 24px 0 0 !important; max-height: 90vh !important; overflow-y: auto !important; border: none !important; }
    .modal-header::before { content: ''; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 40px; height: 4px; background: #cbd5e1; border-radius: 10px; }
    .modal-header { padding-top: 24px !important; position: relative; }
    
    .sch-loading-overlay, #app-loading {
        position: fixed !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100vw !important; height: 100vh !important; z-index: 99999999 !important;
        display: flex !important; justify-content: center !important; align-items: center !important;
        background: rgba(255, 255, 255, 0.8) !important; backdrop-filter: blur(5px) !important; margin: 0 !important; padding: 0 !important;
    }
}

/* READ-ONLY MODE */
body.read-only-mode .tmc-primary-btn, 
body.read-only-mode .btn-edit, 
body.read-only-mode .btn-delete, 
body.read-only-mode .btn-update, 
body.read-only-mode #btnDetailDelete, 
body.read-only-mode .v-btn, 
body.read-only-mode #ua-gap-section button, 
body.read-only-mode #uploadDropzoneBox, 
body.read-only-mode .card-admin-controls, 
body.read-only-mode .btn-change-photo-badge 
{
    display: none !important;
    pointer-events: none !important;
}
body.read-only-mode [ondblclick] { cursor: default !important; }

/* ULTRA-MODERN SWEETALERT */
.swal2-container { zoom: 1 !important; } 
.swal2-container.swal2-backdrop-show:not(.swal2-top-end) { 
    background: rgba(15, 23, 42, 0.6) !important; 
    backdrop-filter: blur(4px) !important; 
    z-index: 100005 !important; 
}
.swal2-container.swal2-top-end { background: transparent !important; backdrop-filter: none !important; }
.swal2-popup:not(.swal2-toast) { 
    width: 320px !important; 
    padding: 1.5rem 1.2rem 1.2rem !important; 
    border-radius: 20px !important; 
    background: #ffffff !important; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.15) !important; 
    border: 1px solid rgba(48,82,138,0.05) !important; 
}
.swal2-title { font-family: 'Poppins', sans-serif !important; font-size: 1.1rem !important; font-weight: 800 !important; color: #1e293b !important; margin: 0 0 0.4rem 0 !important; padding: 0 !important; letter-spacing: -0.3px !important; }
.swal2-html-container { font-family: 'Poppins', sans-serif !important; font-size: 0.85rem !important; font-weight: 500 !important; color: #64748b !important; margin: 0 !important; line-height: 1.4 !important; }
.swal2-icon { width: 4rem !important; height: 4rem !important; margin: 0 auto 1rem !important; border: none !important; }
.swal2-icon.swal2-success, .swal2-icon.swal2-info { border-color: var(--tirta-blue) !important; color: var(--tirta-blue) !important; }
.swal2-icon.swal2-success [class^=swal2-success-line] { background-color: var(--tirta-blue) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border: 4px solid rgba(48, 82, 138, 0.2) !important; }
.swal2-icon.swal2-error { border-color: var(--tirta-red) !important; color: var(--tirta-red) !important; }
.swal2-icon.swal2-error [class^=swal2-x-mark-line] { background-color: var(--tirta-red) !important; }
.swal2-icon.swal2-warning { border-color: var(--tirta-gold) !important; color: var(--tirta-gold) !important; }
.swal2-actions { margin-top: 1.2rem !important; gap: 8px !important; width: 100% !important; padding: 0 !important; }
.swal2-confirm, .swal2-cancel {
    font-family: 'Poppins', sans-serif !important; font-size: 0.85rem !important; font-weight: 700 !important;
    border-radius: 12px !important; padding: 10px !important; min-height: 42px !important; margin: 0 !important;
    flex: 1 !important; transition: all 0.2s ease !important; box-shadow: none !important; border: none !important;
}
.swal2-styled.swal2-confirm:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.15) !important; filter: brightness(1.1); }
.swal2-styled.swal2-cancel { background: #f1f5f9 !important; color: #64748b !important; }
.swal2-styled.swal2-cancel:hover { background: #e2e8f0 !important; color: #1e293b !important; transform: translateY(-2px) !important; }

/* ==========================================================================
   STANDBY / LOCK SCREEN UI
   ========================================================================== */
#standbyLockScreen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(244, 246, 249, 0.6);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    z-index: 9999999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
}
#standbyLockScreen.active {
    opacity: 1; visibility: visible;
}
.lock-card {
    background: #ffffff; padding: 40px; border-radius: 24px;
    box-shadow: 0 20px 50px rgba(48, 82, 138, 0.15); border: 1px solid #e2e8f0;
    text-align: center; max-width: 380px; width: 90%;
    transform: translateY(20px); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#standbyLockScreen.active .lock-card {
    transform: translateY(0);
}
.lock-avatar {
    width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 20px auto;
    background: linear-gradient(135deg, var(--tirta-blue) 0%, #1e3a68 100%);
    color: white; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; border: 4px solid #f8fafc;
    box-shadow: 0 8px 20px rgba(48, 82, 138, 0.2); overflow: hidden;
}

/* ==========================================================================
   🔥 FIX MODAL & DATEPICKER KETINDIHAN (Z-INDEX OVERRIDE) 🔥
   ========================================================================== */
.flatpickr-calendar,
.datepicker,
.datepicker-dropdown,
.daterangepicker,
.ui-datepicker {
    z-index: 100055 !important; 
}
/* 🔥 FIX SWEETALERT NGUMPET DI BELAKANG MODAL BOOTSTRAP 🔥 */
.swal2-container {
    z-index: 9999999 !important;
}