/* ══════════════════════════════════
   KISI-KISI SOAL — document.css
   Styling dokumen cetak F4 Landscape (330mm × 215mm)
   ══════════════════════════════════ */

/* ── CONTAINER DOKUMEN ── */
.page {
  width: 330mm;
  min-height: 215mm;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  padding: var(--margin, 15mm);
  font-family: 'Times New Roman', Times, serif;
  color: #1a1a1a;
  font-size: 10px;
  line-height: 1.4;
  box-sizing: border-box;
}

/* Portrait orientation */
.page.portrait {
  width: 215mm;
  min-height: 330mm;
}

/* ── HEADER DOKUMEN (KOP SURAT 4 BARIS STANDAR) ── */
.doc-header {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 10px;
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  padding: 7px 0;
  margin-bottom: 14px;
}

.logo-box {
  width: 52px;
  height: 52px;
  border: 1.5px dashed #555;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 6.5pt;
  color: #555;
  text-align: center;
  line-height: 1.3;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-box.has-logo {
  border: none;
}

.doc-title-center {
  text-align: center;
  line-height: 1.25;
  font-family: Arial, sans-serif;
}

.kop-pemda {
  font-size: 8pt;
  font-weight: normal;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
}

.kop-dinas {
  font-size: 9pt;
  font-weight: bold;
  letter-spacing: 0.03em;
  margin-bottom: 1px;
}

.kop-sekolah {
  font-size: 12pt;
  font-weight: bold;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.kop-alamat {
  font-size: 7.5pt;
  font-weight: normal;
  font-style: italic;
  letter-spacing: 0.01em;
}

/* ── JUDUL DOKUMEN ── */
.doc-title-block {
  text-align: center;
  margin: 10px 0 14px;
  padding: 8px 0;
}

.doc-title {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: Arial, sans-serif;
}

.doc-subtitle {
  font-size: 10px;
  color: #333;
  font-family: Arial, sans-serif;
  margin-top: 2px;
}

/* ── IDENTITAS ── */
.identitas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin-bottom: 16px;
  font-size: 10.5px;
  font-family: Arial, sans-serif;
}

.id-row,
.id-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px;
  line-height: 1.4;
  align-items: start;
}

.id-label {
  color: #333;
}

.id-val {
  font-weight: 600;
  color: #111;
}

/* ── TABEL KISI-KISI ── */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 14px;
}

table.kisi {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  font-family: Arial, sans-serif;
}

table.kisi thead tr {
  background: #1a4a7a !important;
  color: #fff !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

table.kisi thead tr.sub-header {
  background: #2d6aad !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

table.kisi th {
  border: 1px solid #1a4a7a;
  padding: 5px 6px;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
  vertical-align: middle;
}

table.kisi td {
  border: 1px solid #b0b8c8;
  padding: 5px 6px;
  vertical-align: top;
  line-height: 1.4;
}

table.kisi td:nth-child(3) {
  vertical-align: middle;
  padding-top: 6px;
  padding-bottom: 6px;
}

table.kisi td.center {
  text-align: center;
  vertical-align: middle;
}

table.kisi td.no {
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
}

table.kisi tr:nth-child(even) td {
  background: #f5f7fb;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Elemen header row */
table.kisi tr.elemen-header td {
  background: #dce6f4 !important;
  font-weight: 700;
  font-size: 9px;
  color: #1a4a7a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Level badge */
.badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-l1 {
  background: #d4edda !important;
  color: #155724 !important;
  border: 1px solid #c3e6cb;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.badge-l2 {
  background: #fff3cd !important;
  color: #856404 !important;
  border: 1px solid #ffc107;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.badge-l3 {
  background: #f8d7da !important;
  color: #721c24 !important;
  border: 1px solid #f5c6cb;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Bentuk soal badge */
.soal-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 700;
  background: #e8edf7 !important;
  color: #1a4a7a !important;
  border: 1px solid #b0c4e0;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* ── REKAPITULASI ── */
.rekap-section {
  margin-top: 16px;
  page-break-inside: avoid;
}

.rekap-title {
  font-size: 10px;
  font-weight: 700;
  font-family: Arial, sans-serif;
  color: #1a4a7a;
  border-left: 3px solid #1a4a7a;
  padding-left: 8px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

table.rekap {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
  font-family: Arial, sans-serif;
}

table.rekap th {
  background: #1a4a7a !important;
  color: #fff !important;
  border: 1px solid #1a4a7a;
  padding: 4px 8px;
  text-align: center;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

table.rekap td {
  border: 1px solid #b0b8c8;
  padding: 4px 8px;
  vertical-align: middle;
}

table.rekap td.center {
  text-align: center;
}

table.rekap tr:nth-child(even) td {
  background: #f5f7fb !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

table.rekap tr.total-row td {
  font-weight: 700;
  background: #dce6f4 !important;
  color: #1a4a7a !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

table.rekap tr.ttd-row td {
  background: #fff !important;
  padding: 8px;
}

.ttd-rekap {
  font-family: Arial, sans-serif;
  font-size: 9px;
}

.ttd-rekap-info {
  text-align: right;
  margin-bottom: 6px;
  color: #333;
}

.ttd-rekap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
}

.ttd-rekap-table th {
  border: 1px solid #b0b8c8;
  padding: 4px 6px;
  text-align: center;
  background: #eef2f8 !important;
  color: #1a4a7a !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.ttd-rekap-table td {
  border: 1px solid #b0b8c8;
  padding: 6px;
  vertical-align: middle;
}

.ttd-rekap-table td.center {
  text-align: center;
}

.ttd-rekap-table .ttd-slot {
  height: 32px;
}

/* ── TTD ── */
.ttd-section {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  page-break-inside: avoid;
}

.ttd-box {
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 10px;
  min-width: 180px;
}

.ttd-box .ttd-place-date {
  margin-bottom: 4px;
  color: #333;
}

.ttd-box .ttd-space {
  height: 36px;
  margin: 0 20px 6px;
}

.ttd-box .ttd-name {
  font-weight: 700;
  font-size: 10.5px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.ttd-box .ttd-nip {
  color: #555;
  font-size: 9px;
  margin-top: 1px;
}

/* ── PRINT MEDIA ── */
@media print {
  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .page {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    page-break-after: always;
    box-sizing: border-box !important;
  }

  table {
    page-break-inside: auto;
  }

  table.kisi tr,
  table.rekap tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  table.kisi thead,
  table.rekap thead {
    display: table-header-group !important;
  }
}
