/* New Beacon staff portal — shares brand tokens with site.css */
:root {
  --navy-950: #00121f; --navy-900: #001a33; --navy: #002749; --navy-700: #0d3a63;
  --coral: #ff4e31; --coral-strong: #d63a1d; --coral-soft: #ffe7e1;
  --gold: #f4b41a; --gold-soft: #fff4d6;
  --ivory: #fbf8f3; --sand: #f4ede3; --paper: #fff;
  --ink: #0e1b29; --body: #3a4a5c; --muted: #6b7a8b; --line: #e3e7ec; --line-strong: #cfd6de;
  --ok: #157f4f; --ok-soft: #e3f5ec; --warn: #9a6400; --warn-soft: #fff3d6;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0,26,51,.05), 0 8px 24px -12px rgba(0,26,51,.18);
  --sidebar: 256px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 1.55; color: var(--body); background: #f5f6f8; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--coral-strong); }
h1, h2, h3 { color: var(--ink); margin: 0 0 .5em; line-height: 1.2; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy-900); color: rgba(255,255,255,.72); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px 14px; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.sb-brand img { width: 36px; }
.sb-brand strong { font-family: var(--font-display); font-weight: 600; font-size: 18px; display: block; line-height: 1.1; }
.sb-brand span { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.sb-section { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 18px 10px 6px; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: rgba(255,255,255,.78); font-weight: 600; font-size: 14.5px; }
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-link.is-active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--coral); }
.sb-link .icon { color: var(--gold); opacity: .9; }
.sb-badge { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.sb-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.sb-user small { display: block; color: rgba(255,255,255,.55); font-size: 12px; text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: rgba(245,246,248,.9); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar .term-pill { margin-left: auto; }
.menu-btn { display: none; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; width: 40px; height: 40px; align-items: center; justify-content: center; color: var(--navy); cursor: pointer; }
.content { padding: 28px 32px 60px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: -.01em; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: block; }
.term-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--gold-soft); color: #6b4a00; font-weight: 700; font-size: 13px; }
.term-pill.is-missing { background: var(--coral-soft); color: var(--coral-strong); }

/* ---------- Cards, grids ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 18px; }

.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat__value { font-family: var(--font-display); font-size: 36px; font-weight: 500; color: var(--navy); line-height: 1.1; }
.stat__link { font-size: 13px; font-weight: 700; margin-top: 6px; }
.stat .icon { position: absolute; right: 18px; top: 18px; width: 28px; height: 28px; color: var(--gold); }
.stat--alert .stat__value { color: var(--coral-strong); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--line-strong); }
.empty h3 { color: var(--ink); font-size: 17px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: #fbfaf7; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table-tight td, .table-tight th { padding: 7px 10px; }
.row-title { font-weight: 700; color: var(--ink); }
.row-sub { font-size: 12.5px; color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef1f4; color: var(--body); white-space: nowrap; text-transform: capitalize; }
.badge--new, .badge--coral { background: var(--coral-soft); color: var(--coral-strong); }
.badge--ok, .badge--admitted, .badge--active { background: var(--ok-soft); color: var(--ok); }
.badge--warn, .badge--assessment, .badge--contacted { background: var(--warn-soft); color: var(--warn); }
.badge--navy { background: var(--navy); color: #fff; }
.badge--gold { background: var(--gold-soft); color: #6b4a00; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--navy); color: #fff; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .15s; line-height: 1.2; }
.btn:hover { background: var(--navy-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--coral-strong); }
.btn--primary:hover { background: #bd3118; }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--line-strong); }
.btn--ghost:hover { background: #f6f7f9; color: var(--navy); }
.btn--danger { background: #fff; color: var(--coral-strong); border-color: #f2c2b8; }
.btn--danger:hover { background: var(--coral-soft); color: var(--coral-strong); }
.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label, .label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, select.input {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink); padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,39,73,.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 180px; }

/* ---------- Score entry ---------- */
.score-table input { width: 72px; text-align: center; padding: 7px 6px; border-radius: 8px; border: 1px solid var(--line-strong); font: inherit; font-variant-numeric: tabular-nums; font-weight: 600; }
.score-table input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,39,73,.12); background: var(--gold-soft); }
.score-table input.is-error { border-color: var(--coral-strong); background: var(--coral-soft); }
.score-table .total { font-weight: 800; color: var(--navy); }
.score-table .grade { font-weight: 800; color: var(--coral-strong); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 14px 22px; display: flex; gap: 12px; align-items: center; justify-content: space-between; border-radius: 0 0 var(--radius) var(--radius); }
.progress { height: 8px; border-radius: 999px; background: #edf0f3; overflow: hidden; min-width: 90px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--coral)); border-radius: inherit; }
.progress.is-done span { background: var(--ok); }

/* ---------- Broadsheet ---------- */
.broadsheet th.rot { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; padding: 10px 6px; height: 190px; text-align: left; vertical-align: bottom; }
.broadsheet td { text-align: center; font-variant-numeric: tabular-nums; }
.broadsheet td:first-child, .broadsheet th:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; }
.broadsheet .pos { font-weight: 800; color: var(--coral-strong); }
.broadsheet .fail { color: var(--coral-strong); font-weight: 700; }

/* ---------- Alerts / toasts ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: grid; gap: 10px; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 16px 40px -12px rgba(0,26,51,.5); animation: tin .35s ease; }
.toast--error { background: #8a2412; }
.toast .icon { margin-top: 2px; }
.toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: all .35s; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.alert { padding: 14px 16px; border-radius: 12px; border: 1px solid; margin-bottom: 18px; }
.alert--warn { background: var(--warn-soft); border-color: #f1d79a; color: #5e4300; }
.alert--error { background: var(--coral-soft); border-color: #f2c2b8; color: #7a1d10; }
.alert--ok { background: var(--ok-soft); border-color: #b7e2cb; color: #0d5a37; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.credential { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.credential code { background: rgba(255,255,255,.12); padding: 3px 8px; border-radius: 6px; font-size: 16px; letter-spacing: .04em; color: var(--gold); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ivory); }
.auth__art { position: relative; background: var(--navy-900) url("../img/campus/admin-block.jpg") center/cover; }
.auth__art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(0,26,51,.55), rgba(0,18,31,.92)); }
.auth__art-copy { position: absolute; z-index: 1; left: 48px; right: 48px; bottom: 48px; color: #fff; }
.auth__art-copy h2 { color: #fff; font-family: var(--font-display); font-weight: 500; font-size: 42px; line-height: 1.05; letter-spacing: -.02em; }
.auth__art-copy em { color: var(--gold); }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__box { width: 100%; max-width: 400px; }
.auth__box img { width: 56px; margin-bottom: 18px; }
.auth__box h1 { font-family: var(--font-display); font-weight: 500; font-size: 32px; }
.auth__box .btn { padding: 12px 18px; font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .3s ease; }
  .sidebar.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,18,31,.5); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
}
@media (max-width: 600px) {
  .grid-4, .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 25px; }
  .filters .input { min-width: 0; flex: 1 1 140px; }
}
@media print {
  .sidebar, .topbar, .btn, .filters, .sticky-actions, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ---------- Attendance segmented control ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.seg__opt { position: relative; cursor: pointer; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg__opt span { display: block; padding: 7px 14px; font-size: 13.5px; font-weight: 700; color: var(--muted); border-left: 1px solid var(--line); }
.seg__opt:first-child span { border-left: 0; }
.seg__opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: -3px; }
.seg__opt--present input:checked + span { background: var(--ok-soft); color: var(--ok); }
.seg__opt--late input:checked + span { background: var(--warn-soft); color: var(--warn); }
.seg__opt--absent input:checked + span { background: var(--coral-soft); color: var(--coral-strong); }
@media print { .credential, .page-head p { color: #000; } }

/* ---------- Family portal ---------- */
body.family { background: var(--ivory); }
.fam-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.fam-top { background: var(--navy-900); position: sticky; top: 0; z-index: 30; }
.fam-top__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.fam-nav { display: flex; gap: 4px; align-items: center; }
.fam-nav a, .fam-nav button { color: rgba(255,255,255,.8); font: inherit; font-weight: 700; font-size: 14px; padding: 8px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.fam-nav a:hover, .fam-nav button:hover, .fam-nav a.is-active { color: #fff; background: rgba(255,255,255,.08); }
.fam-main { padding-top: 24px; padding-bottom: 48px; }
.fam-hero { margin: 8px 0 22px; }
.fam-hero h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(26px, 4vw, 36px); letter-spacing: -.01em; }
.fam-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--coral-strong); margin: 0 0 6px; }
.fam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.fam-child { display: flex; flex-direction: column; gap: 18px; padding: 22px; color: inherit; transition: transform .2s, box-shadow .2s; }
.fam-child:hover { transform: translateY(-3px); color: inherit; }
.fam-child__head { display: flex; gap: 14px; align-items: center; }
.fam-child__head h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0; }
.fam-child__head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.avatar--lg { width: 52px; height: 52px; font-size: 18px; background: var(--navy); color: var(--gold); }
.fam-child__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fam-child__stats .label, .fam-summary .label { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.fam-child__stats strong { font-size: 14.5px; color: var(--ink); }
.fam-child__go { font-weight: 700; color: var(--coral-strong); display: inline-flex; gap: 8px; align-items: center; }
.fam-due { color: var(--coral-strong) !important; }
.fam-ok { color: var(--ok) !important; }
.fam-section { margin-top: 32px; }
.fam-h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 0 0 12px; }
.fam-h2-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.fam-h2-row .fam-h2 { margin: 0; }
.fam-ann { margin-bottom: 12px; }
.fam-ann h3 { font-size: 16px; margin: 6px 0; }
.fam-ann p { margin: 0; white-space: pre-line; }
.fam-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card.fam-summary { border-bottom: 1px solid var(--line); }
.fam-summary strong { font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--navy); }
.fam-pos { color: var(--coral-strong) !important; }
.fam-inv { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; color: inherit; }
.fam-inv:hover { color: inherit; box-shadow: 0 10px 30px -14px rgba(0,26,51,.3); }
.fam-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.fam-foot a { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.crumb { display: inline-block; }
@media (max-width: 600px) {
  .fam-cards { grid-template-columns: 1fr; }
  .fam-summary { grid-template-columns: repeat(2, 1fr); }
  .fam-nav a:not(.is-active) { display: none; }
  .sb-brand strong { font-size: 16px; }
}

/* ---------- Direct payment details & claim review ---------- */
.bank-box { display: grid; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #f1dfa6; margin: 10px 0 14px; }
.bank-box .label { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #7a5a00; margin-bottom: 2px; }
.bank-box strong { color: var(--ink); font-size: 15.5px; }
.bank-box div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.bank-box div .label { flex-basis: 100%; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { display: none; }
.proof-frame { width: 100%; min-height: 520px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.proof-img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }
