/* Channah Kiddies School — portal (admin / teacher / parent) styles */
:root {
  --red: #AB0A12; --red-500: #C8141E; --red-50: #FDECEC;
  --blue: #3B3A8F; --blue-600: #2F2E7A; --navy: #1E1D4E; --blue-50: #EEF0FA;
  --sun: #FFC93C; --green: #079455; --green-50: #ECFDF3; --amber: #B54708; --amber-50: #FFFAEB;
  --ink: #1F2140; --muted: #62668A; --line: #E4E6F2; --bg: #F5F6FB; --card: #fff;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px -10px rgba(30, 29, 78, .18);
  --head: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--head); color: var(--navy); line-height: 1.2; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
svg { fill: currentColor; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; }
.hide-sm { } .nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
code { background: var(--blue-50); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 800; padding: 10px 18px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; background: var(--blue); color: #fff; line-height: 1.2; white-space: nowrap; transition: background .15s, box-shadow .15s; }
.btn:hover { color: #fff; background: var(--blue-600); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--blue); }
.btn-red, .btn-danger { background: var(--red); }
.btn-red:hover, .btn-danger:hover { background: var(--red-500); }
.btn-light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-light:hover { background: var(--blue-50); color: var(--navy); }
.btn-outline { background: #fff; color: var(--blue); border-color: #C9CBEA; }
.btn-outline:hover { background: var(--blue-50); color: var(--blue); }
.btn-ghost-danger { background: #fff; color: var(--red); border-color: #F3C3C5; }
.btn-ghost-danger:hover { background: var(--red-50); color: var(--red); }
.btn-success { background: var(--green); } .btn-success:hover { background: #067647; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn.is-busy { opacity: .7; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--red); font-weight: 700; cursor: pointer; }
.inline { display: inline; }

/* Alerts */
.alert { display: block; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; border: 1px solid; }
.alert-success { background: var(--green-50); border-color: #ABEFC6; color: #085D3A; }
.alert-error { background: #FEF3F2; border-color: #FECDCA; color: #912018; }
.alert-info { background: var(--blue-50); border-color: #C9CCF0; color: var(--navy); }
.alert-warning { background: var(--amber-50); border-color: #FEDF89; color: #93370D; }
.alert-close { float: right; margin-left: 12px; background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* Layout */
.side { position: fixed; inset: 0 auto 0 0; width: 260px; background: var(--navy); color: #cfd1ee; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.side::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--red) 50%, var(--blue) 50%); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 22px 18px 18px; color: #fff; }
.side-brand:hover { color: #fff; }
.side-logo { background: #fff; border-radius: 12px; padding: 4px; display: inline-flex; }
.side-brand strong { display: block; font-family: var(--head); font-size: 1.1rem; line-height: 1.1; }
.side-brand small { color: #ff9ea3; font-weight: 700; }
.side-nav { display: flex; flex-direction: column; padding: 4px 12px 24px; gap: 2px; }
.side-label { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 800; color: #8D90C4; padding: 14px 12px 6px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #dcdef5; font-weight: 700; }
.side-nav a svg { width: 19px; height: 19px; opacity: .8; flex: 0 0 19px; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active { background: var(--red); color: #fff; box-shadow: 0 6px 16px -8px rgba(171, 10, 18, .9); }
.side-nav a.active svg { opacity: 1; }
.badge { margin-left: auto; background: var(--sun); color: var(--navy); font-size: .72rem; padding: 1px 8px; border-radius: 999px; font-weight: 800; }
.main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }
.topnav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 10px 28px; min-height: 64px; }
.topnav-title { font-family: var(--head); font-weight: 800; color: var(--navy); font-size: 1.15rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav-user { display: flex; align-items: center; gap: 10px; }
.topnav-user form { margin: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--red), var(--blue)); color: #fff; display: grid; place-items: center; font-weight: 800; }
.who { display: flex; flex-direction: column; line-height: 1.15; }
.who small { color: var(--muted); font-weight: 700; }
.icon-btn { background: none; border: 0; padding: 6px; cursor: pointer; color: var(--navy); border-radius: 8px; }
.icon-btn svg { width: 26px; height: 26px; }
.side-toggle { display: none; }
.side-scrim { display: none; }
.content { padding: 26px 28px 60px; max-width: 1320px; width: 100%; }

/* Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 2px; }
.page-head p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; display: block; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 22px 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); color: var(--ink); }
a.stat:hover { border-color: #C9CBEA; color: var(--ink); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 46px; }
.stat-icon svg { width: 24px; height: 24px; }
.si-red { background: var(--red-50); color: var(--red); } .si-blue { background: var(--blue-50); color: var(--blue); }
.si-green { background: var(--green-50); color: var(--green); } .si-amber { background: var(--amber-50); color: var(--amber); }
.stat strong { display: block; font-family: var(--head); font-size: 1.7rem; line-height: 1; color: var(--navy); }
.stat small { color: var(--muted); font-weight: 700; }

.welcome-card { background: linear-gradient(120deg, var(--navy), var(--blue)); color: #fff; border: 0; position: relative; overflow: hidden; }
.welcome-card::after { content: ''; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .07); }
.welcome-card h1, .welcome-card h2 { color: #fff; }
.welcome-card p { opacity: .9; margin: 0; }
.term-chip { display: inline-flex; gap: 6px; align-items: center; background: rgba(255, 255, 255, .15); padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; margin-bottom: 10px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; background: #FAFBFE; white-space: nowrap; }
tbody tr:hover { background: #FAFBFF; }
td.num, th.num { text-align: center; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 34px; height: 34px; font-size: .85rem; }
.person img.ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.person strong { display: block; color: var(--navy); }
.person small { color: var(--muted); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--blue-50); color: var(--blue); white-space: nowrap; }
.pill-green { background: var(--green-50); color: var(--green); }
.pill-red { background: var(--red-50); color: var(--red); }
.pill-amber { background: var(--amber-50); color: var(--amber); }
.pill-grey { background: #F2F4F7; color: #475467; }

/* Forms */
label { display: block; font-weight: 700; font-size: .88rem; color: var(--navy); margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 600; color: var(--ink); padding: 10px 12px; border: 1.5px solid #D5D8EA; border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(59, 58, 143, .12); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 6px 0 0; accent-color: var(--blue); }
input[type=file] { padding: 8px; background: var(--bg); }
.check { display: flex; align-items: center; font-weight: 700; gap: 4px; }
.hint { display: block; font-weight: 600; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 6px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 2px; margin: 0 0 16px; }
legend { font-weight: 800; color: var(--red); padding: 0 6px; font-size: .9rem; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters label { margin: 0; min-width: 160px; }
.filters input, .filters select { margin-top: 3px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: var(--blue-50); color: var(--blue); border: 0; border-radius: 8px; padding: 5px 10px; font-weight: 800; cursor: pointer; font-size: .8rem; margin-top: 2px; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-family: ui-monospace, monospace; }

/* Score grid */
.score-table input { width: 74px; text-align: center; padding: 7px 6px; margin: 0 auto; font-weight: 800; }
.score-table input.invalid { border-color: var(--red); background: var(--red-50); }
.score-table td.total { font-family: var(--head); font-size: 1.1rem; font-weight: 800; color: var(--navy); text-align: center; }
.score-table th { text-align: center; }
.score-table th:first-child, .score-table th:nth-child(2) { text-align: left; }
.sticky-bar { position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.traits-table select { width: 64px; padding: 6px; margin: 0 auto; }
.traits-table textarea { min-width: 220px; }
.traits-table input[type=number] { width: 70px; }

/* Children cards (parent) */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.kid { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.kid-top { background: linear-gradient(120deg, var(--blue), #5352B8); color: #fff; padding: 20px; display: flex; gap: 14px; align-items: center; }
.kid:nth-child(even) .kid-top { background: linear-gradient(120deg, var(--red), #D3333B); }
.kid-photo { width: 62px; height: 62px; border-radius: 50%; background: rgba(255, 255, 255, .2); border: 3px solid rgba(255, 255, 255, .6); display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 1.5rem; overflow: hidden; flex: 0 0 62px; }
.kid-photo img { width: 100%; height: 100%; object-fit: cover; }
.kid-top strong { font-family: var(--head); font-size: 1.25rem; display: block; line-height: 1.1; }
.kid-top small { opacity: .9; font-weight: 700; }
.kid-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kid-body .btn { margin-top: auto; }
.kv { display: flex; justify-content: space-between; font-size: .92rem; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.kv span { color: var(--muted); font-weight: 700; }
.kv strong { color: var(--navy); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.notice h3 { margin-bottom: 4px; }
.notice small { color: var(--muted); font-weight: 700; }
.notice p { margin: 6px 0 0; color: #3d4163; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-50); padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: .86rem; }
.file-chip svg { width: 16px; height: 16px; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: #C4C7E3; margin-bottom: 8px; }
.empty h3 { color: var(--navy); }

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--red); }
.progress { height: 8px; background: var(--blue-50); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--red)); border-radius: 999px; }
.secret-box { font-family: ui-monospace, monospace; font-size: 1.1rem; letter-spacing: .12em; background: var(--blue-50); padding: 12px 14px; border-radius: 10px; word-break: break-all; color: var(--navy); font-weight: 800; }
.cred-box { background: var(--amber-50); border: 1px dashed #F7B27A; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.cred-box code { background: #fff; font-size: 1rem; }
.photo-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-admin figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.photo-admin img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-admin figcaption { padding: 6px 8px; display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: .78rem; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-weight: 800; padding: 0 8px; }
.pager a.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Report card (HTML view) */
.rc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.rc { background: #fff; max-width: 900px; margin: 0 auto; border-radius: 6px; box-shadow: var(--shadow); padding: 28px 30px; border-top: 8px solid var(--blue); position: relative; }
.rc::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--red); }
.rc-head { display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 10px; text-align: center; }
.rc-head img { width: 90px; }
.rc-head h1 { color: var(--blue); font-size: 1.7rem; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
.rc-head p { margin: 0; color: var(--muted); font-size: .85rem; }
.rc-band { background: var(--red); color: #fff; text-align: center; font-weight: 800; padding: 7px; margin: 14px 0; border-radius: 4px; letter-spacing: .04em; font-size: .92rem; }
.rc-info { display: grid; grid-template-columns: repeat(4, auto); border: 1px solid #C7CBE0; margin-bottom: 16px; }
.rc-info div { padding: 6px 10px; border-bottom: 1px solid #C7CBE0; font-size: .88rem; }
.rc-info div:nth-child(odd) { background: var(--blue-50); font-weight: 800; color: var(--navy); }
.rc table th { background: var(--blue); color: #fff; text-align: center; font-size: .72rem; }
.rc table th:first-child { text-align: left; }
.rc table td { padding: 7px 10px; font-size: .9rem; border: 1px solid #DDE0EE; }
.rc table td.c { text-align: center; }
.rc table tbody tr:nth-child(even) { background: #F7F8FD; }
.rc-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); background: var(--blue-50); border: 1px solid #C7CBE0; margin: 12px 0 16px; text-align: center; }
.rc-sum div { padding: 8px; }
.rc-sum small { display: block; color: var(--muted); font-weight: 800; font-size: .7rem; text-transform: uppercase; }
.rc-sum strong { font-family: var(--head); color: var(--navy); font-size: 1.15rem; }
.rc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rc-two h4 { color: var(--red); font-size: .85rem; letter-spacing: .04em; margin-bottom: 6px; }
.rc-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; font-size: .84rem; }
.rc-traits div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.rc-traits b { color: var(--blue); }
.rc-key td { font-size: .82rem !important; padding: 3px 8px !important; }
.rc-comment { border: 1px solid #C7CBE0; border-left: 5px solid var(--red); padding: 10px 14px; margin-top: 12px; font-size: .9rem; }
.rc-comment small { display: block; font-weight: 800; color: var(--navy); font-size: .75rem; text-transform: uppercase; }
.rc-comment em { display: block; text-align: right; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.rc-foot { text-align: center; color: var(--muted); font-size: .75rem; margin-top: 16px; }
.watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--head); font-size: 5rem; color: rgba(171, 10, 18, .07); transform: rotate(-25deg); font-weight: 800; }

/* Auth pages */
.auth-body { background: var(--bg); }
.auth { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.2fr); min-height: 100vh; }
.auth-side { background: var(--navy); background-image: radial-gradient(circle at 100% 0, rgba(171, 10, 18, .55) 0 180px, transparent 181px), radial-gradient(circle at 0 100%, rgba(59, 58, 143, .9) 0 260px, transparent 261px); color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth-brand { display: flex; gap: 14px; align-items: center; color: #fff; }
.auth-brand:hover { color: #fff; }
.auth-logo { background: #fff; padding: 6px; border-radius: 16px; display: inline-flex; }
.auth-brand strong { display: block; font-family: var(--head); font-size: 1.3rem; line-height: 1.1; }
.auth-brand small { color: #ff9ea3; font-weight: 700; }
.auth-side h2 { color: #fff; font-size: 2rem; max-width: 380px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; }
.auth-side li { padding: 8px 0 8px 30px; position: relative; font-weight: 700; }
.auth-side li::before { content: '✓'; position: absolute; left: 0; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-size: .72rem; }
.auth-secure { display: flex; gap: 8px; align-items: center; font-size: .85rem; opacity: .85; margin: 0; }
.auth-secure svg { width: 18px; height: 18px; color: var(--sun); }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; box-shadow: 0 20px 50px -24px rgba(30, 29, 78, .35); padding: 34px; border-top: 5px solid var(--red); }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 4px; }
.auth-card .btn-block { padding: 13px; font-size: 1rem; margin-top: 4px; }
.auth-foot { margin-top: 18px; font-size: .88rem; color: var(--muted); }
.row-between { display: flex; justify-content: space-between; margin: -4px 0 16px; font-size: .88rem; font-weight: 700; }

/* Responsive */
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .side { transform: translateX(-100%); transition: transform .25s; }
  body.side-open .side { transform: none; }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 15, 40, .45); z-index: 35; }
  .main { margin-left: 0; }
  .side-toggle { display: inline-flex; }
  .topnav { padding: 8px 16px; }
  .content { padding: 18px 16px 50px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 22px 20px; }
  .auth-side-copy, .auth-secure { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card { padding: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .rc { padding: 16px; }
  .rc-head { grid-template-columns: 56px 1fr; }
  .rc-head img { width: 56px; }
  .rc-head > div:last-child { display: none; }
  .rc-head h1 { font-size: 1.15rem; }
  .rc-info { grid-template-columns: auto 1fr; }
  .rc-two { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
}

/* Print: report card only */
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .side, .topnav, .rc-toolbar, .alert, .side-scrim, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .rc { box-shadow: none; padding: 0; max-width: none; }
  .rc table th, .rc-band, .rc-info div:nth-child(odd), .rc-sum { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Getting-started checklist */
.setup-card { border-left: 5px solid var(--blue); }
.setup-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.setup-list li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.setup-list li.done { color: var(--muted); text-decoration: line-through; font-weight: 600; }
.setup-list .tick { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #C9CBEA; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.setup-list li.done .tick { background: var(--green); border-color: var(--green); }
.side-version { margin: auto 20px 18px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .1); color: #8D90C4; font-size: .78rem; font-weight: 700; }
.side-version:hover { color: #fff; }

/* In-page confirmation dialog */
.confirm-wrap { position: fixed; inset: 0; background: rgba(15, 15, 40, .5); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 300; }
.confirm-box { background: #fff; border-radius: 16px; padding: 24px; max-width: 420px; width: 100%; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); border-top: 5px solid var(--red); }
.confirm-box p { font-weight: 700; color: var(--navy); font-size: 1.02rem; margin: 0 0 18px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Fees */
.pay-card { border-left: 5px solid var(--red); }
.pay-amount { font-family: var(--head); font-size: 2rem; font-weight: 800; color: var(--navy); margin: 4px 0 12px; }
.fee-grid td, .fee-grid th { padding: 8px 10px; }
.kid-fees { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--red-50); border-radius: 10px; padding: 8px 12px; font-weight: 700; color: var(--red); font-size: .9rem; }
.kid-fees.ok { background: var(--green-50); color: var(--green); }
.grid-main > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.stat strong.money { font-size: 1.35rem; white-space: nowrap; }
@media (max-width: 1280px) { .stat strong.money { font-size: 1.15rem; } }

/* ---- 1.5.0: transfer confirmations, attendance, admissions ---- */
.bank-box { background: var(--blue-50); border-radius: 10px; padding: 12px 14px; font-weight: 700; color: var(--navy); line-height: 1.6; margin-bottom: 8px; }
.proof-form { border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 14px; }
.proof-form h3 { font-size: 1rem; margin-bottom: 10px; }
.att-table td, .att-table th { vertical-align: middle; }
.att-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.att-opt { position: relative; }
.att-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.att-opt span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); font-weight: 800; font-size: .85rem; color: var(--muted); background: #fff; }
.att-opt input:focus-visible + span { outline: 3px solid var(--blue-50); outline-offset: 2px; }
.att-opt input:checked + span.p { background: var(--green-50); border-color: var(--green); color: var(--green); }
.att-opt input:checked + span.a { background: var(--red-50); border-color: var(--red); color: var(--red); }
.att-opt input:checked + span.l { background: var(--amber-50); border-color: var(--amber); color: var(--amber); }
.att-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.att-sum .pill { font-size: .85rem; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.att-day { height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; background: var(--bg); color: var(--muted); }
.att-day.P { background: var(--green-50); color: var(--green); }
.att-day.A { background: var(--red-50); color: var(--red); }
.att-day.L { background: var(--amber-50); color: var(--amber); }
.stage-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stage-pills a { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 700; font-size: .85rem; color: var(--ink); background: #fff; }
.stage-pills a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.stage-pills a small { opacity: .7; margin-left: 4px; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 700; font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.applicant-photo { width: 96px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (max-width: 700px) {
  .att-table thead { display: none; }
  .att-table, .att-table tbody { display: block; }
  .att-table tr { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .att-table td { display: block; padding: 0; border: 0; }
  .att-table td:first-child { display: none; }
  .att-opts { flex-wrap: nowrap; }
  .att-opt span { min-width: 0; padding: 0 14px; }
}
