
        }

        function updateSortArrows(sortedIndex, ascending) {
          headers.forEach((header, index) => {
            header.classList.remove("sorted");
            const arrow = header.querySelector(".sort-arrow");
            if (index === sortedIndex) {
              header.classList.add("sorted");
              arrow.textContent = ascending ? "▲" : "▼";
            } else {
              arrow.textContent = "";
            }
          });
        }

        function filterTable(filterVa