/* Session Replay Viewer — design tokens + shell.
   The visual language follows the current KidsTime web standard (kidstime.css tokens / KidsTimeTheme):
   navy ink on the light blue-grey field, white cards with a 1px divider outline and a light shadow,
   pill buttons (one yellow primary per view, tonal secondaries, red destructive), tinted status tags,
   Poppins 400/500/600. The --kt-* tokens below are the single source of colour, radius, shadow and
   spacing for the shell and the kt-* building blocks; html[data-theme="dark"] swaps them for the
   KidsTime dark palette. MudBlazor reads the matching MudTheme palette (App.razor). */
:root {
    color-scheme: light;

    /* Brand / raw hues */
    --kt-navy: #0B204C;
    --kt-navy-2: #14295B;
    --kt-yellow: #FBC30A;            /* primary action fill — never text (1.6:1 on white) */
    --kt-yellow-dark: #E6B009;       /* pressed / hover */
    --kt-on-primary: #0B204C;        /* text on the yellow fill */
    --kt-purple: #832D9B;
    --kt-green: #2CC09C;             /* marks only (dots, bars) — never text */
    --kt-red: #DC2725;
    --kt-red-pressed: #B81F1D;
    --kt-blue: #3794F5;

    /* Surfaces & lines */
    --kt-bg: #F0F4FD;
    --kt-surface: #FFFFFF;
    --kt-surface-hover: #EEF3FC;
    --kt-border: #DCE3F0;
    --kt-border-strong: #B9C7E3;
    --kt-dashed: #B9C7E3;
    --kt-input-border: #D9DFEC;
    --kt-tonal: #E3EAF7;             /* secondary (tonal) buttons, segmented tracks */
    --kt-tonal-pressed: #D5DFF2;
    --kt-brand-fill: #0B204C;        /* selected pill tab */
    --kt-on-brand: #FFFFFF;

    /* Text */
    --kt-ink: #0B204C;
    --kt-muted: #5B6478;             /* secondary text, AA (5.4:1 on the field) */
    --kt-icon-muted: #9298A6;        /* icons, placeholders, separators only */
    --kt-action-text: #832D9B;       /* links / accents as text */
    --kt-focus: #1A64BC;

    /* Status tints (tag = tint background + darker text, AA) */
    --kt-green-bg: #E3F6F0;   --kt-green-text: #0E7A5F;  --kt-green-ink: #0E7A5F;  --kt-green-border: #B5E6D8;
    --kt-blue-bg: #E6F1FE;    --kt-blue-ink: #1A64BC;
    --kt-red-bg: #FCE8E8;     --kt-red-text: #B4201E;    --kt-red-ink: #B4201E;    --kt-red-border: #F3C4C3;
    --kt-grey-bg: #E9EDF4;    --kt-grey-ink: #5B6478;
    --kt-purple-bg: #F3EAF7;  --kt-purple-ink: #832D9B;
    --kt-yellow-bg: #FFF4CC;  --kt-yellow-ink: #8A6200;  --kt-yellow-border: #F0D98A;

    /* Navigation rail */
    --kt-rail: #0B204C;
    --kt-rail-hover: rgba(255, 255, 255, .15);
    --kt-rail-active: rgba(255, 255, 255, .20);
    --kt-rail-icon: rgba(255, 255, 255, .78);

    /* Code blocks */
    --kt-code-bg: #0F172A;
    --kt-code-fg: #F8FAFC;
    --kt-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

    /* Shape, elevation, spacing */
    --kt-radius-sm: 8px;
    --kt-radius-md: 12px;
    --kt-radius-lg: 16px;
    --kt-button-radius: 999px;
    --kt-button-height: 40px;
    --kt-card-shadow: 0 1px 2px rgba(11, 32, 76, .05), 0 2px 10px rgba(11, 32, 76, .06);
    --kt-row-shadow: 0 1px 2px rgba(11, 32, 76, .04);
    --kt-shadow-hover: 0 4px 18px rgba(11, 32, 76, .12);
    --kt-shadow-pop: 0 10px 30px rgba(11, 32, 76, .14);
    --kt-space-xs: 4px;
    --kt-space-sm: 8px;
    --kt-space-md: 16px;
    --kt-space-lg: 24px;
    --kt-space-xl: 32px;

    /* Auth (sign-in) side panel */
    --kt-auth-panel: linear-gradient(160deg, #F6F9FF 0%, #E3EAF7 55%, #DDE6F6 100%);
    --kt-auth-accent: #832D9B;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --kt-yellow: #F2B807;
    --kt-yellow-dark: #D9A406;
    --kt-on-primary: #22215B;
    --kt-purple: #D08BE3;
    --kt-red: #C9302C;
    --kt-red-pressed: #B02A26;
    --kt-blue: #4BA0F7;

    --kt-bg: #0F172A;
    --kt-surface: #1A2540;
    --kt-surface-hover: #223050;
    --kt-border: #31415F;
    --kt-border-strong: #4A5B7D;
    --kt-dashed: #4A5B7D;
    --kt-input-border: #4A5B7D;
    --kt-tonal: #2A3A5C;
    --kt-tonal-pressed: #33466E;
    --kt-brand-fill: #4466AA;
    --kt-on-brand: #FFFFFF;

    --kt-ink: #E7ECF5;
    --kt-muted: #A5B0C4;
    --kt-icon-muted: #8290A8;
    --kt-action-text: #D08BE3;
    --kt-focus: #8CC4FF;

    --kt-green-bg: #12352F;   --kt-green-text: #5EDDB5;  --kt-green-ink: #5EDDB5;  --kt-green-border: #1F5A4E;
    --kt-blue-bg: #142C4D;    --kt-blue-ink: #8CC4FF;
    --kt-red-bg: #3D1A1F;     --kt-red-text: #FF9B97;    --kt-red-ink: #FF9B97;    --kt-red-border: #6B2A2F;
    --kt-grey-bg: #2A3447;    --kt-grey-ink: #B8C1D1;
    --kt-purple-bg: #2E2140;  --kt-purple-ink: #D08BE3;
    --kt-yellow-bg: #2E2A17;  --kt-yellow-ink: #F2B807;  --kt-yellow-border: #6B5712;

    --kt-rail: #131C30;
    --kt-rail-hover: rgba(255, 255, 255, .10);
    --kt-rail-active: rgba(255, 255, 255, .16);
    --kt-rail-icon: #A5B0C4;

    --kt-code-bg: #0B1020;
    --kt-code-fg: #E7ECF5;

    --kt-card-shadow: 0 1px 2px rgba(0, 0, 0, .30);
    --kt-row-shadow: none;
    --kt-shadow-hover: 0 4px 18px rgba(0, 0, 0, .45);
    --kt-shadow-pop: 0 10px 30px rgba(0, 0, 0, .50);

    --kt-auth-panel: linear-gradient(160deg, #24407F 0%, #1B2F66 45%, #172554 100%);
    --kt-auth-accent: #F2B807;
}

html, body {
    font-family: "Poppins", sans-serif;
    background: var(--kt-bg);
    color: var(--kt-ink);
}

h1:focus { outline: none; }
a { color: var(--kt-action-text); }

/* Keyboard focus: one visible ring everywhere (WCAG 2.4.7); mouse clicks stay clean. */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, [role="button"]:focus-visible,
.mud-button-root:focus-visible, .mud-chip:focus-visible, .mud-tab:focus-visible {
    outline: 2px solid var(--kt-focus);
    outline-offset: 2px;
}

.mono { font-family: var(--kt-mono); font-size: 12.5px; word-break: break-all; color: var(--kt-ink); }

/* ── shell: navy rail + menu panel + topbar ────────────────────────────── */
.kt-shell { display: flex; min-height: 100vh; }

.kt-rail {
    position: fixed; inset: 0 auto 0 0; width: 72px; z-index: 1200;
    background: var(--kt-rail);
    display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 4px;
    overflow-y: auto; scrollbar-width: none;
}
.kt-rail::-webkit-scrollbar { display: none; }
.kt-logo {
    width: 44px; height: 44px; border-radius: 14px; margin-bottom: 20px; flex: none;
    background: var(--kt-yellow); color: var(--kt-on-primary);
    display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 18px;
}
.kt-rail .kt-logo:hover { background: var(--kt-yellow-dark); color: var(--kt-on-primary); }
.kt-rail a:not(.kt-logo), .kt-rail button {
    position: relative; width: 48px; height: 48px; border-radius: 12px; border: 0; background: transparent; flex: none;
    display: flex; align-items: center; justify-content: center; color: var(--kt-rail-icon); cursor: pointer; text-decoration: none;
    font-size: 18px; transition: background-color .2s ease, color .2s ease;
}
.kt-rail a:not(.kt-logo):hover, .kt-rail button:hover { background: var(--kt-rail-hover); color: #fff; }
.kt-rail a.active { background: var(--kt-rail-active); color: #fff; }
.kt-rail a.active::before { content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 4px; height: 24px; border-radius: 0 4px 4px 0; background: var(--kt-yellow); }
.kt-rail a:focus-visible, .kt-rail button:focus-visible { outline-color: var(--kt-yellow); outline-offset: -2px; }
.kt-rail .spacer { flex: 1; }
.kt-rail .sep { width: 32px; height: 1px; background: rgba(255, 255, 255, .14); margin: 6px 0; flex: none; }
/* Hover label, like the KidsTime slim sidebar tooltip. */
.kt-rail .tip {
    position: fixed; left: 76px; transform: translateY(0); background: var(--kt-navy); color: #fff; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 1300;
}
.kt-rail a:hover .tip, .kt-rail button:hover .tip, .kt-rail a:focus-visible .tip, .kt-rail button:focus-visible .tip { opacity: 1; }

/* Menu panel (KidsTime "institution menu panel"): the app's sections with labels, as a floating card. */
.kt-menu {
    position: fixed; z-index: 1150; top: 12px; bottom: 12px; left: 84px; width: 232px;
    background: var(--kt-bg); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg);
    box-shadow: var(--kt-card-shadow), 0 6px 24px rgba(11, 32, 76, .06);
    overflow-y: auto; scrollbar-width: thin; display: none; flex-direction: column;
}
.kt-shell.has-menu .kt-menu { display: flex; }
.kt-menu-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--kt-border); }
.kt-menu-title { font-size: 15px; font-weight: 600; color: var(--kt-ink); line-height: 1.3; overflow-wrap: anywhere; }
.kt-menu-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--kt-muted); margin-top: 4px; }
.kt-menu-switch {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 12px; min-height: 28px; border-radius: var(--kt-button-radius);
    background: var(--kt-tonal); color: var(--kt-ink); font-size: 12px; font-weight: 600; text-decoration: none;
}
.kt-menu-switch:hover { background: var(--kt-tonal-pressed); color: var(--kt-ink); }
.kt-menu-section { padding: 10px 0 6px; border-bottom: 1px solid var(--kt-border); }
.kt-menu-section:last-child { border-bottom: 0; }
.kt-menu-section.general { margin-top: auto; border-top: 1px solid var(--kt-border); border-bottom: 0; }
.kt-menu-label { padding: 0 16px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--kt-muted); }
.kt-menu a.kt-menu-item, .kt-menu button.kt-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 14px 6px 13px; border: 0; border-left: 3px solid transparent;
    background: transparent; color: var(--kt-ink); font: 500 14px "Poppins", sans-serif; text-decoration: none; text-align: left; cursor: pointer;
    transition: background-color .15s ease;
}
.kt-menu-item .ico {
    width: 28px; height: 28px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
    background: var(--sec-bg, var(--kt-tonal)); color: var(--sec-fg, var(--kt-ink));
}
.kt-menu-item:hover { background: var(--kt-surface-hover); }
.kt-menu-item.active { background: var(--sec-bg, var(--kt-tonal)); border-left-color: var(--sec-fg, var(--kt-ink)); font-weight: 600; }
.kt-menu-item.active .ico { background: var(--kt-surface); }
.kt-menu-item:focus-visible { outline-offset: -2px; }
.kt-menu-section.sec-blue   { --sec-bg: var(--kt-blue-bg);   --sec-fg: var(--kt-blue-ink); }
.kt-menu-section.sec-green  { --sec-bg: var(--kt-green-bg);  --sec-fg: var(--kt-green-text); }
.kt-menu-section.sec-red    { --sec-bg: var(--kt-red-bg);    --sec-fg: var(--kt-red-text); }
.kt-menu-section.sec-yellow { --sec-bg: var(--kt-yellow-bg); --sec-fg: var(--kt-yellow-ink); }
.kt-menu-section.sec-purple { --sec-bg: var(--kt-purple-bg); --sec-fg: var(--kt-purple-ink); }
.kt-menu-section.general { --sec-bg: var(--kt-grey-bg);  --sec-fg: var(--kt-grey-ink); }
/* On desktop the rail already carries the global links, so the panel only lists the app's sections. */
.kt-menu-section.general { display: none; }

.kt-scrim { display: none; position: fixed; inset: 0; z-index: 1140; background: rgba(11, 16, 32, .5); border: 0; padding: 0; }

.kt-body { flex: 1; margin-left: 72px; min-width: 0; }
.kt-shell.has-menu .kt-body { margin-left: 328px; }

.kt-topbar { display: flex; align-items: center; gap: 16px; min-height: 64px; padding: 10px 24px; }
.kt-burger {
    display: none; width: 44px; height: 44px; flex: none; border: 0; border-radius: 12px; background: transparent; color: var(--kt-action-text);
    align-items: center; justify-content: center; font-size: 20px; cursor: pointer;
}
.kt-burger:hover { background: var(--kt-tonal); }
.kt-greeting { min-width: 0; }
.kt-greeting h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--kt-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-greeting p { margin: 0; font-size: 12px; color: var(--kt-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-user { display: flex; align-items: center; gap: 12px; margin-left: auto; text-align: right; }
.kt-user .name { font-weight: 600; color: var(--kt-action-text); font-size: 14px; line-height: 1.2; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt-user .role { font-size: 12px; color: var(--kt-muted); }
.kt-user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; border: 0; padding: 0 4px; background: transparent; border-radius: 12px; font: inherit; text-align: right; }
.kt-user-menu .who { display: flex; flex-direction: column; }
.kt-user-menu .chev { color: var(--kt-muted); font-size: 12px; }
.kt-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--kt-purple-bg); color: var(--kt-purple-ink); font-weight: 600; font-size: 15px; border: 1px solid var(--kt-border); }
.kt-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 32px; border: 1px solid var(--kt-border); border-radius: var(--kt-button-radius); background: var(--kt-surface); font-size: 12px; font-weight: 500; color: var(--kt-muted); white-space: nowrap; }
.kt-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--kt-green); }

.kt-main { padding: 0 24px 56px; max-width: 1560px; margin: 0 auto; min-width: 0; }

/* ── page header: purple overline, back button, large title, actions, dashed rule ── */
.kt-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding: 28px 0 24px; margin: 0 0 24px; border-bottom: 2px dashed var(--kt-dashed); }
.kt-page-header .titles { flex: 1 1 440px; min-width: 0; }
.kt-overline { font-size: 14px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--kt-action-text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.kt-overline a { color: inherit; text-decoration: none; }
.kt-overline a:hover { text-decoration: underline; }
.kt-title-row { display: flex; align-items: center; gap: 16px; min-width: 0; }
.kt-back {
    width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--kt-tonal); color: var(--kt-ink); text-decoration: none; font-size: 16px;
}
.kt-back:hover { background: var(--kt-tonal-pressed); color: var(--kt-ink); }
.kt-title { margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.15; font-weight: 600; color: var(--kt-ink); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.kt-subtitle { margin-top: 4px; font-size: 14px; color: var(--kt-muted); }
.kt-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── buttons (plain-HTML twin of the MudButton overrides in viewer.css) ── */
.kt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
    min-height: var(--kt-button-height); padding: 8px 20px; border-radius: var(--kt-button-radius); font: 600 14px "Poppins", sans-serif;
    background: var(--kt-yellow); color: var(--kt-on-primary);
}
.kt-btn:hover { background: var(--kt-yellow-dark); color: var(--kt-on-primary); }
.kt-btn:disabled { background: var(--kt-grey-bg); color: var(--kt-muted); cursor: default; opacity: .7; }
.kt-btn.small { min-height: 32px; padding: 5px 14px; font-size: 12.5px; }
.kt-btn.danger { background: var(--kt-red); color: #fff; }
.kt-btn.danger:hover { background: var(--kt-red-pressed); }
.kt-btn.tonal, .kt-btn.ghost, .kt-btn.navy { background: var(--kt-tonal); color: var(--kt-ink); }
.kt-btn.tonal:hover, .kt-btn.ghost:hover, .kt-btn.navy:hover { background: var(--kt-tonal-pressed); }

/* ── segmented filters / status tags ───────────────────────────────────── */
.kt-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; background: var(--kt-tonal); border-radius: 20px; padding: 4px; }
.kt-chip {
    border: 0; background: transparent; color: var(--kt-muted); cursor: pointer; min-height: 32px;
    padding: 6px 16px; border-radius: 999px; font: 500 13px "Poppins", sans-serif; display: inline-flex; align-items: center; gap: 6px;
}
.kt-chip.active { background: var(--kt-surface); color: var(--kt-ink); font-weight: 600; box-shadow: var(--kt-card-shadow); }
.kt-chip .count { background: var(--kt-tonal); border-radius: 999px; padding: 0 6px; font-size: 11px; }

/* StatusTag: tinted background + darker text of the same hue (never white on a bright fill). */
.kt-status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 18px; }
.kt-status-chip.green, .kt-status-chip.soft-green { background: var(--kt-green-bg); color: var(--kt-green-text); }
.kt-status-chip.yellow, .kt-status-chip.soft-yellow { background: var(--kt-yellow-bg); color: var(--kt-yellow-ink); }
.kt-status-chip.red, .kt-status-chip.soft-red { background: var(--kt-red-bg); color: var(--kt-red-text); }
.kt-status-chip.blue, .kt-status-chip.soft-blue { background: var(--kt-blue-bg); color: var(--kt-blue-ink); }
.kt-status-chip.grey { background: var(--kt-grey-bg); color: var(--kt-grey-ink); }
.kt-status-chip.purple { background: var(--kt-purple-bg); color: var(--kt-purple-ink); }

/* ── cards & stats ─────────────────────────────────────────────────────── */
.kt-card { background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg); box-shadow: var(--kt-card-shadow); padding: 24px; margin-bottom: 24px; }
.kt-card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 20px; font-weight: 600; color: var(--kt-ink); }
.kt-card-title .mud-icon-root, .kt-card-title > i { color: var(--kt-action-text); }
.kt-muted { color: var(--kt-muted); font-size: 13px; }

.kt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kt-stat { background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg); box-shadow: var(--kt-card-shadow); padding: 16px 20px; min-width: 0; }
.kt-stat .label { font-size: 12.5px; font-weight: 500; color: var(--kt-muted); }
.kt-stat .value { font-size: 28px; font-weight: 600; line-height: 1.25; margin-top: 4px; color: var(--kt-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kt-stat .value small { font-size: 13px; font-weight: 500; color: var(--kt-muted); }
.kt-stat.green { border-left: 4px solid var(--kt-green); }
.kt-stat.green .value { color: var(--kt-green-ink); }
.kt-stat.red { border-left: 4px solid var(--kt-red); }
.kt-stat.red .value { color: var(--kt-red-ink); }
.kt-stat.yellow { border-left: 4px solid var(--kt-yellow); }
.kt-stat.yellow .value { color: var(--kt-ink); }

/* ── list rows: tables rendered as KidsTime list-row cards ─────────────── */
.kt-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.kt-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--kt-muted); padding: 0 16px 2px; white-space: nowrap; }
.kt-table td { background: var(--kt-surface); padding: 14px 16px; font-size: 14px; font-weight: 500; vertical-align: middle; border-top: 1px solid var(--kt-border); border-bottom: 1px solid var(--kt-border); }
.kt-table td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid var(--kt-border); }
.kt-table td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid var(--kt-border); }
.kt-table tr.clickable td { cursor: pointer; }
.kt-table tr.clickable:hover td { background: var(--kt-surface-hover); }
.kt-table .strong { font-weight: 600; }
.kt-table .right { text-align: right; }
.kt-table .sub { display: block; font-size: 12px; color: var(--kt-muted); font-weight: 400; }

/* Empty state: dashed outline, icon in a tonal circle, a semibold title and one secondary line. */
.kt-empty { text-align: center; padding: 32px 20px; color: var(--kt-muted); font-size: 14px; background: transparent; border: 1px dashed var(--kt-border-strong); border-radius: var(--kt-radius-md); }
.kt-empty .kt-empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--kt-tonal); color: var(--kt-ink); font-size: 22px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; }
.kt-empty .kt-empty-title { font-size: 18px; font-weight: 600; color: var(--kt-ink); margin-bottom: 2px; }

/* Loading skeleton (list rows / tiles) — replaces a bare progress bar while the first page loads. */
.kt-skel-list { display: flex; flex-direction: column; gap: 8px; }
.kt-skel-row { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-md); }
.kt-skel-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.kt-skel-tile { padding: 20px; background: var(--kt-surface); border: 1px solid var(--kt-border); border-radius: var(--kt-radius-lg); display: flex; flex-direction: column; gap: 12px; }
.kt-skel {
    height: 12px; border-radius: 6px; flex: none;
    background: linear-gradient(90deg, var(--kt-tonal) 25%, var(--kt-surface-hover) 50%, var(--kt-tonal) 75%); background-size: 200% 100%;
    animation: kt-skel 1.4s ease-in-out infinite;
}
.kt-skel.circle { width: 36px; height: 36px; border-radius: 50%; }
.kt-skel.grow { flex: 1; }
@keyframes kt-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .kt-skel { animation: none; } }

/* ── forms ─────────────────────────────────────────────────────────────── */
.kt-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

pre.snippet { background: var(--kt-code-bg); color: var(--kt-code-fg); padding: 14px 16px; border-radius: var(--kt-radius-md); overflow-x: auto; font-size: 12.5px; margin: 6px 0 18px; }

/* Theme switch = segmented control (tonal track, raised selected segment). */
.kt-lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--kt-tonal); flex: none; }
.kt-lang button { border: 0; background: transparent; width: 36px; height: 30px; border-radius: 999px; font: 600 12px "Poppins", sans-serif; color: var(--kt-muted); cursor: pointer; }
.kt-lang button.on { background: var(--kt-surface); color: var(--kt-ink); box-shadow: var(--kt-card-shadow); }

/* ── sign in / register / activate: split screen (brand panel + form) ──── */
.kt-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 41%) 1fr; }
.kt-auth-side { position: relative; overflow: hidden; background: var(--kt-auth-panel); padding: 56px; display: flex; flex-direction: column; }
.kt-auth-brand { display: flex; align-items: center; gap: 14px; font-size: 24px; font-weight: 600; color: var(--kt-ink); }
.kt-auth-brand .kt-logo { margin: 0; width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.kt-auth-pitch { margin: auto 0; padding: 40px 0; }
.kt-auth-pitch h2 { margin: 0 0 20px; font-size: clamp(1.8rem, 1rem + 2vw, 2.6rem); line-height: 1.15; font-weight: 600; color: var(--kt-ink); }
.kt-auth-pitch h2 span { color: var(--kt-auth-accent); display: block; }
.kt-auth-pitch p { margin: 0 0 24px; font-size: 16px; color: var(--kt-muted); max-width: 30em; }
.kt-auth-pitch ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.kt-auth-pitch li { display: flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 500; color: var(--kt-ink); }
.kt-auth-pitch li i { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--kt-surface); color: var(--kt-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; box-shadow: var(--kt-card-shadow); }
.kt-auth-dot { position: absolute; border-radius: 50%; opacity: .55; }
.kt-auth-foot { font-size: 13px; color: var(--kt-muted); }
html[data-theme="dark"] .kt-auth-side .kt-auth-brand, html[data-theme="dark"] .kt-auth-pitch h2, html[data-theme="dark"] .kt-auth-pitch li { color: #FFFFFF; }
html[data-theme="dark"] .kt-auth-pitch p, html[data-theme="dark"] .kt-auth-foot { color: #C9D3E8; }
html[data-theme="dark"] .kt-auth-pitch li i { background: rgba(255, 255, 255, .14); color: var(--kt-yellow); box-shadow: none; }

.kt-login { display: flex; align-items: center; justify-content: center; padding: 40px 24px; position: relative; }
.kt-login-card { width: 100%; max-width: 480px; }
.kt-login-card .kt-logo { display: none; margin: 0 0 20px; width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.kt-login-card h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); font-weight: 600; margin: 0 0 6px; color: var(--kt-ink); }
.kt-login-card .kt-login-sub { font-size: 15px; color: var(--kt-muted); margin: 0 0 28px; }
.kt-login-card form, .kt-login-card .kt-login-body { text-align: left; }
.kt-login-card .mud-button-root.mud-button[class*="-size-large"] { min-height: 52px; font-size: 16px; }
.kt-login-foot { margin-top: 20px; font-size: 14px; color: var(--kt-muted); text-align: center; }
.kt-login-foot a { color: var(--kt-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.kt-divider { display: flex; align-items: center; gap: 10px; color: var(--kt-muted); font-size: 12px; margin: 22px 0; }
.kt-divider::before, .kt-divider::after { content: ""; flex: 1; height: 1px; background: var(--kt-border); }

/* ── responsive ────────────────────────────────────────────────────────── */
/* < 1200px: the menu panel leaves the page and becomes a drawer opened with the topbar hamburger. */
@media (max-width: 1199.98px) {
    .kt-shell.has-menu .kt-body { margin-left: 72px; }
    .kt-shell.has-menu .kt-menu { display: none; }
    .kt-shell.has-menu .kt-burger { display: inline-flex; }
    .kt-shell.nav-open .kt-menu { display: flex; top: 0; bottom: 0; left: 72px; width: min(300px, calc(100vw - 72px)); border-radius: 0 16px 16px 0; border-left: 0; box-shadow: var(--kt-shadow-pop); }
    .kt-shell.nav-open .kt-scrim { display: block; }
}

/* < 768px: the rail is hidden too; hamburger opens rail + labelled menu together (KidsTime mobile drawer). */
@media (max-width: 767.98px) {
    .kt-rail { display: none; }
    .kt-shell.nav-open .kt-rail { display: flex; }
    .kt-shell .kt-burger { display: inline-flex; }
    .kt-body, .kt-shell.has-menu .kt-body { margin-left: 0; }
    .kt-shell.nav-open .kt-menu-section.general { display: block; }
    .kt-topbar { padding: 8px 16px; gap: 8px; }
    .kt-topbar .kt-status, .kt-user .who, .kt-user-menu .chev { display: none; }
    .kt-greeting h2 { font-size: 15px; }
    .kt-main { padding: 0 16px 40px; }
    .kt-page-header { padding: 16px 0 20px; margin-bottom: 20px; }
    .kt-title-row { gap: 12px; }
    .kt-actions { width: 100%; }
    .kt-table td, .kt-table th { padding-left: 10px; padding-right: 10px; }
    .kt-card { padding: 16px; }
    .kt-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
    .kt-stat { padding: 12px 14px; }
    .kt-stat .value { font-size: 22px; }
}

@media (max-width: 899.98px) {
    .kt-auth { grid-template-columns: 1fr; }
    .kt-auth-side { display: none; }
    .kt-login { align-items: flex-start; padding: 12vh 20px 24px; }
    .kt-login-card .kt-logo { display: flex; }
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

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

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

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--kt-border);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--kt-yellow);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: var(--kt-ink);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

