@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --brand: #2563eb; --brand-hover: #1d4ed8; --brand-soft: #eff6ff;
    --dark: #0f172a; --dark-soft: #1e293b;
    --bg-main: #f8fafc; --bg-surface: #ffffff;
    --text-main: #334155; --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
    --radius-lg: 16px; --radius-md: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }

/* PERBAIKAN: Hapus overflow:hidden di body agar scroll HP lancar */
body { background: var(--bg-main); color: var(--text-main); display: flex; min-height: 100vh; overflow-x: hidden; }

/* SIDEBAR */
.sidebar { width: 280px; background: var(--bg-surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 1000; position: fixed; top: 0; left: 0; height: 100vh; transition: transform 0.3s ease; }
.brand { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.brand-icon { width: 40px; height: 40px; background: var(--brand-soft); color: var(--brand); border-radius: 10px; display: flex; justify-content: center; align-items: center; font-size: 24px; flex-shrink: 0; }
.brand-text h2 { font-size: 1.1rem; font-weight: 800; color: var(--dark); margin: 0; }
.brand-text p { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin: 0; }
.close-sidebar { display: none; background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }

.nav-menu { padding: 1.5rem 1rem; flex: 1; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.nav-label { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin: 10px 0 5px 10px; letter-spacing: 1px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--text-main); text-decoration: none; font-weight: 600; font-size: 0.9rem; border-radius: var(--radius-md); transition: 0.2s; }
.nav-link:hover { background: var(--bg-main); color: var(--brand); }
.nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }

/* MAIN CONTENT */
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-height: 100vh; margin-left: 280px; transition: margin-left 0.3s ease; width: calc(100% - 280px); }
.topbar { background: var(--bg-surface); min-height: 70px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; position: sticky; top: 0; z-index: 900; }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.menu-toggle { display: none; background: var(--brand-soft); color: var(--brand); border: none; width: 40px; height: 40px; border-radius: 8px; font-size: 24px; cursor: pointer; align-items: center; justify-content: center; }
.live-clock { background: var(--bg-main); padding: 8px 16px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; color: var(--brand); border: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }

.content { flex: 1; padding: 2rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--dark); margin-bottom: 5px; }
.page-header p { color: var(--text-muted); font-size: 0.9rem; }

/* UI COMPONENTS */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.card { background: var(--bg-surface); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 10px; }
.card-title { font-weight: 700; font-size: 1.1rem; color: var(--dark); display: flex; align-items: center; gap: 8px; margin: 0; }

/* STATS */
.stat-box { display: flex; align-items: center; gap: 15px; }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.stat-icon.blue { background: var(--brand-soft); color: var(--brand); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }
.stat-icon.orange { background: #fef3c7; color: var(--warning); }
.stat-val h3 { font-size: 1.5rem; font-weight: 800; color: var(--dark); margin: 0; }
.stat-val p { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin: 0; }

/* TABLES */
.table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { background: #f8fafc; padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; font-weight: 500; }
.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bg-success { background: #dcfce7; color: #166534; } .bg-danger { background: #fee2e2; color: #991b1b; } .bg-warning { background: #fef3c7; color: #92400e; } .bg-primary { background: var(--brand-soft); color: var(--brand); }

/* FORMS & BUTTONS */
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.form-control { padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 0.9rem; outline: none; transition: 0.2s; background: var(--bg-main); width: 100%; }
.form-control:focus { border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; border: none; transition: 0.2s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-hover); }

/* RESPONSIVE MOBILE FIX */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); box-shadow: 10px 0 15px rgba(0,0,0,0.1); }
    .close-sidebar { display: block; }
    .main-wrapper { margin-left: 0; width: 100%; }
    .menu-toggle { display: flex; }
    .content { padding: 1rem; }
    .topbar { padding: 1rem; flex-wrap: wrap; gap: 10px; }
    .grid-4 { grid-template-columns: 1fr; }
    .card { padding: 1rem; }
}