hart.instances) {
        Object.values(Chart.instances).forEach(chart => {
            if (chart && chart.options) {
                chart.options.responsive = true;
                chart.options.maintainAspectRatio = false;
                chart.update();
            }
        });
    }
}

// All Devices Modal functionality
let allDevicesData = [];
let currentSort = { field: 'total_revenue', order: 'desc' };
let currentPage = 1;
const itemsPerPage = 50;

function toggleAllDevicesView() {
    const modal =