/* ==========================================================================
   6. Resmî BEP Dosyası ekranı ve MEB örnek formatı önizlemesi
   Renkler MEB şablonundan alınmıştır: başlık #91A9BA, etiket #D1D8E0, bölüm başlığı #C6B261.
   ========================================================================== */
:root {
  --meb-head: #91a9ba;
  --meb-head-dark: #7a98ad;
  --meb-label: #d1d8e0;
  --meb-gold: #b49a3e;
  --meb-ink: #231f20;
  --meb-line: #7a98ad;
}

.nav-item-official span { font-weight: 700; }

.off-source-note {
  display: flex; gap: .6rem; align-items: flex-start;
  background: #f6f3e6; border: 1px solid #e3d9b1; color: #5b4b12;
  border-radius: var(--radius-md); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .85rem; line-height: 1.45;
}
.off-source-note a { color: #5b4b12; font-weight: 600; }
.off-source-note svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }

.off-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.25rem; align-items: start; }
.off-forms { min-width: 0; }
.off-preview-col { position: sticky; top: 1rem; min-width: 0; }
.off-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .5rem; font-size: .9rem; }
.off-preview-head span { color: var(--text-muted); font-size: .8rem; }
.off-preview-scroll { max-height: calc(100vh - 7rem); overflow: auto; background: #e9edf2; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: .75rem; }

.off-wide { grid-column: 1 / -1; }
.off-hint { color: var(--text-muted); font-size: .8rem; line-height: 1.45; margin: .35rem 0 .75rem; }
.off-subtitle { font-size: .95rem; margin: 1.1rem 0 .5rem; color: var(--text-main); }
.off-label-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.off-link { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }
.off-radio-row { display: flex; gap: 1.25rem; padding-top: .4rem; }
.off-radio-row label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
.off-inline-add { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 .25rem; }
.off-inline-add .form-control { flex: 1 1 150px; min-width: 0; }

.off-family-table input { width: 100%; min-width: 110px; }
.off-family-table th:first-child, .off-family-table td:first-child { white-space: nowrap; font-weight: 600; }

.off-performance-list { display: grid; gap: .6rem; margin-bottom: .75rem; }
.off-perf-item label { font-weight: 600; font-size: .85rem; }
.off-empty { color: var(--text-muted); font-style: italic; font-size: .85rem; padding: .5rem 0; }

.off-plan-list { display: grid; gap: .75rem; margin-bottom: .75rem; }
.off-plan-subject { border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.off-plan-subject > h5 { margin: 0; padding: .45rem .75rem; background: var(--meb-head); color: #fff; font-size: .85rem; letter-spacing: .02em; }
.off-plan-uda { padding: .6rem .75rem; border-top: 1px solid var(--border-color); }
.off-plan-uda > p { margin: 0 0 .35rem; font-size: .85rem; }
.off-plan-meta { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .78rem; color: var(--text-muted); margin-bottom: .4rem; }
.off-plan-meta .is-missing { color: var(--danger); font-weight: 600; }
.off-plan-kda { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px; gap: .4rem .6rem; align-items: center; padding: .35rem 0; border-top: 1px dashed var(--border-color); font-size: .82rem; }
.off-plan-kda .form-control, .off-plan-kda .form-select { padding: .3rem .45rem; font-size: .8rem; min-height: 34px; }

.off-row-list { display: grid; gap: .35rem; }
.off-row { display: flex; gap: .5rem; align-items: center; justify-content: space-between; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: .4rem .6rem; font-size: .85rem; }
.off-row small { color: var(--text-muted); }
.off-row .btn { padding: .25rem .5rem; }

.off-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.off-checklist li button { width: 100%; text-align: left; display: flex; gap: .5rem; align-items: flex-start; background: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: .35rem .45rem; cursor: pointer; font: inherit; font-size: .84rem; color: var(--text-main); }
.off-checklist li button:hover, .off-checklist li button:focus-visible { border-color: var(--border-color); background: var(--bg-main); }
.off-checklist .off-mark { flex-shrink: 0; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; }
.off-checklist .is-ok .off-mark { background: #dcfce7; color: #166534; }
.off-checklist .is-missing .off-mark { background: #fee2e2; color: #991b1b; }
.off-checklist small { display: block; color: var(--text-muted); font-size: .74rem; }
#off-checklist-badge.is-complete { background: #dcfce7; color: #166534; }
#off-checklist-badge.is-incomplete { background: #fef3c7; color: #92400e; }
.off-flash { animation: off-flash 1.2s ease; }
@keyframes off-flash { 0%, 60% { box-shadow: 0 0 0 3px rgba(79, 70, 229, .45); } 100% { box-shadow: var(--shadow-sm); } }

@media (max-width: 1180px) {
  .off-layout { grid-template-columns: minmax(0, 1fr); }
  .off-preview-col { position: static; }
  .off-preview-scroll { max-height: 70vh; }
}
@media (max-width: 640px) {
  .off-plan-kda { grid-template-columns: minmax(0, 1fr); }
  .off-family-table input { min-width: 90px; }
}
@media (prefers-reduced-motion: reduce) { .off-flash { animation: none; } }

/* ---------------------------------------------------------------- MEB belge düzeni */
.meb-resmi-bep { color: var(--meb-ink); font-family: Arial, "Helvetica Neue", sans-serif; font-size: 9pt; line-height: 1.25; }
.meb-resmi-bep .mb-page { position: relative; background: #fff; margin: 0 auto .9rem; padding: 0 20mm 10mm 23.4mm; box-shadow: 0 1px 4px rgba(15, 23, 42, .18); box-sizing: border-box; }
.meb-resmi-bep .mb-portrait { width: 210mm; min-height: 297mm; }
.meb-resmi-bep .mb-landscape { width: 297mm; min-height: 210mm; }
.off-preview-scroll .meb-resmi-bep { zoom: .6; }
/* Bölüm başlıkları ve tabloların sayfadaki yeri örnek dosyadaki gibidir (mm). */
.meb-resmi-bep .mb-h { font-style: italic; font-weight: 400; color: #c6b261; font-size: 13pt; line-height: 7mm; margin: 0; white-space: pre; }
.meb-resmi-bep .mb-sec-1 { padding-top: 33.6mm; }
.meb-resmi-bep .mb-sec-1 .mb-h { margin-bottom: .5mm; }
.meb-resmi-bep .mb-sec-2 { padding-top: 31.3mm; }
.meb-resmi-bep .mb-sec-3 { padding-top: 21.4mm; }
.meb-resmi-bep .mb-sec-3 .mb-h { margin-bottom: .7mm; }
.meb-resmi-bep .mb-sec-4a { padding-top: 22.4mm; }
.meb-resmi-bep .mb-sec-4b { padding-top: 25.9mm; }
.meb-resmi-bep .mb-sec-4c { padding-top: 27.9mm; }
.meb-resmi-bep .mb-sec-5 { padding-top: 16.3mm; }
.meb-resmi-bep .mb-sec-5 .mb-h { margin-bottom: 2.9mm; }
.meb-resmi-bep .mb-table { border-collapse: collapse; table-layout: fixed; margin: 0; }
.meb-resmi-bep .mb-table th, .meb-resmi-bep .mb-table td { border: .5pt solid var(--meb-line); padding: 1mm 1.6mm; vertical-align: top; overflow-wrap: anywhere; }
.meb-resmi-bep .mb-table th { background: var(--meb-head); color: #fff; font-weight: 700; text-align: center; vertical-align: middle; letter-spacing: .03em; }
.meb-resmi-bep .mb-table th.mb-left { text-align: left; }
.meb-resmi-bep .mb-label { background: var(--meb-label); }
.meb-resmi-bep .mb-val { white-space: normal; }
.meb-resmi-bep .mb-center { text-align: center; }
.meb-resmi-bep .mb-right { text-align: right; }
/* I- Öğrenci bilgileri */
.meb-resmi-bep .mb-t-ogrenci, .meb-resmi-bep .mb-t-aile { width: 161.6mm; margin-left: 2.2mm; font-size: 10pt; }
.meb-resmi-bep .mb-t-ogrenci td.mb-val, .meb-resmi-bep .mb-t-aile td.mb-val { font-size: 9pt; }
.meb-resmi-bep .mb-t-ogrenci td, .meb-resmi-bep .mb-t-aile td { vertical-align: middle; }
.meb-resmi-bep .mb-t-aile { margin-top: 7.3mm; margin-bottom: 6mm; }
/* II- Eğitsel performans */
.meb-resmi-bep .mb-perf { width: 161.6mm; margin-left: 2mm; margin-bottom: 11mm; }
.meb-resmi-bep .mb-perf th { font-size: 9.5pt; }
.meb-resmi-bep .mb-perf tr:first-child th { font-size: 11pt; }
.meb-resmi-bep .mb-perf-row { height: 29.8mm; }
/* III- Plan */
.meb-resmi-bep .mb-plan { width: 246.2mm; margin-left: 2.1mm; margin-bottom: 3mm; font-size: 8pt; }
.meb-resmi-bep .mb-plan th { font-size: 9pt; font-weight: 400; letter-spacing: .04em; }
.meb-resmi-bep .mb-plan-subject { height: 8.6mm; }
.meb-resmi-bep .mb-plan-row { height: 5.3mm; }
.meb-resmi-bep .mb-subject { background: var(--meb-head); color: #fff; text-align: center; vertical-align: middle !important; letter-spacing: .04em; font-size: 9pt; }
/* IV- Kararlar (A, B, C ayrı sayfalarda) */
.meb-resmi-bep .mb-services { width: 244mm; margin-left: 2mm; }
.meb-resmi-bep .mb-services th { font-size: 9pt; }
.meb-resmi-bep .mb-services th.mb-left { font-size: 9.5pt; letter-spacing: .02em; }
.meb-resmi-bep .mb-service-row { height: 39.8mm; }
.meb-resmi-bep .mb-family { width: 248.5mm; margin-left: 2.3mm; font-size: 9pt; }
.meb-resmi-bep .mb-family tr + tr { height: 33.8mm; }
.meb-resmi-bep .mb-decisions { width: 248.9mm; margin-left: 2.3mm; font-size: 10pt; }
.meb-resmi-bep .mb-decisions td { vertical-align: middle; }
.meb-resmi-bep .mb-box { border: .5pt solid var(--meb-line); padding: 1.6mm; box-sizing: border-box; }
.meb-resmi-bep .mb-general { width: 248.9mm; margin: 12mm 0 3.5mm 2.3mm; min-height: 58mm; font-size: 9pt; }
/* V- Üyeler */
.meb-resmi-bep .mb-members { width: 161.6mm; font-size: 8pt; }
.meb-resmi-bep .mb-members tr { height: 11.8mm; }
.meb-resmi-bep .mb-members td { vertical-align: middle; }
.meb-resmi-bep .mb-members tr:first-child th { font-size: 8pt; }
.meb-resmi-bep .mb-note { font-size: 7.5pt; line-height: 1.35; margin: 0 0 1.6mm; }
.meb-resmi-bep .mb-approval { margin-top: 20mm; display: flex; justify-content: space-between; align-items: flex-end; font-size: 9pt; width: 161.6mm; }
.meb-resmi-bep .mb-approval-left { display: grid; gap: 9mm; }
.meb-resmi-bep .mb-approval-date { text-align: center; margin-bottom: -12mm; }
.meb-resmi-bep .mb-cover-frame, .meb-resmi-bep .mb-cover-logo, .meb-resmi-bep .mb-cover-title, .meb-resmi-bep .mb-cover-box { position: absolute; box-sizing: border-box; }
/* Kapak: ölçüler özgün MEB şablonundan (20141302_BEP_Word.docx) milimetre olarak alınmıştır. */
.meb-resmi-bep .mb-page.mb-cover { position: relative; padding: 0; height: 297mm; overflow: hidden; }
.meb-resmi-bep .mb-cover-frame { left: 25.1mm; top: 32.6mm; width: 161.9mm; height: 241.4mm; border: .5pt solid var(--meb-line); background: #fff; box-shadow: 4.2mm 3.5mm 0 var(--meb-label); }
.meb-resmi-bep .mb-cover-logo { left: 87.7mm; top: 51.4mm; width: 36.6mm; height: 36.6mm; object-fit: contain; }
.meb-resmi-bep .mb-cover-title { left: 25.1mm; top: 131.5mm; width: 161.9mm; margin: 0; text-align: center; color: #c6b261; font-weight: 400; font-size: 25pt; line-height: 12.4mm; letter-spacing: 0; }
.meb-resmi-bep .mb-cover-box { left: 50.3mm; top: 192.2mm; width: 111.5mm; min-height: 48.3mm; padding: 7.3mm 6mm 3.2mm 7.6mm; background: var(--meb-label); border: .5pt solid var(--meb-line); border-radius: 1.2mm; font-size: 14pt; line-height: 5.6mm; color: var(--meb-ink); }
.meb-resmi-bep .mb-cover-box > div { min-height: 10.7mm; overflow-wrap: anywhere; }
.meb-resmi-bep .mb-cover-box > div:last-child { min-height: 0; }
.meb-resmi-bep .mb-cover-box strong { font-weight: 700; }
/* 7. adımdaki "BEP Klasör Kapağı": PDF motoru sayfayı tam A4 olarak yakalar (gölge dışarıda kalır). */
.bep-cover-sheet { width: 210mm; margin: 0 auto 1rem; box-shadow: 0 1px 6px rgba(15, 23, 42, .18); background: #fff; }
.bep-cover-sheet .meb-resmi-bep .mb-page { margin: 0; box-shadow: none; }

/* Yazdırma: yalnızca resmî dosya basılır; bölümler kendi sayfa yönünde (dikey/yatay). */
@page bep-dikey { size: A4 portrait; margin: 0; }
@page bep-yatay { size: A4 landscape; margin: 0; }
#off-print-root { display: none; }
@media print {
  html:has(body.printing-official), body.printing-official { display: block !important; height: auto !important; min-height: 0 !important; overflow: visible !important; background: #fff !important; }
  body.printing-official > *:not(#off-print-root) { display: none !important; }
  body.printing-official #off-print-root { display: block !important; }
  body.printing-official .meb-resmi-bep .mb-page { box-shadow: none; margin: 0; break-after: page; }
  body.printing-official .meb-resmi-bep .mb-page:last-child { break-after: auto; }
  /* Genişlik sayfa kutusundan gelir; sabit mm genişlik Chrome'da tüm belgeyi küçültürdü. */
  body.printing-official .meb-resmi-bep .mb-portrait { page: bep-dikey; width: auto; min-height: 0; height: auto; }
  body.printing-official .meb-resmi-bep .mb-landscape { page: bep-yatay; width: auto; min-height: 0; height: auto; }
  body.printing-official .meb-resmi-bep tr { break-inside: avoid; }
  /* Kapak tek sayfaya sığar; çerçeve sayfaya bölünmez. */
  body.printing-official .meb-resmi-bep .mb-page.mb-cover { height: 296mm; overflow: hidden; break-inside: avoid; }
  body.printing-official .meb-resmi-bep .mb-table th, body.printing-official .meb-resmi-bep .mb-label,
  body.printing-official .meb-resmi-bep .mb-subject, body.printing-official .meb-resmi-bep .mb-cover-box {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
