/* =========================================
   STYLE.CSS - TEMA GLASSMORPHISM ELEGAN
   ========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body { 
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    /* Latar Belakang Gradien Mewah */
    background: linear-gradient(135deg, #74ebd5 0%, #9face6 100%);
    background-attachment: fixed;
    color: #1f2937;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden; 
}

/* =========================================
   KUNCI PERBAIKAN LAYOUT (SMART LAYOUT)
   ========================================= */
.main-content {
    margin-left: 260px; /* Mendorong konten ke kanan sejauh lebar sidebar PC */
    padding: 30px; /* Memberikan ruang napas di sekeliling layar */
    transition: margin-left 0.3s ease;
}

/* --- EFEK KACA UTAMA (CONTAINER) --- */
.container { 
    background: rgba(255, 255, 255, 0.45); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6); 
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15); 
    
    padding: 35px 40px; 
    border-radius: 16px; 
    
    width: 100%;
    max-width: 1600px; 
    margin: 0 auto; 
    min-height: 85vh;
}

h2 {
    color: #1e3a8a; 
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

/* --- TOMBOL (BUTTONS) --- */
.btn { 
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; 
    text-decoration: none; 
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-tambah { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; margin-bottom: 20px; }
.btn-tambah:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3); }

.btn-edit { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; padding: 8px 14px; font-size: 13px;}
.btn-edit:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3); }

.btn-hapus { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #fff; padding: 8px 14px; font-size: 13px;}
.btn-hapus:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3); }

/* --- TABEL TEMA KACA --- */
table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0;
    margin-top: 15px; 
    border-radius: 12px;
    overflow: hidden; 
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

th, td { 
    padding: 15px 18px; 
    text-align: left; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

th { 
    background-color: rgba(255, 255, 255, 0.6); 
    color: #1e293b; 
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(255, 255, 255, 0.75); }

/* --- PENYESUAIAN DATATABLES AGAR MENYATU --- */
.dataTables_wrapper { margin-top: 20px; }
.dataTables_wrapper .dataTables_length select, 
.dataTables_wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    transition: 0.3s;
    color: #1e293b;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 8px !important;
    font-weight: 600;
}

/* =========================================
   SIDEBAR MENU (KIRI) - PREMIUM DARK & DROPDOWN
   ========================================= */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh; width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e3a8a 100%);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1); 
    display: flex; flex-direction: column;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    z-index: 10000;
}

.sidebar-brand {
    padding: 24px; font-size: 19px; font-weight: 800; color: #ffffff;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); letter-spacing: -0.3px; position: relative;
}
.sidebar-brand svg { color: #60a5fa; filter: drop-shadow(0 2px 4px rgba(96, 165, 250, 0.3)); }

.menu-label { padding: 24px 24px 10px; font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 1.2px; }

/* Tombol Close HP */
.btn-close-sidebar {
    display: none; position: absolute; right: 15px; background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2); width: 32px; height: 32px;
    border-radius: 8px; color: #f8fafc; font-weight: bold; cursor: pointer;
    align-items: center; justify-content: center; transition: all 0.2s; backdrop-filter: blur(5px);
}
.btn-close-sidebar:hover { background: rgba(239, 68, 68, 0.8); border-color: #ef4444; color: white;}

/* Area Menu List */
.sidebar-menu { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

/* Link & Tombol Akordeon (Dropdown) */
.sidebar-menu a.nav-link, .dropdown-btn {
    display: flex; align-items: center; gap: 12px; padding: 12px 18px; margin: 4px 16px;
    color: #cbd5e1; text-decoration: none; font-size: 14.5px; font-weight: 500;
    border-radius: 8px; border-left: 4px solid transparent; transition: all 0.2s ease-in-out;
    background: transparent; border-top: none; border-right: none; border-bottom: none;
    width: calc(100% - 32px); font-family: inherit; cursor: pointer; text-align: left;
}
/* === KODE SAKTI ANTI-ERROR DI HP === */
.dropdown-btn * {
    pointer-events: none; 
}
/* =================================== */
.dropdown-btn { justify-content: space-between; }
.dropdown-btn .menu-left { display: flex; align-items: center; gap: 12px; }
.sidebar-menu a.nav-link svg, .dropdown-btn svg { transition: all 0.2s ease-in-out; color: #94a3b8; }

/* Animasi Panah Dropdown */
.dropdown-btn .chevron { width: 16px; height: 16px; transition: transform 0.3s ease; }
.dropdown-btn.open .chevron { transform: rotate(180deg); color: #ffffff; }

/* Efek Sorot & Aktif */
.sidebar-menu a.nav-link:hover, .dropdown-btn:hover { background: rgba(255, 255, 255, 0.05); color: #ffffff; border-left-color: #93c5fd; }
.sidebar-menu a.nav-link:hover svg, .dropdown-btn:hover svg { color: #ffffff; }

.sidebar-menu a.aktif, .dropdown-btn.aktif {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, transparent 100%);
    color: #ffffff; font-weight: 700; border-left-color: #3b82f6;
}
.sidebar-menu a.aktif svg, .dropdown-btn.aktif svg { color: #60a5fa; filter: drop-shadow(0 0 5px rgba(96,165,250,0.5)); }

/* Wadah Sub-menu (Isi Dropdown) */
.dropdown-container {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-in-out;
    background: rgba(0, 0, 0, 0.15); border-radius: 8px; margin: 0 16px;
}
.dropdown-container a.nav-link {
    margin: 2px 0; padding: 10px 15px 10px 45px; font-size: 13.5px; border-left: none; width: 100%; position: relative;
}
.dropdown-container a.nav-link::before {
    content: "•"; position: absolute; left: 24px; color: #475569; font-size: 20px; line-height: 0.8; transition: color 0.2s;
}
.dropdown-container a.nav-link:hover { background: rgba(255, 255, 255, 0.05); }
.dropdown-container a.nav-link:hover::before { color: #3b82f6; }
.dropdown-container a.aktif { background: transparent; color: #93c5fd; font-weight: 600; }
.dropdown-container a.aktif::before { color: #60a5fa; }

/* Warna Spesial Menu Akses & Log */
.menu-danger { color: #fca5a5 !important; } .menu-danger svg { color: #fca5a5 !important; }
.menu-danger:hover { background: rgba(239, 68, 68, 0.15) !important; color: #ffffff !important; border-left-color: #ef4444 !important; }
.menu-warning { color: #fde047 !important; } .menu-warning svg { color: #fde047 !important; }
.menu-warning:hover { background: rgba(234, 179, 8, 0.15) !important; color: #ffffff !important; border-left-color: #eab308 !important; }

/* Footer Logout */
.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.05); background: rgba(0, 0, 0, 0.1); }
.btn-logout {
    display: flex; align-items: center; gap: 10px; justify-content: center; width: 100%; padding: 12px;
    background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3);
    text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 8px; transition: all 0.3s ease; box-sizing: border-box;
}
.btn-logout:hover { background: #ef4444; color: white; border-color: #ef4444; box-shadow: 0 4px 15px rgba(239,68,68,0.4); }

/* =========================================
   MEDIA QUERY - TAMPILAN HP (MOBILE RESPONSIVE)
   ========================================= */
@media (max-width: 992px) {
    /* Konten memenuhi layar */
    .main-content { margin-left: 0; padding: 15px; }

    /* Sembunyikan Sidebar ke luar layar (kiri) */
    .sidebar {
        background: rgba(15, 23, 42, 0.85); /* Tembus pandang di HP */
        left: -300px;
        transition: 0.3s ease-in-out;
        border-right: none;
        box-shadow: 10px 0 25px rgba(0,0,0,0.5);
    }
    
    /* Tombol X (Close) Muncul di HP */
    .btn-close-sidebar { display: flex; }
    
    /* Pemicu Javascript Buka Menu Sidebar */
    .sidebar.buka { left: 0 !important; }

    /* Sesuaikan Kotak Kaca */
    .container { padding: 20px 15px; border-radius: 12px; min-height: auto; }
    h2 { font-size: 22px; margin-bottom: 15px; }
}