/* =====================================================================
   Print stylesheet - clean A4 output for reports, records and pupil histories.
   Hides navigation, buttons and filters. Loaded with media="print".
   ===================================================================== */

@page { size: A4 portrait; margin: 14mm 12mm 16mm; }
body.print-landscape { }

* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

html, body { background: #fff !important; color: #000 !important; font-size: 10.5pt; }
.no-print, .sidebar, .topbar, .bottom-nav, .app-footer, .offcanvas, .modal, .alert, .btn, .skip-link,
.page-head, .filter-card, .sub-tabs, .pagination, .dropdown, .plain-footer { display: none !important; }

.app-shell, .app-main { display: block !important; }
.content, .plain-main { padding: 0 !important; margin: 0 !important; }

.card-soft, .form-section, .stat-card { box-shadow: none !important; border: 1px solid #bbb !important; border-radius: 4px !important; break-inside: avoid; }

/* Report sheet: no screen chrome when printed */
.report-scroll { overflow: visible !important; }
.report-sheet { box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; max-width: none !important; min-width: 0 !important; width: 100% !important; margin: 0 !important; }
.report-table { font-size: 9pt; }
.report-table thead { display: table-header-group; }
.report-table tr { break-inside: avoid; }
.report-table th { background: #eee !important; }
.report-sign { break-inside: avoid; }
.report-foot { position: static; }

/* Tables that are card-stacked on phones print as normal tables */
.table-stack thead { display: table-header-group !important; }
.table-stack, .table-stack tbody { display: table-row-group !important; width: auto !important; }
.table-stack { display: table !important; width: 100% !important; }
.table-stack tr { display: table-row !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
.table-stack td { display: table-cell !important; text-align: left !important; border: 1px solid #999 !important; padding: 3px 5px !important; font-size: 9pt !important; }
.table-stack td::before { display: none !important; }
.table > thead > tr > th { background: #eee !important; border: 1px solid #999 !important; color: #000 !important; }

.status-badge, .sex-badge, .tag { border: 1px solid #777 !important; background: #fff !important; color: #000 !important; }
.timeline::before { background: #999; }
a { color: #000 !important; text-decoration: none !important; }

/* Print footer with the confidentiality notice on every printed page */
.print-confidential { display: block !important; position: fixed; bottom: 0; left: 0; right: 0; text-align: center; font-size: 8pt; border-top: 1px solid #999; padding-top: 3px; background: #fff; }
.print-only { display: block !important; }

/* Keep headings with the table that follows; one confidentiality line per page is enough */
.report-h2 { break-after: avoid; page-break-after: avoid; }
.report-foot { display: none !important; }
