/* School Result app components (dashboards, help, profile). Shared UI
   library styles stay in ui.css / brand.css, copied from nhqa_frontend. */

.sr-kpi { border-left: 4px solid var(--brand-imperial); }
.sr-kpi-imperial { border-left-color: var(--brand-imperial); }
.sr-kpi-pumpkin  { border-left-color: var(--brand-pumpkin); }
.sr-kpi-sky      { border-left-color: var(--brand-sky); }
.sr-kpi-gold     { border-left-color: var(--brand-gold); }
.sr-kpi-success  { border-left-color: var(--bs-success); }
.sr-kpi-danger   { border-left-color: var(--bs-danger); }
.sr-kpi-muted    { border-left-color: var(--bs-secondary-bg); }
.sr-kpi-value { font-size: 1.6rem; font-weight: 600; line-height: 1.2; color: var(--brand-imperial); font-variant-numeric: tabular-nums; }
.sr-kpi a.stretched-link:focus-visible { outline: 2px solid var(--brand-pumpkin); outline-offset: 2px; }

.sr-checklist .list-group-item { padding: .55rem .9rem; }

.sr-child-card .sr-subjects { display: flex; flex-wrap: wrap; gap: 4px; }
.sr-child-card .sr-subjects .badge { font-weight: 500; }

.sr-help-page summary { cursor: pointer; }
.sr-help-page .sr-help-item + .sr-help-item { border-top: 1px solid var(--bs-border-color); }

/* ── Report card (inc/report_card.php) ─────────────────────────────── */
.sr-report { max-width: 1000px; margin: 0 auto; }
.sr-report-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid var(--brand-imperial); padding-bottom: 8px; }
.sr-report-logo { width: 64px; height: 64px; object-fit: contain; flex: 0 0 64px; }
.sr-report-initial { display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-imperial); color: #fff; font-size: 1.8rem; font-weight: 700; }
.sr-report-school { font-size: 1.35rem; font-weight: 700; color: var(--brand-imperial); line-height: 1.2; }
.sr-report-title { margin-top: 4px; font-weight: 600; letter-spacing: .02em; }
.sr-report-info th { width: 45%; font-weight: 500; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); }
.sr-report-position { margin: .6rem 0 0; padding: .45rem .8rem; border-radius: 6px; background: rgba(30, 123, 239, .08); color: var(--brand-imperial); text-align: center; }
.sr-report-subjects thead th { background: var(--brand-imperial); color: #fff; font-weight: 600; font-size: .8rem; vertical-align: middle; }
.sr-report-subjects td, .sr-report-subjects th { font-variant-numeric: tabular-nums; }
.sr-report-h { font-size: .95rem; font-weight: 600; color: var(--brand-imperial); margin: 0 0 .35rem; }
.sr-report .sr-grade { background: var(--brand-imperial); color: #fff; font-size: .85rem; }
.sr-report-signature { max-height: 48px; max-width: 160px; object-fit: contain; }
.sr-report-foot { border-top: 1px solid var(--bs-border-color); padding-top: 6px; text-align: center; }
.sr-broadsheet th, .sr-broadsheet td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sr-broadsheet thead th { font-size: .78rem; }

/* Printing: A4 with 5 mm margins (about the least printers allow); one report card per page. */
@page { size: A4; margin: 5mm; }
@media print {
  .sr-report { break-inside: avoid; page-break-inside: avoid; }
  .sr-report + .sr-report, .sr-report ~ .sr-report { break-before: page; page-break-before: always; }
  html, body, .app-wrapper, .app-main { min-height: 0 !important; height: auto !important; }
  /* A page holding a report card prints just the card (no child picker, filters or buttons). */
  body:has(.sr-report) .app-content *:not(.sr-report):not(.sr-report *):not(:has(.sr-report)) { display: none !important; }
  /* The printable width (200 mm) is just under the tablet breakpoint: keep the desktop arrangement. */
  .sr-report .row > .col-md-6 { flex: 0 0 auto; width: 50%; }
  .sr-report .row-cols-sm-2 > * { flex: 0 0 auto; width: 33.333%; }
  .sr-report-subjects th, .sr-report-subjects td { padding: .18rem .3rem !important; }
  .sr-report-subjects td:first-child { white-space: nowrap; }
  .app-sidebar, .app-header, .app-footer, .no-print, .ui-page-head, .ui-breadcrumb, #srAi, .alert { display: none !important; }
  .app-main, .app-content, .container-fluid { margin: 0 !important; padding: 0 !important; }
  .app-wrapper { display: block !important; }
  body { background: #fff !important; }
  .sr-report { box-shadow: none !important; border: 0 !important; max-width: none; }
  .sr-report-subjects thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sr-report .table-responsive { overflow: visible !important; }
}
.sr-report-qr { width: 88px; height: 88px; flex: 0 0 88px; image-rendering: pixelated; }

/* The page title lives in the topbar only (one h1 per page); it truncates on phones. */
.app-header .sr-page-title { font-size: clamp(.95rem, .85rem + .4vw, 1.1rem); max-width: 46vw; }
@media (min-width: 768px) { .app-header .sr-page-title { max-width: 40vw; } }

/* Report card: the student's passport photograph (a standard 35 x 45 mm proportion). */
.sr-report .sr-report-passport { width: 96px; height: 120px; object-fit: cover; border: 1px solid #d1d5db; border-radius: 4px; flex: none; }
.sr-report .sr-report-passport-empty { display: flex; align-items: center; justify-content: center; background: #f5f7fb; color: #b0b7c3; font-size: 2.2rem; }
@media (max-width: 575.98px) { .sr-report .sr-report-passport { width: 72px; height: 90px; } }
