/* =========================================
   1. RESET & GLOBAL STYLE
   ========================================= */
body { 
    font-family: 'Poppins', sans-serif; 
    background-color: #f4f7fe; 
    margin: 0; 
    padding: 0; 
    overflow-x: hidden; 
    color: #333;
}

a { text-decoration: none; }

/* Scrollbar Keren */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(17, 28, 67, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(17, 28, 67, 0.5); }

/* =========================================
   2. SIDEBAR (TAMPILAN DESKTOP)
   ========================================= */
.sidebar {
    width: 260px; 
    height: 100vh; 
    background: #111c43; 
    color: #a3aed1;
    position: fixed; 
    top: 0; 
    left: 0; 
    z-index: 1000;
    display: flex; 
    flex-direction: column; 
    transition: 0.3s;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
    overflow-y: auto;
}

.sidebar-brand { 
    padding: 25px; 
    font-size: 1.3rem; 
    font-weight: 700; 
    color: #fff; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    display: flex; 
    align-items: center; 
    gap: 10px;
}

.sidebar-user {
    padding: 15px 20px; 
    margin: 20px 15px;
    background: rgba(255,255,255,0.05); 
    border-radius: 15px;
    display: flex; 
    align-items: center; 
    gap: 15px;
    text-decoration: none; 
    transition: 0.3s; 
    border: 1px solid transparent;
    color: inherit;
}
.sidebar-user:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); color: #fff; }
.sidebar-user img { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.2); }

.user-info h6 { color: #fff; margin: 0; font-size: 0.9rem; font-weight: 600; }
.user-info span { font-size: 0.75rem; color: #6c7fbf; }

.sidebar-menu { padding: 0 15px; flex-grow: 1; }
.menu-header { font-size: 0.7rem; text-transform: uppercase; color: #586896; margin: 20px 0 10px 10px; font-weight: 700; letter-spacing: 1px; }

.nav-link {
    display: flex; align-items: center; color: #a3aed1;
    padding: 12px 20px; margin-bottom: 5px; border-radius: 12px;
    text-decoration: none; transition: 0.3s; font-weight: 500; font-size: 0.95rem;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: #fff; transform: translateX(5px); }
.nav-link.active { background: linear-gradient(45deg, #4361ee, #3f37c9); color: #fff; box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4); }
.nav-link i { width: 25px; text-align: center; margin-right: 10px; font-size: 1.1rem; }

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.05); margin-top: auto; }
.btn-logout {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px; border-radius: 12px;
    background: rgba(239, 68, 68, 0.1); color: #ef4444;
    font-weight: 700; text-decoration: none; transition: 0.3s;
}
.btn-logout:hover { background: #ef4444; color: #fff; }

/* =========================================
   3. MAIN CONTENT (LAYOUT)
   ========================================= */
.main-content { 
    margin-left: 260px; 
    padding: 30px; 
    transition: 0.3s; 
    min-height: 100vh; 
}

/* Header Desktop */
.desktop-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 30px; background: white; padding: 20px; 
    border-radius: 15px; box-shadow: 0 5px 20px rgba(0,0,0,0.03); 
}

/* Kartu Statistik & Menu */
.stat-card {
    background: white; border-radius: 20px; padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03); border: 1px solid #f0f0f0;
    display: block; text-decoration: none; color: inherit;
    transition: transform 0.2s; height: 100%; position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-5px); border-color: #4361ee; }

.icon-box {
    width: 55px; height: 55px; border-radius: 15px; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 1.6rem; margin-bottom: 15px;
}

/* Kartu Grafik/Tabel */
.card-box, .card-chart, .card-table { 
    background: white; border-radius: 20px; padding: 25px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.03); border: 1px solid #f0f0f0; 
    height: 100%;
}

/* Tabel */
.table thead th { background: #f8f9fa; border: none; padding: 12px; font-weight: 600; color: #6c757d; }
.table tbody td { padding: 12px; border-bottom: 1px solid #f1f1f1; vertical-align: middle; }

/* =========================================
   4. RESPONSIVE MOBILE (HP)
   ========================================= */
@media (max-width: 991px) {
    /* Sembunyikan Sidebar & Header Desktop */
    .sidebar { display: none !important; }
    .desktop-header { display: none !important; }
    
    /* Reset Margin Konten */
    .main-content { margin-left: 0 !important; padding: 0 !important; width: 100%; }
    .content-area { padding: 0 20px 80px 20px; position: relative; z-index: 2; }
    
    /* Header Mobile (App-like) */
    .mobile-header {
        display: block !important;
        background: linear-gradient(135deg, #111c43 0%, #2a3d7c 100%);
        padding: 30px 20px 90px 20px;
        border-bottom-left-radius: 30px; 
        border-bottom-right-radius: 30px;
        color: white; margin-bottom: -60px; 
        position: relative; z-index: 1;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    }
    
    /* Tombol Logout Mobile */
    .btn-logout-mobile {
        background: rgba(255,255,255,0.2); color: white; border: none;
        width: 40px; height: 40px; border-radius: 12px;
        display: flex; align-items: center; justify-content: center;
        text-decoration: none; backdrop-filter: blur(5px);
    }
    
    /* Fix Tinggi Chart di HP */
    .chart-container-mobile { height: 250px !important; }
}

/* Sembunyikan Mobile Header di Desktop */
@media (min-width: 992px) {
    .mobile-header { display: none !important; }
}