y.addEventListener('click', function(e) {
        if (e.target === overlay) {
            closeMetricDetail();
        }
    });
    
    // Store reference for closing
    window.currentMetricOverlay = overlay;
}

function getMetricDetailContent(metricType, index) {
    const insights = [
        {
            title: 'Revenue Analysis',
            content: `
                <div class="rc-grid rc-grid-cols-1 rc-gap-4">
                    <div class="rc-metric-breakdown">
                        <h4><i cl