/* School Enrollment Suite: base styles (look carried over from the Little Flower demo).
   --red / --navy are set per school in an inline <style> by layout.php. */
:root {
  --red: #b3122e;
  --navy: #1d2b4f;
  --navy-soft: #33456f; 
  --cream: #fbf8f3; 
  --paper: #ffffff; 
  --ink: #1f2430;
  --muted: #4b5262;   /* secondary text; darkened from #667085 for readability (2026-12-04) */
  --line: #e4e0d8; 
  --green: #1f7a4d; 
  --green-pale: #e8f5ee;    
  --amber: #a15c07;
  --amber-pale: #fdf3e2;
  --blue-pale: #eef2fa;  
  --red-pale: #fbecee;   
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 8px 24px rgba(20, 20, 40, .06);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
} 

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.15; margin: 0 0 .4em; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); font-weight: 600; }
h2 { font-size: 1.6rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt { margin-top: 20px; }
.center { text-align: center; }

/* Top bar */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-text strong { display: block; font-family: var(--serif); font-size: 1.4rem; color: var(--red); line-height: 1.1; }
.brand-tag { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--navy-soft); border-left: 1px solid var(--line); padding-left: 12px; }
@media (max-width: 640px) { .brand-logo { height: 40px; } .brand-tag { display: none; } }
.nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nav a { text-decoration: none; color: var(--navy); font-size: .88rem; font-weight: 500; padding: 7px 12px; border-radius: 999px; }
.nav a:hover { background: var(--blue-pale); }
.nav a.nav-staff { border: 1px solid #cfd5e3; color: var(--navy-soft); }   /* "Staff login" for signed-out visitors */
.nav a.nav-staff::before { content: "🔒 "; font-size: .8em; }
.nav a.active, .nav a.active:hover { background: var(--navy); color: #fff; font-weight: 600; }   /* the page you're on */
form.inline { display: inline; margin: 0; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 20px 80px; }
.wrap.narrow { max-width: 760px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card + .card { margin-top: 20px; }
.narrow-card { max-width: 520px; margin: 0 auto; }
.eyebrow { display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.site-footer { text-align: center; font-size: .8rem; color: var(--muted); padding: 0 20px 40px; }
.site-footer a { color: var(--muted); }

/* Forms */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.grid .field { margin-bottom: 0; }
.field > label, .label { font-size: .82rem; font-weight: 600; color: var(--navy); }
.hint { font-size: .78rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #d5d0c6; border-radius: 10px; padding: 10px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(51, 69, 111, .15); }
input.code-input { font-size: 1.4rem; letter-spacing: .3em; text-align: center; max-width: 220px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 6px 0 16px; }
.check input { margin-top: 4px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 .92rem var(--sans); padding: 11px 20px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { filter: brightness(.9); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border-color: #cfd5e3; }
.btn-ghost:hover { background: var(--blue-pale); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn-danger { background: #fff; color: var(--red); border-color: #e8b7c0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--red); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Alerts */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: .92rem; border: 1px solid transparent; }
.alert-ok { background: var(--green-pale); color: var(--green); border-color: #bfe3cf; }
.alert-error { background: var(--red-pale); color: #8c0d23; border-color: #f0c3cb; }
.alert-info { background: var(--blue-pale); color: var(--navy-soft); border-color: #cfd8ec; }
.alert-warn { background: var(--amber-pale); color: var(--amber); border-color: #f1d6a8; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fbfaf7; }
td { padding: 12px 16px; border-bottom: 1px solid #f0ede7; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--blue-pale); color: var(--navy-soft); }
.badge-ok { background: var(--green-pale); color: var(--green); }
.badge-warn { background: var(--amber-pale); color: var(--amber); }
.badge-off { background: #f0ede7; color: var(--muted); }

/* 2FA setup + secrets shown once */
.secret-box { font: 600 1.15rem/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; background: var(--blue-pale); border: 1px dashed #b9c6e2; border-radius: 10px; padding: 14px 16px; word-break: break-all; text-align: center; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font: 600 1.05rem ui-monospace, "Cascadia Mono", Consolas, monospace; background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin: 12px 0 18px; }
.qr { text-align: center; margin: 16px 0; }
.qr-img { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 10px; }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 0 12px; flex-wrap: wrap; }

/* Application wizard (from the demo) */
.page-head { margin-bottom: 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.req::after { content: " *"; color: var(--red); }
.field-error { font-size: .8rem; color: #8c0d23; font-weight: 600; }
.invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(179, 18, 46, .12) !important; }
textarea { min-height: 70px; resize: vertical; }
.stepper { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: nowrap; align-items: flex-start; }
/* Buttons centre their content vertically by default: use a top-aligned column so every bar lines up, even when a label wraps. */
.stepper button, .stepper a { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-start; border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; font: inherit; color: var(--muted); text-decoration: none; }
.stepper .bar { display: block; width: 100%; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 8px; }
.stepper .lbl { font-size: .8rem; font-weight: 500; line-height: 1.3; }
@media (max-width: 640px) {
  .stepper > :not(.current) .lbl { display: none; }   /* phones: only the current step's name */
  .stepper .current { flex-grow: 3; }
}
.stepper .done .bar { background: var(--navy-soft); }
.stepper .current .bar { background: var(--red); }
.stepper .current { color: var(--ink); }
.stepper .current .lbl { font-weight: 600; }
.step-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-actions .actions { margin-top: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-title:first-child, .stepper + .section-title, .alert + .section-title { margin-top: 0; }
.section-title h3 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 8px 14px; border: 1px solid #d5d0c6; border-radius: 999px; font-size: .88rem; cursor: pointer; background: #fff; user-select: none; }
.chip span:hover { border-color: var(--navy-soft); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(51, 69, 111, .3); }
.yn { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.repeat { border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: #fdfcfa; }
.repeat + .repeat { margin-top: 14px; }
.repeat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.repeat-head strong { font-family: var(--serif); font-size: 1.2rem; color: var(--navy); }
.add-row { margin-top: 14px; width: 100%; border: 1.5px dashed #c9c3b6; background: transparent; border-radius: 12px; padding: 14px; font: 600 .9rem var(--sans); color: var(--navy); cursor: pointer; }
.add-row:hover { border-color: var(--navy-soft); background: var(--blue-pale); }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; font-size: .88rem; background: var(--blue-pale); color: var(--navy); margin-bottom: 18px; }
.note.ok { background: var(--green-pale); color: var(--green); }
.note-icon { font-weight: 700; flex-shrink: 0; }
.age-msg { font-size: .8rem; }
.age-msg.ok, .ok-text { color: var(--green); }
.age-msg.warn, .warn-text { color: var(--amber); }
.review dl { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; margin: 0 0 8px; font-size: .92rem; }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; }
.review h4 { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.review h4 .link-btn { text-transform: none; letter-spacing: 0; margin-left: 8px; }
@media (max-width: 640px) { .review dl { grid-template-columns: 1fr; gap: 2px; } .review dd { margin-bottom: 8px; } }
.pay-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: #fff; margin-top: 18px; }
.pay-amount { font-family: var(--serif); font-size: 2rem; color: var(--navy); font-weight: 600; margin: 0; }
.fee-note { max-width: 360px; margin: 0; }
.success { text-align: center; padding: 24px 12px 32px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-pale); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; font-size: 1.8rem; }
.audit { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; background: #f6f5f1; border-radius: 10px; padding: 14px 16px; color: #444; }
.audit div { display: flex; gap: 12px; }
.audit span:first-child { color: #888; min-width: 120px; flex-shrink: 0; }
.audit span:last-child { min-width: 0; overflow-wrap: anywhere; }   /* long values (IPv6 addresses) wrap instead of running off */
@media (max-width: 1100px) { .audit span:first-child { min-width: 96px; } }
details summary { cursor: pointer; color: var(--navy); font-weight: 600; }

/* Enrollment (Student Data Sheet + Medical) */
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }
.kid-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.kid-tab { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 16px; text-decoration: none; color: inherit; }
.kid-tab b { display: block; color: var(--navy); }
.kid-tab small { color: var(--muted); }
.kid-tab.active { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.repeat .check { margin: 0; }
.repeat .check + .grid { margin-top: 14px; }
.repeat p { margin-bottom: 10px; }
.statements { padding-left: 18px; color: var(--navy); }
.statements li { margin-bottom: 6px; }
.alert-list { margin: 0; padding-left: 18px; }

/* Family page: one row per accepted child, with a 2-part checklist and one "next" button */
.child-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--line); }
.checklist { margin: 8px 0 0; padding-left: 20px; }
.checklist li { margin-bottom: 4px; }
.checklist li .small { color: var(--amber); margin-left: 6px; }
.checklist li.done .small { color: var(--green); }
.checklist li.current a { font-weight: 700; }
.next-tag { font-size: .8rem; font-weight: 700; color: var(--red); }
.card-next { border: 2px solid var(--red); }

/* Documents */
.doc-card .repeat-head { margin-bottom: 6px; }
.doc-card + .doc-card { margin-top: 14px; }
.doc-card input[type=file] { font: inherit; margin-top: 6px; max-width: 100%; }
.file-list { list-style: none; padding: 0; margin: 8px 0; }
.file-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.file-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.doc-table td { vertical-align: top; }
.inline-secret { display: inline-block; padding: 4px 12px; margin-left: 6px; }

/* Confirmation pop-up (assets/js/confirm.js) */
.confirm-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(20, 20, 40, .25); }
.confirm-dialog::backdrop { background: rgba(20, 25, 40, .45); }
.confirm-dialog p { font-size: 1rem; margin: 0 0 18px; }
.confirm-dialog .actions { justify-content: flex-end; }
.btn-danger-solid { background: #8c0d23; color: #fff; }

/* Product landing page (bare domain / www) */
.hero { max-width: 720px; padding: 24px 0 36px; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.2rem); }
.lead { font-size: 1.1rem; color: #3b4252; }
.landing-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .landing-grid { grid-template-columns: 1fr; } }
/* School front page (index.php): full-width banner like the demo, in the school's own colors (--navy / --red) */
.school-hero { color: #fff; background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--red) 35%, transparent), transparent 45%),
    linear-gradient(135deg, var(--navy) 0%, color-mix(in srgb, var(--navy) 92%, #fff) 60%, color-mix(in srgb, var(--navy) 70%, var(--red)) 100%); }
.school-hero-inner { max-width: 1120px; margin: 0 auto; padding: 56px 20px 64px; }
.school-hero h1 { color: #fff; max-width: 760px; font-size: clamp(2.2rem, 5.5vw, 3.2rem); }
.school-hero p { color: #d7ddeb; max-width: 620px; font-size: 1.08rem; }
.school-hero .eyebrow { color: #f3c1ca; }
.school-hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .55); }   /* outlined button on the blue banner */
.school-hero .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
/* Product FAQ (faq.php): sections of open/close questions + contact box */
.faq { max-width: 860px; margin: 0 auto; }
.faq h2 { font-size: 1.6rem; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.faq h2:first-child { margin-top: 0; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 0 0 10px; }
.faq-item[open] { border-color: #cfd5e3; box-shadow: 0 4px 16px rgba(29, 43, 79, .06); }
.faq-item summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 20px; font-weight: 600; color: var(--navy); position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--red); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-answer { padding: 0 20px 16px; }
.faq-answer p { margin: 0 0 10px; }
.faq-answer ul { margin: 0 0 10px; padding-left: 20px; }
.faq-answer li { margin-bottom: 4px; }
.faq-cta { margin-top: 40px; padding: 28px; border-radius: 16px; color: #fff; background:
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--red) 35%, transparent), transparent 45%),
    linear-gradient(135deg, var(--navy) 0%, color-mix(in srgb, var(--navy) 92%, #fff) 60%, color-mix(in srgb, var(--navy) 70%, var(--red)) 100%); }
.faq-cta h2 { color: #fff; border: 0; margin: 0 0 8px; padding: 0; }
.faq-cta p { color: #d7ddeb; margin: 0 0 18px; }
/* School sign-in page (index.php): "How it works" numbered steps + "Helpful to have ready" */
.howto { list-style: none; margin: 0; padding: 0; }
.howto li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.howto li:last-child { border-bottom: 0; padding-bottom: 0; }
.howto-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--red-pale); color: var(--red); }
.howto strong { color: var(--navy); }
.howto p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.ready-list { padding-left: 18px; margin: 0; }
.ready-list li { margin-bottom: 8px; }
#start, #confirm, #sign { scroll-margin-top: 20px; }
/* Application, Review step: a new family confirms their email with a 6-digit code before submitting */
.confirm-email { border: 2px solid var(--navy); border-radius: 12px; padding: 16px 20px; margin-top: 20px; background: var(--blue-pale); }
.confirm-email h3 { margin: 0 0 6px; }
.code-field input { max-width: 180px; font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 640px) { .feature-grid { grid-template-columns: 1fr; } }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature h3 { margin-bottom: .3em; }
.feature p { margin: 0; font-size: .92rem; color: #3b4252; }
#sign-in { scroll-margin-top: 20px; }

/* Super admin: edit a staff member's name/email inside the Actions menu */
.edit-user { min-width: 260px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.edit-user .field { margin-bottom: 10px; }

/* Activity log (office/activity.php, admin/activity.php) */
.activity-filters input[type=date] { width: auto; padding: 7px 10px; }
.activity-filters input[type=text] { max-width: 220px; }
.check-inline { display: inline-flex; gap: 6px; align-items: center; }
/* Sub-navigation (settings tabs, activity log views, office form sections): buttons; the current one is filled navy */
.tabs { display: flex; gap: 8px; align-items: center; margin: 6px 0 16px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; padding: 8px 18px; border-radius: 999px; border: 1px solid #cfd5e3; background: #fff;
  text-decoration: none; color: var(--navy); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.tabs a:hover { background: var(--blue-pale); }
.tabs a.active, .tabs a.active:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs .tab-right { margin-left: auto; color: var(--red); border-color: #e8b7c0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
table.activity td { vertical-align: top; }

/* Enrollment change history (office/enrollment.php) */
.history-item { padding: 14px 0; border-top: 1px solid var(--line); }
.history-item:first-of-type { border-top: 0; }
.mt-s { margin-top: 8px; }
table.changes td { vertical-align: top; overflow-wrap: anywhere; }
table.changes td:first-child { font-weight: 600; color: var(--navy); white-space: nowrap; }

.back-link { margin: -12px 0 14px; }
.back-link a { text-decoration: none; font-weight: 600; }
.back-link a:hover { text-decoration: underline; }

/* Form step bar states (family/enroll.php, family/documents.php): ✓ done = green, ! needs attention = amber, current = red */
.stepper .done .bar { background: var(--green); }
.stepper .attention .bar { background: #e0a23c; }
.stepper .current .bar { background: var(--red); }
.stepper .done { color: var(--ink); }
.stepper .attention { color: var(--amber); }
.stepper .lbl { display: flex; gap: 3px; align-items: flex-start; font-size: .76rem; }   /* keeps ✓ / ! next to the first word */
.stepper .lbl > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.stepper .mark { flex-shrink: 0; font-weight: 700; }
.stepper .done .mark { color: var(--green); }
.stepper .attention .mark { color: var(--amber); }
.stepper .todo-count { display: block; color: var(--amber); font-weight: 600; white-space: nowrap; }
.kid-tab small { display: block; }
.kid-tab small + small { margin-top: 2px; }

/* Family progress tracker (family/index.php): Apply → Decision → Enrollment forms → Documents */
.tracker { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tracker li { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); color: var(--muted); }
.tracker-dot { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: #f0ede7; color: var(--muted); }
.tracker-text { display: flex; flex-direction: column; line-height: 1.3; }
.tracker-text strong { color: inherit; font-size: .92rem; }
.tracker li.done { color: var(--ink); }
.tracker li.done .tracker-dot { background: var(--green-pale); color: var(--green); }
.tracker li.done .small { color: var(--green); }
.tracker li.current { color: var(--ink); border: 2px solid var(--red); }
.tracker li.current .tracker-dot { background: var(--red); color: #fff; }
.tracker li.current .small { color: var(--red); font-weight: 600; }
.tracker-note { margin: 0 0 20px; }
@media (max-width: 760px) { .tracker { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .tracker { grid-template-columns: 1fr; } }
.form-sub { color: var(--muted); font-size: .85rem; }

/* Office list: decision pop-up (office/index.php + assets/js/decide.js) */
.decide-dialog, .family-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(20, 20, 40, .25); }
.decide-dialog::backdrop, .family-dialog::backdrop { background: rgba(20, 25, 40, .45); }
.decide-dialog { max-width: 540px; }
.decide-dialog form { padding: 26px 28px; }
.decide-dialog h2 { margin-bottom: 12px; }
.decide-dialog .review dl { grid-template-columns: 150px 1fr; }
.decide-dialog .decide-choice.is-current, .decide-dialog .decide-choice.is-current:hover { background: var(--navy); filter: none; cursor: default; opacity: 1; }
/* Family pop-up (contents from office/family-panel.php) */
.family-dialog { max-width: 1040px; max-height: 92vh; overflow: auto; background: var(--cream); }
.family-body { padding: 24px 28px 28px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2 { margin-bottom: 2px; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .panel-grid { grid-template-columns: 1fr; } }
.panel-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-box + .panel-box { margin-top: 16px; }
.panel-box h3 { margin-bottom: 8px; }

/* A "Back to …" button in the top-right corner, above the page title */
.page-back { display: flex; justify-content: flex-end; margin: -10px 0 6px; }
.page-back + .section-head { margin-top: 0; }

/* Office application page: parents' contact details at the top (family_contact_html()) */
.family-contact { margin-bottom: 20px; }
.contact-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 32px; }
.contact-person { display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.contact-person strong { font-size: 1.05rem; color: var(--navy); }
.contact-person .eyebrow { margin-bottom: 2px; }
/* Application printout (office/application-print.php) */
.print-sub { margin: 18px 0 8px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.print-table { font-size: .9rem; margin-bottom: 8px; }
.print-table th, .print-table td { padding: 6px 10px; }

/* Office: one child's documents (office/documents.php): status line + one next step + "More" menu */
.doc-table .doc-name { width: 22%; }
.doc-table .doc-action { width: 43%; }
.doc-table .doc-action .badge { margin-bottom: 4px; }
/* Status checkboxes (office/documents.php + assets/js/doc-checks.js) */
.doc-checks .check-row { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; margin: 0 0 6px; cursor: pointer; }
.doc-checks .check-row input { margin-top: 3px; }
.doc-checks .check-row.is-on span { color: var(--green); font-weight: 600; }
.doc-checks .check-row.is-off { cursor: default; opacity: .6; }
.doc-checks .who { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); }
.doc-checks.is-saving { opacity: .5; pointer-events: none; }
.doc-table .doc-files { margin-top: 6px; overflow-wrap: anywhere; }
.doc-table .doc-next .actions { margin-top: 0; }
.more-menu { margin-top: 6px; }
.more-menu summary { display: inline-block; list-style: none; padding: 4px 12px; border: 1px solid #cfd5e3; border-radius: 999px; color: var(--navy); font-weight: 600; cursor: pointer; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu summary::after { content: " ▾"; }
.more-menu[open] summary { background: var(--blue-pale); }
.more-items { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; padding: 10px 12px; background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px; }

/* School admin: Users (office/settings-users.php) */
.users-table td { vertical-align: top; }
.users-table tr.is-disabled td { color: var(--muted); background: #fbfaf7; }
.user-actions { min-width: 250px; }
.user-actions .field { margin-bottom: 6px; }
.role-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 8px; }
.role-compare > div { background: #fbfaf7; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: .88rem; }
.role-compare ul { margin: 6px 0 0; padding-left: 18px; }
.role-compare li { margin-bottom: 2px; }
@media (max-width: 640px) { .role-compare { grid-template-columns: 1fr; } }

/* Office applications list: one row per child, grouped by family (office/index.php) */
.list-filters { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 2px solid var(--line); }   /* divider above the table */
.app-list td { vertical-align: top; }
/* Coming back from a child's page / a pop-up: scroll to that row (#kid-… / #fam-…) and flash it softly */
.app-list tr[id], .app-list tbody[id] { scroll-margin-top: 90px; }
.app-list tr:target td, .app-list tbody:target td { animation: row-flash 2.4s ease-out; }
@keyframes row-flash { 0%, 35% { background: #fdf0c8; } 100% { background: transparent; } }
.app-list thead th { background: var(--navy); color: #fff; border-bottom-color: var(--navy); }
/* Same height as the status pills above them (.mini-track: .74rem text, 3px padding, 1px border) */
.app-list .btn-view { gap: 4px; padding: 3px 10px; font-size: .74rem; line-height: 1.55; border-width: 1px; }
.app-list .btn-view .icon-eye { width: 13px; height: 13px; vertical-align: -2px; }
.app-list .btn-view:hover { filter: brightness(1.2); }
.icon-eye { display: inline-block; vertical-align: -3px; }
.app-list tbody.family-group + tbody.family-group { border-top: 2px solid var(--line); }
.app-list .family-cell { width: 24%; border-right: 1px solid #f0ede7; background: #fdfcfa; position: relative; cursor: pointer; }
.app-list .family-cell:hover { background: var(--blue-pale); }
.app-list .family-name { color: var(--ink); font-size: 1rem; }
.app-list .view-app { margin-top: 10px; }
.app-list .view-app::after { content: ""; position: absolute; inset: 0; }   /* the whole family cell opens the application */
.app-list .family-cell > div { margin-top: 3px; }
.app-list .contact-line { overflow-wrap: anywhere; }
.app-list .child-cell { min-width: 170px; }
.app-list tbody.family-group tr:last-child td { border-bottom: 0; }
.app-list .mini-track { margin: 0; }
.app-list .status-cell .btn { margin-top: 8px; white-space: nowrap; }

/* Office */
.student-line + .student-line { margin-top: 12px; }
/* Office list: each child's 4 steps (same path as the families' tracker) */
.mini-track { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.mini-track > li, .mini-track > span { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.mini-track a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mini-track .done { background: var(--green-pale); color: var(--green); }
.mini-track .done::before { content: "✓"; }
.mini-track .office { background: var(--amber-pale); color: var(--amber); border-color: #f1d6a8; }
.mini-track .office::before { content: "●"; font-size: .6rem; }
.mini-track .family { background: #fff; color: var(--navy-soft); border-color: #cfd5e3; }
.mini-track .family::before { content: "○"; font-size: .7rem; }
.mini-track .later { background: #f3f1ec; color: #7d828c; font-weight: 500; }
.mini-track .stop { background: #f0ede7; color: var(--muted); }
.mini-track.inline { display: inline-flex; vertical-align: middle; margin: 0 0 0 4px; }
.track-legend { margin: 4px 0 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; color: var(--navy); line-height: 1.1; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.toolbar input[type=text] { max-width: 280px; }
.toolbar select { width: auto; }
.office-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.office-grid .card + .card { margin-top: 20px; }
@media (max-width: 900px) { .office-grid { grid-template-columns: 1fr; } }

/* Office: full-width "test mode / closed / open" bar under the menu (office_mode_bar() in layout.php) */
.mode-bar { border-bottom: 1px solid transparent; font-size: .88rem; }
.mode-bar-inner { max-width: 1120px; margin: 0 auto; padding: 9px 20px; }
.mode-bar a { font-weight: 600; color: inherit; margin-left: 6px; white-space: nowrap; }
.mode-test { background: #fbe6bd; color: #6b3d00; border-color: #eac07a; }
.mode-test strong { text-transform: uppercase; letter-spacing: .06em; }
.mode-closed { background: #eceae4; color: #4a4f5c; border-color: #d9d5cc; }
.mode-open { background: var(--green-pale); color: var(--green); border-color: #bfe3cf; }
@media print { .mode-bar { display: none; } }

/* Tuition agreement (includes/tuition.php): scrollable text in the form step, rates box, signed copy, settings rows */
.tuition-scroll { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; background: #fff; margin: 12px 0; }
.tuition-text h3 { margin: 0 0 6px; }
.tuition-text h4 { margin: 14px 0 6px; font-size: 1rem; }
.tuition-text p, .tuition-text li { font-size: .92rem; line-height: 1.5; }
.tuition-text ul { padding-left: 20px; margin: 8px 0; }
.tuition-box { border: 1px solid var(--navy); border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-weight: 600; background: var(--blue-pale); }
.signed-agreement { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-top: 8px; }
.rate-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
textarea.mono-text { font-family: Consolas, Menlo, monospace; font-size: .85rem; line-height: 1.45; width: 100%; }
@media print { .tuition-scroll { max-height: none; overflow: visible; } }

/* School admin: settings area title (office_settings_tabs()) */
.settings-head { margin-bottom: 12px; }
/* Settings sections: one card each, bold title + one-line description, divider under the title */
.settings-section-head { border-bottom: 2px solid var(--line); padding-bottom: 12px; margin-bottom: 18px; }
.settings-section-head h2 { font-size: 1.55rem; margin: 0 0 2px; }
.settings-section-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.settings-section .label { display: block; }
.mode-choice { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; }
.mode-choice:has(input:checked) { border-color: var(--navy); background: var(--blue-pale); }
/* Save button stays in view at the bottom of the screen while scrolling through the sections */
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  margin-top: 20px; padding: 12px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 20px rgba(20, 20, 40, .08); }
.danger-section { margin-top: 36px; border-color: #f0c3cb; }
.question-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 8px; }
.question-list .check { margin: 4px 0 8px; }
.question-list .hint { display: block; }
@media (max-width: 760px) { .question-list { grid-template-columns: 1fr; } }
.notify-table td { vertical-align: middle; }
/* Families: school office contact box at the bottom of their pages (family_contact_box() in layout.php) */
.contact-box { display: flex; flex-direction: column; gap: 2px; align-items: center; text-align: center; margin: 32px auto 0; padding: 16px 20px; max-width: 760px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); font-size: .92rem; }
.contact-box strong { color: var(--navy); }
.danger-section .settings-section-head { border-bottom-color: #f6dbe0; }

/* School admin: document settings (office/settings-documents.php) */
.doc-settings td { vertical-align: middle; }
.doc-settings td:first-child { min-width: 200px; }
.doc-settings .check-inline { margin-right: 12px; white-space: nowrap; }
.doc-settings input[type=text] { min-width: 240px; }
.doc-settings tr.locked td { background: #fbfaf7; }

/* ── Printing / Save as PDF (office/enrollment-print.php, office/alerts.php) ───────────────────────── */
.confidential { border: 1.5px solid var(--red); color: #8c0d23; background: var(--red-pale); border-radius: 10px; padding: 8px 12px; font-size: .82rem; font-weight: 600; margin: 0 0 16px; }
.print-toolbar { margin-bottom: 16px; }
.print-alerts { background: var(--amber-pale); border: 1px solid #f1d6a8; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; color: var(--amber); font-size: .92rem; }
.print-sheet .review h4 { margin-top: 14px; }
.alerts-table td { vertical-align: top; font-size: .85rem; }
.alerts-table td.alert-cell { color: #8c0d23; font-weight: 600; }
@page report { size: landscape; margin: 12mm; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .topbar, .site-footer, .no-print, .back-link, .alert:not(.alert-warn) { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card, .table-wrap { box-shadow: none; border: 0; }
  a { color: inherit; text-decoration: none; }
  .confidential { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-report { page: report; }
  .alerts-table { font-size: 8.5pt; }
  .alerts-table th, .alerts-table td { padding: 5px 6px; border-bottom: 1px solid #ccc; }
  .alerts-table tr { break-inside: avoid; }
  .alerts-table thead { display: table-header-group; }   /* column titles repeat on every page */
  .review dl { grid-template-columns: 180px 1fr; }
  .review h4 { break-after: avoid; }
}