/* Shared by the seven school pages: education-admin, -students, -student,
   -board, -ministry, -progress and -activity. Same patterns as clinic-dashboard.css (the
   approved clinic dashboards): one header (logo, page or school name, Sign out),
   one container, one footer, one gate card, card-style tables on phones and
   44px tap targets. Page-only rules stay in each page or its workspace sheet. */
:root{
  --green:#1a7d52;--green-dark:#0f5238;--green-soft:#eaf5ee;--green-line:#cde6d8;
  --ink:#16241d;--muted:#5e6663;--cream:#faf7f0;--line:#e3ede6;--card:#fff;
  --danger:#b42318;--danger-soft:#fdeceb;
  --amber-ink:#6b4500;--amber-bg:#fff7e6;--amber-line:#f0d9a6
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* The WINDOW scrolls (audit M1). height:100% with overflow-x:hidden on both html
   and body turned the body into its own scroll box: PageDown and Space did
   nothing, sticky bars scrolled away and iPhone toolbars never collapsed.
   height:auto plus overflow-x:clip (hidden where clip is unsupported) keeps
   the sideways guard without making either element a scroller. */
html,body{margin:0;height:auto;overflow-x:hidden;overflow-x:clip}
body{min-height:100vh;display:flex;flex-direction:column;background:var(--cream);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
main{flex:1 0 auto;width:100%}
h1,h2,h3,p{margin:0}
a{color:var(--green)}
a:hover{color:var(--green-dark)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--ink);outline-offset:2px}
[hidden]{display:none!important}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.skip-link{position:absolute;left:-9999px;top:0;background:var(--ink);color:#fff;padding:10px 16px;font-size:14px;font-weight:800;border-radius:0 0 8px 0;z-index:10000;text-decoration:none}
.skip-link:focus{left:0}
.wrap{width:100%;max-width:1080px;margin:0 auto;padding:24px 24px 64px}

/* ── Header: logo, page or school name, Sign out. One row at every width; a
   long name wraps inside its own column, so Sign out never wraps or moves. ── */
.edu-head{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin:0 0 18px}
.edu-mark{width:40px;height:40px;flex:0 0 40px;border-radius:11px;background:#fff;box-shadow:0 2px 10px rgba(15,82,56,.12);display:flex;align-items:center;justify-content:center}
.edu-mark img{display:block;width:24px;height:26px}
.edu-title{flex:1 1 0;min-width:0}
.edu-title h1{font-size:24px;font-weight:800;letter-spacing:-.4px;line-height:1.2;overflow-wrap:anywhere}
.edu-sub{margin-top:2px;color:var(--muted);font-size:14px;line-height:1.45;overflow-wrap:break-word}
.edu-sub .sep,.edu-foot .sep{margin:0}
/* Sub-line facts: each one carries its trailing dot and wraps inside only when
   it is wider than the column, so no line starts with "·" and nothing runs
   under Sign out at 320px. */
.edu-sub .seg{display:inline-block;max-width:100%;vertical-align:top}
/* Inline links in the sub line: the padding grows the tap area to 44px
   without moving the line (vertical padding on an inline box adds no height). */
.edu-sub a{font-weight:700;text-decoration:underline;text-underline-offset:2px;padding:16px 0}
.edu-picker{font-size:14px;font-weight:700;padding:8px 10px;border:1.5px solid var(--line);border-radius:10px;background:#fff;max-width:260px;min-width:0;min-height:40px}
.edu-signout{flex:0 0 auto;background:#fff;border:1.5px solid var(--line);border-radius:10px;padding:8px 14px;font-weight:700;font-size:14px;color:var(--muted);cursor:pointer;white-space:nowrap;min-height:40px;transition:border-color .15s,color .15s}
.edu-signout:hover{border-color:var(--green-line);color:var(--green)}
.edu-back{display:inline-flex;align-items:center;gap:6px;min-height:36px;margin:0 0 8px;color:var(--muted);font-size:14px;font-weight:700;text-decoration:none}
.edu-back:hover{color:var(--green)}
.edu-back svg{width:16px;height:16px;flex:0 0 16px}

/* ── Language: English / Français, above the page on every view (drawn by
   education-session.js). The language in use is plain text weight, the other
   one reads as a link. 44px tall on touch screens, like every other control. ── */
.edu-lang{display:flex;justify-content:flex-end;align-items:center;gap:0 6px;width:100%;max-width:1080px;margin:0 auto;padding:8px 24px 0;font-size:13px;color:var(--muted)}
.edu-lang .sep{margin:0}
.edu-lang-btn{background:none;border:0;padding:0 4px;min-height:32px;font-size:13px;font-weight:700;color:var(--green);cursor:pointer;border-radius:6px}
.edu-lang-btn:hover{color:var(--green-dark);text-decoration:underline;text-underline-offset:2px}
.edu-lang-btn[aria-pressed="true"]{color:var(--ink);cursor:default;text-decoration:none}
/* The page's own top padding already clears the row above it. */
.edu-lang+main>.wrap{padding-top:10px}
.edu-lang+main>.edu-gate{margin-top:40px}

/* ── Footer (the same on all seven pages) ── */
.edu-foot{flex-shrink:0;border-top:1px solid var(--line);padding:22px 16px;text-align:center;color:var(--muted);font-size:13px;line-height:1.7}
.edu-foot a{color:var(--green);text-decoration:none;font-weight:600;padding:15px 0}
.edu-foot a:hover{text-decoration:underline}

/* ── Gate card (signed out, session ended, not staff, could not load) ── */
.edu-gate{max-width:440px;margin:56px auto;padding:30px 24px;background:#fff;border:1px solid var(--line);border-radius:18px;text-align:center}
.edu-gate .edu-mark{margin:0 auto}
.edu-gate h1{margin:14px 0 6px;font-size:21px;font-weight:800;line-height:1.25}
.edu-gate p{color:var(--muted);font-size:15px;line-height:1.5}
.edu-gate-actions{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:18px}
.edu-gate-actions .linkbtn{min-height:44px}
/* "Sign out" on a gate only for someone who is signed in (education-session.js
   marks <html> once a session is confirmed). */
html:not(.edu-signed-in) .edu-gate-signout{display:none!important}
.edu-loading{display:flex;flex-direction:column;align-items:center;gap:12px;margin:72px auto;color:var(--muted);font-size:15px}
.edu-spinner{width:28px;height:28px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--green);animation:edu-spin .8s linear infinite}
@keyframes edu-spin{to{transform:rotate(360deg)}}

/* ── Sections, cards, banners ── */
.edu-section{background:#fff;border:1px solid var(--line);border-radius:18px;padding:22px;margin-top:18px;scroll-margin-top:72px}
.edu-section>h2,.edu-section-head h2{font-size:18px;font-weight:800;line-height:1.3}
.edu-section p.desc{color:var(--muted);font-size:14px;margin:4px 0 16px;line-height:1.5;max-width:760px}
.edu-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px 14px;flex-wrap:wrap}
.edu-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 4px}
.edu-cards.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.edu-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;min-width:0}
.edu-card .n{font-size:26px;font-weight:800;line-height:1.15;font-variant-numeric:tabular-nums}
.edu-card .l{color:var(--muted);font-size:13px;margin-top:2px}
.edu-banner{background:var(--amber-bg);border:1px solid var(--amber-line);border-radius:14px;padding:15px 17px;margin:0 0 16px;color:var(--amber-ink)}
.edu-banner h2{font-size:16px;font-weight:800;line-height:1.35;margin:0 0 4px;color:#4f3300}
.edu-banner p{font-size:14px;line-height:1.5}
.edu-banner a:not(.btn){color:#4f3300;font-weight:800}
.edu-note{display:flex;gap:9px;align-items:flex-start;background:var(--green-soft);border:1px solid var(--green-line);border-radius:12px;padding:11px 14px;color:#24523e;font-size:13.5px;font-weight:600;line-height:1.5}
.edu-note svg{flex:0 0 15px;margin-top:3px}

/* ── Buttons and inputs ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:9px 18px;border:1.5px solid transparent;border-radius:999px;font-size:14px;font-weight:700;line-height:1.2;text-decoration:none;white-space:nowrap;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.btn-primary{background:var(--green);color:#fff}
.btn-primary:hover{background:var(--green-dark);color:#fff}
.btn-outline{background:#fff;color:var(--green);border-color:var(--green-line)}
.btn-outline:hover{border-color:var(--green);color:var(--green-dark)}
.btn-soft{background:var(--green-soft);color:var(--green)}
.btn-soft:hover{background:#dcefe3;color:var(--green-dark)}
.btn-sm{min-height:36px;padding:7px 14px;font-size:13.5px}
.btn:disabled,.btn[aria-disabled="true"]{opacity:.5;cursor:default}
/* Text-style row actions, as on the clinic dashboard. */
.linkbtn{display:inline-flex;align-items:center;background:none;border:0;padding:0;font-size:14px;font-weight:700;color:var(--green);cursor:pointer;text-decoration:none;white-space:nowrap}
.linkbtn:hover{color:var(--green-dark);text-decoration:underline;text-underline-offset:2px}
.linkbtn.danger{color:var(--danger)}
.linkbtn.danger:hover{color:#8f1b12}
.plain-note{font-size:13px;font-weight:600;color:var(--muted);white-space:nowrap}
label.f-label,.f-label{display:block;font-size:12px;font-weight:700;color:var(--muted);margin-bottom:5px}
.f-input,.edu-section input:not([type=checkbox]):not([type=radio]),.edu-section select,.edu-dialog input,.edu-dialog select{width:100%;min-width:0;min-height:44px;padding:10px 12px;border:1.5px solid var(--line);border-radius:11px;background:#fff;font-size:15px}
.f-input:focus,.edu-section input:focus,.edu-section select:focus,.edu-dialog input:focus,.edu-dialog select:focus{outline:none;border-color:var(--green);box-shadow:0 0 0 3px rgba(26,125,82,.15)}
.f-row{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.f-row>.f{flex:1 1 200px;min-width:0}
.f-row>.f.f-narrow{flex:0 0 96px}
.f-row>.btn{flex:0 0 auto;min-height:44px}
.f-hint{font-size:13px;color:var(--muted);margin-top:6px;line-height:1.45}
.msg{font-size:13.5px;line-height:1.45;margin-top:8px;min-height:0}
.msg:empty{display:none}
.msg.ok{color:var(--green)}
.msg.err{color:var(--danger)}
.msg.info{color:var(--muted)}

/* ── Status toast: confirmations and errors appear where the person is
   looking, instead of scrolling the page back to the top (audit LOW 4). ── */
.edu-toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:600;width:min(560px,calc(100vw - 32px));display:flex;align-items:flex-start;gap:10px;padding:12px 12px 12px 16px;border-radius:12px;background:var(--ink);color:#fff;font-size:14px;font-weight:600;line-height:1.45;box-shadow:0 12px 32px rgba(0,0,0,.22)}
.edu-toast[data-kind="error"]{background:#7a1b12}
.edu-toast[data-kind="success"]{background:var(--green-dark)}
.edu-toast .t{flex:1 1 auto;min-width:0;padding-top:2px}
.edu-toast .x{flex:0 0 auto;width:32px;height:32px;margin:-4px -4px -4px 0;border:0;border-radius:8px;background:transparent;color:#fff;font-size:20px;line-height:1;cursor:pointer}
.edu-toast .x:hover{background:rgba(255,255,255,.14)}

/* ── Dialogs: the status line sits INSIDE the dialog (audit M5). ── */
.edu-modal{position:fixed;inset:0;z-index:500;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(15,36,29,.45)}
.edu-dialog{width:100%;max-width:480px;max-height:calc(100vh - 36px);max-height:calc(100dvh - 36px);overflow-y:auto;background:#fff;border-radius:18px;padding:24px;box-shadow:0 18px 50px rgba(15,82,56,.25)}
.edu-dialog h2{font-size:19px;font-weight:800;line-height:1.3;margin:0 0 4px;overflow-wrap:anywhere}
.edu-dialog p.desc{color:var(--muted);font-size:14px;line-height:1.5;margin:0 0 14px}
.edu-dialog .actions{display:flex;gap:10px;justify-content:space-between;flex-wrap:wrap;margin-top:16px}
.edu-dialog .actions.end{justify-content:flex-end}

/* ── Tables: a stack of cards on phones and tablets (clinic .rt) ── */
.tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;margin:14px 0 0;position:relative}
.rt{width:100%;border-collapse:collapse}
.rt th,.rt td{text-align:left;padding:11px 8px;border-bottom:1px solid var(--line);font-size:14px;vertical-align:middle}
.rt th{color:var(--muted);font-weight:700;font-size:12px;text-transform:uppercase;letter-spacing:.4px;white-space:nowrap}
.rt td.c-name{font-weight:700;overflow-wrap:anywhere;min-width:120px}
.rt td.num,.rt th.num{text-align:center;font-variant-numeric:tabular-nums}
.rt td.c-act{text-align:right;white-space:nowrap}
.m-meta{display:none}

@media(max-width:860px){
  .rt thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .rt,.rt tbody{display:block;width:100%}
  .rt tr{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:6px 12px;padding:14px 0;border-bottom:1px solid var(--line)}
  .rt tr:last-child{border-bottom:0}
  .rt td{display:block;grid-column:1/-1;padding:0;border:0;min-width:0;text-align:left}
  .rt td.c-name{grid-column:1;font-size:16px;font-weight:800}
  .rt td.c-hide-m{display:none}
  .rt .m-meta{display:block;font-size:13px;font-weight:400;color:var(--muted);margin-top:2px}
  .rt td.c-act{text-align:left;white-space:normal}
  .rt .linkbtn,.rt .btn{min-height:44px}
  /* 44px tap targets on touch screens. */
  .btn,.btn-sm,.edu-signout,.edu-picker,.linkbtn,.edu-back,.edu-lang-btn{min-height:44px}
}
@media(max-width:768px){.edu-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){
  .wrap{padding:16px 16px 56px}
  .edu-lang{padding:0 16px}
  .edu-lang+main>.wrap{padding-top:4px}
  .edu-lang+main>.edu-gate{margin-top:16px}
  .edu-title h1{font-size:20px}
  .edu-sub{font-size:13.5px}
  /* Phones: logo, name and Sign out share the top row; the sub-line runs
     beneath the name and under Sign out, rather than in a 140px column at
     320px; the school switcher takes its own row. (.edu-title is a plain div,
     so display:contents costs no semantics.) */
  .edu-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:12px;row-gap:0}
  .edu-head .edu-title{display:contents}
  .edu-head .edu-mark{grid-row:1;grid-column:1}
  .edu-head h1{grid-row:1;grid-column:2}
  .edu-head .edu-signout{grid-row:1;grid-column:3}
  .edu-head .edu-sub{grid-row:2;grid-column:2/-1}
  .edu-head .edu-picker{grid-row:3;grid-column:1/-1;max-width:none;margin-top:10px}
  .edu-section{padding:18px 16px;border-radius:16px}
  .edu-cards{gap:8px}
  .edu-cards.three{grid-template-columns:repeat(3,minmax(0,1fr))}
  .edu-card{padding:12px}
  .edu-card .n{font-size:22px}
  .edu-card .l{font-size:12px;line-height:1.35}
  .f-row>.btn{flex:1 1 100%}
  .edu-gate{margin:28px auto}
  .edu-dialog{padding:20px 18px}
  .edu-dialog .actions .btn{flex:1 1 auto}
}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
