/* Frelyn International School — shared interface system
   Navy, white, light blue, subtle grey. 48px buttons, 16px body, phone-first. */

@font-face { font-family: 'Nunito'; src: url('../vendor/fonts/nunito-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../vendor/fonts/nunito-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../vendor/fonts/nunito-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../vendor/fonts/nunito-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --navy: #0b2a5b;
  --navy-800: #082145;
  --navy-600: #16407f;
  --sky: #e8f1fb;
  --sky-deep: #cfe2f7;
  --ink: #12263f;
  --muted: #5d7186;
  --line: #dfe7f1;
  --bg: #f4f7fb;
  --card: #ffffff;
  --green: #1f8a4c;
  --green-soft: #e6f6ec;
  --amber: #9a5b00;
  --amber-soft: #fff3d6;
  --red: #b3261e;
  --red-soft: #fdecea;
  --purple: #6b4bb8;
  --accent: var(--navy);
  --accent-soft: var(--sky);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(11, 42, 91, .07);
  --shadow-lg: 0 24px 60px rgba(11, 42, 91, .16);
  --topbar-h: 68px;
  --sidenav-w: 252px;
}

html { font-size: 16px; }
html[data-text-size="large"] { font-size: 18px; }
html[data-text-size="xlarge"] { font-size: 20px; }

* { -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
  min-height: 100vh;
}
h1, h2, h3, h4, h5, .h1, .h2, .h3 { color: var(--navy); font-weight: 800; letter-spacing: -.01em; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; }
.text-muted, .text-secondary { color: var(--muted) !important; }
:focus-visible { outline: 3px solid #2f80ed; outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 3000;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 1040;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--navy); color: #fff; box-shadow: 0 2px 16px rgba(8, 33, 69, .2);
}
.topbar a { color: #fff; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand img { height: 44px; width: auto; background: #fff; border-radius: 8px; padding: 3px 5px; }
.brand-name { font-weight: 800; font-size: .95rem; line-height: 1.1; max-width: 190px; }
.brand-name small { display: block; font-weight: 600; font-size: .68rem; opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.term-pill {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: .86rem; font-weight: 700; white-space: nowrap;
}
.term-pill svg { width: 17px; height: 17px; }
.icon-btn {
  border: 0; background: rgba(255,255,255,.1); color: #fff; width: 44px; height: 44px;
  border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,.2); }
.icon-btn svg { width: 21px; height: 21px; }
.help-btn {
  border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff;
  border-radius: 999px; padding: 9px 15px; font-weight: 700; font-size: .9rem;
  display: inline-flex; align-items: center; gap: 7px;
}
.help-btn svg { width: 18px; height: 18px; }
.help-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.bell-wrap { position: relative; }
.bell-badge {
  position: absolute; top: 2px; right: 2px; background: #ffb020; color: #3b2600;
  min-width: 20px; height: 20px; border-radius: 999px; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 5px; border: 2px solid var(--navy);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--navy);
  font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; border: 2px solid rgba(255,255,255,.5); flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-btn { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: #fff; padding: 4px; border-radius: 12px; }
.profile-btn:hover { background: rgba(255,255,255,.1); }
.profile-name { text-align: left; line-height: 1.1; font-weight: 700; font-size: .88rem; }
.profile-name small { display: block; font-weight: 600; font-size: .7rem; opacity: .8; }

.global-search { position: relative; flex: 1; max-width: 420px; }
.global-search input {
  width: 100%; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.12); color: #fff; padding: 0 16px 0 44px; font-size: .95rem;
}
.global-search input::placeholder { color: rgba(255,255,255,.72); }
.global-search input:focus { background: #fff; color: var(--ink); outline: none; border-color: #fff; }
.global-search .search-ico { position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; opacity: .85; pointer-events: none; }
.search-results {
  position: absolute; top: 52px; left: 0; right: 0; background: #fff; color: var(--ink);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 2000;
  max-height: 380px; overflow-y: auto; border: 1px solid var(--line);
}
.search-results a { display: block; padding: 11px 15px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.search-results a:hover { background: var(--sky); }
.search-results .sr-type { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }

/* ---------- Shell ---------- */
.app-shell { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }
.sidenav {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidenav-w);
  background: #fff; border-right: 1px solid var(--line); padding: 16px 12px 28px;
  overflow-y: auto; z-index: 1030; flex-direction: column; gap: 4px;
}
.nav-section { margin: 10px 0 4px; padding: 0 14px; font-size: .7rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nav-link.app-nav {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  color: #33475f; font-weight: 700; font-size: .95rem; border: 1px solid transparent;
}
.nav-link.app-nav svg { width: 20px; height: 20px; color: #5d7186; flex: none; }
.nav-link.app-nav:hover { background: var(--sky); color: var(--navy); text-decoration: none; }
.nav-link.app-nav.active { background: var(--navy); color: #fff; box-shadow: 0 8px 18px rgba(11,42,91,.18); }
.nav-link.app-nav.active svg { color: #fff; }
.nav-link.app-nav .nav-badge { margin-left: auto; background: var(--amber-soft); color: var(--amber); border-radius: 999px; padding: 1px 8px; font-size: .72rem; font-weight: 800; }
.nav-link.app-nav.active .nav-badge { background: rgba(255,255,255,.2); color: #fff; }

.main-content { margin-left: var(--sidenav-w); width: 100%; padding: 26px 30px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.45rem, 2vw, 2rem); margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0; max-width: 760px; }
.breadcrumb-line { font-size: .82rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.breadcrumb-line svg { width: 14px; height: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040; background: #fff;
  border-top: 1px solid var(--line); display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 18px rgba(11,42,91,.06);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--muted); font-size: .68rem; font-weight: 800; padding: 6px 2px; border-radius: 10px;
  text-decoration: none; min-height: 52px; justify-content: center;
}
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.active { color: var(--navy); background: var(--sky); }

.offcanvas { max-width: 92vw; }
.offcanvas .nav-link.app-nav { color: #33475f; }
.offcanvas .nav-link.app-nav svg { color: #5d7186; }
.offcanvas .nav-link.app-nav.active { color: #fff; }
.offcanvas .nav-link.app-nav.active svg { color: #fff; }

/* ---------- Buttons ---------- */
.btn { border-radius: 12px; font-weight: 800; min-height: 46px; padding: .62rem 1.15rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { width: 18px; height: 18px; }
.btn-lg { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { min-height: 38px; padding: .35rem .8rem; font-size: .86rem; }
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover, .btn-primary:focus { background: var(--navy-600); border-color: var(--navy-600); }
.btn-success { background: var(--green); border-color: var(--green); }
.btn-warning { background: #f0a500; border-color: #f0a500; color: #3b2600; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-outline-primary { color: var(--navy); border-color: #a9bfdc; }
.btn-outline-primary:hover { background: var(--navy); border-color: var(--navy); }
.btn-outline-secondary { color: #41566e; border-color: #c7d3e1; background: #fff; }
.btn-outline-secondary:hover { background: var(--sky); color: var(--navy); border-color: #a9bfdc; }
.btn-light { background: #fff; border-color: var(--line); color: var(--navy); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--navy-600); }
.btn-ghost:hover { background: var(--sky); }

/* ---------- Cards & layout blocks ---------- */
.app-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.app-card.tight { padding: 16px; }
.card-title-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title-line h2, .card-title-line h3 { font-size: 1.1rem; margin: 0; }
.section-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.band-banner { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, white); border-left: 6px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.action-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; gap: 14px; text-align: left; color: var(--ink);
  min-height: 92px; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s, border-color .12s;
  text-decoration: none !important; width: 100%;
}
.action-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #bcd2ea; color: var(--navy); }
.action-tile .tile-icon {
  width: 52px; height: 52px; border-radius: 14px; background: var(--sky); color: var(--navy);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.action-tile .tile-icon svg { width: 27px; height: 27px; }
.action-tile .tile-label { font-weight: 800; font-size: 1.02rem; line-height: 1.25; }
.action-tile .tile-sub { font-size: .83rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.action-tile.accent .tile-icon { background: var(--accent); color: #fff; }
.action-tile.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.action-tile.primary .tile-icon { background: rgba(255,255,255,.16); color: #fff; }
.action-tile.primary .tile-sub { color: rgba(255,255,255,.8); }
.action-tile.primary:hover { color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: .8rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1.1; margin: 4px 0 2px; }
.stat-card .stat-note { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-card.tone-warn { border-left: 5px solid #f0a500; }
.stat-card.tone-good { border-left: 5px solid var(--green); }
.stat-card.tone-info { border-left: 5px solid #2f80ed; }
.stat-card.tone-danger { border-left: 5px solid var(--red); }

.two-col { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.stack-8 > * + * { margin-top: 8px; }
.stack-14 > * + * { margin-top: 14px; }

/* ---------- Status, pills, workflow ---------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 4px 11px; font-size: .78rem; font-weight: 800; white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-success { background: var(--green-soft); color: var(--green); border-color: #b9e3c9; }
.tone-info { background: #e8f1fd; color: #1b5bb5; border-color: #c4dcfb; }
.tone-warning { background: var(--amber-soft); color: var(--amber); border-color: #f2d798; }
.tone-danger { background: var(--red-soft); color: var(--red); border-color: #f3c4c0; }
.tone-secondary { background: #eef2f7; color: #46596e; border-color: #d5dee9; }

.workflow-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; font-weight: 800; color: var(--muted); }
.workflow-line .wf-step { display: inline-flex; align-items: center; gap: 5px; }
.workflow-line .wf-step.done { color: var(--green); }
.workflow-line .wf-step.current { color: var(--navy); background: var(--sky); padding: 2px 8px; border-radius: 999px; }
.workflow-line .wf-sep { color: #b7c4d4; }

.band-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: .74rem; font-weight: 800; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 20%, white); }
.grade-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 3px 9px; border-radius: 9px; font-weight: 800; background: var(--sky); color: var(--navy); }

.progress { height: 10px; border-radius: 999px; background: #e7eef7; }
.progress-bar { background: var(--accent); border-radius: 999px; }
.progress.thin { height: 6px; }

/* ---------- Forms ---------- */
.form-label { font-weight: 800; color: #33475f; margin-bottom: 5px; font-size: .92rem; }
.form-hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-control, .form-select {
  border-radius: 12px; border: 1.5px solid #cdd9e7; min-height: 48px; font-size: 1rem; padding: .6rem .85rem;
}
.form-control:focus, .form-select:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(22,64,127,.15); }
.form-check-input { width: 1.2em; height: 1.2em; margin-top: .2em; }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.input-group-text { border-radius: 12px; background: var(--sky); border-color: #cdd9e7; font-weight: 700; color: var(--navy); }
.was-validated .form-control:valid, .form-control.is-valid { border-color: var(--green); background-image: none; }
.required-mark { color: var(--red); }

.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.wizard-step {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: .82rem; font-weight: 800; color: var(--muted);
}
.wizard-step .num { width: 24px; height: 24px; border-radius: 50%; background: #e7eef7; display: flex; align-items: center; justify-content: center; font-size: .76rem; }
.wizard-step.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.wizard-step.active .num { background: rgba(255,255,255,.2); }
.wizard-step.done { background: var(--green-soft); color: var(--green); border-color: #b9e3c9; }
.wizard-step.done .num { background: var(--green); color: #fff; }

/* ---------- Tables ---------- */
.table-responsive { border-radius: 12px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; color: var(--ink); }
.table > :not(caption) > * > * { padding: .7rem .6rem; vertical-align: middle; }
.table thead th { background: #eef4fb; color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; border-bottom: 1px solid var(--line); }
.table-hover tbody tr:hover { background: #f7fafd; }
.table-sm > :not(caption) > * > * { padding: .45rem .5rem; }
.row-flag { background: #fff6f5 !important; }

.table-stack thead { display: none; }
.table-stack tbody tr { display: block; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: #fff; padding: 8px 4px; }
.table-stack tbody td { display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 0 !important; padding: 7px 12px !important; text-align: right; }
.table-stack tbody td::before { content: attr(data-label); font-weight: 800; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.table-stack tbody td:last-child { border-top: 1px dashed var(--line) !important; }

/* ---------- People ---------- */
.person-line { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar-photo {
  width: 46px; height: 46px; border-radius: 12px; background: var(--sky); color: var(--navy);
  overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex: none; font-weight: 800;
}
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; }
.avatar-photo.lg { width: 92px; height: 92px; border-radius: 18px; font-size: 1.5rem; }
.avatar-photo.xl { width: 128px; height: 128px; border-radius: 22px; font-size: 2rem; }
.person-line .pname { font-weight: 800; line-height: 1.2; }
.person-line .pmeta { font-size: .8rem; color: var(--muted); font-weight: 600; }

.child-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.child-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  box-shadow: var(--shadow); text-align: center;
}
.child-card img.child-photo, .child-card .child-photo.placeholder {
  width: 108px; height: 108px; border-radius: 50%; object-fit: cover; margin: 0 auto 12px; display: block;
  border: 4px solid var(--accent-soft); background: var(--sky); color: var(--navy);
  font-size: 2rem; font-weight: 800; line-height: 100px; text-align: center;
}
.child-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.child-card .child-class { color: var(--muted); font-weight: 700; font-size: .88rem; margin-bottom: 14px; }

.pupil-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pupil-tile {
  position: relative; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 10px;
  text-align: center; cursor: pointer; user-select: none; transition: all .12s; min-height: 150px;
}
.pupil-tile img, .pupil-tile .ph { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; margin: 0 auto 8px; background: var(--sky); display: flex; align-items: center; justify-content: center; color: var(--navy); font-weight: 800; font-size: 1.4rem; }
.pupil-tile .pn { font-weight: 800; font-size: .88rem; line-height: 1.2; }
.pupil-tile .pstate { font-size: .74rem; font-weight: 800; margin-top: 4px; color: var(--green); }
.pupil-tile.absent { border-color: #efb5b0; background: var(--red-soft); }
.pupil-tile.absent .pstate { color: var(--red); }
.pupil-tile.late { border-color: #efd49a; background: var(--amber-soft); }
.pupil-tile.late .pstate { color: var(--amber); }
.pupil-tile.selected { border-color: var(--navy); box-shadow: 0 0 0 3px var(--sky); }

/* ---------- Score entry & ratings ---------- */
.score-screen { max-width: 760px; margin: 0 auto; }
.score-pupil { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.score-pupil .avatar-photo { width: 72px; height: 72px; border-radius: 18px; font-size: 1.4rem; }
.score-input { text-align: center; font-size: 2rem; font-weight: 800; min-height: 76px; color: var(--navy); }
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.score-grid label { text-align: center; display: block; font-weight: 800; color: #33475f; }
.score-total { display: flex; align-items: center; justify-content: space-between; background: var(--sky); border-radius: 14px; padding: 14px 18px; margin-top: 16px; flex-wrap: wrap; gap: 10px; }
.score-total .big { font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.score-total .grade { font-size: 1.4rem; font-weight: 800; }
.progress-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 800; color: var(--muted); }

.rating-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rating-option input { position: absolute; opacity: 0; pointer-events: none; }
.rating-option label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 58px; border-radius: 12px; border: 2px solid var(--line); background: #fff;
  font-weight: 800; cursor: pointer; color: #33475f; padding: 5px;
}
.rating-option label .code { font-size: 1rem; }
.rating-option label .word { font-size: .62rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.rating-option input:checked + label { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent); }
.rating-option input:checked + label .word { color: rgba(255,255,255,.85); }
.rating-option input:focus-visible + label { outline: 3px solid #2f80ed; outline-offset: 2px; }
.dev-indicator { border-bottom: 1px solid var(--line); padding: 14px 0; }
.dev-indicator:last-child { border-bottom: 0; }
.dev-indicator .statement { font-weight: 700; margin-bottom: 9px; }
.dev-domain-title { margin: 22px 0 4px; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); font-weight: 800; }
.dev-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.rating-1-5 { display: flex; gap: 7px; flex-wrap: wrap; }
.rating-1-5 input { position: absolute; opacity: 0; pointer-events: none; }
.rating-1-5 label {
  width: 52px; height: 48px; border-radius: 11px; border: 2px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; cursor: pointer; color: #33475f;
}
.rating-1-5 input:checked + label { background: var(--navy); color: #fff; border-color: var(--navy); }
.rating-scale-note { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); font-weight: 700; margin-top: 3px; }

/* ---------- Misc components ---------- */
.empty-state { text-align: center; padding: 44px 22px; }
.empty-state .empty-icon { width: 74px; height: 74px; border-radius: 22px; background: var(--sky); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty-state .empty-icon svg { width: 38px; height: 38px; }
.empty-state h3 { font-size: 1.2rem; }
.empty-state p { color: var(--muted); max-width: 480px; margin: 0 auto 16px; }

.help-hero { background: linear-gradient(135deg, var(--navy), var(--navy-600)); color: #fff; border-radius: 20px; padding: 26px; }
.help-hero h2 { color: #fff; }
.help-hero p { color: rgba(255,255,255,.82); margin: 0; }
.help-article-list a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; font-weight: 700; color: var(--ink); background: #fff; }
.help-article-list a:hover { background: var(--sky); text-decoration: none; }
.step-list { counter-reset: step; padding: 0; list-style: none; }
.step-list li { position: relative; padding-left: 42px; margin-bottom: 13px; }
.step-list li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .82rem; }

.alert { border-radius: 12px; border: 1px solid transparent; font-weight: 600; }
.app-alert { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; }
.app-alert .alert-icon { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.alert-success { background: var(--green-soft); color: #125c33; border-color: #b9e3c9; }
.alert-danger { background: var(--red-soft); color: #8d1d17; border-color: #f3c4c0; }
.alert-warning { background: var(--amber-soft); color: #7a4800; border-color: #f2d798; }
.alert-info { background: #e8f1fd; color: #174d94; border-color: #c4dcfb; }

.modal-content, .offcanvas { border-radius: 20px; border: 0; box-shadow: var(--shadow-lg); }
.modal-header, .offcanvas-header { border-bottom: 1px solid var(--line); padding: 18px 22px; }
.modal-body, .offcanvas-body { padding: 22px; }
.modal-title { font-weight: 800; }
.offcanvas.offcanvas-end { border-radius: 20px 0 0 20px; }

.feedback-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px dashed #c7d3e1; border-radius: 14px; padding: 12px 16px; margin-top: 26px; flex-wrap: wrap; }
.feedback-bar .fb-actions { display: flex; gap: 8px; }
.feedback-bar button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.feedback-bar button:hover { background: var(--sky); }
.feedback-bar button svg { width: 18px; height: 18px; }
.app-footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 12px 0 4px; }
.app-footer strong { color: var(--navy); }

.offline-banner {
  display: none; position: fixed; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 2000;
  background: var(--amber-soft); color: var(--amber); border: 1px solid #f2d798; border-radius: 12px;
  padding: 9px 16px; font-weight: 800; box-shadow: var(--shadow); font-size: .88rem;
}
body.is-offline .offline-banner { display: block; }

.save-state { font-size: .78rem; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.save-state.saved { color: var(--green); }
.save-state.saving { color: var(--amber); }
.save-state svg { width: 15px; height: 15px; }

.photo-upload { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.photo-upload .preview { width: 128px; height: 128px; border-radius: 20px; background: var(--sky); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.photo-upload .preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload .preview svg { width: 38px; height: 38px; }

.big-number { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--navy); }
.mini-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.hr-soft { border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Tour & session ---------- */
.tour-highlight { position: relative; z-index: 2001 !important; box-shadow: 0 0 0 6px #ffb020, 0 0 0 9999px rgba(4, 16, 35, .55) !important; border-radius: 14px !important; }
.tour-panel {
  position: fixed; z-index: 2002; right: 18px; bottom: 18px; width: min(390px, calc(100vw - 24px));
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); padding: 20px; border: 1px solid var(--line);
}
.tour-panel h3 { font-size: 1.05rem; margin-bottom: 6px; }
.tour-panel p { color: var(--muted); font-size: .92rem; margin-bottom: 14px; }
.tour-panel .tour-count { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.tour-panel .tour-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Report card ---------- */
.report-wrap { background: #e9eef5; padding: 24px 12px; border-radius: 16px; }
.report-sheet {
  background: #fff; color: #111; width: 210mm; min-height: 297mm; margin: 0 auto 20px;
  padding: 14mm 13mm; box-shadow: 0 8px 30px rgba(0,0,0,.14); position: relative;
  font-family: 'Nunito', 'Segoe UI', sans-serif; font-size: 11pt; line-height: 1.35;
}
.report-sheet + .report-sheet { page-break-before: always; }
.report-head { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid #0b2a5b; padding-bottom: 8px; margin-bottom: 10px; }
.report-head .rlogo { width: 95px; flex: none; }
.report-head .rlogo img { width: 100%; height: auto; }
.report-head .rname { flex: 1; text-align: center; }
.report-head .rname h1 { font-size: 19pt; margin: 0 0 2px; color: #0b2a5b; letter-spacing: .02em; }
.report-head .rname .motto { font-size: 8.5pt; color: #555; font-style: italic; }
.report-head .rname .raddr { font-size: 7.4pt; color: #555; margin-top: 3px; }
.report-title-row { background: #0b2a5b; color: #fff; padding: 6px 12px; border-radius: 6px; margin-bottom: 9px; }
.report-title-row table { width: 100%; border-collapse: collapse; }
.report-title-row td { border: 0; padding: 0; }
.report-title-row .rt { font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: 10pt; width: 75%; }
.report-title-row .rs { font-size: 8pt; text-align: right; width: 25%; white-space: nowrap; }
.report-id { display: table; width: 100%; margin-bottom: 9px; }
.report-id .cell { display: table-cell; vertical-align: top; }
.report-id .who { padding: 0 10px; }
.report-id .serial { width: 112px; }
.report-id .passport { width: 100px; height: 100px; border: 2px solid #0b2a5b; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #777; font-size: 8pt; text-align: center; background: #f5f8fc; }
.report-id .passport img { width: 100%; height: 100%; object-fit: cover; }
.report-id table { font-size: 8.6pt; }
.report-id td { padding: 1.5px 0; vertical-align: top; }
.report-id td.lbl { color: #555; width: 72px; }
.overall-box { border: 1px solid #9fb2c9; border-radius: 6px; padding: 5px 4px; background: #f3f7fc; text-align: center; font-size: 7.4pt; color: #555; }
.overall-box .ob-label { text-transform: uppercase; letter-spacing: .05em; font-weight: 800; color: #0b2a5b; }
.overall-box .ob-grade { font-size: 20pt; font-weight: 800; color: #0b2a5b; line-height: 1.1; }
.at-glance { border: 2px solid #0b2a5b; border-radius: 8px; padding: 7px 10px; margin-bottom: 9px; background: #f3f7fc; }
.at-glance table { width: 100%; border-collapse: collapse; }
.at-glance td { text-align: center; font-size: 8pt; color: #444; padding: 0 6px; white-space: nowrap; }
.at-glance td b { display: block; font-size: 12pt; color: #0b2a5b; }
.preview-mark { position: absolute; top: 55mm; left: 0; right: 0; text-align: center; font-size: 42pt; color: rgba(200,60,60,.10); font-weight: 800; letter-spacing: .1em; transform: rotate(-18deg); pointer-events: none; }
.att-line { width: 100%; border-collapse: collapse; }
.att-line td { text-align: center; font-size: 7.4pt; color: #555; padding: 2px 2px; width: 16.6%; }
.att-line td b { display: block; font-size: 11pt; color: #0b2a5b; }
.report-footer table { width: 100%; border-collapse: collapse; }
.report-footer td { border: 0; padding: 0; vertical-align: top; }
.report-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; margin-bottom: 8px; }
.report-table th { background: #0b2a5b; color: #fff; padding: 4px 5px; font-size: 7.6pt; text-transform: uppercase; letter-spacing: .02em; border: 1px solid #0b2a5b; }
.report-table td { border: 1px solid #b9c6d8; padding: 3.5px 5px; }
.report-table tr:nth-child(even) td { background: #f6f9fd; }
.report-table .num { text-align: center; }
.report-table .subj { font-weight: 700; }
.report-table .total-row td { font-weight: 800; background: #e8f1fb !important; }
.report-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.report-box { border: 1px solid #9fb2c9; border-radius: 6px; padding: 6px 8px; font-size: 8pt; }
.report-box h4 { font-size: 7.8pt; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .05em; color: #0b2a5b; border-bottom: 1px solid #d5dee9; padding-bottom: 2px; }
.report-rating-table { width: 100%; border-collapse: collapse; font-size: 7.6pt; }
.report-rating-table td { border: 1px solid #b9c6d8; padding: 2px 4px; }
.report-rating-table td.v { text-align: center; font-weight: 800; width: 44px; }
.report-remarks { border: 1px solid #9fb2c9; border-radius: 6px; padding: 6px 8px; font-size: 8.2pt; margin-bottom: 7px; min-height: 34px; }
.report-remarks .rlabel { font-size: 7.4pt; font-weight: 800; color: #0b2a5b; text-transform: uppercase; letter-spacing: .04em; }
.report-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; font-size: 7.8pt; text-align: center; }
.report-signs .sig { min-width: 0; }
.report-signs.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.report-signs .sigline { border-top: 1px solid #333; margin-top: 26px; padding-top: 3px; }
.report-footer { position: absolute; bottom: 7mm; left: 13mm; right: 13mm; display: flex; justify-content: space-between; font-size: 7pt; color: #666; border-top: 1px solid #ccd6e2; padding-top: 3px; }
.report-stamp { position: absolute; right: 15mm; bottom: 22mm; width: 28mm; height: 28mm; border: 2px dashed #9fb2c9; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 6.6pt; color: #8a9bb0; text-align: center; transform: rotate(-12deg); }
.dev-page-title { text-align: center; font-weight: 800; color: #0b2a5b; text-transform: uppercase; letter-spacing: .1em; font-size: 11pt; margin: 4px 0 10px; }
.dev-note { font-size: 8pt; color: #444; background: #f3f7fc; border-left: 3px solid #0b2a5b; padding: 6px 9px; margin-bottom: 9px; }
.dev-table { width: 100%; border-collapse: collapse; font-size: 8pt; }
.dev-table th, .dev-table td { border: 1px solid #b9c6d8; padding: 3px 5px; }
.dev-table th { background: #e8f1fb; color: #0b2a5b; font-size: 7.4pt; text-transform: uppercase; }
.dev-table td.c { text-align: center; width: 34px; font-weight: 800; }
.dev-table td.code { text-align: center; width: 40px; color: #555; font-size: 7pt; }
.dev-table td.domain { background: #eef4fb; color: #0b2a5b; font-weight: 800; font-size: 7.6pt; text-transform: uppercase; letter-spacing: .03em; }
.dev-key { display: flex; gap: 12px; justify-content: center; font-size: 7.4pt; margin: 6px 0 10px; flex-wrap: wrap; }
.dev-key span { display: inline-block; margin: 0 4px; }
.dev-key b { color: #0b2a5b; }
.dev-textarea-box { border: 1px solid #9fb2c9; border-radius: 5px; padding: 5px 7px; min-height: 46px; font-size: 8.2pt; margin-bottom: 6px; }
.dev-textarea-box .lb { font-size: 7.2pt; font-weight: 800; text-transform: uppercase; color: #0b2a5b; letter-spacing: .04em; }
.dev-sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.dev-sig { border: 1px solid #9fb2c9; border-radius: 5px; padding: 6px; font-size: 7.6pt; min-height: 54px; }
.dev-sig .line { border-top: 1px solid #444; margin-top: 20px; padding-top: 2px; display: flex; justify-content: space-between; }
.print-toolbar { position: sticky; top: 0; z-index: 100; background: var(--navy); padding: 10px 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Pupil portal ---------- */
body.pupil-mode { background: linear-gradient(160deg, #eaf2fd 0%, #fdf6ec 100%); font-size: 1.15rem; }
.pupil-shell { max-width: 1100px; margin: 0 auto; padding: 18px; }
.pupil-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.pupil-title { font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 800; color: var(--navy); }
.pupil-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.pupil-tile-big {
  background: #fff; border-radius: 26px; padding: 28px 20px; text-align: center; box-shadow: var(--shadow-lg);
  border: 4px solid #fff; color: var(--navy); text-decoration: none !important; transition: transform .15s;
}
.pupil-tile-big:hover { transform: translateY(-4px); color: var(--navy); }
.pupil-tile-big .ico { width: 90px; height: 90px; border-radius: 28px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--sky); }
.pupil-tile-big .ico svg { width: 52px; height: 52px; }
.pupil-tile-big .lbl { font-size: 1.25rem; font-weight: 800; }
.pupil-tile-big .sub { font-size: .88rem; color: var(--muted); font-weight: 600; }
.pupil-tile-big.t1 .ico { background: #ffe9e3; color: #c2523b; }
.pupil-tile-big.t2 .ico { background: #e6f6ec; color: #1f8a4c; }
.pupil-tile-big.t3 .ico { background: #e8f1fd; color: #1b5bb5; }
.pupil-tile-big.t4 .ico { background: #f1ecfb; color: #6b4bb8; }
.read-aloud-btn { border: 2px solid var(--navy); color: var(--navy); background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 800; display: inline-flex; align-items: center; gap: 7px; }
.read-aloud-btn svg { width: 19px; height: 19px; }
.stars { display: flex; gap: 4px; justify-content: center; margin: 8px 0; }
.stars svg { width: 30px; height: 30px; color: #f0a500; fill: #f0a500; }
.stars svg.off { fill: #e7eef7; color: #e7eef7; }
.pupil-report-card { background: #fff; border-radius: 22px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.pupil-subject-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 6px; border-bottom: 1px solid var(--line); }
.pupil-subject-row:last-child { border-bottom: 0; }
.pupil-subject-row .sname { font-weight: 800; }
.pupil-subject-row .sgrade { font-size: 1.25rem; font-weight: 800; color: var(--navy); }

/* ---------- Auth ---------- */
.auth-body { background: #eef3fa; min-height: 100vh; display: flex; align-items: stretch; }
.auth-wrap { display: grid; grid-template-columns: 1.05fr 1fr; width: 100%; min-height: 100vh; }
.auth-art { background: linear-gradient(150deg, #082145 0%, #0b2a5b 45%, #16407f 100%); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; width: 460px; height: 460px; border-radius: 50%; border: 80px solid rgba(255,255,255,.06); right: -140px; bottom: -120px; }
.auth-art .auth-logo { background: #fff; border-radius: 18px; padding: 12px 16px; width: fit-content; }
.auth-art .auth-logo img { height: 92px; width: auto; display: block; }
.auth-art h1 { color: #fff; font-size: clamp(1.8rem, 2.6vw, 2.6rem); line-height: 1.15; margin: 28px 0 10px; max-width: 480px; }
.auth-art p { color: rgba(255,255,255,.82); max-width: 460px; font-size: 1.02rem; }
.auth-art .auth-band-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.auth-band-chips span { border-radius: 999px; padding: 5px 12px; font-size: .78rem; font-weight: 800; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); }
.auth-art .auth-foot { font-size: .78rem; color: rgba(255,255,255,.6); position: relative; z-index: 1; }
.auth-panel { background: #fff; display: flex; align-items: center; justify-content: center; padding: 34px 22px; }
.auth-card { width: min(430px, 100%); }
.auth-card h2 { font-size: 1.7rem; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); font-size: .96rem; margin-bottom: 22px; }
.auth-card .form-control { min-height: 52px; }
.demo-note { background: #f3f7fc; border: 1px dashed #c7d3e1; border-radius: 12px; padding: 12px 14px; font-size: .84rem; color: var(--muted); margin-top: 18px; }
.auth-alt { text-align: center; margin-top: 18px; font-weight: 700; }
.auth-alt a { font-weight: 800; }

/* ---------- Parent portal ---------- */
.portal-top { background: var(--navy); color: #fff; padding: 14px 20px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 100; }
.portal-top img { height: 46px; background: #fff; border-radius: 8px; padding: 3px 5px; }
.portal-top .pt { font-weight: 800; line-height: 1.15; }
.portal-top .pt small { display: block; font-weight: 600; font-size: .7rem; opacity: .75; }
.portal-top .spacer { flex: 1; }
.portal-page { max-width: 1080px; margin: 0 auto; padding: 26px 18px 50px; }
.portal-hero { margin-bottom: 22px; }
.portal-hero h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.notice-card { background: #fff; border: 1px solid var(--line); border-left: 5px solid #2f80ed; border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.notice-card h3 { font-size: 1rem; margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .sidenav { width: 228px; }
  .main-content { margin-left: 228px; padding: 22px 22px 100px; }
  :root { --sidenav-w: 228px; }
}
@media (max-width: 991.98px) {
  .main-content { margin-left: 0; padding: 18px 14px 100px; }
  .app-shell { display: block; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .action-tile { min-height: 86px; padding: 14px; }
  .action-tile .tile-icon { width: 46px; height: 46px; }
  .action-tile .tile-label { font-size: .95rem; }
  .brand-name { max-width: 120px; font-size: .8rem; }
  .brand img { height: 38px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .profile-name { display: none; }
  .help-btn span { display: none; }
  .help-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 12px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card .stat-value { font-size: 1.55rem; }
  .report-wrap { padding: 10px 0; background: transparent; overflow-x: auto; }
  .report-sheet { width: 100%; min-height: 0; padding: 18px; font-size: 10.5pt; }
  .report-id { grid-template-columns: 90px 1fr; }
  .report-id .passport { width: 82px; height: 82px; }
  .report-head .rlogo { width: 70px; }
}
@media (max-width: 575.98px) {
  .action-grid { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .page-head { gap: 10px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .rating-grid { gap: 5px; }
  .rating-option label { min-height: 54px; }
  .child-card { padding: 16px; }
  .portal-page { padding: 18px 12px 40px; }
  .score-input { font-size: 1.7rem; min-height: 68px; }
  .pupil-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .report-grid-2 { grid-template-columns: 1fr; }
  .report-head .rname h1 { font-size: 14pt; }
  .report-signs { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Data-light mode ---------- */
body.data-light .pupil-tile img, body.data-light .pupil-tile .ph { width: 42px; height: 42px; border-radius: 9px; }
body.data-light .child-card img.child-photo, body.data-light .child-card .child-photo.placeholder { width: 56px; height: 56px; font-size: 1.1rem; line-height: 48px; }
body.data-light .avatar-photo { width: 34px; height: 34px; border-radius: 9px; }
body.data-light .score-pupil .avatar-photo { width: 48px; height: 48px; }

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; font-size: 10.5pt; }
  .topbar, .sidenav, .bottomnav, .page-head, .feedback-bar, .app-footer, .print-toolbar,
  .portal-top, .portal-hero, .pupil-top,
  .no-print, .offline-banner, .modal, .offcanvas, .tour-panel, .app-alert { display: none !important; }
  .app-shell { padding: 0 !important; display: block !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  .portal-page, .pupil-shell { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .report-wrap { background: #fff; padding: 0; }
  .report-sheet {
    width: 210mm; min-height: 296mm; margin: 0; padding: 12mm 12mm 16mm; box-shadow: none;
    page-break-after: always; break-after: page;
  }
  .report-sheet:last-child { page-break-after: auto; break-after: auto; }
  .report-sheet, .report-table, .dev-table { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href]::after { content: none !important; }
  .app-card { box-shadow: none; border-color: #ccc; }
  .pn-panel { display: block !important; }
}

/* ---------- Pre-Nursery record ---------- */
.pn-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pn-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 15px; font-weight: 800; font-size: .84rem; color: var(--muted); }
.pn-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pn-tab .count { font-weight: 700; opacity: .8; font-size: .76rem; }
.pn-panel { display: none; }
.pn-panel.active { display: block; }
.pn-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.pn-section-note { background: var(--sky); border-radius: 12px; padding: 12px 16px; font-size: .9rem; color: #33475f; }
.pn-sign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.pn-sign-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.pn-sign-card h4 { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }


/* ---------- Attendance register ---------- */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.att-tile { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 13px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s; }
.att-tile.absent { border-color: #efb5b0; background: var(--red-soft); }
.att-tile.late { border-color: #efd49a; background: var(--amber-soft); }
.att-tile.excused { border-color: #b9c9e8; background: var(--sky); }
.att-head { display: flex; align-items: center; gap: 10px; }
.att-head .avatar-photo { width: 48px; height: 48px; border-radius: 12px; }
.att-name { font-weight: 800; line-height: 1.15; }
.att-sub { font-size: .74rem; color: var(--muted); }
.att-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: #f2f6fb; padding: 4px; border-radius: 12px; }
.att-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.att-tabs label { text-align: center; padding: 9px 2px; border-radius: 9px; font-size: .72rem; font-weight: 800; color: var(--muted); cursor: pointer; margin: 0; }
.att-tabs input:checked + label { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(11,42,91,.14); }
.att-tabs input[value="present"]:checked + label { background: var(--green-soft); color: var(--green); }
.att-tabs input[value="absent"]:checked + label { background: var(--red-soft); color: var(--red); }
.att-tabs input[value="late"]:checked + label { background: var(--amber-soft); color: var(--amber); }
.att-tabs input[value="excused"]:checked + label { background: var(--sky); color: var(--navy); }
.att-tabs input:focus-visible + label { outline: 3px solid #2f80ed; outline-offset: 1px; }
.att-reason { font-size: .82rem; }

/* ---------- QR attendance ---------- */
.qr-stage { text-align: center; padding: 24px 12px 8px; }
.qr-stage img.qr-code { width: min(400px, 78vw); height: auto; border-radius: 18px; background: #fff; padding: 12px; border: 1px solid var(--line); }
.qr-stage .qr-school { font-weight: 800; color: var(--navy); letter-spacing: .04em; text-transform: uppercase; font-size: .9rem; }
.qr-stage .qr-hint { max-width: 460px; margin: 14px auto 0; color: var(--muted); font-size: .9rem; }
.qr-big-state { text-align: center; padding: 36px 18px; }
.qr-big-state .qr-icon { width: 96px; height: 96px; border-radius: 30px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.qr-big-state .qr-icon svg { width: 52px; height: 52px; }
.qr-big-state h2 { font-size: 1.5rem; }
.qr-big-state.success .qr-icon { background: var(--green-soft); color: var(--green); }
.qr-big-state.error .qr-icon { background: var(--red-soft); color: var(--red); }
.qr-big-state.info .qr-icon { background: var(--sky); color: var(--navy); }
.qr-big-state .btn { min-height: 56px; font-size: 1.05rem; }

/* ---------- Certificates ---------- */
.certificate-sheet { background: #fff; padding: 10px; }
.cert-frame { border: 10px double var(--navy); border-radius: 8px; padding: 26px 30px 20px; background: #fffdf7; min-height: 250mm; display: flex; flex-direction: column; }
.cert-head { display: flex; align-items: center; gap: 18px; border-bottom: 2px solid var(--navy); padding-bottom: 16px; }
.cert-head img { width: 92px; height: 92px; object-fit: contain; }
.cert-school { font-size: 1.35rem; font-weight: 800; letter-spacing: .06em; color: var(--navy); text-transform: uppercase; }
.cert-motto { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.cert-address { font-size: .72rem; color: var(--muted); margin-top: 4px; max-width: 520px; }
.cert-body { text-align: center; flex: 1; padding: 36px 12px 20px; }
.cert-kicker { font-family: Georgia, 'Times New Roman', serif; font-size: 2.1rem; color: var(--navy); letter-spacing: .04em; text-transform: uppercase; }
.cert-lead { color: var(--muted); font-size: .95rem; margin-top: 14px; }
.cert-name { font-family: Georgia, 'Times New Roman', serif; font-size: 2.3rem; font-weight: 700; color: var(--ink); margin-top: 10px; }
.cert-rule { width: 62%; height: 2px; background: var(--navy); margin: 12px auto 4px; opacity: .5; }
.cert-award { font-family: Georgia, 'Times New Roman', serif; font-size: 1.5rem; color: var(--navy); font-weight: 700; margin-top: 10px; }
.cert-signs { width: 100%; margin-top: 26px; border-collapse: collapse; }
.cert-signs td { width: 33%; text-align: center; vertical-align: bottom; padding: 0 10px; }
.cert-sig-line { border-bottom: 1px solid var(--ink); height: 34px; margin: 0 8px 6px; }
.cert-sig-name { font-weight: 800; font-size: .86rem; }
.cert-sig-role { font-size: .76rem; color: var(--muted); }
.cert-stamp img { max-width: 100px; max-height: 100px; }
.cert-stamp-ring { width: 96px; height: 96px; margin: 0 auto; border: 2px dashed var(--muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .62rem; letter-spacing: .1em; color: var(--muted); }
.cert-foot { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 8px; font-size: .7rem; color: var(--muted); }

@media print {
  .certificate-sheet { padding: 0; }
  .cert-frame { border-width: 8px; min-height: 275mm; padding: 18mm 18mm 12mm; }
  .cert-kicker { font-size: 2rem; }
  .cert-name { font-size: 2.2rem; }
  .report-wrap { padding: 0; }
}
