body {
  background-color: #f7f8fa;
}

.page-heading h1 {
  font-weight: 600;
}

.data-table thead th {
  white-space: nowrap;
  background-color: #eef1f5;
}

.data-table.wrap-headers thead th { white-space: normal; vertical-align: bottom; }

.data-table th.group-header {
  background-color: #dde4ee;
}

/* Filter forms: a row of fields above the list they filter. */
.filters-card { padding: 0.75rem 1rem; }
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.5rem 1rem;
  align-items: end;
}
.filter-bar > div { margin-bottom: 0 !important; }
.filter-bar .form-label { font-size: 0.8rem; margin-bottom: 0.15rem; color: var(--bs-secondary-color); }
.filter-bar .form-control,
.filter-bar .form-select { font-size: 0.875rem; padding-top: 0.25rem; padding-bottom: 0.25rem; }
.filter-bar .form-text { font-size: 0.75rem; margin-top: 0.1rem; }
.filter-bar .ts-control { font-size: 0.875rem; padding: 0.25rem 0.5rem; min-height: 0; }

/* Compact article cells in wide tables */
.article-cell { min-width: 16rem; max-width: 26rem; }
.gaps-cell { min-width: 10rem; max-width: 16rem; }
.gaps-cell .badge { margin-bottom: 0.15rem; }
.data-table td { font-size: 0.9rem; }

.card-narrow {
  max-width: 28rem;
}

th.sortable {
  cursor: pointer;
}

th[aria-sort="ascending"]::after {
  content: " \25B2";
}

th[aria-sort="descending"]::after {
  content: " \25BC";
}

/* Stages */
.stage-badge,
.issue-stage {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  font-size: 0.8rem;
  background: #e9ecef;
  white-space: nowrap;
}

.stage-planned { background: #f1f3f5; }
.stage-copy_received { background: #e7f1ff; }
.stage-copyediting,
.stage-copyedit_check { background: #d0e4ff; }
.stage-typesetting,
.stage-production_proof { background: #cfe8f3; }
.stage-author_proof,
.stage-author_approved { background: #fff1c2; }
.stage-ready { background: #c9efd6; }
.stage-published { background: #9fdcb5; }

.issue-stage-scheduled { background: #f1f3f5; }
.issue-stage-working { background: #fff1c2; }
.issue-stage-approved { background: #c9efd6; }
.issue-stage-live { background: #9fdcb5; }

.stage-bar-planned { background-color: #ced4da; }
.stage-bar-copy_received { background-color: #9ec5fe; }
.stage-bar-copyediting,
.stage-bar-copyedit_check { background-color: #6ea8fe; }
.stage-bar-typesetting,
.stage-bar-production_proof { background-color: #3d8bfd; }
.stage-bar-author_proof,
.stage-bar-author_approved { background-color: #ffc107; }
.stage-bar-ready { background-color: #20c997; }
.stage-bar-published { background-color: #198754; }

.readiness-bar { height: 0.45rem; min-width: 6rem; }
.completion { display: flex; align-items: center; gap: 0.35rem; }
.completion .progress { width: 3.5rem; height: 0.45rem; }

.gap-badge { font-weight: 500; }
.gap-copyright { background-color: #f8d7da; color: #842029; }
.gap-offprint { background-color: #ffe5d0; color: #8a4b0f; }
.gap-check { background-color: #e2d9f3; color: #432874; }
.gap-skip { background-color: #fff3cd; color: #664d03; }

.tracker-journal { scroll-margin-top: 1rem; }
.tracker-issue { scroll-margin-top: 1rem; }
.tracker-facts { display: flex; flex-wrap: wrap; column-gap: 1.75rem; row-gap: 0.5rem; margin-bottom: 0.75rem; }
.tracker-facts dt { font-weight: 400; color: var(--bs-secondary-color); }
.tracker-facts dd { margin-bottom: 0; }
.tracker-issue .data-table { margin-bottom: 0.5rem; }
.tracker-status { font-size: 0.85rem; }
.tracker-status .issue-stage + div { display: inline; margin-left: 0.35rem; }
.tracker-status .readiness-bar { width: 8rem; }
.tracker-status:nth-last-child(2) { margin-left: auto; text-align: right; }
.tracker-status:nth-last-child(2) div { display: inline; margin-left: 0.35rem; }

.running-order tr.dragging { opacity: 0.5; }
.running-order .drag-handle { cursor: grab; }
