     
        function updateTimestamp() {
            const timestamp = new Date(statsData.last_updated);
            document.getElementById('lastUpdatedTime').textContent = timestamp.toLocaleString();
        }
        
        function showErrorState() {
            document.getElementById('metricsGrid').innerHTML = `
                <div class="metric-card" style="grid-column: 1 / -1; text-align: center; padding: 2rem;">
                    <div style="color: var(--text-error); font-size: 1.5rem; margi