cture: ${error.message}</p>
                </div>
            `;
        }
    }
    
    function renderModalTreeView(categories) {
        const container = document.getElementById('modalTreeViewContainer');
        
        if (!categories || categories.length === 0) {
            container.innerHTML = `
                <div class="text-center py-3 text-muted">
                    <i class="bi bi-diagram-3 display-6"></i>
                    <p class="mt-2">No devices found</p>
                </div>
  