/**
 * WinSPP - Print Isolation & Card Styling Stylesheet
 * Desain Kartu SPP Presisi 4 Kartu A4 (95mm x 135mm), Struk Thermal POS, & Kuitansi A5
 */

/* ==========================================================================
   GAYA KARTU SPP (TAMPILAN MONITOR & CETAK)
   ========================================================================== */
.spp-card-container {
  width: 95mm;
  height: 135mm;
  background: #FFFFFF;
  border: 1.5px solid #0F172A;
  border-radius: 6px;
  padding: 5mm 6mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  position: relative;
  page-break-inside: avoid;
}

/* Header Kop Yayasan */
.card-header-kop {
  text-align: center;
  line-height: 1.25;
}

.kop-yayasan {
  font-size: 8.5px;
  font-weight: 700;
  color: #047857;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.kop-sekolah {
  font-size: 11px;
  font-weight: 800;
  color: #000000;
  letter-spacing: 0.03em;
}

.kop-sub {
  font-size: 7.5px;
  font-weight: 600;
  color: #475569;
  margin-top: 1px;
}

.kop-line {
  height: 1.5px;
  background: #000000;
  margin: 4px 0 6px 0;
}

/* Konten Identitas Siswa & QR Code */
.card-body-content {
  display: flex;
  gap: 4mm;
  align-items: center;
  flex: 1;
}

.card-identity-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.table-id {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  line-height: 1.35;
}

.table-id td {
  padding: 1.5px 0;
  vertical-align: top;
}

.col-lbl {
  width: 38px;
  font-weight: 600;
  color: #334155;
}

.col-sep {
  width: 8px;
  text-align: center;
}

.col-val {
  font-weight: 500;
  color: #000000;
}

.val-nama {
  font-weight: 700;
  font-size: 9.5px;
  color: #000000;
}

.val-nisn {
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 10px;
}

.card-status-pill {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  width: fit-content;
}

/* Kotak QR Code */
.card-qr-box {
  width: 32mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
}

.qr-img {
  width: 30mm;
  height: 30mm;
  object-fit: contain;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
}

.qr-sub-text {
  font-size: 7px;
  font-weight: 700;
  color: #475569;
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* Footer Petunjuk Kartu */
.card-footer-notice {
  font-size: 6.8px;
  color: #64748B;
  text-align: center;
  border-top: 1px dashed #CBD5E1;
  padding-top: 3px;
  margin-top: 3px;
  font-style: italic;
}

/* ==========================================================================
   SISI BELAKANG: TABEL MATRIKS 12 BULAN
   ========================================================================== */
.spp-card-back {
  background: #FFFFFF;
}

.back-title-kop {
  text-align: center;
  font-size: 8.5px;
  font-weight: 800;
  color: #000000;
  border-bottom: 1px solid #000000;
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.table-back-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5px;
  text-align: center;
}

.table-back-matrix th,
.table-back-matrix td {
  border: 1px solid #000000;
  padding: 1.8px 2px;
}

.table-back-matrix th {
  background-color: #F1F5F9;
  font-weight: 700;
}

.tb-col-bln {
  font-weight: 700;
  text-align: left;
  padding-left: 4px !important;
}

.tb-col-tgl {
  font-family: 'Courier New', monospace;
  font-size: 7px;
}

.tb-col-nom {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  text-align: right;
  padding-right: 4px !important;
}

.tb-col-stmp {
  font-size: 7px;
  font-weight: 700;
  color: #047857;
}

/* ==========================================================================
   LEMBAR CETAK A4 GRID 4 KARTU (MONITOR PREVIEW & CETAK)
   ========================================================================== */
.a4-sheet-preview {
  width: 210mm;
  min-height: 297mm;
  background: #FFFFFF;
  margin: 0 auto 24px auto;
  padding: 8mm;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6mm;
  position: relative;
  page-break-after: always;
}

/* Garis Panduan Potong (Cut Guide Dashed Lines) */
.cut-guide-horizontal {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px dashed #CBD5E1;
  pointer-events: none;
}

.cut-guide-vertical {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 1px dashed #CBD5E1;
  pointer-events: none;
}

/* ==========================================================================
   ATURAN KHUSUS DIALOG PRINT BROWSER (@MEDIA PRINT)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  /* Sembunyikan seluruh shell web */
  #sidebar,
  #topbar,
  .page-header,
  .spp-card,
  #auth-gate-screen,
  #spp-toast-container,
  .no-print {
    display: none !important;
  }

  body, html, #app-wrapper, #main-content-wrap, #main-viewport {
    background: #FFFFFF !important;
    color: #000000 !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .a4-sheet-preview {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: 198mm !important;
    height: 282mm !important;
    page-break-after: always !important;
    gap: 4mm !important;
  }

  .spp-card-container {
    border: 1.5px solid #000000 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cut-guide-horizontal,
  .cut-guide-vertical {
    border-color: #94A3B8 !important;
  }
}
