.follow-ups-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-body[data-page="follow-ups"] .view-scroll {
  padding: 18px 20px;
}

.fu-detail__section-head span,
.fu-detail__next-head > span {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.fu-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.follow-ups-workspace {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(380px, 430px);
  gap: 14px;
  align-items: start;
}

#follow_up_queue,
#follow_up_detail {
  display: block;
  min-width: 0;
}

#follow_up_detail {
  position: sticky;
  top: 12px;
  align-self: start;
}

.fu-queue,
.fu-detail {
  min-width: 0;
  overflow: hidden;
}

.fu-queue {
  display: flex;
  flex-direction: column;
}

/* The queue's head is a ledger head (see components.css); it only needs the
   lane tabs to keep their line when the owner filter wraps beside them. */
.fu-queue__head {
  min-height: 42px;
}

.fu-rows {
  display: flex;
  flex-direction: column;
}

/* [#1310] Queue pager — plain links so a 300-item backlog is walkable. */
.fu-queue__pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-lo);
  background: var(--surface-lo);
}

.fu-queue__page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.fu-queue__page:hover {
  border-color: var(--brass);
  color: var(--brass);
}

.fu-queue__page.is-disabled {
  border-color: var(--border-lo);
  background: transparent;
  color: var(--text-3);
  opacity: 0.55;
}

.fu-queue__page-count {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

.fu-row {
  display: block;
  min-height: 76px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-lo);
  background: var(--surface);
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease;
}

.fu-row:last-child {
  border-bottom: 0;
}

.fu-row:hover,
.fu-row.is-selected {
  background: linear-gradient(
    90deg,
    rgba(184, 146, 74, 0.08),
    var(--surface) 22%
  );
}

.fu-row.is-selected {
  box-shadow:
    inset 3px 0 0 var(--brass),
    0 1px 0 rgba(28, 46, 66, 0.03);
}

.fu-row__main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.fu-row__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

.fu-row__body {
  min-width: 0;
}

.fu-row__top,
.fu-row__meta,
.fu-detail__chips,
.fu-detail__inline-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.fu-row__top {
  justify-content: space-between;
}

.fu-row__top strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.fu-row__due {
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-hi);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.fu-row__due.is-overdue {
  background: rgba(220, 38, 38, 0.09);
  color: #991b1b;
}

.fu-row__meta {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 11px;
}

.fu-row__body p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.fu-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-lo);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
}
@media (pointer: coarse) {
  .fu-icon-btn {
    min-width: 44px;
    height: 44px;
  }
}

.fu-icon-btn:hover {
  border-color: var(--brass);
  color: var(--text-1);
  background: var(--surface);
}

.fu-inline-form {
  display: inline-flex;
  margin: 0;
}

.fu-detail {
  position: static;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  box-shadow: 0 1px 8px rgba(28, 46, 66, 0.06);
}

.fu-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  position: sticky;
  top: -14px;
  z-index: 2;
  margin: -14px -14px 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border-lo);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.fu-detail__header h2 {
  font-size: 20px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.fu-detail__eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 3px;
}

.fu-detail__eyebrow .badge {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 22px;
  padding: 4px 8px;
  line-height: 1;
}

.fu-detail__header p,
.fu-detail__note {
  color: var(--text-2);
  font-size: 12px;
}

.fu-detail__chips {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
}

.fu-detail__chips > span,
.fu-detail__chips > a {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface-lo);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12px;
}

.fu-detail__contact-chip {
  width: 100%;
  text-decoration: none;
}

.fu-detail__contact-chip i {
  flex: 0 0 auto;
  color: var(--text-3);
}

.fu-detail__contact-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fu-detail__next {
  padding: 12px;
  border: 1px solid var(--border-lo);
  border-radius: var(--r-md);
  background: var(--surface-lo);
}

.fu-detail__next-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.fu-detail__next-head strong {
  color: var(--text-1);
  font-size: 12px;
}

.fu-detail__next > p {
  margin: 4px 0 9px;
  color: var(--text-3);
  font-size: 11px;
}

.fu-detail__section {
  padding: 13px 0;
  border-top: 1px solid var(--border-lo);
}

.fu-detail__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.fu-detail__jobs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fu-detail__job,
.fu-detail__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  background: var(--surface-lo);
  border: 1px solid var(--border-lo);
  border-radius: var(--r-sm);
}

.fu-detail__job small {
  color: var(--text-3);
}

.fu-detail__follow-up-panel {
  margin-top: 12px;
}

.fu-detail__follow-up-panel .customer-followup-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.fu-detail__follow-up-panel .customer-followup-form__actions span {
  font-size: 12px;
}

.fu-detail__follow-up-panel .customer-followup-card__form {
  margin-top: 0;
  padding: 10px;
}

.fu-detail__follow-up-panel .customer-followup-form {
  gap: 8px;
}

.fu-detail__follow-up-panel .customer-followup-form__grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.fu-detail__follow-up-panel .customer-followup-form__field--next-date,
.fu-detail__follow-up-panel .customer-followup-form__field--assignee {
  grid-column: 1 / -1;
}

.fu-detail__follow-up-panel .customer-followup-form__label {
  margin-bottom: 3px;
}

.fu-detail__follow-up-panel .customer-followup-form .form-control {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  font-size: 12px;
}

.fu-detail__follow-up-panel .customer-followup-form__notes {
  min-height: 78px;
}

.fu-detail__follow-up-panel .customer-followup-form__actions {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
}

.fu-detail__follow-up-panel .customer-followup-form__actions .btn-primary {
  justify-content: center;
  width: 100%;
}

.fu-detail__follow-up-panel .customer-followup-card__history {
  padding-top: 13px;
  border-top: 1px solid var(--border-lo);
}

.fu-detail__context {
  margin-top: 13px;
}

.fu-detail__more {
  align-self: flex-start;
  color: var(--text-3);
  font-size: 11px;
  text-decoration: none;
}

.fu-detail--empty {
  display: grid;
  align-content: center;
  justify-items: center;
  grid-auto-rows: max-content;
  gap: 6px;
  min-height: 220px;
  color: var(--text-3);
  text-align: center;
}

.fu-detail--empty i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--brass);
  background: color-mix(in srgb, var(--brass) 10%, var(--surface));
  border-radius: 999px;
}

.fu-detail--empty p { margin: 0; }

@media (max-width: 1180px) {
  .app-body[data-page="follow-ups"] .view-scroll {
    overflow-y: auto;
    padding: 18px 20px;
  }

  .follow-ups-page {
    min-height: 100%;
  }

  .follow-ups-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  #follow_up_queue,
  #follow_up_detail {
    height: auto;
  }

  #follow_up_detail {
    position: static;
    overflow: visible;
  }

  .fu-queue,
  .fu-detail {
    position: static;
    max-height: none;
  }
}

@media (max-width: 520px) {
  .fu-queue__head .ledger__filters,
  .fu-queue__head .select-filter {
    width: 100%;
  }

  .fu-row__main {
    min-height: 44px;
  }

  .fu-row__main {
    align-items: center;
  }

  .fu-row__main {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .fu-row__avatar {
    width: 36px;
    height: 36px;
  }
}
