/* ===== retention-fiche.css — fiche client 360, fenêtres, frise du suivi (B.133-135) =====
   Chargé après retention.css (mêmes variables de couleur). */
/* --- Fiche client 360 (panneau latéral) ----------------------------------------- */
.rt-voile { position: fixed; inset: 0; background: rgba(12, 58, 92, .28); z-index: 40; }
.rt-fiche {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 100%); z-index: 41;
  background: var(--clyo-surface); box-shadow: -12px 0 32px rgba(12, 58, 92, .18);
  display: flex; flex-direction: column;
}
.rt-fiche-tete { background: var(--blanc); border-bottom: 1px solid var(--rt-bord); padding: 14px 18px; display: flex; gap: 12px; align-items: flex-start; }
.rt-fiche-tete h2 { margin: 0; font-size: 20px; }
.rt-fiche-corps { flex: 1; overflow-y: auto; padding: 16px 18px; }
.rt-resume { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; background: var(--blanc); border: 1px solid var(--rt-bord); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.rt-resume dt { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--texte-doux); }
.rt-resume dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; word-break: break-word; }
.rt-fiche-grille { display: grid; grid-template-columns: 1fr 320px; gap: 12px; align-items: start; }
.rt-chrono { list-style: none; margin: 0; padding: 0; }
.rt-chrono li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rt-bord-doux); font-size: 13px; }
.rt-chrono .rt-quand { color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.rt-chrono .rt-source { font-size: 11px; color: var(--texte-doux); }
.rt-suggestion { border: 2px solid var(--clyo-accent); border-radius: 12px; background: var(--blanc); padding: 14px; }
.rt-suggestion h3, .rt-bloc h3 { font-size: 14px; }
.rt-pile { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rt-pile .rt-btn { justify-content: center; }

/* --- Aperçu d'e-mail (fenêtre) ---------------------------------------------------- */
.rt-modale {
  position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  background: var(--blanc); border-radius: 14px; box-shadow: 0 20px 50px rgba(12, 58, 92, .25); padding: 18px;
}
/* Fenêtre large : tableau d'étapes d'un scénario (27/11/2026). */
.rt-modale--large { width: min(1100px, calc(100% - 32px)); }
.rt-ed-ligne td { vertical-align: middle; }
.rt-ed-ligne [data-ch="jour"] { width: 80px; min-width: 0; }
.rt-ed-ligne [data-ch="canal"] { min-width: 120px; }
.rt-ed-ligne [data-ch="modele"] { min-width: 280px; max-width: 380px; }
.rt-ed-ligne [data-ch="libelle"] { min-width: 280px; width: 100%; }
.rt-voile--modale { z-index: 50; }
.rt-mail { border: 1px solid var(--rt-bord); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; font-size: 14px; line-height: 1.5; background: #FBFDFF; }
.rt-mail-tete { font-size: 13px; color: var(--texte-doux); margin-bottom: 8px; }
.rt-mail-tete b { color: var(--clyo-dark); }
.rt-avert { background: #FFF7ED; border: 1px solid #FBD5B5; color: #7C2D12; border-radius: 8px; padding: 8px 10px; font-size: 12px; margin: 10px 0; }

/* --- Message éphémère ---------------------------------------------------------------- */
.rt-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--clyo-dark); color: var(--blanc); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(12, 58, 92, .3); max-width: calc(100% - 32px);
}

/* --- Suivi de l'incident : la frise (B.134, §3o) -----------------------------------
   Étapes de gauche à droite, reliées par un trait ; le trait est plein jusqu'au
   curseur (étapes faites), pointillé ensuite. Couleur + libellé, jamais la couleur seule. */
.rt-suivi { margin-bottom: 12px; }
.rt-suivi-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.rt-frise { overflow-x: auto; padding: 22px 4px 6px; }
.rt-piste { list-style: none; margin: 0; padding: 0; display: flex; min-width: min-content; }
.rt-pas { position: relative; flex: 0 0 136px; display: flex; flex-direction: column; align-items: center; }
/* trait vers l'étape suivante */
.rt-pas::after { content: ''; position: absolute; top: 18px; left: calc(50% + 18px); width: calc(100% - 36px); border-top: 2px dashed #BFDCEF; }
.rt-pas:last-child::after { display: none; }
.rt-pas--faite::after { border-top: 2px solid var(--clyo-dark); }
.rt-pas-bouton { background: none; border: 0; padding: 0 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--clyo-dark); text-align: center; border-radius: 10px; width: 100%; font: inherit; }
.rt-pas-bouton:focus-visible { outline: 2px solid var(--clyo-primary); outline-offset: 2px; }
.rt-pas-noeud {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: var(--blanc); border: 2px solid #BFDCEF; position: relative; z-index: 1;
}
.rt-pas--faite .rt-pas-noeud { background: var(--clyo-dark); border-color: var(--clyo-dark); filter: saturate(.85); }
.rt-pas--retard .rt-pas-noeud { border-color: var(--rt-litige); }
.rt-pas--proposee .rt-pas-noeud { border: 2px dashed var(--clyo-accent); background: #FFF6EF; }
.rt-pas--reponse .rt-pas-noeud { border-radius: 8px; border-color: var(--clyo-primary); background: #EAF6FD; }
.rt-pas--courante .rt-pas-noeud { border: 3px solid var(--clyo-accent); box-shadow: 0 0 0 4px #FDEBDD; }
.rt-pas--choisie .rt-pas-bouton { background: var(--clyo-surface); }
.rt-pas-date { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rt-pas-libelle { font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 31px; }
.rt-pas-etat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--texte-doux); min-height: 13px; }
.rt-pas--retard .rt-pas-etat { color: var(--rt-litige); }
.rt-pas--proposee .rt-pas-etat { color: var(--rt-resil); }
.rt-curseur { position: absolute; top: -20px; font-size: 10px; font-weight: 700; color: var(--clyo-accent); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.rt-pas-panneau { border-top: 1px solid var(--rt-bord-doux); margin-top: 8px; padding-top: 10px; }

/* --- Formulaires des fenêtres (B.135) ------------------------------------------- */
.rt-form { display: flex; flex-direction: column; gap: 4px; }
.rt-form .rt-petit { margin-top: 6px; }
.rt-form .rt-champ, .rt-form .rt-select { width: 100%; }
.rt-choix-ligne { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.rt-choix-ligne input { position: absolute; opacity: 0; pointer-events: none; }
.rt-choix-ligne label { cursor: pointer; }
.rt-choix-ligne input:checked + span { background: var(--clyo-dark); color: #fff; border-color: var(--clyo-dark); }
.rt-choix-ligne input:focus-visible + span { outline: 2px solid var(--clyo-accent); outline-offset: 2px; }

/* --- Situation du suivi (pause, promesse, litige…) et CRM / support (B.135) ------- */
.rt-situation { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--clyo-light); color: var(--clyo-dark); font-size: 13px; }
.rt-externe { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.rt-h4 { margin: 12px 0 4px; font-size: 13px; font-weight: 700; color: var(--clyo-dark); }
.rt-externe .rt-h4 { margin-top: 0; }

/* --- Petits écrans (après les règles ci-dessus, pour les remplacer) ---------------- */
@media (max-width: 900px) {
  .rt-fiche-grille { grid-template-columns: 1fr; }
  .rt-externe { grid-template-columns: 1fr; }
}

/* --- Réglages de l'espace (B.136) ------------------------------------------------ */
.rt-reglage { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 13px; cursor: pointer; }
.rt-reglage input { margin-top: 3px; }
.rt-choix-crm { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }

/* --- Analyse du dossier (B.138) ------------------------------------------------- */
.rt-analyse { margin-bottom: 12px; border-left: 4px solid var(--clyo-blue, #60C0ED); }
.rt-analyse-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rt-analyse-tete h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-analyse-situation { font-size: 14px; font-weight: 600; color: var(--clyo-dark, #0C3A5C); margin: 8px 0; line-height: 1.45; }
.rt-analyse-fait summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--clyo-dark, #0C3A5C); }
.rt-v-recuperable { color: var(--rt-ok); background: var(--rt-ok-fond); }
.rt-v-a_obtenir { color: var(--rt-resil); background: var(--rt-resil-fond); }
.rt-v-difficile { color: var(--rt-litige); background: var(--rt-litige-fond); }
.rt-v-irrecouvrable { color: #fff; background: #4B5B6B; }

/* Notes du CRM en texte clair (B.138) */
.rt-crm-texte { white-space: normal; font-size: 12.5px; line-height: 1.45; color: #33475B; margin-top: 4px; overflow-wrap: anywhere; }
.rt-crm-repli summary { cursor: pointer; }
.rt-crm-repli[open] summary .rt-petit { display: none; }

/* Raison donnée par le client (B.139) : badge, suggestion à confirmer, pastilles d'appel */
.rt-raison-client { color: #33475B; background: #EEF2F6; }
.rt-raison-suggeree { color: #33475B; background: #fff; border: 1px dashed #94A3B8; }
.rt-suggestion { margin: 8px 0; padding: 8px 10px; border-radius: 8px; background: #F5F9FC; border: 1px dashed #9CC7E4; font-size: 13px; }
.rt-raison-groupe { margin-bottom: 4px; }
.rt-raison-groupe > .rt-petit { display: block; margin: 2px 0; }
.rt-suggestion-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* --- Deux grands filtres : Matériel « one off » / Abo récurrent (B.152) --- */
.rt-grand-filtre { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rt-grand-filtre__choix {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  border: 1px solid var(--rt-bord); border-radius: 10px; background: var(--blanc); color: var(--clyo-dark);
  padding: 10px 14px; font: inherit; box-shadow: var(--rt-ombre);
}
.rt-grand-filtre__choix:hover { border-color: var(--clyo-dark); }
.rt-grand-filtre__choix:focus-visible { outline: 2px solid var(--clyo-dark); outline-offset: 2px; }
.rt-grand-filtre__choix[aria-pressed="true"] { background: var(--clyo-dark); color: var(--blanc); border-color: var(--clyo-dark); }
.rt-grand-filtre__titre { font-weight: 700; font-size: 15px; }
.rt-grand-filtre__chiffres { font-size: 13px; opacity: .8; font-variant-numeric: tabular-nums; }
.rt-grand-filtre__note { margin: -2px 0 10px; }
@media (max-width: 900px) { .rt-grand-filtre { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rt-grand-filtre { grid-template-columns: 1fr; } }
.rt-cat-prov { color: var(--clyo-dark); background: #FFF6D6; }
.rt-cat-offline { color: #9A3412; background: #FFF7ED; }
.rt-dates { margin: 0 0 8px; }
.rt-cat-materiel { color: var(--rt-resil); background: var(--rt-resil-fond); }
.rt-cat-abonnement { color: var(--rt-impaye); background: var(--rt-impaye-fond); }
.rt-materiel { margin: 0; padding-left: 18px; }
.rt-materiel li { margin: 2px 0; }
