    category.direct_devices.forEach(device => {
                html += renderModalTreeDevice(device);
            });
        }

        // Subcategories
        if (category.subcategories && category.subcategories.length > 0) {
            category.subcategories.forEach(subcategory => {
                html += renderModalTreeSubcategory(subcategory);
            });
        }

        html += `
                </div>
            </div>
        `;

        return html;
    }
    
    function renderModalTr