/* A section heading that doubles as a link to its management page. Keeps the
   heading's normal colour (so it doesn't read as body-text link) and reveals a
   trailing arrow + underline on hover/focus to signal it's clickable. */
.heading-link {
  color: inherit;
  text-decoration: none;
}

.heading-link::after {
  content: "\2192"; /* → */
  margin-left: var(--gap-xsmall);
  color: var(--theme-fg-muted);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.heading-link:hover,
.heading-link:focus-visible {
  text-decoration: underline;
}

.heading-link:hover::after,
.heading-link:focus-visible::after {
  opacity: 1;
}

/* A dashboard stat whose label links to its catalogue (Events / Styles /
   Locations → their index). Keeps the label in body colour and only underlines
   on hover/focus, so the row still reads as a figure, not a link list. */
.stat-link {
  color: inherit;
  text-decoration: none;
}

.stat-link:hover,
.stat-link:focus-visible {
  text-decoration: underline;
}

/* Shared chrome for the read-only catalogue browsers (admin events / styles /
   locations), lifted from the genres index so the three feel identical. */
.catalogue-filters .filter-divider {
  align-self: center;
  height: 1.2em;
  border-left: var(--border-width) solid var(--theme-fg-muted);
  margin-inline: var(--gap-xsmall);
}

.catalogue-sort-option {
  text-decoration: none;
}

.catalogue-sort-option.active {
  color: var(--theme-fg-color);
  font-weight: bold;
}

/* The ×N usage figure trailing a catalogue row's name. */
.catalogue-count {
  font-variant-numeric: tabular-nums;
}

/* Stat rows on the admin dashboard: label and figure joined by a dotted leader
   so the eye can follow a row across the width to its number. */
.stat {
  display: flex;
  align-items: baseline;
  gap: var(--gap-small);
}

.stat dt,
.stat dd {
  white-space: nowrap;
}

.stat__leader {
  flex: 1 1 auto;
  position: relative;
  top: -0.3em;
  border-bottom: 1px dotted var(--theme-fg-muted);
}

/* Scannable account / invitation lists in the admin area. Same dotted-leader
   idiom as .stat: a label group on the left, muted meta on the right. */
.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-medium);
}

.admin-row {
  display: flex;
  align-items: baseline;
  gap: var(--gap-small);
}

.admin-row__main {
  display: flex;
  align-items: baseline;
  gap: var(--gap-small);
  white-space: nowrap;
}

.admin-row__meta {
  white-space: nowrap;
}

/* The redeemable code and its shareable signup link. */
.invite__code {
  font-weight: bold;
  letter-spacing: 0.08em;
}

.invite__link {
  word-break: break-all;
  color: var(--theme-fg-muted);
}

.invite__status--redeemed {
  color: var(--theme-fg-muted);
}

.invite__status--expired {
  color: var(--theme-warn-color);
}

/* Scraper run oversight (/admin/scrape_runs). A per-scraper outcomes table plus
   a colour-coded history strip so a newly-broken or flapping venue stands out. */
.scrape-table-wrap {
  overflow-x: auto;
}

.scrape-table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.scrape-table th,
.scrape-table td {
  text-align: left;
  padding: var(--gap-xsmall) var(--gap-small);
  white-space: nowrap;
}

.scrape-table th {
  font-weight: normal;
  color: var(--theme-fg-muted);
}

.scrape-table .num {
  text-align: right;
}

.scrape-table tbody tr {
  border-top: 1px solid var(--theme-bg-muted);
}

/* Compact per-scraper "Run" button so a row of them stays scannable. button_to
   wraps each in a form, so collapse the form's own box too. */
.scrape-table form {
  margin: 0;
}

.button--small {
  padding: 0 var(--gap-small);
  font-size: var(--font-size-small);
}

/* Status pill: ok = green, empty (ran but wrote nothing) = amber, failed = red. */
.scrape-badge {
  display: inline-block;
  /* Centre the pill against adjacent text instead of letting its padded box
     sit on the text baseline (which makes it ride high next to the run date). */
  vertical-align: middle;
  padding: 0 var(--gap-xsmall);
  border-radius: 3px;
  font-size: var(--font-size-small);
  color: var(--color-white);
}

.scrape-badge--ok {
  background: var(--color-green);
}

.scrape-badge--empty {
  background: var(--color-amber);
}

.scrape-badge--failed {
  background: var(--color-red);
}

.scrape-badge--running {
  background: var(--theme-fg-muted);
}

.scrape-history {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.scrape-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--theme-fg-muted);
}

.scrape-dot--ok {
  background: var(--color-green);
}

.scrape-dot--empty {
  background: var(--color-amber);
}

.scrape-dot--failed {
  background: var(--color-red);
}

/* A run where this scraper produced no result at all. */
.scrape-dot--none {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--theme-fg-muted);
}

.scrape-error {
  white-space: normal;
  font-size: var(--font-size-small);
  color: var(--theme-warn-color);
}
