nt">${subcategory.device_count} devices</span>
                </div>
                <div class="tree-content" id="subcategory-${subcategory.id}" style="display: none;">
        `;

        // Direct devices
        if (subcategory.direct_devices && subcategory.direct_devices.length > 0) {
            subcategory.direct_devices.forEach(device => {
                html += renderModalTreeDevice(device);
            });
        }

        // Subbiercategories
        if (subcategory.subbiercategories && subca