/* CSS Dokumen Prosem — Diambil dari mockup */
/* Tidak boleh diubah, digunakan untuk rendering output */

*, *::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; }

/* A4 LANDSCAPE — Prosem butuh banyak kolom minggu */
.page {
  width: 297mm;
  min-height: 210mm;
  margin: 20px auto;
  background: #fff;
  padding: 10mm 10mm 10mm 10mm;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.nomor-dok { font-size: 8pt; color: #444; text-align: right; margin-bottom: 4px; }

.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;
  }
  .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: 9.5pt;
    color: #444;
  }
  .ttd-wrapper {
    margin-top: 20px;
    page-break-inside: avoid;
  }

.identitas { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 10pt; }
.identitas td { padding: 3px 7px; border: 1px solid #000; }
.identitas td:first-child { font-weight: bold; white-space: nowrap; width: 22%; }

.section-title {
  font-size: 10.5pt; font-weight: bold; color: #000; text-transform: uppercase;
  letter-spacing: 0.04em; border-left: 4px solid #000;
  padding: 3px 8px; margin: 12px 0 7px 0; background: #f5f5f5;
}

/* ── TABEL PROSEM UTAMA ── */
table.prosem {
  width: 100%;
  border-collapse: collapse;
  font-size: 8pt;
  margin-bottom: 10px;
}
table.prosem th {
  background: #1a365d;
  color: #fff;
  padding: 5px 4px;
  text-align: center;
  border: 1px solid #000;
  vertical-align: middle;
  line-height: 1.3;
}
table.prosem th.bulan {
  background: #2c5aa0;
}
table.prosem td {
  padding: 4px 5px;
  border: 1px solid #000;
  vertical-align: middle;
  line-height: 1.4;
}
table.prosem td.no { text-align: center; font-weight: bold; width: 20px; }
table.prosem td.kode {
  font-family: 'Courier New', monospace;
  font-size: 7.5pt;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
}
table.prosem td.jp { text-align: center; font-weight: bold; }
table.prosem td.ket { font-size: 7.5pt; }

/* Minggu cell */
table.prosem td.minggu-aktif {
  background: #4a90e2;
  color: #fff;
  text-align: center;
  font-weight: bold;
  font-size: 8pt;
}
table.prosem td.minggu-kosong {
  background: #fff;
  text-align: center;
}
table.prosem td.minggu-libur {
  background: #e6f2ff;
  text-align: center;
  font-size: 7pt;
  color: #1a365d;
}
table.prosem td.minggu-pts {
  background: #4a90e2;
  color: #fff;
  text-align: center;
  font-size: 7pt;
}
table.prosem td.minggu-pas {
  background: #2c5aa0;
  color: #fff;
  text-align: center;
  font-size: 7pt;
}

/* Row types */
table.prosem tr.elemen-header td {
  background: #edf5ff;
  color: #1a365d;
  font-weight: bold;
  font-size: 8.5pt;
  padding: 4px 6px;
  border-bottom: 2px solid #1a365d;
}
table.prosem tr.subtotal td {
  background: #e6f2ff;
  color: #1a365d;
  font-weight: bold;
  text-align: center;
  font-size: 8pt;
}
table.prosem tr.subtotal td.label {
  text-align: right;
  padding-right: 8px;
}
table.prosem tr.grandtotal td {
  background: #1a365d;
  color: #fff;
  font-weight: bold;
  text-align: center;
  font-size: 8pt;
}
table.prosem tr.grandtotal td.label {
  text-align: right;
  padding-right: 8px;
}

/* LEGENDA */
.legenda {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 8pt;
  margin-bottom: 10px;
  padding: 5px 8px;
  border: 1px solid #ccc;
  background: #fafafa;
}
.legenda-item { display: flex; align-items: center; gap: 5px; }
.legenda-box {
  width: 16px; height: 12px; border: 1px solid #000; display: inline-block; flex-shrink: 0;
}
.lb-aktif { background: #4a90e2; }
.lb-libur { background: #e6f2ff; }
.lb-pts   { background: #4a90e2; }
.lb-pas   { background: #2c5aa0; }
.lb-kosong { background: #fff; }

.catatan { font-size: 8pt; color: #1a365d; margin-bottom: 10px; padding: 5px 8px; border-left: 3px solid #1a365d; line-height: 1.7; background: #edf5ff; }

.doc-footer {
  border-top: 2px solid #1a365d; margin-top: 12px; padding-top: 4px;
  display: flex; justify-content: space-between; font-size: 8pt; color: #1a365d;
}

/* PAGE BREAK antar semester */
.page-break { page-break-before: always; }

/* ── Area TTD Pengesahan ── */
.ttd-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
  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;
}

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

/* ── Indikator minggu terpotong libur (v2.0) ── */
td.minggu-terpotong {
  background-color: #fff8e1;
  color: #5d4037;
  font-weight: 600;
  text-align: center;
}

.catatan-kaki {
  margin-top: 12px;
  padding: 8px 12px;
  border-top: 1px solid #ccc;
  font-size: 11px;
  color: #333;
}

.catatan-kaki ul {
  margin: 4px 0 0 16px;
  padding: 0;
}

.catatan-kaki li {
  margin-bottom: 2px;
}