/* =========================================
   0. FORCE NO ZOOM (ANTI-CUBIT)
   ========================================= */
html, body {
    /* touch-action: manipulation mencegah double-tap zoom tapi tetap mengizinkan scroll & pan */
    touch-action: manipulation; 
    
    /* Mencegah iOS mengubah ukuran text otomatis */
    -webkit-text-size-adjust: 100%; 
    
    /* Mencegah scroll ke samping */
    overflow-x: hidden;

    /* JANGAN PAKAI height: 100%; karena ini yang bikin macet scroll */
}

/* =========================================
   1. GLOBAL & DESKTOP STYLES
   ========================================= */
body {
    background-color: #f9fbfd;
}

/* Jarak antar modul/baris */
.gap-row { margin-bottom: 30px; }

/* Style untuk Card Stats agar seragam */
.card { border: none; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
.stat-card { 
    transition: all 0.3s; 
    margin-bottom: 20px; 
    border: none; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); 
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }

/* Icon bulat pada dashboard */
.card-stat-icon { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: white; font-size: 20px; }

/* Warna Background Icon Custom */
.bg-purple { background-color: #6f42c1; }
.bg-gray { background-color: #6c757d; }
.bg-brown { background-color: #795548; }
.bg-blue { background-color: #007bff; }
.bg-green { background-color: #28a745; }
.bg-red { background-color: #dc3545; }

/* Warna Icon Soft */
.bg-purple-soft { background-color: #8e8eeb; }
.bg-gray-soft { background-color: #8590a5; }
.bg-brown-soft { background-color: #7b634d; }
.bg-blue-soft { background-color: #62c2e8; }
.bg-green-soft { background-color: #6cdca2; }
.bg-red-soft { background-color: #f57f7f; }

/* Header Customization */
.header .logo h4 { letter-spacing: 1px; color: #333; }

/* Search Bar Desktop di Header */
.header-search-bar {
    flex-grow: 1;
    max-width: 600px;
    margin: 0 30px;
}
.header-search-bar .input-group-text {
    background-color: #1a237e;
    border-color: #1a237e;
    color: white;
}

/* =========================================
   2. MOBILE SPECIFIC STYLES
   ========================================= */

/* Bottom Navigation (Hanya muncul di Mobile) */
.mobile-bottom-nav {
    display: none; /* Default hidden di desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: #ffffff;
    border-top: 1px solid #edf2f9;
    z-index: 1050;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9aa5b9;
    font-size: 11px;
    text-decoration: none !important;
    width: 20%;
}

.mobile-nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
    color: #9aa5b9;
}

/* Highlight item tengah (Active/Home) */
.mobile-nav-item.active-center i { color: #ffffff; }
.mobile-nav-item.active-center { position: relative; }
.mobile-nav-item.active-center::before {
    content: '';
    position: absolute;
    top: -25px;
    width: 55px;
    height: 55px;
    background-color: #1a237e;
    border-radius: 50%;
    z-index: -1;
    box-shadow: 0 4px 10px rgba(26, 35, 126, 0.4);
}

/* Style Alert Info Mobile */
.info-alert-mobile {
    background-color: #e3f2fd;
    border: none;
    border-radius: 8px;
    padding: 15px;
}
.info-alert-mobile .alert-heading {
    color: #1565c0;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}
.info-alert-mobile p {
    color: #5e7e9b;
    font-size: 12px;
    line-height: 1.5;
}

/* =========================================
   3. MEDIA QUERIES (RESPONSIVE RULES)
   ========================================= */

@media (min-width: 992px) {
    .mobile-only-view { display: none !important; }
}

@media (max-width: 991px) {
    /* --- Tampilan MOBILE --- */
    
    /* 1. Tampilkan Bottom Nav */
    .mobile-bottom-nav { display: flex; }
    
    /* 2. Sembunyikan Sidebar & Elemen Desktop */
    .side-nav, .desktop-toggle, .mobile-toggle, .header-search-bar { display: none !important; }
    
    /* 3. Padding Halaman Utama */
    .page-container { padding-left: 0 !important; }
    
    .main-content { 
        padding-top: 110px !important; /* Jarak aman dari header */
        padding-left: 15px !important;
        padding-right: 15px !important;
        padding-bottom: 80px !important;
    }
    
    /* 4. PERBAIKAN EXTRA: JARAK ANTAR MODUL (CARD) */
    /* Target kolom grid (col-6) agar jarak antar baris grid lebih lebar */
    .col-6 {
        margin-bottom: 15px !important; /* Tambahan jarak pada container kolom */
    }

    .stat-card {
        margin-bottom: 20px !important; /* Tambahan jarak pada kartu itu sendiri */
        height: 100%; /* Pastikan tinggi kartu sama */
    }
    
    /* 5. Header Mobile Adjustment */
    .header .nav-wrap { justify-content: flex-end; } 
    
    /* 6. Logo Mobile */
    .header .logo { 
        display: flex !important;      
        align-items: center !important; 
        width: auto !important;        
        height: 70px;                  
        padding-left: 15px; 
        border: none !important;       
    }
    .header .logo img {
        max-height: 55px !important;   
        width: auto;                   
        object-fit: contain;           
    }
    
    /* Sembunyikan Footer Desktop */
    .footer { display: none; }
    
    /* Tampilkan elemen khusus mobile */
    .mobile-only-view { display: block; }
}