:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}

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

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.navbar { background: #0f172a; color: #fff; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.brand { font-weight: 700; font-size: 1.1rem; }
.nav-links a { color: #cbd5e1; margin: 0 8px; display: inline-block; }
.nav-links a:hover { color: #fff; text-decoration: none; }

ul { padding-left: 22px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.stat { text-align: center; padding: 18px; }
.stat .num { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.stat .lbl { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

h1 { font-size: 1.4rem; margin-bottom: 8px; }
h2 { font-size: 1.1rem; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; font-size: 0.9rem; vertical-align: top; }
th { background: #f8fafc; }

form label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; margin-top: 14px; }

.alert { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 0.9rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0f172a; }
.auth-box { background: #fff; border-radius: 12px; padding: 28px; width: 100%; max-width: 400px; }
.auth-box h1 { text-align: center; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.badge-aktif { background: #dcfce7; color: #166534; }
.badge-nonaktif { background: #fee2e2; color: #991b1b; }
.badge-berlangsung { background: #dbeafe; color: #1e40af; }
.badge-selesai { background: #dcfce7; color: #166534; }
.badge-terpaksa { background: #fef9c3; color: #854d0e; }
.badge-benar { background: #dcfce7; color: #166534; }
.badge-salah { background: #fee2e2; color: #991b1b; }
.badge-kosong { background: #f1f5f9; color: #475569; }

.exam-top { position: sticky; top: 0; z-index: 20; background: #0f172a; color: #fff; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: -16px -16px 16px; }
.timer { font-size: 1.3rem; font-weight: 700; font-family: Consolas, monospace; }
.violasi { font-size: 0.85rem; color: #fca5a5; }

#lockWarning {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.97); color: #fff; z-index: 100;
  display: none; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
#lockWarning.show { display: flex; }

#lockOverlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); color: #fff; z-index: 90;
  display: none; align-items: center; justify-content: center; text-align: center; padding: 24px;
}
#lockOverlay.show { display: flex; }

.soal-item { margin-bottom: 10px; }
.soal-opsi { display: block; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; margin: 6px 0; cursor: pointer; }
.soal-opsi:hover { background: #f8fafc; }
.soal-opsi input { margin-right: 8px; }
input[type=radio] { accent-color: var(--primary); width: auto; }

.jawaban-user { font-weight: 600; }
.kunci-benar { background: #f0fdf4; }
.kunci-salah { background: #fef2f2; }