:root {
    --ink: #e8eef7;
    --ink-soft: #a8b4c7;
    --muted: #7a879c;
    --paper: #0b1018;
    --panel: rgba(22, 30, 44, 0.78);
    --panel-solid: #161e2c;
    --panel-hover: rgba(36, 48, 68, 0.9);
    --input-bg: rgba(12, 18, 28, 0.85);
    --line: rgba(180, 200, 230, 0.12);
    --accent: #3b82f6;
    --accent-deep: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --warn: #f59e0b;
    --ok: #3b82f6;
    --danger: #f87171;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --font-display: "Syne", sans-serif;
    --font-body: "Sora", system-ui, sans-serif;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.5;
}

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

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 500px at 8% -10%, rgba(59, 130, 246, 0.22), transparent 60%),
        radial-gradient(700px 420px at 92% 8%, rgba(37, 99, 235, 0.16), transparent 55%),
        radial-gradient(600px 400px at 70% 100%, rgba(99, 102, 241, 0.1), transparent 50%),
        linear-gradient(165deg, #070b12 0%, #0d1420 45%, #0b1018 100%);
}

.shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

.sidebar {
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid var(--line);
    backdrop-filter: blur(8px);
}

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

.brand-logo {
    width: 44px;
    height: auto;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(59, 130, 246, 0.35));
}

.brand-logo--lg {
    width: 72px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--ink);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.auth-brand .eyebrow {
    margin: 0;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-link {
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    font-weight: 550;
    color: var(--ink-soft);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    background: var(--panel-hover);
    color: var(--ink);
    transform: translateX(2px);
}

.nav-link.is-active {
    background: var(--accent-soft);
    color: var(--accent-deep);
}

.nav-link.is-soon {
    opacity: 0.45;
    pointer-events: none;
}

.sidebar-foot {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-user {
    margin: 0;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.sidebar-logout {
    color: var(--muted);
    font-weight: 550;
    width: fit-content;
}

.sidebar-logout:hover {
    color: var(--danger);
}

.auth-body {
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 420px);
    padding: 2rem 1.75rem;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: rise 0.5s ease both;
}

.auth-card h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.2rem;
    letter-spacing: -0.03em;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.form-panel {
    max-width: 480px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.field input {
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.8rem 0.95rem;
    font: inherit;
    color: var(--ink);
    background: var(--input-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-divider {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.btn-block {
    width: 100%;
}

.main {
    padding: 2.25rem 2.5rem 3rem;
}

.page-header {
    margin-bottom: 2rem;
    animation: rise 0.55s ease both;
}

.page-header--split {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.page-header h1,
.panel h2,
.section h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.page-header h1 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.lede {
    margin: 0.75rem 0 0;
    max-width: 38rem;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.section {
    animation: rise 0.65s ease both;
    animation-delay: 0.08s;
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

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

.module {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.35rem 1.4rem;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

a.module:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
}

.module.is-muted {
    opacity: 0.7;
}

.module-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.module strong {
    font-family: var(--font-display);
    font-size: 1.45rem;
    letter-spacing: -0.02em;
}

.module span:last-child {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.inline-form {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.15rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #f8fbff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--panel-hover);
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-secondary:hover {
    background: rgba(59, 130, 246, 0.18);
}

.flash {
    margin-bottom: 1.25rem;
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    font-weight: 550;
    animation: rise 0.4s ease both;
}

.flash-success {
    background: rgba(59, 130, 246, 0.16);
    color: var(--accent-deep);
}

.flash-error {
    background: rgba(248, 113, 113, 0.14);
    color: var(--danger);
}

.panel {
    margin-top: 1.25rem;
    padding: 1.35rem 1.4rem 1.5rem;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: rise 0.7s ease both;
}

.panel p {
    color: var(--ink-soft);
}

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

.panel-toolbar h2 {
    font-size: 1.25rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
    animation: rise 0.6s ease both;
}

.stat {
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.65rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-sep {
    color: var(--muted);
    font-weight: 500;
    margin: 0 0.15rem;
}

.stat-meta {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.range-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.range-tab {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--input-bg);
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease;
}

.range-tab:hover {
    background: var(--panel-hover);
}

.range-tab.is-active {
    background: var(--accent-soft);
    color: var(--accent-deep);
    border-color: rgba(59, 130, 246, 0.35);
}

.chart-wrap {
    position: relative;
    min-height: 280px;
}

.chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    color: var(--muted);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding-bottom: 1rem;
        gap: 1rem;
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-foot {
        display: none;
    }

    .stat-row,
    .module-grid {
        grid-template-columns: 1fr 1fr;
    }

    .main {
        padding: 1.5rem 1.25rem 2.5rem;
    }
}

@media (max-width: 640px) {
    .stat-row,
    .module-grid {
        grid-template-columns: 1fr;
    }
}
