/* ============================================================
   ECHEANCES.CSS — Timeline des dates d'échéance (onglet Score)
   Calqué sur .sp-actions / .score-portefeuille de app.css.
   Utilise exclusivement les tokens de tokens.css.
============================================================ */

/* Conteneur principal — identique à .sp-actions */
.echeances-section {
  background: var(--color-bg-card);
  border: 0.5px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

/* En-tête — identique à .sp-actions-header + .sp-actions-titre */
.echeances-titre {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 0.5px solid var(--color-border-faint);
}

/* Badge "N urgents" — identique à .sp-actions-badge mais couleurs danger */
.echeances-badge-alerte {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--color-danger-dim);
  color: var(--color-danger);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Séparateur entre groupes */
.echeances-groupe + .echeances-groupe {
  border-top: 0.5px solid var(--color-border-faint);
}

/* Titre de groupe — identique à .sp-actions-titre */
.echeances-groupe-titre {
  padding: var(--space-2) var(--space-4) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Ligne contrat — identique à .sp-action-item */
.echeances-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 0.5px solid var(--color-border-faint);
  cursor: pointer;
  transition: var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.echeances-item:last-child {
  border-bottom: none;
}

.echeances-item:hover,
.echeances-item:active {
  background: var(--color-bg-sunken);
}

/* Icône type de contrat — identique à .sp-contrat-icon */
.echeances-item-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* Nom + type — identique à .sp-contrat-info */
.echeances-item-info {
  flex: 1;
  min-width: 0;
}

.echeances-item-nom {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.echeances-item-type {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 1px;
}

/* Partie droite : jours restants + date */
.echeances-item-date {
  text-align: right;
  flex-shrink: 0;
}

.echeances-item-j {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.2;
}

.echeances-item-df {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
}

/* Masquer automatiquement si vide */
#timeline-echeances:empty {
  display: none;
}
