         
            renderMeasuresList();
            selectMeasure(category, name);
        }

        function deleteMeasure() {
            if (!confirm(`Delete measure ${currentMeasure}?`)) return;
            
            delete measuresDB[currentCategory][currentMeasure];
            currentMeasure = null;
            currentCategory = null;
            
            document.getElementById('measureForm').style.display = 'none';
            document.getElementById('measureTitle').textContent = 'Selec