html,
body {
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0;
}

body {
    margin: 0;
    min-width: 320px;
}

a {
    color: inherit;
}

h1:focus {
    outline: none;
}

.admin-appbar {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-shell-title {
    font-weight: 700;
}

.admin-user-actions {
    max-width: min(42vw, 420px);
}

.admin-user-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-sign-out-button {
    white-space: nowrap;
}

.admin-drawer {
    border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-nav-header {
    align-items: center;
    display: flex;
    gap: 12px;
    min-height: 72px;
    padding: 16px 20px 10px;
}

.admin-nav {
    padding: 6px 10px 16px;
}

.admin-nav .mud-nav-link {
    font-size: 0.95rem;
    min-height: 40px;
}

.admin-nav .mud-nav-link-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.admin-nav-header .mud-typography-subtitle2 {
    font-size: 0.95rem;
    font-weight: 700;
}

.admin-nav-header .mud-typography-caption {
    font-size: 0.78rem;
}

.admin-main {
    min-height: 100vh;
}

.admin-container {
    padding: 24px;
}

.admin-page-header {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.admin-page-kicker {
    color: var(--mud-palette-text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.admin-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    height: 100%;
}

.admin-stat-value {
    font-size: 1.7rem;
    font-weight: 750;
    line-height: 1.1;
}

.admin-muted {
    color: var(--mud-palette-text-secondary);
}

.admin-api-error {
    margin-bottom: 16px;
}

.admin-status-chip {
    max-width: 100%;
    width: fit-content;
}

.admin-dialog-backdrop {
    align-items: center;
    background: rgba(15, 23, 42, 0.58);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 1400;
}

.admin-dialog {
    border-radius: 8px;
    max-width: min(560px, 100%);
    padding: 22px;
    width: 100%;
}

.admin-metadata {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 8px;
    font-size: 0.82rem;
    max-height: 54vh;
    overflow: auto;
    padding: 14px;
    white-space: pre-wrap;
}

.auth-panel {
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    display: flex;
    gap: 16px;
    max-width: 620px;
    padding: 22px;
}

.auth-panel .mud-button {
    min-width: 112px;
    white-space: nowrap;
}

.admin-auth-shell {
    align-items: center;
    background: var(--mud-palette-background);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.admin-auth-panel {
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 420px;
    padding: 34px;
    text-align: center;
    width: 100%;
}

.admin-auth-logo {
    align-items: center;
    background: rgba(15, 118, 110, 0.12);
    border-radius: 8px;
    color: var(--mud-palette-primary);
    display: flex;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.admin-auth-logo-warning {
    background: rgba(180, 83, 9, 0.13);
    color: var(--mud-palette-warning);
}

.admin-auth-copy {
    max-width: 32ch;
}

.admin-auth-primary-action {
    margin-top: 4px;
    min-width: 210px;
}

.blazor-error-boundary {
    background: #b91c1c;
    color: #fff;
    padding: 1rem;
}

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

#blazor-error-ui {
    background: #fef2f2;
    border-top: 1px solid #fecaca;
    bottom: 0;
    color: #7f1d1d;
    display: none;
    left: 0;
    padding: 0.75rem 1rem;
    position: fixed;
    right: 0;
    z-index: 2000;
}

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

@media (max-width: 720px) {
    .admin-container {
        padding: 16px;
    }

    .auth-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-auth-panel {
        padding: 26px 20px;
    }
}
