> 0) {
                    totalRecords = data.tables.reduce((sum, table) => sum + (table.record_count || 0), 0);
                }

                document.getElementById('totalRecords').textContent = totalRecords.toLocaleString();
                document.getElementById('totalTables').textContent = data.total_tables || 0;

            } catch (error) {
                console.error('Failed to load stats:', error);
                // Set default values
                document.getElementById('totalRecords