/* Tambahan kecil di atas W3.CSS */
:root { --navy: #1e3a8a; --navy-soft: #e1e8f7; --paper: #f2f5f9; }
html, body, h1, h2, h3, h4, h5, h6 { font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { background: var(--paper); color: #14203a; }
.w3-indigo, .w3-hover-indigo:hover { background-color: var(--navy) !important; color: #fff !important; }
.w3-text-indigo { color: var(--navy) !important; }

/* menu atas */
.topnav { position: sticky; top: 0; z-index: 20; }
.topnav-in { display: flex; align-items: center; gap: 4px; padding: 0 16px; max-width: 1400px; margin: 0 auto; }
.brand-top { display: flex; flex-direction: column; justify-content: center; padding: 10px 16px 10px 0; text-decoration: none; color: inherit; line-height: 1.2; }
.brand-top b { font-size: 1.1rem; font-weight: 800; color: var(--ink, #14203a); }
.brand-top small { font-size: .72rem; color: #6b7690; }
.main-menu { flex: 1; }
.main-menu .w3-bar-item.w3-button, .main-menu > .w3-dropdown-hover > button { padding: 18px 14px; border-bottom: 3px solid transparent; background: none; font-weight: 600; color: #3a4257; }
.main-menu .w3-bar-item.w3-button:hover, .main-menu > .w3-dropdown-hover > button:hover { background: var(--navy-soft); border-bottom-color: #c5cfdf; }
.main-menu .active, .main-menu > .w3-dropdown-hover > button.active { color: var(--navy); border-bottom-color: var(--navy); }
.main-menu .caret { font-size: .7rem; margin-left: 2px; }
.main-menu .w3-dropdown-content { min-width: 210px; margin-top: -1px; border-top: 3px solid var(--navy); z-index: 21; }
.main-menu .w3-dropdown-content .w3-bar-item { padding: 10px 16px; border-bottom: 0 !important; font-weight: 500; }
.main-menu .w3-dropdown-content .w3-bar-item.active { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.user-box { align-items: center; }
.hamburger { font-size: 1.4rem; padding: 8px 10px; }
.mobile-menu { display: none; border-top: 1px solid #e3e8f0; max-height: 75vh; overflow-y: auto; }
.mobile-menu .w3-bar-item.w3-button { padding: 12px 16px; }
.mobile-menu .mobile-sub { padding-left: 28px; }
.mobile-menu .menu-label { padding: 12px 16px 4px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #6b7690; }
.mobile-menu .active { background: var(--navy-soft); color: var(--navy); font-weight: 700; }
.content-main { max-width: 1200px; margin: 0 auto; }

/* konten */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-weight: 800; }
.card { background: #fff; border-radius: 12px; border: 1px solid #d5dde9; }
.stat b { font-size: 2rem; font-weight: 800; display: block; line-height: 1.1; }
.inline { display: inline; }
.w3-table-all td, .w3-table-all th { vertical-align: middle; }
.w3-table-all th { background: #e9eef5; }
label.lbl { display: block; font-weight: 600; margin: 14px 0 6px; }
.w3-input, .w3-select { border-radius: 8px; }
.field-err { margin-top: 4px; }
.req { color: #b8382a; }
.nowrap { white-space: nowrap; }
.filter .w3-input, .filter .w3-select { padding: 8px; }

/* halaman login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 12px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 760px; }

/* soal */
.soal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #e3e8f0; }
.soal-no { font-size: 1.15rem; margin-right: 6px; }
.soal-body { padding: 14px 16px; }
.stimulus { background: #f2f5f9; border-left: 4px solid var(--navy); padding: 10px 14px; border-radius: 0 8px 8px 0; margin-bottom: 12px; }
.pertanyaan { font-weight: 600; margin-top: 0; }
.opsi-list { display: grid; gap: 8px; }
.opsi { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #d5dde9; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.opsi input { margin-top: 4px; }
.opsi:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.opsi.kunci { border-color: #2e7d32; }
.sa-box { border: 1px solid #d5dde9; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.sa-box p { margin: 4px 0 8px; font-weight: 600; }
.sa-sebab { font-weight: 800; letter-spacing: .12em; color: var(--navy); text-align: center; margin: 4px 0; }
.bs-table td, .bs-table th { vertical-align: middle; }
.jodoh-row { display: grid; grid-template-columns: 1fr 180px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #e3e8f0; }
.jodoh-row .w3-small { grid-column: 1 / -1; }
.pembahasan { margin-top: 14px; background: #fff8e1; border-radius: 8px; padding: 10px 14px; }
.stimulus img, .pertanyaan img, .pembahasan img, .sa-box img { max-width: 100%; height: auto; border-radius: 6px; margin: 6px 0; display: block; }
.stimulus p, .pertanyaan p, .pembahasan p, .sa-box p { margin: 0 0 8px; }
.stimulus p:last-child, .pertanyaan p:last-child, .pembahasan p:last-child, .sa-box p:last-child { margin-bottom: 0; }
.stimulus ul, .pertanyaan ul, .pembahasan ul, .stimulus ol, .pertanyaan ol, .pembahasan ol { padding-left: 22px; margin: 0 0 8px; }
.opsi-teks p { display: inline; margin: 0; }
.opsi-teks img, .bs-table img { max-height: 90px; width: auto; max-width: 100%; vertical-align: middle; border-radius: 4px; }
.bs-table td p { margin: 0 0 4px; }
.bs-table td p:last-child { margin-bottom: 0; }
.param { font-variant-numeric: tabular-nums; }
.jenis-sec { border: 1px dashed #c5cfdf; border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.row-opsi { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.row-bs { display: grid; grid-template-columns: 1fr 130px; gap: 8px; margin-bottom: 8px; align-items: start; }
.row-bs select { margin-top: 2px; }
.row-jd { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; align-items: start; }
.score-circle { width: 120px; height: 120px; border-radius: 50%; border: 6px solid var(--navy); display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; }
.score-circle b { font-size: 2.6rem; line-height: 1; }
@media (max-width: 600px) { .jodoh-row { grid-template-columns: 1fr; } .row-bs, .row-jd { grid-template-columns: 1fr; } }

/* generator */
.sec-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.sec-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 7px 16px; border: 1.5px solid #c5cfdf; border-radius: 999px; cursor: pointer; font-weight: 600; }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid #f4c33d; }
.materi-list { max-height: 260px; overflow-y: auto; border: 1px solid #d5dde9; border-radius: 8px; padding: 6px 10px; }
.materi-item { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #eef1f6; cursor: pointer; }
.materi-item[hidden] { display: none; }
/* w3.css menetapkan display pada banyak class (mis. .w3-button) sebagai author style,
   sehingga menang atas default browser [hidden]{display:none} meski tanpa !important.
   Aturan global ini mengembalikan agar atribut hidden selalu benar-benar menyembunyikan elemen. */
[hidden] { display: none !important; }
.jenis-table td { vertical-align: middle; padding: 6px 4px; }
.jml:disabled { background: #f2f5f9; color: #9aa3b5; }
.persen-wrap { display: flex; align-items: center; gap: 6px; }
.ringkasan { position: sticky; top: 64px; }
.bar-tingkat { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #e3e8f0; margin: 12px 0 6px; }
.prompt-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; }

/* ujian */
.row-opsi-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ujian-card { height: 100%; }
.ujian-bar .topnav-in { justify-content: space-between; }
.timer-box { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; background: var(--surface-2, #e9eef5); padding: 8px 18px; border-radius: 999px; }
.timer-box.timer-low { background: var(--bad-soft, #f8e2de); color: var(--bad, #b8382a); }
.ujian-header-right { display: flex; align-items: center; gap: 14px; }
.ujian-header-nav { display: flex; align-items: center; gap: 10px; }
@media (max-width: 480px) { .ujian-header-nav #soal-posisi { display: none; } }

/* Navigasi ujian satu-soal-per-layar */
.ujian-topbar { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ujian-topbar-nav { display: flex; align-items: center; gap: 10px; }
.ujian-navbar { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #d5dde9; flex-wrap: wrap; }
.ujian-navbar .w3-margin-left { margin-left: auto !important; }
.ujian-wrap { max-width: 1080px; margin-left: 0; margin-right: 0; }
@media (max-width: 480px) { .ujian-navbar { justify-content: space-between; } .ujian-navbar .w3-margin-left { margin-left: 0 !important; width: 100%; order: 3; } }

.modal-soal-overlay {
    position: fixed; inset: 0; background: rgba(20, 32, 58, .55); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-soal-overlay[hidden] { display: none; }
.modal-soal-box { width: 100%; max-width: 640px; max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-soal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #e3e8f0; }
.modal-soal-head button { padding: 4px 10px; }
.modal-soal-legenda { display: flex; gap: 16px; padding: 10px 16px 0; font-size: .82rem; color: #6b7690; }
.modal-soal-legenda .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #9aa3b5; margin-right: 5px; vertical-align: middle; }
.modal-soal-legenda .dot.dijawab { background: #1a7a3c; border-color: #1a7a3c; }
.modal-soal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; padding: 14px 16px; overflow-y: auto; }
.btn-nomor-soal {
    aspect-ratio: 1; border: 2px solid #d5dde9; border-radius: 8px; background: #fff; font-weight: 700;
    cursor: pointer; font-size: .95rem; color: #14203a;
}
.btn-nomor-soal:hover { border-color: #1e3a8a; }
.btn-nomor-soal.dijawab { background: #e5f4ea; border-color: #1a7a3c; color: #1a7a3c; }
.btn-nomor-soal.aktif { outline: 3px solid #1e3a8a; outline-offset: 1px; }

.sumber-pilih { display: block; border: 1.5px solid #d5dde9; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.sumber-pilih:has(input:checked) { border-color: #1e3a8a; background: #f2f5fc; }
.ujian-body { background: var(--paper, #f2f5f9); }

/* Anti-kecurangan */
.pelanggaran-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--bad-soft, #f8e2de); color: var(--bad, #b8382a); font-weight: 700; font-size: .85rem; padding: 6px 12px; border-radius: 999px; }
.modal-peringatan .modal-soal-box, #gerbang-fs .modal-soal-box { align-items: center; }
.peringatan-ikon { font-size: 2.4rem; line-height: 1; }
/* Cegah seleksi/penyalinan teks soal saat mode anti-kecurangan aktif; input jawaban tetap bisa diketik & diseleksi. */
#ujian-form { user-select: none; -webkit-user-select: none; }
#ujian-form input, #ujian-form textarea, #ujian-form select { user-select: text; -webkit-user-select: text; }

/* pratinjau rumus (KaTeX) */
.katex-preview { margin: 10px 0 16px; padding: 10px 14px; background: #f2f5f9; border: 1px dashed #c5cfdf; border-radius: 8px; }
.katex-preview-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6b7690; margin-bottom: 6px; }
.katex-preview > div:not(.katex-preview-label) { margin-bottom: 6px; font-size: .95rem; }
.katex-preview > div:empty { display: none; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* Mode ringkas untuk opsi jawaban: lebih pendek, toolbar lebih kecil, muat dalam satu baris/tabel. */
.editor-soal-compact .editor-soal-toolbar { padding: 3px 4px; gap: 2px; }
.editor-soal-compact .editor-soal-btn { padding: 3px 7px; font-size: .82rem; }
.editor-soal-compact .editor-soal-area { padding: 6px 10px; min-height: 0; }
.editor-soal-compact .editor-soal-area .ProseMirror { min-height: 22px; font-size: .95rem; line-height: 1.4; }
.editor-soal-compact .editor-soal-area .ProseMirror p { margin: 0; }
.editor-soal-compact .editor-soal-img { max-height: 120px; width: auto; max-width: 100%; }
.editor-soal-compact .editor-soal-status { font-size: .72rem; }
