:root {
    /* Color Palette */
    --brand-50: #ecfdf5; --brand-100: #d1fae5; --brand-500: #10b981; --brand-600: #059669; --brand-700: #047857;
    --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1; --slate-400: #94a3b8;
    --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155; --slate-800: #1e293b; --slate-900: #0f172a;
    --blue-100: #dbeafe; --blue-600: #2563eb; --red-100: #fee2e2; --red-600: #dc2626;
    --sidebar-width: 260px; --topbar-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--slate-100); color: var(--slate-800); line-height: 1.5; display: flex; min-height: 100vh; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
ul { list-style: none; }

/* Typography & Utilities */
.text-center { text-align: center; } .text-green { color: var(--brand-600); } .text-red { color: var(--red-600); } .text-blue { color: var(--blue-600); } .text-muted { color: var(--slate-500); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
.font-bold { font-weight: 600; }
.hidden { display: none !important; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background-color: var(--slate-900); color: white; display: flex; flex-direction: column; position: fixed; height: 100vh; left: 0; top: 0; z-index: 100; }
.sidebar-header { display: flex; align-items: center; gap: 12px; font-size: 40px; font-weight: 700; padding: 24px; color: white; border-bottom: 1px solid var(--slate-800); }
.menu-label { padding: 20px 24px 10px; font-size: 12px; color: var(--slate-500); letter-spacing: 1px; font-weight: 600; }
.nav-menu { display: flex; flex-direction: column; padding: 0 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--slate-300); border-radius: 8px; cursor: pointer; transition: all 0.2s; margin-bottom: 4px; }
.nav-item:hover { background-color: var(--slate-800); color: white; }
.nav-item.active { background-color: var(--brand-600); color: white; }
.logout { padding: 20px 24px; margin-top: auto; border-top: 1px solid var(--slate-800); cursor: pointer; color: var(--slate-300); display: flex; align-items: center; gap: 12px; transition: color 0.2s;}
.logout:hover { color: var(--red-600); }

/* Main Content */
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-height); background-color: white; border-bottom: 1px solid var(--slate-200); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 90; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background-color: var(--brand-100); color: var(--brand-700); display: flex; align-items: center; justify-content: center; font-weight: 600; }
.content-wrapper { padding: 32px; }

/* Page Display Logic */
.page { display: none; animation: fadeIn 0.3s ease-in-out; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Cards */
.card { background-color: white; border-radius: 12px; border: 1px solid var(--slate-200); padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* Dashboard Specifics */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; margin-bottom: 24px; }
.stat-card { background: white; padding: 24px; border-radius: 12px; border: 1px solid var(--slate-200); display: flex; justify-content: space-between; align-items: center; }
.stat-info p { color: var(--slate-500); font-size: 14px; margin-bottom: 8px; }
.stat-info h3 { font-size: 32px; font-weight: 700; color: var(--slate-900); }
.stat-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; justify-content: center; align-items: center; font-size: 24px; }
.bg-blue { background: var(--blue-100); color: var(--blue-600); } .bg-green { background: var(--brand-100); color: var(--brand-600); } .bg-red { background: var(--red-100); color: var(--red-600); }

/* Forms & Buttons */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--slate-700); }
.form-group input { width: 100%; padding: 12px 16px; border: 1px solid var(--slate-300); border-radius: 8px; outline: none; transition: border 0.2s; font-size: 15px; }
.form-group input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }

.btn { padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--brand-600); color: white; box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2); }
.btn-primary:hover { background: var(--brand-700); transform: translateY(-1px); }
.btn-outline { background: white; border: 1px solid var(--slate-300); color: var(--slate-700); }
.btn-outline:hover { background: var(--slate-50); border-color: var(--slate-400); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; }
.table th, .table td { padding: 16px; border-bottom: 1px solid var(--slate-200); }
.table th { background: var(--slate-50); color: var(--slate-500); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tbody tr:hover { background-color: var(--slate-50); }

/* Detail/Result Sections */
.result-hero { display: flex; flex-direction: column; align-items: center; padding: 32px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px;}
.score-display { font-size: 64px; font-weight: 900; margin: 8px 0; color: var(--slate-900); }
.badge-result { padding: 8px 24px; font-weight: 700; border-radius: 50px; font-size: 16px; letter-spacing: 1px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.detail-box { background: var(--slate-50); padding: 20px; border-radius: 8px; border: 1px solid var(--slate-200); }
.detail-box h3 { margin-top: 8px; font-size: 24px; color: var(--slate-900); }
.flex-between { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; border-bottom: 1px dashed var(--slate-300); padding-bottom: 4px; color: var(--slate-700); }


/* =========================================
   STYLING UNTUK MODAL (POP-UP) CRUD
   ========================================= */
.modal {
    display: none; /* Disembunyikan secara default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* Warna latar gelap transparan */
    backdrop-filter: blur(4px); /* Efek blur ala modern UI */
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex; /* Memunculkan modal ke tengah layar */
}

.modal-content {
    animation: modalMuncul 0.3s ease-out forwards;
}

.close-btn:hover {
    color: #ef4444 !important; /* Warna merah saat di-hover */
}

/* Animasi pop-up muncul dari atas */
@keyframes modalMuncul {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}