jQuery(document).ready(function($) {
    const $fileInput = $('#cash-to-cashUploadFile');
    const $status = $('#cash-to-cashUploadStatus');
    const $hiddenInput = $('#cash-to-cashUploadedFile');

    $fileInput.on('change', function() {
        const file = this.files[0];
        if (!file) return;

        // Vérification extension
        if (!file.name.match(/\.(jpe?g|png|pdf)$/i)) {
            $status.html('<span style="color:red;">' + cash-to-cashParams.messages.invalidType + '</span>');
            $(this).val('');
            return;
        }

        const formData = new FormData();
        formData.append('file', file);
        formData.append('action', 'cash_to_cash_handle_upload');
        formData.append('security', cash-to-cashParams.nonce);

        $status.html('<span style="color:blue;">' + cash-to-cashParams.messages.uploading + '</span>');

        $.ajax({
            url: cash-to-cashParams.ajaxUrl,
            type: 'POST',
            data: formData,
            processData: false,
            contentType: false,
            success: function(response) {
                if (response.success) {
                    $status
