/* Trading Dashboard — Base Theme & Layout */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2333;
    --bg-card: #1a1f2e;
    --border: #30363d;
    --border-bright: #3d444d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --green: #3fb950;
    --green-dim: #1a3a2a;
    --red: #f85149;
    --red-dim: #3a1a1a;
    --yellow: #d29922;
    --yellow-dim: #3a2e1a;
    --blue: #58a6ff;
    --blue-dim: #1a2a3a;
    --accent: #388bfd;
    --mono: 'Consolas', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    --sans: 'Segoe UI', -apple-system, system-ui, sans-serif;
}

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

body {
    font-family: var(--sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ---- Top Bar ---- */

.top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.top-bar .logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.top-bar .logo span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 13px;
    margin-left: 8px;
}

.account-stats {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-item .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-item .value {
    font-family: var(--mono);
    font-size: 16px;
    font-weight: 600;
}

.stat-item .value.big { font-size: 22px; }

/* ---- Dashboard Grid ---- */

.dashboard {
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-rows: auto auto;
    gap: 16px;
    padding: 16px 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-yellow { background: var(--yellow); }
.dot-blue { background: var(--blue); }

.panel-body { padding: 16px; }

/* ---- Color Utilities ---- */

.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text-muted); }

/* ---- Chart Page ---- */

.chart-container {
    padding: 16px 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.chart-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-top-bar h1 {
    font-family: var(--mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--blue);
}

.chart-top-bar .back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.chart-top-bar .back-link:hover { color: var(--text-primary); }

.chart-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    height: calc(100vh - 120px);
    min-height: 500px;
}

#chart-area { width: 100%; height: 100%; }

.chart-no-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 16px;
    flex-direction: column;
    gap: 12px;
}

.chart-no-data .key-icon {
    font-size: 32px;
    color: var(--yellow);
}

/* ---- Responsive (laptop 1366px+) ---- */

@media (max-width: 1100px) {
    .dashboard { grid-template-columns: 1fr; }
    .cockpit-panel { grid-column: 1; grid-row: auto; }
    .account-stats { gap: 16px; }
}
