/* ==========================================================================
   Review Record — review show page layout
   Card-based two-column layout: the review's details on the left, its client's
   on the right, tabulation full width below. Log time, warnings and Activity
   are in the header (see reviews/show).
   ========================================================================== */
.review-record {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Cards themselves are shared with the other records (see .record-card in
   record_page.css); what follows is what a review puts inside them. */

/* == Layout grid == */
.review-record__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

.review-record__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

@media (max-width: 1024px) {
  .review-record__grid {
    grid-template-columns: 1fr;
  }
}

/* == Detail grid == */
.review-record__details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.review-record__details--stacked {
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.review-record__details-column {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

/* Label beside value, as a case's details are, rather than stacked: stacking
   made the card twice as tall as it needed to be. A note about the value (why
   a pack date is what it is) goes under the value, not under the label. */
.review-record__detail {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  column-gap: var(--space-3);
}

.review-record__detail-note {
  grid-column: 2;
}

/* The client's details sit in the narrower side column, with longer labels
   ("Preferred contact"), so their label column is a little wider. */
.review-record__details--stacked .review-record__detail {
  grid-template-columns: 150px minmax(0, 1fr);
}

.review-record__detail-label {
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--label-letter-spacing);
  color: var(--color-text-muted);
}

.review-record__detail-value {
  margin: 0;
  font-size: var(--font-size-medium);
  color: var(--color-text);
  overflow-wrap: anywhere;
}

/* A date the record is behind on, coloured as the table colours its row: amber
   for a pack still to come, red for one that went out late. */
.review-record__detail-value--warning {
  color: var(--color-warning);
  font-family: var(--font-family-bold);
  font-weight: 600;
}

.review-record__detail-value--danger {
  color: var(--color-danger);
  font-family: var(--font-family-bold);
  font-weight: 600;
}

/* How late a pack still not out is, beside its date. */
.review-record__overdue-pill {
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-2);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  background-color: var(--tint-danger-10);
  color: var(--color-danger);
  font-size: var(--font-size-small);
  font-weight: 500;
  white-space: nowrap;
  vertical-align: middle;
}

/* Why a pack date is what it is, under the date itself: set by hand, or the
   firm's own lead time rather than the practice's standard (see
   reviews/show/_details). Quiet — it explains a figure, it is not one. */
.review-record__detail-note {
  margin-top: var(--space-1);
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  font-style: italic;
}
