:root {
    --bg: #070a0f;
    --panel: #0d131d;
    --panel2: #111a27;
    --line: #1f2b3a;
    --text: #e7eefc;
    --muted: #8190a8;
    --accent: #8fd3ff;
    --good: #52f0a4;
    --bad: #ff6b7a;
    --warn: #ffd166;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(72, 116, 255, .16), transparent 32rem),
        radial-gradient(circle at bottom left, rgba(82, 240, 164, .08), transparent 30rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-body,
body:has(.auth-card) {
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(440px, calc(100vw - 32px));
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(13, 19, 29, .92);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.brand {
    letter-spacing: .22em;
    font-size: 13px;
    color: var(--accent);
    font-weight: 800;
}

h1, h2, p {
    margin-top: 0;
}

h1 {
    font-size: 30px;
    margin-bottom: 24px;
}

h2 {
    font-size: 19px;
    margin-bottom: 8px;
}

p {
    color: var(--muted);
}

label {
    display: block;
    margin: 18px 0 8px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #090e16;
    color: var(--text);
    outline: none;
}

input:focus {
    border-color: var(--accent);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding: 13px 18px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #8fd3ff, #52f0a4);
    color: #041018;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button.full {
    width: 100%;
}

.button.secondary {
    background: #182435;
    color: var(--text);
    border: 1px solid var(--line);
}

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

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin: 16px 0;
    border: 1px solid var(--line);
}

.alert.error {
    color: var(--bad);
    border-color: rgba(255, 107, 122, .45);
    background: rgba(255, 107, 122, .08);
}

.alert.success {
    color: var(--good);
    border-color: rgba(82, 240, 164, .45);
    background: rgba(82, 240, 164, .08);
}

.alert.warning {
    color: var(--warn);
    border-color: rgba(255, 209, 102, .45);
    background: rgba(255, 209, 102, .08);
}

pre {
    overflow: auto;
    padding: 16px;
    border-radius: 14px;
    background: #05080d;
    border: 1px solid var(--line);
    color: var(--accent);
}

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

.side {
    border-right: 1px solid var(--line);
    padding: 28px;
    background: rgba(8, 12, 18, .72);
}

.side-title {
    margin: 34px 0 18px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .16em;
    font-weight: 800;
}

.side-line {
    padding: 10px 0;
    border-bottom: 1px solid rgba(31, 43, 58, .7);
    color: var(--muted);
    font-size: 13px;
}

.side-line span {
    color: var(--text);
}

.collector-box {
    margin-top: 28px;
}

.collector-box input {
    font-size: 11px;
}

.terminal {
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--good);
    font-size: 12px;
    letter-spacing: .18em;
    font-weight: 900;
}

.price-tile {
    min-width: 260px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(17, 26, 39, .96), rgba(10, 15, 22, .96));
    border: 1px solid var(--line);
    text-align: right;
}

.live-price {
    font-size: 36px;
    font-weight: 900;
    color: var(--good);
    font-variant-numeric: tabular-nums;
}

.live-meta {
    color: var(--muted);
    font-size: 12px;
}

.muted {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric {
    padding: 20px;
    border-radius: 20px;
    background: rgba(17, 26, 39, .86);
    border: 1px solid var(--line);
}

.metric span {
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.metric strong {
    font-size: 26px;
    font-variant-numeric: tabular-nums;
}

.panel {
    border: 1px solid var(--line);
    background: rgba(13, 19, 29, .9);
    border-radius: 24px;
    padding: 22px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.status {
    padding: 9px 12px;
    border-radius: 999px;
    background: #121b28;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.status.ok {
    color: var(--good);
}

.status.bad {
    color: var(--bad);
}

.table-wrap {
    overflow: auto;
    margin-top: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

th {
    text-align: left;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
}

td {
    padding: 13px 10px;
    border-bottom: 1px solid rgba(31, 43, 58, .6);
}

tr:hover td {
    background: rgba(143, 211, 255, .035);
}

.badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(143, 211, 255, .09);
    color: var(--accent);
    font-size: 12px;
}

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

    .side {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .topbar {
        flex-direction: column;
    }

    .price-tile {
        width: 100%;
        text-align: left;
    }

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

.collector-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.button.mini {
    padding: 9px 10px;
    margin-top: 0;
    font-size: 12px;
    border-radius: 10px;
}

.button.danger {
    background: rgba(255, 107, 122, .12);
    color: var(--bad);
    border: 1px solid rgba(255, 107, 122, .38);
}

.collector-status {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(143, 211, 255, .06);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
}

.collector-status.active {
    color: var(--good);
    border-color: rgba(82, 240, 164, .38);
    background: rgba(82, 240, 164, .08);
}

.collector-status.inactive {
    color: var(--warn);
    border-color: rgba(255, 209, 102, .38);
    background: rgba(255, 209, 102, .08);
}

.collector-status.error {
    color: var(--bad);
    border-color: rgba(255, 107, 122, .38);
    background: rgba(255, 107, 122, .08);
}


.debug-panel {
    margin-bottom: 20px;
    border: 1px solid rgba(255, 107, 122, .38);
    background: rgba(255, 107, 122, .06);
    border-radius: 24px;
    padding: 22px;
}

.debug-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.debug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.debug-panel pre {
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    color: var(--bad);
}
