                      } else {
                            $("#export-btn").hide();
                        }

                    }
                });
            });
        }


        // Initial load with all models
        loadPivotData("candidate");

        // Model selection change event
        $("#model-select").on("change", function () {
            let selectedModel = $(this).val();
            loadPivotData(selectedModel); // Reload pivot data with selected model
        });

        // Export