.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}
.filter-bar label { margin: 0; }
.admin-index-tools {
  padding: 0.8rem 0.9rem;
}
.admin-index-tools .filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: end;
}
.admin-index-tools .filter-bar label {
  flex: 0 1 9.5rem;
  min-width: 8.5rem;
  max-width: 11rem;
}
.admin-index-tools .filter-bar label:first-of-type {
  flex-basis: 14rem;
  max-width: 14rem;
}
.admin-index-tools .filter-bar label:nth-of-type(4) {
  flex-basis: 13rem;
  max-width: 13rem;
}
.admin-index-tools .publication-filter-bar label:nth-of-type(2) {
  flex-basis: 15rem;
  max-width: 16rem;
}
.admin-index-tools .publication-filter-bar label:nth-of-type(3) {
  flex-basis: 10rem;
  max-width: 11rem;
}
.admin-index-tools input[type=text],
.admin-index-tools select {
  padding: 0.42rem 0.55rem;
}
.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: 0;
}
.admin-index-table th:first-child,
.admin-index-table td:first-child {
  width: 3.25rem;
  padding-right: 0.25rem;
}
.admin-index-table td {
  vertical-align: middle;
}
.publications-table {
  table-layout: fixed;
}
.publications-table th:nth-child(1),
.publications-table td:nth-child(1) { width: 3.25rem; }
.publications-table th:nth-child(2),
.publications-table td:nth-child(2) { width: 20%; }
.publications-table th:nth-child(3),
.publications-table td:nth-child(3) { width: 34%; }
.publications-table th:nth-child(4),
.publications-table td:nth-child(4) { width: 9%; }
.publications-table th:nth-child(5),
.publications-table td:nth-child(5) { width: 13%; }
.publications-table th:nth-child(6),
.publications-table td:nth-child(6) { width: 14.5rem; }
.publications-table .table-url a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.publications-table .row-actions {
  justify-content: flex-end;
}
.table-thumb {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  background: var(--border);
  border: 1px solid var(--border);
}
.table-thumb:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.table-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.table-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel-2);
  font-weight: 800;
  font-size: 0.9rem;
}
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding-top: 0.85rem;
}
.pagination-top {
  border-top: 0;
  border-bottom: 1px solid var(--border);
  margin: 0 0 0.75rem;
  padding: 0 0 0.85rem;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
}
.pagination span {
  display: inline-flex;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.82rem;
}
.pagination span a {
  display: inline-flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  color: var(--text);
}
.pagination span a:hover { text-decoration: none; color: var(--accent); }
.pagination .current {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}
.table-url {
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* rails#317: source-recommendation cross-link panels and the run funnel. */
.recommendation-source-counts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.recommendation-source-counts li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.refresh-funnel td { font-variant-numeric: tabular-nums; }
.refresh-recommendations {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
}
.refresh-recommendations .muted { margin-left: 0.4rem; font-size: 0.85rem; }

/* Cleanup R3: admin Sources page — per-city toggle chips (one form each). */
.source-city-toggles { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.source-city-toggle-form { display: inline; margin: 0; }
.source-city-toggle { cursor: pointer; font: inherit; font-size: 0.72rem; }
.source-city-toggle:hover { border-color: var(--accent); color: var(--accent); }
.sources-table .row-actions { flex-direction: column; align-items: flex-start; gap: 0.35rem; }

/* Cleanup R6: pending recommendations that still need a decision, and the
   Sources page's "Ingestion limits" panel (research param rows in a grid). */
.badge-pending.badge-attention { color: var(--amber); border-color: var(--amber); }
.ingestion-limits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 0.5rem 1.5rem;
}
.ingestion-limits .research-entry { margin-bottom: 0.5rem; }

/* Cleanup R8: wide tables scroll inside their panel, never the page. */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.sources-table .table-url { overflow-wrap: anywhere; }
