:root {
    color-scheme: dark;
    --sa-bg: #060b17;
    --sa-border: rgba(133, 154, 207, 0.14);
    --sa-text: #f5f7fb;
    --sa-muted: #a4afca;
    --sa-blue: #35b8ff;
    --sa-purple: #ac4eff;
    --sa-orange: #ff8b3d;
}

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(53, 184, 255, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(172, 78, 255, 0.18), transparent 25%),
        linear-gradient(180deg, #07101f 0%, #050915 55%, #060b17 100%);
    color: var(--sa-text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.mud-main-content {
    padding-top: 0;
}

.sa-muted-text {
    color: var(--sa-muted);
}

.sa-gradient-text {
    background: linear-gradient(90deg, var(--sa-blue) 0%, #6d8dff 32%, #c35aff 63%, var(--sa-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sa-hero,
.sa-section {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.sa-home-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3.25rem 0 4rem;
}

.sa-login-root {
    min-height: 100vh;
}

.sa-brand {
    display: inline-flex;
    align-items: center;
}

.sa-brand-logo {
    width: clamp(9rem, 14vw, 11rem);
    height: auto;
}

.sa-user-button {
    color: #f5f7fb !important;
    border-color: rgba(134, 160, 217, 0.22) !important;
    background: rgba(10, 16, 31, 0.4);
    min-height: 2rem;
    padding-inline: 1rem !important;
    border-radius: 999px !important;
}

.sa-user-menu .mud-popover-paper {
    padding: 0.35rem;
    border: 1px solid rgba(129, 150, 204, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(13, 20, 37, 0.98), rgba(8, 13, 26, 0.95));
    box-shadow: 0 20px 40px rgba(1, 6, 16, 0.35);
}

.sa-user-menu .mud-list {
    padding: 0;
    background: transparent;
}

.sa-user-menu .mud-list-item {
    min-height: 3.05rem !important;
    padding: 0.8rem 1rem !important;
    border-radius: 999px !important;
    margin: 0 !important;
}

.sa-user-menu .mud-list-item:hover,
.sa-user-menu .mud-list-item:focus-visible {
    background: rgba(53, 184, 255, 0.12) !important;
    border-radius: 999px !important;
}

.sa-notification-button {
    color: #f5f7fb !important;
    background: rgba(10, 16, 31, 0.32);
}

.sa-notification-badge {
    display: inline-flex;
    overflow: visible;
    padding-top: 0.2rem;
}

.sa-notification-badge .mud-badge-root {
    overflow: visible;
}

.sa-notification-badge .mud-badge {
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    top: 0.15rem !important;
    right: 0.1rem !important;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.2rem;
    box-shadow: 0 0 0 2px rgba(7, 16, 31, 0.95);
}

.sa-notification-badge .mud-badge.mud-badge-top.right {
    inset: unset !important; 
}

.sa-notification-menu .mud-popover-paper {
    width: min(92vw, 24rem);
    padding: 0;
    border: 1px solid rgba(129, 150, 204, 0.12);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(13, 20, 37, 0.98), rgba(8, 13, 26, 0.95));
    box-shadow: 0 20px 40px rgba(1, 6, 16, 0.35);
}

.sa-notification-panel {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
}

.sa-notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sa-notification-panel-header strong {
    display: block;
}

.sa-notification-panel-header span {
    color: var(--sa-muted);
    font-size: 0.82rem;
}

.sa-notification-list {
    display: grid;
    gap: 0.7rem;
    max-height: 26rem;
    overflow: auto;
}

.sa-notification-item {
    display: grid;
    gap: 0.45rem;
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(128, 150, 210, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--sa-text);
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sa-notification-item:hover {
    background: rgba(53, 184, 255, 0.08);
    border-color: rgba(53, 184, 255, 0.18);
    transform: translateY(-1px);
}

.sa-notification-item.is-unread {
    border-color: rgba(53, 184, 255, 0.26);
    box-shadow: inset 0 0 0 1px rgba(53, 184, 255, 0.08);
}

.sa-notification-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sa-notification-item-header span {
    color: var(--sa-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.sa-notification-item p {
    margin: 0;
    color: #dbe4f6;
    font-size: 0.92rem;
    line-height: 1.4;
}

.sa-notification-item-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sa-notification-item-meta span {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--sa-muted);
    font-size: 0.72rem;
}

.sa-notification-empty {
    color: var(--sa-muted);
    text-align: center;
    padding: 0.75rem 0 0.25rem;
}

.sa-login-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    overflow: hidden;
}

.sa-login-background {
    position: absolute;
    inset: 0;
}

.sa-login-card {
    width: min(100%, 30rem);
    position: relative;
    z-index: 1;
    padding: 2rem;
    border: 1px solid var(--sa-border);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(13, 20, 37, 0.96), rgba(8, 13, 26, 0.92));
    box-shadow: 0 24px 80px rgba(1, 6, 16, 0.38);
}

.sa-login-logo {
    width: 11rem;
    height: auto;
}

.sa-loading-shell {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 3000;
    background: rgba(3, 8, 19, 0.72);
    backdrop-filter: blur(12px);
}

.sa-loading-card {
    min-width: 15rem;
    padding: 1.6rem 1.8rem;
    border: 1px solid rgba(134, 160, 217, 0.16);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(13, 20, 37, 0.96), rgba(8, 13, 26, 0.94));
    box-shadow: 0 24px 80px rgba(1, 6, 16, 0.42);
    text-align: center;
}

.sa-loading-spinner {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--sa-blue);
    border-radius: 999px;
    animation: sa-spin 0.9s linear infinite;
}

.sa-loading-image {
    max-width: 7rem;
    margin-bottom: 1rem;
}

.sa-loading-text {
    color: var(--sa-text);
    font-weight: 600;
}

.sa-hero {
    padding-top: 8rem;
    padding-bottom: 3rem;
}

.sa-hero-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.sa-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(45px);
    opacity: 0.7;
}

.sa-orb-blue {
    top: 2rem;
    left: -2rem;
    width: 14rem;
    height: 14rem;
    background: rgba(53, 184, 255, 0.2);
}

.sa-orb-purple {
    top: 5rem;
    right: 4rem;
    width: 11rem;
    height: 11rem;
    background: rgba(172, 78, 255, 0.22);
}

.sa-grid-glow {
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background:
        linear-gradient(to right, rgba(53, 184, 255, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(53, 184, 255, 0.06) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.85));
    opacity: 0.35;
}

.sa-hero-title {
    max-width: 11ch;
    font-size: clamp(3rem, 8vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.sa-hero-subtitle {
    max-width: 46rem;
    color: var(--sa-muted);
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    line-height: 1.7;
}

.sa-badge {
    width: fit-content;
    padding-inline: 0.6rem;
    border: 1px solid rgba(104, 130, 196, 0.2);
    background: rgba(10, 16, 31, 0.66);
    backdrop-filter: blur(14px);
    color: #dce7ff;
}

.sa-primary-button,
.sa-secondary-button {
    min-width: 12rem;
    height: 3.35rem;
    padding-inline: 1.4rem;
    border-radius: 18px;
    font-size: 1rem;
}

.sa-primary-button {
    color: #08111f !important;
    background: linear-gradient(90deg, var(--sa-blue), #7d67ff 45%, var(--sa-orange));
    box-shadow: 0 18px 45px rgba(73, 150, 255, 0.24);
}

.sa-secondary-button {
    border-color: rgba(134, 160, 217, 0.22) !important;
    color: var(--sa-text) !important;
    background: rgba(10, 16, 31, 0.4);
}

.sa-pill-row {
    padding-top: 0.5rem;
}

.sa-highlight-card,
.sa-feature-card,
.sa-profile-card,
.sa-vision-panel,
.sa-contact-card {
    position: relative;
    overflow: hidden;
    padding: 1.65rem;
    border: 1px solid var(--sa-border);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(13, 20, 37, 0.92), rgba(8, 13, 26, 0.88));
    box-shadow: 0 24px 80px rgba(1, 6, 16, 0.38);
    backdrop-filter: blur(18px);
}

.sa-highlight-card::after,
.sa-feature-card::after,
.sa-profile-card::after,
.sa-vision-panel::after,
.sa-contact-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(53, 184, 255, 0.08), transparent 35%, rgba(172, 78, 255, 0.08));
    pointer-events: none;
}

.sa-kicker {
    color: #7ecfff;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    font-weight: 700;
}

.sa-stat-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sa-stat-box {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(128, 150, 210, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.sa-stat-box span {
    display: block;
    color: var(--sa-muted);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.sa-stat-box strong {
    font-size: 1rem;
}

.sa-section-heading {
    margin-bottom: 1.4rem;
}

.sa-feature-card {
    min-height: 100%;
}

.sa-profile-card {
    padding: 1.8rem;
}

.sa-feature-icon {
    display: grid;
    place-items: center;
    width: 4.1rem;
    height: 4.1rem;
    margin-bottom: 1.2rem;
    border-radius: 22px;
    color: white;
    font-size: 1.65rem;
    font-weight: 700;
}

.sa-blue {
    background: linear-gradient(180deg, #32c0ff, #2b74ff);
}

.sa-purple {
    background: linear-gradient(180deg, #9a55ff, #c642ff);
}

.sa-orange {
    background: linear-gradient(180deg, #ff9c49, #ff6a3d);
}

.sa-mini-list {
    display: grid;
    gap: 0.9rem;
}

.sa-mini-list div {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    color: #d8e1f4;
}

.sa-mini-list span {
    display: inline-flex;
    flex: 0 0 0.55rem;
    width: 0.55rem;
    height: 0.55rem;
    margin-top: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--sa-blue), var(--sa-purple));
    box-shadow: 0 0 18px rgba(58, 184, 255, 0.5);
}

.sa-vision-copy {
    margin-top: 0.6rem;
    max-width: 42rem;
}

.sa-footer-cta {
    padding-bottom: 4rem;
}

.sa-contact-card {
    text-align: center;
}

.sa-profile-help {
    display: flex;
    align-items: center;
    min-height: 100%;
}

.sa-readonly-field .mud-input-slot {
    background: rgba(255, 255, 255, 0.03);
}

.sa-readonly-field input {
    color: var(--sa-text) !important;
    -webkit-text-fill-color: var(--sa-text) !important;
    opacity: 1 !important;
}

.sa-profile-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.sa-form-actions,
.sa-page-header,
.sa-page-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sa-page-header {
    justify-content: space-between;
}

.sa-page-actions,
.sa-form-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.sa-inline-action {
    min-width: 6.75rem;
    min-height: 2.9rem;
    padding-inline: 1rem !important;
    border-radius: 999px !important;
    font-weight: 700;
}

.sa-list-card {
    padding: 1rem 1.1rem;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.02);
}

.sa-list-card-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
}

.sa-list-card-content {
    min-width: 0;
}

.sa-list-card-content strong {
    display: block;
    font-size: 1.08rem;
    word-break: break-word;
}

.sa-list-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--sa-muted);
    font-size: 0.82rem;
}

.sa-pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.sa-pagination {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sa-detail-stat,
.sa-access-field {
    display: grid;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(128, 150, 210, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.sa-detail-stat span,
.sa-access-field span {
    color: var(--sa-muted);
    font-size: 0.85rem;
}

.sa-detail-stat strong,
.sa-access-field strong {
    font-size: 1rem;
    word-break: break-word;
}

.sa-mfa-qr-shell {
    display: grid;
    place-items: center;
    min-height: 100%;
    padding: 1rem;
    border: 1px solid rgba(128, 150, 210, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.sa-mfa-tabs {
    border: 1px solid rgba(128, 150, 210, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.02);
}

.sa-mfa-tabs .mud-tabs-toolbar {
    padding: 0.85rem 0.85rem 0;
}

.sa-mfa-tabs .mud-tab {
    min-height: 3rem;
    border-radius: 999px;
}

.sa-mfa-tab-panel {
    padding: 1rem;
}

.sa-mfa-qr {
    width: min(100%, 15rem);
    height: auto;
    border-radius: 18px;
    background: white;
    padding: 0.75rem;
}

.sa-recovery-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(128, 150, 210, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.sa-recovery-card span {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: rgba(7, 16, 31, 0.66);
    border: 1px solid rgba(128, 150, 210, 0.12);
    font-weight: 700;
    letter-spacing: 0.06em;
}

.sa-access-card {
    padding: 1rem;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.02);
}

.sa-access-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sa-copy-row,
.sa-password-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sa-password-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

#blazor-error-ui {
    background: rgba(112, 10, 24, 0.94);
    color: white;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    padding: 0.9rem 3rem 0.9rem 1rem;
    position: fixed;
    border-radius: 18px;
    z-index: 2000;
}

.mud-snackbar-location-top-center {
    top: 1.2rem;
}

.mud-snackbar-container {
    width: min(calc(100vw - 1.5rem), 30rem);
}

.mud-snackbar {
    border-radius: 22px;
    backdrop-filter: blur(14px);
}

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

.sa-site-card {
    padding: 1rem 1.125rem;
}

.sa-sites-page {
    background: transparent !important;
}

.sa-sites-page .sa-profile-card {
    background: linear-gradient(180deg, rgba(13, 20, 37, 0.92), rgba(8, 13, 26, 0.88)) !important;
}

.sa-sites-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1rem 0 1.25rem;
}

.sa-sites-filter-chip {
    cursor: pointer;
    font-weight: 700;
}

.sa-site-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.sa-site-card-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sa-site-card-actions .mud-button-root {
    min-width: 132px;
}

.sa-site-status-chip {
    flex-shrink: 0;
}

.sa-site-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sa-site-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (max-width: 960px) {
    .sa-hero {
        padding-top: 7rem;
    }
}

@media (max-width: 700px) {
    .sa-hero,
    .sa-section {
        padding-inline: 1rem;
    }

    .sa-stat-grid {
        grid-template-columns: 1fr;
    }

    .sa-login-card {
        padding: 1.4rem;
    }

    .sa-profile-card {
        padding: 1.35rem;
    }

    .sa-profile-actions {
        justify-content: stretch;
    }

    .sa-profile-actions .mud-button-root,
    .sa-form-actions .mud-button-root {
        width: 100%;
    }

    .sa-page-header,
    .sa-page-actions,
    .sa-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .sa-site-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    .sa-sites-filter-row {
        margin-top: 0.9rem;
    }

    .sa-list-card-row {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .sa-pagination-bar {
        align-items: center;
    }
}

@media (max-width: 560px) {
    .sa-brand-logo {
        width: 8.5rem;
    }

    .sa-user-button {
        min-width: 0;
        padding-inline: 0.85rem !important;
    }
}

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