/* ── Base ─────────────────────────────────────────────── */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(12px, -18px) scale(1.05); }
    66% { transform: translate(-8px, 10px) scale(0.95); }
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

.animate-in {
    animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

.page-enter {
    animation: pageEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
    .animate-in,
    .page-enter,
    .app-brand__logo--hero,
    .auth-shell__orb,
    .status-dot--online {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .stat-card:hover,
    .action-btn:hover,
    .top-nav-link:hover {
        transform: none !important;
    }
}

/* ── App shell / top navigation ───────────────────────── */
.app-bar .mud-toolbar-appbar,
.app-bar-toolbar {
    flex-wrap: nowrap !important;
    gap: 0.25rem;
    overflow: hidden;
}

.app-bar .nav-menu {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.app-bar .top-nav--desktop {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.app-bar .top-nav--desktop::-webkit-scrollbar {
    display: none;
}

.app-bar .top-nav-link,
.app-bar .top-nav-dropdown {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Brand ────────────────────────────────────────────── */
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}

.app-brand--link {
    transition: opacity 0.2s ease;
}

.app-brand--link:hover {
    opacity: 0.92;
}

.app-brand__logo {
    display: block;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.app-brand--link:hover .app-brand__logo {
    transform: scale(1.05) rotate(-2deg);
}

.app-brand__logo--bar {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.app-brand__logo--hero {
    animation: logoFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 8px 20px rgba(89, 74, 226, 0.35));
}

.app-brand__title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

@media (max-width: 959px) {
    .app-bar-brand .app-brand__title {
        display: none;
    }

    .app-bar-brand {
        margin-left: 0.15rem;
    }
}

.auth-brand {
    justify-content: center;
    width: 100%;
}

.auth-title {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

/* ── Auth shell (login) ───────────────────────────────── */
.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(145deg, #f0f2fa 0%, #e8ecf8 40%, #f4f6fb 100%);
}

.auth-shell__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-shell__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: orbDrift 12s ease-in-out infinite;
}

.auth-shell__orb--1 {
    width: 320px;
    height: 320px;
    top: -80px;
    right: -60px;
    background: rgba(89, 74, 226, 0.22);
}

.auth-shell__orb--2 {
    width: 260px;
    height: 260px;
    bottom: -40px;
    left: -40px;
    background: rgba(14, 165, 233, 0.18);
    animation-delay: -4s;
}

.auth-shell__orb--3 {
    width: 180px;
    height: 180px;
    top: 40%;
    left: 55%;
    background: rgba(119, 107, 231, 0.15);
    animation-delay: -8s;
}

.auth-shell__container {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 16px !important;
    border: 1px solid rgba(89, 74, 226, 0.08);
    backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(89, 74, 226, 0.12) !important;
}

/* Setup wizard — taller form; allow scroll (login shell clips overflow) */
.auth-shell--setup {
    overflow-x: hidden;
    overflow-y: auto;
    align-items: flex-start;
    padding: 1.5rem 0 2.5rem;
}

.auth-shell__container--setup {
    margin-top: 0;
    margin-bottom: 0;
}

.auth-card--setup {
    max-width: 560px;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.auth-field label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

.auth-field-icon {
    opacity: 0.7;
}

.auth-field input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field input:focus {
    outline: none;
    border-color: #594ae2;
    box-shadow: 0 0 0 3px rgba(89, 74, 226, 0.15);
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #64748b;
}

.auth-submit {
    border-radius: 10px !important;
    padding: 0.65rem 1rem !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(89, 74, 226, 0.3);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-links__sep {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ── Dashboard ────────────────────────────────────────── */
.dashboard-hero {
    background: linear-gradient(135deg, rgba(89, 74, 226, 0.08) 0%, rgba(14, 165, 233, 0.06) 100%);
    border: 1px solid rgba(89, 74, 226, 0.1);
    border-radius: 16px !important;
}

.dashboard-avatar {
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 14px rgba(89, 74, 226, 0.25);
}

.dashboard-greeting {
    letter-spacing: -0.02em;
}

.stat-card {
    border-radius: 14px !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1) !important;
    border-color: rgba(89, 74, 226, 0.12);
}

.stat-card__value {
    font-weight: 700 !important;
    letter-spacing: -0.02em;
}

.stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    transition: transform 0.25s ease;
}

.stat-card:hover .stat-card__icon {
    transform: scale(1.08) rotate(-3deg);
}

.stat-card__icon--primary {
    background: rgba(89, 74, 226, 0.12);
    color: #594ae2;
}

.stat-card__icon--info {
    background: rgba(14, 165, 233, 0.12);
    color: #0ea5e9;
}

.stat-card__icon--success {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot--online {
    background: #16a34a;
    animation: statusPulse 2s ease-in-out infinite;
}

.quick-actions {
    border-radius: 14px !important;
}

.action-btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.rounded-progress {
    border-radius: 4px;
}

/* ── Dark mode tweaks ─────────────────────────────────── */
.mud-theme-dark .auth-shell {
    background: linear-gradient(145deg, #121218 0%, #1a1a24 50%, #121218 100%);
}

.mud-theme-dark .auth-field label {
    color: #94a3b8;
}

.mud-theme-dark .auth-field input {
    background: #1e1e28;
    border-color: #334155;
    color: #f1f5f9;
}

.mud-theme-dark .auth-card {
    border-color: rgba(119, 107, 231, 0.15);
}

.mud-theme-dark .dashboard-hero {
    background: linear-gradient(135deg, rgba(119, 107, 231, 0.12) 0%, rgba(56, 189, 248, 0.06) 100%);
    border-color: rgba(119, 107, 231, 0.15);
}

/* ── Notifications ────────────────────────────────────── */
.notification-badge .mud-badge-badge {
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
}

.notification-item--unread {
    background: rgba(119, 107, 231, 0.08);
}

.notification-card {
    border-radius: 12px;
    border: 1px solid rgba(119, 107, 231, 0.12);
}

.notification-card--read {
    opacity: 0.75;
}
