/* ================================================
   SIMADA MASTERPIECE UI - FINAL RESPONSIVE FIX
   ================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* --- DIMENSIONS --- */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --transition-speed: 0.3s;

    /* --- COLORS --- */
    --bs-primary: #0d6efd;
    --bs-body-bg: #f4f6f9; 
    --dark-blue: #1e293b; 
    --sidebar-text: #94a3b8;
    --sidebar-active: #fff;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
}

/* =========================================
   1. GLOBAL RESET & BASE
   ========================================= */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bs-body-bg);
    color: #334155;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* Custom Scrollbar yang halus */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* =========================================
   2. SIDEBAR (KIRI - FIXED)
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 1040;
    background-color: var(--dark-blue);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
    overflow-y: auto;
}

/* Menu Links */
.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 12px 16px;
    margin: 4px 12px;
    border-radius: 8px;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    margin-right: 12px;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-active);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(13,110,253,0.15) 0%, rgba(13,110,253,0) 100%);
    color: #60a5fa; /* Light Blue Text */
    border-left: 3px solid #60a5fa;
    border-radius: 4px 8px 8px 4px;
}


/* =========================================
   3. MAIN LAYOUT (KANAN)
   ========================================= */
.main-container {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-speed) ease;
}

/* Navbar Glassmorphism */
.navbar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* Content Area - DESKTOP */
.main-content {
    flex: 1; 
    /* UBAH DARI 2rem MENJADI 1.25rem ATAU 1rem */
    padding: 0.5rem; 
    
    /* Opsional: Pastikan lebar maksimal tidak dibatasi */
    width: 100%;
    max-width: 100%;
}

/* Footer Sticky */
footer {
    background: #fff;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
    margin-top: auto; 
}


/* =========================================
   4. COMPONENTS (BENTO UI)
   ========================================= */
.card {
    border: none;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* Tabel yang lebih rapi */
.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem;
}
.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}


/* =========================================
   5. MOBILE RESPONSIVE (BREAKPOINT 992px)
   ========================================= */
@media (max-width: 991.98px) {
    
    /* A. SIDEBAR & NAVIGASI */
    .sidebar {
        transform: translateX(-100%); /* Sembunyi default */
    }
    .sidebar.show {
        transform: translateX(0); /* Muncul saat toggle */
    }
    .main-container {
        margin-left: 0; /* Full width */
    }

    /* B. HEADER & OVERLAY */
    .navbar-glass {
        padding: 0.5rem 1rem; /* Navbar lebih ringkas */
    }
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 1035;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* C. KONTEN UTAMA (FIX JARAK KIRI-KANAN) */
    .main-content {
        /* Mengurangi padding drastis di HP agar tabel muat */
        padding: 1rem 0.8rem !important; 
    }

    /* D. CARD PADDING DI HP */
    .card-body {
        padding: 1rem; /* Mengurangi padding dalam kartu */
    }

    /* E. TABEL DI HP */
    .table thead th, 
    .table tbody td {
        padding: 0.75rem 0.5rem; /* Tabel lebih rapat */
        font-size: 0.85rem; /* Font sedikit lebih kecil */
    }
}


/* =========================================
   6. DARK MODE SUPPORT
   ========================================= */
[data-bs-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .navbar-glass,
[data-bs-theme="dark"] footer {
    background-color: #1e293b;
    border-color: rgba(255,255,255,0.05);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #334155;
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}