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

.mud-picker-paper {
    min-width: 310px !important;
}

/* M3-style nav items: inset from drawer edges, spaced, rounded corners */
.mud-navmenu {
    padding: 4px 8px !important;
    box-sizing: border-box !important;
}

.mud-nav-link {
    border-radius: var(--mud-default-borderradius) !important;
    margin-bottom: 4px !important;
}

.mud-nav-group-title {
    border-radius: var(--mud-default-borderradius) !important;
    margin-bottom: 4px !important;
}

.region-stats-panel {
    width: 40%;
    min-width: 160px;
    border-right: 1px solid var(--mud-palette-divider);
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    height: 250px;
    overflow: hidden;
    container-type: inline-size;
}

.region-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.3rem 0.5rem;
    overflow: hidden;
}


h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.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;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1s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OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
}

.splash-dark .loading-splash {
    background: #0f172a;
}

@keyframes logo-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.92); }
}

.loading-logo {
    width: 8rem;
    height: 8rem;
    object-fit: contain;
    animation: logo-pulse 1.8s ease-in-out infinite;
}

code {
    color: #c02d76;
}

.card-lift {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
    border-radius: var(--mud-default-borderradius);
}

.card-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

/* Header attribute that flows under the title on small screens but right-aligns
   on wider screens (MudBlazor md breakpoint = 960px). */
.header-attr {
    align-items: flex-start;
    text-align: left;
}

@media (min-width: 960px) {
    .header-attr {
        align-items: flex-end;
        text-align: right;
    }
}

.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;
}

.mud-alert .mud-alert-icon {
    align-self: center;
}

/* Sticky table headers: the container scrolls (FixedHeader pins the header). max-height
   (not a fixed height) means short tables render naturally with no empty space. The base
   cap suits tables with content below them (forms, lookup add-rows) — they scroll
   internally without pushing those controls off-screen. Works inside overflow-x:auto wrappers. */
.mud-table.sticky-table .mud-table-container {
    overflow-y: auto;
    max-height: 70vh;
    /* Match the paper's rounded corners so scrolled rows clip cleanly at the corners. */
    border-radius: inherit;
}

/* "Fill" tables (the table is the last content on the page) auto-fit to a uniform gap
   above the viewport bottom. js/sticky-tables.js measures each table's position and sets
   an exact max-height; the rule below is only the fallback before that script runs. */
.mud-table.sticky-table-fill .mud-table-container {
    max-height: max(240px, calc(100dvh - 240px));
}

/* Generic "fill" scroll container for non-MudTable layouts. js/sticky-tables.js sizes the
   max-height at runtime; this rule is the fallback before that script runs. */
.sticky-fill-scroll {
    overflow-y: auto;
    overflow-x: auto;
    max-height: max(240px, calc(100dvh - 240px));
    /* No border-radius here: this class sits directly on a MudPaper, so let .mud-paper's own
       radius apply. overflow:auto then clips the sticky header/rows to those rounded corners.
       (`border-radius: inherit` would override the paper and inherit the parent's 0, squaring
       off the corners — unlike the .mud-table-container rule above, which is a paper child.) */
}

/* Teaching Events list: a custom grid layout (not MudTable) so each month section bounds
   its own sticky header, giving the "push" effect as one month scrolls past the next. */
.teaching-table {
    /* Shared column template — applied identically to the column header and every data row.
       Only fixed/fr units (no content-based sizing) so independent grid rows stay aligned. */
    --ct-teaching-cols: 5rem 2fr 1.5fr 6rem 7rem;
    --ct-teaching-colhead-h: 2.25rem; /* column header height == month header's sticky top */
    width: 100%;
    /* Keep every event on a single row; on narrow/mobile screens the scroll container
       (overflow-x: auto) scrolls sideways instead of squeezing/wrapping the columns. */
    min-width: 41rem;
    font-size: 0.875rem;
}

.teaching-colhead,
.teaching-row {
    display: grid;
    grid-template-columns: var(--ct-teaching-cols);
    align-items: center;
    column-gap: 16px;
    padding: 4px 16px;
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

/* Column header: pinned at the very top of the scroll container. */
.teaching-colhead {
    position: sticky;
    top: 0;
    z-index: 3;
    height: var(--ct-teaching-colhead-h);
    padding-block: 0;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    font-weight: 600;
}

/* Month header: pinned directly below the column header. Because it lives inside its
   .teaching-month section, it is pushed up and out as that month scrolls past. */
.teaching-monthhead {
    position: sticky;
    top: var(--ct-teaching-colhead-h);
    z-index: 2;
    padding: 4px 16px;
    background-color: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-table-lines);
    font-weight: 600;
}

/* Nudge the month label down so it sits lower in its row. */
.teaching-monthhead > span {
    position: relative;
    top: 0.5px;
}

.teaching-row:hover {
    background-color: var(--mud-palette-table-hover);
}

.teaching-date {
    white-space: nowrap;
}