/* 문서 유형 관련 */
function loadDocTypes() {
    fetch('/api/doc-types')
    .then(r => r.json())
    .then(data => {
        docTypes = data;
        renderDocTypeList();
        if (docTypes.length > 0) selectDocType(docTypes[0].id);
    });
}

function renderDocTypeList() {
    const container = document.getElementById('docTypeList');
    container.classList.remove('loading');
    container.innerHTML = docTypes.map(doc =>
        `<div class="doc-type-item ${doc.id === currentDocType ? 'selected' : ''}" 
            data-id="${doc.id}" onclick="selectDocType('${doc.id}')">
            <span class="icon">${doc.icon}</span>
            <div class="info">
                <div class="name">${doc.name}</div>
                <div class="desc">${doc.description}</div>
            </div>
        </div>`
J).join('');
}

function selectDocType(id) {
    currentDocType = id;
    renderDocTypeList();
    updateDocTypeOptions();
}

function updateDocTypeOptions() {
    const doc = docTypes.find(d => d.id === currentDocType);
    const container = document.getElementById('docTypeOptionsContainer');
    if (!doc || !doc.options) {
        container.innerHTML = '';
        return;
    }
    
    // 옵션 엠믨 생성 ...
}

