nction changePage(page) {
    currentPage = page;
    renderAllDevicesTable();
}

// Close modal when clicking outside
document.addEventListener('click', function(e) {
    const modal = document.getElementById('allDevicesModal');
    if (e.target === modal) {
        closeAllDevicesModal();
    }
});

// Close modal with escape key
document.addEventListener('keydown', function(e) {
    if (e.key === 'Escape') {
        closeAllDevicesModal();
    }
});

// Initialize additional functionality
document.addEve