Stable sorting protects equal-value order
Rows are paired with their original position before sorting. When selected cells compare equally, that position breaks the tie and keeps the source order deterministic.
The header never participates in the sort and remains the first record.