html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}


a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Navigation menu icon alignment */
.nav-link .bi {
    font-size: 1.1rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    display: inline-block;
    width: 1.25rem;
    text-align: center;
}

.nav-link {
    display: flex;
    align-items: center;
}

/* Sortable table headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}


/* Form fields */
.field-error {
    position:absolute;
    bottom:-15px;
}

.form-field, .form-field-label {
    width: var(--w, 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group {
    row-gap:0;
}

.form-diff {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}


.form-diff-current,
.form-diff-revision,
.form-diff-unchanged {
    font-size:0.875rem
}

.form-diff-current,
.form-diff-revision {
    /* flex: 1; */
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid transparent;
    min-height: 2rem;
    display: flex;
    align-items: center;
    word-break: break-word;
}

.form-diff-current {
    background: #e6ffec;
    border-color: #a3d9a5;
    color: #1a4a1e;
}

.form-diff-revision {
    background: #ffebe9;
    border-color: #f5b8b5;
    color: #4a1a1a;
    text-decoration:line-through;
}

.form-diff-unchanged {
    background: transparent;
    border-color: transparent;
    color: inherit;
}

.form-diff-restore {
    font-size: 0.65rem;
    color: #002147;
    cursor: pointer;
    user-select: none;
    font-weight:bold;
}

/* End form fields */

/* ── Radzen primary colour override ───────────────────────── */
:root {
    --rz-primary: #3b4cca;
    --rz-primary-light: #4e5fd4;
    --rz-primary-lighter: rgba(59, 76, 202, 0.16);
    --rz-primary-dark: #2f3eb0;
    --rz-primary-darker: #1f2d8a;
    --rz-input-focus-border:1px solid #3b4cca;
    --rz-input-shadow:none;
    --rz-input-hover-shadow:none;
    --rz-input-focus-shadow:0 0 0 3px var(--accent-soft);
}

.rz-button.rz-primary.rz-shade-default:hover {
    background-color: var(--rz-primary-dark) !important;
    background-image: none !important;
    box-shadow: none !important;
}

.rz-button.rz-light.rz-shade-default:active {
    background-image: none !important;
    box-shadow: none !important;
}

/* ── Radzen button ───────────────────────── */
:root {
--rz-button-border-radius:8px;
}

/* ── RadzenFormField (icon input wrapper) ──────────────────── */
:root {
    --rz-form-field-margin-block: 0;
}

/* ── RadzenNumeric spinner buttons — flatten the default blue box, light-grey carets ──── */
:root {
    --rz-numeric-button-background-color: transparent;
    --rz-numeric-button-color: #9ba3b4;
}

/* Pressed state also darkens via a separate global overlay (--rz-button-active-gradient/-shadow,
   shared by every .rz-button in the app) rather than --rz-numeric-button-background-color — clear it
   for the numeric spinner specifically instead of touching those shared variables. Matches the library
   rule's specificity (.rz-numeric-button:not(.rz-state-disabled):active) so it wins on source order
   alone (default.css loads before app.css), no !important needed. */
.rz-numeric-button:not(.rz-state-disabled):active {
    background-image: none;
    box-shadow: none;
}

.rz-form-field {
    height: 36px;
    background: var(--surface);
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: border-color 120ms;
}


.rz-form-field-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100%;
}

.rz-form-field-label {
    display: none;
}

.rz-form-field .rz-textbox,
.rz-form-field .rz-datepicker .rz-inputtext {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    padding: 0 8px;
    height: 100%;
    flex: 1;
    min-width: 0;
    width: auto !important;
}

.rz-form-field.rz-state-focused {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.rz-form-field-start {
    display: flex;
    align-items: center;
    padding: 0 8px;
    flex-shrink: 0;
}

.rz-form-field-start .rzi {
    color: var(--text-3);
    font-size: 18px;
    line-height: 1;
}

/* ── Global design tokens ──────────────────────────────────── */
:root {
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --surface-hover: #f3f5f8;
    --border: #e6e8ed;
    --border-strong: #d4d8df;
    --text: #0f1729;
    --text-2: #4a5468;
    --text-3: #7a8499;
    --text-4: #9ba3b4;
    --accent: #3b4cca;
    --accent-hover: #2f3eb0;
    --accent-soft: #eef0fc;
    --green: #0f7a4d;
    --green-soft: #e3f3eb;
    --amber: #a25d00;
    --amber-soft: #fbecd0;
    --red: #b42318;
    --red-soft: #fde7e3;
    --slate: #475569;
    --slate-soft: #eef1f5;
    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;
    --row-h: 52px;
    --row-px: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 41, 0.06), 0 1px 2px rgba(15, 23, 41, 0.04);
}

/* ── Table cell helpers (used in C# render tree builders) ──── */
.km-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.km-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.km-mono {
    font-family: "JetBrains Mono", "Courier New", ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text-2);
}

.km-email {
    color: var(--text-2);
}

.km-empty {
    color: var(--text-4);
    font-style: italic;
    font-size: 12.5px;
}

.km-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.km-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
}

.km-badge--active {
    background: var(--green-soft);
    color: var(--green);
}

.km-badge--inactive {
    background: var(--slate-soft);
    color: var(--slate);
}

/* Says why the fields on a detail page are rendering as text rather than inputs. Sits next to the
   active/inactive badge in the card hero. Deliberately quiet — read-only is the normal state for
   most staff on most screens, not an error. */
.km-badge--readonly {
    background: var(--surface-2);
    color: var(--text-3);
    padding-left: 8px;
}

/* Status tones for badges that report progress rather than an on/off state — currently the
   module list's planned-hours cell. Global rather than page-scoped on purpose: the cell is
   built with RenderTreeBuilder and rendered by KimikApiDataTable, so it never receives the
   page's CSS-isolation attribute and a scoped rule would silently never match. */
.km-badge--ok {
    background: var(--green-soft);
    color: var(--green);
}

.km-badge--warn {
    background: var(--amber-soft);
    color: var(--amber);
}

.km-badge--danger {
    background: var(--red-soft);
    color: var(--red);
}

.km-badge--muted {
    background: var(--surface-2);
    color: var(--text-3);
}

/* The fifth tone, added for the student-status lifecycle phases: the six of them need six
   distinguishable colour families and the four above are two short — this supplies indigo, with
   .km-badge--inactive's slate covering the last. Global for the same reason. */
.km-badge--accent {
    background: var(--accent-soft);
    color: var(--accent);
}

/* Tabular figures so "84 / 120 t" lines up down the column. */
.km-badge--ok,
.km-badge--warn,
.km-badge--danger,
.km-badge--muted,
.km-badge--accent {
    font-variant-numeric: tabular-nums;
    padding-left: 8px;
}

/* ── Radzen DataGrid — global styling for all KimikApiDataTable instances ── */
.rz-datatable {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.rz-datatable-scrollable-wrapper {
    border: none !important;
}

.rz-grid-table {
    border-collapse: collapse !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    font-size: 13.5px !important;
}

/* Header cells */
.rz-column-header,
.rz-header-cell,
.rz-grid-table th {
    background: var(--surface-2) !important;
    color: var(--text-3) !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
    padding: 10px var(--row-px) !important;
    white-space: nowrap !important;
    user-select: none !important;
}

.rz-sort-label,
.rz-column-title {
    color: var(--text-3) !important;
    font-weight: 600 !important;
    font-size: 11.5px !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}

/* Data rows */
.rz-data-row td,
.rz-grid-table tbody td {
    padding: 0 var(--row-px) !important;
    height: var(--row-h) !important;
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    font-size: 13.5px !important;
    color: var(--text) !important;
    vertical-align: middle !important;
    transition: background 100ms !important;
}

.rz-data-row:hover td,
.rz-grid-table tbody tr:hover td {
    background: var(--surface-hover) !important;
}
/*
.rz-selectable:hover td,
.rz-grid-table tbody tr.rz-selectable:hover td {
    cursor: pointer;
}
*/
/* Selected row */
.rz-data-row.rz-state-focused td,
.rz-data-row.rz-state-active td {
    background: var(--accent-soft) !important;
    color: var(--text) !important;
}


/* Empty state */
.rz-data-empty td {
    text-align: center !important;
    padding: 60px 0 !important;
    color: var(--text-3) !important;
    font-size: 14px !important;
    height: auto !important;
}

/* Paginator */
.rz-pager {
    background: var(--surface-2) !important;
    border-top: 1px solid var(--border) !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    font-size: 12.5px !important;
    color: var(--text-3) !important;
    padding: 10px 18px !important;
}

.rz-paginator-element {
    border-radius: var(--r-sm) !important;
    min-width: 28px !important;
    height: 28px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text-2) !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    font-size: 12.5px !important;
    transition: background 100ms, color 100ms !important;
}

.rz-paginator-element:hover:not(:disabled) {
    background: var(--surface-hover) !important;
}

.rz-paginator-element.rz-state-active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    font-weight: 500 !important;
}

.rz-paginator-element:disabled {
    opacity: 0.4 !important;
}

.rz-pager-summary {
    color: var(--text-3) !important;
    font-size: 12.5px !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}

.rz-pager select,
.rz-pager .rz-dropdown {
    border: 1px solid var(--border) !important;
    border-radius: var(--r-sm) !important;
    background: var(--surface) !important;
    color: var(--text-2) !important;
    font-size: 12.5px !important;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    height: 28px !important;
    padding: 0 8px !important;
}

.rz-datatable-loading-icon {
    color: var(--accent) !important;
}

/* ── Table icon action buttons ─────────────────────────────── */
.tbl-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}

.tbl-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 120ms, color 120ms;
    font-size: 16px;
    padding: 0;
    flex-shrink: 0;
}

.tbl-icon-btn .rzi {
    font-size: 16px;
}

.tbl-icon-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.tbl-icon-btn--danger:hover {
    background: var(--red-soft);
    color: var(--red);
}

/* ── Context menu (kebab "more actions") ───────────────────── */
/* Override Radzen's own theming hooks so the popup matches the card rounding
   and carries smaller icons. Custom properties cascade to the menu container
   and its item icons. */
.rz-context-menu {
    --rz-menu-border-radius: var(--r-lg);
    --rz-icon-size: 18px;
    --rz-menu-item-border-radius: var(--r-sm); /* rounded item highlight */
    --rz-context-menu-padding-block: 4px;      /* breathing room around the items */
    --rz-context-menu-padding-inline: 4px;
    /* Global equivalent of the calendar's scoped --sc-surface-hover (both #f3f5f8);
       the scoped one doesn't resolve out here at the app root. */
    --rz-menu-item-hover-background-color: var(--surface-hover);
    /* Keep text/icon at their resting colors on hover — Radzen's default hover foreground is a
       light color for its dark hover background, which would go white on our light hover bg. */
    --rz-menu-item-hover-color: var(--rz-menu-item-color);
    --rz-menu-item-icon-hover-color: var(--rz-menu-item-icon-color);
}

.rz-context-menu .rz-navigation-menu {
    overflow: hidden; /* clip item highlights to the rounded corners */
}

/* ── Radzen layout theming ─────────────────────────────────── */
.rz-layout {
    background-color: #f6f7f9;
}


.rz-body {
    background-color: #f6f7f9;
    --rz-layout-body-background-color:#f6f7f9;
}

/* The settings subsystem renders full-bleed (its category panel + content reach every edge). Drop
   the Radzen body's 1rem padding while it's shown so, together with the page's own -24px bleed of
   the .content padding, nothing leaves a gray gap — notably the strip below the sticky save bar. */
.rz-body:has(.settings-page) {
    padding-top: 0;
    padding-bottom: 0;
}

.rz-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e6e8ed;
    padding: 0;
    min-height: 56px;
}

/* ── Sidebar dark theme ────────────────────────────────────── */
.rz-sidebar {
    --rz-sidebar-background-color: #0d1424;
    --rz-sidebar-color: #c8cfdc;
    --rz-sidebar-border-inline-end: 1px solid rgba(255, 255, 255, 0.04);
    --rz-panel-menu-item-color: #c8cfdc;
    --rz-panel-menu-item-background-color: transparent;
    --rz-panel-menu-item-hover-color: #ffffff;
    --rz-panel-menu-item-hover-background-color: rgba(255, 255, 255, 0.06);
    --rz-panel-menu-item-active-color: #ffffff;
    --rz-panel-menu-item-active-background-color: #1c2741;
    --rz-panel-menu-item-active-indicator: transparent;
    --rz-panel-menu-item-2nd-level-color: #c8cfdc;
    --rz-panel-menu-item-2nd-level-background-color: transparent;
    --rz-panel-menu-item-2nd-level-hover-color: #ffffff;
    --rz-panel-menu-item-2nd-level-hover-background-color: rgba(255, 255, 255, 0.06);
    --rz-panel-menu-item-2nd-level-active-color: #ffffff;
    --rz-panel-menu-item-2nd-level-active-background-color: #1c2741;
}

.rz-sidebar-toggle {
    color: #4a5468;
}

/* ── Login page ────────────────────────────────────────────── */

.lgn-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 41, 0.24), 0 4px 12px rgba(15, 23, 41, 0.12);
    width: 100%;
    max-width: 400px;
    padding: 40px 36px 32px;
}

.lgn-header {
    text-align: center;
    margin-bottom: 28px;
}

.lgn-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b4cca 0%, #2a37c9 100%);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(59, 76, 202, 0.35);
}

.lgn-title {
    font-size: 22px;
    font-weight: 600;
    color: #0f1729;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.lgn-subtitle {
    font-size: 13.5px;
    color: #7a8499;
    margin: 0;
}

.lgn-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fde7e3;
    color: #b42318;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
}

.lgn-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.lgn-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lgn-label {
    font-size: 13px;
    font-weight: 500;
    color: #4a5468;
}

.lgn-remember-me {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.lgn-label--inline {
    margin: 0;
    cursor: pointer;
}

.lgn-help {
    font-size: 12px;
    color: #9ba3b4;
    text-align: center;
    margin: 16px 0 0;
}

/* Remove vertical dividers in the table in ForeignKeyTableField  */
.rz-dropdown-panel .rz-grid-table td,
.rz-dropdown-panel .rz-grid-table th {
    border-right: none !important;
}

/* --- Shared component styles --- */

.km-page {
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --surface-hover: #f3f5f8;
    --border: #e6e8ed;
    --border-strong: #d4d8df;
    --text: #0f1729;
    --text-2: #4a5468;
    --text-3: #7a8499;
    --text-4: #9ba3b4;
    --accent: #3b4cca;
    --accent-hover: #2f3eb0;
    --accent-soft: #eef0fc;
    --green: #0f7a4d;
    --green-soft: #e3f3eb;
    --amber: #a25d00;
    --amber-soft: #fbecd0;
    --red: #b42318;
    --red-soft: #fde7e3;
    --slate: #475569;
    --slate-soft: #eef1f5;
    --r-sm: 6px;
    --r: 8px;
    --r-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 41, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 41, 0.06), 0 1px 2px rgba(15, 23, 41, 0.04);
    --row-h: 52px;
    --row-px: 20px;

    display: flex;
    flex-direction: column;
    padding: 24px 32px 32px;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01", "ss03";
    animation: pmFadeIn 180ms ease-out;
}

@keyframes pmFadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.km-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.km-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.km-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0;
    line-height: 1.2;
}

.km-subtitle {
    font-size: 13.5px;
    color: var(--text-3);
    margin: 4px 0 0;
    max-width: 600px;
}

.km-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.km-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.km-stat-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.01em;
}

.km-stat-value {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.km-stat-meta {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.km-filter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.km-filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.km-filter-active-banner {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 12.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.km-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.cm-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ── Detail page — breadcrumb, hero, card, form, aside ─────── */

.km-crumb-strip {
    padding: 16px 32px 0;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

.km-crumb-strip--narrow {
    max-width: 920px;
}

.km-crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.km-crumb-link {
    color: var(--text-3);
    text-decoration: none;
    transition: color 120ms;
}

.km-crumb-link:hover {
    color: var(--accent);
}

.km-crumb-sep {
    font-size: 10px;
    color: var(--text-4);
}

.km-crumb-active {
    color: var(--text);
    font-weight: 500;
}

.km-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    padding: 16px 32px 32px;
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    align-items: start;
}

.km-body--narrow {
    grid-template-columns: minmax(0, 1fr);
    max-width: 920px;
}

.km-main-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.km-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: pmFadeIn 220ms ease-out;
}

.km-card-hero {
    padding: 22px 28px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
}

.km-back-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 120ms, color 120ms;
    flex-shrink: 0;
    font-size: 14px;
}

.km-back-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.km-avatar--lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.km-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    color: var(--text-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.km-header-text {
    min-width: 0;
    flex: 1;
}

.km-meta-row {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.km-meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-4);
    flex-shrink: 0;
}

.km-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.km-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--r);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 120ms, color 120ms, border-color 120ms;
    white-space: nowrap;
    border: none;
    text-decoration: none;
}

.km-btn--primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 41, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.km-btn--primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.km-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.km-btn--ghost {
    background: var(--surface);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.km-btn--ghost:hover {
    background: var(--surface-hover);
}

.km-btn--danger {
    background: var(--surface);
    color: var(--red);
    border: 1px solid var(--border);
}

.km-btn--danger:hover {
    background: var(--red-soft);
    border-color: var(--red-soft);
}

.km-section {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    padding: 24px 28px;
}

.km-section--divider {
    border-top: 1px solid var(--border);
}

.km-section-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 2px;
}

.km-section-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
}

.km-section-sub {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.5;
}

.km-section-fields {
    min-width: 0;
}

.km-field-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    align-items: start;
}

.km-span-3  { grid-column: span 3; }
.km-span-4  { grid-column: span 4; }
.km-span-5  { grid-column: span 5; }
.km-span-6  { grid-column: span 6; }
.km-span-7  { grid-column: span 7; }
.km-span-8  { grid-column: span 8; }
.km-span-9  { grid-column: span 9; }
.km-span-12 { grid-column: span 12; }

.km-card .form-group {
    margin-bottom: 0;
}

.km-card .field-error,
.km-card .validation-message {
    font-size: 12px !important;
    color: var(--red) !important;
    margin-top: 4px !important;
}

.km-card-footer {
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.km-footer-hint {
    font-size: 12.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.km-footer-spacer {
    flex: 1;
}

.km-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
}

.km-aside-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    animation: pmFadeIn 220ms ease-out;
}

.km-aside-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.km-meta-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.km-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-size: 12.5px;
}

.km-meta-key {
    color: var(--text-3);
    flex-shrink: 0;
}

.km-meta-val {
    color: var(--text);
    font-weight: 500;
    font-family: "JetBrains Mono", "Courier New", ui-monospace, monospace;
    font-size: 12px;
    text-align: right;
}

.km-meta-val--normal {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 12.5px;
}

/* ── Grid span additions ──────────────────────────────────── */
.km-span-2  { grid-column: span 2; }

/* ── Hero icons ───────────────────────────────────────────── */
.km-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    background: #eef0fc;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.km-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.km-icon--create {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--green-soft);
    color: var(--green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.km-icon--placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    color: var(--text-4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

/* ── Plain HTML form controls ─────────────────────────────── */
.km-field-group { display: flex; flex-direction: column; gap: 5px; }

.km-label { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0.01em; }

/* Read-only value shown where a form control would otherwise sit. Matches .km-input's typography
   without the box, so a display-only field lines up with the editable ones around it. The
   min-height keeps a row with an em-dash placeholder the same height as one with real text.
   Global (rather than page-scoped) because showing values instead of inputs is how a screen
   renders for someone without write access. */
.km-readonly-value {
    font-size: 13.5px;
    color: var(--text);
    min-height: 20px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.km-input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    width: 100%;
    transition: border-color 120ms, box-shadow 120ms;
    outline: none;
    box-sizing: border-box;
}

.km-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 76, 202, 0.1); }

.km-textarea {
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    width: 100%;
    resize: vertical;
    min-height: 80px;
    transition: border-color 120ms, box-shadow 120ms;
    outline: none;
    line-height: 1.5;
    box-sizing: border-box;
}

.km-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 76, 202, 0.1); }

.km-hint { font-size: 11.5px; color: var(--text-4); }

/* A quiet aside inside a km-label — e.g. "· 24-timers format". Part of the label element,
   so it inherits its layout, but visibly not part of the field's name. */
.km-label-note { color: var(--text-4); font-weight: 400; }

.km-native-select {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
    appearance: auto;
    transition: border-color 120ms;
}

.km-native-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 76, 202, 0.12);
}

.km-field-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 4px;
}

.km-error {
    font-size: 12.5px;
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #fca5a5;
    border-radius: var(--r-sm);
    padding: 8px 12px;
    margin-top: 12px;
}

/* ── Translation tabs ─────────────────────────────────────── */
.km-tabs { display: flex; flex-direction: column; gap: 0; }

.km-tab-list {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.km-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    transition: color 120ms, border-color 120ms;
    margin-bottom: -1px;
    font-family: inherit;
}

.km-tab:hover { color: var(--text); }
.km-tab--active { color: var(--accent); border-bottom-color: var(--accent); }

.km-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
}

/* ── Translation cards ────────────────────────────────────── */
.km-trans-card {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: 12px;
}

.km-trans-card:last-child { margin-bottom: 0; }

.km-trans-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.km-trans-name { font-size: 13px; font-weight: 600; color: var(--text); }

.km-trans-code {
    font-size: 11.5px;
    color: var(--text-3);
    font-family: "JetBrains Mono", monospace;
}

.km-trans-check {
    margin-left: auto;
    color: var(--green);
    font-size: 13px;
}

.km-trans-body { padding: 14px; }

/* ── Create-person flow ───────────────────────────────────── */
.km-badge--create {
    background: var(--accent-soft);
    color: var(--accent);
    gap: 4px;
}

.km-create-hint {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.km-toggle-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 120ms, color 120ms;
}

.km-toggle-link:hover {
    color: var(--accent-hover);
    text-decoration-color: var(--accent-hover);
}

.km-btn--back {
    background: none;
    border: none;
    color: var(--text-3);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
    transition: color 120ms;
}

.km-btn--back:hover { color: var(--accent); }

/* --- Booking dialog host ---------------------------------------------------
   BookingDialog renders its own header, scrolling body and footer (the
   "Booking-dialog v2" design), so the host opens it with ShowTitle = false and
   these rules remove Radzen's content padding and let the shell own the box.
   Global rather than scoped because the target is the dialog wrapper, which is
   a parent of the component's own root element. */

.bd-dialog .rz-dialog-content {
    padding: 0 !important;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bd-dialog.rz-dialog {
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
}


/* ── Settings primitives (set-*) ──────────────────────────────────────────────
   Card / row / toggle / segment / input / select, as used by the settings panels
   and by the notification settings on /my-account.

   These lived in SettingsLayout.razor.css behind `::deep`, which scoped them to the
   settings layout's subtree — so the same controls rendered anywhere else came out
   unstyled. They are primitives, not layout, so they belong here. Values unchanged. */
/* Card + rows */
.set-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.set-card-head {
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.set-card-title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.set-card-sub {
    font-size: 12.5px;
    color: var(--text-3);
    margin-top: 2px;
}

.set-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.set-row:last-child { border-bottom: none; }

.set-row-text { flex: 1; min-width: 0; }

.set-row-label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.set-row-desc {
    font-size: 12.5px;
    color: var(--text-3);
    margin-top: 2px;
    line-height: 1.5;
    max-width: 460px;
}

.set-row-control { flex-shrink: 0; }

/* Toggle */
.set-toggle {
    width: 40px;
    height: 23px;
    border: none;
    border-radius: 999px;
    position: relative;
    background: var(--border-strong);
    cursor: pointer;
    transition: background 160ms;
    flex-shrink: 0;
}

.set-toggle.on { background: var(--accent); }

/* A switch the user isn't allowed to flip — e.g. a channel the institution has turned off. The
   row's description carries the explanation. */
.set-toggle.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.set-toggle-knob {
    position: absolute;
    top: 2.5px;
    left: 2.5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 41, 0.25);
    transition: left 160ms;
}

.set-toggle.on .set-toggle-knob { left: 19.5px; }

/* Segmented control */
.set-seg {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 2px;
}

.set-seg-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    background: transparent;
    cursor: pointer;
    transition: color 120ms, background 120ms;
}

.set-seg-btn.on {
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* Inputs / selects */
.set-input {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    font-size: 13.5px;
    color: var(--text);
    min-width: 220px;
    outline: none;
    transition: border-color 120ms, box-shadow 120ms;
}

.set-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.set-input.mono { font-family: ui-monospace, "JetBrains Mono", monospace; }

.set-select {
    height: 36px;
    padding: 0 32px 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--surface);
    font-size: 13.5px;
    color: var(--text);
    min-width: 200px;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8499' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}


/* Danger card variant */
.set-card--danger { border-color: #f0d4cf; }
.set-card--danger .set-card-head { border-color: #f6e2de; }
.set-card--danger .set-card-title { color: var(--red); }

/* A named divider inside a card, for rows that fall into two different kinds of setting. Tinted so
   it reads as a break in the list rather than as another row. */
.set-subhead {
    padding: 13px 20px 11px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.set-subhead-title {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
}

.set-subhead-sub {
    font-size: 12.5px;
    color: var(--text-3);
    margin-top: 3px;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
}

/* Rows that are two facets of one setting: no hairline between them, one under the pair. */
.set-group {
    border-bottom: 1px solid var(--border);
}

.set-group:last-child { border-bottom: none; }
.set-group > .set-row { border-bottom: none; }

/* The continuation row hugs the one it belongs to — the gap above it is the first row's own
   bottom padding, so the pair reads as a single block. */
.set-group > .set-row + .set-row { padding-top: 0; }

/* Status pill beside a row label, e.g. "coming soon" on a channel that isn't built yet. */
.set-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    vertical-align: 1px;
}

/* A row whose setting doesn't currently apply — the detail under a switch that is off. Only the
   text is dimmed here; the control carries its own disabled state, so that the row cannot end up
   looking inert while still being operable. Matches .set-toggle.disabled's 0.45. */
.set-row--disabled .set-row-label,
.set-row--disabled .set-row-desc {
    opacity: 0.45;
}

.set-select:disabled,
.set-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: var(--surface-2);
}

/* Row of badges in a grid cell — e.g. the student list's status summary, one badge
   per distinct status the person's enrollments hold. Global for the same reason as
   the .km-badge tones above: the cell is built with RenderTreeBuilder and never
   receives a page's CSS-isolation attribute. Wraps rather than truncating, since
   several badges is the case the cell exists for. */
.km-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    min-width: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Student detail (sd-*) — the tabbed student page.

   In app.css rather than a scoped .razor.css because three components share these
   classes (the page, StudentStatusTab, StudentMockTab) and scoped CSS does not
   cross a component boundary.

   Status colour is keyed on the code-owned lifecycle phase (sd-phase-*), never on
   the tenant's own status name — an institution may call `active` anything it
   likes, and the palette still has to work.
   ───────────────────────────────────────────────────────────────────────────── */

.sd-card {
    background: var(--surface-1, #fff);
    border: 1px solid var(--border, #e6e8ed);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 41, 0.04);
    overflow: hidden;
}

.sd-header-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 20px 22px 18px; }

.sd-avatar {
    width: 52px; height: 52px; border-radius: 999px; color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 600;
}

.sd-header-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sd-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sd-name { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.sd-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2, #4a5468); }
.sd-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.sd-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }
.sd-sep { color: var(--border, #d4d8df); }
.sd-muted { color: var(--text-4, #9ba3b4); }
.sd-right { text-align: right; }

.sd-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
    background: var(--surface-2, #f3f5f8); color: var(--text-2, #4a5468);
}
.sd-pill-sub { opacity: 0.65; font-weight: 400; }
.sd-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

/* Wraps rather than scrolls. A scroller hides tabs off the right edge with nothing to say they are
   there, and this is a fixed set of five — at any width they fit in one or two rows. */
.sd-tabs { display: flex; flex-wrap: wrap; align-items: stretch; gap: 2px; padding: 0 14px; border-top: 1px solid var(--border-soft, #eceef2); }

.sd-tab {
    display: flex; align-items: center; gap: 7px;
    padding: 12px 14px; background: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: 13.5px; font-weight: 450;
    color: var(--text-2, #4a5468);
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.sd-tab--on { font-weight: 600; color: var(--accent, #3730c4); border-bottom-color: var(--accent, #3730c4); }
.sd-tab-count {
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px;
    padding: 1px 6px; border-radius: 999px;
    background: var(--surface-2, #f3f5f8); color: var(--text-3, #7a8499);
}
.sd-tab--on .sd-tab-count { background: #eef0fc; color: #2733a8; }

/* The mock marker. Deliberately loud enough to read before the tab is opened. */
.sd-tab-mock {
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 1px 5px; border-radius: 4px;
    background: #fdf1e3; color: #a25d00;
}


/* ── Body ─────────────────────────────────────────────────────────────────── */

.sd-body { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; margin-top: 18px; }
.sd-main { flex: 1 1 580px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.sd-aside { flex: 1 1 300px; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }

.sd-card-head {
    display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
    gap: 12px; padding: 16px 22px 14px;
}
.sd-card-title { font-size: 15px; font-weight: 600; }
.sd-card-sub { font-size: 12.5px; color: var(--text-3, #7a8499); }

.sd-btn {
    height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border, #e6e8ed); background: var(--surface-1, #fff);
    font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-2, #4a5468);
    display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.sd-btn--primary { background: var(--accent, #3730c4); border-color: var(--accent, #3730c4); color: #fff; }
.sd-btn--danger { border-color: #f3d6d3; color: #c0392b; }
.sd-plus { font-size: 15px; }

.sd-link { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit;
           font-size: 12.5px; font-weight: 500; color: var(--accent, #3730c4); }
.sd-link:hover { text-decoration: underline; }
.sd-link--danger { color: #c0392b; }

.sd-chips { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 22px 16px; }
.sd-chip {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
    border-radius: 8px; cursor: pointer; font-family: inherit;
    border: 1px solid var(--border, #e6e8ed); background: var(--surface-1, #fff);
    color: var(--text-2, #4a5468);
}
.sd-chip--on { background: #eef0fc; border-color: #c9cff5; color: #2733a8; font-weight: 500; }
.sd-chip-label { font-size: 13px; font-weight: 500; }
.sd-chip-sub { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; opacity: 0.7; }

.sd-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px;
    border-top: 1px solid var(--border-soft, #eceef2); border-bottom: 1px solid var(--border-soft, #eceef2);
    background: var(--border-soft, #eceef2);
}
.sd-summary-cell { background: #fafbfc; padding: 13px 22px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sd-summary-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3, #7a8499); }
.sd-summary-value { font-size: 14.5px; font-weight: 500; }
.sd-summary-sub { font-size: 11.5px; color: var(--text-4, #9ba3b4); }

/* ── Status timeline ──────────────────────────────────────────────────────── */

.sd-timeline { padding: 20px 22px 8px; display: flex; flex-direction: column; }
.sd-tl-row { display: grid; grid-template-columns: 110px 20px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.sd-tl-date { text-align: right; display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.sd-tl-datelabel { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #b0b7c4; }
.sd-tl-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sd-tl-dot { width: 9px; height: 9px; border-radius: 999px; background: #c9cdd6; flex-shrink: 0; margin-top: 5px; }
.sd-tl-dot--now { width: 13px; height: 13px; background: currentColor; margin-top: 3px; }
.sd-tl-dot--future { background: #fff; border: 2px solid currentColor; }
.sd-tl-line { flex: 1; width: 2px; min-height: 16px; background: var(--border, #e6e8ed); }
.sd-tl-line--future { width: 0; background: none; border-left: 2px dashed #d4d8df; }

.sd-tl-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding-bottom: 22px; }
.sd-tl-card--now,
.sd-tl-card--future {
    padding: 12px 14px; margin-bottom: 18px; border-radius: 10px;
    border: 1px solid var(--border, #e6e8ed); background: var(--surface-1, #fff);
}
.sd-tl-card--future { border-style: dashed; background: #fcfcfd; }
.sd-tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-tl-note { font-size: 13px; color: var(--text-2, #4a5468); white-space: pre-wrap; }
.sd-tl-by { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-4, #9ba3b4); }
.sd-tl-actions { display: flex; gap: 10px; margin-top: 2px; }

.sd-tag { padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 500;
          border: 1px dashed #c9cdd6; color: var(--text-3, #7a8499); background: #fff; white-space: nowrap; }
.sd-tag--now { border: 0; background: #0f1729; color: #fff; padding: 2px 8px; }

/* ── Subject table ────────────────────────────────────────────────────────── */

.sd-table { padding: 12px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.sd-thead,
.sd-row { display: grid; grid-template-columns: minmax(0, 1fr) 148px 132px 62px; gap: 10px; }
.sd-thead {
    padding: 0 2px 7px; border-bottom: 1px solid var(--border-soft, #eceef2);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-3, #7a8499);
}
.sd-group { display: flex; flex-direction: column; gap: 2px; }
.sd-group-head { display: flex; align-items: baseline; gap: 9px; padding: 0 2px 6px; }
.sd-group-label { font-size: 12px; font-weight: 600; }
.sd-group-meta { font-size: 11.5px; color: var(--text-4, #9ba3b4); }
.sd-row { align-items: center; padding: 9px 2px; border-top: 1px solid #f3f5f8; }
.sd-subject { font-size: 13.5px; }
.sd-subject-meta { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: var(--text-4, #9ba3b4); }
.sd-cell-type { font-size: 12.5px; color: var(--text-2, #4a5468); }
.sd-cell-state { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sd-when { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: var(--text-4, #9ba3b4); }
.sd-cell-grade { text-align: right; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; font-weight: 500; }
.sd-subject-empty { padding: 18px 22px 24px; font-size: 13px; color: var(--text-3, #7a8499); }

.sd-current { border-top: 1px solid var(--border-soft, #eceef2); padding: 16px 22px 6px;
              display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.sd-current-name { font-size: 15px; font-weight: 600; }
.sd-current-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3, #7a8499); }

.sd-state {
    display: inline-flex; align-items: center; align-self: flex-start;
    padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; white-space: nowrap;
    background: var(--surface-2, #f3f5f8); color: var(--text-2, #5c6577);
}
.sd-state--assessed { background: #e6f4ec; color: #0f7a4d; }
.sd-state--awaitingassessment { background: #efebf7; color: #5a4399; }
.sd-state--scheduled { background: #eef0fc; color: #2733a8; }
.sd-state--notstarted { background: #f3f5f8; color: #5c6577; }

/* ── External documents (It-reg) ───────────────────────────────────────────── */

/* No "received" column: It-reg's document payload carries no date, and a made-up one on a student
   record is worse than a missing column. Three columns, not the design's four. */
.sd-doc-head,
.sd-doc-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 92px; gap: 10px; padding: 0 22px; }
.sd-doc-head {
    padding-bottom: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft, #eceef2);
    background: var(--surface-1, #fafbfc);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-3, #7a8499);
}
.sd-doc-row { align-items: center; padding-top: 11px; padding-bottom: 11px; border-top: 1px solid #f3f5f8; }
.sd-doc-row:last-child { padding-bottom: 18px; }
.sd-doc-action { text-align: right; }

.sd-doc-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sd-doc-ext {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 7px;
    background: #f0f1fb; color: #3730c4;
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; font-weight: 500;
}
.sd-doc-text { min-width: 0; }
.sd-doc-title { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-doc-sub { font-size: 11.5px; color: var(--text-4, #9ba3b4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sd-doc-cat {
    display: inline-flex; padding: 2px 8px; border-radius: 6px;
    font-size: 11.5px; font-weight: 500; white-space: nowrap;
    background: var(--surface-2, #f3f5f8); color: var(--text-2, #5c6577);
}

.sd-doc-link {
    border: 0; background: none; padding: 0; cursor: pointer;
    font-size: 12.5px; font-weight: 500; color: #3730c4;
}
.sd-doc-link:hover:not(:disabled) { text-decoration: underline; }
.sd-doc-link:disabled { color: var(--text-4, #9ba3b4); cursor: default; }

/* The integration is off, or broken. Not a table with nothing in it — a state with an instruction. */
.sd-doc-notice {
    margin: 4px 22px 20px; padding: 14px 16px; border-radius: 10px;
    border: 1px dashed #c9cdd6; background: #fcfcfd;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
    font-size: 12.5px; color: var(--text-2, #4a5468); text-wrap: pretty;
}
.sd-doc-notice--error { border-style: solid; border-color: #fca5a5; background: #fde7e3; color: #b42318; }

.sd-card-note { font-size: 12.5px; color: var(--text-3, #7a8499); white-space: nowrap; }

/* ── Lifecycle phases (the code-owned StudentStatusKinds values) ───────────── */

/* The badge shape, matching .sd-state on the student page. The neutral colours are the fallback for
   a badge whose modifier this stylesheet doesn't know; the palette below overrides them. */
.km-phase {
    display: inline-flex; align-items: center; flex-shrink: 0;
    padding: 1px 7px; border-radius: 6px;
    font-size: 11px; font-weight: 500; white-space: nowrap;
    background: var(--surface-2, #f3f5f8); color: var(--text-2, #5c6577);
}

/* One palette, two names. `sd-phase-*` is the student page's own usage; `km-phase--*` is the same
   colour reached from anywhere else — the pickers, above all — so a phase looks identical wherever
   it is shown instead of merely similar. Adding a phase means adding it to one line here.

   The km half is written doubled (`.km-phase.km-phase--x`) on purpose: as a single class it ties with
   `.km-phase` above on specificity, and whichever came last in the file would win — which is exactly
   how every badge came out grey the first time. Doubling makes the order irrelevant. */
.sd-phase-applied,      .km-phase.km-phase--applied      { background: #f3f5f8; color: #5c6577; }
.sd-phase-accepted,     .km-phase.km-phase--accepted     { background: #eef0fc; color: #2733a8; }
.sd-phase-active,       .km-phase.km-phase--active       { background: #e6f4ec; color: #0f7a4d; }
.sd-phase-completed,    .km-phase.km-phase--completed    { background: #efebf7; color: #5a4399; }
.sd-phase-not_enrolled, .km-phase.km-phase--not_enrolled { background: #fdeceb; color: #b42318; }
.sd-phase-inactive,     .km-phase.km-phase--inactive     { background: #fdf1e3; color: #a25d00; }

/* A dropdown row: the institution's own name for the status, then the phase the system acts on.
   The name is what you read; the badge is what you check. */
.km-choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; width: 100%; }
.km-choice-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* The text-only variant: colour without the chip background. */
.sd-phase-text { background: none !important; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */

.sd-aside-card { padding: 16px 18px; }
.sd-aside-title {
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-3, #7a8499); padding-bottom: 10px; border-bottom: 1px solid var(--border-soft, #eceef2);
}
.sd-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
         padding: 8px 0; border-bottom: 1px solid #f5f6f8; font-size: 12.5px; }
.sd-kv > span:first-child { color: var(--text-2, #4a5468); flex-shrink: 0; }
.sd-kv > span:last-child { text-align: right; min-width: 0; word-break: break-word; }

/* ── Mock tabs ────────────────────────────────────────────────────────────── */

.sd-mock-banner { display: flex; gap: 12px; padding: 16px 22px; background: #fdf8f0; border-bottom: 1px solid #f5e3c8; }
.sd-mock-badge {
    flex-shrink: 0; align-self: flex-start; padding: 2px 7px; border-radius: 5px;
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    background: #a25d00; color: #fff;
}
.sd-mock-title { font-size: 13.5px; font-weight: 600; color: #7a4a00; }
.sd-mock-why { font-size: 12.5px; color: #8a6a3a; }

/* Dimmed and non-interactive, so placeholder rows cannot be mistaken for records. */
.sd-mock-body { padding: 8px 22px 20px; opacity: 0.45; filter: saturate(0.4); pointer-events: none; user-select: none; }
.sd-mock-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid #f3f5f8; }
.sd-mock-date { width: 48px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
                padding: 5px 0; border: 1px solid var(--border, #e6e8ed); border-radius: 9px; background: #fafbfc; }
.sd-mock-date b { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; font-weight: 500; }
.sd-mock-date span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3, #7a8499); }
.sd-mock-ext { width: 32px; height: 32px; flex-shrink: 0; border-radius: 7px; background: #f0f1fb; color: #3730c4;
               display: flex; align-items: center; justify-content: center;
               font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; font-weight: 500; }
.sd-mock-grow { flex: 1 1 200px; min-width: 0; }
.sd-mock-strong { font-size: 13.5px; font-weight: 500; }
.sd-mock-sub { font-size: 12px; color: var(--text-3, #7a8499); }
.sd-mock-slot { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-2, #4a5468); }
.sd-mock-field { padding: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.sd-mock-field label { font-size: 12.5px; font-weight: 500; color: var(--text-2, #4a5468); }
.sd-mock-input { height: 38px; display: flex; align-items: center; padding: 0 12px;
                 border: 1px solid #e0e3e9; border-radius: 8px; background: #fafbfc; font-size: 13.5px; }
.sd-mock-placeholder { padding: 30px 0; text-align: center; font-size: 13px; color: var(--text-3, #7a8499); }

.sd-empty { padding: 40px 22px; text-align: center; }
.sd-empty-title { font-size: 14px; color: var(--text-3, #7a8499); }
.sd-sync-body { padding: 0 22px 18px; display: flex; flex-direction: column; gap: 8px; }
