/* ============================================
   DOCUMENT.CSS — Rubrik Penilaian
   Styling KHUSUS dokumen cetak (.page)
   SEMUA selector diawali .page
   ============================================ */

/* ── HALAMAN ── */
.page {
  width: 210mm;
  min-height: auto;
  margin: 20px auto;
  background: #fff;
  padding: 12mm 12mm 12mm 15mm;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  font-family: 'Times New Roman', Times, serif;
  font-size: 10pt;
  color: #000;
}

/* ── HEADER DOKUMEN ── */
.page .rubrik-header {
  margin-bottom: 10px;
}

.page .rubrik-judul-utama {
  font-size: 13pt;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.08em;
  color: #000;
}

.page .rubrik-judul-sub {
  font-size: 10.5pt;
  font-weight: bold;
  text-align: center;
  color: #222;
  margin-top: 2px;
}

.page .rubrik-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 8.5pt;
  color: #555;
  margin-top: 4px;
  flex-wrap: wrap;
}

.page .rubrik-meta span + span::before {
  content: "| ";
}

.page .rubrik-border-bawah {
  height: 3px;
  background: #1a365d;
  margin-top: 6px;
  margin-bottom: 12px;
}

/* ── SECTION PERTEMUAN (Formatif) ── */
.page .pertemuan-section {
  margin-bottom: 8px;
  page-break-inside: avoid;
}

.page .pertemuan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid #1a365d;
  padding: 5px 10px;
  margin-bottom: 8px;
  background: #f0f4f8;
}

.page .pertemuan-label {
  font-size: 10pt;
  font-weight: bold;
  color: #1a365d;
}

.page .pertemuan-sintak {
  font-size: 8.5pt;
  color: #555;
  font-style: italic;
  margin-left: auto;
}

/* ── SUB LABEL ── */
.page .sub-label {
  font-size: 9pt;
  font-weight: bold;
  color: #1a365d;
  margin: 8px 0 4px 0;
  padding: 3px 8px;
  background: #f8f9fa;
  border-left: 3px solid #1a365d;
}

/* ── TABEL RUBRIK ANALITIK ── */
.page .tabel-rubrik {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  margin-bottom: 8px;
  table-layout: fixed;
}

.page .tabel-rubrik th {
  background: #f8f8f8;
  color: #1a365d;
  font-weight: bold;
  padding: 3px 4px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 8pt;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page .tabel-rubrik th.col-no       { width: 26px; }
.page .tabel-rubrik th.col-kriteria { width: 24%; }
.page .tabel-rubrik th.col-bobot    { width: 45px; }

.page .tabel-rubrik td {
  border: 1px solid #ccc;
  padding: 3px 4px;
  vertical-align: top;
  font-size: 8.5pt;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page .tabel-rubrik td.no {
  text-align: center;
  background: #fafafa;
  font-weight: bold;
  color: #555;
  vertical-align: middle;
}

.page .tabel-rubrik td.kriteria-nama {
  font-weight: bold;
  background: #fafafa;
  vertical-align: middle;
}

.page .tabel-rubrik td.bobot {
  text-align: center;
  font-weight: bold;
  color: #1a365d;
  vertical-align: middle;
  background: #f0f4f8;
}

.page .tabel-rubrik tr:nth-child(even) td {
  background: #fafafa;
}
.page .tabel-rubrik tr:nth-child(even) td.no,
.page .tabel-rubrik tr:nth-child(even) td.kriteria-nama {
  background: #f5f5f5;
}
.page .tabel-rubrik tr:nth-child(even) td.bobot {
  background: #e8edf5;
}

/* ── BADGE SKOR ── */
.page .badge-skor {
  display: inline-block;
  font-size: 7.5pt;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 3px;
}
.page .badge-4 { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.page .badge-3 { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }
.page .badge-2 { background: #fff8e1; color: #f57f17; border: 1px solid #ffecb3; }
.page .badge-1 { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }

/* ── PEMISAH ── */
.page .pemisah {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 6px 0;
}

/* ── MODEL BADGE (Sumatif) ── */
.page .model-badge {
  display: inline-block;
  background: #e8edf5;
  border: 1px solid #1a365d;
  color: #1a365d;
  font-size: 8pt;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

/* ── KOMPONEN BOX (Sumatif) ── */
.page .komponen-box {
  background: #f0f4f8;
  border: 1px solid #c5d5e8;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 8.5pt;
}

.page .komponen-box .komponen-label {
  font-weight: bold;
  color: #1a365d;
  margin-bottom: 4px;
  font-size: 9pt;
}

.page .komponen-item {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px dotted #c5d5e8;
}

.page .komponen-item:last-child {
  border-bottom: none;
}

.page .komponen-bobot {
  font-weight: bold;
  color: #1a365d;
}

/* ── SOAL ESAI ── */
.page .soal-item {
  margin-bottom: 8px;
  page-break-inside: avoid;
}

.page .soal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid #1a365d;
  padding: 5px 10px;
  margin-bottom: 6px;
  background: #f0f4f8;
}

.page .soal-label {
  font-size: 9.5pt;
  font-weight: bold;
  color: #1a365d;
}

.page .soal-skor-maks {
  margin-left: auto;
  font-size: 8.5pt;
  color: #555;
  font-style: italic;
}

.page .soal-teks {
  font-size: 9pt;
  line-height: 1.6;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  font-style: italic;
}

/* ── TABEL ESAI ── */
.page .tabel-esai {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.5pt;
  margin-bottom: 4px;
}

.page .tabel-esai th {
  background: #f8f8f8;
  color: #1a365d;
  font-weight: bold;
  padding: 5px 8px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 8pt;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page .tabel-esai th.col-rentang { width: 90px; }

.page .tabel-esai td {
  border: 1px solid #ccc;
  padding: 5px 8px;
  vertical-align: top;
  font-size: 8.5pt;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page .tabel-esai td.rentang {
  text-align: center;
  font-weight: bold;
  vertical-align: middle;
}

.page .tabel-esai tr:nth-child(1) td.rentang { color: #2e7d32; background: #f1f8e9; }
.page .tabel-esai tr:nth-child(2) td.rentang { color: #1565c0; background: #e8f0fb; }
.page .tabel-esai tr:nth-child(3) td.rentang { color: #f57f17; background: #fffde7; }
.page .tabel-esai tr:nth-child(4) td.rentang { color: #c62828; background: #fce4ec; }

/* ── TOTAL SKOR BOX ── */
.page .total-skor-box {
  background: #f0f4f8;
  border: 1px solid #c5d5e8;
  border-radius: 4px;
  padding: 6px 12px;
  margin-top: 8px;
  font-size: 8.5pt;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page .total-skor-box .label {
  font-weight: bold;
  color: #1a365d;
}

.page .total-skor-box .nilai {
  font-size: 11pt;
  font-weight: bold;
  color: #1a365d;
}

/* ── KETERANGAN SKOR ── */
.page .keterangan-skor {
  margin-top: 10px;
  font-size: 8pt;
  color: #555;
  border-top: 1px dashed #ccc;
  padding-top: 6px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.page .keterangan-skor .item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── FONT ADAPTIF ── */
.page.kriteria-sedang  { font-size: 9pt; }
.page.kriteria-banyak  { font-size: 8.5pt; }

/* ── PRINT ── */
@media print {
  body { background: #fff !important; margin: 0 !important; }
  .page {
    width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Heading control */
  h1, h2, h3, .rubrik-judul-utama, .rubrik-judul-sub, .pertemuan-label, .sub-label, .soal-label {
    page-break-after: avoid;
  }
  
  /* Paragraph control */
  p {
    widows: 2;
    orphans: 2;
  }
  
  /* Simplified break rules */
  .page .pertemuan-section { break-inside: avoid; }
  .page .soal-item          { break-inside: avoid; }
  tr                        { break-inside: avoid; }
  thead                     { display: table-header-group; }
}

