/* =====================================================================
   CBT PROFESIONAL — Tema modern (ala CAT BKN / Moodle)
   ===================================================================== */
:root {
  --brand-1: #1d4ed8;
  --brand-2: #4f46e5;
  --brand-3: #0ea5e9;
  --brand-soft: #eef4ff;
  --sidebar-w: 268px;
  --topbar-h: 68px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 4px 18px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, .12);
  --line: #e6ebf3;
  --muted: #64748b;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: #f4f7fc;
  color: #0f172a;
  font-size: .9375rem;
}
[data-bs-theme="dark"] body { background: #0b1220; color: #e2e8f0; }
[data-bs-theme="dark"] { --line: #22304a; --muted: #94a3b8; }

a { text-decoration: none; }
h1, h2, h3, h4, h5 { letter-spacing: -.015em; font-weight: 700; }

/* ---------------- Shell ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: fixed;
  inset: 0 auto 0 0;
  background: linear-gradient(180deg, #14224a 0%, #0c1730 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .22s ease;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; padding: 3px; }
.brand-logo-fallback {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: #fff; font-size: 1.05rem; flex: 0 0 38px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { color: #fff; font-size: 1rem; letter-spacing: .02em; }
.brand-text span { color: #93a4c4; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; scrollbar-width: thin; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }
.nav-judul {
  font-size: .67rem; text-transform: uppercase; letter-spacing: .1em;
  color: #7186ad; font-weight: 700; padding: 16px 12px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: #c3d0e6; font-size: .875rem; font-weight: 500;
  margin-bottom: 2px; transition: background .15s, color .15s, transform .15s;
}
.nav-item i { width: 18px; text-align: center; font-size: .86rem; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.aktif {
  background: linear-gradient(90deg, rgba(79,70,229,.95), rgba(37,99,235,.92));
  color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(37,99,235,.32);
}
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: #e2e8f0; }
.sidebar-user:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-user strong { display: block; font-size: .82rem; line-height: 1.2; }
.sidebar-user small { color: #8ba0c4; font-size: .7rem; }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.2); flex: 0 0 34px; }

.main-area {
  flex: 1; min-width: 0; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
[data-bs-theme="dark"] .topbar { background: rgba(12,20,36,.86); }
.topbar-title { min-width: 0; }
.topbar-eyebrow { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.topbar-title h1 { font-size: 1.06rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: #fff; color: #334155; padding: 0;
}
[data-bs-theme="dark"] .btn-icon { background: #131f36; color: #cbd5e1; border-color: #22304a; }
.btn-icon:hover { background: var(--brand-soft); color: var(--brand-1); }
[data-bs-theme="dark"] .btn-icon:hover { background: #1b2942; color: #93c5fd; }
.btn-user {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); background: #fff; border-radius: 99px;
  padding: 3px 12px 3px 4px; font-size: .85rem; font-weight: 600; color: #1e293b;
}
[data-bs-theme="dark"] .btn-user { background: #131f36; color: #e2e8f0; border-color: #22304a; }
.btn-user:hover { background: var(--brand-soft); }
.notif-dot {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
.notif-menu { width: 340px; padding: 0; border-radius: 14px; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.notif-item.baru { background: rgba(37,99,235,.05); }
.notif-ikon { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; background: rgba(37,99,235,.1); display: grid; place-items: center; }
.notif-judul { font-size: .83rem; font-weight: 650; }
.notif-pesan { font-size: .78rem; color: var(--muted); }
.notif-waktu { font-size: .7rem; color: #94a3b8; margin-top: 2px; }

/* ---------------- Konten ---------------- */
.content-area { padding: 24px; flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 24px; font-size: .76rem; color: var(--muted);
  border-top: 1px solid var(--line);
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 1.3rem; margin: 0 0 3px; }
.page-head p { margin: 0; color: var(--muted); font-size: .85rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: #fff; }
[data-bs-theme="dark"] .card { background: #101b30; border-color: #22304a; }
.card-header { background: transparent; border-bottom: 1px solid var(--line); padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-header h3, .card-header h5 { font-size: .98rem; margin: 0; }
.card-body { padding: 20px; }
.card-footer { background: rgba(248,250,252,.7); border-top: 1px solid var(--line); }
[data-bs-theme="dark"] .card-footer { background: #0d1728; }

/* Statistik */
.stat-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-sm);
  padding: 18px; display: flex; align-items: center; gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease;
}
[data-bs-theme="dark"] .stat-card { background: #101b30; border-color: #22304a; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-ikon {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 13px;
  display: grid; place-items: center; font-size: 1.15rem;
}
.stat-nilai { font-size: 1.55rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.stat-sub { font-size: .74rem; color: var(--muted); }

.bg-lembut-primary { background: rgba(37,99,235,.1); color: #2563eb; }
.bg-lembut-success { background: rgba(16,185,129,.12); color: #059669; }
.bg-lembut-warning { background: rgba(245,158,11,.14); color: #d97706; }
.bg-lembut-danger  { background: rgba(239,68,68,.12); color: #dc2626; }
.bg-lembut-info    { background: rgba(14,165,233,.12); color: #0284c7; }
.bg-lembut-purple  { background: rgba(124,58,237,.12); color: #7c3aed; }

.badge-lembut { font-weight: 600; padding: .38em .62em; border-radius: 7px; font-size: .72rem; }

/* Tabel */
.table { --bs-table-bg: transparent; margin: 0; }
.table > thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line);
  padding: 11px 14px; white-space: nowrap;
}
.table > tbody td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background: rgba(37,99,235,.035); }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { background: rgba(255,255,255,.04); }
.btn-ikon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; }
.table-responsive { border-radius: var(--radius); }

/* Form */
.form-label { font-size: .82rem; font-weight: 650; margin-bottom: .35rem; color: #334155; }
[data-bs-theme="dark"] .form-label { color: #cbd5e1; }
.form-control, .form-select { border-radius: var(--radius-sm); padding: .55rem .8rem; font-size: .9rem; border-color: #d8e0ec; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background: #0d1728; border-color: #22304a; color: #e2e8f0; }
.form-control:focus, .form-select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 .2rem rgba(79,70,229,.13); }
.form-text { font-size: .76rem; }
.btn { border-radius: var(--radius-sm); font-weight: 600; font-size: .875rem; padding: .5rem .95rem; }
.btn-primary { background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); border: 0; box-shadow: 0 4px 12px rgba(37,99,235,.24); }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #1a44bd, #4338ca); }
.btn-outline-primary { color: var(--brand-1); border-color: #bfdbfe; }
.btn-outline-primary:hover { background: var(--brand-1); border-color: var(--brand-1); }

/* Login */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  background: #f7f9fe;
}
.login-kiri {
  position: relative; overflow: hidden; color: #fff; padding: 48px;
  background:
    radial-gradient(900px 420px at 15% 8%, rgba(56,189,248,.35), transparent 65%),
    radial-gradient(700px 500px at 85% 90%, rgba(139,92,246,.45), transparent 60%),
    linear-gradient(150deg, #0b1b3d 0%, #14224a 45%, #1e1b4b 100%);
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-kiri h1 { font-size: 2.1rem; line-height: 1.2; letter-spacing: -.03em; }
.login-kiri p { color: #bfd0ea; }
.login-fitur { display: grid; gap: 14px; margin-top: 28px; }
.login-fitur div { display: flex; gap: 12px; align-items: flex-start; color: #d7e3f7; font-size: .88rem; }
.login-fitur i { color: #7dd3fc; margin-top: 3px; }
.login-kanan { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-card .card { border: 0; box-shadow: var(--shadow-lg); border-radius: 20px; }
.login-logo { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); margin-bottom: 14px; }
.akun-demo { border: 1px dashed #c7d2fe; background: #f5f7ff; border-radius: 12px; padding: 12px; font-size: .76rem; }
[data-bs-theme="dark"] .akun-demo { background: #16213a; border-color: #2b3b5c; }
.akun-demo code { cursor: pointer; color: var(--brand-1); }
[data-bs-theme="dark"] .akun-demo code { color: #93c5fd; }

/* ---------------- Halaman ujian peserta ---------------- */
.exam-page { background: #eef2f9; min-height: 100vh; }
[data-bs-theme="dark"] .exam-page { background: #0b1220; }
.exam-header {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: 10px 18px;
}
[data-bs-theme="dark"] .exam-header { background: rgba(13,23,40,.95); }
.exam-header-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.exam-judul { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.exam-sub { font-size: .75rem; color: var(--muted); }
.timer-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 99px; font-variant-numeric: tabular-nums;
  background: var(--brand-soft); color: var(--brand-1); font-weight: 800; font-size: 1.05rem;
  border: 1px solid #dbeafe;
}
[data-bs-theme="dark"] .timer-pill { background: #16213a; color: #93c5fd; border-color: #2b3b5c; }
.timer-pill.hampir { background: #fef2f2; color: #dc2626; border-color: #fecaca; animation: denyut 1.5s infinite; }
@keyframes denyut { 50% { opacity: .55; } }
.progress-tipis { height: 6px; border-radius: 99px; background: #e2e8f0; }
[data-bs-theme="dark"] .progress-tipis { background: #22304a; }
.progress-tipis .progress-bar { border-radius: 99px; background: linear-gradient(90deg, var(--brand-1), var(--brand-2)); }

.exam-wrap { max-width: 1320px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 20px; align-items: start; }
.soal-card { border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
[data-bs-theme="dark"] .soal-card { background: #101b30; border-color: #22304a; }
.soal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.soal-nomor { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-1); }
.soal-isi { font-size: 1.03rem; line-height: 1.7; }
.soal-isi img { max-width: 100%; height: auto; border-radius: 8px; }
.soal-isi table { width: 100%; border-collapse: collapse; }
.soal-isi table td, .soal-isi table th { border: 1px solid var(--line); padding: 6px 9px; }

.opsi-jawab {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 15px;
  cursor: pointer; transition: all .13s ease; background: #fff; margin-bottom: 10px;
}
[data-bs-theme="dark"] .opsi-jawab { background: #0d1728; border-color: #22304a; }
.opsi-jawab:hover { border-color: #a5b4fc; background: #f8faff; }
[data-bs-theme="dark"] .opsi-jawab:hover { background: #16213a; }
.opsi-jawab input { position: absolute; opacity: 0; pointer-events: none; }
.opsi-huruf {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  background: #f1f5f9; color: #475569; border: 1px solid var(--line);
}
.opsi-jawab.dipilih { border-color: var(--brand-1); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-1) inset; }
[data-bs-theme="dark"] .opsi-jawab.dipilih { background: #17264a; }
.opsi-jawab.dipilih .opsi-huruf { background: var(--brand-1); color: #fff; border-color: var(--brand-1); }
.opsi-teks { flex: 1; padding-top: 3px; word-break: break-word; }
.exam-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.palet-card { position: sticky; top: 84px; }
.palet-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.palet-btn {
  aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: .82rem; color: #334155;
  display: grid; place-items: center; cursor: pointer; transition: all .13s;
}
[data-bs-theme="dark"] .palet-btn { background: #0d1728; border-color: #22304a; color: #cbd5e1; }
.palet-btn:hover { border-color: var(--brand-1); }
.palet-btn.terjawab { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }
.palet-btn.ragu { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
[data-bs-theme="dark"] .palet-btn.ragu { background: #3a2a0a; color: #fcd34d; }
.palet-btn.aktif { box-shadow: 0 0 0 2px #0f172a; }
[data-bs-theme="dark"] .palet-btn.aktif { box-shadow: 0 0 0 2px #fff; }
.legenda { display: grid; gap: 6px; font-size: .76rem; color: var(--muted); margin-top: 12px; }
.legenda span { display: flex; align-items: center; gap: 7px; }
.kotak { width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--line); }
.kotak.biru { background: var(--brand-1); border-color: var(--brand-1); }
.kotak.kuning { background: #fffbeb; border-color: #f59e0b; }

/* Hasil / sertifikat */
.skor-bulat {
  width: 140px; height: 140px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--brand-1) var(--derajat,0deg), #e2e8f0 var(--derajat,0deg));
}
.skor-bulat::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
[data-bs-theme="dark"] .skor-bulat::before { background: #101b30; }
.skor-bulat .isi { position: relative; text-align: center; }
.skor-bulat .angka { font-size: 2.3rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.skor-bulat .ket { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }

.sertifikat {
  background: #fff; color: #0f172a; border: 14px double #1d4ed8;
  border-radius: 6px; padding: 38px 44px; position: relative; overflow: hidden;
  max-width: 820px; margin: 0 auto;
}
.sertifikat::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(37,99,235,.07), transparent 60%);
}
.sertifikat h2 { font-size: 1.7rem; letter-spacing: .12em; text-transform: uppercase; color: #1e3a8a; }
.sertifikat .nama { font-size: 2rem; font-weight: 800; border-bottom: 2px solid #cbd5e1; display: inline-block; padding: 0 26px 6px; }
.sertifikat .nilai-badge { font-size: 2.6rem; font-weight: 800; color: #1d4ed8; }

/* Grafik */
.chart-box { position: relative; height: 280px; }
.chart-box-sm { position: relative; height: 230px; }

/* Cetak */
.print-wrap { max-width: 900px; margin: 0 auto; padding: 28px; background: #fff; }
@media print {
  .no-print, .sidebar, .topbar, .app-footer { display: none !important; }
  body, .print-wrap { background: #fff !important; }
  .main-area { margin: 0 !important; }
  .content-area { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #cbd5e1 !important; }
  .sertifikat { border-color: #1d4ed8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 12mm; }
}

/* Responsif */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 0 40px rgba(2,6,23,.35); }
  body.nav-terbuka .sidebar { transform: translateX(0); }
  body.nav-terbuka .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 1035; }
  .main-area { margin-left: 0; }
  .content-area { padding: 16px; }
  .topbar { padding: 0 14px; }
  .exam-wrap { grid-template-columns: minmax(0,1fr); }
  .palet-card { position: static; order: 2; }
  .palet-grid { grid-template-columns: repeat(8, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-kiri { display: none; }
}
@media (max-width: 575.98px) {
  .content-area { padding: 13px; }
  .page-head h2 { font-size: 1.1rem; }
  .topbar-title h1 { font-size: .95rem; }
  .stat-card { padding: 14px; gap: 11px; }
  .stat-ikon { width: 40px; height: 40px; flex: 0 0 40px; font-size: 1rem; }
  .stat-nilai { font-size: 1.28rem; }
  .soal-isi { font-size: .97rem; }
  .exam-wrap { padding: 12px; gap: 14px; }
  .palet-grid { grid-template-columns: repeat(6, 1fr); }
  .notif-menu { width: 300px; }
  .footer { flex-direction: column; }
}

/* DataTables & util */
.dataTables_wrapper .dataTables_filter input { border-radius: var(--radius-sm); border: 1px solid #d8e0ec; padding: .35rem .6rem; }
.dataTables_wrapper .dataTables_length select { border-radius: var(--radius-sm); border: 1px solid #d8e0ec; }
table.dataTable > thead > tr > th { border-bottom: 1px solid var(--line) !important; }
.divider-teks { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .76rem; }
.divider-teks::before, .divider-teks::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tema-terang-ikon { display: none; }
[data-bs-theme="dark"] .tema-terang-ikon { display: inline; }
[data-bs-theme="dark"] .tema-gelap-ikon { display: none; }
.text-muted { color: var(--muted) !important; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 2.2rem; opacity: .35; margin-bottom: 10px; display: block; }
.ck-editor__editable { min-height: 170px; border-radius: 0 0 10px 10px !important; }
.ck.ck-editor__main > .ck-editor__editable { background: #fff; }
[data-bs-theme="dark"] .ck.ck-editor__main > .ck-editor__editable { background: #0d1728; color: #e2e8f0; }

/* Gambar pada pilihan jawaban */
.opsi-gambar {
  display: block;
  max-width: 100%;
  width: auto;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #fff;
}
[data-bs-theme="dark"] .opsi-gambar { border-color: #22304a; background: #0b1220; }
.opsi-teks > .opsi-gambar:first-child { margin-top: 0; }
@media (max-width: 575.98px) {
  .opsi-gambar { max-height: 96px !important; }
}

/* ================= Bank Soal (kartu per mapel) ================= */
.bank-toolbar { gap: 12px; }
.bank-toolbar h3 { font-size: 1rem; }
.legenda-warna .kotak-warna {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  margin-right: 8px; vertical-align: -2px;
}
.kotak-warna-sm { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

.bank-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bank-filter .form-select { width: 320px; max-width: 100%; }

.bank-grid-wrap { padding: 16px 20px 22px; }
.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.bank-card {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  position: relative;
}
[data-bs-theme="dark"] .bank-card { background: #101b30; border-color: #22304a; }
.bank-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; color: #fff;
}
.bank-nama {
  font-weight: 800; font-size: 1rem; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bank-kode { display:inline-block; margin-left:6px; padding:1px 6px; border-radius:5px; background:rgba(255,255,255,.25); font-size:.68rem; font-weight:700; letter-spacing:.04em; vertical-align:2px; }
.bank-head-btn {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45);
  color: #fff; width: 34px; height: 30px; display: grid; place-items: center; padding: 0;
  border-radius: 5px; font-size: .8rem;
}
.bank-head-btn:hover { background: rgba(255,255,255,.32); color: #fff; }
.bank-head-btn:disabled { opacity: .5; }

.bank-body { padding: 4px 16px 10px; flex: 1; }
.bank-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: .875rem;
}
.bank-row:last-child { border-bottom: 0; }
.bank-row > span { color: var(--muted); }
.bank-row > b { text-align: right; font-weight: 700; }

.bank-foot {
  padding: 12px 16px 16px; border-top: 1px solid var(--line);
  background: rgba(248,250,252,.75); display: grid; gap: 10px;
}
[data-bs-theme="dark"] .bank-foot { background: #0d1728; }
.bank-cetak {
  display: block; text-align: center; padding: 9px 12px;
  border: 1px solid var(--line-2, #cbd5e1); border-radius: 8px; background: #fff;
  color: #334155; text-decoration: none; line-height: 1.3;
}
[data-bs-theme="dark"] .bank-cetak { background: #101b30; color: #cbd5e1; border-color: #22304a; }
.bank-cetak:hover { border-color: var(--brand-1); color: var(--brand-1); text-decoration: none; }
.bank-cetak b { font-size: .86rem; font-weight: 600; }
.bank-cetak small { display: block; font-size: .74rem; font-style: italic; color: var(--muted); }

@media (max-width: 575.98px) {
  .bank-grid { grid-template-columns: 1fr; gap: 16px; }
  .bank-grid-wrap { padding: 12px; }
  .bank-filter .form-select { width: 100%; }
  .bank-filter .ms-auto { margin-left: 0 !important; width: 100%; justify-content: space-between; }
}

/* Kartu soal untuk cetak */
.soal-cetak-item { page-break-inside: avoid; margin-bottom: 16px; }
.soal-cetak-item .opsi { margin-left: 6px; }

/* ================= Form bank soal (komposisi) ================= */
.bank-jenis {
  border: 1px solid #cbd5e1; border-radius: 6px; padding: 12px 14px; height: 100%;
}
.bank-jenis .form-label { color: #12304f; font-weight: 700; margin-bottom: 3px; }
.bank-jenis .form-control, .bank-jenis .form-select { background: #fff; border-color: rgba(0,0,0,.16); }
.bank-total {
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; background: #fff; height: 100%;
  display: flex; align-items: center;
}
[data-bs-theme="dark"] .bank-total { background: #101b30; }
.bank-total-angka { font-size: 1.4rem; font-weight: 800; line-height: 1.1; }

/* ================= Pelaksanaan: kartu dokumen ================= */
.pelaksanaan-dok {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: #fff; color: inherit; text-decoration: none; height: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
[data-bs-theme="dark"] .pelaksanaan-dok { background: #101b30; border-color: #22304a; }
.pelaksanaan-dok:hover { border-color: var(--brand-1); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; color: inherit; }
.pelaksanaan-dok b { display: block; font-size: .9rem; }
.pelaksanaan-dok small { display: block; font-size: .76rem; color: var(--muted); line-height: 1.3; }
.pelaksanaan-dok .stat-ikon { width: 40px; height: 40px; flex: 0 0 40px; font-size: 1rem; }

/* ================= Bank soal: pilihan kelas otomatis ================= */
.bank-kelas-box {
  border: 1px dashed var(--line-2, #cbd5e1); border-radius: 8px;
  padding: 10px 12px; background: rgba(248,250,252,.7);
}
[data-bs-theme="dark"] .bank-kelas-box { background: #0d1728; border-color: #22304a; }
.bank-kelas-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-chip {
  border: 1px solid var(--line-2, #cbd5e1); background: #fff; color: #334155;
  border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 600;
  transition: all .13s;
}
[data-bs-theme="dark"] .bank-chip { background: #101b30; color: #cbd5e1; border-color: #22304a; }
.bank-chip:hover { border-color: var(--brand-1); color: var(--brand-1); }
.bank-chip.aktif { background: var(--brand-1); border-color: var(--brand-1); color: #fff; }
