/* =============================================================================
   SCREENER.CSS — Page-Specific Styles: Signal Scanner
   AI Supply Chain Dashboard
   Created: 2025-02-27

   ACCENT: Amber/Gold (#f59e0b) — "scanner signal" — distinct from purple
   (universe) and indigo (ETF hub). Each tool has its own colour identity.

   SHARED MODULES IMPORTED:
   - base.css, scores.css, index-bar.css, table.css, admin.css

   REVERT: Paste rules back into screener.html <style>.
   ============================================================================= */

:root {
    --acc:          #f59e0b;
    --acc-dim:      rgba(245,158,11,0.08);
    --acc-glow:     rgba(245,158,11,0.15);
    --ambient-colour: rgba(245,158,11,0.04);
}

/* -------------------------------------------------------------------------
   PAGE HEADER
   ------------------------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-hi);
    letter-spacing: -0.02em;
    line-height: 1;
}

.page-title span { color: var(--acc); }

.page-sub {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* -------------------------------------------------------------------------
   MACRO HEALTH BAR — sticky strip at top of page
   ------------------------------------------------------------------------- */
.macro-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(5,5,7,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
}

.macro-bar::-webkit-scrollbar { display: none; }

.macro-segment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.macro-segment:first-child { padding-left: 0; }
.macro-segment:last-child  { border-right: none; margin-left: auto; }

.macro-sym   { font-size: 9px; font-weight: 800; color: var(--text-hi); letter-spacing: 0.05em; }
.macro-score { font-size: 9px; font-weight: 700; }
.macro-ctx   { font-size: 8px; color: var(--text-dim); letter-spacing: 0.06em; }
.macro-divider { width: 1px; height: 16px; background: var(--border); }

.breadth-bar   { display: flex; align-items: center; gap: 6px; }
.breadth-track { width: 60px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.breadth-fill  { height: 100%; border-radius: 2px; transition: width 0.8s ease; }
.macro-health  { font-size: 8px; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: 0.08em; }
.health-good    { background: rgba(16,185,129,0.12); color: var(--gain); }
.health-caution { background: rgba(251,191,36,0.12); color: #fbbf24; }
.health-bad     { background: rgba(239,68,68,0.12);  color: var(--loss); }

/* -------------------------------------------------------------------------
   SCAN TABS — A+ Setups / Others (2026-03-16)
   ------------------------------------------------------------------------- */
.scan-tabs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.scan-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.scan-tab {
    padding: 6px 16px;
    font-family: var(--font-data);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.scan-tab:not(:last-child) { border-right: 1px solid var(--border); }
.scan-tab:hover            { color: var(--acc); background: var(--acc-dim); }
.scan-tab.active           { color: #000; background: var(--acc); font-weight: 800; }

/* Scan tags column — hidden on A+ tab, shown on Others */
.col-scans-only { display: none; }

/* Pullback type column — hidden by default, shown on Pullbacks tab */
.col-pb-only { display: none; }

/* -------------------------------------------------------------------------
   TIER PANELS — collapsible filter sections
   ------------------------------------------------------------------------- */
/* ── Side-by-side grid layout for T1 + T2 (2026-03-14) ────────────────── */
/* T1 and T2 sit as two equal columns. T4/T7 span full width below.
   On screens below 900px, collapses to single column.
   REVERT: Restore .tiers-wrap { flex-direction: column } */
.tiers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .tiers-grid {
        grid-template-columns: 1fr;
    }
    .tiers-grid > [style*="grid-column"] {
        grid-column: auto !important;
    }
}

.tier-panel {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    overflow: visible;
    transition: border-color 0.2s;
    position: relative;
}

.tier-panel.has-filters { border-color: rgba(245,158,11,0.3); }
.tier-panel.locked      { opacity: 0.45; pointer-events: none; }

.tier-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.tier-header:hover { background: rgba(255,255,255,0.02); }

.tier-num  { font-size: 8px; font-weight: 800; color: var(--text-dim); letter-spacing: 0.1em; min-width: 14px; }
.tier-name { font-size: 10px; font-weight: 700; color: var(--text-base); flex: 1; letter-spacing: 0.04em; }
.tier-panel.has-filters .tier-name { color: var(--acc); }

.tier-count { font-size: 8px; font-weight: 800; padding: 1px 7px; border-radius: 10px; min-width: 22px; text-align: center; }
.tier-count.active   { background: var(--acc-glow); color: var(--acc); border: 1px solid rgba(245,158,11,0.25); }
.tier-count.inactive { background: rgba(255,255,255,0.03); color: var(--text-dim); border: 1px solid var(--border); }

.tier-lock    { font-size: 9px; color: var(--text-dim); margin-left: 4px; }
.tier-chevron { font-size: 9px; color: var(--text-dim); transition: transform 0.2s; }
.tier-panel.open .tier-chevron { transform: rotate(180deg); }

.tier-body { display: none; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.tier-panel.open .tier-body { display: block; }

/* -------------------------------------------------------------------------
   FILTER CONTROLS inside tier body
   ------------------------------------------------------------------------- */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.filter-row:last-child { margin-bottom: 0; }

.filter-lbl {
    font-size: 8px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-width: 80px;
}

/* Pill toggles */
.pill-group { display: flex; gap: 4px; flex-wrap: wrap; }

.pill {
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: none;
    font-family: var(--font-data);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
}

.pill:hover       { border-color: var(--acc); color: var(--acc); }
.pill.on          { border-color: var(--acc); color: #000; background: var(--acc); }
.pill.multi.on    { background: rgba(245,158,11,0.25); color: #f59e0b; border-color: rgba(245,158,11,0.5); }

/* Range slider */
.range-wrap   { display: flex; align-items: center; gap: 8px; }

.range-input {
    -webkit-appearance: none;
    width: 120px;
    height: 3px;
    background: var(--border-mid);
    border-radius: 2px;
    outline: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--acc);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 0 6px rgba(245,158,11,0.4);
}

.range-val {
    font-size: 10px;
    color: var(--text-hi);
    font-weight: 700;
    min-width: 40px;
}

/* Mini select */
.mini-sel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-family: var(--font-data);
    font-size: 9px;
    color: var(--text-base);
    outline: none;
    cursor: pointer;
}

.mini-sel:focus { border-color: var(--acc); }

/* -------------------------------------------------------------------------
   RUN BUTTON + RESULT SUMMARY
   ------------------------------------------------------------------------- */
/* ── Compact run button — sits in preset row (2026-03-14) ──────────── */
/* REVERT: Restore .run-row and .run-btn blocks. */
.run-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--acc);
    background: var(--acc-glow);
    font-family: var(--font-data);
    font-size: 10px;
    font-weight: 800;
    color: var(--acc);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.04em;
    white-space: nowrap;
    margin-left: auto;
}

.run-btn-compact:hover { background: var(--acc); color: #000; }
.run-btn-compact.running { pointer-events: none; opacity: 0.7; }

.run-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.run-btn-compact.running .run-dot { animation: ping 1s infinite; }

@keyframes ping {
    0%, 100% { opacity: 1; transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(1.4); }
}

.result-summary   { font-size: 10px; color: var(--text-mid); white-space: nowrap; }
.result-summary b { color: var(--acc); font-weight: 800; }

.reset-btn {
    font-size: 9px;
    color: var(--text-dim);
    border: 1px solid var(--border);
    background: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-family: var(--font-data);
    transition: all 0.2s;
    margin-left: auto;
}

.reset-btn:hover { color: var(--loss); border-color: var(--loss); }

/* -------------------------------------------------------------------------
   SCREENER RESULTS TABLE extras
   ------------------------------------------------------------------------- */
.results-label {
    font-size: 8px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* setup-score-cell removed 2026-03-14 — replaced by Setup badge from convBadgeHtml */

.tier-checks { display: flex; gap: 3px; }

.tc { font-size: 8px; font-weight: 700; padding: 1px 5px; border-radius: 3px; }
.tc.pass { background: rgba(16,185,129,0.1); color: var(--gain); }
.tc.fail { background: rgba(255,255,255,0.03); color: var(--border-mid); }
.tc.lock { background: rgba(255,255,255,0.02); color: var(--border); }

/* ── Star / Favorites column ──────────────────────────────────────────── */
.star-cell {
    text-align: center; width: 28px; max-width: 28px; padding: 0 2px !important;
    font-size: 13px; cursor: pointer; user-select: none;
    transition: transform 0.15s, color 0.15s;
}
.star-cell:hover { transform: scale(1.25); }
.star-cell.star-active { color: #f59e0b; text-shadow: 0 0 6px rgba(245,158,11,0.4); }
.star-cell.star-inactive { color: var(--border-mid); opacity: 0.4; }
.star-cell.star-inactive:hover { color: #f59e0b; opacity: 0.7; }
