/* Borang: susunan meniru borang kertas, A4 (TIDAK DIUBAH untuk cetakan) */
.pratonton { overflow-x: auto; background: #e5e7eb; padding: 12px; border-radius: 12px; }
#borang, #borangAdmin { padding: 8px; }
.halaman { width: 210mm; min-height: 297mm; background: #fff; color: #000; padding: 9mm 14mm; margin: 0 auto 12px; font-family: Arial, Helvetica, sans-serif; font-size: 10.5pt; }
.kepala { display: flex; align-items: center; gap: 14px; }
.kepala img { width: 18mm; }
.kepala .ar { font-size: 11pt; }
.kepala b { display: block; }
.tajuk { text-align: center; font-size: 15pt; font-weight: 700; margin: 4mm 0; }
.medan { display: flex; gap: 6mm; margin: 2.5mm 0; }
.medan span { flex: 1; border-bottom: 1px dotted #000; padding-left: 2mm; }
.halaman table { width: 100%; border-collapse: collapse; margin-top: 3mm; }
.halaman th, .halaman td { border: 1px solid #000; padding: 0 2mm; height: 5.8mm; text-align: center; }
.halaman td.catatan { text-align: left; }
.halaman p { margin: 3mm 0; }
.kotak { border: 1px solid #000; width: 125mm; padding: 2.5mm 4mm; margin-top: 1mm; line-height: 1.6; }
.tt { margin-top: 3mm; display: flex; justify-content: space-between; align-items: flex-end; }
.tt .ruang { height: 9mm; }
.surat { font-family: "Times New Roman", Times, serif; font-size: 12pt; line-height: 1.3; padding: 22mm 20mm 20mm 23mm; }
.surat p { margin: 0 0 5mm; }
.surat hr { border: 0; border-top: 1px solid #000; margin: -1mm 0 6mm; }
.surat .alamat { display: flex; justify-content: space-between; }
.surat .alamat p:last-child { width: 62mm; }
.surat ol { padding-left: 6mm; margin: 0 0 5mm; }
.surat li { padding-left: 0; margin-bottom: 6mm; }
.halaman table.penerima { border: 2px solid #000; margin: 8mm 0 4mm; }
.penerima td, .penerima th { height: 6.3mm; white-space: nowrap; }
.penerima td.catatan { white-space: normal; }
.kekerapan { display: flex; justify-content: space-between; gap: 2mm; }

/* Borang kelas tambahan: 20 baris, kotak jumlah dan tiga tandatangan dalam satu muka A4 */
.halaman.tambahan { padding-top: 7mm; padding-bottom: 5mm; line-height: 1.2; }
.tambahan .kepala img { width: 14mm; }
.halaman.tambahan th, .halaman.tambahan td { height: 4.9mm; font-size: 9.5pt; padding: 0 1mm; line-height: 1.1; }
.jum { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #000; border-top: 0; line-height: 1.4; }
.jum > div { padding: 2mm 3mm; }
.jum > div + div { border-left: 1px solid #000; }
.jum-baris { display: grid; grid-template-columns: 26mm 1fr; font-size: 10pt; }
.tandatangan { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20mm; margin-top: 3mm; line-height: 1.35; }
.tandatangan > div:not(.penuh) { margin-top: 2mm; }
.tandatangan .penuh { grid-column: 1 / -1; }
.tandatangan .ruang { height: 8mm; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  header, nav, .tiada-cetak, .mesej, .modal-latar { display: none !important; }
  main { max-width: none; padding: 0 !important; }
  section:not(.aktif) { display: none !important; }
  section.aktif { display: block !important; max-width: none !important; }
  .pratonton, #borang, #borangAdmin { background: none; padding: 0; overflow: visible; }
  .halaman { margin: 0; page-break-after: always; zoom: 1 !important; min-height: 0; height: 296mm; overflow: hidden; }
  .halaman:last-child { page-break-after: auto; }
  .halaman.tambahan { min-height: 0; }
}
