:root {
    --bg: #05070d;
    --bg-2: #0a1222;
    --card: #0e1a2e;
    --line: #1d3f68;
    --text: #e7f1fb;
    --muted: #8aa3bd;
    --accent: #3c9ae6;
    --accent-2: #8ec8f8;
    --navy: #16325c;
    --ok: #3dbe8b;
    --warn: #e0a15a;
    --danger: #e06c6c;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(900px 420px at 0% -10%, rgba(60, 154, 230, 0.16), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
}

body { min-height: 100vh; }

a { color: var(--accent-2); text-decoration: none; }

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

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(180deg, #4aa6ee, #2d7fc8);
    color: #041018;
    font-weight: 650;
    cursor: pointer;
}

button.secondary, .button.secondary {
    background: transparent;
    color: var(--accent-2);
    border: 1px solid var(--line);
}

button.ghost, .button.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid transparent;
}

button.danger { background: #8d3040; color: #ffe8ea; }

input, select, textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #091321;
}

label { display: block; color: var(--muted); font-size: 0.92rem; }

.shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.side {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px 16px;
    background: rgba(8, 14, 26, 0.92);
    border-right: 1px solid var(--line);
}

.brand img { width: 100%; height: auto; display: block; }

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

.nav a {
    padding: 10px 12px;
    border-left: 3px solid transparent;
    color: var(--muted);
}

.nav a.active {
    color: var(--text);
    border-left-color: var(--accent);
    background: rgba(60, 154, 230, 0.1);
}

.side-foot { margin-top: auto; }

.main { padding: 28px 28px 64px; max-width: 1080px; }

.page-head, .stats, .split, .row, .actions, .bar-label {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.page-head { align-items: flex-end; margin-bottom: 18px; }

h1, h2 { margin: 0; font-weight: 560; letter-spacing: -0.03em; }

h1 { font-size: 2rem; }

h2 { margin-bottom: 14px; font-size: 1.15rem; }

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.card, .timer-card, .stats article {
    background: linear-gradient(180deg, rgba(18, 38, 66, 0.55), var(--card));
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.card { padding: 18px; margin-top: 16px; }

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

.stats article {
    display: block;
    padding: 14px 16px;
}

.stats span, .muted, .timer-meta, .row p { color: var(--muted); }

.stats strong { display: block; margin-top: 6px; font-size: 1.6rem; font-weight: 560; }

.timer-card { margin-top: 16px; padding: 22px; }

.clock {
    margin: 8px 0;
    font-size: clamp(4.2rem, 12vw, 7rem);
    line-height: 0.9;
    font-weight: 520;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-2);
}

.actions { flex-wrap: wrap; justify-content: flex-start; margin-top: 14px; }

.grid-form, .stack { display: grid; gap: 12px; }

.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }

.wide { grid-column: 1 / -1; }

.checks { display: flex; flex-wrap: wrap; gap: 12px 18px; }

.check { display: flex; gap: 8px; align-items: center; color: var(--text); }

.check input { width: auto; margin: 0; }

.split { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: start; }

.row {
    padding: 12px 0;
    border-top: 1px solid rgba(29, 63, 104, 0.7);
}

.row:first-of-type { border-top: 0; }

.banner {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(61, 190, 139, 0.12);
    color: #b8f3d8;
}

.banner.bad, .field-error { color: #ffc1c1; }

.pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(224, 161, 90, 0.15);
    color: var(--warn);
}

.online { color: var(--ok); }

.qr {
    width: fit-content;
    margin: 14px 0;
    padding: 12px;
    background: white;
    border-radius: 12px;
}

.qr svg { display: block; width: 220px; height: 220px; }

.steps { margin: 0 0 14px; padding-left: 18px; color: var(--muted); }

.steps li { margin: 6px 0; }

.score-note { margin: 12px 0 0; }

.bar-row { margin: 10px 0; }

.bar-label span:last-child { color: var(--muted); }

.bar {
    height: 8px;
    margin-top: 6px;
    border-radius: 99px;
    background: #091321;
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #1d4e86, var(--accent-2));
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card { width: min(440px, 100%); padding: 28px; }

.login-logo { width: min(280px, 100%); display: block; margin: 0 auto 8px; }

.login h1 { margin-bottom: 16px; }

code { color: var(--accent-2); }

@media (max-width: 860px) {
    .shell { display: block; }
    .side {
        position: sticky;
        top: 0;
        z-index: 2;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
    .brand img { max-width: 210px; }
    .nav { flex-direction: row; overflow: auto; }
    .nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
    .nav a.active { border-bottom-color: var(--accent); }
    .side-foot { margin-top: 0; }
    .main { padding: 18px 14px 48px; }
    .stats, .split, .grid-form { grid-template-columns: 1fr; }
    .page-head, .row { align-items: stretch; flex-direction: column; }
}
