/* RehbarNova Teacher Corner — front-end app styles. Scoped under #rntc-app
   so it never leaks into the Astra Urdu child theme's own styles. */

/* The site theme is RTL (Astra Urdu child theme, dir="rtl" on <html>), but
   this dashboard is an LTR interface (sidebar on the left, English/number
   entry fields). Without this, the theme's RTL context mirrors the whole
   flex layout — the sidebar/menu jumps to the right, the top-bar's
   Log Out button gets pushed out of view, and every text/number field
   types right-to-left. Force LTR everywhere inside the app, with enough
   specificity to always win over the theme. */
#rntc-app, #rntc-app * { direction: ltr !important; text-align: left; }
#rntc-app input, #rntc-app select, #rntc-app textarea { direction: ltr !important; text-align: left !important; unicode-bidi: plaintext; }

#rntc-app, #rntc-app * { box-sizing: border-box; }
#rntc-app {
	font-family: -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
	color: #1E1E1C;
	background: #F5F4EF;
	border: 1px solid #E4E1D8;
	border-radius: 14px;
	overflow: hidden;
	margin: 24px 0;
}
.rntc-login-notice { padding: 24px; text-align: center; }
.rntc-shell { display: flex; min-height: 640px; }
.rntc-sidebar { width: 220px; background: #153A2B; color: #fff; padding: 20px 0; flex-shrink: 0; }
.rntc-brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px; }
.rntc-logo { width: 36px; height: 36px; border-radius: 9px; background: #D97757; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.rntc-brand-title { font-weight: 700; font-size: 15px; }
.rntc-brand-sub { font-size: 11px; color: #BFD4C8; }
.rntc-nav { padding: 4px 10px; }
.rntc-nav-item {
	display: block; padding: 11px 16px; margin: 2px 0; font-size: 14px;
	color: #C9DED2; cursor: pointer; border-radius: 8px; border-left: 3px solid transparent;
	transition: background-color 180ms ease-out, color 180ms ease-out, border-color 180ms ease-out;
}
.rntc-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.rntc-nav-item.active {
	background: linear-gradient(135deg, rgba(217,119,87,.28) 0%, rgba(217,119,87,.10) 100%);
	border-left-color: #D97757; color: #fff; font-weight: 700;
	box-shadow: inset 0 0 0 1px rgba(217,119,87,.25);
}
.rntc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rntc-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 26px; background: #fff; border-bottom: 1px solid #E4E1D8; font-weight: 700; }
.rntc-user { font-weight: 400; font-size: 13px; color: #6B6858; }
.rntc-topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.rntc-logout-btn {
	font-weight: 600; font-size: 12.5px; color: #B03A2E !important; text-decoration: none;
	padding: 7px 14px; border-radius: 8px; border: 1px solid #E6A99B; background: #FBEAE7;
	transition: background-color 180ms ease-out, transform 180ms ease-out;
	white-space: nowrap; display: inline-block; flex-shrink: 0;
}
.rntc-logout-btn:hover { background: #F6D8D1; transform: translateY(-1px); }
@media (max-width: 600px) { .rntc-user { display: none; } }
.rntc-content { flex: 1; padding: 22px 26px; overflow: auto; }
.rntc-loading { color: #8A8578; padding: 40px; text-align: center; }

.rntc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 20px; }
.rntc-card { background: #fff; border: 1px solid #E4E1D8; border-radius: 12px; padding: 14px 16px; }
.rntc-card .lbl { font-size: 12px; color: #8A8578; }
.rntc-card .val { font-size: 24px; font-weight: 700; margin-top: 4px; }

.rntc-panel { background: #fff; border: 1px solid #E4E1D8; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.rntc-panel h3 { margin: 0 0 12px; font-size: 15px; }
.rntc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rntc-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }

.rntc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.rntc-toolbar select { min-width: 170px; }
/* 2.11.0 UI-clarity fix: a persistent "Generating: <Subject> · Class X-Y"
   line above the Generate button (renderReports() in app.js), so the
   current report-type/class/section/subject selection is always visible
   and unambiguous, instead of relying on the <select>'s own (theme-styled,
   easy-to-miss) chosen-value text. */
.rntc-report-summary { font-size: 12.5px; color: #4A473F; background: #F5F4EF; border-radius: 8px; padding: 8px 12px; margin-top: -2px; }
/* Same root cause as .rntc-btn above (fixed separately): these had no
   explicit color/background, so the Astra theme's own global form-field
   styling could make a <select>'s chosen value unreadable — e.g. picking
   "First Language Urdu" in Marks Entry / a report's subject dropdown and
   the text going invisible/blending into the background right after
   selecting it. Pinned explicitly with !important so this can never again
   depend on the theme. */
.rntc-toolbar select, .rntc-toolbar input[type=text], .rntc-toolbar input[type=search] {
	padding: 8px 10px; border: 1px solid #D8D4C8 !important; border-radius: 8px; font-size: 13px;
	background: #fff !important; color: #1E1E1C !important;
}
/* 2.11.1: the site owner reported a selected dropdown value (e.g. "First
   Language Urdu") appearing half-cut inside the <select> box. Root cause:
   these selects had no explicit height/line-height, so the Astra theme's
   own line-height (meant for its own, differently-padded form controls)
   was clipping the text's top/bottom instead of vertically centering it.
   A fixed height + matching line-height forces the chosen text to render
   fully and centered regardless of the active theme. */
.rntc-toolbar select, .rntc-field select {
	height: 44px !important; line-height: 44px !important;
	padding-top: 0 !important; padding-bottom: 0 !important;
	text-overflow: clip; white-space: normal;
}
.rntc-toolbar select option { color: #1E1E1C; background: #fff; white-space: normal; }
/* .rntc-btn's plain (non-primary, non-danger) variant used to have no
   explicit `color` — it inherited from #rntc-app, which is fine on its own,
   but the Astra theme's own global button styling (which targets every
   <button>/<a class="button"> on the site, including ours) can carry a
   higher-specificity or !important color rule that only resolves to a
   readable color on :hover. That's exactly what made "Edit / Cancel /
   Close / Copy / Import CSV / Export CSV" labels invisible until hovered.
   Every state below is now pinned explicitly with !important so it can
   never again depend on the theme or on hover. */
.rntc-btn {
	position: relative; overflow: hidden; padding: 9px 16px; border-radius: 8px;
	border: 1px solid #D8D4C8 !important; background: #fff !important; color: #1E1E1C !important;
	font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none !important;
	display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
	transition: transform 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out;
}
.rntc-btn.primary {
	background: linear-gradient(135deg, #E08865 0%, #D97757 55%, #C7623F 100%) !important;
	border-color: #D97757 !important;
	color: #fff !important;
	box-shadow: 0 2px 6px rgba(217,119,87,.35);
}
.rntc-btn.danger { background: #FBEAE7 !important; border-color: #E6A99B !important; color: #B03A2E !important; }
.rntc-btn:disabled { opacity: .5; cursor: not-allowed; }
.rntc-spacer { flex: 1; }

/* Premium "diamond shine" sweep: a diagonal light streak that glides across
   the button on hover, plus a gentle lift/scale and a brighter glow. Pure
   CSS transform/opacity — cheap to paint, no blur or JS, safe on low-end
   Android phones. */
.rntc-btn.primary::after {
	content: "";
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.55) 50%, transparent 100%);
	transform: translateX(0) skewX(-20deg);
	opacity: 0;
	pointer-events: none;
	transition: transform 550ms ease-out, opacity 550ms ease-out;
}
.rntc-btn.primary:hover {
	transform: translateY(-2px) scale(1.02);
	box-shadow: 0 6px 16px rgba(217,119,87,.45);
}
.rntc-btn.primary:hover::after {
	transform: translateX(260%) skewX(-20deg);
	opacity: 1;
}
.rntc-btn.primary:active { transform: translateY(0) scale(.99); }
.rntc-btn:not(.primary):hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(30,30,28,.08); }

.rntc-nav-item { transition: background-color 180ms ease-out, border-color 180ms ease-out; }
table.rntc-table tbody tr { transition: background-color 150ms ease-out; }
table.rntc-table tbody tr:hover { background: #FAF8F3; }
.rntc-toolbar select, .rntc-toolbar input[type=text], .rntc-toolbar input[type=search],
.rntc-field input, .rntc-field select {
	transition: border-color 180ms ease-out, box-shadow 180ms ease-out;
}
.rntc-toolbar select:focus, .rntc-toolbar input[type=text]:focus, .rntc-toolbar input[type=search]:focus,
.rntc-field input:focus, .rntc-field select:focus {
	outline: none;
	border-color: #D97757;
	box-shadow: 0 0 0 3px rgba(217,119,87,.18);
}

table.rntc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rntc-table th { background: #F0EBE3; text-align: left; padding: 9px 10px; font-size: 12px; color: #4A473F; position: sticky; top: 0; }
table.rntc-table td { padding: 8px 10px; border-bottom: 1px solid #F0EBE3; }
table.rntc-table input.rntc-cell { width: 60px; padding: 5px 6px; border: 1px solid #D8D4C8; border-radius: 6px; text-align: center; font-size: 13px; }
.rntc-table-wrap { max-height: 520px; overflow: auto; border: 1px solid #E4E1D8; border-radius: 10px; }

.rntc-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.rntc-badge.ok { background: #E7F3EA; color: #2E8B4E; }
.rntc-badge.warn { background: #FDF1E4; color: #C7710A; }
.rntc-badge.err { background: #FBEAE7; color: #C0392B; }

/* Small per-FA grade chip (FA-1 A+, FA-2 B+, ...): shows the FA-1..FA-4
   progress trend next to a subject's totals, in the marks-entry grid and
   in the printed reports. Background is set inline per-chip to the grade's
   own color (same palette as .rntc-swatch / grade cells elsewhere). */
.rntc-fa-grade-chip { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; margin: 1px 2px 1px 0; }
.rntc-fa-trend { display: flex; flex-wrap: wrap; gap: 3px; }

.rntc-modal-backdrop { position: fixed; inset: 0; background: rgba(21,58,43,.45); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.rntc-modal { background: #fff; border-radius: 14px; padding: 22px; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; }
.rntc-modal h3 { margin-top: 0; }
.rntc-field { margin-bottom: 12px; text-align: left; }
.rntc-field label { display: block; text-align: left; font-size: 12px; color: #6B6858; margin-bottom: 4px; font-weight: 600; }
.rntc-field input, .rntc-field select { width: 100%; padding: 8px 10px; border: 1px solid #D8D4C8 !important; border-radius: 8px; font-size: 13px; text-align: left; box-sizing: border-box; background: #fff !important; color: #1E1E1C !important; }
.rntc-field select option { color: #1E1E1C; background: #fff; }

/* Force every login / signup form to be left-aligned (username, password,
   mobile, email, all Create-My-School / Join-a-School fields) even if the
   active WordPress theme's global styles try to center wp_login_form(). */
.rntc-auth-wrap, .rntc-auth-panel, .rntc-auth-panel form,
.rntc-auth-panel p, .rntc-auth-panel label, .rntc-auth-panel input {
	text-align: left !important;
}
.rntc-auth-panel input[type="text"],
.rntc-auth-panel input[type="email"],
.rntc-auth-panel input[type="password"],
.rntc-auth-panel input[type="submit"] { width: 100%; box-sizing: border-box; }
.rntc-auth-panel #loginform p { text-align: left; }
.rntc-auth-panel #loginform label { display: block; text-align: left; }
.rntc-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.rntc-code-row { display: flex; gap: 8px; }
.rntc-code-row input { flex: 1; font-weight: 700; letter-spacing: 1px; }

.rntc-toast { position: fixed; bottom: 24px; right: 24px; background: #153A2B; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13px; z-index: 10000; }
.rntc-toast.err { background: #B03A2E; }

/* 2.11.5 CRITICAL FIX — the TRUE, confirmed (not guessed) root cause of
   "last column always runs off the page", present in EVERY report, even a
   plain 3-column table with no <colgroup> at all (the Grade Analysis
   table): the @media print rule further down sets
   `.rntc-print-page { position: absolute; left: 0; top: 0; width: 100%; }`
   to hide everything except the report while printing. Without
   `box-sizing: border-box`, a `width: 100%` element still ADDS its own
   `padding: 30px` (left+right = 60px) on top of that 100% — so the box's
   real rendered width becomes "100% of the page + 60px", not 100%. Because
   it's `position: absolute` with `left: 0` (left edge pinned), that extra
   60px can only overflow in ONE direction: to the RIGHT, off the edge of
   the printable page — consistently, on every single report, regardless of
   column count or <colgroup> widths, exactly matching what was reported.
   `box-sizing: border-box` makes `width: 100%` include the padding INSIDE
   that 100%, so the box's outer edge lands exactly at the page's own right
   margin, every time. */
.rntc-print-page { background: #fff; padding: 30px; font-family: -apple-system, sans-serif; color: #1E1E1C; box-sizing: border-box; }
.rntc-print-page * { box-sizing: border-box; }
.rntc-print-head { display: flex; align-items: center; gap: 14px; border-bottom: 3px solid #153A2B; padding-bottom: 12px; margin-bottom: 14px; }
.rntc-print-logo { width: 46px; height: 46px; border-radius: 10px; background: #153A2B; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; }
.rntc-print-school { font-size: 19px; font-weight: 700; }
.rntc-print-sub { font-size: 11px; color: #6B6858; }
.rntc-print-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px 20px; font-size: 12px; background: #F5F4EF; padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; }
table.rntc-print-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px; }
table.rntc-print-table th, table.rntc-print-table td { border: 1px solid #C9C4B6; padding: 6px 8px; }
table.rntc-print-table th { background: #F0EBE3; }
table.rntc-print-table td.c { text-align: center; }
table.rntc-print-table td.b { font-weight: 700; }
.rntc-total-row { background: #F0EBE3; font-weight: 700; }
.rntc-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.rntc-partb-wrap { margin-bottom: 14px; font-size: 12px; }
.rntc-partb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rntc-partb-item { display: flex; gap: 6px; background: #F5F4EF; padding: 4px 10px; border-radius: 6px; }
.rntc-print-sign { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 30px; margin-top: 20px; border-top: 1px solid #E4E1D8; font-size: 12px; }
.rntc-sign-box { width: 140px; border-top: 1px solid #1E1E1C; padding-top: 4px; text-align: center; }
.rntc-sign-qr { width: 60px; height: 60px; border: 1px dashed #B9B4A5; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 9px; text-align: center; color: #8A8578; }
.rntc-print-note { font-size: 11px; color: #6B6858; margin-bottom: 14px; }

.rntc-page-break { page-break-before: always; break-before: page; padding-top: 20px; }
@media print {
	body * { visibility: hidden; }
	.rntc-print-page, .rntc-print-page * { visibility: visible; }
	.rntc-print-page { position: absolute; left: 0; top: 0; width: 100%; }
	.rntc-landscape { width: 100%; }
	@page { size: A4; margin: 12mm; }
}

table.rntc-print-table.rntc-small th, table.rntc-print-table.rntc-small td { padding: 3px 5px; font-size: 10px; line-height: 1.25; }

/* All Subject Consolidated (Class 10): wider than Class 9 thanks to the
   Preparatory-1/-2 checkpoint columns, so it gets an extra compaction pass
   on top of .rntc-small to keep the whole row on one A4 Landscape page.
   2.11.4 tightened this further (3px/4px, 9.5px -> 2px/3px, 8.5px) purely
   for column-width headroom; 2.11.6 then loosened the row HEIGHT back up
   for readability now that .rntc-paginate-15 lets a big class spill onto a
   second page instead of being crushed onto one — see the actual rule and
   its docblock further down (search "MULTI-PAGE STUDENT LISTS"), which is
   the one that applies. */

/* 2.11.1: site owner reported the last column(s) of a wide report (Subject
   Consolidated / Mid-Term / Final, which can run to 25+ columns with the
   full FA-1..FA-4 + checkpoint breakdown) running off the printed page.
   table-layout:fixed forces every column into an equal, page-bounded share
   of the table's own width (100%) instead of letting the browser size each
   column to its content and overflow the page; word-break lets a long
   header/value wrap onto a second line within that fixed width rather than
   being clipped or pushing the table wider than the page. Applied to every
   .rntc-print-table (portrait and landscape) so no report's columns can
   ever be cut off again. */
table.rntc-print-table { table-layout: fixed; }
table.rntc-print-table th, table.rntc-print-table td { white-space: normal; word-break: break-word; overflow-wrap: break-word; }
@media print {
	table.rntc-print-table { width: 100% !important; table-layout: fixed !important; }
	table.rntc-print-table th, table.rntc-print-table td { white-space: normal !important; word-break: break-word !important; }
}

/* 2.11.6 — MULTI-PAGE STUDENT LISTS + A NON-SPLITTING GRADE ANALYSIS TABLE.
   Site owner's exact complaint: with a big class (e.g. 27 students) the
   student list was squeezed onto ONE page via very tight row padding
   (.rntc-tight was 2px/3px, 8.5px font) so it was hard to read, AND the
   Grade Analysis table right after it would start on that same page and
   get sliced in half by the page boundary — its heading + first few rows
   printed on page 1, the rest orphaned onto page 2 with no repeated header.
   Fix, in two parts:
   1) `thead`/`tbody` now wrap the header row(s) and data rows of every
      report's main student table (see class-rntc-reports.php) so the
      browser's print engine can repeat the header row on every page a
      table spans — `display: table-header-group` is what makes that
      happen; it's the browser default for a real <thead> but is spelled
      out here in case any host stylesheet resets it.
   2) `.rntc-paginate-15 tbody tr` gets `page-break-inside: avoid` (a row
      itself must never be split across two pages) and every 15th data row
      gets `page-break-after: always` — this forces a clean, predictable
      break after exactly 15 student rows per page (the row height was
      loosened below specifically so ~15 rows is what already fits an A4
      page comfortably, not a cramped 27), with the <thead> reprinting on
      the next page automatically. A 27-student class therefore prints as
      15 rows on page 1 + the remaining 12 (with header) on page 2, instead
      of one crushed 27-row page.
   3) The Grade Analysis heading + table are wrapped (in the PHP) in a
      single `.rntc-keep-together` block with `page-break-inside: avoid` /
      `break-inside: avoid`. A browser respecting that rule treats the
      whole block as one atomic unit: if it doesn't fit in the space left
      on the current page it is pushed ENTIRELY onto the next page, rather
      than being split with its header row stranded above the break. */
table.rntc-print-table thead { display: table-header-group; }
table.rntc-paginate-15 tbody tr { page-break-inside: avoid; break-inside: avoid; }
@media print {
	table.rntc-print-table thead { display: table-header-group !important; }
	table.rntc-paginate-15 tbody tr { page-break-inside: avoid !important; break-inside: avoid !important; }
}

/* 2.16.0 — DYNAMIC PAGINATION (site owner's exact complaint: a flat "break
   after every 15th row" left a near-empty page whenever a class size wasn't
   a clean multiple of 15 — e.g. 32 students printed as 15+15+2, the last
   sheet almost entirely blank). The blanket `:nth-child(15n)` rule above is
   gone; class-rntc-reports.php now computes a BALANCED page size per report
   (self::pagination_breaks()) so a class of any size splits into the fewest,
   most even pages possible (32 students -> 11+11+10, never a 1-2 row
   leftover sheet) and writes the actual break onto a dedicated marker row
   (`.rntc-page-break-row`) instead of a data row, carrying its own
   "Page X of Y" footer. This also fixes a quiet edge-case in the old rule:
   when a class size was an EXACT multiple of 15, the very last data row also
   matched `:nth-child(15n)` and forced a pointless extra blank page before
   the Grade Analysis table — the new marker-row approach never emits a break
   after the final page's rows, so Grade Analysis always flows straight after
   the table when it fits. */
tr.rntc-page-break-row { page-break-after: always; break-after: page; }
td.rntc-page-footer { border: none !important; text-align: right; font-size: 10.5px; font-style: italic; color: #6B6858; padding: 6px 2px 0 !important; }
@media print {
	tr.rntc-page-break-row { page-break-after: always !important; break-after: page !important; }
	td.rntc-page-footer { border: none !important; }
}
.rntc-keep-together { page-break-inside: avoid; break-inside: avoid; }
@media print {
	.rntc-keep-together { page-break-inside: avoid !important; break-inside: avoid !important; }
}

/* Loosened from the old 2px/3px, 8.5px cramped values — the site owner
   asked for the student list to look "khula khula" (open/spacious) and
   easy to read rather than squeezed to fit everyone on one page, now that
   .rntc-paginate-15 above lets a big class spill onto a second page
   instead. Still tight enough to keep a 20+ column Mid-Term/Final
   Consolidated table inside A4 Landscape width. */
table.rntc-print-table.rntc-tight th, table.rntc-print-table.rntc-tight td { padding: 5px 6px; font-size: 10px; line-height: 1.45; }

/* Subject Individual Marks Entry Register — two stacked rows (I-SEM/II-SEM)
   per student, SL.NO/Name merged via rowspan across both. */
table.rntc-print-table.rntc-register-table th, table.rntc-print-table.rntc-register-table td { vertical-align: middle; }

/* 2.11.2 Subject Consolidated redesign: checkpoint_consolidated() now emits
   its own <colgroup> with an exact per-column width percentage (Roll No/
   Grade compact, Student Name widest, columns always sum to 100% of the
   table however many assessment stages are currently visible — see that
   method's docblock). .rntc-fixed-cols opts a table INTO using those
   authored widths as-is (table-layout:fixed already applies to every
   .rntc-print-table above; this class exists purely as a marker/hook so a
   future report can add its own <colgroup> the same way).
   .rntc-nowrap-cell is Roll No specifically: a short numeric roll number
   should never wrap. 2.16.0 — site owner's screenshot showed a LONG student
   name forced onto one line by this same rule overflowing visibly into the
   next column (table-layout:fixed doesn't clip a nowrap cell, it just lets
   the text spill over), so Student Name cells no longer carry this class in
   class-rntc-reports.php and fall back to the blanket word-break:break-word
   above — a normal-length name still renders on one line on its own (wrap
   only kicks in once the text actually exceeds the column's width), and a
   long one now wraps onto a second line with the row's height growing to
   fit, instead of invading the next column. */
table.rntc-print-table td.rntc-nowrap-cell, table.rntc-print-table th.rntc-nowrap-cell {
	white-space: nowrap !important; word-break: normal !important; overflow-wrap: normal !important;
}
@media print {
	table.rntc-print-table td.rntc-nowrap-cell, table.rntc-print-table th.rntc-nowrap-cell { white-space: nowrap !important; }
}

/* 2.16.0 — Grade Analysis table styling (site owner's exact spec: bigger
   font, bold/highlighted heading, centered counts, darker professional
   borders) decoupled from `.rntc-small`'s general compacting, which several
   main data tables also use and must stay small. */
table.rntc-print-table.rntc-grade-table th, table.rntc-print-table.rntc-grade-table td {
	font-size: 15px; padding: 7px 12px; border: 1.5px solid #8A8578; text-align: center;
}
table.rntc-print-table.rntc-grade-table th {
	background: #153A2B; color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: .02em;
}
table.rntc-print-table.rntc-grade-table td:first-child { text-align: left; font-weight: 700; }
@media print {
	table.rntc-print-table.rntc-grade-table th, table.rntc-print-table.rntc-grade-table td { border: 1.5px solid #8A8578 !important; }
}

/* 2.16.0 — Colour/Black & White print mode (site owner's exact request).
   Colour is the existing default look (dark-green school name, blue report
   title, the stat cards' own colours, the green grade-table heading, grey
   signature footer — all below). `.rntc-bw-mode`, added to the print
   popup's <body> when the person picks "Black & White" before printing
   (see app.js openReportPrintPopup()), neutralises every colour to plain
   black-on-white for cheap ink-saving prints while keeping every border so
   the table is still readable without colour. */
.rntc-print-generated { font-size: 10px; color: #8A8578; text-align: right; margin-top: 10px; }
.rntc-print-school { color: #153A2B; font-weight: 700; }
.rntc-print-report-title { color: #2563AC; font-weight: 600; }
.rntc-print-sign { background: #F5F4EF; border-radius: 0 0 8px 8px; }
.rntc-bw-mode, .rntc-bw-mode * {
	color: #000 !important; background: #fff !important; border-color: #000 !important;
}
.rntc-bw-mode .rntc-print-stat { border: 1px solid #000 !important; }
@media print {
	.rntc-bw-mode, .rntc-bw-mode * { color: #000 !important; background: #fff !important; border-color: #000 !important; }
}

/* Subject Consolidated Analysis Report — A4 Landscape, 2-page dashboard.
   Named-page CSS (Paged Media): only pages carrying this class print
   landscape, every other report keeps the default portrait @page above. */
.rntc-print-page.rntc-landscape-a4 { page: rntc-landscape-a4; width: 100%; }
.rntc-print-page.rntc-landscape-a4 .rntc-print-school { text-transform: uppercase; }
@media print {
	@page rntc-landscape-a4 { size: A4 landscape; margin: 10mm; }
}

.rntc-print-meta-line { display: flex; flex-wrap: wrap; gap: 4px 28px; font-size: 12.5px; background: #F5F4EF; padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; }
.rntc-section-h { margin: 0 0 6px; font-size: 13px; color: #153A2B; }

.rntc-print-stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.rntc-print-stat { flex: 1; min-width: 118px; border-radius: 10px; padding: 9px 13px; color: #fff; }
.rntc-print-stat .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; opacity: .95; font-weight: 600; }
.rntc-print-stat .val { font-size: 23px; font-weight: 800; margin-top: 3px; }

.rntc-print-flex { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.rntc-print-flex > div { flex: 1; min-width: 0; }
.rntc-chart-box { position: relative; height: 190px; }
.rntc-chart-box canvas { max-width: 100%; max-height: 100%; }

.rntc-remarks h4 { margin: 10px 0 3px; font-size: 12.5px; color: #153A2B; }
.rntc-remarks p { margin: 0 0 6px; font-size: 11.5px; line-height: 1.5; }
@media (max-width: 900px) {
	.rntc-shell { flex-direction: column; }
	.rntc-sidebar { width: 100%; }
	.rntc-nav { display: flex; overflow-x: auto; }
	.rntc-nav-item { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
	.rntc-nav-item.active { border-left: none; border-bottom-color: #D97757; }
	.rntc-grid-2, .rntc-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
	.rntc-auth-wrap { margin: 12px auto; padding: 16px; border-radius: 10px; }
	.rntc-auth-tabs { flex-wrap: wrap; }
	.rntc-auth-tab { flex: 1 1 100%; }
}

/* 2.11.7 — "All Subject Consolidated" HM register: site owner's exact
   request was "at least 4 students per page" so this printout can actually
   be used and bound as the school's physical consolidated-marks register,
   instead of the old one-full-page-per-student layout burning a whole
   sheet on every single student. Each student is now one dense block
   (identity line + subject table + one summary line, see
   all_subject_consolidated()'s PHP for the markup) and 4 of them are
   grouped under one shared letterhead/signature per printed page.
   `.rntc-register-compact` is deliberately denser than the `.rntc-tight`
   class used elsewhere (that one was loosened for on-screen readability by
   the earlier row-height fix; this one exists purely so 4 full student
   records - each its own multi-column subject table - fit one A4
   Landscape sheet, which a bound register can afford since it's read at a
   desk, not skimmed on a phone). */
.rntc-consolidated-student { margin-bottom: 4px; padding-bottom: 3px; border-bottom: 1px solid #E4E1D8; }
.rntc-consolidated-student:last-child { border-bottom: none; }
.rntc-consolidated-student-head { font-size: 11px; background: #F5F4EF; padding: 2px 8px; border-radius: 5px; margin-bottom: 2px; }
.rntc-consolidated-summary { font-size: 10px; padding: 1px 8px; }
table.rntc-print-table.rntc-register-compact th, table.rntc-print-table.rntc-register-compact td { padding: 1.5px 3px; font-size: 8px; line-height: 1.15; }
table.rntc-print-table.rntc-register-compact { margin-bottom: 0; }
/* This report's own signature line sits right after 4 dense student blocks
   with very little slack left on the page - the shared .rntc-print-sign
   rule elsewhere uses a generous 30px/20px top gap meant for a mostly-empty
   page, which was just enough to push onto an otherwise-empty 2nd sheet
   here. Pulled in for this report only. */
.rntc-consolidated-register .rntc-print-sign { padding-top: 10px; margin-top: 6px; }
