/* ==========================================================================
   Adviser-proposed preference changes waiting for review
   ========================================================================== */

/* The banner at the top of the Firm Preferences page */
.pending-changes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-warning);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
}

.pending-changes__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.pending-changes__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--color-warning);
}

.pending-changes__title {
  margin: 0;
  font-family: var(--font-family-bold);
  font-size: var(--font-size-medium);
  color: var(--color-primary-dark);
}

.pending-changes__blurb {
  margin: var(--space-1) 0 0;
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* One card's worth of proposed changes */
.pending-change {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-sunken);
}

.pending-change__header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.pending-change__section {
  margin: 0;
  font-family: var(--font-family-bold);
  font-size: var(--font-size-medium);
  color: var(--color-primary-dark);
}

.pending-change__meta {
  font-size: var(--font-size-small);
  color: var(--color-text-muted);
}

.pending-change__fields {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pending-change__field {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) 2fr;
  align-items: start;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.pending-change__field:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.pending-change__accept {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.pending-change__label {
  font-size: var(--font-size-small);
  color: var(--color-text);
}

/* Old value, arrow, new value — the arrow drops out on narrow screens and the
   two values stack, which still reads in the right order. */
.pending-change__values {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--font-size-small);
  min-width: 0;
}

.pending-change__from {
  color: var(--color-text-faint);
  text-decoration: line-through;
  overflow-wrap: anywhere;
}

.pending-change__arrow {
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.pending-change__to {
  font-family: var(--font-family-bold);
  color: var(--color-primary-dark);
  overflow-wrap: anywhere;
}

.pending-change__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.pending-change__awaiting {
  margin: var(--space-3) 0 0;
  font-size: var(--font-size-small);
  color: var(--color-text-faint);
  font-style: italic;
}

/* Card header: the pending pill sits beside the edit pencil */
.firm-card__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Count beside "Firm Preferences" in the firm record's own nav */
.firm-subnav__badge {
  margin-left: auto;
  min-width: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  background-color: var(--color-danger);
  color: var(--color-surface);
  font-size: var(--font-size-small);
  font-family: var(--font-family-bold);
  line-height: 20px;
  text-align: center;
}

/* Count inside the directory's Pending Changes tab */
.cases-index-tabs__count {
  display: inline-block;
  margin-left: var(--space-1);
  min-width: 18px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  background-color: var(--color-danger);
  color: var(--color-surface);
  font-size: var(--font-size-small);
  line-height: 18px;
  text-align: center;
}

/* Directory row for a firm with changes waiting. Tinted the way the
   renewal-due row is, but in the danger colour: a renewal is a date passing,
   this is somebody outside the practice waiting on an answer from us. */
.firm-pill--attention {
  background-color: var(--tint-danger-10);
  border-color: var(--color-danger);
}

.firm-pill--attention:hover {
  background-color: var(--tint-danger-16);
  border-color: var(--color-danger);
}
