/* Plain HTML tables with Align's spaced white rows; no grid library required.
 * Reference: Align student_binders/lists.sass and staff/lists.sass.
 * Wrap wide tables in .table-wrap with tabindex="0", role="region" and an
 * accessible name. Keep a caption, scoped headers and real aria-sort states.
 */
.workspace .table-wrap { max-width: 100%; margin-block: 1rem 1.5rem; padding: .375rem; overflow-x: auto; }
.workspace table { width: 100%; border-collapse: separate; border-spacing: 0 .1875rem; color: var(--ink); font-size: .8125rem; text-align: left; }
.workspace caption { padding: .75rem 0; color: var(--muted); text-align: left; }
.workspace th, .workspace td { padding: .5rem .625rem; vertical-align: middle; }
.workspace thead th { padding-block: 1.25rem; color: #474d51; background: var(--canvas); font-weight: 700; }
.workspace tbody td, .workspace tbody th { height: 3.125rem; background: var(--surface); }
.workspace tbody tr:hover > *, .workspace tbody tr:focus-within > * { background: #eaf3f9; }
.workspace tr > :first-child { padding-left: 1.25rem; }
.workspace tr > :last-child { padding-right: 1.25rem; }
.workspace tbody tr > :first-child { border-radius: var(--radius) 0 0 var(--radius); }
.workspace tbody tr > :last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.workspace tbody tr > :only-child { border-radius: var(--radius); }
.workspace tbody tr[aria-selected="true"] > * { background: var(--selected); }
.workspace tfoot th, .workspace tfoot td { padding-block: 1rem; border-top: 1px solid var(--line); font-weight: 700; }
.workspace table .actions { margin-block: .25rem; }
.workspace table .actions a, .workspace table button { padding: .5rem .75rem; }
.workspace .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-block: 1rem; }
.workspace .pagination a, .workspace .pagination span[aria-current] { display: inline-flex; align-items: center; justify-content: center; min-width: 2.75rem; min-height: 2.75rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.workspace .pagination span[aria-current="page"] { border-color: var(--action); color: var(--surface); background: var(--action); font-weight: 700; }

/* Index table search and filters (tables/_controls). Fields sit in a row and
 * wrap on narrow screens; the summary is focused after page changes. */
.workspace .table-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1rem; margin-block: 1.5rem 0; }
.workspace .table-controls .field { flex: 1 1 12rem; margin-block: .5rem; }
.workspace .table-controls .actions { margin-block: .5rem; }
.workspace .table-summary { margin-block: 1rem 0; color: var(--muted); }
.workspace td .hint, .workspace th .hint { display: block; font-weight: 400; }
.workspace caption .hint { margin-left: .25em; }
.workspace .sort-indicator { margin-left: .25em; }
/* Turbo replaces a table frame's contents on each search, sort, or page
 * change. Browser scroll anchoring then shifts the page by any change in the
 * table's height, so pages with an index table keep their scroll position. */
.workspace main:has(.index-table) { overflow-anchor: none; }
/* Turbo sets aria-busy on the frame while it loads new results. */
.workspace .index-table[aria-busy="true"] .table-wrap { opacity: .6; cursor: progress; transition: opacity .15s; }
.workspace .index-table[aria-busy="true"] .table-summary::after { content: " Updating results…"; }
@media (prefers-reduced-motion: reduce) { .workspace .index-table[aria-busy="true"] .table-wrap { transition: none; } }
