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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0e1117;
    color: #e0e0e0;
    line-height: 1.5;
    padding: 0 1.5rem;
}

header {
    padding: 1.25rem 0 0.5rem;
    border-bottom: 1px solid #333;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #333;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: none;
    border: none;
    color: #888;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
    color: #ccc;
}

.tab-btn.active {
    color: #4fc3f7;
    border-bottom-color: #4fc3f7;
}

/* Metrics */
.metrics-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.metric-card {
    background: #1a1d24;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

.metric-delta {
    font-size: 0.8rem;
    color: #888;
}

.metric-sub {
    font-size: 0.75rem;
    color: #666;
}

.positive { color: #66bb6a; }
.negative { color: #ef5350; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #444;
    color: #999;
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #222;
}

tbody tr:hover {
    background: #1a1d24;
}

tbody tr.selected-row {
    background: #1a2a1a;
}

td.buy, .buy { color: #66bb6a; }
td.sell, .sell { color: #ef5350; }

/* Headings */
h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ddd;
}

h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #ccc;
}

/* Layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.two-col.wide-left {
    grid-template-columns: 3fr 2fr;
}

/* Chart */
.chart-container {
    position: relative;
    height: 250px;
    margin-bottom: 1.5rem;
    background: #1a1d24;
    border: 1px solid #2a2d35;
    border-radius: 8px;
    padding: 0.75rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #2d1a1a;
    border: 1px solid #ef5350;
    color: #ef5350;
}

/* Buttons */
.btn-danger {
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-danger:hover {
    background: #b71c1c;
}

/* Misc */
.status-caption {
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.sub-caption {
    font-size: 0.78rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.info-msg {
    color: #666;
    font-size: 0.9rem;
    padding: 0.75rem 0;
}

.emergency-controls {
    margin-bottom: 1.5rem;
}

code {
    background: #1a1d24;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: #4fc3f7;
}

footer {
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid #333;
    text-align: center;
    font-size: 0.78rem;
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .metrics-row { flex-direction: column; }
    .two-col, .two-col.wide-left { grid-template-columns: 1fr; }
    body { padding: 0 0.75rem; }
}
