body {
    font-family: 'Nunito', sans-serif;
    background-color: #f2f7fb;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Top Navbar Customization */
.top-navbar {
    background-color: #1a233a;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: relative;
    z-index: 10000; /* Menjaga navbar tetap berada di atas elemen manapun */
}
.brand-zone {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Toggler Burger Menu (Kustom Responsif) */
.burger-btn-wrapper {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}
.burger-btn-wrapper:hover {
    opacity: 0.8;
}

.brand-title {
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.2;
    letter-spacing: 0.5px;
}
.brand-title span {
    color: #ffc107;
    display: block;
    font-size: 0.8rem;
}
.brand-logo {
    height: 45px; /* Disesuaikan agar proporsional di dalam navbar 60px */
    width: 45px;
    object-fit: contain;
}

/* Main Layout Configuration */
.wrapper {
    display: flex;
    height: calc(100vh - 60px); /* Presisi memotong tinggi navbar agar tidak overflow script body */
    width: 100vw;
    position: relative;
}

/* Tombol Command Centre */
.custom-btn-cc {
    font-size: 0.75rem; 
    border-radius: 6px;
    pointer-events: none;
}

/* Wrapper Avatar Polda Lampung (Kanan Atas) */
.polda-avatar-wrapper {
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background-color: transparent;
    border-radius: 50%;
    overflow: hidden;
}
.polda-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Sidebar Width Managed to 245px */
.sidebar-panel {
    width: 245px;
    background-color: #fff;
    border-right: 1px solid #e3e3e3;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
    padding: 15px;
    position: relative;
}

/* Tombol Close (X) di Dalam Sidebar Menu */
.sidebar-close-btn {
    display: none; /* Default sembunyi di Desktop PC */
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #252e3e;
    margin-bottom: 15px;
}
.section-divider {
    border-top: 1px solid #ebebeb;
    margin: 15px 0;
}

/* Styling Blok Header Filter */
.filter-header-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #252e3e;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.filter-header-block .bulk-action-links {
    display: flex;
    align-items: center;
}
.filter-header-block .bulk-action-links a {
    font-size: 0.72rem;
    transition: color 0.2s ease;
}
.filter-header-block .bulk-action-links a:hover {
    text-decoration: underline !important;
}
.filter-header-block .bulk-action-links span {
    font-size: 0.72rem;
    margin: 0 8px;
    opacity: 0.6;
}

/* Custom Checkbox & Badges Alignment */
.filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #435ebe;
    font-weight: 600;
}
.filter-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.badge-count {
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: 10px;
}

/* Subdomain Node List */
.subdomain-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 6px;
    padding: 4px 0;
}
.subdomain-name {
    color: #4f5d73;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* Map Canvas Workspace */
.map-container {
    flex-grow: 1;
    position: relative;
    height: 100%;
}
#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Status Panel Top Right */
.floating-status-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 999;
    background: #1a233a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}
.status-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}
.status-location span {
    font-weight: 400;
    font-size: 0.75rem;
    color: #a0aec0;
    display: block;
}

/* Container Utama Card Statistik Melayang */
.floating-stats-bar {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 999;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    max-width: calc(100% - 380px);
}
.stats-card-mini {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 180px;
}
.stats-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.bg-primary-soft { background-color: rgba(67, 94, 190, 0.15); }
.bg-success-soft { background-color: rgba(25, 135, 84, 0.15); }
.bg-danger-soft  { background-color: rgba(220, 53, 69, 0.15); }

.stats-info {
    display: flex;
    flex-direction: column;
}
.stats-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #252e3e;
    line-height: 1.2;
}
.stats-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #7c8db5;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Styling Tabel Khusus Popup Standar Command Center */
.popup-cc-container {
    min-width: 220px;
    font-family: 'Nunito', sans-serif;
}
.popup-cc-header {
    background-color: #1a233a;
    color: #fff;
    padding: 6px 10px;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 4px 4px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.table-popup-stats {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.8rem;
}
.table-popup-stats td {
    padding: 4px 2px;
    color: #4f5d73;
}
.table-popup-stats .stat-title {
    font-weight: 700;
}
.table-popup-stats .stat-value {
    text-align: right;
    font-weight: 800;
    color: #252e3e;
}
.progress-popup-bar {
    height: 6px;
    border-radius: 3px;
    background-color: #e9ecef;
    overflow: hidden;
    margin-top: 4px;
}

/* ==========================================================================
   INTERFACES RESPONSIVE RULES (SINKRONISASI TOTAL KUSTOM GRID)
   ========================================================================== */

/* 1. Pengaturan Tampilan Khusus PC Desktop / Monitor Besar */
@media screen and (min-width: 992px) {
    .burger-btn-wrapper {
        display: none !important; /* Tombol burger musnah di PC */
    }
    .sidebar-panel {
        display: flex !important;
        left: 0 !important;
    }
}

/* 2. Pengaturan Tampilan Khusus Ponsel & Tablet */
@media screen and (max-width: 991.9px) {
    
/* 1. KITA AKTIFKAN KEMBALI JUDUL DI MOBILE */
    .brand-title {
        display: block !important;
        font-size: 0.85rem !important; /* Diperkecil dari 1.1rem agar pas di layar HP */
        color: #ffffff;
        cursor: pointer;
        user-select: none;
    }
    
    .brand-title span {
        font-size: 0.65rem !important; /* Diperkecil dari 0.8rem */
        display: inline-block; /* Diubah ke inline-block agar teksnya memanjang ke samping jika ruang cukup */
        margin-left: 4px;
    }

    .brand-logo {
        height: 35px; /* Sedikit diperkecil di mobile */
        width: 35px;
    }

    /* Transformasi Sidebar Menjadi Model Laci Slider (Drawer Layer) */
    .sidebar-panel {
        position: absolute;
        top: 0;
        left: -245px; /* Sembunyikan total di area kiri luar frame viewport */
        height: 100%;
        z-index: 9999;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.25);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Aktif Bergeser ke Kanan saat Tombol Burger Diketuk */
    .sidebar-panel.active {
        left: 0 !important;
    }

    /* Memunculkan Icon Silang (X) Penutup */
    .sidebar-close-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        font-size: 1.3rem;
        color: #dc3545;
        cursor: pointer;
        z-index: 10001;
    }

    /* Map Menyesuaikan Skala Fullscreen Mobile */
    .map-container {
        width: 100vw !important;
    }

    /* Menggeser Panel Jam & Tanggal Ke Bawah Jika di HP Agar Tidak Menutup Statistik */
    .floating-status-panel {
        top: auto;
        bottom: 20px;
        right: 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }

    /* Mengatur Flexbox Card Statistik agar Turun Kebawah (*Stacking Layout*) */
    .floating-stats-bar {
        top: 15px;
        left: 15px;
        right: 15px;
        max-width: 100%;
        gap: 8px;
    }
    .stats-card-mini {
        flex: 1 1 100%; /* Memaksa tiap card berukuran penuh selebar HP */
        min-width: 0;
        padding: 8px 12px;
    }
}