/* ── Milestone tab bar ─────────────────────────────────────────────────── */

.milestone-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding: 0 4px;
}

.milestone-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.milestone-tab:hover {
  color: var(--text);
}

.milestone-tab--active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.milestone-tab__count {
  background: rgba(145, 167, 199, 0.14);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.milestone-tab--active .milestone-tab__count {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Tab panels ────────────────────────────────────────────────────────── */

.milestone-panel {
  display: none;
}

.milestone-panel--active {
  display: block;
}

/* ── Events table ──────────────────────────────────────────────────────── */

.onboarding-events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.onboarding-events-table thead th {
  text-align: left;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(145, 167, 199, 0.18);
}

.onboarding-events-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(145, 167, 199, 0.08);
}

.onboarding-events-row {
  cursor: pointer;
}

.onboarding-events-row:hover {
  background: rgba(145, 167, 199, 0.08);
}

/* ── Incomplete-cell highlight (DELIVERED events with missing data) ─────── */

.cell--incomplete {
  background: rgba(245, 177, 75, 0.18) !important;
  color: var(--warning);
}

/* ── Request-source badge + legend ─────────────────────────────────────── */

/* Pill mirrors .status-badge shape. Tone variants are a fixed palette; any
   request_source not in the map renders with the neutral --other tone. Keep the
   tone slugs in sync with _REQUEST_SOURCE_TONES in onboarding_events_service.py. */
.request-source-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
}

.request-source-badge--swagger {
  background: var(--accent-soft);
  color: var(--accent);
}

.request-source-badge--artifax {
  background: rgba(167, 139, 250, 0.18);
  color: #d6ccff;
}

.request-source-badge--catalogix {
  background: var(--success-soft);
  color: #cbffe9;
}

.request-source-badge--other {
  background: rgba(145, 167, 199, 0.16);
  color: #e1ebfa;
}

.request-source-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.request-source-legend__title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Legend chips double as client-side show/hide toggles. Reset button chrome so
   they look identical to the static .request-source-badge pills. */
.request-source-legend__toggle {
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

/* "Off" = this tone's rows are hidden. Dim + strike-through the chip as feedback. */
.request-source-badge--off {
  opacity: 0.4;
  text-decoration: line-through;
}

.onboarding-events-row--hidden {
  display: none;
}

/* ── Detail drawer timeline ────────────────────────────────────────────── */

.onboarding-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.onboarding-timeline__entry {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(145, 167, 199, 0.16);
}

.onboarding-timeline__entry--unset {
  opacity: 0.55;
}

/* ── Confirmation modal ────────────────────────────────────────────────── */

.modal-shell--confirm {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  background: rgba(15, 22, 33, 0.98);
  border-radius: 16px;
  padding: 24px;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-shell--confirm .modal-body {
  padding: 8px 0 16px;
  line-height: 1.5;
}

.modal-shell--confirm .modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Drawer action buttons ─────────────────────────────────────────────── */

.drawer-action--danger {
  background: rgba(255, 107, 107, 0.18);
  color: #ffd2d2;
}

.drawer-action--warning {
  background: rgba(255, 186, 73, 0.18);
  color: #ffe7bd;
}
