/* ==========================================================================
   Parent Portal — layout and components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
.shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(184, 150, 60, .17), transparent 60%),
    linear-gradient(168deg, var(--green-500) 0%, var(--green-700) 42%, var(--green-900) 100%);
  color: var(--sidebar-ink);
  border-right: 1px solid rgba(255, 255, 255, .06);
  transition: width var(--slow) var(--ease), transform var(--slow) var(--ease);
}

.sidebar::after {
  /* Gold hairline: the Egerton masthead, reduced to a single line */
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold-500) 22%, var(--gold-700) 78%, transparent);
  opacity: .5;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--topbar-h);
  padding: 0 1.25rem;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar__crest {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}

.sidebar__wordmark { min-width: 0; }
.sidebar__wordmark strong {
  display: block;
  font-family: var(--font-display);
  font-size: .9375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.sidebar__wordmark span {
  display: block;
  font-size: .6875rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold-300);
  white-space: nowrap;
}

.sidebar__scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem .75rem 1.5rem;
}
.sidebar__scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); background-clip: content-box; }

.nav-section {
  margin: 1.15rem .5rem .4rem;
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--sidebar-ink-dim);
  white-space: nowrap;
}
.nav-section:first-child { margin-top: .15rem; }

.nav-link-x {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem .7rem;
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--sidebar-ink);
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-link-x > i {
  font-size: 1.0625rem;
  width: 22px;
  flex: 0 0 22px;
  text-align: center;
  opacity: .82;
}
.nav-link-x:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link-x.is-active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.nav-link-x.is-active > i { opacity: 1; color: var(--gold-300); }
.nav-link-x.is-active::before {
  content: "";
  position: absolute;
  left: -.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--gold-400);
}
.nav-link-x__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Disclosure: a parent link that opens the pages beneath it */
.nav-link-x--parent {
  width: 100%;
  background: none;
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.nav-link-x--parent.is-current { color: #fff; }
.nav-link-x--parent.is-current > i:first-child { opacity: 1; color: var(--gold-300); }
.nav-link-x__caret {
  flex: 0 0 auto;
  font-size: .7rem !important;
  width: auto !important;
  opacity: .6;
  transition: transform var(--fast) var(--ease);
}
.nav-group.is-open .nav-link-x__caret { transform: rotate(180deg); }

.nav-sub {
  display: none;
  margin: 0 0 .35rem .95rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, .12);
}
.nav-group.is-open .nav-sub { display: block; }
.nav-link-x--sub { font-size: .8125rem; padding: .5rem .6rem; }
.nav-link-x--sub > i { font-size: .95rem; width: 18px; flex: 0 0 18px; }
.nav-link-x--sub.is-active::before { left: -1rem; }

.nav-count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 0 .35rem;
  height: 20px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  font-size: .6875rem;
  font-weight: 700;
  background: var(--gold-400);
  color: var(--green-950);
}
.nav-count.is-alert { background: var(--danger); color: #fff; }

/* Marks a menu whose page is reserved but not live yet. */
.nav-flag {
  flex: 0 0 auto;
  margin-left: -.45rem;
  padding: .05rem .3rem;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, .22);
  font-size: .5rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--sidebar-ink-dim);
}
.nav-link-x:hover .nav-flag,
.nav-link-x.is-active .nav-flag { color: #fff; border-color: rgba(255, 255, 255, .4); }

.sidebar__foot {
  flex: 0 0 auto;
  padding: .85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: .6875rem;
  color: var(--sidebar-ink-dim);
  white-space: nowrap;
}

/* Collapsed rail (desktop) */
.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.is-collapsed .sidebar__wordmark,
.is-collapsed .nav-link-x__label,
.is-collapsed .nav-count,
.is-collapsed .nav-flag,
.is-collapsed .nav-section,
.is-collapsed .sidebar__foot span { display: none; }
.is-collapsed .sidebar__brand { justify-content: center; padding: 0; }
.is-collapsed .nav-link-x { justify-content: center; padding: .65rem 0; }
.is-collapsed .nav-section { display: block; height: 1px; margin: .75rem .6rem; background: rgba(255, 255, 255, .1); color: transparent; overflow: hidden; }
.is-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* In the rail there is no room to disclose, so nested pages sit inline. */
.is-collapsed .nav-link-x__caret { display: none; }
.is-collapsed .nav-sub { display: block; margin: 0; padding: 0; border: 0; }
.is-collapsed .nav-link-x--sub > i { font-size: 1.0625rem; width: 22px; flex: 0 0 22px; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--slow) var(--ease);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300) 28%, transparent 62%);
  opacity: .55;
}

.icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.0625rem;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text-strong); }
.icon-btn.has-dot { position: relative; }
.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: .625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--surface);
  box-sizing: content-box;
}

/* Breadcrumb: the topbar states where you are; the page states what it is. */
.crumbs {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  flex: 1 1 auto;
  font-size: .8125rem;
}
.crumbs > i { font-size: .7rem; color: var(--text-faint); flex: 0 0 auto; }
.crumbs__section {
  color: var(--text-faint);
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  flex: 0 0 auto;
}
.crumbs strong {
  min-width: 0;
  font-weight: 650;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .crumbs__section, .crumbs > i { display: none; }
}

.searchbox {
  position: relative;
  flex: 0 1 300px;
  min-width: 0;
}
.searchbox i {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: .9375rem;
  pointer-events: none;
}
.searchbox input {
  width: 100%;
  height: 38px;
  padding: 0 .8rem 0 2.15rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: .875rem;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
.searchbox input::placeholder { color: var(--text-faint); }
.searchbox input:focus {
  outline: 0;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

/* Clear control.
   `type="search"` draws a native × in WebKit, nothing at all in Firefox, and
   it never reaches the app's own state — the results stay filtered until
   something dispatches an event. The portal draws its own so every browser
   behaves the same and clearing actually reloads the list. */
.searchbox input::-webkit-search-cancel-button { display: none; }
.searchbox--clearable input { padding-right: 2.1rem; }
.searchbox__clear {
  position: absolute;
  right: .3rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.searchbox__clear:hover { background: var(--surface-3); color: var(--text-strong); }
/* Undoes the positioning `.searchbox i` applies to the magnifier. */
.searchbox__clear i {
  position: static;
  transform: none;
  left: auto;
  color: inherit;
  font-size: .8125rem;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Copyable values
   -------------------------------------------------------------------------- */

/* A number with a copy button beside it. The button holds its space rather
   than appearing on hover — these sit in table cells that are scanned quickly,
   and a control that appears under the cursor is one that gets missed. */
.copyable {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-width: 0;
  max-width: 100%;
}
.copyable > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copyable__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--text-faint);
  font-size: .75rem;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.copyable__btn:hover { background: var(--primary-soft); color: var(--primary-text); }
.copyable__btn.is-copied { color: var(--success); background: transparent; }

/* --------------------------------------------------------------------------
   Learner switcher
   -------------------------------------------------------------------------- */
.switcher {
  display: flex;
  align-items: center;
  gap: .55rem;
  height: 40px;
  padding: 0 .55rem 0 .3rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  max-width: 240px;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.switcher:hover { border-color: var(--border-strong); background: var(--surface); }
.switcher__meta { min-width: 0; text-align: left; line-height: 1.15; }
.switcher__meta strong {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switcher__meta span {
  display: block;
  font-size: .6875rem;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  background: linear-gradient(145deg, var(--green-400), var(--green-600));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8125rem;
  letter-spacing: -.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.avatar--gold { background: linear-gradient(145deg, var(--gold-300), var(--gold-600)); color: var(--green-950); }
.avatar--sm { width: 28px; height: 28px; font-size: .6875rem; }
.avatar--lg { width: 56px; height: 56px; font-size: 1.25rem; }
.avatar--xl { width: 88px; height: 88px; font-size: 1.875rem; border-radius: var(--r-lg); }

/* --------------------------------------------------------------------------
   Dropdowns / menus
   -------------------------------------------------------------------------- */
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1060;
  min-width: 260px;
  max-width: min(94vw, 380px);
  padding: .4rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px) scale(.985);
  pointer-events: none;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu__head {
  padding: .6rem .7rem .5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: .3rem;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  padding: .55rem .7rem;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-size: .875rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.menu__item:hover { background: var(--surface-3); color: var(--text-strong); }
.menu__item > i { font-size: 1rem; color: var(--text-faint); width: 18px; text-align: center; }
.menu__item.is-active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.menu__item.is-active > i { color: var(--primary-text); }
.menu__item.is-danger { color: var(--danger); }
.menu__item.is-danger > i { color: var(--danger); }
.menu__sep { height: 1px; margin: .3rem .35rem; background: var(--border-subtle); }
.menu__scroll { max-height: 340px; overflow-y: auto; }

.has-menu { position: relative; }

/* --------------------------------------------------------------------------
   Content area
   -------------------------------------------------------------------------- */
.content {
  flex: 1 1 auto;
  padding: var(--gutter);
  max-width: 1560px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.page-head h2 { font-size: 1.4rem; letter-spacing: -.024em; }
.page-head p { margin: .2rem 0 0; color: var(--text-muted); font-size: .875rem; }
.page-head__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.grid { display: grid; gap: var(--gutter); }
.grid--tiles { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--aside { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); }
@media (max-width: 1180px) { .grid--aside { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card-x {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card-x__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}
.card-x__head h3 { font-size: .9375rem; font-weight: 700; letter-spacing: -.012em; }
.card-x__head p { margin: .1rem 0 0; font-size: .75rem; color: var(--text-faint); }
.card-x__body { padding: 1.15rem; }
.card-x__body--flush { padding: 0; }
.card-x__foot {
  padding: .8rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
.card-x--accent { border-top: 3px solid var(--accent); }

/* Hero card — the fee/identity band at the top of the dashboard */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 1.5rem;
  color: #fff;
  background:
    radial-gradient(110% 120% at 100% 0%, rgba(184, 150, 60, .34), transparent 58%),
    linear-gradient(140deg, var(--green-500), var(--green-700) 62%, var(--green-900));
  box-shadow: var(--shadow-md);
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -10% -60% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .09), transparent 62%);
  pointer-events: none;
}
.hero h2, .hero h3 { color: #fff; }
.hero .t-eyebrow { color: var(--gold-300); }
.hero__grid {
  position: relative;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
@media (max-width: 820px) { .hero__grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Stat tiles
   -------------------------------------------------------------------------- */
.tile {
  position: relative;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
a.tile:hover, .tile--link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.tile__icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 1.0625rem;
  background: var(--primary-soft);
  color: var(--primary-text);
}
.tile__icon--gold { background: var(--accent-soft); color: var(--accent); }
.tile__icon--info { background: var(--info-soft); color: var(--info); }
.tile__icon--warning { background: var(--warning-soft); color: var(--warning); }
.tile__icon--danger { background: var(--danger-soft); color: var(--danger); }
.tile__icon--success { background: var(--success-soft); color: var(--success); }
.tile__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .01em;
}
.tile__value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--text-strong);
  margin-top: .55rem;
}
.tile__value small { font-size: .8125rem; font-weight: 600; color: var(--text-faint); letter-spacing: 0; }
.tile__foot { margin-top: .5rem; font-size: .75rem; color: var(--text-faint); display: flex; align-items: center; gap: .35rem; }

.delta { display: inline-flex; align-items: center; gap: .2rem; font-weight: 700; font-size: .75rem; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }
.delta--flat { color: var(--text-faint); }

/* --------------------------------------------------------------------------
   Chips, badges, pills
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: var(--r-pill);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .015em;
  background: var(--surface-3);
  color: var(--text-muted);
  white-space: nowrap;
}
.chip > i { font-size: .8125rem; }
.chip--success { background: var(--success-soft); color: var(--success); }
.chip--warning { background: var(--warning-soft); color: var(--warning); }
.chip--danger  { background: var(--danger-soft); color: var(--danger); }
.chip--info    { background: var(--info-soft); color: var(--info); }
.chip--primary { background: var(--primary-soft); color: var(--primary-text); }
.chip--gold    { background: var(--accent-soft); color: var(--accent); }
.chip--outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }
.chip--lg { padding: .35rem .7rem; font-size: .75rem; }

.grade-pill {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 .4rem;
  border-radius: var(--r-xs);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .8125rem;
}
.grade-A { background: var(--success-soft); color: var(--success); }
.grade-B { background: var(--info-soft); color: var(--info); }
.grade-C { background: var(--accent-soft); color: var(--gold-600); }
.grade-D { background: var(--warning-soft); color: var(--warning); }
.grade-E { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .grade-C { color: var(--accent); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  height: 40px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn-x:active { transform: translateY(1px); }
.btn-x:disabled, .btn-x.is-loading { opacity: .62; cursor: not-allowed; transform: none; }
.btn-x > i { font-size: 1rem; }

.btn-x--primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-xs); }
.btn-x--primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--shadow-sm); }

.btn-x--gold {
  background: linear-gradient(140deg, var(--gold-400), var(--gold-600));
  color: var(--green-950);
  box-shadow: var(--shadow-xs);
}
.btn-x--gold:hover:not(:disabled) { filter: brightness(1.06); }

.btn-x--outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-x--outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-text); background: var(--primary-soft); }

.btn-x--ghost { background: transparent; color: var(--text-muted); }
.btn-x--ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text-strong); }

/* Tinted secondary button. It has a surface at rest — so it reads as a button
   rather than a link — while staying quiet enough not to compete with the
   primary action below it. */
.btn-x--soft {
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 26%, transparent);
  color: var(--primary-text);
}
.btn-x--soft:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary) 16%, var(--surface));
  border-color: var(--primary);
  color: var(--primary-text);
}

.btn-x--danger { background: var(--danger); color: #fff; }
.btn-x--danger:hover:not(:disabled) { filter: brightness(1.06); }

.btn-x--xs { height: 30px; gap: .35rem; padding: 0 .6rem; font-size: .75rem; border-radius: var(--r-xs); }
.btn-x--xs > i { font-size: .8125rem; }
.btn-x--sm { height: 33px; padding: 0 .7rem; font-size: .8125rem; border-radius: var(--r-xs); }
.btn-x--lg { height: 46px; padding: 0 1.35rem; font-size: .9375rem; }
.btn-x--block { width: 100%; }
.btn-x--icon { width: 40px; padding: 0; }

.btn-x.is-loading { position: relative; color: transparent !important; }
.btn-x.is-loading::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin .6s linear infinite;
  color: var(--primary-ink);
}
.btn-x--outline.is-loading::after, .btn-x--ghost.is-loading::after { color: var(--text); }
.btn-x--soft.is-loading::after { color: var(--primary-text); }
.btn-x--xs.is-loading::after { width: 12px; height: 12px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border-radius: var(--r-xs);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.segmented button:hover { color: var(--text-strong); }
.segmented button.is-active { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-xs); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field > label,
.field-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text);
}
/* Label plus a right-hand action. The action's own padding is pulled back so
   its text still lines up with the right edge of the input below it. */
.field__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .35rem;
}
.field__row > label { margin-bottom: 0; }

.field__hint { margin-top: .3rem; font-size: .75rem; color: var(--text-faint); }
.field__error { margin-top: .3rem; font-size: .75rem; color: var(--danger); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: .55rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  appearance: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-3); color: var(--text-faint); cursor: not-allowed; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }

/* A field the guardian reads rather than fills: the sample pages mirror forms
   the student submits, so their inputs are plain text in an input's clothing. */
.input--static {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border-style: dashed;
  color: var(--text);
  font-weight: 500;
}
.field--wide { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   Learner profile — the identity block on the front page
   -------------------------------------------------------------------------- */

/* Photo, then two columns of facts, matching the order the University's own
   student portal uses so a guardian finds the same field in the same place. */
.profile-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 1.25rem 2rem;
  align-items: start;
}
.profile-grid__photo { display: flex; flex-direction: column; align-items: center; }
.profile-grid__col { min-width: 0; }

.pfield {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: .75rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  align-items: baseline;
}
.pfield:last-child { border-bottom: 0; }

/* A whole row that is a link — the timetable type chooser uses it */
.action--link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: inherit;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.action--link:hover { border-color: var(--primary); background: var(--surface-2); }

/* One bank account on the payments page */
.bankcard {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.ecitizen-checkout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.ecitizen-checkout__header h3 { margin: 0; font-size: 1.125rem; }
.ecitizen-frame {
  display: block;
  width: 100%;
  height: min(76vh, 820px);
  min-height: 540px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.pfield__label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text-muted);
}
.pfield__value {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-grid__photo { align-items: flex-start; }
  .pfield { grid-template-columns: 7rem 1fr; }
}
@media (max-width: 768px) {
  .ecitizen-checkout__header { align-items: flex-start; flex-direction: column; }
  .ecitizen-frame { height: 72vh; min-height: 500px; }
}
.input.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }

.select {
  padding-right: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238492a3'%3E%3Cpath d='M4.5 6.2 8 9.7l3.5-3.5 1 1L8 11.7 3.5 7.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  background-size: 15px;
}

.input-group-x { display: flex; align-items: stretch; }
.input-group-x .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group-x .input-group-x__addon {
  display: grid;
  place-items: center;
  padding: 0 .8rem;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.input-group-x--lead .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-group-x--lead .input-group-x__addon { border-left: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row strong { display: block; font-size: .875rem; font-weight: 600; }
.switch-row span { display: block; font-size: .75rem; color: var(--text-faint); }

.switch { position: relative; flex: 0 0 44px; width: 44px; height: 25px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background var(--fast) var(--ease);
  pointer-events: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform var(--fast) var(--ease);
}
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(19px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--ring); }

/* Radio cards (payment channels) */
.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.option-card:hover { border-color: var(--primary); }
.option-card input { position: absolute; opacity: 0; }
.option-card__mark {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.option-card input:checked ~ .option-card__mark {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 4px var(--primary);
}
.option-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.option-card strong { display: block; font-size: .875rem; }
.option-card span { display: block; font-size: .75rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }

.table-x {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .875rem;
}
.table-x thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: .7rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: left;
  white-space: nowrap;
}
.table-x tbody td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x tbody tr { transition: background var(--fast) var(--ease); }
.table-x tbody tr:hover { background: var(--surface-2); }
.table-x tfoot td {
  padding: .8rem 1rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-strong);
}
.table-x .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-x .shrink { width: 1%; white-space: nowrap; }
.table-x--compact tbody td { padding: .55rem 1rem; }
.table-x tbody td strong { font-weight: 600; color: var(--text-strong); }

/* --------------------------------------------------------------------------
   Meters and bars
   -------------------------------------------------------------------------- */
.meter {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--green-600), var(--green-400));
  transition: width var(--slow) var(--ease);
}
.meter__fill--gold { background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); }
.meter__fill--warning { background: linear-gradient(90deg, var(--warning), var(--gold-300)); }
.meter__fill--danger { background: linear-gradient(90deg, var(--danger), var(--red-300)); }
.meter__fill--info { background: linear-gradient(90deg, var(--info), #7fc0d6); }
.meter--lg { height: 12px; }
.meter--onDark { background: rgba(255, 255, 255, .16); }
.meter--onDark .meter__fill { background: linear-gradient(90deg, var(--gold-300), var(--gold-100)); }

/* --------------------------------------------------------------------------
   Action list (dashboard "needs attention")
   -------------------------------------------------------------------------- */
.action {
  display: flex;
  gap: .9rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}
.action:last-child { border-bottom: 0; }
.action__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1rem;
}
.action--success .action__icon { background: var(--success-soft); color: var(--success); }
.action--warning .action__icon { background: var(--warning-soft); color: var(--warning); }
.action--danger  .action__icon { background: var(--danger-soft); color: var(--danger); }
.action--info    .action__icon { background: var(--info-soft); color: var(--info); }
.action__body { min-width: 0; flex: 1 1 auto; }
.action__body strong { display: block; font-size: .875rem; font-weight: 650; color: var(--text-strong); }
.action__body p { margin: .15rem 0 .5rem; font-size: .8125rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Lists and timelines
   -------------------------------------------------------------------------- */
.list-x { display: flex; flex-direction: column; }
.list-x__item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--fast) var(--ease);
}
.list-x__item:last-child { border-bottom: 0; }
a.list-x__item:hover, .list-x__item--link:hover { background: var(--surface-2); }
.list-x__item strong { font-size: .875rem; font-weight: 600; color: var(--text-strong); display: block; }
.list-x__item p { margin: .1rem 0 0; font-size: .8125rem; color: var(--text-muted); }
.list-x__when { flex: 0 0 auto; font-size: .6875rem; color: var(--text-faint); white-space: nowrap; padding-top: .15rem; }
.list-x__unread { position: relative; }
.list-x__unread::before {
  content: "";
  position: absolute;
  left: .45rem;
  top: 1.15rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: .4rem;
  bottom: .4rem;
  width: 2px;
  background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 1.15rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: .3rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
}
.timeline__item--gold::before { border-color: var(--accent); }
.timeline__item--muted::before { border-color: var(--border-strong); }

/* Chat bubbles */
.bubble { max-width: 78%; margin-bottom: .9rem; }
.bubble__body {
  padding: .75rem .95rem;
  border-radius: var(--r);
  font-size: .875rem;
  line-height: 1.55;
  white-space: pre-line;
}
.bubble__meta { margin-top: .3rem; font-size: .6875rem; color: var(--text-faint); }
.bubble--them .bubble__body { background: var(--surface-3); border-top-left-radius: var(--r-xs); }
.bubble--me { margin-left: auto; }
.bubble--me .bubble__body { background: var(--primary); color: var(--primary-ink); border-top-right-radius: var(--r-xs); }
.bubble--me .bubble__meta { text-align: right; }

/* --------------------------------------------------------------------------
   Timetable grid
   -------------------------------------------------------------------------- */
.tt-day { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.tt-day__head {
  padding: .6rem .85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tt-day.is-today .tt-day__head { background: var(--primary-soft); color: var(--primary-text); }
.tt-slot { padding: .7rem .85rem; border-bottom: 1px solid var(--border-subtle); }
.tt-slot:last-child { border-bottom: 0; }
.tt-slot__time { font-size: .6875rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.tt-slot strong { display: block; font-size: .8125rem; margin-top: .1rem; }
.tt-slot span { font-size: .75rem; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   States: empty, skeleton, error
   -------------------------------------------------------------------------- */
.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.empty__icon {
  width: 60px;
  height: 60px;
  margin: 0 auto .9rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--surface-3);
  color: var(--text-faint);
  font-size: 1.6rem;
}
.empty h4 { font-size: 1rem; margin-bottom: .3rem; }
.empty p { margin: 0 auto; max-width: 42ch; font-size: .875rem; }

.sk { position: relative; overflow: hidden; background: var(--surface-3); border-radius: var(--r-xs); }
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
  animation: sheen 1.3s infinite;
}
@keyframes sheen { 100% { transform: translateX(100%); } }
.sk--line { height: 12px; margin-bottom: .5rem; }
.sk--title { height: 20px; width: 45%; margin-bottom: .9rem; }
.sk--tile { height: 118px; border-radius: var(--r-lg); }
.sk--card { height: 260px; border-radius: var(--r-lg); }

@media (prefers-reduced-motion: reduce) {
  .sk::after { animation: none; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  width: min(370px, calc(100vw - 2rem));
}
.toast-x {
  display: flex;
  gap: .7rem;
  padding: .85rem .95rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--slow) var(--ease);
}
.toast-x.is-out { animation: toast-out var(--fast) var(--ease) forwards; }
.toast-x > i { font-size: 1.05rem; color: var(--primary); }
.toast-x strong { display: block; font-size: .875rem; }
.toast-x p { margin: .1rem 0 0; font-size: .8125rem; color: var(--text-muted); }
.toast-x--success { border-left-color: var(--success); }
.toast-x--success > i { color: var(--success); }
.toast-x--danger { border-left-color: var(--danger); }
.toast-x--danger > i { color: var(--danger); }
.toast-x--warning { border-left-color: var(--warning); }
.toast-x--warning > i { color: var(--warning); }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  animation: fade-in var(--fast) var(--ease);
}
.sheet {
  width: min(560px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  animation: sheet-in var(--slow) var(--ease);
  overflow: hidden;
}
.sheet--wide { width: min(820px, 100%); }
.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sheet__body { padding: 1.25rem; overflow-y: auto; }
.sheet__foot {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-2);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* --------------------------------------------------------------------------
   Charts
   -------------------------------------------------------------------------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font-sans); fill: var(--text-faint); font-size: 10px; }
.chart .grid-line { stroke: var(--border-subtle); stroke-width: 1; }
.chart .axis-line { stroke: var(--border); stroke-width: 1; }
.chart__legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.chart__legend span { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--text-muted); }
.chart__swatch { width: 10px; height: 10px; border-radius: 3px; }

.donut__label {
  font-family: var(--font-display);
  font-weight: 800;
  fill: var(--text-strong);
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--canvas);
}
@media (max-width: 940px) { .auth { grid-template-columns: 1fr; } }

/* The brand column fills the page so the gradient runs the whole way down,
   but its content is pinned to the viewport. Registration is a long form —
   without this the three blocks get spread across 2,000-odd pixels and the
   headline ends up marooned far below the crest. */
.auth__brand {
  position: relative;
  color: #fff;
  background:
    radial-gradient(90% 80% at 88% 6%, rgba(184, 150, 60, .3), transparent 55%),
    linear-gradient(158deg, var(--green-500), var(--green-700) 55%, var(--green-900));
}
@media (max-width: 940px) { .auth__brand { display: none; } }

.auth__brand-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 2.6rem 3rem;
}
/* Sized against the viewport so it anchors the lower half of the panel on a
   tall screen instead of leaving it flat. */
.auth__brand-inner::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -20%;
  width: clamp(360px, 52vh, 660px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: inset 0 0 140px rgba(255, 255, 255, .05);
  pointer-events: none;
}
.auth__brand-inner::before {
  content: "";
  position: absolute;
  right: 6%;
  bottom: -46%;
  width: clamp(300px, 42vh, 540px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(184, 150, 60, .12);
  pointer-events: none;
}

/* The brand lock-up is the first thing on the page, so it is sized to lead. */
.auth__brand-head { position: relative; display: flex; align-items: center; gap: 1.15rem; }
.auth__brand-head strong { font-size: 1.5rem; line-height: 1.15; letter-spacing: -.02em; }
.auth__brand-head .t-xs {
  font-size: .8125rem;
  letter-spacing: .12em;
  margin-top: .15rem;
}
/* A measured gap under the crest, rather than whatever is left over. */
.auth__brand-body { position: relative; margin-top: clamp(1.5rem, 6vh, 3.25rem); }
.auth__brand-foot { position: relative; margin-top: auto; padding-top: 1.5rem; }

.auth__brand h2 { color: #fff; font-size: 2.1rem; line-height: 1.18; letter-spacing: -.03em; max-width: 22ch; }
.auth__brand p { color: rgba(255, 255, 255, .74); max-width: 46ch; }
/* Beats the 46ch cap above, which would break the phone number onto its own line. */
.auth__brand .auth__brand-foot { max-width: none; }

/* Shorter viewports: tighten the rhythm so nothing is clipped. */
@media (max-height: 780px) {
  .auth__brand-inner { padding: 2rem 2.5rem; }
  .auth__brand-body { margin-top: 1.25rem; }
  .auth__brand h2 { font-size: 1.8rem; }
  .auth__brand-head strong { font-size: 1.25rem; }
  .auth__points { gap: .7rem; }
}

.auth__points { display: grid; gap: 1rem; position: relative; }
.auth__point { display: flex; gap: .8rem; align-items: flex-start; }
.auth__point i {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  color: var(--gold-300);
  font-size: 1rem;
}
.auth__point strong { display: block; font-size: .875rem; color: #fff; }
.auth__point span { font-size: .8125rem; color: rgba(255, 255, 255, .66); }

.auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background: var(--surface);
}
.auth__form { width: min(400px, 100%); }
.auth__logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(150deg, var(--green-500), var(--green-700));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-md);
}
/* Sign-in feedback: an account can be wrong, waiting, or refused, and each
   reads differently. */
.auth__notice {
  display: none;
  align-items: flex-start;
  gap: .65rem;
  padding: .8rem .95rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--border-strong);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: .8125rem;
}
.auth__notice.is-visible { display: flex; }
.auth__notice > i { font-size: 1rem; margin-top: .1rem; }
.auth__notice strong { display: block; color: var(--text-strong); }
.auth__notice span { display: block; color: var(--text-muted); }
.auth__notice > div > div { margin-top: .3rem; color: var(--text-faint); font-size: .75rem; }
.auth__notice--danger  { border-color: var(--danger);  background: var(--danger-soft); }
.auth__notice--danger > i { color: var(--danger); }
.auth__notice--warning { border-color: var(--warning); background: var(--warning-soft); }
.auth__notice--warning > i { color: var(--warning); }
.auth__notice--info    { border-color: var(--info);    background: var(--info-soft); }
.auth__notice--info > i { color: var(--info); }
.auth__notice--success { border-color: var(--success); background: var(--success-soft); }
.auth__notice--success > i { color: var(--success); }

.auth__divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-faint);
  font-size: .75rem;
}
.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

/* The University crest, used wherever the institution signs its name. */
.crest {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .22));
}
.crest--sm { width: 38px; height: 38px; }
.crest--lg { width: 66px; height: 66px; }
.crest--xl { width: 92px; height: 92px; }
/* Sign-in and registration lead with the crest. */
.crest--brand { width: 88px; height: 88px; }
@media (max-height: 780px) { .crest--brand { width: 68px; height: 68px; } }

.pw-toggle {
  position: absolute;
  right: .25rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-faint);
  width: 34px;
  height: 34px;
  border-radius: var(--r-xs);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-3); }

/* --------------------------------------------------------------------------
   Print — statements, receipts, transcripts
   -------------------------------------------------------------------------- */
.print-doc { display: none; }
@media print {
  .sidebar, .topbar, .toasts, .no-print { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0; max-width: none; }
  .card-x { border: 0; box-shadow: none; }
  .table-x thead th { background: #f2f2f2 !important; color: #000; }
  a[href]::after { content: ""; }
  /* Tables fit the page instead of scrolling: the Balance column was cut off. */
  .table-wrap { overflow: visible; }
  .table-x { font-size: 8.5pt; }
  .table-x thead th { position: static; padding: .35rem .45rem; letter-spacing: .02em; white-space: normal; }
  .table-x tbody td, .table-x tfoot td, .table-x--compact tbody td { padding: .3rem .45rem; }
  .table-x tr { break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--slow) var(--ease);
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .is-nav-open .sidebar { transform: none; }
  .is-nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0 !important; }
  .is-collapsed .sidebar { width: var(--sidebar-w); }
  .is-collapsed .sidebar__wordmark,
  .is-collapsed .nav-link-x__label,
  .is-collapsed .nav-flag,
  .is-collapsed .nav-count { display: revert; }
  .is-collapsed .nav-section { display: block; height: auto; margin: 1.15rem .5rem .4rem; background: none; color: var(--sidebar-ink-dim); }
  .is-collapsed .sidebar__brand { justify-content: flex-start; padding: 0 1.25rem; }
  .is-collapsed .nav-link-x { justify-content: flex-start; padding: .6rem .7rem; }
  /* The drawer is full width, so disclosures behave normally again. */
  .is-collapsed .nav-link-x__caret { display: revert; }
  .is-collapsed .nav-sub {
    display: none;
    margin: 0 0 .35rem .95rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, .12);
  }
  .is-collapsed .nav-group.is-open .nav-sub { display: block; }
  .is-collapsed .nav-link-x--sub { padding: .5rem .6rem; }
  .is-collapsed .nav-link-x--sub > i { font-size: .95rem; width: 18px; flex: 0 0 18px; }
}

@media (max-width: 768px) {
  :root { --gutter: 15px; --topbar-h: 62px; }
  .searchbox { display: none; }
  .switcher__meta { display: none; }
  .switcher { max-width: none; padding-right: .3rem; }
  .page-head h2 { font-size: 1.2rem; }
  .tile__value { font-size: 1.4rem; }
  .hero { padding: 1.15rem; }
  .bubble { max-width: 92%; }
}

/* --------------------------------------------------------------------------
   Administration
   -------------------------------------------------------------------------- */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .4rem;
  vertical-align: 1px;
}
.status-dot--pending { background: var(--warning); }
.status-dot--approved { background: var(--success); }
.status-dot--rejected { background: var(--danger); }
.status-dot--suspended { background: var(--text-faint); }

.queue-row { cursor: pointer; }
.queue-row.is-selected { background: var(--primary-soft) !important; }

/* Registration form: learner rows the applicant can add and remove. */
.learner-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}
.learner-row .input { flex: 1 1 auto; text-transform: uppercase; }
.learner-row .input::placeholder { text-transform: none; }

.steps {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.5rem;
  font-size: .75rem;
}
.steps__item {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.steps__item.is-active { color: var(--primary-text); font-weight: 600; }
.steps__item.is-done { color: var(--success); }
.steps__num {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: .6875rem;
  font-weight: 700;
}
.steps__item.is-active .steps__num { background: var(--primary); border-color: var(--primary); color: #fff; }
.steps__item.is-done .steps__num { background: var(--success); border-color: var(--success); color: #fff; }
.steps__rule { flex: 1 1 auto; height: 1px; background: var(--border); min-width: 12px; }
