ice-status device-status-maintenance">Maintenance</span>';
        }

        let caseInfo = '';
        if (isUnavailable && device.caseName) {
            caseInfo = `<span class="case-info">In ${device.caseName}</span>`;
        }

        const deviceClasses = `tree-device ${isSelected ? 'selected' : ''} ${isUnavailable ? 'unavailable' : ''}`;
        
        return `
            <div class="${deviceClasses}" onclick="${isUnavailable ? '' : `toggleModalTreeDeviceSelection('${device.deviceID}')`}">
    