/* ═══ 📈 History Tab ═══ */
.history-period-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.history-period-btn {
    background: rgba(20, 27, 45, 0.5);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}
.history-period-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}
.history-period-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text);
    border-color: var(--primary);
}

.history-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.hist-stat-card {
    background: rgba(15, 20, 33, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}
.hist-stat-card.buy { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.05); }
.hist-stat-card.sell { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.05); }
.hist-stat-card.confidence { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.05); }

.hist-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hist-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}
.hist-stat-value.buy-color { color: var(--success); }
.hist-stat-value.sell-color { color: var(--danger); }
.hist-stat-value.gold-color { color: var(--gold); }
.hist-stat-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.history-trend-chart {
    background: rgba(15, 20, 33, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}
.history-trend-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.history-trend-svg {
    width: 100%;
    height: 100px;
    overflow: visible;
}

.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.history-item {
    display: grid;
    grid-template-columns: 12px 90px 1fr 80px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(20, 27, 45, 0.4);
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 8px;
    transition: all 0.2s;
}
.history-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
}
.history-item.bias-buy { border-left-color: var(--success); }
.history-item.bias-sell { border-left-color: var(--danger); }
.history-item.bias-neutral { border-left-color: var(--text-muted); }

.hist-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 auto;
}
.hist-dot.buy { background: var(--success); }
.hist-dot.sell { background: var(--danger); }
.hist-dot.neutral { background: var(--text-muted); }

.hist-time {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.hist-time-relative {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.hist-content {
    min-width: 0;
}
.hist-bias {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 3px;
}
.hist-bias.buy { color: var(--success); }
.hist-bias.sell { color: var(--danger); }
.hist-bias.neutral { color: var(--text-muted); }
.hist-headline {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hist-confidence {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
}
.hist-conf-label {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.history-empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.history-empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.history-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .history-item {
        grid-template-columns: 8px 70px 1fr 60px;
        gap: 8px;
        padding: 10px;
    }
    .hist-headline { display: none; }
}



