/* ══════════════════════════════════════════════════════════════
   SLC Dashboard — Shared Theme (Dense / Terminal Style)
   Include on every page: <link rel="stylesheet" href="/shared/theme.css">
   ══════════════════════════════════════════════════════════════ */

:root {
    --bg: #0a0b10;
    --bg2: #0e1117;
    --bg3: #121725;
    --surface: #1a1b26;
    --fg: #e5e7eb;
    --fg-muted: #565f89;
    --fg-dim: #94a3b8;
    --line: #292e42;
    --pos: #22c55e;
    --neg: #ef4444;
    --neon: #14f195;
    --blue: #7aa2f7;
    --purple: #bb9af7;
    --amber: #e0af68;
    --cyan: #7dcfff;
    --rose: #f7768e;
    --teal: #2dd4bf;
}

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

body {
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(168,85,247,0.12), transparent),
        radial-gradient(1000px 600px at 100% 0%, rgba(0,229,255,0.08), transparent),
        var(--bg);
    color: var(--fg);
    font: 11px/1.4 'Segoe UI', ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-variant-numeric: tabular-nums;
}

/* ── Nav bar ─────────────────────────────────────────────────── */
.nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg2);
    border-bottom: 1px solid var(--line);
    padding: 0 8px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    color: var(--neon);
    font-weight: 700;
    font-size: 12px;
    padding: 6px 10px 6px 0;
    text-decoration: none;
    border-right: 1px solid var(--line);
    margin-right: 2px;
    white-space: nowrap;
}
.nav a {
    color: var(--fg-muted);
    text-decoration: none;
    padding: 6px 7px;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.nav a:hover { color: #c0caf5; background: rgba(255,255,255,0.03); }
.nav a.active { color: var(--blue); border-bottom: 2px solid var(--blue); }

/* ── Page content ────────────────────────────────────────────── */
.page { padding: 8px; display: flex; flex-direction: column; gap: 6px; }

/* ── Glass card ──────────────────────────────────────────────── */
.glass {
    background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

/* ── Surface card (solid) ────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px;
}

/* ── KPI / stat card ─────────────────────────────────────────── */
.kpi {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(168,85,247,0.06), rgba(0,229,255,0.04));
    border-radius: 8px;
    padding: 6px 8px;
    text-align: center;
}
.kpi .val { font-size: 14px; font-weight: bold; margin-bottom: 1px; }
.kpi .lbl { font-size: 9px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Section headers ─────────────────────────────────────────── */
h1 { font-size: 13px; font-weight: 700; color: var(--blue); }
h2 { font-size: 12px; font-weight: 700; }
h3 { font-size: 11px; font-weight: 600; }
.section-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ── Form controls ───────────────────────────────────────────── */
input[type="text"], input[type="date"], input[type="number"],
input[type="password"], select, textarea {
    background: var(--bg3);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 3px 8px;
    color: var(--fg);
    font-size: 11px;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-primary {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 1px 4px rgba(37,99,235,0.2);
}
.btn-primary:hover { background: #3b82f6; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
    background: var(--bg3);
    color: var(--fg);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--blue); }
.btn-danger { background: #991b1b; color: white; border-color: #991b1b; }
.btn-danger:hover { background: #b91c1c; }

/* ── Tables (basic HTML tables) ──────────────────────────────── */
/* Matched to old deal-matching page density */
table.slc-table { width: 100%; border-collapse: collapse; font-size: 11px; }
table.slc-table th {
    text-align: left; padding: 4px 5px; font-weight: 600; font-size: 9px;
    color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.3px;
    background: var(--bg3); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.slc-table td { padding: 3px 5px; border-bottom: 1px solid rgba(255,255,255,0.03); white-space: nowrap; }
table.slc-table tr:hover td { background: rgba(122,162,247,0.06); }
table.slc-table .number { text-align: right; font-variant-numeric: tabular-nums; }

/* ── ag-Grid dark theme ──────────────────────────────────────── */
/* Matched to old deal-matching page: th 9px/4px 5px, td 11px/3px 5px */
.ag-theme-alpine-dark {
    --ag-background-color: var(--bg2);
    --ag-foreground-color: var(--fg);
    --ag-header-background-color: var(--bg3);
    --ag-border-color: var(--line);
    --ag-header-foreground-color: var(--fg-dim);
    --ag-odd-row-background-color: rgba(255,255,255,0.015);
    --ag-row-hover-color: rgba(122,162,247,0.08);
    --ag-font-size: 11px;
    --ag-header-height: 20px;
    --ag-row-height: 20px;
    --ag-cell-horizontal-padding: 5px;
    --ag-grid-size: 2px;
    --ag-list-item-height: 20px;
}
/* Force header font to 9px uppercase — matches old deal-matching th */
.ag-theme-alpine-dark .ag-header-cell-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ag-theme-alpine-dark .ag-header-cell {
    font-size: 9px;
    padding-left: 5px;
    padding-right: 5px;
}
/* Force cell font and padding */
.ag-theme-alpine-dark .ag-cell {
    font-size: 11px;
    line-height: 20px;
    padding-left: 5px;
    padding-right: 5px;
}
/* Compact pinned bottom (totals) row */
.ag-theme-alpine-dark .ag-floating-bottom .ag-cell {
    font-weight: 600;
}

/* ── Utility classes ─────────────────────────────────────────── */
.text-pos { color: var(--pos); }
.text-neg { color: var(--neg); }
.text-neon { color: var(--neon); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-amber { color: var(--amber); }
.text-cyan { color: var(--cyan); }
.text-rose { color: var(--rose); }
.text-muted { color: var(--fg-muted); }
.text-dim { color: var(--fg-dim); }
.font-bold { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-xs { font-size: 10px; }
.text-sm { font-size: 11px; }
.text-lg { font-size: 13px; }

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}
.badge-buy { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-sell { background: rgba(239,68,68,0.15); color: #f87171; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b4261; }

/* ── Loading / error ─────────────────────────────────────────── */
.loading { color: var(--fg-muted); font-style: italic; padding: 12px; text-align: center; font-size: 11px; }
.error { color: var(--neg); background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 4px; padding: 6px 10px; font-size: 11px; }
.msg-ok { color: var(--pos); }
.msg-err { color: var(--neg); }
