/* Printing a signed-in page (loaded with media="print"; decided 2026-10-18). What prints is the page's content on white paper:
   no sidebar, buttons, filters or search; tables at full width with their header repeated on every sheet; colours kept. The
   header and footer of every sheet (centre, school, year, print date, page x of y) are page margin boxes written by
   Layout/PrintFrame.razor and js/site.js. Pages print in the light theme whatever the screen uses (the dark tokens are screen only). */

@page {
  size: A4; margin: 18mm 11mm 16mm;
  /* the texts come from Layout/PrintFrame.razor (centre and school, year, print date); the page number is here */
  /* the centre's logo before its name (2026-10-21): the sidebar's brand mark (Layout/MainLayout.razor), inline so it is
     there when the sheet is drawn (a margin box draws only an image already loaded, and never one in «content») */
  @top-right { font: 700 8.5pt "Vazirmatn", Tahoma, sans-serif; color: #1C2E63; direction: rtl; vertical-align: bottom; padding-bottom: 2.5mm; padding-right: 8.5mm; border-bottom: .6pt solid #C9CED8;
    background: no-repeat right 0 bottom 1.2mm / 7mm 7mm url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' width='48' height='48'%3E%3Cg transform='rotate(-10 24 26)'%3E%3Crect x='8' y='20' width='32' height='20' rx='3' fill='%233A3A3A'/%3E%3Crect x='10' y='15' width='32' height='20' rx='3' fill='%23fff' stroke='%23C9CED8' stroke-width='1.2'/%3E%3Cpath d='M17 26h18M17 30h12' stroke='%23D9DEE7' stroke-width='2' stroke-linecap='round'/%3E%3C/g%3E%3Cpath d='M16 24l8 8L40 12' fill='none' stroke='%23F47B20' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
  @top-center { content: ""; vertical-align: bottom; border-bottom: .6pt solid #C9CED8; }
  @top-left { font: 500 8pt "Vazirmatn", Tahoma, sans-serif; color: #5B6473; direction: rtl; vertical-align: bottom; padding-bottom: 2.5mm; border-bottom: .6pt solid #C9CED8; }
  @bottom-right { font: 500 7.5pt "Vazirmatn", Tahoma, sans-serif; color: #5B6473; direction: rtl; vertical-align: top; padding-top: 2.5mm; }
  @bottom-left { content: "صفحهٔ " counter(page, persian) " از " counter(pages, persian); font: 500 7.5pt "Vazirmatn", Tahoma, sans-serif; color: #5B6473; direction: rtl; vertical-align: top; padding-top: 2.5mm; }
}
/* a page with a wide table (any element marked .print-wide) prints in landscape */
@page wide { size: A4 landscape; margin: 16mm 10mm 14mm; }
body:has(.print-wide) { page: wide; }

html, body, .panel, .panel__body, .panel__content { background: #fff !important; }
* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body { font-size: 10pt; color: #141B34; }

/* the frame of the panel goes; the content takes the whole sheet */
.panel { display: block !important; min-height: 0 !important; }
.panel::before, .panel::after, .focus::before { display: none !important; }
.panel__body, .panel__content, .focus { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }

/* screen-only things */
.panel__sidebar, .sidebar-toggle, .theme-sw, #blazor-error-ui, #toast-container, .components-reconnect-show,
.help-launcher, .help-dialog, .qdlg, .htip, .qtip, .ftip, .infotip__body, .tip::after,
.btn, .rp-head__acts, .page-head__acts, .page-actions, .excel-toolbar, .rp-bar, .rp-tabs, .filters, .dt-tools, .dt-menu, .table-tools, .subtabs,
.st-exam, .st-chips, .st-notes form, .nb-bar, .nb-start, .rv-top, .rv-keys, .xseg, .qr-chips, .xreps, noscript, .no-print { display: none !important; }
.print-only { display: revert !important; }

/* page title: smaller, tied to what follows */
h1, .rp-head h1, .page-head h1 { font-size: 15pt !important; margin: 0 0 2mm !important; }
.rp-head, .page-head { margin-bottom: 4mm !important; padding: 0 !important; }
h1, h2, h3, h4, h5, .sp-t, .exam-group { break-after: avoid; }

/* tabbed pages: only the open tab's name shows, as a sub-heading */
.sp-tabs, .st-tabs { border: 0 !important; margin: 0 0 3mm !important; }
.sp-tabs a:not(.on), .st-tabs a:not(.on), .sp-tabs a small, .st-tabs a small { display: none !important; }
.sp-tabs a.on, .st-tabs a.on { padding: 0 !important; border: 0 !important; color: #1C2E63 !important; font-size: 12pt; }

/* boxes: thin lines, no shadows */
.card, .rp-card, .sp-card, .kpi, .quick, .exam-item, .exam-head, .xdetail, .xbox, .rp-kpi, .sp-kp > div, .sp-in1, .st-mr, .tl-act__c,
.table-wrap, .rp-tw, .form-section, .stepper__step { box-shadow: none !important; }
.card:not(.bare), .rp-card:not(.bare), .kpi, .exam-item, .sp-in1, .rp-kpi, .sp-kp > div { border-color: #D9DEE7 !important; }

/* tables: everything visible, the header row on every sheet, rows never split */
.table-wrap, .rp-tw, .dt-wrap, .picker__table { overflow: visible !important; max-height: none !important; }
table { width: 100% !important; }
thead { display: table-header-group; }
/* a table's footer is its total row: printed once, after the last row */
tfoot { display: table-row-group; }
th { position: static !important; }
tr, .exam-item, .rp-card, .sp-in1, .kpi, figure, .st-mr, .tl-act__c, .xrep { break-inside: avoid; }
.table-brand th, .table-brand td, table.rp-t th, table.rp-t td { padding-block: 3px !important; height: auto !important; font-size: 8.5pt; }
.table-brand td, table.rp-t td { white-space: normal; }
.dtable tbody tr:hover td, .table-brand tbody tr:hover td { background: inherit; }

a { color: inherit !important; text-decoration: none !important; }
.badge, .chip { border: 1px solid #D9DEE7; }

/* the student's own page: the side column (countdown, year list) is for the screen */
.st-own { display: block !important; }
.st-own__cd, .st-own__yl { display: none !important; }
/* advisor dashboard: of the exam strip only the open exam's panel prints */
.xstrip-head, .xstrip { display: none !important; }
.xdetail { border: 0 !important; padding: 0 !important; }
/* teacher progress sheets: one per sheet */
.tl-sheet { break-inside: avoid; break-after: page; }

/* ---- print versions (Shared/PrintSheet, decided 2026-10-21) ----
   A page that has one prints only it: designed for A4 and a black-and-white printer, the figures that matter and nothing
   that needs colour. Black text, grey only as a light fill (survives any laser printer), ▲▼ for changes, bold for strength. */
body:has(.pv) .panel__content :not(.pv, .pv *, :has(.pv)) { display: none !important; }
body:has(.pv) { page: auto; }
body:has(.pv--wide), html.rp-parts body:has(.pv--wp), html.rp-stages body:has(.pv--ws), html.rp-parts.rp-stages body:has(.pv--wps), html.rp-books body:has(.pv--wb) { page: wide; }
.pv { display: block !important; color: #000; font-size: 9pt; line-height: 1.55; }
.pv * { color: #000; }

.pv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; padding-bottom: 2.5mm; margin-bottom: 4mm; border-bottom: 1.2pt solid #000; break-inside: avoid; }
.pv-head h1 { font-size: 15pt !important; font-weight: 800; margin: 0 0 .8mm !important; line-height: 1.35; }
.pv-head p { margin: 0; font-size: 8.5pt; color: #333; }
.pv-facts { display: flex; flex-shrink: 0; border: .7pt solid #000; border-radius: 1.5mm; }
.pv-fact { padding: 1mm 3mm 1.2mm; text-align: center; min-width: 17mm; }
.pv-fact + .pv-fact { border-inline-start: .5pt solid #000; }
.pv-fact span { display: block; font-size: 7pt; color: #333; white-space: nowrap; }
.pv-fact b { display: block; font-size: 12.5pt; font-weight: 800; line-height: 1.35; white-space: nowrap; }
.pv-fact small { display: block; font-size: 7pt; color: #333; white-space: nowrap; }

.pv h2 { font-size: 10.5pt; font-weight: 800; margin: 5mm 0 1.5mm; break-after: avoid; }
.pv h2 small { font-size: 8pt; font-weight: 500; color: #444; margin-inline-start: 2mm; }
.pv-head + h2, .pv-head + .pv-cols h2 { margin-top: 0; }
.pv-sec { break-inside: avoid; }
.pv-break { break-before: page; }
.pv-note { font-size: 7.5pt; color: #333; margin: 1.5mm 0 0; }
.pv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; align-items: start; }
.pv-list { margin: 0; padding-inline-start: 4.5mm; }
.pv-list li { margin-bottom: 1mm; break-inside: avoid; }
.pv-list li b { font-weight: 800; }
/* screen markup inside a finding's sentence (question chips, coloured figures) prints as plain text */
.pv-list li span, .pv-list li i, .pv-list li em { background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; display: inline !important; min-width: 0 !important; font-weight: inherit; }
.pv-list .st-qn + .st-qn::before { content: "، "; }
/* a box with ruled lines to write on (session notes) */
.pv-lines { border: .7pt solid #000; border-radius: 1.5mm; padding: 1.5mm 3mm 0; margin-top: 5mm; break-inside: avoid; }
.pv-lines > span { font-size: 7.5pt; color: #333; }
.pv-lines > i { display: block; height: 7.5mm; border-bottom: .4pt solid #999; }
.pv-lines > i:last-child { border-bottom: 0; }
.pv-notes { margin: 0; padding-inline-start: 5mm; }
.pv-notes li { padding: 1.5mm 0 2mm; border-bottom: .4pt solid #B5B5B5; break-inside: avoid; }
.pv-notes small { font-size: 7.5pt; color: #333; }
.pv-notes p { margin: .5mm 0 0; white-space: pre-line; }
/* an empty square to tick by hand */
.pv-box { display: inline-block; width: 3.2mm; height: 3.2mm; border: .6pt solid #000; vertical-align: middle; }

/* the brand table (design-system §6.1, as in the Excel files): a blue header row with white text and blue-tinted zebra rows;
   on a black-and-white printer the header prints dark grey and the zebra very light grey, so rows stay easy to follow */
table.pt { width: 100%; border-collapse: collapse; font-size: 8.5pt; line-height: 1.4; }
/* header text may wrap: a long title (a book's name) then takes two lines instead of pushing the table off the sheet */
.pt th { font-size: 7.5pt; font-weight: 700; line-height: 1.3; padding: 1mm 1.2mm; text-align: center; vertical-align: bottom; background: var(--brand-blue); border: .5pt solid #fff; border-top: 0; }
.pt th, .pt th * { color: #fff; }
.pt th small { display: block; font-weight: 500; font-size: 6.5pt; color: #DCE3F2; }
.pt td { padding: .6mm 1.2mm; text-align: center; border-bottom: .4pt solid #C9D2E3; font-variant-numeric: tabular-nums; }
.pt tbody tr:where(:nth-child(even)) td { background: var(--tint-blue); }
.pt .s { text-align: start; }
.pt .w { white-space: nowrap; }
.pt .mut { color: #555; }
/* darker than the zebra, so a weak cell still stands out on a tinted row */
.pt td.lo { background: #C4C4C4; }
.pt .hi { font-weight: 800; }
.pt td.k { font-weight: 800; }
.pt tr.sub td { font-size: 8pt; color: #333; }
.pt tr.sub td.s { padding-inline-start: 5mm; }
.pt tr.sub2 td { font-size: 7.5pt; color: #444; }
.pt tr.sub2 td.s { padding-inline-start: 9mm; }
.pt tr.sum td { font-weight: 700; background: none; border-top: .8pt solid var(--brand-blue); border-bottom: 1pt solid var(--brand-blue); }
.pt tr.grp td { font-weight: 800; text-align: start; padding-top: 2.5mm; background: none; border-bottom: .8pt solid var(--brand-blue); }
.pt tr.grp2 td { font-weight: 800; border-top: .8pt solid var(--brand-blue); }
/* the viewer's own rows among others': bold, with a black bar at the start of the row */
.pt tr.me td { font-weight: 800; }
.pt tr.me td:first-child { border-inline-start: 2.5pt solid #000; }
.pt tbody tr:last-child td { border-bottom: 1pt solid var(--brand-blue); }
.pt tbody tr.sum:last-child td, .pt tbody:has(+ tfoot) tr:last-child td { border-bottom: .4pt solid #C9D2E3; }
.pt tfoot td { font-weight: 700; border-bottom: 1pt solid var(--brand-blue); border-top: .8pt solid var(--brand-blue); }
/* the notebook's practice booklet (Reports/Notebook.razor): book and chapter headings, each question with its image, then
   from a new sheet the answers two to a row */
.pv h3 { font-size: 9.5pt; font-weight: 800; margin: 3.5mm 0 1mm; break-after: avoid; }
.pv h3 small { font-size: 8pt; font-weight: 500; color: #444; margin-inline-start: 2mm; }
.pv-ch { font-size: 8pt; font-weight: 700; color: var(--brand-blue); margin: 2mm 0 0; padding-bottom: .8mm; border-bottom: .6pt solid var(--brand-blue); break-after: avoid; }
.pv .pv-ch { color: var(--brand-blue); }
.pv-q { padding: 1.8mm 0 2.4mm; border-bottom: .4pt solid #C9D2E3; break-inside: avoid; }
.pv-q__h { font-size: 7.5pt; color: #333; margin-bottom: 1mm; }
.pv-q__h b { font-size: 8.5pt; }
.pv-q img, .pv-a img { display: block; width: 100%; height: auto; }
.pv-answers { break-before: page; }
.pv-ans { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 5mm; align-items: start; }
.pv-a { padding: 1.5mm 2mm 2mm; border: .5pt solid #C9D2E3; border-radius: 1.5mm; break-inside: avoid; }
.pv-a__note { margin: 0 0 1mm; font-size: 7.5pt; }

/* lists to write on: a wide empty column, and on an attendance list rows tall enough to sign */
.pt th.pv-blank { width: 34%; }
.pt-roll tbody td { height: 8mm; }

/* the answer matrix: one narrow column per question; black for wrong, a dash for blank, empty for correct */
.pt-mx { table-layout: fixed; }
.pt-mx th, .pt-mx td { padding: .3mm .1mm; font-size: 6.5pt; line-height: 1.2; }
.pt-mx th.s { width: 32mm; }
.pt-mx th:nth-child(2) { width: 9mm; }
.pt-mx td.s, .pt-mx td.k { font-size: 7.5pt; padding-inline: 1mm; }
.pt-mx tbody td { height: 4.2mm; border: .3pt solid #BBB; }
.pt-mx .mx-w { background: #000; }
.pt-mx .mx-b::after { content: "–"; }
.pt-mx .mx-v { background: #E6E6E6; }

/* a page with several print versions (one per class) starts each on a new sheet */
.pv ~ .pv { break-before: page; }

/* columns that follow the screen's «نمایش زیردرس‌ها / پیش و پایه / کتاب‌ها» switches */
.pv .px-parts, .pv .px-stages, .pv .px-books { display: none; }
html.rp-parts .pv .px-parts, html.rp-stages .pv .px-stages, html.rp-books .pv .px-books { display: table-cell; }
/* and their grouped header: one set of header rows per state of the switches (PrintUi.Variants); only the matching set prints */
html.rp-parts .pv tr.pxv-np, html:not(.rp-parts) .pv tr.pxv-yp,
html.rp-stages .pv tr.pxv-ns, html:not(.rp-stages) .pv tr.pxv-ys,
html.rp-books .pv tr.pxv-nb, html:not(.rp-books) .pv tr.pxv-yb { display: none; }
