/* Branded print / PDF sheets (letterhead with the school logo and names, colour kept in print). */
#printroot{display:none}
html.printing body>*:not(#printroot){display:none!important}
html.printing #printroot{display:block}
html.printing body{background:#fff!important}
html.printing body::before,html.printing .ms-bg{display:none!important}
.sheet{font-family:var(--font);color:#0f172a;background:#fff;max-width:1000px;margin:0 auto;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.sheet-h{display:flex;align-items:center;gap:14px;padding:14px 18px;border-radius:14px;background:linear-gradient(135deg,var(--p-deep),var(--pri-d) 55%,var(--p1));color:var(--pri-soft);margin-bottom:14px}
.sheet-h .logo{width:58px;height:58px;border-radius:14px;background:#fff;display:grid;place-items:center;overflow:hidden;flex:none}
.sheet-h .logo img{width:100%;height:100%;object-fit:contain}
.sheet-h .logo svg{width:34px;height:34px}
.sheet-h .names{flex:1;min-width:0}
.sheet-h .names b{display:block;font-size:17px;color:#fff;line-height:1.3}
.sheet-h .names small{display:block;font-size:12px;color:rgba(255,255,255,.78);font-family:"Plus Jakarta Sans",sans-serif}
.sheet-h .doc{text-align:end;flex:none}
.sheet-h .doc b{display:block;font-size:16px;color:#fff}
.sheet-h .doc small{display:block;font-size:11.5px;color:rgba(255,255,255,.85)}
.sheet-meta{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:12px;color:#475569;margin:0 2px 12px}
.sheet-meta b{color:#0f172a}
.sheet table{width:100%;border-collapse:collapse;font-size:12px;margin-bottom:12px;page-break-inside:auto}
.sheet th{background:var(--pri-soft);color:var(--pri-d);font-weight:800;text-align:start;padding:7px 8px;border:1px solid var(--pri-line)}
.sheet td{padding:7px 8px;border:1px solid #d6dcec;vertical-align:top}
.sheet tr{page-break-inside:avoid}
.sheet tbody tr:nth-child(even) td{background:#f8fafc}
.sheet td.day{background:var(--pri-soft)!important;font-weight:800;color:var(--pri-d);white-space:nowrap}
.sheet .hw{color:#92400e;font-size:11px;margin-top:3px}
.sheet .muted{color:#64748b}
.sheet .tag{display:inline-block;padding:1px 8px;border-radius:999px;font-size:10.5px;font-weight:800;background:#e2e8f0;color:#334155}
.sheet .tag.ok{background:#d1fae5;color:#065f46}.sheet .tag.warn{background:#fef3c7;color:#92400e}.sheet .tag.info{background:#dbeafe;color:#1e40af}.sheet .tag.bad{background:#ffe4e6;color:#9f1239}
.sheet .body{white-space:pre-wrap;line-height:1.9;font-size:13px;border:1px solid #d6dcec;border-radius:12px;padding:14px 16px;margin-bottom:14px}
.sheet h3{font-size:14px;color:var(--pri-d);margin:14px 0 8px;border-inline-start:4px solid var(--p1);padding-inline-start:8px}
.sheet-f{display:flex;justify-content:space-between;gap:10px;margin-top:16px;padding-top:8px;border-top:1px solid #d6dcec;font-size:10.5px;color:#64748b}
.sheet .sign{display:flex;gap:40px;margin-top:28px;font-size:12px}
.sheet .sign div{flex:1;border-top:1px dashed #94a3b8;padding-top:6px;text-align:center;color:#475569}
.sheet .tt td{text-align:center;height:46px}
.sheet .tt td.has{background:var(--pri-soft)}
.sheet .tt td.brk{background:#fef3c7!important;color:#92400e;font-weight:700;height:auto}
@media print{
  /* margin 0 removes the browser's own header and footer (date, title, address); the sheet adds its own margins */
  @page{size:A4;margin:0}
  @page landscape{size:A4 landscape;margin:0}
  html.printing body{padding:0!important}
  html.printing #printroot .sheet{padding:11mm 12mm;-webkit-box-decoration-break:clone;box-decoration-break:clone}
  .sheet.land{page:landscape}
  .sheet-h,.sheet th,.sheet td.day,.sheet .tag,.sheet tbody tr:nth-child(even) td,.sheet .tt td.has,.sheet .tt td.brk{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
/* printed exam paper */
.pstudent{display:flex;flex-wrap:wrap;gap:10px 24px;padding:10px 14px;border:1.5px solid var(--pri-line);border-radius:12px;margin-bottom:14px;font-size:13px;font-weight:700}
.pstudent i{display:inline-block;width:200px;border-bottom:1px dotted #475569;margin-inline-start:6px}
.paper .pq{border:1px solid #d6dcec;border-radius:12px;padding:10px 14px;margin-bottom:10px;page-break-inside:avoid;font-size:13px}
.pqh{display:flex;gap:10px;align-items:flex-start;margin-bottom:6px}
.pqn{width:24px;height:24px;border-radius:50%;background:var(--pri-d);color:#fff;display:inline-grid;place-items:center;font-size:12px;font-weight:800;flex:none}
.pqp{color:#64748b;font-size:11.5px;white-space:nowrap}
.pqimg{max-width:60%;max-height:200px;border-radius:8px;display:block;margin:6px 0}
.ptf{font-weight:700}
.pch{display:flex;flex-wrap:wrap;gap:6px 22px}
.pkey{color:var(--pri-d);font-weight:800}
.pfill{line-height:2.4}
.pline{display:inline-block;width:110px;border-bottom:1px solid #334155;margin:0 4px}
.pmatch td{border:0!important;padding:4px 8px!important;background:none!important}
.pmatch .pblank{width:50px;text-align:center}
.pgroups th{text-align:center}
.pcard{border:1px solid #cbd5e1;border-radius:8px;padding:2px 10px}
.phot{position:relative;display:inline-block}
.phot img{max-width:70%;max-height:240px;display:block}
.ppassage{background:#f8fafc;border:1px solid #d6dcec;border-radius:10px;padding:10px;white-space:pre-wrap;line-height:1.9;margin-bottom:8px}
.psub{margin:8px 0}
.pwline{height:26px;border-bottom:1px dotted #94a3b8}
/* student cards: 8 per A4 page */
.scards{display:grid;grid-template-columns:1fr 1fr;gap:5mm}
.scard{border:1.5px solid var(--p1);border-radius:14px;overflow:hidden;page-break-inside:avoid;background:#fff}
.sc-h{display:flex;align-items:center;gap:8px;padding:6px 10px;background:linear-gradient(135deg,var(--p-deep),var(--pri-d) 55%,var(--p1));color:#fff;font-size:12px}
.sc-h img{width:24px;height:24px;border-radius:6px;background:#fff;object-fit:contain}
.sc-b{display:flex;gap:10px;padding:8px 10px;align-items:center}
.sc-qr{width:88px;height:88px;flex:none}
.sc-qr svg{width:100%;height:100%}
.sc-t{display:flex;flex-direction:column;gap:1px;font-size:12px;min-width:0}
.sc-t b{font-size:14px}
.sc-l{color:#64748b;font-size:10px;margin-top:3px}
.sc-code{font-family:"Plus Jakarta Sans",monospace;font-weight:800;font-size:18px;letter-spacing:.18em;color:var(--pri-d);direction:ltr;text-align:start}
.sc-code.sm{font-size:14px}
.sc-f{font-size:9.5px;color:#475569;padding:4px 10px 6px;border-top:1px dashed var(--pri-line)}

.pch{display:flex;flex-wrap:wrap;gap:6px 24px}
.popt{display:inline-flex;align-items:center;gap:6px}
.pbox{display:inline-block;width:13px;height:13px;border:1.6px solid #334155;flex:none}
.pbox.round{border-radius:50%}
.pbox.sq{border-radius:3px}
.pbox.fill{background:var(--pri-d);border-color:var(--pri-d)}
.pqimg.sz-s{max-height:110px}.pqimg.sz-m{max-height:180px}.pqimg.sz-l{max-height:260px}
.phot.sz-s img{max-height:150px}.phot.sz-m img{max-height:210px}.phot.sz-l img{max-height:280px}
.sheet .tt th.brkh{background:#fef3c7;color:#92400e;font-size:10px;width:30px;writing-mode:vertical-rl}
.sheet .tt td.brk{background:#fef3c7!important;width:30px;padding:0}

/* ===== transcripts and certificates: one student per page ===== */
.sheet.multi{max-width:none}
.stu-page{position:relative;padding:6px 4px 14px;page-break-after:always;break-after:page;min-height:240mm;background:#fff}
.stu-page:last-child{page-break-after:auto;break-after:auto}
.stu-page .trinfo{display:flex;flex-wrap:wrap;gap:6px 22px;margin:4px 2px 12px;font-size:13px}
.trtable{width:100%;border-collapse:collapse;font-size:12.5px;margin-bottom:10px}
.trtable th,.trtable td{border:1px solid #cbd5e1;padding:6px 8px;text-align:center;vertical-align:middle}
.trtable th{background:#ecfdf5;color:#065f46;font-weight:800}
.trtable th small{display:block;font-weight:600;color:#64748b}
.trtable td.sub,.trtable th.sub{text-align:start;min-width:120px}
.trtable td small{color:#64748b}
.trtable .live{font-style:italic;color:#92400e}
.trtable .okc{color:#047857}.trtable .badc{color:#b91c1c}
.trtable.compact{font-size:12px}
.trtable.compact th,.trtable.compact td{padding:5px 6px}
.trnote{font-size:11px;color:#64748b;margin:2px 2px 8px}
.trresult{display:flex;gap:28px;flex-wrap:wrap;justify-content:center;margin:14px 0 6px;padding:12px 16px;border-radius:14px;font-size:15px;border:2px solid currentColor}
.trresult.okc{color:#047857;background:#ecfdf5}.trresult.badc{color:#b91c1c;background:#fef2f2}
.stu-page .sign{display:flex;justify-content:space-between;gap:20px;margin-top:70px;font-size:13px}
.stu-page .sign>div{flex:1;text-align:center;border-top:1px solid #64748b;padding-top:8px}
.stu-page.certificate{border:3px double #0f766e;border-radius:18px;padding:18px 20px 20px}
.stu-page .wm{position:absolute;inset:0;display:grid;place-items:center;font-size:150px;font-weight:900;letter-spacing:.05em;color:rgba(220,38,38,.13);transform:rotate(-30deg);pointer-events:none;z-index:2;overflow:hidden;white-space:nowrap}
.stu-page .draftbar{margin:0 0 8px;padding:6px 12px;border-radius:10px;background:#fef2f2;color:#b91c1c;border:1px dashed #dc2626;font-weight:800;font-size:12px;text-align:center}
@media print{ .stu-page{min-height:0} .stu-page .wm{-webkit-print-color-adjust:exact;print-color-adjust:exact} }
/* the student's own transcript is for viewing only */
.stu-transcript{-webkit-user-select:none;user-select:none}
@media print{ .stu-transcript{display:none!important} }
.pfill{white-space:pre-wrap}
