/* ──────────────────────────────────────────────────────────────
   ScreenerX.ai — dashboard
   ────────────────────────────────────────────────────────────── */

:root {
    --bg-deep: #05040a;
    --bg-base: #0c0b12;
    --surface-1: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.07);
    --surface-3: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text-primary: #f4f4f8;
    --text-secondary: #9ca3b8;
    --text-dim: #6b7289;
    --accent: #22d3ee;
    --accent-2: #a78bfa;
    --accent-mix: #38bdf8;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --accent-red: #fb7185;
    --gradient-brand: linear-gradient(135deg, #22d3ee 0%, #a78bfa 100%);
    --gradient-btn: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 55%, #a78bfa 100%);
    --shadow-glow: 0 0 60px rgba(34, 211, 238, 0.12);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --transition: 0.22s var(--ease);
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Ambient mesh */
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(34, 211, 238, 0.18), transparent 50%),
        radial-gradient(ellipse 60% 40% at 85% 10%, rgba(167, 139, 250, 0.15), transparent 45%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(6, 182, 212, 0.08), transparent 50%);
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
    position: relative;
    z-index: 1;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 32px);
}

/* ── Header ── */
.header {
    padding: clamp(16px, 2.5vw, 28px) 0;
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-shell {
    background: rgba(12, 11, 18, 0.72);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: clamp(14px, 2vw, 20px) clamp(18px, 2.5vw, 28px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    flex-shrink: 0;
    filter: drop-shadow(0 8px 24px rgba(34, 211, 238, 0.25));
}

.brand-text {
    min-width: 0;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.brand h1 {
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-pill {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--accent);
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

.header-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.header-user-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
    width: 100%;
    max-width: 100%;
}

.auth-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: min(100%, 260px);
    padding: 4px 12px 4px 4px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
}

.auth-user-chip .auth-pic {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
}

.auth-user-chip__name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.header-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}

.header-toolbar .status-chip {
    padding: 5px 11px;
    font-size: 0.72rem;
    gap: 6px;
}

.header-toolbar .pulse {
    width: 6px;
    height: 6px;
}

.header-toolbar .scope-select {
    padding: 7px 30px 7px 11px;
    font-size: 0.75rem;
    min-width: 0;
    max-width: min(210px, 42vw);
    border-radius: var(--radius-sm);
    background-position: right 10px center;
}

.header-toolbar .btn-scan {
    padding: 8px 16px;
    font-size: 0.8rem;
    gap: 6px;
}

.header-toolbar .btn-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Only in DOM for admins; hidden for everyone else (see /api/me is_admin). */
.auth-admin-pill {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.35);
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition), border-color var(--transition);
}

.auth-admin-pill:hover {
    background: rgba(34, 211, 238, 0.18);
    border-color: rgba(34, 211, 238, 0.55);
}

.auth-signout {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
}

.auth-signout:hover {
    color: var(--text-secondary);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    animation: pulse-anim 2s ease-in-out infinite;
}

.pulse.scanning {
    background: var(--warning);
    box-shadow: 0 0 12px var(--warning);
}

@keyframes pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.15); }
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.btn-scan {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #05040a;
    cursor: pointer;
    overflow: hidden;
    background: var(--gradient-btn);
    box-shadow: 0 4px 24px rgba(34, 211, 238, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform var(--transition), box-shadow var(--transition);
}

.btn-scan__glow {
    display: none;
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-scan:active {
    transform: translateY(0);
}

.btn-scan:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-scan .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-scan .btn-icon svg {
    animation: none;
}

.btn-scan:disabled .btn-icon svg {
    animation: spin 0.85s linear infinite;
}

.btn-scan:focus-visible,
.scope-select:focus-visible,
.search-input:focus-visible,
.filter-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scope-select {
    padding: 10px 36px 10px 14px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: min(280px, 100%);
}

.scope-select:hover,
.scope-select:focus {
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.main {
    padding-bottom: 48px;
}

/* ── Stats ── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(10px, 2vw, 16px);
    padding: clamp(20px, 3vw, 28px) 0;
    animation: fadeInUp 0.55s var(--ease);
}

.stat-card {
    position: relative;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: 0.65;
}

.stat-card--candidates::before { opacity: 1; }
.stat-card--scanned::before { background: linear-gradient(90deg, #64748b, #94a3b8); opacity: 0.5; }
.stat-card--filtered::before { background: linear-gradient(90deg, #f59e0b, #fb923c); opacity: 0.5; }
.stat-card--score::before { background: linear-gradient(90deg, #34d399, #22d3ee); opacity: 0.8; }

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-glow);
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.stat-value {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.stat-value--muted {
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
    opacity: 0.85;
}

/* ── Loading ── */
.loading-section {
    display: flex;
    justify-content: center;
    padding: clamp(64px, 12vw, 120px) 0;
}

.loader-card {
    text-align: center;
    padding: 40px 48px;
    border-radius: var(--radius-xl);
    background: var(--surface-1);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.loader-orbit {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-right-color: var(--accent-2);
    animation: spin 0.85s linear infinite;
    position: relative;
}

.loader-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.loader-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.loader-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── Empty state ── */
.empty-state {
    display: flex;
    justify-content: center;
    padding: clamp(48px, 10vw, 100px) 0;
}

.empty-card {
    width: 100%;
    max-width: 560px;
    text-align: center;
    padding: clamp(28px, 5vw, 40px);
    border-radius: var(--radius-xl);
    background: linear-gradient(145deg, var(--surface-1), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.empty-visual {
    position: relative;
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
}

.empty-rings {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    animation: ring-pulse 3s ease-in-out infinite;
}

.empty-rings::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.15);
    animation: ring-pulse 3s ease-in-out infinite 0.5s;
}

@keyframes ring-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.5; }
}

.empty-icon {
    font-size: 2rem;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.5);
}

.empty-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.empty-lead {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-1);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: border-color var(--transition), color var(--transition);
}

.feature:hover {
    border-color: rgba(34, 211, 238, 0.35);
    color: var(--text-primary);
}

.feature-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gradient-brand);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

/* ── Filters ── */
.filter-shell {
    margin: 8px 0 16px;
    padding: 4px;
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    border: 1px solid var(--border);
}

.filter-bar {
    display: flex;
    gap: 10px;
    padding: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-search-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.filter-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-input:focus {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.filter-select {
    padding: 11px 36px 11px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:focus {
    border-color: rgba(34, 211, 238, 0.4);
}

/* ── Table ── */
.table-shell {
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    background: var(--surface-1);
    overflow: hidden;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.25);
}

.table-wrapper {
    overflow: auto;
    max-height: calc(100vh - 260px);
    -webkit-overflow-scrolling: touch;
}

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    white-space: nowrap;
}

.results-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 14px 14px;
    text-align: left;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: rgba(8, 7, 15, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}

.results-table th:hover {
    color: var(--accent);
}

.results-table td {
    padding: 12px 14px;
    font-size: 0.86rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    background: transparent;
}

.results-table tbody tr {
    transition: background var(--transition);
}

.results-table tbody tr:hover td {
    background: rgba(34, 211, 238, 0.04);
}

.results-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.col-rank {
    width: 44px;
    text-align: center;
    color: var(--text-dim);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.col-symbol { min-width: 96px; }
.col-company { min-width: 150px; }
.col-industry { min-width: 110px; }
.col-chart { min-width: 112px; }
.col-score { width: 76px; text-align: center; }
.col-price,
.col-entry,
.col-sl,
.col-target { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }
.col-rr { width: 56px; text-align: center; }
.col-signals { min-width: 190px; }
.col-rsi { width: 56px; text-align: center; }

.cell-symbol {
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-mix);
}

.cell-company {
    color: var(--text-secondary);
    font-size: 0.8rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-industry {
    font-size: 0.76rem;
    color: var(--text-dim);
}

/* Score badge */
.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 5px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    border: 1px solid transparent;
}

.score-badge:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 20px rgba(34, 211, 238, 0.2);
}

.score-badge::after {
    content: "i";
    position: absolute;
    top: -5px;
    right: -4px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-2);
    color: #05040a;
    font-size: 0.55rem;
    font-weight: 900;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.score-badge:hover::after {
    opacity: 1;
}

.score-high {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.25);
}

.score-mid {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.25);
}

.score-low {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
    border-color: rgba(251, 113, 133, 0.22);
}

/* Breakdown */
.breakdown-row td {
    padding: 0 !important;
    border-bottom: 1px solid rgba(167, 139, 250, 0.35) !important;
}

.breakdown-panel {
    background: linear-gradient(165deg, rgba(20, 18, 32, 0.98), rgba(8, 7, 15, 0.99));
    border-left: 3px solid var(--accent-2);
    margin: 0;
    padding: 18px 22px;
    animation: slideDown 0.35s var(--ease);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.breakdown-header {
    margin-bottom: 14px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.breakdown-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.factor-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: var(--surface-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.factor-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.factor-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

.factor-values {
    display: flex;
    gap: 8px;
    align-items: center;
}

.factor-raw {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent);
}

.factor-weight-label {
    font-size: 0.62rem;
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-2);
}

.factor-weighted {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--success);
}

.factor-bar-track {
    width: 100%;
    height: 5px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
}

.factor-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.8s var(--ease);
}

.factor-bar-fill.bar-high { background: var(--success); }
.factor-bar-fill.bar-mid { background: var(--warning); }
.factor-bar-fill.bar-low { background: var(--danger); }

.factor-reason {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.35;
}

.cell-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cell-entry { font-weight: 700; color: var(--accent-mix); }
.cell-sl { font-weight: 700; color: var(--danger); }
.cell-target { font-weight: 700; color: var(--success); }
.cell-rr { font-weight: 800; color: var(--success); font-variant-numeric: tabular-nums; }

.signal-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.signal-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(52, 211, 153, 0.1);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.signal-pill.inactive {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border);
    opacity: 0.35;
}

.sparkline-canvas {
    display: block;
    border-radius: 6px;
}

.rsi-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.rsi-cool { color: var(--success); }
.rsi-warm { color: var(--warning); }
.rsi-hot { color: var(--danger); }

/* Footer */
.footer {
    padding: 28px 0 20px;
    margin-top: 32px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 0.76rem;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.5;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeInUp 0.45s var(--ease);
}

/* Responsive */
@media (max-width: 900px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-aside {
        align-items: stretch;
    }

    .header-user-row {
        justify-content: flex-start;
    }

    .header-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .header-toolbar .scope-select {
        min-width: 100%;
        max-width: 100%;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .btn-scan {
        width: 100%;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .col-company,
    .col-industry,
    .col-chart {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }
}
