:root {
    --bg: #0b0f14;
    --bg-panel: #11161d;
    --bg-panel-2: #161d26;
    --border: #232b36;
    --text: #e6edf3;
    --text-muted: #8b96a5;
    --green: #2fd680;
    --green-dim: #1a7a4a;
    --red: #ff5c5c;
    --red-dim: #8f2f2f;
    --accent: #4f8cff;
    --gold: #e0b954;
    --radius: 10px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: radial-gradient(circle at top, #101620 0%, #0b0f14 60%);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

/* ---------- Header ---------- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #0b0f14;
}

.brand h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand span {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--green);
    background: rgba(47, 214, 128, 0.1);
    border: 1px solid rgba(47, 214, 128, 0.25);
    padding: 6px 12px;
    border-radius: 999px;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(47,214,128, 0.6);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(47,214,128, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(47,214,128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47,214,128, 0); }
}

/* ---------- Progress hero ---------- */
.hero {
    background: linear-gradient(180deg, var(--bg-panel), var(--bg-panel-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
}

.balance-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.balance-value {
    font-family: var(--mono);
    font-size: 46px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.balance-change {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}
.balance-change.pos { color: var(--green); background: rgba(47,214,128,0.1); }
.balance-change.neg { color: var(--red); background: rgba(255,92,92,0.1); }

.goal-info {
    text-align: right;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--text-muted);
}
.goal-info b { color: var(--text); }

.progress-track {
    width: 100%;
    height: 14px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    border-radius: 999px;
    transition: width 0.6s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ---------- Stats grid ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.stat-card .value {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
}
.stat-card .value.pos { color: var(--green); }
.stat-card .value.neg { color: var(--red); }

/* ---------- Chart panel ---------- */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
}

.panel h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

/* ---------- Table ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
}

tbody tr:hover { background: rgba(255,255,255,0.02); }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.badge.long { color: var(--green); background: rgba(47,214,128,0.12); }
.badge.short { color: var(--red); background: rgba(255,92,92,0.12); }

.pl.pos { color: var(--green); font-weight: 700; }
.pl.neg { color: var(--red); font-weight: 700; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

footer {
    text-align: center;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 12.5px;
}
footer a { color: var(--accent); text-decoration: none; }

@media (max-width: 600px) {
    .balance-value { font-size: 34px; }
    .goal-info { text-align: left; }
    .hero-top { align-items: flex-start; }
}
