ct_name': 'Product Name (A-Z)', 
        'rental_count': 'Rental Count'
    };
    
    const dropdown = document.getElementById('sortDropdown');
    if (dropdown) {
        dropdown.innerHTML = `<i class="bi bi-sort-down"></i> Sort: ${sortLabels[field] || 'Revenue'}`;
    }
    
    // Re-fetch data with new sort
    loadAllDevices();
}

function renderAllDevicesTable() {
    const tbody = document.getElementById('allDevicesTableBody');
    if (!tbody) return;
    
    // Calculate pagination
    const tot