:root {
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #162821;
  background: #f4f6f2;
  color-scheme: light;
  font-synthesis: none;
  --ink: #162821;
  --muted: #4f6158;
  --paper: #fff;
  --line: #d7e1d8;
  --green: #12533d;
  --green-deep: #102f26;
  --green-soft: #e8f2eb;
  --amber: #f3d694;
  --warning: #794913;
  --warning-soft: #f9efdc;
  --error: #8b3029;
  --ring: #177d58;
  --radius: 18px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--green); text-underline-offset: .19em; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { letter-spacing: -.036em; overflow-wrap: anywhere; }
h1 { margin: 0 0 10px; font-size: clamp(1.85rem, 4.9vw, 3.25rem); line-height: 1.06; }
h2 { margin: 0 0 14px; font-size: clamp(1.125rem, 1.7vw, 1.35rem); line-height: 1.23; }
h3 { margin: 0 0 8px; font-size: 1.02rem; }
p { margin: 0 0 12px; }
small { font-size: .82em; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; top: 10px; left: 10px; background: var(--paper); padding: 12px; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner, .frame { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: clamp(12px, 4.8vw, 62px); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 760; line-height: 1.12; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); letter-spacing: 0; font-weight: 490; font-size: .76rem; margin-top: 3px; }
.brand-mark {
  display: grid; place-items: center; width: 41px; height: 41px; flex: none;
  border-radius: 14px 14px 14px 5px; color: var(--amber); font-size: 1.23rem;
  background: var(--green-deep); box-shadow: inset 0 0 0 1px #ffffff20;
}
.header-inner nav { display: flex; flex-shrink: 0; gap: 4px; align-items: center; font-size: .92rem; }
.header-inner nav a { display: grid; align-items: center; min-height: 44px; padding-inline: 13px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 660; }
.header-inner nav a:hover, .header-inner nav a[aria-current] { background: var(--green-soft); color: var(--green); }
main { padding-block: clamp(23px, 5vw, 60px) 55px; flex: 1; }
footer { border-top: 1px solid var(--line); padding-block: 18px 26px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: .84rem; }
.eyebrow { margin: 0 0 11px; color: var(--green); font-size: .81rem; font-weight: 740; line-height: 1.35; }
.welcome {
  background: radial-gradient(ellipse at 5% 96%, #215a46 0, transparent 49%),
    linear-gradient(125deg, #102f26, #143d31 70%, #1c4b3b);
  border-radius: 25px; color: #fff; padding: clamp(25px, 6vw, 77px);
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(23px, 6vw, 72px); align-items: center; min-height: 430px;
}
.welcome .eyebrow { color: var(--amber); margin-bottom: 16px; }
.welcome h1 { font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: .99; letter-spacing: -.06em; margin: 0 0 19px; }
.welcome-intro > p:last-child { color: #e2eee6; max-width: 38ch; line-height: 1.6; margin-bottom: 0; }
.welcome .welcome-card { color: var(--ink); margin: 0; padding: clamp(17px, 3vw, 30px); border-color: transparent; box-shadow: 0 14px 44px #08251c59; }
.welcome .btn, .auth-card .auth-submit .btn { width: 100%; }
.subtle, .hint { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.hint { font-size: .875rem; margin: 7px 0 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: clamp(15px, 3.3vw, 29px); margin-top: 16px; min-width: 0; }
.narrow { max-width: 650px; margin-inline: auto; }
.fields, .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 17px; }
.fields .whole { grid-column: 1/-1; }
.fields label, label.field { display: grid; min-width: 0; gap: 6px; color: var(--ink); font-weight: 660; font-size: .9rem; align-content: start; }
.fields input, .fields textarea, .fields select, .field input, .field textarea, .field select {
  width: 100%; min-width: 0; min-height: 46px; border: 1px solid #a9bdb0;
  color: var(--ink); background: #fff; border-radius: 9px; padding: 10px 12px; font-weight: 480; font-size: 1rem;
}
.fields textarea, .field textarea { resize: vertical; }
.fields :is(select,input):disabled, .field :is(select,input):disabled { background: #f4f6f3; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; }
.actions:empty { display: none; }
.btn {
  max-width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 15px; border-radius: 9px; border: 1px solid var(--green);
  color: #fff; background: var(--green); text-decoration: none; font-weight: 680; text-align: center; line-height: 1.22;
}
.btn:not(:disabled):hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn.alt { background: #fff; color: var(--green); border-color: #a9bdb0; }
.btn.alt:not(:disabled):hover { background: var(--green-soft); border-color: var(--green); }
.btn:disabled { background: #dce6df; color: #43564b; border-color: #becec3; cursor: default; }
.notice {
  background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 8px;
  padding: 11px 13px; color: var(--green); line-height: 1.5; margin: 13px 0 0; overflow-wrap: anywhere;
}
.notice:empty { display: none; }
.notice.error { background: #f9eaea; color: var(--error); border-color: var(--error); }
.session-facts {
  padding: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(105px,1fr)); gap: 1px;
  margin: 20px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line);
}
.session-facts div { padding: 12px; background: #f6f8f4; overflow-wrap: anywhere; }
.session-facts dt { color: var(--muted); font-size: .84rem; }
.session-facts dd { margin: 4px 0 0; font-weight: 720; line-height: 1.35; }
.receipt { border-top: 4px solid var(--green); }
.receipt-warning { border-top-color: var(--warning); }
.receipt-facts dd { margin-top: 5px; font-size: 1.75rem; letter-spacing: -.035em; }
.receipt-facts dd small { font-size: .9rem; color: var(--muted); }
.exam-workspace { max-width: 1100px; margin-inline: auto; }
.exam-banner {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
  padding: 12px clamp(12px, 3vw, 24px); box-shadow: 0 5px 13px #102f260b;
}
.exam-banner h1 { margin: 0; font-size: clamp(1.03rem, 3vw, 1.72rem); overflow-wrap: anywhere; }
.exam-banner .eyebrow { margin-bottom: 4px; }
.time-box { flex: none; display: grid; gap: 1px; min-width: 90px; padding: 7px 11px; text-align: center; color: var(--green); background: var(--green-soft); border-radius: 9px; }
.time-box span { font-size: .75rem; font-weight: 650; }
.time-box.time-low { color: var(--warning); background: var(--warning-soft); }
.timer { font-size: 1.28rem; font-variant-numeric: tabular-nums; letter-spacing: .025em; }
.exam-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .41fr);
  grid-template-areas: "question progress" "question navigation";
  grid-template-rows: min-content 1fr; align-items: start; column-gap: 16px;
}
.question-panel { grid-area: question; }
.exam-progress { grid-area: progress; }
.exam-navigation { grid-area: navigation; }
.question-meta { display: flex; gap: 7px 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.question-meta h2 { margin: 0; scroll-margin-top: 120px; }
.question-meta h2 span, .question-kind { color: var(--muted); font-size: .83rem; letter-spacing: 0; }
.question-kind { font-weight: 600; }
.question { font-size: clamp(1.03rem, 2.5vw, 1.25rem); line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; margin: 15px 0 18px; }
.question-options { min-width: 0; margin: 0; border: 0; padding: 0; }
.option { position: relative; display: flex; gap: 12px; min-height: 51px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer; }
.option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.option:focus-within { outline: 3px solid var(--ring); outline-offset: 1px; }
.option:has(input:checked) { background: var(--green-soft); border-color: var(--green); }
.option:has(input:disabled) { cursor: default; }
.option span:last-child { overflow-wrap: anywhere; }
.option-letter { flex: none; display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); font-weight: 720; }
.option:has(input:checked) .option-letter { background: var(--green); color: #fff; border-color: var(--green); }
input[type=checkbox] { accent-color: var(--green); }
.character-count { text-align: right; font-variant-numeric: tabular-nums; }
.exam-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 17px; }
.exam-paging { display: flex; flex-wrap: wrap; gap: 7px; }
.exam-paging:empty { display: none; }
.exam-counter { color: var(--muted); font-size: .875rem; margin: 0 0 6px; }
.exam-counter strong { color: var(--ink); font-size: 1.15rem; }
progress { display: block; width: 100%; height: 8px; accent-color: var(--green); }
.save-state { font-size: .85rem; font-weight: 680; color: var(--green); margin: 10px 0 0; }
.save-state[data-state=saving], .save-state[data-state=warning] { color: var(--warning); }
.number-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(43px, 1fr)); gap: 6px; margin: 12px 0; }
.number-nav button { min-width: 0; min-height: 44px; border: 1px solid #b7cabc; background: #fff; color: var(--ink); border-radius: 8px; font-weight: 650; }
.number-nav button.filled { background: var(--green-soft); color: var(--green); border-color: #97b2a2; }
.number-nav button[aria-current] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
summary { color: var(--green); font-weight: 700; min-height: 36px; padding-block: 6px; }
.review-dialog { width: min(465px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 5vw, 28px); color: var(--ink); background: var(--paper); }
.review-dialog::backdrop { background: #102f26b3; }
.review-dialog .hint:empty { display: none; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; font-weight: 675; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.work-title, .section-heading {
  display: flex; justify-content: space-between; align-items: start; gap: 14px;
  flex-wrap: wrap; overflow-wrap: anywhere;
}
.work-title { margin: 0 0 14px; }
.work-title h1, .section-heading h2 { margin-bottom: 0; }
.work-title .subtle { margin: 7px 0 0; }
.work-title > .btn { flex-shrink: 0; }
.section-heading { align-items: center; }
.staff-profile {
  display: flex; justify-content: space-between; align-items: center; gap: 10px 15px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--line); background: #edf2ec; border-radius: 12px;
}
.staff-profile > div:first-child { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.staff-profile span { color: var(--muted); font-size: .87rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.row-actions .btn { font-size: .88rem; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 9px 12px; margin-bottom: 12px; }
.filter-bar .field:first-child { flex: 2 1 225px; }
.filter-bar .field:nth-child(2) { flex: 1 1 155px; }
.filter-bar .btn { min-height: 46px; }
.reset-filter { display: grid; align-items: center; min-height: 44px; font-weight: 640; }
.empty-state { padding-block: 15px; }
.empty-state p { margin-bottom: 0; }
.exam-list, .audit-list ul { list-style: none; padding: 0; margin: 0; }
.exam-list li { border-bottom: 1px solid var(--line); }
.exam-list li:last-child { border-bottom: 0; }
.exam-item {
  display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,.9fr) max-content 26px;
  gap: 10px 14px; align-items: center; padding: 13px 10px; min-height: 60px;
  text-decoration: none; color: var(--ink); border-radius: 8px; overflow-wrap: anywhere;
}
.exam-item:hover { background: #f1f6f1; }
.exam-item-title { min-width: 0; }
.exam-item-title small, .data-table small { display: block; color: var(--muted); margin-top: 4px; }
.exam-item-time { font-size: .88rem; color: var(--muted); }
.item-arrow { color: var(--green); font-weight: 700; text-align: center; }
.badge { display: inline-block; align-self: center; justify-self: start; border-radius: 7px; padding: 5px 8px; font-size: .8rem; line-height: 1.35; font-weight: 690; text-align: center; }
.badge-good { color: var(--green); background: var(--green-soft); }
.badge-caution { color: var(--warning); background: var(--warning-soft); }
.badge-neutral { color: #465850; background: #edf0ed; }
.pagination { border-top: 1px solid var(--line); padding-top: 12px; }
.create-form { display: grid; gap: 0; }
#question-preview > ol { max-height: 360px; overflow: auto; padding-inline-start: 22px; }
#question-preview :is(li,p) { overflow-wrap: anywhere; white-space: pre-wrap; }
#question-preview h3 { margin-top: 16px; }
#question-preview.preview-error { background: #f9eaea; color: var(--error); border-radius: 8px; padding: 10px; margin-top: 10px; }
.checkline { display: flex; gap: 9px; align-items: start; }
.checkline input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; }
.overview-facts { margin: 16px 0; }
.roster-facts { margin: 13px 0; }
.roster-facts dd { font-size: 1.35rem; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.data-table th { background: var(--green-soft); color: var(--green-deep); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.audit-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.audit-list small { display: block; color: var(--muted); margin-top: 3px; }
.access-card, .correction { background: #edf4ed; margin-top: 14px; border-radius: 10px; padding: 13px; overflow-wrap: anywhere; }
.access-card .btn { margin-top: 7px; }
.room-code { display: inline-block; padding: 4px 7px; background: var(--paper); border-radius: 4px; letter-spacing: .11em; font-family: ui-monospace, monospace; }
.credentials, .credentials a { overflow-wrap: anywhere; }
.correction { white-space: pre-wrap; }
.auth-card { max-width: 480px; margin-top: 0; border-top: 4px solid var(--green); padding: clamp(18px, 4.6vw, 37px); }
.auth-card h1 { font-size: clamp(1.7rem, 5vw, 2.55rem); }
.auth-form { display: grid; gap: 12px; margin-top: 18px; }
.auth-form label[for] { margin-bottom: -7px; }
.password-field { display: flex; align-items: stretch; min-height: 46px; min-width: 0; border: 1px solid #a9bdb0; border-radius: 9px; }
.password-field input { flex: 1 1 0; min-width: 0; border: 0; border-radius: 8px 0 0 8px; padding: 10px 12px; font-size: 1rem; }
.password-field button { flex: 0 0 auto; border: 0; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; background: #f1f6f1; color: var(--green); padding: 6px 10px; min-width: 56px; font-size: .86rem; font-weight: 650; }
.auth-form .hint { margin-top: -4px; }
.auth-card .auth-submit { margin-top: 6px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 0 16px; padding-top: 8px; margin-top: 14px; border-top: 1px solid var(--line); }
.auth-links a { display: inline-flex; min-height: 44px; align-items: center; font-size: .9rem; font-weight: 640; }
#roster-result { margin-bottom: 6px; }

@media (max-width: 820px) {
  .exam-grid {
    grid-template-columns: minmax(0,1fr); grid-template-areas: "progress" "question" "navigation";
    grid-template-rows: auto; gap: 0;
  }
  .exam-progress, .exam-navigation { padding: 10px 13px; margin-top: 8px; }
  .exam-progress h2 { display: none; }
  .exam-progress .hint { font-size: .8rem; margin-top: 4px; }
  .exam-navigation summary { min-height: 44px; }
  .exam-navigation { padding-block: 0; }
  .exam-navigation p { margin-bottom: 10px; }
  .exam-navigation .number-nav { max-height: 245px; overflow: auto; margin: 8px 0 0; padding: 3px; }
  .question-panel { margin-top: 9px; }
}

@media (max-width: 640px) {
  .header-inner { min-height: 62px; }
  .brand { gap: 6px; font-size: .94rem; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px 10px 10px 3px; font-size: 1rem; }
  .brand small { display: none; }
  .header-inner nav { font-size: .82rem; gap: 0; }
  .header-inner nav a { padding-inline: clamp(6px, 1.7vw, 11px); }
  .welcome, .columns, .fields { grid-template-columns: minmax(0, 1fr); }
  .welcome { min-height: 0; border-radius: 16px; padding: 18px; }
  .welcome h1 { font-size: clamp(2.03rem, 8vw, 3rem); }
  .welcome .welcome-card { padding: 16px; }
  .overview-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-facts div:last-child { grid-column: 1/-1; }
  .roster-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .exam-item { grid-template-columns: minmax(0,1fr) auto; gap: 5px 8px; padding: 11px 5px; }
  .exam-item-title { grid-column: 1; }
  .exam-item-time { grid-row: 2; grid-column: 1/-1; }
  .exam-item .badge { grid-row: 1; grid-column: 2; max-width: 96px; }
  .item-arrow { display: none; }
  .data-table { font-size: .88rem; }
  .data-table td, .data-table th { padding: 8px 6px; }
  .data-table td[data-label=Aksi] { min-width: 98px; }
  .data-table td .row-actions .btn { font-size: .78rem; min-height: 44px; padding: 5px; overflow-wrap: anywhere; }
  .section-heading .row-actions .btn { padding-inline: 9px; }
}
@media (max-width: 440px) {
  .filter-bar :is(.field:first-child, .field:nth-child(2)) { flex-basis: 100%; }
  .exam-actions, .exam-paging { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  .exam-paging { grid-column: 1/-1; }
  .exam-paging .btn:only-child, .exam-actions > .btn { grid-column: 1/-1; }
  .exam-actions .btn { padding-inline: 5px; }
  .exam-banner { padding: 7px 8px; top: env(safe-area-inset-top,0); }
  .exam-grid .question { margin-block: 10px 13px; }
  .option { padding: 7px 8px; gap: 7px; }
  .badge { font-size: .74rem; }
  .data-table td, .data-table th { padding: 8px 3px; }
  .data-table td[data-label=Aksi] { min-width: 74px; }
  .welcome { padding: 16px; }
  .welcome .welcome-card .btn { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

.question-upload { margin-top: 18px; }
.template-actions { margin-top: 10px; }
.question-csv { margin-top: 11px; }
.question-csv[open] { padding: 10px; background: #f2f6f2; border-radius: 10px; }
.simulation-banner { text-align: center; font-weight: 700; background: var(--warning-soft); color: var(--warning); }
.simulation-banner a { color: inherit; min-height: 44px; display: inline-flex; align-items: center; }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,275px),1fr)); gap: 12px; }
.sim-card { margin-top: 0; display: flex; flex-direction: column; }
.sim-card .actions { margin-top: auto; padding-top: 9px; }
.sim-stages { margin-top: 26px; }
.sim-data-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,230px),1fr)); gap: 8px; padding: 0; }
.sim-data-list li { list-style: none; background: var(--green-soft); padding: 11px; border-radius: 8px; }
.sim-data-list li :is(span,small) { display: block; margin-top: 4px; overflow-wrap: anywhere; }
