/* Table footer: rows-per-page selector + pagination.
   Used by templates/includes/pagination.html (server-side) and static/js/table-pager.js (client-side). */
.tpg {
  --tpg-accent: #9C1C1C;
  --tpg-border: #e2e2e2;
  --tpg-muted: #6b6b6b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 16px;
  font-size: .85rem;
  color: var(--tpg-muted);
}
.tpg-size { margin: 0; }
.tpg-size label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.tpg-size select {
  padding: 4px 8px;
  border: 1px solid var(--tpg-border);
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  /* Theme CSS styles every select as a tall form field; keep this one compact. */
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1.4 !important;
  padding: 4px 8px !important;
}
.tpg-size select:focus { outline: 2px solid var(--tpg-accent); outline-offset: 1px; }
.tpg-pages { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.tpg-pages a, .tpg-pages span {
  min-width: 32px;
  padding: 5px 10px;
  border: 1px solid var(--tpg-border);
  border-radius: 6px;
  background: #fff;
  color: var(--tpg-muted);
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.tpg-pages a:hover { border-color: var(--tpg-accent); color: var(--tpg-accent); }
.tpg-pages .on { background: var(--tpg-accent); border-color: var(--tpg-accent); color: #fff; cursor: default; }
.tpg-pages .off { opacity: .4; cursor: default; }
.tpg-pages .gap { border-color: transparent; background: none; cursor: default; }
@media (max-width: 600px) {
  .tpg-pages { margin-left: 0; width: 100%; }
}
/* Copy of the controls above the table */
.tpg-top { padding-bottom: 10px; }
