/* ===== Ujian Online CI4 — gaya utama ===== */
:root {
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #ccfbf1;
  --sidebar-w: 260px;
  --sidebar-bg: #0b1f1d;
  --sidebar-fg: #cbd5d4;
  --sidebar-muted: #6b8784;
  --sidebar-active: rgba(20, 184, 166, .16);
  --surface: #ffffff;
  --page-bg: #f3f6f6;
  --radius: 14px;
}
[data-bs-theme="dark"] {
  --surface: #151b1b;
  --page-bg: #0d1212;
  --brand-soft: rgba(20, 184, 166, .15);
  --sidebar-bg: #070d0c;
}
body { background: var(--page-bg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.btn-brand { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff;
  --bs-btn-hover-bg: #0d5f59; --bs-btn-hover-border-color: #0d5f59; --bs-btn-hover-color:#fff;
  --bs-btn-active-bg: #0b4f4a; --bs-btn-active-color:#fff; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
.bg-brand-soft { background: var(--brand-soft) !important; }

/* Sidebar */
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar-bg);
  color: var(--sidebar-fg); display: flex; flex-direction: column; z-index: 1040; transition: transform .25s ease; }
.app-sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.app-sidebar .brand img { width: 38px; height: 38px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.app-sidebar .brand .t1 { font-weight: 700; color: #fff; line-height: 1.1; }
.app-sidebar .brand .t2 { font-size: .75rem; color: var(--sidebar-muted); }
.app-sidebar nav { overflow-y: auto; padding: .8rem .7rem 2rem; flex: 1; }
.app-sidebar .menu-head { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); padding: 1rem .8rem .35rem; }
.app-sidebar a.menu { display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; color: var(--sidebar-fg);
  border-radius: 10px; text-decoration: none; font-size: .93rem; }
.app-sidebar a.menu i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.app-sidebar a.menu:hover { background: rgba(255,255,255,.05); color: #fff; }
.app-sidebar a.menu.active { background: var(--sidebar-active); color: #5eead4; font-weight: 600; }
.app-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1030; background: var(--surface); border-bottom: 1px solid var(--bs-border-color);
  padding: .6rem 1.25rem; display: flex; align-items: center; gap: .75rem; }
.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: 1rem 1.5rem; font-size: .8rem; color: var(--bs-secondary-color); }
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  body.sidebar-open .app-sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
  .app-main { margin-left: 0; }
  .app-content { padding: 1rem; }
}

/* Kartu */
.card { border: 1px solid var(--bs-border-color-translucent); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color-translucent); padding: .9rem 1.1rem; font-weight: 600; }
.page-title { font-weight: 700; margin: 0; font-size: 1.35rem; }
.page-sub { color: var(--bs-secondary-color); font-size: .9rem; }
.stat { display: flex; flex-direction: row; gap: 1rem; align-items: center; padding: 1.1rem; }
.stat .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; }
.stat .v { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat .l { color: var(--bs-secondary-color); font-size: .85rem; }
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); white-space: nowrap; }
.badge-soft-success { background: rgba(25,135,84,.12); color: #198754; }
.badge-soft-warning { background: rgba(255,193,7,.18); color: #997404; }
.badge-soft-danger { background: rgba(220,53,69,.12); color: #dc3545; }
.badge-soft-secondary { background: rgba(108,117,125,.14); color: var(--bs-secondary-color); }
.badge-soft-primary { background: rgba(13,110,253,.12); color: #0d6efd; }
[data-bs-theme="dark"] .badge-soft-warning { color: #ffda6a; }
.soal-html img { max-width: 100%; height: auto; }
.soal-html p:last-child { margin-bottom: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.token-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .25em; font-weight: 800; }
.dt-container .dt-search input { min-width: 220px; }

/* Halaman login */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: linear-gradient(135deg, #0b3b37 0%, #0f766e 55%, #14b8a6 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -160px; border-radius: 50%; border: 60px solid rgba(255,255,255,.06); }
.auth-form { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } }

/* Ruang ujian */
.exam-top { background: var(--brand); color: #fff; }
.exam-timer { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.35rem; font-weight: 800; background: rgba(0,0,0,.18); padding: .25rem .8rem; border-radius: 10px; }
.exam-timer.warn { background: #dc3545; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.opsi { display: flex; gap: .85rem; align-items: flex-start; padding: .8rem 1rem; border: 1.5px solid var(--bs-border-color); border-radius: 12px; cursor: pointer; margin-bottom: .6rem; transition: all .12s; }
.opsi:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.opsi input { display: none; }
.opsi .huruf { flex: 0 0 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--bs-border-color); display: grid; place-items: center; font-weight: 700; }
.opsi.dipilih { border-color: var(--brand); background: var(--brand-soft); }
.opsi.dipilih .huruf { background: var(--brand); color: #fff; border-color: var(--brand); }
.nav-soal { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: .4rem; }
.nav-soal button { height: 42px; border-radius: 9px; border: 1.5px solid var(--bs-border-color); background: var(--surface); font-weight: 600; color: var(--bs-body-color); }
.nav-soal button.terjawab { background: var(--brand); color: #fff; border-color: var(--brand); }
.nav-soal button.ragu { background: #f59f00; color: #fff; border-color: #f59f00; }
.nav-soal button.aktif { outline: 3px solid rgba(20,184,166,.45); outline-offset: 1px; }
.no-select { -webkit-user-select: none; user-select: none; }
.fs-soal-1 .soal-body { font-size: 1rem; } .fs-soal-2 .soal-body { font-size: 1.15rem; } .fs-soal-3 .soal-body { font-size: 1.3rem; }
.save-ind { font-size: .8rem; opacity: .9; }

@media print { .app-sidebar, .app-topbar, .no-print { display: none !important; } .app-main { margin: 0; } }

/* Form di dalam modal yang dapat digulir: isi menggulir, footer (tombol Simpan) tetap terlihat */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; }
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }

/* Jenis soal: pilihan ganda kompleks & benar/salah */
.petunjuk-jenis { font-size: .9rem; padding: .5rem .8rem; border-radius: 10px; background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); margin-bottom: .8rem; }
.opsi .kotak { flex: 0 0 26px; height: 26px; margin-top: 4px; border-radius: 6px; border: 2px solid var(--bs-border-color); display: grid; place-items: center; color: transparent; font-size: .95rem; }
.opsi.opsi-pgk .huruf { border-radius: 8px; }
.opsi.dipilih .kotak { background: var(--brand); border-color: var(--brand); color: #fff; }
.opsi.opsi-bs { flex: 1 1 180px; justify-content: center; align-items: center; padding: 1rem; }
.opsi.opsi-bs.dipilih { color: var(--brand); }
.badge-jenis { font-size: .7rem; font-weight: 600; }
