html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Falls back to the light background before the MudBlazor theme variables load. */
    background: var(--mud-palette-background, #F1F5F9);
}

/* ── Page content (below the app bar) ───────────────────────────────────────── */
.page-content {
    padding: 5rem 1rem 2rem;
}

@media (min-width: 960px) {
    .page-content {
        padding: 5rem 2rem 2rem;
    }
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.mud-drawer {
    background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%) !important;
}

.mud-nav-link {
    color: #94A3B8 !important;
    font-size: 0.855rem !important;
    border-radius: 8px !important;
    margin: 1px 6px !important;
    padding: 0 10px !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.mud-nav-link:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #E2E8F0 !important;
}

.mud-nav-link.active {
    background: rgba(37,99,235,0.22) !important;
    color: #93C5FD !important;
    font-weight: 600 !important;
}

.mud-nav-link .mud-icon-root {
    font-size: 1.05rem !important;
    color: inherit !important;
}

/* ── Cards / Papers ─────────────────────────────────────────────────────────── */
.mud-paper {
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04) !important;
}

.mud-paper.mud-elevation-2 {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05) !important;
}

.mud-paper.mud-elevation-4 {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06) !important;
}

/* ── AppBar ─────────────────────────────────────────────────────────────────── */
.mud-appbar {
    border-radius: 0 !important;
}

/* ── Table ──────────────────────────────────────────────────────────────────── */
.mud-table {
    border-radius: 12px !important;
    overflow: hidden;
}

.mud-table-row:hover td {
    background: var(--mud-palette-table-hover) !important;
}

/* Wide tables scroll sideways on phones instead of blowing up the page width. */
.mud-table-container {
    overflow-x: auto;
}

/* ── Chips ──────────────────────────────────────────────────────────────────── */
.mud-chip {
    font-size: 0.72rem !important;
    height: 22px !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.mud-button-root {
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
}

/* ── Expansion panels ───────────────────────────────────────────────────────── */
.mud-expand-panel {
    border-radius: 10px !important;
    margin-bottom: 4px !important;
}

/* ── Login / 2FA form inputs (static SSR — Bootstrap form-control) ──────────── */
.form-control {
    display: block;
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    color: #1e293b;
    background-color: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: #ffffff;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    accent-color: #2563eb;
    cursor: pointer;
}

.mud-input-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

/* ── Form validation ────────────────────────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #10B981; }
.invalid                             { outline: 1px solid #EF4444; }
.validation-message                  { color: #EF4444; font-size: 0.8rem; margin-top: 0.25rem; }

/* ── Error boundaries ───────────────────────────────────────────────────────── */
.blazor-error-boundary {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: #991B1B;
    font-size: 0.875rem;
}

#blazor-error-ui {
    background: #FEF3C7;
    border-top: 1px solid #FCD34D;
    color: #92400E;
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}
