/* JADWALE 6.41 — print isolation safety layer.
   Loaded only for print. Preserve the proven report layouts from the reporting
   styles while neutralizing screen-only UX classes introduced later. */


@page { size:A4 landscape; margin:3mm; }

:root, body, .app-shell, .public-share-shell, .print-report {
  font-family:"Segoe UI",Tahoma,Arial,sans-serif !important;
  background:#fff !important;
  color:#000 !important;
  overflow:visible !important;
}

html, body, .app-shell, .app-workspace, .content {
  width:auto !important;
  max-width:none !important;
  min-width:0 !important;
  height:auto !important;
  min-height:0 !important;
}

.app-shell {
  display:block !important;
  grid-template-columns:none !important;
}

.content {
  display:block !important;
  padding:0 !important;
  margin:0 !important;
}

.sidebar,.topbar,.mobile-bottom-nav,.mobile-nav-backdrop,.app-whatsapp-contact,
.workspace-route-context,.ux-page-breadcrumb,.ux-scroll-cue,.ux-sheet-close,
.ux-page-actions-trigger,.ux-mobile-actions-shell,.ux-header-copy-toggle,
.mobile-timetable-guide,.teacher-focus-panel,.section-focus-panel,
.edit-selection-strip,.teacher-edit-howto {
  display:none !important;
}

/* Screen surface styling must not alter physical report geometry. */
.panel.ux-surface,.ux-surface,.panel {
  box-shadow:none !important;
}

/* Restore table semantics even if experience-system.js enhanced the table for phone UX. */
table.ux-mobile-cards,
table.ux-wide-grid {
  display:table !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  overflow:visible !important;
  border-radius:0 !important;
  background:#fff !important;
}

table.ux-mobile-cards thead,
table.ux-wide-grid thead { display:table-header-group !important; position:static !important; width:auto !important; height:auto !important; margin:0 !important; overflow:visible !important; clip:auto !important; white-space:normal !important; }
table.ux-mobile-cards tbody,
table.ux-wide-grid tbody { display:table-row-group !important; }
table.ux-mobile-cards tr,
table.ux-wide-grid tr { display:table-row !important; width:auto !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; background:transparent !important; }
table.ux-mobile-cards th,
table.ux-mobile-cards td,
table.ux-wide-grid th,
table.ux-wide-grid td { display:table-cell !important; position:static !important; width:auto; max-width:none !important; min-width:0 !important; box-shadow:none !important; }
table.ux-mobile-cards td::before { display:none !important; content:none !important; }

.ux-wide-scroll,.table-wrap,.report-table-wrap,.timetable-wrap {
  overflow:visible !important;
  max-width:none !important;
}

/* A screen sticky column must never widen or offset printed tables. */
table.ux-wide-grid :where(th:first-child,td:first-child) {
  position:static !important;
  right:auto !important;
  left:auto !important;
  box-shadow:none !important;
}

/* The distribution layouts already define exact 2x2/one-up geometry in app.css.
   These guards only prevent flex/card transformations from overriding it. */
.distribution-report-pages { overflow:visible !important; }
.distribution-print-page { max-width:100% !important; }
.distribution-mini-table { min-width:0 !important; max-width:100% !important; }

/* Avoid a trailing page generated by screen chrome or a transformed footer. */
.print-report:last-child,
.distribution-print-page:last-child,
.print-page:last-child { break-after:auto !important; page-break-after:auto !important; }

/* 6.42 — large individual teacher/section sheets.
   A "large" sheet is exactly one logical report per physical A4 page.
   Keep branding compact, give the timetable the page, and never let the table
   spill into a second page (the previous oversized BrandLockup was the trigger). */
.distribution-report-pages .distribution-print-page.distribution-one-up {
  display:block !important;
  width:100% !important;
  height:202mm !important;
  min-height:0 !important;
  max-height:202mm !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  break-inside:avoid-page !important;
  page-break-inside:avoid !important;
  break-after:page !important;
  page-break-after:always !important;
}
.distribution-report-pages .distribution-print-page.distribution-one-up:last-child {
  break-after:auto !important;
  page-break-after:auto !important;
}
.distribution-print-page.distribution-one-up > .distribution-sheet {
  box-sizing:border-box !important;
  width:100% !important;
  height:202mm !important;
  min-height:0 !important;
  max-height:202mm !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  overflow:hidden !important;
  break-inside:avoid-page !important;
  page-break-inside:avoid !important;
}

/* Compact identity header. The report already prints the product name at the
   opposite edge, so only the master emblem is needed in the lockup here. */
.distribution-one-up .distribution-brand-row {
  box-sizing:border-box !important;
  height:13mm !important;
  min-height:13mm !important;
  max-height:13mm !important;
  margin:0 0 .8mm !important;
  padding:0 1mm .7mm !important;
  overflow:hidden !important;
  align-items:center !important;
}
.distribution-one-up .distribution-brand-row .jw-brand-lockup {
  flex:0 0 24mm !important;
  width:24mm !important;
  max-width:24mm !important;
  height:11mm !important;
  max-height:11mm !important;
  margin:0 !important;
  transform:none !important;
  overflow:hidden !important;
}
.distribution-one-up .distribution-brand-row .jw-brand-lockup .jw-emblem {
  display:block !important;
  width:auto !important;
  max-width:13mm !important;
  height:10mm !important;
  max-height:10mm !important;
  margin:0 auto !important;
  object-fit:contain !important;
  filter:none !important;
}
.distribution-one-up .distribution-brand-row .jw-brand-lockup .jw-product-row,
.distribution-one-up .distribution-brand-row .jw-brand-lockup .jw-descriptor {
  display:none !important;
}
.distribution-one-up .distribution-brand-row > span {
  font-size:8pt !important;
  line-height:1 !important;
}

.distribution-one-up .report-watermark {
  width:18% !important;
  max-width:48mm !important;
  opacity:.035 !important;
}
.distribution-one-up .distribution-sheet-title {
  margin:0 0 .8mm !important;
  line-height:1.05 !important;
}
.distribution-one-up .distribution-sheet-title strong { font-size:8pt !important; line-height:1 !important; }
.distribution-one-up .distribution-sheet-title h2 { font-size:13pt !important; line-height:1.05 !important; margin:.45mm 0 !important; }
.distribution-one-up .distribution-sheet-title small { font-size:6.3pt !important; line-height:1 !important; }
.distribution-one-up .distribution-summary {
  margin:.7mm 0 1.3mm !important;
  gap:.7mm 3mm !important;
  font-size:6.6pt !important;
  line-height:1 !important;
}

/* Give the timetable most of the physical sheet. A fixed table height lets the
   browser distribute available space across however many school days exist. */
.distribution-one-up .distribution-mini-table {
  width:100% !important;
  height:150mm !important;
  max-height:150mm !important;
  table-layout:fixed !important;
  border-collapse:collapse !important;
  break-inside:avoid-page !important;
  page-break-inside:avoid !important;
}
.distribution-one-up .distribution-mini-table thead { height:10mm !important; }
.distribution-one-up .distribution-mini-table tbody { height:140mm !important; }
.distribution-one-up .distribution-mini-table tr { break-inside:avoid-page !important; page-break-inside:avoid !important; }
.distribution-one-up .distribution-mini-table th,
.distribution-one-up .distribution-mini-table td {
  height:auto !important;
  padding:.9mm !important;
  font-size:8.2pt !important;
  line-height:1.05 !important;
  overflow:hidden !important;
}
.distribution-one-up .distribution-mini-table td b { font-size:8.8pt !important; line-height:1.05 !important; }
.distribution-one-up .distribution-mini-table td small { font-size:6.8pt !important; line-height:1.05 !important; margin-top:.6mm !important; }
.distribution-one-up .distribution-day-col { width:17mm !important; }
.distribution-one-up .distribution-sheet-footer {
  margin-top:.9mm !important;
  padding-top:.55mm !important;
  font-size:4.8pt !important;
  line-height:1 !important;
}

/* 6.44 — conservative tuning for the school-wide "عرض تجميعي حسب الحصة" only.
   6.43's report splitting is intentionally NOT carried forward. Large teacher/section
   reports stay exactly on the 6.42 print model. This block only relaxes the old 7-period
   compression a little when the school-wide report is already within the proven one-page
   range (<=12 sections), using the otherwise-empty vertical room for readability. */
.school-master-report.one-page-matrix.fit-seven-periods .school-master-table thead th {
  padding:.26mm .3mm !important;
  font-size:5.7pt !important;
  line-height:1 !important;
}
.school-master-report.one-page-matrix.fit-seven-periods .school-master-table tbody th,
.school-master-report.one-page-matrix.fit-seven-periods .school-master-table tbody td {
  padding:.1mm .18mm !important;
  line-height:.96 !important;
}
.school-master-report.one-page-matrix.fit-seven-periods .school-master-cell {
  padding:.06mm .12mm !important;
}
.school-master-report.one-page-matrix.fit-seven-periods .school-master-line {
  gap:.22mm !important;
  padding:.03mm .2mm !important;
  line-height:.96 !important;
}
.school-master-report.one-page-matrix.fit-seven-periods.report-density-roomy .school-master-line,
.school-master-report.one-page-matrix.fit-seven-periods.report-density-roomy .school-master-line b {
  font-size:6.1pt !important;
}
.school-master-report.one-page-matrix.fit-seven-periods.report-density-roomy .school-master-line small {
  font-size:5.1pt !important;
}
.school-master-report.one-page-matrix.fit-seven-periods.report-density-standard .school-master-line,
.school-master-report.one-page-matrix.fit-seven-periods.report-density-standard .school-master-line b {
  font-size:5.55pt !important;
}
.school-master-report.one-page-matrix.fit-seven-periods.report-density-standard .school-master-line small {
  font-size:4.7pt !important;
}
.school-master-report.one-page-matrix.fit-seven-periods.report-density-dense .school-master-line,
.school-master-report.one-page-matrix.fit-seven-periods.report-density-dense .school-master-line b {
  font-size:5pt !important;
}
.school-master-report.one-page-matrix.fit-seven-periods.report-density-dense .school-master-line small {
  font-size:4.25pt !important;
}

/* 6.45 — section-matrix print correction only.
   Keep the proven all-sections matrix intact and remove only the print-only overflow
   that was creating an accidental second page. Legends remain available on screen;
   the printed sheet prioritizes the complete timetable, with a compact rights footer. */
.section-matrix-report.one-page-matrix {
  max-height:204mm !important;
  overflow:hidden !important;
}
.section-matrix-report .matrix-legends {
  display:none !important;
}
.section-matrix-report > .report-brand-footer {
  display:block !important;
  margin:.35mm 0 0 !important;
  padding:.25mm 0 0 !important;
  border-top:.15mm solid #d9e0e7 !important;
  font-size:3.4pt !important;
  line-height:1 !important;
  min-height:0 !important;
  max-height:3.2mm !important;
  overflow:hidden !important;
}
.section-matrix-report > .report-brand-footer .brand-footer-main {
  margin:0 !important;
  padding:0 !important;
  line-height:1 !important;
}
.section-matrix-report > .report-brand-footer .brand-contact {
  display:none !important;
}

/* 6.46 — section matrix vertical alignment only.
   Preserve the 6.45 matrix geometry and font sizes; reclaim a few millimetres
   from the identity header so the timetable sits higher on the physical sheet. */
.section-matrix-report > .report-brand-strip {
  height:9.4mm !important;
  min-height:0 !important;
  max-height:9.4mm !important;
  margin:-1.2mm 0 .15mm !important;
  padding:0 0 .15mm !important;
  overflow:hidden !important;
  align-items:center !important;
}
.section-matrix-report > .report-brand-strip .jw-brand-lockup.compact {
  width:20mm !important;
  max-width:20mm !important;
  margin:0 !important;
  transform:none !important;
}
.section-matrix-report > .report-brand-strip .jw-brand-lockup.compact .jw-emblem {
  width:10mm !important;
  max-width:10mm !important;
  height:auto !important;
}
.section-matrix-report > .report-brand-strip .jw-brand-lockup.compact .jw-product-row {
  width:18mm !important;
  gap:.7mm !important;
  margin-top:-.45mm !important;
}
.section-matrix-report > .report-brand-strip .jw-brand-lockup.compact .jw-product-name {
  font-size:6.4pt !important;
  line-height:1 !important;
}
.section-matrix-report > .report-brand-strip > span {
  font-size:3.7pt !important;
  line-height:1 !important;
}
.section-matrix-report > .compact-title {
  margin:0 0 .35mm !important;
  padding:0 !important;
}
.section-matrix-report > .compact-title h1 {
  font-size:9.2pt !important;
  line-height:1 !important;
}
.section-matrix-report > .compact-title p {
  margin:.15mm 0 0 !important;
  font-size:5.2pt !important;
  line-height:1 !important;
}
