/* ═══ 📈 Analytics Dashboard ═══ */
.analytics-modal {
    max-width: 1200px;
}
.analytics-period-bar {
    display: flex;
    gap: 8px;
    padding: 12px 22px;
    background: rgba(15, 20, 33, 0.4);
    border-bottom: 1px solid var(--border);
}
.ap-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;
}
.ap-btn:hover {
    border-color: var(--primary);
    color: var(--text);
}
.ap-btn.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text);
    border-color: var(--primary);
}

.analytics-section {
    margin-bottom: 28px;
}
.analytics-section-title {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.ao-card {
    background: rgba(15, 20, 33, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.ao-card.primary { border-color: rgba(99, 102, 241, 0.4); background: rgba(99, 102, 241, 0.05); }
.ao-card.success { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.05); }
.ao-card.danger { border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.05); }
.ao-card.warning { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.05); }

.ao-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.ao-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}
.ao-icon {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

/* Top performers list */
.top-performers-list {
    background: rgba(15, 20, 33, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.tp-row {
    display: grid;
    grid-template-columns: 30px 100px 1fr 100px 100px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
}
.tp-row:last-child { border-bottom: none; }
.tp-row:hover {
    background: rgba(99, 102, 241, 0.05);
}
.tp-rank {
    text-align: center;
    font-weight: 700;
    color: var(--gold);
    font-size: 1rem;
}
.tp-rank.gold-1 { color: #ffd700; }
.tp-rank.gold-2 { color: #c0c0c0; }
.tp-rank.gold-3 { color: #cd7f32; }
.tp-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--gold);
    font-size: 0.95rem;
}
.tp-bar-container {
    background: rgba(20, 27, 45, 0.5);
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
    display: flex;
    position: relative;
}
.tp-bar-buy {
    background: linear-gradient(90deg, var(--success), rgba(16, 185, 129, 0.7));
    height: 100%;
    transition: width 0.4s;
}
.tp-bar-sell {
    background: linear-gradient(90deg, var(--danger), rgba(239, 68, 68, 0.7));
    height: 100%;
    transition: width 0.4s;
}
.tp-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.tp-confidence {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    color: var(--gold);
    font-weight: 600;
}
.tp-count {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Activity heatmap */
.heatmap-container {
    background: rgba(15, 20, 33, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 3px;
    margin-bottom: 8px;
}
.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.2s;
    cursor: pointer;
    min-height: 22px;
}
.heatmap-cell:hover {
    transform: scale(1.2);
    border-color: var(--primary);
    z-index: 10;
}
.heatmap-labels {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 3px;
    font-size: 0.6rem;
    color: var(--text-dim);
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    justify-content: center;
}
.heatmap-legend-cells {
    display: flex;
    gap: 2px;
}
.heatmap-legend-cells .heatmap-cell {
    width: 14px;
    height: 14px;
    min-height: 0;
}

@media (max-width: 768px) {
    .tp-row {
        grid-template-columns: 25px 80px 1fr 60px;
        gap: 8px;
        padding: 10px;
    }
    .tp-count { display: none; }
}



