/* ═══════════════════════════════════════════════════
   Stage 2 Scanner — Premium Dark Dashboard Theme
   ═══════════════════════════════════════════════════ */

:root {
    /* Core Palette */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Accent Colors */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-pink: #ec4899;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-green: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-amber: linear-gradient(135deg, #f59e0b, #ec4899);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(59, 130, 246, 0.3);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);

    /* Spacing */
    --radius: 14px;
    --radius-sm: 8px;
    --gap: 1.5rem;

    /* Font */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ─── Background Pattern ─── */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(59,130,246,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139,92,246,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6,182,212,0.03) 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Top Bar ─── */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.version-badge {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.status-dot.idle { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.status-dot.loading { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); animation: pulse 1s infinite; }
.status-dot.error { background: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.last-update {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Button ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 0.9rem;
}

/* ─── Dashboard Layout ─── */
.dashboard {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

/* ─── Summary Cards ─── */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    margin-bottom: 1.5rem;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.card-icon {
    font-size: 2rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.card-value {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.card-sub {
    font-size: 0.75rem;
    color: var(--accent-green);
    font-weight: 600;
}

.summary-card.highlight .card-value {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-card.highlight-green .card-value {
    background: var(--gradient-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.chart-card, .table-card {
    padding: 1.5rem;
}

.chart-card h2, .table-card h2, .card h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.card-header h2 {
    margin-bottom: 0;
}

/* ─── Charts ─── */
.chart-container {
    position: relative;
    height: 320px;
}

.chart-container.chart-tall {
    height: 420px;
}

/* ─── Tabs ─── */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    overflow-x: auto;
}

.tab {
    padding: 0.6rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.25);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* ─── Grid Layouts ─── */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

/* ─── Data Tables ─── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: rgba(30, 41, 59, 0.95);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

.data-table tbody td {
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.data-table tbody td.wrap {
    white-space: normal;
    max-width: 400px;
    line-height: 1.5;
}

/* Cell styling */
.cell-ticker {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-cyan) !important;
    letter-spacing: 0.03em;
}

.cell-positive {
    color: var(--accent-green) !important;
    font-weight: 600;
}

.cell-negative {
    color: var(--accent-red) !important;
    font-weight: 600;
}

.cell-score {
    font-weight: 700;
    font-family: var(--font-mono);
}

.score-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.score-bar-bg {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ─── Search Input ─── */
.search-input {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease;
    min-width: 200px;
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ─── News Grid ─── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    max-height: 700px;
    overflow-y: auto;
    padding: 1rem;
}

.news-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.news-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.news-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.news-ticker {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.news-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.news-title-en {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-title-zh {
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 0.8rem;
}

.news-source {
    font-size: 0.8rem;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.news-source:hover {
    background: rgba(59, 130, 246, 0.2);
    text-decoration: underline;
}

.quick-links {
    display: flex;
    gap: 0.5rem;
}

.quick-link-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.quick-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.2);
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-ticker {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-cyan);
    font-size: 0.8rem;
}

.news-sentiment {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}

.sentiment-positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.sentiment-negative {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.sentiment-neutral {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.news-title {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
}

.news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.news-title a:hover {
    color: var(--accent-blue);
}

.news-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.news-filters {
    display: flex;
    gap: 0.35rem;
}

.filter-btn {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* ─── Settings Filter Grid ─── */
.settings-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat, repeat;
    background-position: right .7rem top 50%, 0 0;
    background-size: .65rem auto, 100%;
}

.filter-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.filter-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.filter-select option[value=""] {
    color: var(--text-muted);
    font-style: italic;
}

.filter-url-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(10, 14, 23, 0.5);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-url-preview label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-url-preview code {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.8rem;
    word-break: break-all;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    grid-column: 1 / -1;
}

/* ─── Loading Overlay ─── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

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

.loading-spinner p {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.loading-sub {
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    font-size: 0.85rem !important;
    margin-top: 0.25rem;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }
    .top-bar-right {
        width: 100%;
        justify-content: space-between;
    }
    .dashboard {
        padding: 1rem;
    }
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    .news-grid {
        grid-template-columns: 1fr;
    }
    .tabs {
        overflow-x: auto;
    }
}

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

/* ─── Grid View ─── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0;
    min-height: 400px;
}

.mini-chart-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.mini-chart-card:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.mini-chart-header {
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 14, 23, 0.5);
    border-bottom: 1px solid var(--border-subtle);
}

.mini-chart-ticker {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.mini-chart-widget {
    height: 180px;
    width: 100%;
    background: rgba(0,0,0,0.2);
    position: relative;
}

.mini-chart-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── Login Screen ─── */
.login-screen {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.login-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.login-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.login-error {
    color: var(--accent-red);
    font-size: 0.8rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* ─── TradingView Chart Panel ─── */

/* Clickable tickers */
.cell-ticker-link {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-cyan) !important;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cell-ticker-link:hover {
    color: var(--accent-blue) !important;
    text-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.cell-ticker-link::after {
    content: '📊';
    font-size: 0.65rem;
    margin-left: 0.3rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cell-ticker-link:hover::after {
    opacity: 1;
}

/* Overlay backdrop */
.tv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.tv-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Slide-up panel */
.tv-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5), 0 -2px 20px rgba(59, 130, 246, 0.1);
    z-index: 600;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.tv-panel.active {
    transform: translateY(0);
}

/* Panel header */
.tv-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.tv-panel-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tv-panel-icon {
    font-size: 1.2rem;
}

.tv-ticker-name {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.tv-exchange-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tv-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tv-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
    transform: scale(1.05);
}

/* Widget container */
.tv-widget-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.tv-widget-container iframe {
    width: 100% !important;
    height: 100% !important;
}

/* ─── TradingView Responsive ─── */
@media (max-width: 768px) {
    .tv-panel {
        height: 85vh;
        border-radius: 16px 16px 0 0;
    }

    .tv-panel-header {
        padding: 0.6rem 1rem;
        border-radius: 16px 16px 0 0;
    }

    .tv-ticker-name {
        font-size: 1rem;
    }
}
