* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #eef2f6;
  color: #1c1917;
  line-height: 1.5;
}

a {
  color: #1d4ed8;
}

code {
  font-family: Consolas, "Courier New", monospace;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
}

h1 {
  margin-top: 0;
  font-size: 24px;
}

h2 {
  font-size: 18px;
  margin-top: 28px;
}

.kartu {
  max-width: 980px;
  margin: 32px auto;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.kartu.sempit {
  max-width: 520px;
}

.kartu.penuh {
  max-width: 1400px;
}

.ket,
.redup {
  color: #57534e;
}

.kecil {
  font-size: 13px;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
}

.teks-merah {
  color: #b91c1c;
  font-weight: bold;
}

/* ---------- Form umum ---------- */

label {
  display: block;
  margin: 12px 0 6px;
  font-weight: bold;
}

input,
select {
  font: inherit;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.sempit form input:not([type="checkbox"]),
.sempit form select {
  width: 100%;
}

button,
.tombol-utama,
.tombol-kecil {
  font: inherit;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.tombol-utama {
  margin-top: 18px;
  padding: 12px 18px;
  background: #1d4ed8;
  color: #fff;
  font-weight: bold;
}

.tombol-kecil {
  padding: 6px 12px;
  background: #e2e8f0;
  color: #1c1917;
  font-size: 14px;
}

.tombol-kecil.hijau {
  background: #0f766e;
  color: #fff;
}

.tombol-kecil.merah {
  background: #fee2e2;
  color: #991b1b;
}

.aturan {
  background: #f8fafc;
  border-left: 4px solid #1d4ed8;
  padding: 10px 10px 10px 28px;
  border-radius: 6px;
}

.kaki-tautan {
  margin-top: 24px;
  text-align: center;
}

/* ---------- Halaman ujian ---------- */

.bilah {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.bilah .redup {
  margin-left: 8px;
  font-size: 14px;
}

.bilah-kanan {
  display: flex;
  align-items: center;
  gap: 16px;
}

.waktu {
  background: #1e293b;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
}

.waktu strong {
  font-family: Consolas, monospace;
  font-size: 18px;
}

.waktu strong.kritis {
  color: #fca5a5;
}

.tata-ujian {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
}

.navigasi {
  position: sticky;
  top: 70px;
  align-self: start;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.navigasi p {
  margin: 0 0 8px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.nav-grid a {
  display: block;
  text-align: center;
  padding: 5px 0;
  border-radius: 6px;
  background: #f1f5f9;
  color: #1c1917;
  text-decoration: none;
  font-size: 13px;
}

.nav-grid a.terisi {
  background: #16a34a;
  color: #fff;
}

.petunjuk {
  background: #eff6ff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 0;
}

.kirim {
  text-align: center;
  padding: 10px 0 40px;
}

.peringatan-tab {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #991b1b;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
  max-width: 90%;
}

/* ---------- Soal ---------- */

.soal {
  background: #fff;
  padding: 18px 20px;
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  scroll-margin-top: 80px;
  border-left: 5px solid #cbd5e1;
}

.soal.ulas-benar {
  border-left-color: #16a34a;
}

.soal.ulas-salah,
.soal.ulas-kosong {
  border-left-color: #dc2626;
}

.soal.ulas-sebagian {
  border-left-color: #f59e0b;
}

.soal-kepala {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nomor {
  font-weight: bold;
}

.lencana {
  background: #e0e7ff;
  color: #3730a3;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.status {
  font-size: 12px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 999px;
}

.status-benar {
  background: #dcfce7;
  color: #166534;
}

.status-salah,
.status-kosong {
  background: #fee2e2;
  color: #991b1b;
}

.status-sebagian {
  background: #fef3c7;
  color: #92400e;
}

.kode {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 0;
  overflow-x: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
}

.kode .baris {
  display: flex;
  white-space: pre;
  min-height: 1.6em;
  align-items: center;
}

.kode .no {
  flex: 0 0 36px;
  text-align: right;
  padding-right: 12px;
  color: #64748b;
  user-select: none;
}

.kode.urut .no {
  color: #fbbf24;
  font-weight: bold;
}

.kode .isi {
  padding-right: 16px;
}

.kode input.isian {
  font-family: inherit;
  font-size: 14px;
  padding: 1px 6px;
  background: #fef9c3;
  color: #1c1917;
  border: 1px solid #facc15;
  border-radius: 4px;
}

.kolom > span:first-child {
  display: block;
  margin-bottom: 4px;
}

input.isian.lebar {
  width: 100%;
  max-width: 620px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: normal;
}

.pilihan {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.opsi {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  font-weight: normal;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
}

.opsi.benar {
  background: #dcfce7;
  border-color: #16a34a;
}

.opsi.salah {
  background: #fee2e2;
  border-color: #dc2626;
}

.opsi.kunci {
  border: 2px dashed #16a34a;
}

.isian-ulas {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  font-family: Consolas, monospace;
  white-space: pre;
}

.isian-ulas.benar {
  background: #16a34a;
  color: #fff;
}

.isian-ulas.salah {
  background: #dc2626;
  color: #fff;
  text-decoration: line-through;
}

.isian-ulas.kosong {
  text-decoration: none;
  font-style: italic;
}

.isian-kunci {
  margin-left: 6px;
  color: #166534;
}

.kode .isian-kunci {
  color: #86efac;
}

.kode .isian-kunci code {
  background: #14532d;
  color: #dcfce7;
}

.penjelasan {
  background: #f0fdf4;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 0;
}

.pratinjau {
  margin-top: 12px;
}

.pratinjau iframe {
  display: block;
  width: 100%;
  height: 260px;
  margin-top: 8px;
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.pratinjau iframe[hidden] {
  display: none;
}

/* ---------- Hasil ---------- */

.ringkas {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
}

.identitas p {
  margin: 2px 0;
}

.nama-peserta {
  font-size: 20px;
  font-weight: bold;
}

.skor {
  display: grid;
  justify-items: center;
  padding: 12px 24px;
  border-radius: 12px;
  background: #1d4ed8;
  color: #fff;
}

.skor.huruf-A {
  background: #15803d;
}

.skor.huruf-B {
  background: #1d4ed8;
}

.skor.huruf-C {
  background: #b45309;
}

.skor.huruf-D,
.skor.huruf-E {
  background: #b91c1c;
}

.skor-angka {
  font-size: 40px;
  font-weight: bold;
  line-height: 1.1;
}

.skor-huruf {
  font-size: 18px;
  font-weight: bold;
}

.batang-daftar {
  display: grid;
  gap: 8px;
}

.batang {
  display: grid;
  grid-template-columns: 190px 1fr 50px;
  align-items: center;
  gap: 10px;
}

.batang-jalur {
  display: inline-block;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
}

.batang-jalur.mini {
  width: 140px;
  vertical-align: middle;
  margin-right: 8px;
}

.batang-isi {
  display: block;
  height: 100%;
  background: #16a34a;
}

.batang-nilai {
  text-align: right;
  font-weight: bold;
}

/* ---------- Rekap ---------- */

.judul-baris {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel {
  background: #f8fafc;
  padding: 4px 16px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.saklar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  margin: 8px 0;
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px 0;
}

.filter input,
.filter select {
  padding: 6px 10px;
}

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

.statistik div {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  color: #57534e;
  font-size: 14px;
}

.statistik span {
  display: block;
  font-size: 26px;
  font-weight: bold;
  color: #1c1917;
}

.gulir {
  overflow-x: auto;
}

.tabel {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tabel th,
.tabel td {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}

.tabel th {
  background: #f1f5f9;
  white-space: nowrap;
}

.tabel .aksi {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tabel .aksi form {
  margin: 0;
}

.akhiri-sesi {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.akhiri-sesi form {
  margin: 0;
}

@media (max-width: 760px) {
  .tata-ujian {
    grid-template-columns: 1fr;
  }

  .navigasi {
    position: static;
  }

  .nav-grid {
    grid-template-columns: repeat(10, 1fr);
  }

  .batang {
    grid-template-columns: 1fr 50px;
  }

  .batang-jalur:not(.mini) {
    grid-column: 1 / -1;
    order: 3;
  }
}
