:root {
    --primary: #811ca2;
    --primary-deep: #5a1174;
    --primary-bright: #a13bc4;
    --blue: #3d7eff;
    --blue-deep: #2458c7;
    --bg: #09060f;
    --sidebar: #120818;
    --card: rgba(22, 10, 32, 0.92);
    --card-solid: #1a0d26;
    --line: rgba(161, 59, 196, 0.28);
    --text: #f6f1fb;
    --muted: #b9a6c8;
    --danger: #ff8d7a;
    --ok: #d7b4ea;
    --field: #100818;
    --nav-hover: #ffffff;
    --chip: #f0d4fa;
    --flash-text: #d6e4ff;
    --bar: rgba(9, 6, 15, 0.82);
    --tile: linear-gradient(180deg, rgba(129, 28, 162, 0.16), rgba(16, 8, 24, 0.9));
}

html[data-theme="light"] {
    --bg: #f6f1fb;
    --sidebar: #ffffff;
    --card: rgba(255, 255, 255, 0.94);
    --card-solid: #ffffff;
    --line: rgba(129, 28, 162, 0.22);
    --text: #1b1024;
    --muted: #5e4a6c;
    --danger: #b42318;
    --ok: #5a1174;
    --primary-bright: #811ca2;
    --field: #ffffff;
    --nav-hover: #5a1174;
    --chip: #5a1174;
    --flash-text: #1d3f91;
    --bar: rgba(246, 241, 251, 0.92);
    --tile: linear-gradient(180deg, rgba(129, 28, 162, 0.08), #ffffff);
}

html[data-theme="light"] body {
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(129, 28, 162, 0.16), transparent 60%),
        radial-gradient(700px 380px at 100% 0%, rgba(61, 126, 255, 0.1), transparent 55%),
        var(--bg);
}
html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f3e6f8, #ffffff 36%);
}
html[data-theme="light"] .brand { color: var(--text); }

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--text);
    font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(129, 28, 162, 0.45), transparent 60%),
        radial-gradient(700px 380px at 100% 0%, rgba(61, 126, 255, 0.18), transparent 55%),
        var(--bg);
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: #8eb2ff; }

h1, h2, .brand strong {
    font-family: "Space Grotesk", Outfit, sans-serif;
    letter-spacing: -0.03em;
}

h1 { margin: 0 0 8px; font-size: 1.85rem; font-weight: 700; }
h2 {
    margin: 28px 0 10px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-bright);
}

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 252px;
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: linear-gradient(180deg, #3d1648, #120818 32%);
    border-right: 1px solid var(--line);
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: white;
    margin-bottom: 28px;
    padding: 0 8px;
}

.mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    box-shadow: 0 0 24px rgba(129, 28, 162, 0.7);
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
}

.brand small, .brand-lockup small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0;
    font-weight: 500;
    line-height: 1.3;
    max-width: 16rem;
}
.brand strong { font-size: 1.05rem; }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
}
.icon { width: 1.15rem; height: 1.15rem; flex: none; }
.icon-button { width: 42px; height: 42px; padding: 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; }

.nav a:hover { color: var(--nav-hover); background: rgba(129, 28, 162, 0.18); }
.nav a.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 8px 24px rgba(129, 28, 162, 0.35);
}

.sidebar-foot { margin-top: auto; padding: 14px 8px 0; }
.who { display: block; font-size: 0.92rem; }
.pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.pulse i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 10px var(--blue);
    display: inline-block;
}

.main { flex: 1; min-width: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 28px 64px; }

.lede { color: var(--muted); margin-top: 0; max-width: 62ch; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.stat, .login, .sheet {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.stat { padding: 16px 16px 14px; position: relative; overflow: hidden; }
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--primary);
}
.stat.alt::before { background: var(--blue); }
.stat span { display: block; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 8px; font-size: 1.45rem; font-family: "Space Grotesk", sans-serif; }

.sheet, .wrap > table, form > table {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.sheet { padding: 6px; margin-top: 8px; overflow: auto; }
.wrap > table, form > table { overflow: hidden; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(161, 59, 196, 0.16); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
tbody tr:hover td { background: rgba(129, 28, 162, 0.08); }

label { display: block; font-size: 0.8rem; margin: 12px 0 6px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

input, select, button { font: inherit; }

input, select {
    width: 100%;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--text);
    outline: none;
}

input:focus, select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(61, 126, 255, 0.25);
}

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--primary-bright), var(--primary));
    color: white;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(129, 28, 162, 0.35);
}

button:hover { filter: brightness(1.08); }

.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    box-shadow: none;
    padding: 8px 12px;
}

.flash, .error {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.flash { background: rgba(61, 126, 255, 0.12); border: 1px solid rgba(61, 126, 255, 0.4); color: var(--flash-text); }
.error { background: rgba(255, 141, 122, 0.1); border: 1px solid rgba(255, 141, 122, 0.4); color: var(--danger); }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.muted { color: var(--muted); }
.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(129, 28, 162, 0.25);
    color: var(--chip);
    text-transform: capitalize;
    font-size: 0.82rem;
}

ul { padding-left: 18px; }
li { margin: 6px 0; }

.kicker { color: var(--blue); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.75rem; }

.site-nav, .site-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 6vw;
}
.site-nav {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bar);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}
.site-nav .brand { margin: 0; color: var(--text); }
.site-links { display: flex; align-items: center; gap: 22px; }
.site-links a { color: var(--muted); font-weight: 500; }
.site-links a:hover, .site-links a.staff-link { color: var(--text); }
.site-links .theme-toggle { margin-top: 0; }
.nav-burger { display: none; }
.site-foot {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.92rem;
}
.site-foot strong { display: block; color: var(--text); font-family: "Space Grotesk", sans-serif; }
.site-foot span { color: var(--muted); }
.landing-hero, .band { padding: 28px 6vw 56px; }
.landing-hero {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 40px;
    align-items: end;
    padding-top: 76px;
}
.landing-hero h1 {
    font-family: Fraunces, Georgia, serif;
    font-weight: 500;
    font-size: clamp(2.8rem, 5.2vw, 4.8rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
    max-width: 13ch;
    margin: 12px 0 16px;
}
.lede { max-width: 46ch; color: var(--muted); font-size: 1.12rem; line-height: 1.55; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-panel {
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 8px 26px 12px;
    background: var(--tile);
}
.hero-line {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    font-family: Fraunces, Georgia, serif;
    font-size: 1.45rem;
}
.hero-panel .kicker { margin: 18px 0 8px; }
.site h2 {
    margin: 8px 0 22px;
    font-family: Fraunces, Georgia, serif;
    font-weight: 500;
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    letter-spacing: -0.03em;
    text-transform: none;
    color: var(--text);
}
.tiles, .steps { display: grid; gap: 16px; }
.tiles { grid-template-columns: repeat(3, 1fr); }
.steps { grid-template-columns: repeat(4, 1fr); list-style: none; padding: 0; margin: 0; }
.tile, .steps li, .panel-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--tile);
}
.tile, .steps li { padding: 24px; }
.tile h3, .steps strong { display: block; margin: 14px 0 8px; font-size: 1.25rem; }
.tile p, .steps span, .fine { color: var(--muted); }
.product-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--primary-bright);
    background: rgba(129, 28, 162, 0.16);
}
.product-mark .icon { width: 22px; height: 22px; }
.about-band {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 36px;
    align-items: center;
}
.about-points { list-style: none; margin: 0; padding: 0; }
.about-points li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}
.about-points .icon { color: var(--primary-bright); margin-top: 3px; }
.topbar, .menu-backdrop { display: none; }

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
}
.auth-frame {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 18px;
}
.hero, .login { margin: 0; }
.panel-card { padding: 36px; }
.hero h1.legal {
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.05;
    max-width: 14ch;
    margin: 10px 0 14px;
}
.hero p { max-width: 38ch; color: var(--muted); }
.login-points { margin: 22px 0 0; padding: 0; list-style: none; }
.login-points li {
    padding: 8px 0 8px 16px;
    border-left: 2px solid var(--primary);
    color: var(--muted);
}
.back-link { color: var(--muted); font-size: 0.9rem; }
.brand-lockup {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}
.brand-lockup strong { font-family: "Space Grotesk", sans-serif; font-size: 1.15rem; }
.form-title {
    margin: 0 0 16px;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
    text-transform: none;
    color: var(--text);
}
.login button { width: 100%; margin-top: 8px; }
.fine { font-size: 0.88rem; }
.toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.toolbar h1 { margin-bottom: 4px; }
.theme-toggle { width: auto; margin-top: 10px; gap: 8px; }
.theme-float { position: fixed; top: 16px; right: 16px; z-index: 6; margin: 0; }
.choice { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 0.95rem; }
input[type="checkbox"] { width: auto; }
.pager { margin-top: 16px; }

@media (max-width: 980px) {
    .tiles, .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 12;
        padding: 10px 14px;
        background: var(--bar);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--line);
    }
    .topbar .brand { margin: 0; color: var(--text); }
    .shell { display: block; }
    .menu-backdrop { position: fixed; inset: 0; background: rgba(8, 4, 14, 0.55); z-index: 18; }
    .shell.menu-open .menu-backdrop { display: block; }
    .sidebar {
        position: fixed;
        z-index: 20;
        top: 0;
        left: 0;
        width: min(300px, 88vw);
        height: 100vh;
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        overflow: auto;
        border-right: 1px solid var(--line);
    }
    .shell.menu-open .sidebar { transform: none; }
    .nav { flex-direction: column; overflow: visible; }
    .wrap { padding: 22px 16px 56px; }
    .landing-hero, .about-band, .tiles, .steps, .auth-frame { grid-template-columns: 1fr; }
    .landing-hero { padding-top: 36px; }
    .landing-hero h1 { font-size: 2.45rem; }
    .site-nav { flex-wrap: wrap; }
    .site-nav .brand { flex: 1; min-width: 0; }
    .site-nav .brand strong { white-space: nowrap; }
    .nav-burger { display: inline-flex; }
    .site-links {
        display: none;
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 8px 0 14px;
        border-top: 1px solid var(--line);
    }
    .site-nav.open .site-links { display: flex; }
    .panel-card { padding: 22px 18px; }
    .auth-body { padding: 72px 14px 32px; align-items: start; }
    .row > * { min-width: 100%; flex-basis: 100%; }
    input, select, textarea { font-size: 16px; }
    .sheet, form, .wrap > table { overflow-x: auto; }
    table { min-width: 560px; }
    .stat strong { font-size: 1.2rem; }
    .toolbar .button { width: 100%; }
}
@media (max-width: 560px) {
    .grid, .tiles, .steps { grid-template-columns: 1fr; }
    .hero-actions .button, .hero-actions .ghost { width: 100%; }
}
