{# Table helpers -- ported from bty's ``_table_macros.html`` shape so an operator moving between the two consoles reads the same toolbar layout. Callers pass a :class:`SortState`, a :class:`PageState`, and a ``preserved`` dict of query params to carry across every link (filter survives sort clicks; sort survives pagination clicks; per_page survives everything). The macros are shape-agnostic: they don't care whether the underlying rows come from an in-memory list or a SQL LIMIT/OFFSET query. Layout intent: * The filter form + the pagination live TOGETHER on the card header row -- NOT in a separate subnav or a card footer. That way the operator's eye lands on "who am I looking at" (the title label), "what am I looking for" (the filter), and "how many are there" (the pagination) in one horizontal sweep. * Column headers are clickable ````s inside ``