/* ===== HISTORY / TIMELINE PAGE ===== */

/* ---- Timeline list ---- */
.timelineList {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0 0.5rem;
  padding-bottom: 2rem;
}

/* ---- Timeline card row ---- */
.timelineCard {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.75rem;
  position: relative;
  padding-bottom: 1.1rem;
}

/* ---- Avatar column ---- */
.timelineAvatarCol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-top: 0.15rem;
}

.timelineLine {
  flex: 1;
  width: 2px;
  background: var(--border-light);
  border-radius: 2px;
  margin-top: 0.35rem;
  min-height: 1.5rem;
}

.timelineCard:last-child .timelineLine {
  display: none;
}

/* System icon (no user) */
.systemIcon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-warm);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--ink-1);
  flex-shrink: 0;
}

.systemIconGlyph,
.activityLabelIcon,
.heroStatIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.systemIconGlyph {
  width: 0.95rem;
  height: 0.95rem;
}

.systemIconGlyph svg,
.activityLabelIcon svg,
.heroStatIcon svg {
  width: 100%;
  height: 100%;
}

/* ---- Content ---- */
.timelineContent {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.1rem;
  min-width: 0;
}

.timelineHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.timelineHeadLeft {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.userName {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ink-0);
  line-height: 1.2;
}

.timelineTime {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.15rem;
}

/* ---- Activity label (titre de la carte + icône) ---- */
.activityLabel {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.activityLabelIcon {
  width: 0.95rem;
  height: 0.95rem;
  color: currentColor;
  opacity: 0.92;
}

.activityLabelText {
  min-width: 0;
}

.heroStatIcon {
  width: 2rem;
  height: 2rem;
  border-radius: 14px;
  color: #62338d;
}

.badgePrimary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.badgeSuccess {
  background: #e4f8e8;
  color: #2e7d36;
}

.badgeWarning {
  background: #fff8db;
  color: #7a5800;
}

.badgeSystem {
  background: var(--border-light);
  color: var(--ink-1);
}

.badgeMuted {
  background: var(--panel-warm);
  border: 1px solid var(--border);
  color: var(--ink-1);
}

/* ---- Card chip ---- */
.cardChip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: fit-content;
}

/* ---- Values block ---- */
.valuesBlock {
  display: grid;
  gap: 0.45rem;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow-card);
}

.valueRow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.fieldLabel {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.valuePill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  font-size: clamp(0.82rem, 3.2vw, 0.9rem);
  font-weight: 700;
  color: var(--ink-0);
  white-space: nowrap;
}

/* ---- Error ---- */
.errorMsg {
  color: var(--accent);
  font-size: 0.9rem;
  padding: 0 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .timelineCard {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 0.6rem;
  }

  .timelineHeader {
    flex-direction: column;
    gap: 0.25rem;
  }

  .timelineTime {
    align-self: flex-start;
  }

  .heroStatIcon {
    width: 1.8rem;
    height: 1.8rem;
  }
}
