@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-body: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-body); color: var(--text-main); overflow-x: hidden; }

/* --- LAYOUT WRAPPER --- */
.wrapper { display: flex; height: 100vh; overflow: hidden; }

/* --- SIDEBAR --- */
.sidebar {
    width: 260px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: relative; z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-header { padding: 25px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { color: var(--primary); font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; }

.nav-links { flex: 1; padding: 20px 10px; display: flex; flex-direction: column; gap: 5px; }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); }

.nav-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px;
    color: var(--text-muted); text-decoration: none; border-radius: 8px;
    transition: 0.2s; cursor: pointer; font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: rgba(59, 130, 246, 0.1); color: var(--primary); }
.nav-item.logout { color: var(--danger); }

/* --- MAIN CONTENT --- */
.main-content { flex: 1; display: flex; flex-direction: column; overflow-y: auto; background: #0f172a; }

header {
    height: 70px; display: flex; align-items: center; padding: 0 30px;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 90;
}
.toggle-btn { display: none; font-size: 24px; cursor: pointer; margin-right: 20px; }
.header-title h3 { font-size: 1.2rem; font-weight: 700; }
.header-title p { font-size: 0.85rem; color: var(--text-muted); }

main { padding: 30px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* --- SECTIONS & CARDS --- */
.section { display: none; animation: fadeIn 0.4s ease; }
.section.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 25px; margin-bottom: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.card h3 { font-size: 1.1rem; color: var(--text-main); margin-bottom: 0; }

/* --- STATS GRID (BARU) --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; display: flex; align-items: center; gap: 20px;
}
.stat-card.blue { border-left: 4px solid var(--primary); }
.stat-card.green { border-left: 4px solid var(--success); }
.stat-card.red { border-left: 4px solid var(--danger); }

.stat-icon { font-size: 2rem; opacity: 0.8; }
.stat-info h4 { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; margin-bottom: 5px; }
.stat-info h2 { font-size: 1.8rem; font-weight: 700; color: white; }

/* --- TABLES & CHARTS --- */
.table-responsive { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--bg-card); min-width: 600px; }
th, td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { background: #0f172a; color: var(--primary); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }
tr:hover { background: rgba(255,255,255,0.02); }
.loading { text-align: center; padding: 20px; color: var(--text-muted); }

.chart-container { position: relative; height: 350px; width: 100%; }

/* --- FORMS & BUTTONS --- */
.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }

input, select {
    width: 100%; padding: 10px; margin-bottom: 10px; background: #0f172a;
    border: 1px solid var(--border); border-radius: 6px; color: white;
}

/* --- MODAL --- */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 200; justify-content: center; align-items: center; }
.modal-content { background: var(--bg-card); padding: 30px; border-radius: 12px; width: 90%; max-width: 450px; position: relative; border: 1px solid var(--border); }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 24px; cursor: pointer; color: var(--text-muted); }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100%; left: -260px; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
    .sidebar.active { left: 0; }
    .overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99; }
    .overlay.active { display: block; }
    .toggle-btn { display: block; }
    .stats-grid { grid-template-columns: 1fr; }
    main { padding: 15px; }
}