html, body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

:root {
    --cmms-primary: #3d6b7f;
    --cmms-primary-dark: #2c5364;
    --cmms-primary-light: #4a90a4;
    --cmms-primary-tint: #eaf2f5;
    --cmms-gradient-chrome: linear-gradient(135deg, var(--cmms-primary) 0%, var(--cmms-primary-dark) 100%);
    --cmms-muted: #5d6b7a;
    --cmms-line-soft: #e9eef3;
    --cmms-line-input: #b9c6d4;
    --cmms-canvas: #f4f6f9;
    --cmms-radius-card: 8px;
    --cmms-radius-hero: 12px;
    --cmms-shadow-overlay: 0 18px 48px rgba(15, 32, 39, 0.28);
    --cmms-font: "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.boot {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 32px 24px;
    box-sizing: border-box;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(61, 107, 127, 0.35), transparent 55%),
        linear-gradient(160deg, #1a3348 0%, #0f2027 55%, #0a161c 100%);
    color: #fff;
    text-align: center;
    font-family: var(--cmms-font);
}

.boot-mark {
    position: relative;
    width: 88px;
    height: 88px;
    margin-bottom: 22px;
    display: grid;
    place-items: center;
}

.boot-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    animation: boot-logo-pulse 1.8s ease-in-out infinite;
}

.boot-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: #7eb6c9;
    border-right-color: rgba(126, 182, 201, 0.45);
    animation: boot-spin 0.9s linear infinite;
}

.boot-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    animation: boot-fade-up 0.55s ease-out both;
}

.boot-sub {
    margin-top: 8px;
    max-width: 320px;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
    animation: boot-fade-up 0.55s ease-out 0.12s both;
}

.boot-progress {
    width: min(220px, 70vw);
    height: 3px;
    margin-top: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    animation: boot-fade-up 0.55s ease-out 0.22s both;
}

.boot-progress-bar {
    display: block;
    width: 12%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4a90a4, #a8d4e0, #4a90a4);
    background-size: 200% 100%;
    transition: width 180ms ease;
    animation: boot-progress-slide 1.35s ease-in-out infinite;
}

@keyframes boot-spin {
    to { transform: rotate(360deg); }
}

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

@keyframes boot-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes boot-progress-slide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
    .boot-logo,
    .boot-ring,
    .boot-title,
    .boot-sub,
    .boot-progress,
    .boot-progress-bar {
        animation: none;
    }

    .boot-ring {
        border-color: rgba(126, 182, 201, 0.55);
    }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
}

.validation-message {
    color: #dc3545;
    font-size: 12px;
}

.app-drawer nav a.nav-link {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    color: rgba(255, 255, 255, 0.82) !important;
    border-radius: 4px;
    margin: 1px 0;
    padding: 7px 10px;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.8125rem;
    box-sizing: border-box;
    line-height: 1.25;
    border: 1px solid transparent;
}

.app-drawer nav a.nav-link:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
}

.app-drawer nav a.nav-link.active {
    border-color: rgba(139, 208, 255, 0.34);
    background: rgba(139, 208, 255, 0.16);
    color: #fff !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #8bd0ff;
}

.app-drawer nav a.nav-link.nav-link-nested {
    padding-left: 36px;
}

.app-drawer nav span.nav-link.disabled {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: rgba(255, 255, 255, 0.45) !important;
    border-radius: 4px;
    margin: 1px 0;
    padding: 7px 10px;
    font-weight: 500;
    font-size: 0.8125rem;
    box-sizing: border-box;
    line-height: 1.25;
    opacity: 0.7;
    cursor: not-allowed;
}

.app-drawer nav span.nav-link.disabled.nav-link-nested {
    padding-left: 36px;
}

.mgmt-page,
.identity-card {
    max-width: 1100px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.identity-card {
    max-width: 480px;
    margin: 48px auto;
}

.mgmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.mgmt-page h1,
.identity-card h1 {
    margin: 0 0 12px;
    color: #333;
}

.mgmt-note,
.mgmt-hint {
    color: #555;
    margin: 0 0 16px;
}

.mgmt-ok {
    color: #2e7d32;
}

.mgmt-table-wrap {
    overflow-x: auto;
}

.mgmt-table {
    width: 100%;
    border-collapse: collapse;
}

.mgmt-table th,
.mgmt-table td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e6eef2;
}

.mgmt-table th {
    color: #555;
    font-size: 0.85rem;
}

.field-label {
    display: block;
    margin: 0 0 6px;
    color: #555;
    font-size: 0.85rem;
}

.field-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    border: 1px solid #b9c6d4;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    padding: 16px;
}

.modal {
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.btn-text,
.btn-primary {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-text {
    background: transparent;
    color: #3d6b7f;
}

.btn-primary {
    background: #3d6b7f;
    color: #fff;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.dialog-error {
    color: #d32f2f;
    margin: 0 0 8px;
}

