/* ─── Base ─────────────────────────────────────────── */
:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #1e2230;
    --border: #2a2d3a;
    --text: #e1e4ea;
    --text-muted: #6b7280;
    --green: #22c55e;
    --green-dim: #166534;
    --red: #ef4444;
    --red-dim: #7f1d1d;
    --blue: #3b82f6;
    --yellow: #eab308;
    --gold: #f59e0b;
    --purple: #a855f7;
    --cyan: #06b6d4;
}

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

body {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

/* ─── Nav ──────────────────────────────────────────── */
.nav {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 700;
    font-size: 15px;
    color: var(--cyan);
    margin-right: 32px;
}

.nav-links { display: flex; gap: 4px; flex: 1; }

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.15s;
}

.nav-link:hover { color: var(--text); background: var(--border); }
.nav-link.active { color: var(--text); background: var(--border); }

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-off { background: var(--red); }
.dot-warn { background: var(--yellow); }

/* ─── Container ────────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 20px 24px; }

/* ─── Grid ─────────────────────────────────────────── */
.grid { display: grid; gap: 16px; margin-bottom: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .nav { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
    .nav-brand { margin-right: auto; }
    .nav-status { order: -1; width: 100%; justify-content: center; font-size: 11px; }
    .nav-links { width: 100%; justify-content: center; }
    .container { padding: 12px 12px; }
    .trade-grid { grid-template-columns: repeat(2, 1fr); }
    .bar-label { width: 120px; font-size: 10px; }
}

/* ─── Cards ────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.card-stat { text-align: center; padding: 20px 16px; }
.stat-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value.large { font-size: 36px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-sub { color: var(--text-muted); font-size: 11px; margin-top: 4px; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

/* ─── Symbols ──────────────────────────────────────── */
.symbol-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    background: var(--blue);
    color: white;
}

.badge-gold { background: var(--gold); color: #000; }

.pipeline-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--border);
    color: var(--text-muted);
}

.pipeline-status.active { background: var(--green-dim); color: var(--green); }
.pipeline-status.no-trade { background: var(--red-dim); color: var(--red); }
.pipeline-status.trade { background: var(--green-dim); color: var(--green); }

/* ─── Checklist ────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: 6px; }

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.6;
}

.check-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

.check-item.passed { background: rgba(34, 197, 94, 0.08); color: var(--green); }
.check-item.passed .check-icon::before { content: '\2714'; color: var(--green); }
.check-item.failed { background: rgba(239, 68, 68, 0.08); color: var(--red); }
.check-item.failed .check-icon::before { content: '\2718'; color: var(--red); }
.check-item.pending { color: var(--text-muted); }
.check-item.pending .check-icon::before { content: '\25CB'; }
.check-item.active { background: rgba(59, 130, 246, 0.08); color: var(--blue); }
.check-item.active .check-icon::before { content: '\25CF'; color: var(--blue); }

.check-details {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 22px;
    padding: 2px 0;
}

.pipeline-details { margin-top: 10px; font-size: 11px; color: var(--text-muted); }

/* ─── Trades ───────────────────────────────────────── */
.trade-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.trade-direction {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
}

.trade-direction.buy { background: var(--green-dim); color: var(--green); }
.trade-direction.sell { background: var(--red-dim); color: var(--red); }

.trade-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    font-size: 11px;
}

.trade-field { display: flex; flex-direction: column; }
.trade-field-label { color: var(--text-muted); }
.trade-field-value { font-weight: 600; }

/* ─── Events ───────────────────────────────────────── */
.event-list { max-height: 400px; overflow-y: auto; }

.event-item {
    display: flex;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.event-item:last-child { border-bottom: none; }

.event-time { color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.event-type {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-type.info { background: var(--border); color: var(--text-muted); }
.event-type.trade { background: var(--green-dim); color: var(--green); }
.event-type.warning { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.event-type.error { background: var(--red-dim); color: var(--red); }

.event-msg { flex: 1; }
.event-symbol { color: var(--cyan); font-weight: 600; margin-right: 6px; }

/* ─── History ──────────────────────────────────────── */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filters { display: flex; gap: 8px; }

select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
}

.session-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.session-date { font-size: 13px; font-weight: 600; }

.session-result {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.session-result.trade { background: var(--green-dim); color: var(--green); }
.session-result.no-trade { background: var(--red-dim); color: var(--red); }
.session-result.scanning { background: rgba(59, 130, 246, 0.15); color: var(--blue); }

/* ─── Analytics ────────────────────────────────────── */
.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.bar-label { width: 200px; text-align: right; color: var(--text-muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 20px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.bar-fill.green { background: var(--green); }
.bar-fill.red { background: var(--red); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.yellow { background: var(--yellow); }
.bar-count { width: 40px; font-weight: 600; }

.stats-row {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

/* ─── Utilities ────────────────────────────────────── */
.section-title {
    font-size: 14px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.muted { color: var(--text-muted); font-size: 12px; }
h3 { font-size: 13px; margin-bottom: 12px; color: var(--text); }
