/* ===========================================================================
   DEUTSCH SPRACHE  --  DS-SMS design system
   ---------------------------------------------------------------------------
   Brand:  Crimson #B60E1C   Charcoal #22201E   Golden Yellow #F3B800
   Font:   Poppins, bundled in assets/fonts (SIL Open Font License). No CDNs:
           the portal runs fully offline.
   =========================================================================== */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

/* ---------- 1. TOKENS ---------- */
:root {
  /* brand */
  --charcoal:      #22201E;
  --charcoal-700:  #312E2B;
  --charcoal-600:  #46423D;
  --red:           #B60E1C;
  --red-dark:      #920A16;
  --red-soft:      #FBECEE;
  --yellow:        #F3B800;
  --yellow-soft:   #FFF6DE;

  /* neutrals: warm off-white page, white cards */
  --bg:            #F8F4F1;
  --surface:       #FFFFFF;
  --surface-2:     #FAF7F5;
  --line:          #EDE6E1;
  --line-strong:   #DDD3CC;
  --ink:           #22201E;
  --ink-2:         #55504A;
  --muted:         #837B72;
  --muted-2:       #A29A91;

  /* sidebar: a white card floating on the page */
  --side-bg:       #FFFFFF;
  --side-line:     #EFE8E3;
  --side-ink:      #4A443F;
  --side-muted:    #7D746B;
  --side-hover:    #F8F1EE;
  --side-active:   var(--red);

  /* semantic */
  --ok:            #10815A;
  --ok-soft:       #E6F5EF;
  --warn:          #B97E00;
  --warn-soft:     #FFF4DD;
  --bad:           #C62011;
  --bad-soft:      #FDECEA;
  --info:          #1F6FB2;
  --info-soft:     #E9F2FA;

  /* stat tiles */
  --tile-green:    #2FA46E;
  --tile-amber:    #EBA028;
  --tile-blue:     #3B7BE6;

  /* shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(34,32,30,.04);
  --shadow-md: 0 2px 4px rgba(34,32,30,.04), 0 8px 24px rgba(34,32,30,.07);
  --shadow-lg: 0 12px 48px rgba(34,32,30,.16);

  --sidebar-w: 252px;
  --topbar-h: 68px;
  --gap-shell: 14px;   /* space around the floating sidebar and topbar */

  --font: "Poppins", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

/* ---------- 2. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
.icon { flex: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--charcoal); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 3. SHELL ---------- */
.shell { min-height: 100vh; }
.shell--centered {
  display: grid; place-items: center; padding: 2rem 1rem;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(243,184,0,.16), transparent 62%),
    radial-gradient(900px 560px at 95% 8%, rgba(182,14,28,.10), transparent 60%),
    var(--bg);
}

.main {
  margin-left: calc(var(--sidebar-w) + var(--gap-shell) * 2);
  padding-right: var(--gap-shell);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 4. SIDEBAR ---------- */
.sidebar {
  position: fixed; top: var(--gap-shell); bottom: var(--gap-shell); left: var(--gap-shell);
  width: var(--sidebar-w);
  background: var(--side-bg);
  color: var(--side-ink);
  display: flex; flex-direction: column;
  z-index: 60;
  border: 1px solid var(--side-line);
  border-radius: var(--r-xl);
  box-shadow: 0 1px 2px rgba(34,32,30,.03), 0 12px 32px rgba(34,32,30,.05);
  overflow: hidden;
}
.sidebar__brand {
  display: flex; align-items: center; gap: .7rem;
  height: var(--topbar-h);          /* lines up with the topbar's bottom edge */
  padding: 0 1.1rem;
  border-bottom: 1px solid var(--side-line);
}
.sidebar__brand .brand-logo { width: 48px; height: 48px; }
/* the institute logo: assets/img/logo.png, see brand_logo() */
.brand-logo { display: block; flex: none; width: 46px; height: 46px; object-fit: contain; }
.brand-logo--disc {
  background: #fff; border-radius: 50%; padding: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,.28);
}
.sidebar__brandtext { display: flex; flex-direction: column; min-width: 0; }
.sidebar__brandtext strong { font-size: .92rem; font-weight: 600; letter-spacing: -.01em; color: var(--charcoal); }
.sidebar__brandtext span   { font-size: .64rem; color: var(--side-muted); letter-spacing: .08em; text-transform: uppercase; }
.sidebar__close { display: none; margin-left: auto; background: none; border: 0; color: inherit; padding: .35rem; cursor: pointer; }

.nav {
  flex: 1; overflow-y: auto; padding: .6rem .75rem 1rem; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: .15rem;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(34,32,30,.18); border-radius: 3px; }

.nav__title {
  font-size: .63rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--side-muted);
  padding: .85rem .8rem .4rem;
}
.nav__link {
  position: relative;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .8rem;
  border-radius: 12px;
  color: var(--side-ink);
  font-size: .86rem; font-weight: 500;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.nav__link:hover { background: var(--side-hover); color: var(--charcoal); }
.nav__link--active {
  background: var(--side-active); color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(182,14,28,.24);
}
.nav__link--active:hover { background: var(--red-dark); color: #fff; }
.nav__icon  { display: grid; place-items: center; color: var(--side-muted); transition: color .14s ease; }
.nav__link:hover .nav__icon   { color: var(--charcoal); }
.nav__link--active .nav__icon,
.nav__link--active:hover .nav__icon { color: #fff; }
.nav__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__pill {
  flex: none; min-width: 20px; height: 20px; padding: 0 .4rem;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--red); color: #fff;
  font-size: .66rem; font-weight: 700;
}
.nav__link--active .nav__pill { background: #fff; color: var(--red); }

/* a group that folds open: "Register a student", "Students" */
.nav__group > summary { list-style: none; cursor: pointer; user-select: none; }
.nav__group > summary::-webkit-details-marker { display: none; }
.nav__caret { display: grid; color: var(--side-muted); transition: transform .18s ease; }
.nav__group[open] > summary .nav__caret { transform: rotate(180deg); }
.nav__group[open] > summary .nav__pill { display: none; }   /* the link inside shows the count */
.nav__group--current > summary { color: var(--charcoal); font-weight: 600; }
.nav__group--current > summary .nav__icon { color: var(--red); }
.nav__sub {
  display: grid; gap: .1rem;
  margin: .15rem 0 .3rem 1.45rem; padding-left: .7rem;
  border-left: 1.5px solid var(--side-line);
}
.nav__link--sub { padding: .5rem .75rem; font-size: .83rem; }

.sidebar__foot { padding: .6rem .75rem; border-top: 1px solid var(--side-line); }
.sidebar__version { padding: .5rem .8rem 0; font-size: .66rem; color: var(--side-muted); }

.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(34,32,30,.5);
  z-index: 55; backdrop-filter: blur(2px);
}

/* ---------- 5. TOPBAR ---------- */
.topbar {
  position: sticky; top: var(--gap-shell); z-index: 40;
  height: var(--topbar-h);
  margin-top: var(--gap-shell);
  display: flex; align-items: center; gap: .9rem;
  padding: 0 1rem 0 1.4rem;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(170%) blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 1px 2px rgba(34,32,30,.03), 0 8px 24px rgba(34,32,30,.04);
}
.topbar__menu {
  display: none; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--ink);
}
.topbar__title {
  flex: none; font-size: 1.14rem; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis;
}
.searchbox { position: relative; flex: 0 1 330px; min-width: 150px; margin-left: auto; }
.searchbox__icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); pointer-events: none;
}
.searchbox input {
  width: 100%; height: 40px;
  padding: 0 1rem 0 2.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: .85rem;
  transition: border-color .15s, box-shadow .15s;
}
.searchbox input::placeholder { color: var(--muted-2); }
.searchbox input:focus {
  outline: none; border-color: var(--charcoal);
  box-shadow: 0 0 0 3px rgba(34,32,30,.07);
}

.topbar__right { display: flex; align-items: center; gap: .6rem; }

.topbar__icon {
  position: relative;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  transition: background .14s;
}
.topbar__icon:hover { background: var(--surface-2); }
.topbar__search { display: none; }   /* phones: an icon instead of the search box */
.topbar__count {
  position: absolute; top: 2px; right: 0;
  min-width: 19px; height: 19px; padding: 0 .3rem;
  display: grid; place-items: center;
  border-radius: var(--r-pill); background: var(--red); color: #fff;
  font-size: .62rem; font-weight: 700; box-shadow: 0 0 0 2px var(--surface);
}

.usermenu { position: relative; padding-left: .7rem; border-left: 1px solid var(--line); }
.usermenu__trigger {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .45rem .3rem .3rem;
  border: 0; border-radius: var(--r-pill);
  background: transparent; cursor: pointer;
  transition: background .14s;
}
.usermenu__trigger:hover { background: var(--surface-2); }
.usermenu__trigger .avatar { background: var(--red); }
.usermenu__chevron { color: var(--muted); }
.usermenu__meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.usermenu__meta strong { font-size: .82rem; font-weight: 600; }
.usermenu__meta small  { font-size: .7rem; color: var(--muted); }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + .5rem);
  min-width: 196px; padding: .35rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  z-index: 50;
}
.usermenu__panel a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .65rem; border-radius: var(--r-sm);
  font-size: .84rem; color: var(--ink-2);
}
.usermenu__panel a:hover { background: var(--surface-2); color: var(--ink); }
.usermenu__danger { color: var(--bad) !important; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--charcoal); color: #fff;
  font-weight: 650; font-size: .82rem; letter-spacing: .02em;
}
.avatar--sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar--lg { width: 60px; height: 60px; font-size: 1.15rem; border-radius: 18px; }
.avatar--red    { background: linear-gradient(145deg, var(--red), var(--red-dark)); }
.avatar--yellow { background: linear-gradient(145deg, var(--yellow), #D9A300); color: var(--charcoal); }

/* ---------- 6. CONTENT + PAGE HEADER ---------- */
.content { flex: 1; padding: 1.4rem 0 2.5rem; max-width: 1600px; width: 100%; }

.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem;
}
.pagehead__title { font-size: 1.62rem; letter-spacing: -.028em; }
.pagehead__sub   { color: var(--muted); font-size: .87rem; margin-top: .2rem; }
.pagehead__actions { display: flex; gap: .55rem; flex-wrap: wrap; }

.crumbs { display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--muted); margin-bottom: .4rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }
.crumbs i { font-style: normal; color: var(--muted-2); }

.footer {
  padding: 1.3rem .3rem; border-top: 1px solid var(--line);
  color: var(--muted-2); font-size: .74rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* ---------- 7. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: 38px; padding: 0 .95rem;
  border: 1px solid transparent; border-radius: 10px;
  font-size: .845rem; font-weight: 600; white-space: nowrap;
  cursor: pointer; transition: background .14s, border-color .14s, color .14s, transform .06s, box-shadow .14s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 2px 6px rgba(182,14,28,.22); }
.btn--primary:hover { background: var(--red-dark); }
.btn--dark    { background: var(--charcoal); color: #fff; }
.btn--dark:hover { background: var(--charcoal-700); }
.btn--accent  { background: var(--yellow); color: var(--charcoal); }
.btn--accent:hover { background: #DFA800; }
.btn--ghost   { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--muted-2); color: var(--ink); }
.btn--danger  { background: var(--bad-soft); color: var(--bad); border-color: #F6C9C3; }
.btn--danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn--ok      { background: var(--ok-soft); color: var(--ok); border-color: #BEE3D5; }
.btn--ok:hover { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn--sm { height: 31px; padding: 0 .65rem; font-size: .775rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--lg { height: 46px; padding: 0 1.4rem; font-size: .92rem; border-radius: 12px; }

.btn-group { display: inline-flex; gap: .35rem; }

/* ---------- 8. CARDS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--line);
}
.card__title { font-size: 1rem; font-weight: 600; }
.card__sub   { font-size: .76rem; color: var(--muted); margin-top: .1rem; }
.card__body  { padding: 1.25rem 1.35rem; }
.card__body--flush { padding: 0; }
.card__foot  {
  padding: .85rem 1.2rem; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg);
  display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap;
}
.card--accent { border-top: 3px solid var(--yellow); }

/* ---------- 9. GRID ---------- */
.grid { display: grid; gap: 1rem; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2.05fr) minmax(300px, 1fr); align-items: start; }
.grid--detail { grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }

/* Grid and stack children must never push their track wider than the layout. */
.grid > *, .stack > * { min-width: 0; }
@media (max-width: 1080px) {
  .grid--main, .grid--detail { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 10. STAT TILES ---------- */
.stat {
  position: relative; overflow: hidden;
  padding: 1.3rem 1.35rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.stat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.stat__label { font-size: .8rem; color: var(--ink-2); font-weight: 500; padding-top: .35rem; }
.stat__icon {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; background: #F3EEEA; color: var(--ink-2);
}
.stat__value { font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; margin-top: .45rem; line-height: 1.15; }
.stat__value small { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: .25rem; }
.stat__foot { margin-top: .45rem; font-size: .76rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.stat__foot a { color: var(--red); font-weight: 600; }
.stat--red    .stat__icon { background: var(--red);        color: #fff; }
.stat--yellow .stat__icon { background: var(--tile-amber); color: #fff; }
.stat--ok     .stat__icon { background: var(--tile-green); color: #fff; }
.stat--info   .stat__icon { background: var(--tile-blue);  color: #fff; }
.stat--dark   .stat__icon { background: var(--charcoal);   color: #fff; }

.trend { font-weight: 650; }
.trend--up   { color: var(--ok); }
.trend--down { color: var(--bad); }

/* ---------- 11. TABLES ---------- */
.table-wrap { overflow-x: auto; }
.table { font-size: .855rem; min-width: 560px; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: .7rem; font-weight: 700;
  letter-spacing: .085em; text-transform: uppercase; color: var(--muted);
  padding: .72rem 1.2rem; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: .78rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table__num   { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table__tight { width: 1%; white-space: nowrap; }
.table__actions { display: flex; gap: .3rem; justify-content: flex-end; }
.table a.link { color: var(--ink); font-weight: 600; }
.table a.link:hover { color: var(--red); }
/* Compact tables live inside narrow side panels, so they must be able to shrink. */
.table--compact { min-width: 0; }
.table--compact tbody td, .table--compact thead th { padding-top: .55rem; padding-bottom: .55rem; }

.cell-person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.cell-person__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-person__meta { font-size: .73rem; color: var(--muted); }

.mono { font-family: var(--mono); font-size: .8rem; letter-spacing: -.01em; }

/* ---------- 12. BADGES / PILLS ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: var(--r-pill);
  font-size: .715rem; font-weight: 650; white-space: nowrap;
  border: 1px solid transparent;
}
.badge--ok      { background: var(--ok-soft);   color: var(--ok);   border-color: #C3E5D7; }
.badge--warn    { background: var(--warn-soft); color: var(--warn); border-color: #F2DFB3; }
.badge--bad     { background: var(--bad-soft);  color: var(--bad);  border-color: #F7CEC9; }
.badge--neutral { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

.level-pill {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 24px; padding: 0 .45rem;
  border-radius: 7px; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  background: var(--charcoal); color: #fff;
}
.level-pill--a1 { background: #E8F1FB; color: #1F6FB2; }
.level-pill--a2 { background: #E6F5EF; color: #10815A; }
.level-pill--b1 { background: var(--yellow-soft); color: #9C7400; }
.level-pill--b2 { background: #FBEDE6; color: #B45309; }
.level-pill--c1 { background: var(--red-soft);    color: var(--red-dark); }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .745rem; color: var(--ink-2);
}
.chip--on { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }

/* ---------- 13. FORMS ---------- */
.form { display: grid; gap: 1.05rem; }
.form-grid { display: grid; gap: 1.05rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.field { display: grid; gap: .35rem; min-width: 0; align-content: start; }
.field--full { grid-column: 1 / -1; }
.label { font-size: .785rem; font-weight: 600; color: var(--ink-2); }
.label .req { color: var(--red); margin-left: .12rem; }
.hint  { font-size: .73rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 .8rem;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: .87rem;
  transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; min-height: 96px; padding: .65rem .8rem; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23837B72' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 3px rgba(34,32,30,.08);
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input--error { border-color: var(--bad); }
.input-affix { position: relative; }
.input-affix__suffix {
  position: absolute; right: .85rem; top: 50%; transform: translateY(-50%);
  font-size: .78rem; font-weight: 650; color: var(--muted); pointer-events: none;
}
.input-affix .input { padding-right: 3.2rem; }

.radio-row { display: flex; gap: .55rem; flex-wrap: wrap; }
.radio-card {
  position: relative; flex: 1 1 120px;
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem .8rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); font-size: .83rem; font-weight: 500;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card__dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 1.6px solid var(--line-strong); transition: border-color .14s, box-shadow .14s;
}
.radio-card:hover { border-color: var(--muted-2); }
.radio-card:has(input:checked) {
  border-color: var(--charcoal); background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--charcoal);
}
.radio-card:has(input:checked) .radio-card__dot {
  border-color: var(--red); box-shadow: inset 0 0 0 4px var(--red);
}

.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .84rem; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: .12rem; accent-color: var(--red); flex: none; }

.form-actions {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
}
.form-actions--split { justify-content: space-between; }

fieldset.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 1.05rem; }
.fieldset__legend {
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); padding-bottom: .55rem; border-bottom: 1px solid var(--line); width: 100%;
}

/* ---------- 14. ALERTS ---------- */
.alert {
  display: flex; align-items: flex-start; gap: .65rem;
  padding: .8rem 1rem; margin-bottom: 1rem;
  border-radius: var(--r-md); border: 1px solid;
  font-size: .855rem;
}
.alert p { flex: 1; }
.alert__icon { margin-top: .08rem; }
.alert__close { background: none; border: 0; cursor: pointer; color: inherit; opacity: .55; padding: 0; }
.alert__close:hover { opacity: 1; }
.alert--success { background: var(--ok-soft);   border-color: #C3E5D7; color: #0B6446; }
.alert--danger  { background: var(--bad-soft);  border-color: #F7CEC9; color: #9E190D; }
.alert--warning { background: var(--warn-soft); border-color: #F2DFB3; color: #8A5E00; }
.alert--info    { background: var(--info-soft); border-color: #CBE0F1; color: #15537F; }

/* ---------- 15. TOOLBAR / FILTERS ---------- */
.toolbar {
  display: flex; gap: .55rem; flex-wrap: wrap; align-items: center;
  padding: .85rem 1.2rem; border-bottom: 1px solid var(--line);
  background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.toolbar .input, .toolbar .select { height: 36px; font-size: .82rem; }
.toolbar__search { flex: 1; min-width: 190px; max-width: 320px; }
.toolbar__spacer { flex: 1; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs__item {
  padding: .65rem .95rem; font-size: .84rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .14s, border-color .14s;
}
.tabs__item:hover { color: var(--ink); }
.tabs__item--active { color: var(--ink); border-bottom-color: var(--red); }
.tabs__count {
  display: inline-block; margin-left: .35rem; padding: 0 .35rem;
  border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--line); font-size: .7rem; color: var(--muted);
}

/* ---------- 16. PAGINATION ---------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding: .9rem 1.2rem; border-top: 1px solid var(--line);
}
.pager__info  { font-size: .77rem; color: var(--muted); }
.pager__links { display: flex; gap: .3rem; }
.pager__btn {
  min-width: 33px; height: 33px; padding: 0 .55rem;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--ink-2);
}
.pager__btn:hover { background: var(--surface-2); border-color: var(--muted-2); }
.pager__btn--active { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }

/* ---------- 17. EMPTY STATE ---------- */
.empty { padding: 3.2rem 1.5rem; text-align: center; }
.empty__icon {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto .85rem;
  border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted-2);
}
.empty__title { font-size: 1rem; }
.empty__text  { color: var(--muted); font-size: .85rem; margin-top: .3rem; max-width: 34rem; margin-inline: auto; }
/* inside a card: a dashed box, no icon */
.empty--boxed {
  margin: 1.1rem 1.35rem 1.35rem; padding: 2.2rem 1.2rem;
  border: 1px dashed var(--line-strong); border-radius: 16px;
}
.empty--boxed .empty__icon { display: none; }
.empty--boxed .empty__title { font-size: .95rem; }

/* ---------- 18. DEFINITION LISTS ---------- */
.dl { display: grid; gap: .1rem; }
.dl__row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .62rem 0; border-bottom: 1px dashed var(--line);
}
.dl__row:last-child { border-bottom: 0; }
.dl__key { font-size: .8rem; color: var(--muted); flex: none; }
.dl__val { font-size: .855rem; font-weight: 550; text-align: right; min-width: 0; word-break: break-word; }
.dl__val--lg { font-size: 1.05rem; font-weight: 700; }

/* ---------- 19. TIMELINE ---------- */
.timeline { position: relative; padding-left: 1.55rem; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: .4rem; bottom: .4rem;
  width: 2px; background: var(--line);
}
.timeline__item { position: relative; padding-bottom: 1.1rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -1.55rem; top: .3rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line-strong);
}
.timeline__item--done::before  { border-color: var(--ok);  background: var(--ok); box-shadow: inset 0 0 0 2px var(--surface); }
.timeline__item--now::before   { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 2px var(--surface); }
.timeline__title { font-size: .865rem; font-weight: 600; }
.timeline__meta  { font-size: .745rem; color: var(--muted); margin-top: .1rem; }

/* ---------- 20. PROGRESS ---------- */
.progress { height: 7px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.progress__bar { height: 100%; border-radius: var(--r-pill); background: var(--ok); transition: width .4s ease; }
.progress__bar--warn { background: var(--yellow); }
.progress__bar--bad  { background: var(--red); }

/* ---------- 21. MODAL ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 1.2rem;
  background: rgba(34,32,30,.52); backdrop-filter: blur(3px);
}
.modal__box {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: pop .16s ease-out;
}
.modal__box--wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line);
}
.modal__body { padding: 1.3rem; }
.modal__foot {
  padding: 1rem 1.3rem; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl);
  display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap;
}

/* ---------- 22. AUTH / PUBLIC PAGES ---------- */
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  padding: 2rem 1.9rem;
}
.auth-card__brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.6rem; }
.auth-card__brand .brand-logo { width: 58px; height: 58px; }
.auth-card__brand div { display: flex; flex-direction: column; }
.auth-card__brand strong { font-size: 1rem; }
.auth-card__brand span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.auth-card__title { font-size: 1.35rem; letter-spacing: -.025em; }
.auth-card__hint  { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.auth-card .form  { margin-top: 1.4rem; }

.demo-logins {
  margin-top: 1.4rem; padding: .85rem 1rem;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  font-size: .76rem; color: var(--muted);
}
.demo-logins strong { color: var(--ink-2); display: block; margin-bottom: .35rem; font-size: .74rem; }
.demo-logins code { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }
.demo-logins button {
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--red);
  font: inherit; font-size: .73rem; font-weight: 650; text-decoration: underline;
}

/* public wrapper */
.public { max-width: 900px; margin: 0 auto; padding: 2.2rem 1.2rem 4rem; }
.public__header { text-align: center; margin-bottom: 2rem; }
.public__header .brand-logo { width: 108px; height: 108px; margin: 0 auto .9rem; }
.public__title { font-size: 2rem; letter-spacing: -.035em; }
.public__sub   { color: var(--muted); margin-top: .45rem; }
.public__strip {
  display: flex; justify-content: center; gap: .45rem; flex-wrap: wrap; margin-top: 1rem;
}

.fee-box {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.15rem; border-radius: var(--r-md);
  background: var(--yellow-soft); border: 1px solid #F2DFB3;
}
.fee-box__label { font-size: .775rem; color: #8A5E00; font-weight: 600; }
.fee-box__value { font-size: 1.5rem; font-weight: 750; letter-spacing: -.03em; color: var(--charcoal); }

/* ---------- 23. CHART CONTAINERS ---------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart__legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .85rem; }
.chart__legend span { display: inline-flex; align-items: center; gap: .4rem; font-size: .765rem; color: var(--muted); }
.chart__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart-tip {
  position: absolute; z-index: 20; pointer-events: none;
  padding: .3rem .6rem; border-radius: 7px;
  background: var(--charcoal); color: #fff;
  font-size: .745rem; font-weight: 650; white-space: nowrap;
  transform: translate(-50%, -140%); opacity: 0; transition: opacity .12s;
  box-shadow: var(--shadow-md);
}
.chart-tip--on { opacity: 1; }

/* ---------- 24. RECEIPT / CERTIFICATE DOCUMENTS ---------- */
.doc-page {
  background: var(--surface);
  max-width: 820px; margin: 1.4rem auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.doc-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.8rem 2rem; background: var(--charcoal); color: #fff;
}
.doc-head__brand { display: flex; align-items: center; gap: .85rem; }
.doc-head__brand .brand-logo { width: 62px; height: 62px; }
.doc-head__brand strong { font-size: 1.15rem; display: block; }
.doc-head__brand span { font-size: .75rem; color: rgba(255,255,255,.65); }
.doc-head__meta { text-align: right; }
.doc-kicker {
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--yellow); font-weight: 700;
}
.doc-no { font-family: var(--mono); font-size: 1rem; font-weight: 700; margin-top: .15rem; }
.doc-body { padding: 2rem; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.4rem 2rem; }
.doc-field__label {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.doc-field__value { font-size: .95rem; font-weight: 600; margin-top: .18rem; }
.doc-total {
  margin-top: 1.8rem; padding-top: 1.3rem; border-top: 2px solid var(--charcoal);
}
.doc-total__row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .9rem; }
.doc-total__row--big {
  font-size: 1.25rem; font-weight: 750; letter-spacing: -.02em;
  padding: .85rem 1rem; margin-top: .6rem; border-radius: var(--r-md);
  background: var(--yellow-soft); border: 1px solid #F2DFB3;
}
.doc-foot {
  padding: 1.3rem 2rem; border-top: 1px dashed var(--line-strong);
  background: var(--surface-2); font-size: .76rem; color: var(--muted);
  display: flex; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
}
.doc-stamp {
  display: inline-block; padding: .35rem .85rem; border: 2px solid var(--ok); color: var(--ok);
  border-radius: 7px; font-weight: 800; letter-spacing: .1em; font-size: .72rem; text-transform: uppercase;
  transform: rotate(-3deg);
}
.doc-stamp--void { border-color: var(--bad); color: var(--bad); }
.doc-stamp--warn { border-color: var(--warn); color: var(--warn); }
.qr { image-rendering: pixelated; border: 6px solid #fff; background: #fff; }

/* certificate */
.cert {
  max-width: 980px; margin: 1.4rem auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: 3.2rem 3rem; text-align: center; position: relative; overflow: hidden;
}
.cert::before, .cert::after {
  content: ""; position: absolute; left: 0; right: 0; height: 9px;
  background: linear-gradient(90deg, var(--charcoal) 0 33.3%, var(--red) 33.3% 66.6%, var(--yellow) 66.6% 100%);
}
.cert::before { top: 0; }
.cert::after  { bottom: 0; }
.cert .brand-logo { width: 120px; height: 120px; margin: 0 auto 1.1rem; }
.cert__kicker { font-size: .78rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.cert__title  { font-size: 2.5rem; letter-spacing: -.035em; margin: .5rem 0 1.5rem; }
.cert__name   {
  font-size: 2.1rem; font-weight: 700; letter-spacing: -.025em;
  padding-bottom: .6rem; margin: .6rem auto 1.3rem; max-width: 30rem;
  border-bottom: 2px solid var(--yellow);
}
.cert__text   { color: var(--ink-2); max-width: 36rem; margin: 0 auto; line-height: 1.75; }
.cert__course { font-weight: 700; color: var(--red); }
.cert__sign   { display: flex; justify-content: space-between; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.cert__sign div { flex: 1; min-width: 180px; }
.cert__sign hr  { border: 0; border-top: 1.5px solid var(--charcoal); margin-bottom: .45rem; }
.cert__sign span { font-size: .76rem; color: var(--muted); }

/* ---------- 24b. DASHBOARD ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) 420px;
  min-height: 276px; margin-bottom: 1.7rem;
  border-radius: var(--r-xl);
  background:
    radial-gradient(640px 360px at 6% -25%, rgba(255,255,255,.14), transparent 62%),
    radial-gradient(560px 340px at 100% 125%, rgba(0,0,0,.20), transparent 60%),
    var(--red);
  color: #fff;
  box-shadow: 0 16px 36px rgba(182,14,28,.22);
}
.hero__text { position: relative; z-index: 1; padding: 2rem 2.3rem 2.2rem; }
.hero__kicker {
  display: flex; align-items: center; gap: .45rem;
  font-size: .7rem; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; color: rgba(255,255,255,.92);
}
.hero__title { margin-top: .75rem; font-size: 2.3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.12; }
.hero__sub   { margin-top: .6rem; font-size: .94rem; color: rgba(255,255,255,.9); max-width: 40rem; }
.hero__actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero__btn {
  display: inline-flex; align-items: center; gap: .5rem;
  height: 48px; padding: 0 1.5rem; border: 1.5px solid #fff; border-radius: var(--r-pill);
  font-size: .9rem; font-weight: 600; white-space: nowrap;
  transition: background .14s, color .14s, transform .06s;
}
.hero__btn:active { transform: translateY(1px); }
.hero__btn--solid { background: #fff; color: var(--red); }
.hero__btn--solid:hover { background: #FFF0F1; }
.hero__btn--ghost { color: #fff; }
.hero__btn--ghost:hover { background: rgba(255,255,255,.12); }

/* the artwork: people standing on the banner's bottom edge, with stickers */
.hero__art { position: relative; }
.hero__art img {
  position: absolute; right: 16px; bottom: 0;
  width: calc(100% + 30px); height: 97%; max-width: none;
  object-fit: contain; object-position: right bottom;   /* any photo or drawing fits its corner */
}
/* a cut-out photo runs into the banner's right and bottom edges, a halo behind the heads */
.hero__art--photo img { right: 0; height: 94%; }
.hero__art--photo::before {
  content: ""; position: absolute; right: 7%; top: 8%;
  width: 72%; aspect-ratio: 1; border-radius: 50%;
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 22px rgba(255,255,255,.045);
}
.hero__art--photo .hero__sticker--hello { left: -34px; }
.hero__sticker {
  position: absolute; z-index: 2; padding: .38rem .95rem;
  border-radius: 12px; background: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.2);
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: .95rem; font-weight: 700; white-space: nowrap;
}
.hero__sticker--hello    { top: 26px; left: 4px; color: var(--red); transform: rotate(-8deg); }
.hero__sticker--together { right: 20px; bottom: 30px; color: var(--charcoal); transform: rotate(-6deg); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 .15rem .9rem; }
.section-head h2 { font-size: 1.2rem; font-weight: 600; }
.quiet-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.quiet-link:hover { color: var(--red); }
.more-link { display: inline-flex; align-items: center; gap: .2rem; font-size: .84rem; font-weight: 500; color: var(--red); white-space: nowrap; }
.more-link:hover { color: var(--red-dark); }

.tag-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: 1rem 1.35rem 0; font-size: .8rem; color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; padding: .14rem .62rem; border-radius: var(--r-pill); font-size: .75rem; font-weight: 500; }
.tag--green { background: var(--ok-soft);   color: var(--ok); }
.tag--amber { background: var(--warn-soft); color: var(--warn); }
.tag--red   { background: var(--red-soft);  color: var(--red); }

.session-list { display: grid; gap: .6rem; padding: 1rem 1.35rem 1.3rem; }
.session { display: flex; align-items: center; gap: .85rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 14px; }
.session__time {
  display: grid; place-items: center; flex: none; width: 62px; height: 46px;
  border-radius: 12px; background: var(--red-soft); color: var(--red);
  font-size: .84rem; font-weight: 600; line-height: 1.1; text-align: center;
}
.session__time small { display: block; font-size: .62rem; font-weight: 500; opacity: .8; }
.session__body   { flex: 1; min-width: 0; }
.session__name   { font-size: .87rem; font-weight: 600; }
.session__meta   { font-size: .74rem; color: var(--muted); }
.session__levels { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 1240px) {
  .hero { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero__art { display: none; }
  .hero__text { padding: 1.6rem 1.4rem 1.7rem; }
  .hero__title { font-size: 1.75rem; }
}

/* ---------- 24c. APPLICATION LINK ---------- */
.linkbox {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1rem; border: 1.5px dashed var(--line-strong); border-radius: 14px;
  background: var(--surface-2);
}
.linkbox__icon {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px;
  border-radius: 50%; background: var(--red-soft); color: var(--red);
}
.linkbox__url { min-width: 0; font-family: var(--mono); font-size: .84rem; word-break: break-all; user-select: all; }
.msg-preview {
  white-space: pre-wrap; word-break: break-word;
  padding: .9rem 1rem; border-radius: 14px; background: var(--surface-2);
  font-size: .8rem; line-height: 1.6; color: var(--ink-2);
}
.sent-list { list-style: none; margin: 0; padding: 0; }   /* block, so long addresses shrink instead of widening the card */
.sent-list__row { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.sent-list__row:last-child { border-bottom: 0; }
.sent-list__icon {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px;
  border-radius: 50%; background: var(--ok-soft); color: var(--ok);
}
.sent-list__icon--email { background: var(--info-soft); color: var(--info); }
.sent-list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sent-list__body strong,
.sent-list__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sent-list__body strong { font-size: .84rem; font-weight: 600; }
.sent-list__body small  { font-size: .72rem; color: var(--muted); }

/* ---------- 24d. CLASSES: LEVEL AND CLASS TIME PICKER ---------- */
.slot-count {
  display: inline-grid; place-items: center; flex: none;
  min-width: 26px; height: 24px; padding: 0 .45rem;
  border-radius: var(--r-pill); background: var(--surface-2);
  font-size: .74rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}

.level-tabs { display: flex; flex-wrap: wrap; gap: .6rem; }
.level-tab {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.05rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  font-size: .92rem; font-weight: 700; color: var(--ink-2);
  transition: border-color .14s, background .14s;
}
.level-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.level-tab--on, .level-tab--on:hover { background: var(--red); border-color: var(--red); color: #fff; }
.level-tab--on .slot-count, .slot-card--on .slot-count { background: #fff; color: var(--red); }

.level-banner {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.35rem 1.6rem; border-radius: var(--r-lg);
  background: var(--red); color: #fff;
}
.level-banner__icon { flex: none; display: grid; color: rgba(255,255,255,.9); }
.level-banner__title { font-size: 1.15rem; color: #fff; }
.level-banner__sub { margin-top: .15rem; font-size: .84rem; color: rgba(255,255,255,.9); }
.level-banner__total { flex: none; text-align: right; }
.level-banner__total strong { display: block; font-size: 1.7rem; line-height: 1.2; color: var(--yellow); font-variant-numeric: tabular-nums; }
.level-banner__total span { font-size: .8rem; color: rgba(255,255,255,.9); }

.slot-group { margin-bottom: 1.05rem; }
.slot-group__head { margin-bottom: .5rem; font-size: .76rem; color: var(--muted); }
.slot-group__head strong { margin-right: .35rem; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.slot-group__cards { display: flex; flex-wrap: wrap; gap: .65rem; }

.slot-card {
  display: flex; align-items: center; gap: .7rem;
  min-width: 190px; padding: .65rem .9rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.slot-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.slot-card--on, .slot-card--on:hover { background: var(--red); border-color: var(--red); color: #fff; }
.slot-card__text { flex: 1; display: grid; line-height: 1.25; }
.slot-card__name { font-size: .9rem; font-weight: 600; }
.slot-card__time { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot-card--on .slot-card__time { color: rgba(255,255,255,.9); }

.slot-icon { flex: none; display: grid; }
.slot-icon--morning, .slot-icon--weekend { color: #D9580F; }
.slot-icon--late_morning { color: var(--tile-amber); }
.slot-icon--evening { color: #7C5CC4; }
.slot-icon--online  { color: var(--tile-blue); }
.slot-card--on .slot-icon { color: var(--yellow); }

/* ---------- 24e. PAYMENTS: THE BANK-CARD TOTAL ---------- */
.pay-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; min-height: 248px;
  padding: 1.45rem 1.6rem; border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%); color: #fff;
  box-shadow: 0 10px 28px rgba(146,10,22,.26);
}
.pay-card__waves { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; stroke: rgba(255,255,255,.14); stroke-width: 1; }
.pay-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.pay-card__brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.pay-card__brand .brand-logo { width: 44px; height: 44px; }
.pay-card__brand strong { font-size: .95rem; font-weight: 600; line-height: 1.25; }
.pay-card__chip { flex: none; display: flex; align-items: center; gap: .45rem; color: rgba(255,255,255,.92); }
.pay-card__chip svg { display: block; }
.pay-card__label { margin-top: 1.25rem; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.92); }
.pay-card__value { margin-top: .2rem; font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-card__value small { font-size: .78rem; font-weight: 500; letter-spacing: 0; color: rgba(255,255,255,.92); }
.pay-card__month { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; font-size: .84rem; color: #FFD75E; }
.pay-card__month strong { font-weight: 600; }
.pay-card__month span { color: rgba(255,255,255,.92); }
.pay-card__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem;
  margin-top: auto; padding-top: 1.15rem; font-size: .8rem; color: rgba(255,255,255,.95);
}
.pay-card__foot span { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- 24f. PAYMENTS: THE TABLE ---------- */
.pay-head { flex-wrap: wrap; border-bottom: 0; padding-bottom: .4rem; }
.state-tabs { display: flex; flex-wrap: wrap; gap: .45rem; }
.state-tab {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600; color: var(--ink-2);
  transition: border-color .14s, background .14s;
}
.state-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.state-tab--on, .state-tab--on:hover { background: var(--red); border-color: var(--red); color: #fff; }
.pay-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .5rem 1.35rem 1rem; }
.pay-filters .input, .pay-filters .select { height: 38px; font-size: .84rem; }
.pay-filters .toolbar__search { max-width: 420px; }
.pay-rownum {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .78rem; font-weight: 700; color: var(--ink-2);
}
.pay-table { min-width: 900px; }
.pay-table thead th, .pay-table tbody td { padding-left: .7rem; padding-right: .7rem; }
.pay-table thead th:first-child, .pay-table tbody td:first-child { padding-left: 1.2rem; }
.pay-table .cell-person__name { display: block; white-space: normal; }
.pay-manage { display: grid; gap: .35rem; width: 96px; }
.pay-manage .btn { justify-content: flex-start; }
.deposit { display: grid; gap: .35rem; width: 124px; }
.deposit .input, .deposit .select { height: 34px; font-size: .8rem; }
.deposit .btn { justify-content: center; }

/* ---------- 25. UTILITIES ---------- */
.u-muted  { color: var(--muted); }
.u-small  { font-size: .78rem; }
.u-xs     { font-size: .72rem; }
.u-bold   { font-weight: 700; }
.u-right  { text-align: right; }
.u-center { text-align: center; }
.u-nowrap { white-space: nowrap; }
.u-red    { color: var(--red); }
.u-ok     { color: var(--ok); }
.u-warn   { color: var(--warn); }
.u-mt-0 { margin-top: 0; }
.u-mt-1 { margin-top: .5rem; }
.u-mt-2 { margin-top: 1rem; }
.u-mt-3 { margin-top: 1.5rem; }
.u-mb-1 { margin-bottom: .5rem; }
.u-mb-2 { margin-bottom: 1rem; }
.u-flex { display: flex; gap: .5rem; align-items: center; }
.u-flex-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.u-grow { flex: 1; }
.u-hide { display: none !important; }

/* ---------- 26. RESPONSIVE ---------- */
@media (max-width: 1240px) {
  .usermenu__meta, .usermenu__chevron { display: none; }
  .usermenu { padding-left: .5rem; }
}
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(calc(-100% - var(--gap-shell) * 2));
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .sidebar__close { display: block; }
  .main { margin-left: var(--gap-shell); }
  .topbar__menu { display: grid; place-items: center; }
}
@media (max-width: 760px) {
  :root { --gap-shell: 10px; }
  .content { padding: 1.1rem .1rem 2rem; }
  .topbar  { padding: 0 .6rem; gap: .5rem; }
  .topbar__title { display: none; }
  .usermenu { padding-left: 0; border-left: 0; }
  .usermenu__meta, .usermenu__chevron { display: none; }
  .usermenu__trigger { padding: .3rem; }
  .pagehead__title { font-size: 1.35rem; }
  .searchbox { display: none; }
  .topbar__search { display: grid; }
  .topbar__right { margin-left: auto; }
  .card__body, .card__head, .toolbar { padding-left: .95rem; padding-right: .95rem; }
  .table thead th, .table tbody td { padding-left: .95rem; padding-right: .95rem; }
  .doc-body, .doc-head, .doc-foot { padding-left: 1.2rem; padding-right: 1.2rem; }
  .cert { padding: 2rem 1.3rem; }
  .cert__title { font-size: 1.7rem; }
  .cert__name { font-size: 1.45rem; }
}
@media (max-width: 520px) {
  .pagehead__actions { width: 100%; }
  .pagehead__actions .btn { flex: 1; }
  .hero__btn { flex: 1 1 100%; justify-content: center; }
  .slot-card { flex: 1 1 100%; }
  .level-banner { padding: 1.1rem 1.15rem; }
  .level-banner__icon { display: none; }
}

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