e {
                        currentSortOrder = "asc"; // Default to ascending for other columns
                    }
                } else {
                    currentSortOrder = currentSortOrder === "asc" ? "desc" : "asc"; // Toggle order
                }
                
                currentSortColumn = column;

                // Sort rows based on column data
                rows.sort((rowA, rowB) => {
                    let valA = rowA.querySelector(`[data-column="${column}"]`)?.innerText.trim(