/* ============================================================
   BNHS Enrollment & Grading System
   Visual language: warm paper, soft cards, coral accent,
   serif display headings over a quiet sans body.
   ============================================================ */

:root {
  /* Surfaces */
  --paper:        #d9d5c7;   /* outer desk */
  --card:         #f7f4ec;   /* main sheet */
  --card-alt:     #fbf9f4;   /* right rail sheet */
  --panel:        #efeadc;   /* inset tiles */
  --line:         #e2dccb;
  --line-soft:    #eee9dc;

  /* Ink */
  --ink:          #20241f;
  --ink-soft:     #5d6157;
  --ink-faint:    #8d9086;

  /* Accents */
  --coral:        #e2604a;
  --coral-soft:   #f6d9d2;
  --coral-ink:    #b8412d;
  --pine:         #4b7355;
  --pine-soft:    #dfeadf;
  --gold:         #b8873a;
  --gold-soft:    #f3e6cd;
  --night:        #1e2420;

  /* Type */
  --display: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(32, 36, 31, .05);
  --shadow-md: 0 4px 16px rgba(32, 36, 31, .07);
  --shadow-lg: 0 18px 50px rgba(32, 36, 31, .13);

  --rail: 76px;
  --rightcol: 380px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0;
  color: var(--ink);
}

h1 { font-size: 2.45rem; line-height: 1.15; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

/* ============================================================
   App shell — the "open book" card floating on the desk
   ============================================================ */

.shell {
  min-height: 100vh;
  padding: 26px;
  display: flex;
}

.book {
  flex: 1;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: calc(100vh - 52px);
}

/* ---------- Left icon rail ---------- */

.rail {
  background: var(--card);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 0 22px;
  gap: 10px;
}

.rail__mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  color: var(--ink);
}

.rail__mark svg { width: 30px; height: 30px; }

.rail__link {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--ink-soft);
  transition: background .18s ease, color .18s ease, transform .18s ease;
  position: relative;
}

.rail__link:hover {
  background: var(--panel);
  color: var(--ink);
}

.rail__link.is-active {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 6px 16px rgba(226, 96, 74, .34);
}

.rail__link svg { width: 21px; height: 21px; }

/* Tooltip on hover */
.rail__link::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--night);
  color: #fff;
  font-size: .75rem;
  font-family: var(--body);
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
  z-index: 40;
}

.rail__link:hover::after { opacity: 1; }

.rail__spacer { flex: 1; }

/* ---------- Page body: main + right rail ---------- */

.page {
  display: grid;
  grid-template-columns: 1fr var(--rightcol);
  min-width: 0;
}

.page--wide { grid-template-columns: 1fr; }

.main {
  padding: 26px 34px 40px;
  min-width: 0;
}

.aside {
  background: var(--card-alt);
  border-left: 1px solid var(--line-soft);
  padding: 26px 28px 40px;
  min-width: 0;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-faint);
  max-width: 460px;
}

.search svg { width: 17px; height: 17px; flex: none; }

.search input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: .92rem;
  color: var(--ink);
  outline: none;
  padding: 6px 0;
}

.search input::placeholder { color: var(--ink-faint); }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.whoami {
  display: flex;
  align-items: center;
  gap: 11px;
}

.whoami__name { font-weight: 500; font-size: .92rem; }
.whoami__role { font-size: .74rem; color: var(--ink-faint); text-transform: capitalize; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--night);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  flex: none;
}

.avatar--coral { background: var(--coral); }
.avatar--pine  { background: var(--pine); }
.avatar--gold  { background: var(--gold); }
.avatar--sm    { width: 30px; height: 30px; font-size: .66rem; }
.avatar--lg    { width: 60px; height: 60px; font-size: 1.05rem; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  transition: background .18s ease;
}

.icon-btn:hover { background: var(--panel); }
.icon-btn svg { width: 19px; height: 19px; }

.icon-btn__dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--card);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 40px;
}

.hero__lead {
  max-width: 460px;
  color: var(--ink-soft);
  font-size: .95rem;
  margin: 14px 0 0;
}

.hero h1 em {
  font-style: italic;
  color: var(--coral);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--night);
  color: #fff;
  font-size: .87rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn svg { width: 15px; height: 15px; }

.btn--coral  { background: var(--coral); }
.btn--ghost  { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--panel); box-shadow: none; }
.btn--sm     { padding: 7px 14px; font-size: .8rem; }
.btn--block  { width: 100%; justify-content: center; }
.btn--danger { background: #a83b2a; }

.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ============================================================
   Section headings
   ============================================================ */

.section {
  margin-bottom: 38px;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.section__head h2 { flex: none; }

.section__head .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section__head .more {
  font-size: .8rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.section__head .more:hover { color: var(--coral); }

/* ============================================================
   Stat tiles
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.stat {
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 18px 20px;
  transition: transform .18s ease;
}

.stat:hover { transform: translateY(-2px); }

.stat__label {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
  font-weight: 500;
}

.stat__value {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1.1;
  margin-top: 6px;
}

.stat__foot {
  font-size: .78rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.stat--coral { background: var(--coral-soft); }
.stat--coral .stat__value { color: var(--coral-ink); }
.stat--pine  { background: var(--pine-soft); }
.stat--gold  { background: var(--gold-soft); }

/* ============================================================
   Cards / tiles
   ============================================================ */

.card {
  background: var(--card-alt);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 22px 24px;
}

.card--plain { background: transparent; border: 0; padding: 0; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

/* Subject / section "spine" cards — echoing the book covers */
.spine {
  display: block;
  transition: transform .2s ease;
}

.spine:hover { transform: translateY(-4px); }

.spine__cover {
  height: 160px;
  border-radius: 6px 12px 12px 6px;
  padding: 16px 16px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border-left: 5px solid rgba(0, 0, 0, .28);
}

.spine__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, .17), transparent 55%);
}

.spine__code {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .85;
  font-weight: 600;
}

.spine__title {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.25;
}

.spine__meta {
  font-size: .74rem;
  opacity: .88;
}

.spine__label {
  margin-top: 12px;
  font-size: .88rem;
  font-weight: 500;
}

.spine__sub {
  font-size: .78rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* Deterministic cover palettes */
.cover-1 { background: linear-gradient(160deg, #8c3a2c, #5d2419); }
.cover-2 { background: linear-gradient(160deg, #24303a, #131c24); }
.cover-3 { background: linear-gradient(160deg, #1d4a6b, #0f2b41); }
.cover-4 { background: linear-gradient(160deg, #3f5b3a, #22331f); }
.cover-5 { background: linear-gradient(160deg, #6b4a1e, #3d2a0f); }
.cover-6 { background: linear-gradient(160deg, #4a3560, #291c38); }
.cover-7 { background: linear-gradient(160deg, #7a3550, #451d2e); }
.cover-8 { background: linear-gradient(160deg, #2c5a55, #16332f); }

/* ============================================================
   Feature panel (the "now reading" block)
   ============================================================ */

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.feature__eyebrow {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}

.feature__title {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.2;
}

.feature__progress {
  font-size: .95rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.feature__progress b {
  color: var(--coral);
  font-size: 1.15rem;
  font-weight: 600;
}

.feature__note {
  font-size: .88rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

.feature__by {
  text-align: right;
  font-size: .84rem;
  color: var(--ink-faint);
  margin-top: 14px;
  font-style: italic;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 12px;
}

.bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--coral);
  transition: width .5s ease;
}

.bar__fill--pine { background: var(--pine); }
.bar__fill--gold { background: var(--gold); }

/* ============================================================
   Week strip (schedule)
   ============================================================ */

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.week__day {
  text-align: center;
  padding: 9px 2px 11px;
  border-radius: 14px;
  transition: background .18s ease;
}

.week__day small {
  display: block;
  font-size: .72rem;
  color: var(--ink-faint);
  margin-bottom: 3px;
}

.week__day span {
  font-size: .95rem;
  font-weight: 500;
}

.week__day.is-sunday small,
.week__day.is-sunday span { color: var(--coral); }

.week__day.is-today {
  background: var(--panel);
}

.week__nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

/* ============================================================
   Activity feed (reader friends)
   ============================================================ */

.feed { position: relative; padding-left: 4px; }

.feed__item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}

.feed__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 44px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}

.feed__who { font-weight: 600; font-size: .9rem; }

.feed__text {
  font-size: .86rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 3px 0 6px;
}

.feed__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .76rem;
}

.feed__tag { color: var(--coral); font-weight: 500; }
.feed__time { color: var(--ink-faint); margin-left: auto; }

/* ============================================================
   Tables
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--card-alt);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

table.data th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
  font-weight: 600;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--panel);
}

table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(226, 96, 74, .045); }

table.data td.num { text-align: center; font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--ink-faint);
}

.empty h3 { color: var(--ink-soft); margin-bottom: 6px; }
.empty p { margin: 0; font-size: .88rem; }

/* ============================================================
   Pills / badges
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--panel);
  color: var(--ink-soft);
}

.pill--great { background: var(--pine-soft); color: #2f5438; }
.pill--good  { background: #dfe8ef; color: #2a4c66; }
.pill--ok    { background: var(--gold-soft); color: #8a6320; }
.pill--bad   { background: var(--coral-soft); color: var(--coral-ink); }
.pill--muted { background: var(--panel); color: var(--ink-faint); }

.pill--pending  { background: var(--gold-soft); color: #8a6320; }
.pill--approved { background: var(--pine-soft); color: #2f5438; }
.pill--rejected { background: var(--coral-soft); color: var(--coral-ink); }
.pill--sent     { background: var(--pine-soft); color: #2f5438; }
.pill--failed   { background: var(--coral-soft); color: var(--coral-ink); }

/* ============================================================
   Forms
   ============================================================ */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-family: inherit;
  font-size: .9rem;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(226, 96, 74, .13);
}

.field textarea { resize: vertical; min-height: 84px; }

.field__hint { font-size: .75rem; color: var(--ink-faint); margin-top: 5px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

/* Compact grade inputs */
input.q {
  width: 62px;
  padding: 7px 8px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: .87rem;
  font-variant-numeric: tabular-nums;
  background: #fff;
  outline: none;
}

input.q:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(226, 96, 74, .13); }
input.q.is-bad { border-color: var(--coral); background: #fdf3f1; }

/* ============================================================
   Filter bar
   ============================================================ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.filters .field { margin-bottom: 0; }
.filters select, .filters input[type="text"] { min-width: 150px; }

/* ============================================================
   Flash messages
   ============================================================ */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: .88rem;
  margin-bottom: 18px;
}

.flash--success { background: var(--pine-soft); color: #2f5438; }
.flash--error   { background: var(--coral-soft); color: var(--coral-ink); }
.flash--info    { background: var(--gold-soft); color: #8a6320; }

/* ============================================================
   Login
   ============================================================ */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
}

.login__card {
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 560px;
}

.login__art {
  background: linear-gradient(165deg, #2b3630, #161c18);
  color: #f2ede1;
  padding: 46px 44px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.login__art::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 96, 74, .34), transparent 68%);
}

.login__crest {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, .1);
  margin-bottom: auto;
}

.login__crest svg { width: 30px; height: 30px; }

.login__art h1 {
  color: #fff;
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.login__art h1 em { font-style: italic; color: #f0a292; }

.login__art p {
  color: rgba(242, 237, 225, .7);
  font-size: .92rem;
  max-width: 320px;
  margin: 0;
}

.login__marks {
  display: flex;
  gap: 22px;
  margin-top: 30px;
  position: relative;
  z-index: 1;
}

.login__mark small {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(242, 237, 225, .5);
}

.login__mark b {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
}

.login__form {
  padding: 46px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login__form h2 { font-size: 1.7rem; margin-bottom: 6px; }

.login__form > p {
  color: var(--ink-soft);
  font-size: .9rem;
  margin: 0 0 26px;
}

/* Role picker — radios styled as a segmented control, so it still works
   without JavaScript and stays reachable by keyboard. */
.rolepick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--panel);
  border-radius: 12px;
  padding: 4px;
}

.rolepick label { margin: 0; cursor: pointer; }

.rolepick input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rolepick span {
  display: block;
  text-align: center;
  padding: 9px 4px;
  border-radius: 9px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background .16s ease, color .16s ease;
  white-space: nowrap;
}

.rolepick span:hover { color: var(--ink); }

.rolepick input:checked + span {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 2px 8px rgba(226, 96, 74, .3);
}

.rolepick input:focus-visible + span {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

@media (max-width: 420px) {
  .rolepick { grid-template-columns: repeat(2, 1fr); }
}

.login__demo {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  color: var(--ink-faint);
}

.login__demo b { color: var(--ink-soft); }

.login__demo ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 4px;
}

.login__demo code {
  background: var(--panel);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: .74rem;
}

/* ============================================================
   Print — Form 138 report card
   ============================================================ */

.sheet {
  background: #fff;
  width: 8.5in;
  min-height: 11in;
  margin: 26px auto;
  padding: .7in .75in;
  box-shadow: var(--shadow-lg);
  color: #000;
  font-size: 11.5px;
  line-height: 1.45;
}

.sheet h1 { font-size: 1.25rem; }

.sheet__head {
  text-align: center;
  border-bottom: 2px solid #000;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.sheet__head small {
  display: block;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 9.5px;
}

table.f138 {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-bottom: 16px;
}

table.f138 th, table.f138 td {
  border: 1px solid #000;
  padding: 5px 7px;
}

table.f138 th { background: #eee; text-align: center; font-size: 10px; }
table.f138 td.subj { text-align: left; }
table.f138 td { text-align: center; font-variant-numeric: tabular-nums; }
table.f138 tfoot td { font-weight: 700; background: #f5f5f5; }

.sheet__sign {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 48px;
  text-align: center;
  font-size: 10.5px;
}

.sheet__sign div { border-top: 1px solid #000; padding-top: 5px; }

@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .sheet { margin: 0; box-shadow: none; width: auto; min-height: 0; padding: 0; }
  @page { margin: .5in; }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  .page { grid-template-columns: 1fr; }
  .aside { border-left: 0; border-top: 1px solid var(--line-soft); }
}

@media (max-width: 820px) {
  .shell { padding: 0; }
  .book { border-radius: 0; grid-template-columns: 1fr; min-height: 100vh; }
  .rail {
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 14px;
    overflow-x: auto;
  }
  .rail__mark { margin: 0 12px 0 0; }
  .rail__spacer { display: none; }
  .rail__link::after { display: none; }
  .main, .aside { padding: 20px; }
  h1 { font-size: 1.9rem; }
  .login__card { grid-template-columns: 1fr; }
  .login__art { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .search { order: 2; flex: 1 1 100%; max-width: none; }
  .topbar__right { margin-left: 0; }
}

/* On a phone the avatar alone identifies the signed-in user; the name
   would otherwise push the bell button past the edge of the screen. */
@media (max-width: 560px) {
  .whoami > div:not(.avatar) { display: none; }
}

/* ============================================================
   Public enrollment (apply.php, application-status.php)
   ============================================================ */

body.apply { background: var(--paper); }

.apply__wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 20px 50px;
}

.apply__wrap--narrow { max-width: 560px; }

.apply__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.apply__head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; }
.apply__head h1 em { font-style: italic; color: var(--coral); }
.apply__head p { margin: 4px 0 0; color: var(--ink-soft); font-size: .9rem; }
.apply__head .btn { margin-left: auto; flex: none; }

.apply__eyebrow {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 6px;
}

.apply .card { background: var(--card); border-color: var(--line); margin-bottom: 18px; }
.apply__intro p { font-size: .9rem; color: var(--ink-soft); }

.apply__legend {
  font-size: 1.05rem;
  margin: 26px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.apply__legend:first-of-type { margin-top: 0; }

.apply .flash { display: block; }

.apply__done { text-align: center; padding: 38px 28px; }

.apply__tick {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--pine-soft);
  color: #2f5438;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
}

.apply__done h2 { margin-bottom: 8px; }
.apply__done > p { color: var(--ink-soft); font-size: .92rem; max-width: 460px; margin: 0 auto 20px; }

.apply__ref {
  background: var(--panel);
  border-radius: var(--r-md);
  padding: 18px;
  margin: 0 auto 18px;
  max-width: 320px;
}

.apply__ref small {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.apply__ref b {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: .04em;
  color: var(--coral-ink);
}

.apply__note { font-size: .84rem; color: var(--ink-soft); max-width: 460px; margin: 0 auto 22px; }
.apply__check { text-align: center; }

.apply__foot {
  text-align: center;
  font-size: .8rem;
  color: var(--ink-faint);
  line-height: 1.7;
  margin-top: 26px;
}

@media (max-width: 560px) {
  .apply__head { flex-wrap: wrap; }
  .apply__head .btn { margin-left: 0; }
}

.login__apply {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--ink-soft);
  text-align: center;
}

.login__apply a { color: var(--coral); font-weight: 500; }
.login__apply a:hover { text-decoration: underline; }

.login__noacct p { margin: 0 0 10px; }
.login__noacct + .login__noacct { margin-top: 12px; }

/* Unread count on the notification bell. */
.icon-btn__count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: .64rem;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--card);
}

/* ============================================================
   Pop-up notices (toasts)
   ============================================================ */

.toasts {
  position: fixed;
  top: 92px;              /* clear of the top bar and the bell */
  right: 26px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 340px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 14px 13px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-faint);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  animation: toast-in .22s ease-out;
}

.toast--leaving { animation: toast-out .2s ease-in forwards; }

.toast__icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink-soft);
}
.toast__icon svg { width: 15px; height: 15px; }

.toast__body { flex: 1 1 auto; min-width: 0; }
.toast__title {
  font-weight: 600;
  font-size: .86rem;
  color: var(--ink);
  line-height: 1.3;
}
.toast__text {
  font-size: .78rem;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.toast__when { font-size: .7rem; color: var(--ink-faint); margin-top: 4px; }

.toast__close {
  flex: 0 0 auto;
  background: none; border: 0; cursor: pointer;
  color: var(--ink-faint);
  font-size: 1.05rem; line-height: 1;
  padding: 2px 4px;
}
.toast__close:hover { color: var(--ink); }

.toast--info    { border-left-color: var(--pine); }
.toast--info    .toast__icon { background: var(--pine-soft); color: #2f5438; }
.toast--warning { border-left-color: var(--gold); }
.toast--warning .toast__icon { background: var(--gold-soft); color: #8a6320; }
.toast--error   { border-left-color: var(--coral); }
.toast--error   .toast__icon { background: var(--coral-soft); color: var(--coral-ink); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(18px); }
                       to   { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(18px); } }

@media (max-width: 640px) {
  .toasts { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; }
}

/* ============================================================
   Curriculum stages (Junior High / Senior High)
   ============================================================ */

.stage { margin-bottom: 42px; }
.stage--shs {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 2px solid var(--line);
}

.stage__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.stage__title {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--ink);
}
.stage__meta {
  font-size: .78rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stage__note {
  font-size: .85rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 18px;
  line-height: 1.55;
}
.stage__group {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-weight: 600;
  color: var(--coral-ink);
  margin: 22px 0 8px;
}
.stage--shs .stage__group:first-of-type { margin-top: 0; }

/* Documents an applicant must attach */
.doc-req { color: var(--coral-ink); font-weight: 600; }
.field--required input[type="file"] {
  border-color: var(--coral);
  background: rgba(226, 96, 74, .04);
}
