*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Times New Roman', Times, serif;
  font-size: 12pt;
  background: #e0e0e0;
  color: #000;
}

.page {
  width: 210mm;
  min-height: 297mm;
  margin: 20px auto;
  background: #fff;
  padding: 20mm 20mm 20mm 25mm;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

/* HEADER */
.doc-header {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid #000;
  padding: 8px 0;
  margin-bottom: 16px;
}

.logo-box {
  width: 56px;
  height: 56px;
  border: 1.5px dashed #555;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 7pt;
  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;
  }
  .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;
  }
  .doc-judul-area {
    text-align: center;
    margin-bottom: 12px;
  }
  .doc-judul-area .judul-utama {
    font-size: 14pt;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 4px 0 2px 0;
  }
  .doc-judul-area .subjudul {
    font-size: 10pt;
    color: #444;
  }
  .ttd-wrapper {
    margin-top: 20px;
    page-break-inside: avoid;
  }
  .ttd-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 8px;
    page-break-inside: avoid;
  }
  .ttd-box {
    text-align: center;
    font-size: 10pt;
    padding: 8px 12px;
  }
  .ttd-box .ttd-jabatan {
    font-weight: bold;
    color: #1a365d;
    font-size: 9.5pt;
    margin-bottom: 4px;
  }
  .ttd-box .ttd-tanggal {
    font-size: 9.5pt;
    margin-bottom: 44px;
  }
  .ttd-box .ttd-nama {
    font-weight: bold;
    font-size: 10pt;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .ttd-box .ttd-nip {
    font-size: 9pt;
    color: #333;
    margin-top: 3px;
  }

/* NOMOR DOKUMEN */
.nomor-dok {
  font-size: 8.5pt;
  color: #444;
  text-align: right;
  margin-bottom: 4px;
}

/* IDENTITAS */
.identitas {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 11pt;
}
.identitas td {
  padding: 4px 8px;
  border: 1px solid #000;
  vertical-align: middle;
}
.identitas td:first-child {
  font-weight: bold;
  white-space: nowrap;
  width: 38%;
}

/* SECTION TITLE */
.page .section-title {
  font-size: 11pt;
  font-weight: bold;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-left: 4px solid #000;
  padding: 3px 8px;
  margin: 14px 0 8px 0;
  background: #f5f5f5;
}

/* TABEL UTAMA */
table.main {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5pt;
  margin-bottom: 14px;
}
table.main th {
  background: #1a365d;
  color: #fff;
  padding: 6px 8px;
  text-align: center;
  font-size: 10pt;
  font-weight: bold;
  border: 1px solid #000;
  vertical-align: middle;
}
table.main td {
  padding: 6px 8px;
  border: 1px solid #000;
  vertical-align: middle;
  line-height: 1.5;
}
table.main tr:nth-child(even) td { background: #fafafa; }
table.main td.no {
  text-align: center;
  width: 32px;
  font-weight: bold;
}
table.main td.kode {
  text-align: center;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  font-size: 7.5pt;
  width: 80px;
  word-break: break-all;
  line-height: 1.4;
}
table.main td.center { text-align: center; }
table.main td.elemen {
  font-weight: bold;
  font-size: 10pt;
}

/* ASPEK — teks biasa */
.badge {
  font-size: 10pt;
  font-weight: normal;
}

/* KETERANGAN KODE */
.kode-box {
  border: 1px solid #000;
  padding: 8px 12px;
  font-size: 9.5pt;
  margin-bottom: 14px;
  background: #fafafa;
}
.kode-box strong { display: block; margin-bottom: 4px; }
.kode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 16px;
}

/* FOOTER */
.doc-footer {
  border-top: 2px solid #000;
  margin-top: 16px;
  padding-top: 5px;
  display: flex;
  justify-content: space-between;
  font-size: 8.5pt;
  color: #333;
}

@media print {
  body { background: #fff; }
  .page {
    margin: 0;
    box-shadow: none;
    padding: 0;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}