:root {
    color-scheme: dark;
    font-synthesis: none;
}

[x-cloak] {
    display: none !important;
}

html {
    background: #080b12;
    scrollbar-color: #334155 #080b12;
    scrollbar-width: thin;
}

body {
    font-family: "Manrope", sans-serif;
}

::selection {
    color: #fff;
    background: rgba(124, 58, 237, 0.7);
}

.surface-grid {
    background-image:
        radial-gradient(circle at 78% 2%, rgba(99, 102, 241, 0.08), transparent 28rem),
        linear-gradient(rgba(148, 163, 184, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.018) 1px, transparent 1px);
    background-size: auto, 44px 44px, 44px 44px;
}

.login-canvas {
    background:
        radial-gradient(circle at 12% 10%, rgba(124, 58, 237, 0.11), transparent 32rem),
        radial-gradient(circle at 88% 92%, rgba(79, 70, 229, 0.1), transparent 30rem),
        #080b12;
}

.login-canvas::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.24;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

.login-orbit::before,
.login-orbit::after {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(167, 139, 250, 0.045);
    border-radius: 999px;
    content: "";
    transform: translate(-50%, -50%);
}

.login-orbit::before {
    width: 75%;
    height: 75%;
}

.login-orbit::after {
    width: 48%;
    height: 48%;
}

.login-panel {
    box-shadow:
        0 34px 90px -35px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.text-gradient {
    color: transparent;
    background: linear-gradient(105deg, #c4b5fd 0%, #818cf8 52%, #e879f9 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

.brand-wave {
    position: absolute;
    width: 4rem;
    height: 4rem;
    border: 1px solid rgba(167, 139, 250, 0.18);
    border-radius: 42% 58% 66% 34% / 46% 35% 65% 54%;
    animation: brand-rotate 9s linear infinite;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: #64748b;
    font-size: 0.8125rem;
    font-weight: 700;
    transition: color 150ms, background-color 150ms, border-color 150ms;
}

.nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.035);
}

.nav-link:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}

.nav-link-active {
    color: #ede9fe;
    border-color: rgba(167, 139, 250, 0.14);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), rgba(79, 70, 229, 0.035));
    box-shadow: inset 2px 0 #8b5cf6;
}

.metric-card {
    position: relative;
    overflow: hidden;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.76), rgba(15, 23, 42, 0.45));
    box-shadow: 0 22px 55px -40px rgba(0, 0, 0, 0.9);
    transition: border-color 180ms, transform 180ms;
}

.metric-card::before {
    position: absolute;
    top: -5rem;
    right: -4rem;
    width: 10rem;
    height: 10rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.055);
    content: "";
    filter: blur(1rem);
}

.metric-card:hover {
    border-color: rgba(167, 139, 250, 0.18);
    transform: translateY(-2px);
}

.metric-icon {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 18%, transparent);
    border-radius: 0.75rem;
}

.metric-index {
    color: #334155;
    font-family: "DM Mono", monospace;
    font-size: 0.625rem;
    letter-spacing: 0.14em;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    width: fit-content;
    padding: 0.25rem 0.5rem;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.status-success {
    color: #6ee7b7;
    border-color: rgba(52, 211, 153, 0.15);
    background: rgba(52, 211, 153, 0.055);
}

.status-danger {
    color: #fda4af;
    border-color: rgba(251, 113, 133, 0.16);
    background: rgba(251, 113, 133, 0.055);
}

.status-neutral {
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.12);
    background: rgba(148, 163, 184, 0.045);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #64748b;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.form-input-dark {
    min-height: 2.625rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    outline: none;
    color: #e2e8f0;
    background: rgba(2, 6, 23, 0.42);
    font-size: 0.8125rem;
    transition: border-color 150ms, box-shadow 150ms, background-color 150ms;
}

.form-input-dark::placeholder {
    color: #334155;
}

.form-input-dark:hover {
    border-color: rgba(255, 255, 255, 0.13);
}

.form-input-dark:focus {
    border-color: rgba(139, 92, 246, 0.65);
    background: rgba(2, 6, 23, 0.66);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

select.form-input-dark {
    cursor: pointer;
}

.table-action,
.pagination-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 0.7rem;
    color: #94a3b8;
    font-size: 0.675rem;
    font-weight: 800;
    transition: color 150ms, border-color 150ms, background-color 150ms;
}

.table-action:hover,
.pagination-button:hover {
    color: #e2e8f0;
    border-color: rgba(167, 139, 250, 0.2);
    background: rgba(139, 92, 246, 0.07);
}

.table-action:focus-visible,
.pagination-button:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.table-action:disabled {
    cursor: wait;
    opacity: 0.55;
}

.pagination-button {
    min-height: 2.5rem;
    padding-inline: 0.85rem;
    font-size: 0.75rem;
}

audio {
    color-scheme: dark;
    accent-color: #8b5cf6;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
