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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* NAVBAR */
.navbar {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 12px rgba(37,99,235,0.2);
}
.navbar-admin { background: linear-gradient(135deg, #0f172a, #1e293b); }
.navbar-sticky { position: sticky; top: 0; z-index: 1000; }
.logo { font-size: 1.3em; font-weight: 800; letter-spacing: -0.5px; }
.nav-info { opacity: 0.9; flex: 1; font-weight: 500; }
.nav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-links a {
    color: white; text-decoration: none; padding: 6px 14px;
    border-radius: 8px; font-size: 0.9em; font-weight: 500;
    transition: background 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.15); }
.nav-links a.active { background: rgba(255,255,255,0.2); border-bottom: 2px solid #fff; }

/* CONTAINER */
.container { max-width: 960px; margin: 24px auto; padding: 0 16px; }

/* LOGIN */
.login-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #7c3aed 100%);
}
.login-box {
    background: white; border-radius: 20px; padding: 44px 36px;
    width: 100%; max-width: 420px; text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    animation: slideUp 0.5s ease;
}
.login-box h1 { font-size: 2.2em; margin-bottom: 2px; font-weight: 800; }
.tagline { color: #64748b; margin-bottom: 28px; font-size: 1em; }
.login-box input, .login-box select {
    width: 100%; padding: 13px 16px; margin-bottom: 12px;
    border: 2px solid #e2e8f0; border-radius: 10px; font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.login-box input:focus, .login-box select:focus {
    outline: none; border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.login-box button {
    width: 100%; padding: 14px; background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white; border: none; border-radius: 10px; font-size: 1.05em;
    cursor: pointer; font-weight: 700; letter-spacing: 0.3px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.login-info {
    margin-top: 24px; text-align: left; background: #f1f5f9;
    padding: 16px; border-radius: 12px; font-size: 0.88em;
}
.login-info code {
    background: #e2e8f0; padding: 2px 8px; border-radius: 6px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.9em;
}
.alert {
    background: #fef2f2; color: #dc2626; padding: 12px 16px;
    border-radius: 10px; margin-bottom: 16px; font-size: 0.9em;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #f0fdf4; color: #16a34a; padding: 12px 16px;
    border-radius: 10px; margin-bottom: 16px; font-size: 0.9em;
    border: 1px solid #bbf7d0;
}

/* STATS */
.stats-row { display: flex; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
    flex: 1; min-width: 130px; background: white; border-radius: 16px;
    padding: 20px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.stat-card.correct { border-bottom: 3px solid #22c55e; }
.stat-number { font-size: 2em; font-weight: 800; color: #2563eb; letter-spacing: -1px; }
.stat-label { color: #64748b; font-size: 0.82em; margin-top: 4px; font-weight: 500; }

/* MAPEL GRID */
.mapel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.mapel-card {
    background: white; border-radius: 16px; padding: 24px; text-align: center;
    text-decoration: none; color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1px solid #f1f5f9;
}
.mapel-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    border-color: #2563eb;
}
.mapel-icon { font-size: 2.5em; margin-bottom: 10px; }
.mapel-nama { font-weight: 700; font-size: 1.05em; }

/* SOAL */
.progress-bar { background: #e2e8f0; border-radius: 10px; height: 10px; margin-bottom: 10px; overflow: hidden; }
.progress-fill {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    height: 100%; border-radius: 10px; transition: width 0.4s ease;
}
.soal-counter { text-align: center; color: #64748b; margin-bottom: 16px; font-weight: 600; }
.soal-card {
    background: white; border-radius: 16px; padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    animation: fadeIn 0.3s ease;
}
.soal-text { font-size: 1.15em; font-weight: 600; margin-bottom: 24px; line-height: 1.7; color: #0f172a; }
.opsi-list { display: flex; flex-direction: column; gap: 10px; }
.opsi {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    border: 2px solid #e2e8f0; border-radius: 12px; cursor: pointer;
    transition: all 0.2s; font-weight: 500;
}
.opsi:hover { border-color: #93c5fd; background: #eff6ff; }
.opsi input { display: none; }
.opsi input:checked + .opsi-label { background: linear-gradient(135deg, #2563eb, #7c3aed); color: white; }
.opsi:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.opsi-label {
    background: #e2e8f0; width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85em; flex-shrink: 0;
    transition: all 0.2s;
}

/* BUTTONS */
.btn-row { display: flex; gap: 12px; margin-top: 24px; justify-content: center; }
.btn {
    display: inline-block; padding: 12px 24px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white; border: none; border-radius: 10px; font-size: 0.95em;
    cursor: pointer; text-decoration: none; font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,0.25); }
.btn-secondary { background: linear-gradient(135deg, #475569, #64748b); }
.btn-secondary:hover { box-shadow: 0 6px 20px rgba(71,85,105,0.25); }
.btn-success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(22,163,74,0.25); }
.btn-sm { padding: 7px 16px; font-size: 0.85em; border-radius: 8px; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(220,38,38,0.25); }
.btn-active { background: linear-gradient(135deg, #1d4ed8, #2563eb); }

/* RESULTS */
.result-header { text-align: center; margin-bottom: 28px; }
.result-score {
    font-size: 1.6em; font-weight: 800; color: #2563eb;
    margin-top: 8px; letter-spacing: -0.5px;
}
.result-item {
    background: white; border-radius: 14px; padding: 18px; margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04); border-left: 4px solid #e2e8f0;
    animation: fadeIn 0.3s ease;
}
.result-item.correct { border-left-color: #22c55e; background: #f0fdf4; }
.result-item.wrong { border-left-color: #ef4444; background: #fef2f2; }
.result-status { font-size: 1.3em; margin-bottom: 4px; }
.result-soal { font-weight: 600; margin-bottom: 8px; }
.result-jawaban { color: #dc2626; margin-bottom: 4px; font-weight: 500; }
.result-pembahasan {
    background: #f0fdf4; padding: 12px 14px; border-radius: 10px;
    color: #166534; font-size: 0.9em; line-height: 1.6;
    border: 1px solid #bbf7d0;
}

/* ANAK CARD (ORTU) */
.anak-card {
    background: white; border-radius: 20px; padding: 28px; margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
}
.anak-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.anak-header h3 { font-size: 1.3em; font-weight: 700; }
.badge {
    background: #eff6ff; color: #2563eb; padding: 4px 14px;
    border-radius: 20px; font-size: 0.82em; font-weight: 700;
}

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; border-radius: 12px; overflow: hidden; }
.data-table th {
    background: #f1f5f9; padding: 12px 14px; text-align: left;
    font-size: 0.82em; color: #475569; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td { padding: 12px 14px; border-top: 1px solid #f1f5f9; }
.data-table tr:hover { background: #f8fafc; }
.row-correct { background: #f0fdf4; }
.row-wrong { background: #fef2f2; }

/* MINI BAR */
.mini-bar { background: #e2e8f0; border-radius: 6px; height: 8px; width: 100px; overflow: hidden; }
.mini-fill { background: linear-gradient(90deg, #22c55e, #4ade80); height: 100%; border-radius: 6px; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px 20px; }

/* GREETING BAR */
.greeting-bar { background: #eff6ff; padding: 12px 18px; border-radius: 12px; margin-bottom: 16px; font-size: 0.95em; color: #1e3a5f; border: 1px solid #dbeafe; }
.empty-state h2 { font-size: 2em; margin-bottom: 8px; font-weight: 800; }
.empty-state p { color: #64748b; margin-bottom: 20px; }

/* CARD */
.card {
    background: white; border-radius: 16px; padding: 24px; margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}
.card h3 { margin-bottom: 16px; font-weight: 700; }
.card h4 { margin: 16px 0 8px; color: #475569; font-weight: 600; }
.card-danger { border-left: 4px solid #ef4444; }

/* FORMS */
.form-group { margin-bottom: 14px; flex: 1; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.88em; color: #374151; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 11px 14px; border: 2px solid #e2e8f0; border-radius: 10px;
    font-size: 0.95em; transition: border-color 0.2s, box-shadow 0.2s; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-row { display: flex; gap: 14px; }
.form-inline { display: flex; gap: 10px; align-items: end; }
.form-inline input { max-width: 220px; }

/* MAPEL FILTER */
.mapel-filter { display: flex; gap: 8px; flex-wrap: wrap; }

/* SOAL ADMIN LIST */
.soal-admin-item {
    display: flex; gap: 14px; padding: 16px; border-bottom: 1px solid #f1f5f9; align-items: flex-start;
}
.soal-admin-item:last-child { border-bottom: none; }
.soal-admin-num { font-weight: 800; color: #94a3b8; min-width: 30px; }
.soal-admin-content { flex: 1; }
.soal-admin-text { font-weight: 600; margin-bottom: 4px; }
.soal-admin-opsi { font-size: 0.85em; color: #64748b; margin-bottom: 4px; }
.soal-admin-jawaban { font-size: 0.85em; color: #16a34a; font-weight: 600; }
.soal-admin-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* BADGES */
.badge-admin { background: #fef3c7; color: #d97706; }
.badge-ortu { background: #ede9fe; color: #7c3aed; }
.badge-aktif { background: #dcfce7; color: #16a34a; }
.badge-nonaktif { background: #fef3c7; color: #d97706; }
.text-muted { color: #94a3b8; }

/* LATIHAN */
.latihan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.latihan-card { border-left: 4px solid #f59e0b; }
.latihan-info { font-size: 0.8em; color: #94a3b8; margin-top: 6px; font-weight: 500; }

/* DETAIL ORTU */
.detail-item { padding: 18px; margin-bottom: 16px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; }
.detail-item.correct { background: #f0fdf4; border-color: #bbf7d0; }
.detail-item.correct .jawaban-anak { color: #16a34a; }
.detail-header { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.detail-mapel { background: linear-gradient(135deg,#2563eb,#3b82f6); color: white; padding: 3px 12px; border-radius: 12px; font-size: 0.8em; font-weight: 700; }
.detail-topik { background: #f1f5f9; color: #475569; padding: 3px 12px; border-radius: 12px; font-size: 0.8em; font-weight: 600; }
.detail-waktu { color: #94a3b8; font-size: 0.8em; margin-left: auto; }
.detail-soal { font-weight: 700; font-size: 1.05em; margin-bottom: 14px; line-height: 1.6; word-wrap: break-word; }
.detail-opsi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.detail-opsi { padding: 10px 14px; border-radius: 10px; background: white; font-size: 0.9em; border: 1px solid #e2e8f0; font-weight: 500; word-wrap: break-word; }
.opsi-benar { background: #dcfce7; border-color: #22c55e; font-weight: 700; }
.opsi-dipilih-salah { background: #fee2e2; border-color: #ef4444; text-decoration: line-through; }
.detail-jawaban { display: flex; gap: 16px; margin-bottom: 10px; font-size: 0.9em; font-weight: 600; flex-wrap: wrap; }
.jawaban-anak { color: #ef4444; }
.jawaban-benar { color: #16a34a; }
.detail-pembahasan { background: #f0fdf4; padding: 14px; border-radius: 10px; color: #166534; font-size: 0.9em; line-height: 1.6; border: 1px solid #bbf7d0; word-wrap: break-word; }
.detail-item-compact { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; border-radius: 8px; margin-bottom: 2px; }
.detail-item-compact.wrong { background: #fef2f2; }
.detail-item-compact.correct { background: #f0fdf4; }
.detail-status { font-size: 1.1em; flex-shrink: 0; }
.detail-soal-compact { flex: 1; font-size: 0.9em; font-weight: 500; }
.detail-topik-compact { color: #94a3b8; font-size: 0.8em; flex-shrink: 0; }

/* AI BUTTON */
.btn-ai { background: linear-gradient(135deg, #8b5cf6, #6366f1); }
.btn-ai:hover { box-shadow: 0 6px 20px rgba(139,92,246,0.3); }

/* HEADINGS */
h2 { margin-bottom: 16px; font-weight: 700; letter-spacing: -0.3px; }
h4 { margin: 16px 0 8px; color: #475569; font-weight: 600; }

/* ANIMATIONS */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* PRICING */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 900px; margin: 0 auto; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 0; }
    .stats-row { gap: 8px; }
    .stat-card { min-width: 70px; padding: 12px 8px; }
    .stat-number { font-size: 1.3em; }
    .stat-label { font-size: 0.72em; }
    .navbar { padding: 10px 14px; gap: 8px; }
    .logo { font-size: 1.1em; }
    .nav-info { font-size: 0.82em; flex: 1; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .nav-links { gap: 4px; flex-wrap: nowrap; margin-left: auto; flex-shrink: 0; }
    .nav-links a { padding: 5px 8px; font-size: 0.75em; white-space: nowrap; }
    .container { padding: 0 10px; margin: 14px auto; }
    .detail-opsi-grid { grid-template-columns: 1fr; }
    .detail-item { padding: 14px; }
    .detail-soal { font-size: 0.95em; }
    .detail-opsi { padding: 8px 12px; font-size: 0.85em; }
    .detail-jawaban { flex-direction: column; gap: 4px; font-size: 0.85em; }
    .detail-pembahasan { padding: 10px; font-size: 0.85em; }
    .card { padding: 16px; margin-bottom: 14px; }
    .card h3 { font-size: 0.95em; }
    .anak-card { padding: 16px; }
    .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 0.85em; }
    .data-table th, .data-table td { padding: 8px 10px; white-space: nowrap; }
    .btn-sm { padding: 5px 10px; font-size: 0.78em; }
    .form-inline { flex-wrap: wrap; }
    .form-inline input { max-width: 100%; }
    .login-box { padding: 28px 20px; margin: 16px; }
    .login-box h1 { font-size: 1.8em; }
    .mapel-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .soal-card { padding: 18px; }
    .soal-text { font-size: 1em; }
    .btn-row { flex-wrap: wrap; }
    .pricing-grid { grid-template-columns: 1fr; gap: 14px; }
}
