    .mda-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.48);
        z-index: var(--z-modal-3); /* D-51 (era 999000) */
        align-items: center;
        justify-content: center;
    }

        .mda-backdrop.mda-visible {
            display: flex;
        }

    .mda-modal {
        background: #fff;
        border-radius: 14px;
        width: 96vw;
        max-width: 960px;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        border: 0.5px solid #BFCFE8;
        overflow: hidden;
    }

    /* Header */
    .mda-header {
        background: #1D4ED8;
        padding: 13px 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #fff;
        font-size: 14px;
        font-weight: 500;
        flex-shrink: 0;
    }

    .mda-btn-close {
        background: rgba(255,255,255,0.15);
        border: none;
        color: #fff;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Body */
    .mda-body {
        display: flex;
        flex: 1;
        overflow: hidden;
    }

    /* Panel izquierdo */
    .mda-left {
        width: 290px;
        min-width: 290px;
        border-right: 0.5px solid #DBEAFE;
        display: flex;
        flex-direction: column;
        background: #F0F6FF;
        overflow: hidden;
    }

    .mda-section {
        padding: 12px 14px;
        border-bottom: 0.5px solid #DBEAFE;
        flex-shrink: 0;
    }

    .mda-section-flex {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .mda-section-title {
        font-size: 10px;
        font-weight: 500;
        color: #1D4ED8;
        text-transform: uppercase;
        letter-spacing: .6px;
        margin-bottom: 10px;
    }

    /* Dropzone */
    .mda-dropzone {
        border: 1.5px dashed #93C5FD;
        border-radius: 10px;
        padding: 16px 10px;
        text-align: center;
        background: #EFF6FF;
        cursor: pointer;
        transition: border-color .2s, background .2s;
    }

        .mda-dropzone:hover, .mda-dropzone.mda-dragover {
            border-color: #1D4ED8;
            background: #DBEAFE;
        }

        .mda-dropzone i {
            font-size: 28px;
            color: #3B82F6;
            display: block;
            margin-bottom: 4px;
        }

        .mda-dropzone p {
            font-size: 12px;
            color: #1D4ED8;
            font-weight: 500;
        }

        .mda-dropzone small {
            font-size: 10px;
            color: #60A5FA;
        }

    /* Lista docs */
    .mda-doc-list {
        overflow-y: auto;
        flex: 1;
        padding: 6px;
    }

    .mda-doc-item {
        display: flex;
        align-items: center;
        gap: 7px;
        padding: 7px 8px;
        border-radius: 8px;
        cursor: pointer;
        border: 0.5px solid transparent;
        margin-bottom: 4px;
        background: #fff;
        transition: all .15s;
    }

        .mda-doc-item:hover {
            border-color: #93C5FD;
            background: #EFF6FF;
        }

        .mda-doc-item.mda-doc-active {
            border-color: #1D4ED8;
            background: #DBEAFE;
        }

    .mda-doc-icon {
        width: 30px;
        height: 30px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        flex-shrink: 0;
    }

    .mda-icon-xml {
        background: #DBEAFE;
        color: #1E40AF;
    }

    .mda-icon-cdr {
        background: #EDE9FE;
        color: #5B21B6;
    }

    .mda-icon-pdf {
        background: #FEF3C7;
        color: #92400E;
    }

    .mda-doc-info {
        flex: 1;
        min-width: 0;
    }

    .mda-doc-name {
        font-size: 11px;
        font-weight: 500;
        color: #1E3A8A;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mda-doc-meta {
        font-size: 10px;
        color: #60A5FA;
    }

    .mda-badge {
        font-size: 9px;
        padding: 2px 6px;
        border-radius: 4px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mda-badge-new {
        background: #DCFCE7;
        color: #166534;
    }

    .mda-badge-saved {
        background: #DBEAFE;
        color: #1E40AF;
    }

    .mda-btn-del {
        background: none;
        border: none;
        color: #93C5FD;
        cursor: pointer;
        padding: 2px;
        border-radius: 4px;
        font-size: 12px;
    }

        .mda-btn-del:hover {
            color: #EF4444;
            background: #FEF2F2;
        }

    .mda-empty-list {
        text-align: center;
        padding: 20px;
        color: #93C5FD;
        font-size: 12px;
    }

        .mda-empty-list i {
            font-size: 28px;
            display: block;
            margin-bottom: 4px;
        }

    /* Panel derecho */
    .mda-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #F8FBFF;
    }

    .mda-preview-header {
        padding: 9px 16px;
        border-bottom: 0.5px solid #DBEAFE;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 12px;
        color: #1D4ED8;
        font-weight: 500;
        flex-shrink: 0;
        background: #fff;
    }

    .mda-preview-body {
        flex: 1;
        overflow: auto;
        padding: 12px;
        display: flex;
        flex-direction: column;
    }

    .mda-iframe-pdf {
        flex: 1;
        width: 100%;
        min-height: 400px;
        border: 0.5px solid #DBEAFE;
        border-radius: 8px;
        background: #fff;
    }

    /* .mda-xml-pre {
        flex: 1;
        background: #fff;
        border: 0.5px solid #DBEAFE;
        border-radius: 8px;
        padding: 12px;
        font-size: 11px;
        font-family: monospace;
        color: #1E3A8A;
        overflow: auto;
        white-space: pre;
        line-height: 1.7;
        min-height: 300px;
    } */
    .mda-xml-pre {
        margin: 0;
        padding: 12px;
        overflow: auto;
        white-space: pre-wrap;
        word-break: break-word;
        font-family: Consolas, 'Courier New', monospace;
        font-size: 13px;
        line-height: 1.5;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
    }

    .mda-preview-empty {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #93C5FD;
        text-align: center;
    }

        .mda-preview-empty i {
            font-size: 44px;
            margin-bottom: 8px;
        }

        .mda-preview-empty p {
            font-size: 13px;
        }

    .mda-preview-loading {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #60A5FA;
    }

    /* Footer */
    .mda-footer {
        padding: 10px 16px;
        border-top: 0.5px solid #DBEAFE;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #F0F6FF;
        flex-shrink: 0;
    }

    .mda-footer-actions {
        display: flex;
        gap: 8px;
    }

    .mda-counter {
        font-size: 11px;
        color: #60A5FA;
    }

        .mda-counter strong {
            color: #1D4ED8;
        }

    .mda-btn {
        border-radius: 7px;
        padding: 7px 16px;
        font-size: 13px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
        border: 0.5px solid #93C5FD;
        font-weight: 500;
    }

    .mda-btn-primary {
        background: #1D4ED8;
        color: #fff;
        border-color: #1D4ED8;
    }

        .mda-btn-primary:hover:not(:disabled) {
            background: #1E40AF;
        }

        .mda-btn-primary:disabled {
            opacity: .5;
            cursor: not-allowed;
        }

    .mda-btn-secondary {
        background: #fff;
        color: #1D4ED8;
    }

        .mda-btn-secondary:hover {
            background: #EFF6FF;
        }

    .mda-spin {
        animation: spin .8s linear infinite;
        display: inline-block;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }

    .xml-viewer {
        padding: 16px;
        overflow: auto;
        height: 100%;
        background: #1e1e1e;
        color: #d4d4d4;
        font-family: Consolas, Monaco, 'Courier New', monospace;
        font-size: 13px;
        line-height: 1.6;
        border-radius: 8px;
        white-space: pre;
    }

    .xml-tag {
        color: #569cd6;
        font-weight: 600;
    }

    .xml-attr {
        color: #9cdcfe;
    }

    .xml-value {
        color: #ce9178;
    }

    .mda-pdf-frame {
        width: 100%;
        height: 100%;
        border: none;
    }
