/**
 * S4 — Returning-user dashboard layout-only styles.
 *
 * StatusCard, MetricCard, BarChart, and button variants come from the
 * shared component CSS. This file only glues the composition together:
 * the per-page container, the usage card wrapper, and the credentials
 * list / row / pill visuals.
 */

.returning-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.returning-card {
  background: var(--bg-primary);
  border: 0.5px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}

.returning-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.returning-card__title {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-h2);
  font-weight: 500;
  color: var(--text-primary);
}

.returning-card__head .returning-card__title {
  margin-bottom: 0;
}

.returning-usage-chart {
  margin-top: var(--space-2);
}

/* --- Credentials list --- */

.returning-creds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.returning-creds__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 0.5px solid var(--border-tertiary);
}

.returning-creds__row:first-child {
  border-top: none;
}

.returning-creds__main {
  flex: 1 1 auto;
  min-width: 0;
}

.returning-creds__title-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.returning-creds__label {
  font-size: var(--font-size-h3);
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 20rem;
}

.returning-creds__pill {
  display: inline-block;
  padding: var(--space-xs) var(--space-2);
  font-size: var(--font-size-micro);
  font-weight: 500;
  color: var(--success-text);
  background: var(--success-bg);
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
}

.returning-creds__meta {
  margin: var(--space-xs) 0 0;
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

.returning-creds__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Responsive (< 640px): stack row header, push actions under meta --- */

@media (max-width: 639.98px) {
  .returning-creds__row {
    flex-wrap: wrap;
  }

  .returning-creds__actions {
    flex-basis: 100%;
    justify-content: flex-end;
  }

  .returning-card__head {
    flex-wrap: wrap;
  }
}
