/* ==========================================================================
   Soul Sounds Academy (SSA) — screens
   Sign in, the dashboard, payments, students, classes, expenses, profits,
   plus the shared screen header, toolbars, tables and empty states.
   ========================================================================== */

/* ---------------- Screens & auth visibility ---------------- */
body.not-authenticated .screen:not(#screen-login) { display: none !important; }
body.authenticated #screen-login { display: none !important; }
.screen { display: flex; flex-direction: column; gap: var(--s-6); }
.screen[hidden] { display: none; }
.screen--login { gap: 0; }

/* ---------------- Screen header ---------------- */
.screen__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-6);
  flex-wrap: wrap;
  padding: var(--s-4) 0 var(--s-2);
}
.screen__intro { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.screen__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-3xl);
  line-height: 1.04;   /* Newsreader's content box is ~1em; this keeps wrapped lines clear */
  letter-spacing: -0.025em;
  color: var(--text-1);
}
/* In-app titles: the em word sits as plain title text */
.screen__title em { font-style: normal; }
/* Sign-in keeps its gold italic accent */
.login-cover__title em {
  font-style: italic;
  background: var(--gold-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}
.screen__lede { color: var(--text-2); font-size: var(--fs-md); line-height: 1.55; max-width: 62ch; }
.screen__actions { display: flex; align-items: flex-end; gap: var(--s-2); flex-wrap: wrap; }

/* Split title letters (ui.js wraps each in .ch for the reveal) */
.ch { display: inline-block; will-change: transform; }
.wd { display: inline-block; white-space: nowrap; }

/* ---------------- Legend ---------------- */
.legend {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.legend__item {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px 0 8px;
  border-radius: 9px;
  font-size: var(--fs-xs); color: var(--text-2);
}
.legend__item .cell { width: 16px; height: 16px; border-radius: 5px; }
.legend__item .cell--online { border-radius: 50%; }
.legend__item .cell--paid::after, .legend__item .cell--online::after { -webkit-mask-size: 11px; mask-size: 11px; }

/* ---------------- Toolbar ---------------- */
.toolbar, .filterbar {
  position: relative; z-index: 2;
  display: flex; align-items: flex-end; gap: var(--s-3); flex-wrap: wrap;
}
.toolbar .field:not(.field--search) { flex: 0 1 190px; }
.toolbar__meta {
  margin-left: auto; align-self: center;
  padding: 6px 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em;
  color: var(--text-3);
  white-space: nowrap;
}
.toolbar__meta:empty { display: none; }

/* =====================================================================
   0. SIGN IN
   ===================================================================== */
.screen--login {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 48px var(--gutter);
  overflow: hidden;
}
.login-stage { position: fixed; inset: 0; z-index: 0; }
.login-stage__canvas { width: 100%; height: 100%; opacity: 0; transition: opacity 1200ms var(--ease-out); }
.login-stage__canvas.is-ready { opacity: 1; }
.login-stage__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 30% 40%, transparent 30%, rgb(var(--bg-rgb) / 0.55) 75%, rgb(var(--bg-rgb) / 0.92) 100%),
    linear-gradient(to top, rgb(var(--bg-rgb) / 0.9), transparent 40%);
}
.login-layout {
  position: relative; z-index: 1;
  width: min(1180px, 100%);
  display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.login-cover { display: flex; flex-direction: column; gap: 22px; }
.login-cover__logo { --logo-h: 56px; filter: drop-shadow(0 0 24px rgb(var(--brass-rgb) / 0.35)); }
.login-cover__eyebrow {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgb(var(--brass-rgb) / 0.3); border-radius: var(--r-pill);
  background: rgb(var(--brass-rgb) / 0.06);
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--brass);
  backdrop-filter: blur(8px);
}
.login-cover__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(3rem, 1.6rem + 4.4vw, 5.6rem);
  line-height: 0.95; letter-spacing: -0.03em;
  text-wrap: balance;
}
.programme {
  list-style: none;
  display: grid; grid-template-columns: repeat(5, auto); gap: 8px; justify-content: start;
  margin-top: 8px;
}
.programme li {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(var(--bg-rgb) / 0.45);
  backdrop-filter: blur(12px);
  transition: border-color 300ms var(--ease-out), transform 400ms var(--ease-rise);
}
.programme li:hover { border-color: rgb(var(--brass-rgb) / 0.45); transform: translateY(-3px); }
.programme__n { font-family: var(--font-mono); font-size: 10px; color: var(--brass); letter-spacing: 0.08em; }
.programme__item { font-weight: 600; font-size: var(--fs-sm); }
.programme__what { font-size: var(--fs-2xs); color: var(--text-3); white-space: nowrap; }

.login-card {
  position: relative;
  padding: 36px 34px 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.07), rgb(255 255 255 / 0.015) 40%),
    rgb(var(--bg-rgb) / 0.55);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--shadow-3), 0 0 120px -40px rgb(var(--brass-rgb) / 0.35);
  transform-style: preserve-3d;
  will-change: transform;
}
:root[data-theme="paper"] .login-card { background: rgb(255 255 255 / 0.72); }
.login-card > .login-card__shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgb(var(--brass-rgb) / 0.14), transparent 45%);
}
.login-card > * { position: relative; }
.login-card__header { margin-bottom: 26px; }
.login-card__badge {
  display: grid; place-items: center;
  width: 46px; height: 46px; margin-bottom: 20px;
  border-radius: 14px;
  background: var(--gold-grad); color: var(--brass-ink);
  box-shadow: var(--shadow-btn-rest), 0 0 30px -4px rgb(var(--brass-rgb) / 0.6);
}
.login-card__badge svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-card__title { font-family: var(--font-display); font-weight: 400; font-size: 2.6rem; line-height: 1; letter-spacing: -0.02em; }
.login-card__subtitle { margin-top: 10px; color: var(--text-2); }
.login-form { gap: 18px; }
.field__control { position: relative; display: block; }
.login-form .field--float .input { height: 50px; padding-left: 42px; border-radius: 13px; font-size: var(--fs-md); }
.field--float .field__icon { left: 15px; width: 16px; height: 16px; margin-top: -8px; }
.field--float:focus-within .field__icon { stroke: var(--brass); }
.field--float:focus-within .field__label { color: var(--brass); }
.field__reveal {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-3);
  transition: color var(--dur-base), background-color var(--dur-base);
}
.field__reveal:hover { color: var(--text-1); background: var(--surface-3); }
.field__reveal svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.field__reveal-slash { stroke-dasharray: 15; stroke-dashoffset: 0; transition: stroke-dashoffset 320ms var(--ease-emphasis); }
.field__reveal[aria-pressed="true"] .field__reveal-slash { stroke-dashoffset: 15; }
.field__reveal[aria-pressed="true"] { color: var(--brass); }
.field--float .input[type="password"], .field--float .input#login-password { padding-right: 50px; }
.login-caps { margin-top: -8px; font-size: var(--fs-xs); color: var(--brass); font-family: var(--font-mono); }
.login-error {
  padding: 12px 14px;
  border: 1px solid rgb(var(--ember-rgb) / 0.4);
  border-radius: 12px;
  background: rgb(var(--ember-rgb) / 0.08);
  color: var(--ember);
  font-size: var(--fs-sm);
  animation: err-shake 420ms var(--ease-out);
}
@keyframes err-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.login-actions { margin-top: 6px; }
.login-submit { width: 100%; }
.login-card__foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--text-3); }

/* =====================================================================
   1. DASHBOARD
   ===================================================================== */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px);
  align-items: end;
  min-height: 380px;
  padding: clamp(28px, 3.4vw, 48px);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.05), transparent 45%),
    var(--surface-solid);
  box-shadow: var(--shadow-3);
}
:root[data-theme="paper"] .hero { background: linear-gradient(135deg, #FFFDF8, #FFF6E6); }
.hero > .hero__mesh { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* One still pool of warm light in the top-left corner; the radial gradient
   is already soft, so only a light blur is needed */
.hero__mesh i { position: absolute; display: block; border-radius: 50%; filter: blur(24px); opacity: 0.5; }
.hero__mesh i:nth-child(1) { width: 480px; height: 480px; left: -160px; top: -220px; background: radial-gradient(circle, rgb(var(--brass-rgb) / 0.3), transparent 68%); }
.hero__copy { display: flex; flex-direction: column; gap: 14px; align-self: stretch; justify-content: flex-end; }
.hero__figure {
  display: flex; align-items: flex-start; flex-wrap: nowrap;
  margin: 8px 0 2px;
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  /* Newsreader's content box is 0.99em (ascent 0.73, descent 0.27) and its
     lining figures rise to the full ascent; 1 keeps the whole glyph in the box */
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums lining-nums;
  outline: none;
  cursor: default;
}
.hero__cur {
  margin: 0.14em 0.22em 0 0;
  font-family: var(--font-mono);
  font-size: 0.16em;
  letter-spacing: 0.12em;
  color: var(--text-3);
}
.hero__int {
  /* One solid warm tone: the gold, drawn a third of the way toward the text
     colour so it reads as champagne rather than a stock gradient fill */
  color: color-mix(in oklab, var(--brass) 70%, var(--text-1));
}
.hero__dec { font-size: 0.42em; margin-top: 0.12em; color: var(--text-3); letter-spacing: -0.01em; }
.hero__note { max-width: 42ch; color: var(--text-2); font-size: var(--fs-md); }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Cadence (hero): stacked month columns */
.cadence { display: flex; flex-direction: column; gap: 10px; }
.cadence__legend { display: flex; gap: 16px; justify-content: flex-end; font-size: var(--fs-2xs); color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.cadence__legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.sw--paid { background: var(--brass); }
.sw--unpaid { background: var(--ember); }
.sw--upcoming { border: 1px dashed var(--text-3); }
.cadence__columns {
  position: relative;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(4px, 0.8vw, 10px);
  align-items: end;
  height: 240px;
  padding-bottom: 1px;
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.cadence__col {
  position: relative;
  display: flex; flex-direction: column-reverse; gap: 2px;
  height: var(--h);
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  outline: none;
  cursor: pointer;
  transform-origin: bottom;
  transition: opacity 250ms var(--ease-out), filter 250ms var(--ease-out), transform 400ms var(--ease-rise);
  animation: bar-grow 1000ms var(--ease-rise) both;
}
.cadence__col:nth-child(1) { animation-delay: 60ms; } .cadence__col:nth-child(2) { animation-delay: 100ms; }
.cadence__col:nth-child(3) { animation-delay: 140ms; } .cadence__col:nth-child(4) { animation-delay: 180ms; }
.cadence__col:nth-child(5) { animation-delay: 220ms; } .cadence__col:nth-child(6) { animation-delay: 260ms; }
.cadence__col:nth-child(7) { animation-delay: 300ms; } .cadence__col:nth-child(8) { animation-delay: 340ms; }
.cadence__col:nth-child(9) { animation-delay: 380ms; } .cadence__col:nth-child(10) { animation-delay: 420ms; }
.cadence__col:nth-child(11) { animation-delay: 460ms; } .cadence__col:nth-child(12) { animation-delay: 500ms; }
@keyframes bar-grow { from { transform: scaleY(0); opacity: 0; } }
.cadence__columns:has(.cadence__col:hover) .cadence__col:not(:hover),
.cadence__columns:has(.cadence__col:focus-visible) .cadence__col:not(:focus-visible) { opacity: 0.35; filter: saturate(0.6); }
.cadence__col:hover, .cadence__col:focus-visible { transform: scaleY(1.02); }
.cadence__seg { flex: var(--n) 1 0; min-height: 3px; border-radius: 3px; }
.cadence__seg:first-child { border-radius: 3px 3px 3px 3px; }
.cadence__col > .cadence__seg:last-child { border-top-left-radius: 8px; border-top-right-radius: 8px; }
.cadence__seg--paid { background: linear-gradient(180deg, var(--brass-hover), var(--brass) 40%, var(--brass-deep)); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35); }
.cadence__seg--unpaid {
  background: repeating-linear-gradient(-45deg, rgb(var(--ember-rgb) / 0.9) 0 3px, rgb(var(--ember-rgb) / 0.45) 3px 6px);
}
.cadence__seg--upcoming { border: 1px dashed var(--line-hot); background: rgb(var(--paper-rgb) / 0.02); }
.cadence__col--current::after {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 8px);
  width: 6px; height: 6px; margin-left: -3px; border-radius: 50%;
  background: var(--brass); box-shadow: 0 0 12px var(--brass);
  animation: dot-pulse 2.4s infinite;
}
/* Headroom for that marker: it sits up to ~20px above a full-height bar (8px offset +
   6px dot + 6px pulse ring) plus the 2% hover lift, so the plot keeps that much clear
   space under the legend. Bar scale and gridlines are unchanged. */
.cadence--hero .cadence__columns { margin-top: 16px; }
.cadence__months {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(4px, 0.8vw, 10px);
  text-align: center;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3);
}
.cadence__months span { cursor: pointer; transition: color var(--dur-base); }
.cadence__months .is-current { color: var(--brass); font-weight: 600; }
.cadence__months .is-active { color: var(--text-1); }


/* Stat tiles */
.statrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-4); }
.stat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px 22px;
  overflow: hidden;
  transition: transform 500ms var(--ease-rise), border-color 300ms var(--ease-out);
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.stat__icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  transition: transform 500ms var(--ease-rise);
}
.stat:hover .stat__icon { transform: rotate(-8deg) scale(1.06); }
.stat__icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stat__icon--gold { color: var(--brass); border-color: rgb(var(--brass-rgb) / 0.35); background: rgb(var(--brass-rgb) / 0.1); }
.stat__icon--ember { color: var(--ember); border-color: rgb(var(--ember-rgb) / 0.35); background: rgb(var(--ember-rgb) / 0.08); }
.stat__label { font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; }
.stat__value {
  font-size: clamp(1.4rem, 1rem + 0.9vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat__value--money { font-size: clamp(1.25rem, 0.95rem + 0.75vw, 1.6rem); }
.stat__value.is-negative { color: var(--ember); }
.stat__hint { font-size: var(--fs-xs); color: var(--text-3); }
.stat--accent {
  border-color: rgb(var(--brass-rgb) / 0.3);
  background:
    radial-gradient(140% 120% at 100% 0%, rgb(var(--brass-rgb) / 0.14), transparent 55%),
    var(--surface);
}
.stat--accent .stat__value:not(.is-negative) { color: var(--brass); }
.stat .money.is-updating { animation: num-flash 700ms var(--ease-out); }
@keyframes num-flash { from { text-shadow: 0 0 18px rgb(var(--brass-rgb) / 0.8); } }

/* Pending + status */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr); gap: var(--s-4); align-items: start; }
.pending { max-height: 520px; overflow-y: auto; margin: 0 -10px; padding: 0 10px; scrollbar-width: thin; }
.pending[data-more="down"] { mask-image: linear-gradient(#000 85%, transparent); -webkit-mask-image: linear-gradient(#000 85%, transparent); }
.pending[data-more="up"] { mask-image: linear-gradient(transparent, #000 15%); -webkit-mask-image: linear-gradient(transparent, #000 15%); }
.pending[data-more="both"] { mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent); }
.pending.empty { max-height: none; }
.pending__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  grid-template-areas: "who strip owed pay" "meta strip owed pay";
  column-gap: 20px; row-gap: 2px;
  align-items: center;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: 14px;
  transition: background-color 200ms var(--ease-out), transform 400ms var(--ease-rise);
}
.pending__row + .pending__row { box-shadow: 0 -1px 0 var(--line); }
.pending__row:hover { background: var(--surface-2); box-shadow: none; }
.pending__row:hover + .pending__row { box-shadow: none; }
.pending__who { grid-area: who; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pending__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending__code, .who__code {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.03em; color: var(--text-3);
}
.pending__meta { grid-area: meta; font-size: var(--fs-xs); color: var(--text-3); }
.pending__owed { grid-area: owed; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pending__owed small { display: block; font-size: 10px; font-weight: 400; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.pending__pay { grid-area: pay; justify-self: end; }
.ministrip { grid-area: strip; display: flex; gap: 3px; padding: 6px; border-radius: 8px; outline: none; cursor: default; }
.ministrip:hover, .ministrip:focus-visible { background: var(--surface-3); }
.ministrip i { width: 7px; height: 18px; border-radius: 2.5px; transition: transform 200ms var(--ease-rise); }
.ministrip i:hover { transform: scaleY(1.25); }
.ministrip .m-paid { background: var(--brass); }
.ministrip .m-online { background: var(--online); }
.ministrip .m-unpaid { background: repeating-linear-gradient(-45deg, var(--ember) 0 2px, rgb(var(--ember-rgb) / 0.4) 2px 4px); }
.ministrip .m-upcoming { box-shadow: inset 0 0 0 1px var(--line-hot); }
.ministrip .m-none { background: var(--line); height: 2px; align-self: center; }

.status { display: flex; flex-direction: column; gap: var(--s-4); outline: none; }
.status .panel__head { margin-bottom: 0; }
.status__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status__item {
  display: flex; flex-direction: column-reverse; gap: 2px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.status__item dt { font-size: 10.5px; color: var(--text-3); line-height: 1.3; }
.status__item dd { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; letter-spacing: -0.02em; }
.status__foot { font-size: var(--fs-xs); color: var(--text-3); }
.status__peek { display: flex; flex-direction: column; gap: 14px; }
.peek__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.peek__title { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.peek__health {
  --val: 0;
  position: relative;
  /* Number and caption stack as one centred group, however many digits */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 84px; height: 84px; flex: none;
  border-radius: 50%;
  font-family: var(--font-display); font-size: 1.75rem; line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  background:
    radial-gradient(closest-side, var(--surface-solid) 82%, transparent 83%),
    conic-gradient(var(--brass) calc(var(--val) * 1%), var(--line-strong) 0);
}
:root[data-theme="paper"] .peek__health { background: radial-gradient(closest-side, #fff 82%, transparent 83%), conic-gradient(var(--brass) calc(var(--val) * 1%), var(--line-strong) 0); }
.peek__health small { font-family: var(--font-mono); font-size: 8.5px; line-height: 1; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.peek__rows { display: flex; flex-direction: column; gap: 12px; }
.peek__row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; }
.peek__label { font-size: var(--fs-xs); color: var(--text-2); }
.peek__value { font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.peek__value small { font-weight: 400; color: var(--text-3); font-size: var(--fs-2xs); }
.peek__bar { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; }
.peek__bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--gold-grad); transform-origin: left; animation: split-draw 1100ms 200ms var(--ease-rise) both; }
.peek__row:nth-child(2) .peek__bar i { background: linear-gradient(90deg, rgb(var(--ember-rgb) / 0.6), var(--ember)); }

/* Admin operations */
.admin-ops { display: flex; flex-direction: column; gap: var(--s-4); margin-top: var(--s-2); }
.admin-ops__head { display: flex; justify-content: space-between; align-items: flex-end; }
.admin-ops__head .eyebrow { margin-bottom: 6px; }
.admin-ops__body { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.admin-ops__group {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon copy" "icon actions";
  gap: 6px 18px;
  padding: 22px;
}
.admin-ops__icon {
  grid-area: icon;
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 13px;
  border: 1px solid rgb(var(--brass-rgb) / 0.3);
  background: rgb(var(--brass-rgb) / 0.08);
  color: var(--brass);
}
.admin-ops__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.admin-ops__copy { grid-area: copy; }
.admin-ops__heading { font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; }
.admin-ops__desc { margin-top: 4px; color: var(--text-2); font-size: var(--fs-sm); max-width: 52ch; }
.admin-ops__actions { grid-area: actions; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.admin-ops__group--danger .admin-ops__icon { color: var(--ember); border-color: rgb(var(--ember-rgb) / 0.3); background: rgb(var(--ember-rgb) / 0.08); }
.admin-ops__group--danger { background: radial-gradient(120% 120% at 100% 100%, rgb(var(--ember-rgb) / 0.06), transparent 50%), var(--surface); }
body[data-role="frontdesk"] #dash-admin-tools { display: none; }

/* Set-up guide */
.setup { padding: clamp(24px, 3vw, 40px); overflow: hidden; }
.setup::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 80% at 100% 0%, rgb(var(--brass-rgb) / 0.12), transparent 60%);
}
.setup > * { position: relative; }
.setup__head { margin-bottom: var(--s-5); }
.setup__eyebrow { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--brass); }
.setup__heading { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.05; margin: 8px 0 8px; }
.setup__lede { max-width: 64ch; }
.setup__steps { list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.setup__step {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 300ms var(--ease-out);
}
.setup__step.is-next { border-color: rgb(var(--brass-rgb) / 0.45); background: rgb(var(--brass-rgb) / 0.06); box-shadow: 0 0 0 4px rgb(var(--brass-rgb) / 0.06); }
.setup__step.is-later { opacity: 0.7; }
.setup__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--text-2);
}
.setup__step.is-next .setup__mark { border-color: var(--brass); color: var(--brass); }
.setup__step.is-done .setup__mark { border-color: transparent; }
.setup__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setup__title { font-weight: 600; }
.setup__text { font-size: var(--fs-sm); }
.setup__done { color: var(--positive); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.setup__after { font-family: var(--font-mono); font-size: 10.5px; }
.setup__steps--compact { margin-top: var(--s-4); text-align: left; width: min(640px, 100%); }
.setup__steps--compact .setup__step { padding: 10px 12px; }

/* ---------------- Empty states ---------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: clamp(40px, 6vw, 72px) var(--s-5);
}
.empty__rest {
  position: relative;
  display: grid; place-items: center;
  width: 64px; height: 64px; margin-bottom: 8px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(to bottom, transparent 0 9px, var(--line-strong) 9px 10px) center / 40px 42px no-repeat,
    var(--surface-2);
  animation: rest-float 5s ease-in-out infinite;
}
.empty__rest i {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 16px rgb(var(--brass-rgb) / 0.8);
  transform: translate(8px, -4px);
}
@keyframes rest-float { 50% { transform: translateY(-5px); } }
.empty__title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-xl); }
.empty__text { color: var(--text-2); max-width: 52ch; }
.empty .btn { margin-top: 8px; }
.empty--banner { border: 1px dashed var(--line-strong); border-radius: var(--r-card); }
.load-error { min-height: 50vh; justify-content: center; }
.load-error__mark {
  display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 20px; margin-bottom: 6px;
  border: 1px solid rgb(var(--ember-rgb) / 0.4);
  background: rgb(var(--ember-rgb) / 0.08);
}
.load-error__mark i { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--ember); background: repeating-linear-gradient(-45deg, rgb(var(--ember-rgb) / 0.5) 0 2px, transparent 2px 5px); }

/* =====================================================================
   2. PAYMENTS MATRIX
   ===================================================================== */
/* One scrollbar: the rows scroll with the page. The wrap only scrolls
   sideways, and only when the matrix is wider than the screen; then the
   student column stays pinned. (A sideways scroller can't also let the
   header dock to the page, so docking applies when the matrix fits.) */
#screen-payments { container: pay / inline-size; }
.matrix-wrap {
  overflow-x: auto; overflow-y: hidden;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.matrix { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1040px; }
.matrix th {
  position: sticky; top: 0; z-index: 3;
  padding: 14px 6px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
}
:root[data-theme="paper"] .matrix th { background: #FFFFFF; }
@container pay (min-width: 1044px) {
  .matrix-wrap { overflow: clip; }                      /* still clips to the card, but is not a scroller */
  .matrix thead th { top: calc(var(--appbar-h) - 1px); } /* docks under the sticky app bar without a 1px subpixel gap */
}
@media (max-width: 960px) {
  .matrix thead th { top: 0; }                          /* appbar is relative below 960px, dock to viewport top */
}
.matrix th.matrix__student, .matrix th.matrix__class { text-align: left; padding-left: 20px; }
.matrix th.matrix__owed { text-align: center; padding-left: calc(16px + 0.08em); padding-right: 16px; }   /* centred over the amounts; +0.08em offsets the trailing letter-spacing */
.matrix th.is-current { color: var(--brass); }
.matrix th.is-current::after {
  content: ""; position: absolute; left: 50%; bottom: -1px; width: 22px; height: 2px; margin-left: -11px;
  background: var(--brass); border-radius: 2px; box-shadow: 0 0 10px var(--brass);
}
.matrix td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  transition: background-color 150ms var(--ease-out);
}
.matrix tbody tr:last-child td { border-bottom: 0; }
.matrix td.matrix__m.is-current { background: rgb(var(--brass-rgb) / 0.045); }
.matrix .matrix__student {
  position: sticky; left: 0; z-index: 2;
  min-width: 200px;
  padding-left: 20px;
  text-align: left;
  background: var(--surface-solid);
}
:root[data-theme="paper"] .matrix td.matrix__student { background: #FFFFFF; }
.matrix th.matrix__student { z-index: 4; left: 0; }
.matrix td.matrix__student { box-shadow: 1px 0 0 var(--line); }
.matrix .matrix__class { text-align: left; padding-left: 20px; min-width: 170px; }
/* Owed: the column hugs its widest amount (width 1%) with equal side padding, so the
   centred header sits exactly over the amounts; amounts stay right-aligned so the
   decimals line up */
.matrix .matrix__owed { width: 1%; text-align: right; padding-left: 16px; padding-right: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.matrix td.matrix__owed:not(.amount-zero) { color: var(--ember); }
/* Per-row "Pay" shortcut: its own narrow column after Owed, so the Owed header
   stays over the amount */
.matrix .matrix__act { width: 1%; padding-left: 8px; padding-right: 12px; text-align: right; white-space: nowrap; }
.matrix .matrix__pay { --btn-h: 30px; --btn-px: 12px; }   /* plain .btn--link, same family as Edit / Delete */
@media (hover: hover) {
  .matrix .matrix__pay { opacity: 0.6; transition: opacity 200ms var(--ease-out); }
  .matrix tbody tr:hover .matrix__pay, .matrix .matrix__pay:focus-visible { opacity: 1; }
}
.matrix tbody tr:hover td { background: var(--surface-2); }
.matrix tbody tr:hover td.matrix__student { background: var(--surface-solid-2); }
:root[data-theme="paper"] .matrix tbody tr:hover td.matrix__student { background: #FBF8F2; }
.matrix tbody tr:hover td.matrix__student::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: var(--brass);
}
.who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.who__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cls { display: flex; flex-direction: column; gap: 1px; }
.cls__name { font-weight: 500; }
.cls__slot { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.mcell {
  position: relative;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border: 0; border-radius: 10px;
  background: transparent;
  transition: background-color 150ms var(--ease-out);
}
.mcell .cell { transition: transform 360ms var(--ease-rise), box-shadow 250ms var(--ease-out); }
.mcell:not(:disabled):hover { background: var(--surface-3); }
.mcell:not(:disabled):hover .cell { transform: scale(1.18); }
.mcell:not(:disabled):active .cell { transform: scale(0.86); transition-duration: 90ms; }
.mcell:disabled { cursor: default; }
.mcell:focus-visible { outline: 2px solid var(--focus-border); outline-offset: 0; }
.mcell:not(:disabled):hover .cell--unpaid { box-shadow: 0 0 14px -2px rgb(var(--ember-rgb) / 0.8); }
.mcell:not(:disabled):hover .cell--upcoming { border-color: var(--brass); }
.amount-zero { color: var(--text-3) !important; font-weight: 400 !important; }
.amount-key { color: var(--ember); font-weight: 600; }
.matrix-wrap > .empty { min-height: 320px; }

/* =====================================================================
   3. STUDENTS & 5. EXPENSES: tables
   ===================================================================== */
.table-wrap { overflow-x: auto; padding: 6px 8px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  padding: 14px 14px;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
}
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 150ms var(--ease-out); }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:hover td:first-child { border-radius: 12px 0 0 12px; }
.table tbody tr:hover td:last-child { border-radius: 0 12px 12px 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; padding-right: calc(14px - 0.08em); }   /* minus the trailing letter-spacing, so the last letter ends on the figures' edge */
.table td.num { font-weight: 500; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; padding-left: var(--s-7); }   /* a clear gap after the last figure column */
/* Owed (Students): hugs its widest amount with equal side padding, header centred over it */
.table .col-owed { width: 1%; padding-left: var(--s-6); padding-right: var(--s-6); }
.table th.col-owed { text-align: center; padding-left: calc(var(--s-6) + 0.08em); padding-right: var(--s-6); }
@media (hover: hover) {
  .table td.actions > * { opacity: 0.6; transition: opacity 200ms var(--ease-out); }
  .table tr:hover td.actions > *, .table td.actions > *:focus-visible { opacity: 1; }
}
/* Registration fee status beside a student code */
.reg-tag {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 6px; margin-left: 4px;
  border-radius: var(--r-pill);
  font-family: var(--font-ui); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: 0;
  vertical-align: 1px;
}
.reg-tag--paid { background: var(--surface-3); color: var(--text-2); }
.reg-tag--due { background: rgb(var(--ember-rgb) / 0.12); color: var(--ember); }
.cell-sub { display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 400; color: var(--text-3); }
.expense-owner-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-3);
}
.expense-owner-badge::before {
  content: ""; width: 9px; height: 9px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='7' width='10' height='7' rx='1.8'/%3E%3Cpath d='M5.3 7V5.2a2.7 2.7 0 0 1 5.4 0V7' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='7' width='10' height='7' rx='1.8'/%3E%3Cpath d='M5.3 7V5.2a2.7 2.7 0 0 1 5.4 0V7' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3C/svg%3E") center / contain no-repeat;
}
#expenses-table td:first-child { font-family: var(--font-mono); font-size: var(--fs-xs); }

/* =====================================================================
   4. CLASS ROSTERS & INDIVIDUAL GRADES: subtabs, card grid, grade table
   ===================================================================== */
.cls-subtabs {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.cls-subtab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.cls-subtab:hover { color: var(--text-1); background: var(--surface-2); }
.cls-subtab[aria-selected="true"] {
  background: var(--surface-3);
  border-color: rgb(var(--brass-rgb) / 0.45);
  color: var(--text-1);
  font-weight: 600;
}
.cls-subtab__badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--surface-2); color: var(--text-3);
  border: 1px solid var(--line);
}
.cls-subtab[aria-selected="true"] .cls-subtab__badge {
  background: rgb(var(--brass-rgb) / 0.16);
  border-color: rgb(var(--brass-rgb) / 0.35);
  color: var(--brass);
}

.cls-panel { display: flex; flex-direction: column; gap: var(--s-4); }
.cls-panel[hidden] { display: none; }

.chip__grade {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 6px; margin-left: 2px;
  border-radius: var(--r-pill);
  background: rgb(var(--brass-rgb) / 0.16);
  border: 1px solid rgb(var(--brass-rgb) / 0.35);
  color: var(--brass);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
}
.chip__rate {
  display: inline-flex; align-items: center;
  height: 18px; padding: 0 6px; margin-left: 2px;
  border-radius: var(--r-pill);
  background: rgb(var(--online-rgb) / 0.12);
  border: 1px solid rgb(var(--online-rgb) / 0.32);
  color: var(--online);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.grd-pills {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.grd-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--fs-xs); font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.grd-pill:hover { border-color: var(--line-hot); color: var(--text-1); background: var(--surface-2); }
.grd-pill.is-active {
  background: rgb(var(--brass-rgb) / 0.14);
  border-color: rgb(var(--brass-rgb) / 0.55);
  color: var(--brass);
  font-weight: 600;
}
.grd-pill__n {
  font-family: var(--font-mono); font-size: 11px; opacity: 0.78;
}

.grd-badge {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: var(--r-pill);
  background: rgb(var(--brass-rgb) / 0.14);
  border: 1px solid rgb(var(--brass-rgb) / 0.38);
  color: var(--brass);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.grd-badge--empty {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text-3);
  font-weight: 400;
}

.grd-rate {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-variant-numeric: tabular-nums;
}
.grd-rate__val { font-weight: 600; color: var(--text-1); white-space: nowrap; }
.grd-rate__sub {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-3); white-space: nowrap;
}
.grd-rate__tag {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: var(--r-pill);
  background: rgb(var(--online-rgb) / 0.14);
  border: 1px solid rgb(var(--online-rgb) / 0.35);
  color: var(--online);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em;
}

.grd-modal-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: var(--fs-xs); color: var(--text-2);
}

.cls-board { display: flex; flex-direction: column; gap: var(--s-6); }
.cls-board[hidden] { display: none; }

.cls-day { display: flex; flex-direction: column; gap: var(--s-3); }
.cls-day__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.cls-day__title {
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-lg);
  line-height: 1.1; letter-spacing: -0.01em; color: var(--text-1);
}
.cls-day__meta {
  font-family: var(--font-mono); font-size: var(--fs-2xs);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
}

.cls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: var(--s-4);
  align-items: stretch;
}

.cls-card {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: 18px 20px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card, 16px);
  background: var(--surface);
  transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.cls-card:hover { border-color: var(--line-hot); background: var(--surface-2); }

.cls-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.cls-card__title-wrap { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cls-card__name {
  font-size: var(--fs-md); font-weight: 600; color: var(--text-1);
  line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cls-card__time {
  font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-2);
  white-space: nowrap;
}
.cls-card__count {
  flex: none; display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--line);
}
.cls-card__count.is-empty { color: var(--text-3); background: transparent; }

.cls-card__fees {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cls-card__fee {
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.cls-card__fee-unit { font-weight: 400; font-size: var(--fs-xs); color: var(--text-3); }
.cls-card__bundle {
  margin-left: auto;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid rgb(var(--brass-rgb) / 0.35);
  background: rgb(var(--brass-rgb) / 0.1);
  color: var(--brass);
  font-size: var(--fs-2xs); font-weight: 600; font-variant-numeric: tabular-nums;
}

.cls-card__roster { flex: 1; min-height: 32px; display: flex; align-items: flex-start; }
.cls-card__roster .chips { gap: 6px; }
.cls-card__empty { font-size: var(--fs-xs); color: var(--text-3); padding: 4px 0; }

.cls-card__foot {
  display: flex; align-items: center; gap: var(--s-2);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.cls-card__foot [data-action="delete-class"] { margin-left: auto; }
@media (hover: hover) {
  .cls-card__foot > * { opacity: 0.78; transition: opacity 160ms var(--ease-out); }
  .cls-card:hover .cls-card__foot > *, .cls-card__foot > *:focus-visible { opacity: 1; }
}

/* =====================================================================
   5. EXPENSES
   ===================================================================== */
.exp-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: var(--s-4); align-items: stretch; }
.statrow--stack { grid-template-columns: 1fr 1fr; }
.statrow--stack .stat { padding: 16px 18px; }
.statrow--stack .stat__value--money { font-size: clamp(1.1rem, 0.8rem + 0.55vw, 1.35rem); }
.cadence--expenses { padding: 22px 24px 18px; gap: 14px; }
.cadence__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cadence__title { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.1; }
.cadence__sub { font-size: var(--fs-xs); color: var(--text-3); }
.cadence--expenses .cadence__columns { height: 200px; flex: 1; min-height: 160px; }
.cadence--expenses .cadence__col {
  background: linear-gradient(180deg, rgb(var(--brass-rgb) / 0.55), rgb(var(--brass-rgb) / 0.15));
  border: 1px solid rgb(var(--brass-rgb) / 0.25);
  border-bottom: 0;
}
.cadence--expenses .cadence__col:hover { background: linear-gradient(180deg, var(--brass-hover), rgb(var(--brass-rgb) / 0.35)); }
.cadence--expenses .cadence__col.is-current { background: var(--gold-grad); box-shadow: 0 0 24px -6px rgb(var(--brass-rgb) / 0.7); }
.cadence--expenses .cadence__col.is-active {
  background: linear-gradient(180deg, var(--online), rgb(var(--online-rgb) / 0.35));
  border-color: rgb(var(--online-rgb) / 0.6);
  box-shadow: 0 0 24px -4px rgb(var(--online-rgb) / 0.7);
}
.cadence--expenses .cadence__col--current::after { display: none; }

/* =====================================================================
   6. PROFITS
   ===================================================================== */
.pf-yearfield { flex-direction: column; align-items: stretch; gap: 6px; }
/* Year summary: one panel that reads as a sum (revenue − expenses = net),
   with the strongest month set apart. Flat and still, unlike the month
   cards below, so it reads as the headline rather than a thirteenth month. */
.pf-summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch;
  padding: 26px 30px;
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgb(var(--paper-rgb) / 0.035), transparent 70%),
    var(--surface-solid);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
:root[data-theme="paper"] .pf-summary { background: var(--surface-solid); }
#screen-profits { container: pf / inline-size; }   /* the strip sizes to the screen, not the window */
.pf-summary__eq { display: flex; align-items: flex-start; gap: 22px; }
.pf-summary__item, .pf-summary__best { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pf-summary__label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
.pf-key { width: 7px; height: 7px; border-radius: 50%; }
.pf-key--rev { background: var(--brass); }
.pf-key--exp { background: var(--ember); }
.pf-summary__value {
  font-size: 1.375rem; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pf-summary__hint { font-size: var(--fs-xs); color: var(--text-3); }
.pf-summary__op {
  align-self: flex-start; margin-top: 22px;
  font-size: 1.375rem; line-height: 1.1; font-weight: 300;
  color: var(--text-3);
}
.pf-summary__item--net .pf-summary__value { font-size: 1.75rem; font-weight: 600; margin-top: -4px; }
.pf-summary__item--net .pf-summary__value:not(.is-negative) { color: var(--brass); }
.pf-summary__best {
  justify-content: flex-start;
  padding-left: 30px; margin-left: 30px;
  border-left: 1px solid var(--line);
}
.pf-summary__month { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.05; margin-top: -4px; }

/* Narrower screens: strongest month drops below, then the sum stacks */
@container pf (max-width: 1060px) {
  .pf-summary { grid-template-columns: 1fr; gap: 20px; }
  .pf-summary__best { padding: 18px 0 0; margin: 0; border-left: 0; border-top: 1px solid var(--line); }
  .pf-summary__eq { gap: 16px; }
  .pf-summary__value, .pf-summary__op { font-size: 1.25rem; }
  .pf-summary__op { margin-top: 20px; }
  .pf-summary__item--net .pf-summary__value { font-size: 1.5rem; }
}
@container pf (max-width: 700px) {
  .pf-summary { padding: 20px; }
  .pf-summary__eq { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .pf-summary__op { display: none; }
  .pf-summary__item--net { grid-column: 1 / -1; }
  .pf-summary__value { white-space: normal; }
}

/* Month by month */
.pf-section-h {
  margin: var(--s-2) 0 var(--s-3);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
}
.pf-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); }
.pf-month {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px 18px 18px;
  border-radius: 14px;
  text-align: left;
  color: var(--text-1);
  cursor: pointer;
  transition: border-color 250ms var(--ease-out), background-color 250ms var(--ease-out), opacity 300ms var(--ease-out);
  animation: rise-in 700ms var(--ease-rise) both;
  animation-delay: calc(var(--i) * 35ms);
}
.pf-month:hover { border-color: var(--line-hot); }
.pf-month:active { transform: scale(0.995); }
.pf-month__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-month__name { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.05; }
.pf-month__now {
  padding: 2px 7px; border-radius: var(--r-pill);
  border: 1px solid rgb(var(--brass-rgb) / 0.4);
  color: var(--brass);
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.pf-month__net {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pf-month__k { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.pf-month__net.is-negative, .money.is-negative, .pf-fig__v.is-negative { color: var(--ember); }
.pf-month__flows { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-flow { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; align-items: baseline; font-size: var(--fs-xs); }
.pf-flow__k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.pf-flow__v { justify-self: end; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-flow__track { grid-column: 1 / -1; display: block; height: 4px; border-radius: 4px; background: rgb(var(--paper-rgb) / 0.06); overflow: hidden; }
.pf-month__bar { display: block; height: 100%; width: var(--w); border-radius: inherit; transform-origin: left; animation: split-draw 900ms var(--ease-rise) both; animation-delay: calc(200ms + var(--i, 0) * 35ms); }
.pf-month__bar--rev { background: var(--gold-grad); }
.pf-month__bar--exp { background: linear-gradient(90deg, rgb(var(--ember-rgb) / 0.5), var(--ember)); }
.pf-month__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
.pf-month.is-quiet { opacity: 0.55; }
.pf-month.is-quiet:hover { opacity: 0.85; }
.pf-month.is-current { border-color: rgb(var(--brass-rgb) / 0.45); }

.pf-dayhead { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-5); margin-bottom: var(--s-4); }
.pf-dayhead__nav { display: flex; gap: 8px; align-items: center; }
.pf-dayhead__title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-2xl); line-height: 1; }
.pf-dayhead__figs { display: flex; gap: 8px; }
.pf-fig { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pf-fig dt { font-size: 10.5px !important; }
.pf-fig__v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The way back to the month grid: full default size and full-contrast text
   (overrides the .btn--sm / .btn--ghost on this one button only) */
.btn.pf-back {
  --btn-h: 40px; --btn-px: 16px; --btn-fs: var(--fs-base); --btn-r: 11px;
  color: var(--text-1);
  border-color: var(--line-strong);
}
.btn.pf-back.is-hot { border-color: var(--line-hot); }
.pf-back__arrow { width: 12px; height: 12px; margin-right: 2px; display: inline-block; }
.pf-back__arrow::before {
  content: ""; display: block; width: 100%; height: 100%; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6H2.5M5.5 2.5 2 6l3.5 3.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 6H2.5M5.5 2.5 2 6l3.5 3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 300ms var(--ease-rise);
}
.pf-back.is-hot .pf-back__arrow::before { transform: translateX(-3px); }

.pf-cal { padding: 14px; }
.pf-cal__dows, .pf-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.pf-cal__dows span { padding: 4px 8px 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.pf-day {
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  min-height: 104px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in oklab, rgb(var(--brass-rgb)) calc(var(--lvl, 0) * 20%), var(--surface));
  color: var(--text-1);
  text-align: left;
  overflow: hidden;
  animation: rise-in 600ms var(--ease-rise) both;
  animation-delay: calc(var(--i, 0) * 12ms);
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
/* Hover stays in place: the border warms and a soft shadow settles, nothing moves */
.pf-day:not(.pf-day--pad):hover { border-color: rgb(var(--brass-rgb) / 0.5); box-shadow: 0 8px 22px -14px rgb(0 0 0 / 0.55); z-index: 1; }
.pf-day--pad { border-style: dashed; background: transparent; opacity: 0.35; animation: none; }
.pf-day__head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pf-day__n { font-family: var(--font-display); font-size: 1.35rem; line-height: 1; }
.pf-day__net { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-day__tags { display: flex; flex-direction: column; gap: 3px; }
.pf-day__dots { display: none; }
.pf-tag {
  display: block;
  padding: 2px 6px; border-radius: 5px;
  font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-tag--rev { background: rgb(var(--brass-rgb) / 0.16); color: var(--brass); }
.pf-tag--exp { background: rgb(var(--ember-rgb) / 0.14); color: var(--ember); }
.pf-day__mark { position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; }
.pf-day.has-revenue .pf-day__mark { background: var(--brass); box-shadow: 0 0 10px var(--brass); }
.pf-day.has-spend:not(.has-revenue) .pf-day__mark { background: var(--ember); }
.pf-day.is-today { border-color: var(--brass); box-shadow: 0 0 0 3px rgb(var(--brass-rgb) / 0.18); }
.pf-day.is-today .pf-day__n { color: var(--brass); }
.pf-note { margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--text-3); }

/* Day summary (dialog) */
.pf-sum { display: flex; flex-direction: column; gap: 14px; }
.pf-sum__figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-sum__h { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.pf-recs { list-style: none; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pf-rec { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 11px 14px; font-size: var(--fs-sm); }
.pf-rec + .pf-rec { border-top: 1px solid var(--line); }
.pf-rec__desc { min-width: 0; }
.pf-rec__amt { font-weight: 600; white-space: nowrap; }

/* =====================================================================
   OVERTURE (after sign-in; the picture is js/scene.js)
   ===================================================================== */
.overture {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity 540ms var(--ease-out);
  animation: fade-in 300ms var(--ease-out);
}
.overture.is-leaving { opacity: 0; pointer-events: none; }
.overture__stage { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.overture__caption {
  position: absolute; left: 50%; bottom: 6vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.overture__logo { --logo-h: 44px; filter: drop-shadow(0 0 20px rgb(var(--brass-rgb) / 0.5)); }
.overture__phase {
  min-height: 1.4em;
  font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
  white-space: pre;
}
.overture.is-waiting .overture__phase { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.45; } }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1280px) {
  .pf-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .exp-top { grid-template-columns: 1fr; }
  .statrow--stack { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .cadence__columns { height: 180px; }
  .statrow, .statrow--stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .admin-ops__body { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; max-width: 520px; }
  .programme { display: none; }
  .login-cover { align-items: flex-start; }
  .login-cover__title { font-size: clamp(2.4rem, 1.6rem + 3vw, 3.4rem); }
  .pf-dayhead { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pf-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-cal__grid, .pf-cal__dows { gap: 3px; }
  .pf-day { min-height: 64px; padding: 6px; border-radius: 8px; }
  .pf-day__tags, .pf-day__net { display: none; }
  .pf-day__dots { display: flex; align-items: center; gap: 4px; margin-top: auto; }
  .pf-dot { width: 6px; height: 6px; border-radius: 50%; display: block; }
  .pf-dot--rev { background: var(--brass); }
  .pf-dot--exp { background: var(--ember); }
  .pf-day__n { font-size: 1rem; }
  .pending__row { grid-template-columns: 1fr auto auto; grid-template-areas: "who owed pay" "meta owed pay" "strip strip strip"; }
  .ministrip { justify-self: start; margin-left: -6px; }
  .toolbar__meta { margin-left: 0; }
  .toolbar .field:not(.field--search) { flex: 1 1 140px; }
  .field--search { max-width: none; flex-basis: 100%; }
  .status__list { grid-template-columns: repeat(3, 1fr); }
  .screen--login { padding: 28px 16px; align-items: start; }
  .login-card { padding: 28px 22px 20px; }
  .login-cover__logo { --logo-h: 40px; }
  .pf-sum__figs { grid-template-columns: 1fr; }
  .pf-dayhead__figs { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .statrow, .statrow--stack { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat__icon { display: none; }
  .stat__value, .stat__value--money, .statrow--stack .stat__value--money { font-size: 1.02rem; white-space: normal; }
  .hero__figure { font-size: 3.6rem; }
  .hero__cur { font-size: 0.2em; }
  .admin-ops__group { grid-template-columns: 1fr; grid-template-areas: "icon" "copy" "actions"; }
  .cls-grid { grid-template-columns: 1fr; }
  .cls-card { padding: 14px 16px 12px; }
  .cls-subtabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .cls-subtab { justify-content: center; padding: 0 10px; font-size: var(--fs-xs); }
  .grd-pills { gap: 6px; }
  .grd-pill { height: 32px; padding: 0 11px; }
}

/* Split titles keep their gold italic word: the gradient moves onto each letter */
.is-split em { background: none; color: inherit; -webkit-text-fill-color: currentColor; }
.is-split em .ch {
  background: var(--gold-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  padding-right: 0.04em; margin-right: -0.04em;
}

/* =====================================================================
   Bulk CSV Import Modal
   ===================================================================== */
.import-modal { display: flex; flex-direction: column; gap: var(--s-3); }
.import-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
}
.import-bar__desc { font-size: var(--fs-sm); color: var(--text-2); max-width: 54ch; }

.import-dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 8px;
  padding: 20px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}
.import-dropzone:hover { border-color: rgb(var(--brass-rgb) / 0.55); background: var(--surface-2); }
.import-dropzone:focus-visible { outline: 2px solid var(--focus-border); outline-offset: 2px; border-color: var(--brass); }
.import-dropzone.is-dragover {
  border-color: var(--brass);
  background: rgb(var(--brass-rgb) / 0.09);
  box-shadow: 0 0 0 4px rgb(var(--brass-rgb) / 0.14);
}
.import-dropzone.is-invalid { border-color: var(--ember); background: rgb(var(--ember-rgb) / 0.06); }
.import-dropzone__icon {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--brass);
}
.import-dropzone__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.import-dropzone__title { font-weight: 600; font-size: var(--fs-sm); color: var(--text-1); }
.import-dropzone__hint { font-size: var(--fs-xs); color: var(--text-3); }

.import-file {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
}
.import-file__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.import-file__name { font-weight: 600; font-size: var(--fs-sm); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-file__sub { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-3); }

.import-preview {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
}
.import-preview__cols { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.import-preview__label { font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-right: 4px; }
.import-preview__col {
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-1);
}
.import-preview__table-wrap { overflow-x: auto; max-height: 150px; }
.import-preview__table { width: 100%; border-collapse: collapse; font-size: 11.5px; font-family: var(--font-mono); }
.import-preview__table th,
.import-preview__table td {
  padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
}
.import-preview__table th { color: var(--text-3); font-weight: 500; }
.import-preview__table td { color: var(--text-2); }

.import-options {
  display: flex; flex-direction: column; gap: var(--s-3);
}
.import-options .check__text {
  flex-direction: column; justify-content: flex-start; gap: 2px;
}

.import-results {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
}
.import-results__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.import-results__title { font-weight: 600; font-size: var(--fs-sm); color: var(--text-1); }
.import-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.import-stat {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
}
.import-stat--created { border-color: rgb(var(--brass-rgb) / 0.45); color: var(--brass); }
.import-stat--updated { border-color: rgb(var(--online-rgb) / 0.45); color: var(--online); }
.import-stat--error { border-color: rgb(var(--ember-rgb) / 0.45); color: var(--ember); }

.import-log {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
  max-height: 180px; overflow-y: auto;
  font-size: var(--fs-xs);
}
.import-log__item {
  display: flex; gap: 8px; align-items: baseline;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.import-log__item--error { border-color: rgb(var(--ember-rgb) / 0.35); background: rgb(var(--ember-rgb) / 0.08); color: var(--ember); }
.import-log__item--warn { border-color: rgb(var(--brass-rgb) / 0.35); background: rgb(var(--brass-rgb) / 0.08); color: var(--brass); }
.import-log__row { font-family: var(--font-mono); font-size: 11px; flex: none; opacity: 0.85; }
.import-log__msg { color: var(--text-1); min-width: 0; word-break: break-word; }

/* Virtualize off-screen table & queue rows to skip layout/paint on large rosters */
.matrix tbody tr,
.table tbody tr,
.pending__row {
  content-visibility: auto;
  contain-intrinsic-size: auto 48px;
}
