/* ======================================================================
   Stocks Market Overview - "/stocks". Same dark terminal language as the
   crypto market overview (market-overview.css): tile grid, dense table,
   change pills, sector heat grid. The "sov-" prefix keeps this page's
   classes isolated; the shared mo-up/mo-down sign classes are reused
   verbatim (same server-side formatters), so their color rules are
   mirrored here.
   ====================================================================== */

.sov-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 16px 48px;
    margin-top: 50px;
}

/* ── Hero: one compact line + terminal CTA right ─────────────────── */
.sov-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 6px 2px 12px;
}
.sov-hero-titles {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}
.sov-hero h1 {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0;
    letter-spacing: 0.2px;
}
.sov-sub {
    font-size: 0.68rem;
    color: #64748b;
    margin: 0;
}
.sov-delayed-badge {
    font-size: 0.56rem;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(148,163,184,0.1);
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 4px;
    padding: 1px 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.sov-open-terminal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.72rem;
    text-decoration: none;
    background: rgba(34,211,238,0.14);
    border: 1px solid rgba(34,211,238,0.4);
    color: #67e8f9;
    white-space: nowrap;
}
.sov-open-terminal:hover { background: rgba(34,211,238,0.22); color: #a5f3fc; }

/* ── Warming strip ─────────────────────────────────────────────────── */
.sov-warming {
    text-align: center;
    padding: 14px;
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(31,41,55,0.4);
    border: 1px dashed rgba(42,46,57,0.5);
    border-radius: 8px;
    margin: 0 0 12px;
}

/* ── Summary tiles (regime + 4 indices) ───────────────────────────── */
.sov-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}
.sov-stat {
    background: var(--tt-panel-grad);
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    padding: 9px 12px 8px;
    min-width: 0;
    box-shadow: var(--tt-shadow);
}
.sov-stat-label {
    font-size: 0.56rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.6px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sov-stat-value {
    font-size: 1rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
    color: #f1f5f9;
    line-height: 1.15;
    white-space: nowrap;
}
.sov-stat-delta {
    font-size: 0.62rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    margin-top: 2px;
    color: #64748b;
}
.sov-stat.sov-regime-on {
    background: linear-gradient(180deg, rgba(34,197,94,0.14), rgba(34,197,94,0.05));
    border-color: rgba(34,197,94,0.4);
}
.sov-stat.sov-regime-on .sov-stat-value { color: var(--tt-up); }
.sov-stat.sov-regime-off {
    background: linear-gradient(180deg, rgba(239,68,68,0.14), rgba(239,68,68,0.05));
    border-color: rgba(239,68,68,0.4);
}
.sov-stat.sov-regime-off .sov-stat-value { color: var(--tt-down); }

.mo-up { color: var(--tt-up) !important; }
.mo-down { color: var(--tt-down) !important; }

/* ── Sector heat grid ──────────────────────────────────────────────── */
.sov-sectors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 6px;
    margin: 0 0 12px;
}
.sov-sector-tile {
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    background: var(--tt-panel-grad);
    padding: 7px 9px;
    text-align: left;
    cursor: pointer;
    min-width: 0;
    transition: border-color 0.15s;
}
.sov-sector-tile:hover { border-color: rgba(34,211,238,0.45); }
.sov-sector-tile.active { border-color: var(--tt-accent, #22d3ee) !important; box-shadow: 0 0 0 1px rgba(34,211,238,0.35) inset; }
.sov-sector-label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.sov-sector-chg {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    color: #64748b;
}
.sov-sector-tile.mo-up {
    background: linear-gradient(180deg, rgba(34,197,94,0.13), rgba(34,197,94,0.04));
    border-color: rgba(34,197,94,0.35);
}
.sov-sector-tile.mo-up .sov-sector-chg { color: var(--tt-up); }
.sov-sector-tile.mo-down {
    background: linear-gradient(180deg, rgba(239,68,68,0.13), rgba(239,68,68,0.04));
    border-color: rgba(239,68,68,0.35);
}
.sov-sector-tile.mo-down .sov-sector-chg { color: var(--tt-down); }
.sov-sector-all {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    color: #94a3b8;
}
.sov-sector-all.active { color: #67e8f9; }

/* ── Movers: two compact cards ─────────────────────────────────────── */
.sov-movers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 14px;
}
.sov-movers-col {
    background: var(--tt-panel-grad);
    border: 1px solid var(--tt-border);
    border-radius: 10px;
    padding: 10px 12px 6px;
    box-shadow: var(--tt-shadow);
}
.sov-movers-col h2 {
    font-size: 0.58rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 6px;
}
.sov-movers-list { list-style: none; margin: 0; padding: 0; }
.sov-movers-list li { border-bottom: 1px solid var(--tt-border-soft); }
.sov-movers-list li:last-child { border-bottom: none; }
.sov-movers-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 2px;
    text-decoration: none;
}
.sov-mv-sym { font-size: 0.72rem; font-weight: 800; color: #f1f5f9; }
.sov-movers-list a:hover .sov-mv-sym { color: #67e8f9; }
.sov-mv-chg {
    font-size: 0.68rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}
.sov-movers-empty { color: #475569; text-align: center; padding: 10px 0 14px; }

/* ── Controls ──────────────────────────────────────────────────────── */
.sov-controls {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 8px;
}
.sov-search {
    background: var(--tt-input-bg);
    border: 1px solid var(--tt-border);
    color: #e2e8f0;
    font-size: 0.72rem;
    padding: 6px 12px;
    border-radius: 8px;
    width: 200px;
    max-width: 100%;
}
.sov-search:focus { outline: none; border-color: rgba(34,211,238,0.45); }
.sov-search::placeholder { color: #64748b; }

/* ── Universe table ────────────────────────────────────────────────── */
.sov-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--tt-border);
    border-radius: 10px;
    background: var(--tt-panel-grad);
    box-shadow: var(--tt-shadow);
}
.sov-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
.sov-table thead th {
    font-size: 0.56rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--tt-border);
    background: var(--tt-panel-solid);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.sov-table th.sov-sortable { cursor: pointer; user-select: none; }
.sov-table th.sov-sortable:hover { color: #cbd5e1; }
.sov-table th.sov-sort-active { color: var(--tt-accent, #22d3ee); }
.sov-table td.num, .sov-table th.num { text-align: right; }
.sov-table tbody tr {
    border-bottom: 1px solid var(--tt-border-soft);
    transition: background 0.15s;
}
.sov-table tbody tr:last-child { border-bottom: none; }
.sov-table tbody tr:hover { background: rgba(34,211,238,0.04); }
.sov-table td {
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    padding: 7px 12px;
    vertical-align: middle;
    color: #e2e8f0;
    white-space: nowrap;
}
.sov-ticker { display: flex; align-items: baseline; gap: 7px; text-decoration: none; }
.sov-ticker > span:first-child { font-weight: 800; color: #f1f5f9; font-size: 0.74rem; }
.sov-ticker:hover > span:first-child { color: #67e8f9; }
.sov-row-name {
    color: #64748b;
    font-size: 0.62rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sov-sector-cell { color: #64748b; font-size: 0.66rem; }

/* 1d% change pill (matches the crypto overview) */
.sov-chg {
    display: inline-block;
    min-width: 58px;
    text-align: right;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 700;
    color: #64748b;
}
.sov-chg.mo-up { background: var(--tt-up-soft); }
.sov-chg.mo-down { background: var(--tt-down-soft); }

/* Signal pill: BUY / SELL from insider+congress prints */
.sov-sig {
    display: inline-block;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 4px;
    padding: 2px 7px;
}
.sov-sig.mo-up { background: rgba(34,197,94,0.14); }
.sov-sig.mo-down { background: rgba(239,68,68,0.14); }
.sov-sig.sov-sig-neutral { background: rgba(148,163,184,0.14); color: #94a3b8 !important; }

@media (max-width: 1000px) {
    .sov-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .sov-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .sov-movers { grid-template-columns: 1fr; }
    .sov-search { width: 140px; }
}
