/* Le site du SAV. Sobre et lisible : il sert plusieurs marques, chacune a sa pastille de couleur. */
:root {
  color-scheme: light;
  --fond: #F5F6F8;
  --surface: #FFFFFF;
  --texte: #16181D;
  --texte-2: #4B5160;
  --texte-3: #7A8091;
  --trait: #E3E6EC;
  --trait-fort: #CDD2DC;
  --accent: #3554B8;
  --accent-fond: #EAEEFA;
  --attente: #B4541A;
  --attente-fond: #FBEDE3;
  --bon: #2F7D4A;
  --bon-fond: #E6F2EA;
  --critique: #B3261E;
  --critique-fond: #FBE4E2;
  --toi-fond: #EEF2FC;
  --rayon: 12px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 400 15px/1.5 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 650; margin: 0 0 12px; }
.discret { color: var(--texte-3); }
.petit { font-size: 13px; }

/* ---------- en-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--trait);
}
.entete__marque { font-weight: 700; font-size: 17px; color: var(--texte); letter-spacing: -0.02em; }
.entete__marque span { color: var(--accent); }
.entete nav { display: flex; gap: 4px; }
.entete nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--texte-2); font-weight: 500;
}
.entete nav a:hover { background: var(--fond); text-decoration: none; }
.entete nav a[aria-current="page"] { background: var(--accent-fond); color: var(--accent); }
.entete__droite { margin-left: auto; font-size: 13px; white-space: nowrap; }
.entete__droite a { color: var(--texte-3); }

.page { max-width: 1180px; margin: 0 auto; padding: 24px; }
.page--etroite { max-width: 860px; }

/* ---------- boutons et champs ---------- */
.bouton {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.bouton:hover { filter: brightness(1.07); text-decoration: none; }
.bouton--doux { background: var(--surface); color: var(--texte); border-color: var(--trait-fort); }
.bouton--danger { background: var(--surface); color: var(--critique); border-color: #E8B4AF; }
.champ { display: grid; gap: 6px; align-content: start; }
.champ label { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.champ input, .champ select {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--trait-fort); background: #fff;
}
.champ input:focus, .champ select:focus { outline: 2px solid var(--accent-fond); border-color: var(--accent); }
.champ small { color: var(--texte-3); font-size: 12.5px; }
.grille-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grille-champs .large { grid-column: 1 / -1; }
details.avance summary { cursor: pointer; color: var(--texte-2); font-size: 13px; margin: 4px 0; }

.alerte { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin: 0 0 16px; }
.alerte--erreur { background: var(--critique-fond); color: var(--critique); }
.alerte--info { background: var(--accent-fond); color: var(--accent); }
.alerte--bon { background: var(--bon-fond); color: var(--bon); }
.bouton:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.essai-envoi { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.essai-envoi input { flex: 1 1 200px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--trait-fort); }
.alerte--attente { background: var(--attente-fond); color: #7A3A12; }
.alerte ul { margin: 6px 0 0; padding-left: 18px; }

.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 20px; }
.carte + .carte { margin-top: 16px; }

/* ---------- pastilles ---------- */
.pastille {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; background: var(--fond); color: var(--texte-2); white-space: nowrap;
}
.pastille i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pastille--attente { background: var(--attente-fond); color: var(--attente); }
.pastille--bon { background: var(--bon-fond); color: var(--bon); }
.pastille--spam { background: var(--critique-fond); color: var(--critique); }
.pastille--ia { background: var(--accent-fond); color: var(--accent); }
.pastille--humeur-agacé, .pastille--humeur-inquiet { background: var(--attente-fond); color: var(--attente); }
.pastille--humeur-furieux { background: var(--critique-fond); color: var(--critique); }
.pastille--humeur-content { background: var(--bon-fond); color: var(--bon); }

/* ---------- connexion ---------- */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connexion .carte { width: 100%; max-width: 380px; padding: 32px 28px; }
.connexion h1 { margin-bottom: 6px; }
.connexion form { display: grid; gap: 14px; margin-top: 20px; }

/* ---------- boîte de réception ---------- */
.boite { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.filtres { position: sticky; top: 80px; display: grid; gap: 18px; }
.filtres h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-3); margin: 0 0 6px; }
.filtres a {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--texte-2);
}
.filtres a:hover { background: var(--surface); text-decoration: none; }
.filtres a[aria-current="true"] { background: var(--surface); color: var(--texte); font-weight: 600; box-shadow: 0 0 0 1px var(--trait); }
.filtres a b { margin-left: auto; font-weight: 600; font-size: 12.5px; color: var(--texte-3); }
.filtres a i { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.liste { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.liste__vide { padding: 48px 24px; text-align: center; color: var(--texte-3); }
.ligne {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 14px 18px;
  border-bottom: 1px solid var(--trait); color: var(--texte);
}
.ligne:last-child { border-bottom: 0; }
.ligne:hover { background: #FAFBFC; text-decoration: none; }
.ligne__qui { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.ligne__qui span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne--attente .ligne__qui::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--attente); flex: none;
}
.ligne__quand { font-size: 13px; color: var(--texte-3); text-align: right; white-space: nowrap; }
.ligne__sujet { grid-column: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne__extrait {
  grid-column: 1 / -1; font-size: 13.5px; color: var(--texte-3); overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ligne__tags { grid-column: 2; grid-row: 2; display: flex; gap: 6px; justify-content: flex-end; }
.bascule { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--trait); }
.bascule a { padding: 6px 12px; border-radius: 8px; color: var(--texte-2); font-size: 14px; font-weight: 500; }
.bascule a:hover { text-decoration: none; background: var(--fond); }
.bascule a[aria-current="true"] { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
.bascule b { font-weight: 600; margin-left: 4px; }
.bandeau-releve { font-size: 13px; color: var(--texte-3); margin: 0 0 12px; }

/* ---------- fil d'un client ---------- */
.fil { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.fil__retour { display: inline-block; margin-bottom: 12px; font-size: 14px; }
.mail { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px 18px; }
.mail + .mail { margin-top: 12px; }
.mail--envoye { background: var(--toi-fond); border-color: #D6DEF5; margin-left: 48px; }
.mail--recu { margin-right: 48px; }
.mail__tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mail__qui { font-weight: 650; }
.mail__quand { margin-left: auto; font-size: 13px; color: var(--texte-3); }
.mail__sujet { font-size: 13.5px; color: var(--texte-2); margin-bottom: 10px; }
.mail__texte { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.mail details { margin-top: 10px; }
.mail details summary { cursor: pointer; font-size: 12.5px; color: var(--texte-3); }
.mail details .mail__texte { color: var(--texte-3); font-size: 13.5px; margin-top: 8px; }
.mail__pieces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cote .carte h2 { margin-bottom: 10px; }
.cote dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.cote dt { color: var(--texte-3); }
.cote dd { margin: 0; overflow-wrap: anywhere; }

.commande + .commande { border-top: 1px solid var(--trait); margin-top: 14px; padding-top: 14px; }
.commande__tete { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.commande__total { margin-left: auto; font-weight: 600; font-size: 14px; }
.commande__statuts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.commande__articles { margin: 0 0 6px; padding-left: 18px; font-size: 13.5px; }
.commande__suivi { margin: 4px 0; overflow-wrap: anywhere; }
.commande p { margin: 4px 0; }

/* ---------- réponse de l'IA ---------- */
.reponse { margin-top: 20px; }
.reponse__tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.reponse__tete h2 { margin: 0 8px 0 0; }
.reponse__resume { margin: 0 0 8px; font-size: 14px; }
.reponse textarea, .champ textarea {
  width: 100%; padding: 12px 14px; border-radius: 9px; border: 1px solid var(--trait-fort); background: #fff;
  font: 400 14.5px/1.55 var(--sans); resize: vertical;
}
.champ input[readonly] { background: var(--fond); }
.reponse__attente { display: flex; align-items: center; gap: 12px; color: var(--texte-2); }
.reponse__vide form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.roue { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-fond); border-top-color: var(--accent); animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- comparaison des modèles ---------- */
.comparaison { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.comparaison .carte { padding: 14px 16px; }
.comparaison h3 { font-size: 14px; margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; }
.comparaison .mail__texte { font-size: 13.5px; }
.cas { margin-bottom: 28px; }
.cas__client { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; }

/* ---------- boutiques ---------- */
.magasin { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--trait); }
.magasin:last-of-type { border-bottom: 1px solid var(--trait); margin-bottom: 12px; }
.magasin form { grid-row: 1 / span 2; grid-column: 2; margin: 0; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tuile { display: block; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px 18px; color: var(--texte); }
.tuile:hover { border-color: var(--trait-fort); text-decoration: none; }
.tuile__nom { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; }
.tuile__nom i { width: 10px; height: 10px; border-radius: 50%; }
.tuile p { margin: 6px 0 0; font-size: 13.5px; color: var(--texte-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions form { margin: 0; }

@media (max-width: 860px) {
  .entete { padding: 0 14px; gap: 12px; }
  .entete .long { display: none; }
  .entete nav a { padding: 6px 10px; }
  .page { padding: 16px 12px; }
  .boite, .fil { grid-template-columns: 1fr; }
  .filtres { position: static; grid-template-columns: 1fr; }
  .filtres nav { display: flex; gap: 6px; overflow-x: auto; }
  .filtres nav a { white-space: nowrap; }
  .mail--envoye { margin-left: 16px; }
  .mail--recu { margin-right: 16px; }
  .grille-champs { grid-template-columns: 1fr; }
  .comparaison { grid-template-columns: 1fr; }
}
