:root {
    --bg: #07111f;
    --bg-2: #0d1d34;
    --surface: rgba(8, 19, 39, 0.82);
    --surface-strong: rgba(12, 24, 47, 0.94);
    --surface-soft: rgba(255, 255, 255, 0.06);
    --surface-light: rgba(255, 255, 255, 0.92);
    --border: rgba(255, 255, 255, 0.08);
    --text: #eef4ff;
    --text-soft: rgba(238, 244, 255, 0.72);
    --text-dark: #132745;
    --muted: #7e92ae;
    --accent: #69e2d0;
    --accent-2: #ffab52;
    --danger: #f26d85;
    --warning: #ffcf70;
    --success: #6de1a8;
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow: 0 24px 60px rgba(2, 7, 18, 0.35);
    --font-display: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    --font-body: "Segoe UI", "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    background:
        radial-gradient(circle at top left, rgba(105, 226, 208, 0.14), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(255, 171, 82, 0.16), transparent 24%),
        linear-gradient(135deg, var(--bg) 0%, #0a1730 46%, var(--bg-2) 100%);
    color: var(--text);
}

.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

.ambient-a {
    left: -8rem;
    top: -7rem;
    width: 22rem;
    height: 22rem;
    background: rgba(105, 226, 208, 0.24);
}

.ambient-b {
    right: -10rem;
    bottom: -8rem;
    width: 26rem;
    height: 26rem;
    background: rgba(255, 171, 82, 0.16);
}

.app-shell {
    display: grid;
    grid-template-columns: 17.5rem minmax(0, 1fr);
    gap: 1.2rem;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.auth-shell {
    position: relative;
    z-index: 1;
    padding: 1rem;
}

.auth-layout,
.setup-layout {
    width: min(1180px, 100%);
    margin: 0 auto;
    min-height: calc(100vh - 2rem);
    display: grid;
    gap: 1.2rem;
    align-items: center;
}

.auth-layout {
    grid-template-columns: 1.15fr 0.85fr;
}

.setup-layout {
    grid-template-columns: 1fr;
    align-content: start;
    padding-block: 2rem;
}

.panel,
.sidebar {
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.sidebar {
    position: sticky;
    top: 1rem;
    height: calc(100vh - 2rem);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.brand-panel {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.brand-badge {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--accent-2), #ff8a3d);
    color: #0f2140;
    font-weight: 800;
}

.brand-panel h1,
.brand-panel h2,
.topbar h2,
.auth-showcase h2,
.auth-card h2,
.panel h1,
.panel h2,
.panel h3 {
    margin: 0;
    font-family: var(--font-display);
}

.eyebrow {
    margin: 0 0 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.56);
}

.subtext,
.sidebar-footer p,
.metric-box span,
.stat-card span,
.field span,
.data-card p {
    color: var(--text-soft);
}

.nav-stack {
    display: grid;
    gap: 0.45rem;
    margin-top: 1.2rem;
    overflow-y: auto;
}

.nav-link {
    padding: 0.82rem 0.9rem;
    border-radius: 1rem;
    color: var(--text);
    text-decoration: none;
    background: transparent;
    transition: background 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
}

.ghost-link,
.subtle-link {
    color: var(--accent);
    text-decoration: none;
}

.main-shell {
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.identity-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.identity-chip span {
    display: block;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.avatar-dot {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(105, 226, 208, 0.9), rgba(255, 171, 82, 0.9));
    color: #12233f;
    font-weight: 800;
}

.content-grid,
.stats-grid,
.steps-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.hero-card,
.section-head,
.module-grid {
    margin-bottom: 1rem;
}

.stat-card,
.data-card {
    padding: 1rem;
}

.stat-card p,
.stat-card strong,
.metric-box strong {
    margin: 0;
}

.stat-card strong {
    display: block;
    margin-top: 0.55rem;
    font-size: 1.5rem;
}

.flash-banner {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
}

.tone-success {
    background: rgba(109, 225, 168, 0.12);
    border-color: rgba(109, 225, 168, 0.18);
    color: #cff6df;
}

.tone-error {
    background: rgba(242, 109, 133, 0.12);
    border-color: rgba(242, 109, 133, 0.2);
    color: #ffd5dd;
}

.tone-warning {
    background: rgba(255, 207, 112, 0.12);
    border-color: rgba(255, 207, 112, 0.2);
    color: #ffedbc;
}

.tone-info {
    background: rgba(105, 226, 208, 0.1);
    border-color: rgba(105, 226, 208, 0.18);
    color: #cffff7;
}

.table-shell {
    overflow: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 0.82rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}

.data-table th {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stack-form,
.inline-form-grid {
    display: grid;
    gap: 0.85rem;
}

.module-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 28rem);
    gap: 1rem;
    align-items: start;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.88rem;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.82rem 0.9rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

option {
    color: #0f1b32;
}

textarea {
    min-height: 7rem;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(105, 226, 208, 0.32);
    border-color: rgba(105, 226, 208, 0.42);
}

.password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
}

.row-inline,
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.primary-button,
.secondary-button,
.tiny-button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    padding: 0.85rem 1rem;
    border-radius: 0.95rem;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent-2), #ff7d38);
    color: #10223f;
    font-weight: 800;
}

.secondary-button,
.tiny-button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.tiny-button {
    min-height: auto;
    padding-inline: 0.8rem;
}

.button-link {
    width: fit-content;
}

.pill-grid,
.metric-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.info-pill,
.metric-box {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
}

.info-pill {
    padding: 0.65rem 0.9rem;
}

.metric-strip {
    margin-top: 1.2rem;
}

.metric-box {
    padding: 1rem;
    min-width: 13rem;
}

.auth-showcase,
.auth-card,
.hero-card,
.panel {
    padding: 1.2rem;
}

.auth-copy {
    max-width: 60ch;
}

.nav-toggle {
    display: none;
    margin-bottom: 0.55rem;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-radius: 0.8rem;
    padding: 0.55rem 0.8rem;
}

.form-note {
    font-size: 0.82rem;
    color: var(--text-soft);
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.summary-item {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-item strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.2rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
}

.badge[data-tone="positive"] {
    color: #cbffe3;
    background: rgba(109, 225, 168, 0.12);
}

.badge[data-tone="warning"] {
    color: #ffecbe;
    background: rgba(255, 207, 112, 0.12);
}

.badge[data-tone="muted"] {
    color: rgba(255, 255, 255, 0.68);
    background: rgba(255, 255, 255, 0.08);
}

.badge[data-tone="danger"] {
    color: #ffdbe2;
    background: rgba(242, 109, 133, 0.12);
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.18rem 0.35rem;
    border-radius: 0.45rem;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 1rem;
        left: 1rem;
        width: min(20rem, calc(100vw - 2rem));
        transform: translateX(-120%);
        transition: transform 180ms ease;
        z-index: 20;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .nav-toggle {
        display: inline-flex;
    }

    .stats-grid,
    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid,
    .auth-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .topbar,
    .row-inline,
    .section-head,
    .topbar-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 620px;
    }
}
