/* Kadence Prospector — feuille de style unique, mobile-first.
   Aucune dépendance externe : tout se charge en une requête. */

:root {
  --fond: #0b0f16;
  --fond-carte: #131a24;
  --fond-carte-haut: #1a2330;
  --bordure: #253044;
  --texte: #e8edf4;
  --texte-doux: #93a1b5;
  --ambre: #f5a524;
  --ambre-sombre: #b8791a;
  --vert: #2ea56b;
  --rouge: #e05555;
  --rayon: 12px;
}

* { box-sizing: border-box; }

/* Une règle `display` posée sur une classe l'emporte sur le style par défaut
   du navigateur : sans ceci, tout élément stylé puis masqué par l'attribut
   `hidden` resterait visible (barre de sélection, badges à zéro…). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--ambre); }

/* --- En-tête ------------------------------------------------------------ */

.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 22, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
  padding: calc(.6rem + env(safe-area-inset-top)) .9rem .1rem;
}

/* Le contenu de l'en-tête suit la même largeur que le corps de page. */
.entete-haut, .onglets { max-width: 780px; margin-left: auto; margin-right: auto; }

.entete-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.marque {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--texte);
  white-space: nowrap;
}
.marque span { color: var(--ambre); margin-left: .3em; font-weight: 500; }

.pastille {
  font-size: .74rem;
  color: var(--texte-doux);
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: .25rem .6rem;
  white-space: nowrap;
}
.pastille-alerte {
  color: #ffd9a0;
  border-color: var(--ambre-sombre);
  background: rgba(245, 165, 36, .12);
}

.onglets { display: flex; gap: 1.1rem; margin-top: .5rem; }
.onglets a {
  color: var(--texte-doux);
  text-decoration: none;
  font-size: .92rem;
  padding: .5rem 0;
  border-bottom: 2px solid transparent;
}
.onglets a.actif { color: var(--texte); border-bottom-color: var(--ambre); }
.onglets .lien-discret { margin-left: auto; font-size: .82rem; }

/* --- Bandeaux ----------------------------------------------------------- */

.bandeau-alerte {
  max-width: 780px;
  width: calc(100% - 1.8rem); /* conserve les gouttières sur téléphone */
  margin: .8rem auto 0;
  padding: .7rem .85rem;
  background: rgba(245, 165, 36, .12);
  border: 1px solid var(--ambre-sombre);
  border-radius: var(--rayon);
  color: #ffe2b8;
  font-size: .86rem;
}

.message-erreur {
  margin: .9rem 0;
  padding: .7rem .85rem;
  background: rgba(224, 85, 85, .12);
  border: 1px solid var(--rouge);
  border-radius: var(--rayon);
  color: #ffc9c9;
  font-size: .88rem;
}

/* --- Structure ---------------------------------------------------------- */

.conteneur { padding: .9rem; max-width: 780px; margin: 0 auto; }

.carte {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1rem;
}

.liste-cartes { display: flex; flex-direction: column; gap: .7rem; }

/* --- Formulaires -------------------------------------------------------- */

.champ { margin-bottom: .9rem; }

label {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--texte-doux);
  margin-bottom: .35rem;
}

input[type="text"], input[type="password"], input[type="number"], input[type="search"] {
  width: 100%;
  padding: .75rem .8rem;
  font-size: 16px; /* évite le zoom automatique sur iOS */
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
input:focus {
  outline: none;
  border-color: var(--ambre);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, .15);
}

.aide { font-size: .78rem; color: var(--texte-doux); margin: .4rem 0 0; }
.aide-attention { color: #ffd9a0; }

button, .bouton-lien, .bouton-appel, .bouton-secondaire, .bouton-inactif {
  font-family: inherit;
  font-size: .95rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* cible tactile confortable */
  padding: .6rem 1rem;
  border: 1px solid transparent;
}

.bouton-principal {
  width: 100%;
  background: var(--ambre);
  color: #1a1204;
  font-weight: 700;
  border: none;
}
.bouton-principal:disabled { opacity: .55; cursor: progress; }

.bouton-secondaire {
  background: var(--fond-carte-haut);
  border-color: var(--bordure);
  color: var(--texte);
}

.bouton-lien {
  background: none;
  border: 1px solid var(--bordure);
  color: var(--ambre);
  font-size: .85rem;
  min-height: 36px;
  padding: .35rem .8rem;
}

.bouton-inactif {
  background: none;
  border: 1px dashed var(--bordure);
  color: var(--texte-doux);
  font-size: .85rem;
  cursor: default;
  min-height: 36px;
}

.bouton-appel {
  background: rgba(46, 165, 107, .14);
  border-color: var(--vert);
  color: #9ae8c2;
  font-weight: 600;
}

/* --- Résultats & prospects ---------------------------------------------- */

.resume-resultats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin: 1.1rem 0 .6rem;
  font-size: .88rem;
  flex-wrap: wrap;
}

.discret { color: var(--texte-doux); font-size: .82rem; }

.carte-entete { display: flex; align-items: flex-start; gap: .5rem; }
.carte-entete h2 {
  font-size: 1rem;
  margin: 0;
  flex: 1;
  line-height: 1.3;
  word-break: break-word;
}

.etiquette {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .2rem .45rem;
  border-radius: 6px;
  white-space: nowrap;
}
.etiquette-fermee { background: rgba(224, 85, 85, .16); color: #ffb3b3; }

/* .etiquette-statut et ses couleurs sont définies plus bas, avec les statuts. */

.adresse { margin: .45rem 0 .2rem; font-size: .88rem; color: var(--texte-doux); }
.meta { margin: .1rem 0 .2rem; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.actions > * { flex: 1 1 auto; }

.carte-traitee { opacity: .5; }
.retour-action { font-size: .85rem; color: var(--vert); margin: .6rem 0 0; }
.retour-action.echec { color: #ffb3b3; }
.retour-action.neutre { color: var(--texte-doux); }

.vide { color: var(--texte-doux); padding: 1.2rem 0; }

.barre-filtre { display: flex; gap: .5rem; align-items: center; }
.barre-filtre input { flex: 1; }

/* --- Pied --------------------------------------------------------------- */

.pied {
  max-width: 780px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 .9rem;
  font-size: .8rem;
  color: var(--texte-doux);
}
.pied summary { cursor: pointer; }
.pied ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.pied li { margin-bottom: .25rem; }

/* --- Login -------------------------------------------------------------- */

.page-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 1rem;
}
.carte-login {
  width: 100%;
  max-width: 360px;
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1.6rem 1.2rem;
}
.marque-login { font-size: 1.3rem; margin: 0 0 1.2rem; text-align: center; }
.carte-login .message-erreur { margin: 0 0 1rem; }
.carte-login button { margin-top: 1rem; }

/* --- Statuts d'appel ---------------------------------------------------- */

.badge {
  display: inline-block;
  min-width: 1.2em;
  padding: 0 .35em;
  border-radius: 999px;
  background: var(--ambre);
  color: #1a1204;
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
}

/* Barre de filtres : défile horizontalement sur téléphone plutôt que de
   passer à la ligne, pour rester à portée de pouce. */
.filtres-statuts {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  margin-bottom: .6rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filtres-statuts::-webkit-scrollbar { display: none; }

.puce-statut {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .7rem;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  background: var(--fond-carte);
  color: var(--texte-doux);
  font-size: .82rem;
  text-decoration: none;
  white-space: nowrap;
}
.puce-statut.actif {
  color: var(--texte);
  border-color: var(--ambre);
  background: rgba(245, 165, 36, .12);
}
.puce-statut .compteur {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--texte);
}

/* Une couleur par statut, appliquée partout où le statut apparaît :
   badge de ligne, point de la sidebar, menu déroulant de la fiche. */
.etiquette-statut {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 600;
  padding: .25rem .55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--fond-carte-haut);
  color: var(--texte-doux);
  white-space: nowrap;
}

.statut-a-appeler {
  background: rgba(91, 157, 249, .16);
  border-color: rgba(91, 157, 249, .35);
  color: #8fbcff;
}
.statut-appele {
  background: rgba(245, 165, 36, .16);
  border-color: rgba(245, 165, 36, .35);
  color: #f5bc63;
}
.statut-interesse {
  background: rgba(53, 192, 127, .16);
  border-color: rgba(53, 192, 127, .35);
  color: #63d6a1;
}
.statut-rdv-pris {
  background: rgba(168, 120, 224, .18);
  border-color: rgba(168, 120, 224, .38);
  color: #c4a2f0;
}
.statut-rappeler {
  background: rgba(242, 121, 75, .16);
  border-color: rgba(242, 121, 75, .35);
  color: #f79b76;
}
.statut-injoignable {
  background: rgba(147, 161, 181, .16);
  border-color: rgba(147, 161, 181, .32);
  color: #aab6c7;
}
.statut-refuse {
  background: rgba(240, 86, 122, .16);
  border-color: rgba(240, 86, 122, .35);
  color: #f68aa5;
}

/* --- Fiche prospect ----------------------------------------------------- */

.identite { margin: .1rem 0 .3rem; word-break: break-word; }

.rappel-actif {
  margin: .5rem 0 0;
  font-size: .85rem;
  color: #ffd9a0;
}

.details-fiche {
  margin-top: .8rem;
  border-top: 1px solid var(--bordure);
  padding-top: .6rem;
}
.details-fiche summary {
  cursor: pointer;
  font-size: .85rem;
  color: var(--texte-doux);
  min-height: 32px;
  display: flex;
  align-items: center;
}
.details-fiche[open] summary { margin-bottom: .6rem; }

.bloc { margin-bottom: 1.1rem; }
.bloc:last-child { margin-bottom: 0; }

.titre-bloc {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--texte-doux);
  margin-bottom: .35rem;
}

select, textarea {
  width: 100%;
  padding: .7rem .8rem;
  font-family: inherit;
  font-size: 16px; /* évite le zoom automatique sur iOS */
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2393a1b5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 12px;
  padding-right: 2.2rem;
}
select:focus, textarea:focus {
  outline: none;
  border-color: var(--ambre);
  box-shadow: 0 0 0 3px rgba(245, 165, 36, .15);
}
textarea { resize: vertical; }

input[type="datetime-local"] {
  width: 100%;
  padding: .7rem .8rem;
  font-family: inherit;
  font-size: 16px;
  color: var(--texte);
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: 10px;
}

.raccourcis {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}

.bouton-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 86, 122, .12);
  border: 1px solid rgba(240, 86, 122, .5);
  color: #f68aa5;
  font-weight: 600;
  width: 100%;
}
.bouton-danger:hover { background: rgba(240, 86, 122, .2); }
.bloc-danger { border-top: 1px solid var(--bordure); padding-top: .8rem; }

/* --- Notes et historique ------------------------------------------------ */

.liste-notes, .liste-historique {
  list-style: none;
  margin: .7rem 0 0;
  padding: 0;
}
.liste-notes li, .liste-historique li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  padding: .5rem 0;
  border-top: 1px solid var(--bordure);
  font-size: .88rem;
}
.horodatage {
  color: var(--texte-doux);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.texte-note { flex: 1 1 100%; word-break: break-word; }
.liste-notes .bouton-lien { min-height: 30px; padding: .2rem .6rem; font-size: .76rem; }

/* --- Recherches précédentes --------------------------------------------- */

.section-historique { margin-top: 1.8rem; }

.titre-section {
  font-size: .95rem;
  margin: 0 0 .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.titre-section .compteur {
  font-size: .78rem;
  color: var(--texte-doux);
  font-variant-numeric: tabular-nums;
}

.liste-recherches { list-style: none; margin: .8rem 0 0; padding: 0; }
.liste-recherches li {
  display: flex;
  align-items: center;
  gap: .6rem;
  border-top: 1px solid var(--bordure);
  padding: .2rem 0;
}
.lien-recherche {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .6rem 0;
  text-decoration: none;
  color: var(--texte);
}
.lien-recherche .requete { font-size: .9rem; }

.bandeau-filtre {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: .6rem .8rem;
  font-size: .84rem;
  color: var(--texte-doux);
  margin: 0 0 .8rem;
}

/* --- Rappels ------------------------------------------------------------ */

.groupe-rappels { margin-bottom: 1.6rem; }
.groupe-rappels.retard .carte-rappel { border-color: var(--rouge); }
.groupe-rappels.aujourdhui .carte-rappel { border-color: var(--ambre-sombre); }
.carte-rappel h3 { font-size: 1rem; margin: 0; flex: 1; }
.carte-rappel h3 a { text-decoration: none; color: var(--texte); }

/* --- Icônes ------------------------------------------------------------- */

/* Les SVG suivent la taille et la couleur du texte : une seule définition
   sert aux boutons, aux libellés et aux listes. */
.ico {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  vertical-align: -.125em;
}
.ico-etoile { fill: #f5a524; stroke: #f5a524; }

button .ico, a.bouton-fin .ico, .bouton-principal .ico, .bouton-danger .ico {
  margin-right: .35em;
}
.ico:only-child { margin-right: 0; }

/* --- Bouton discret (bordure fine, pas de fond plein) ------------------- */

.bouton-fin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  font-family: inherit;
  font-size: .82rem;
  background: none;
  border: 1px solid var(--bordure);
  color: var(--texte-doux);
  border-radius: 8px;
  padding: .4rem .7rem;
  min-height: 34px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.bouton-fin:hover { border-color: var(--texte-doux); color: var(--texte); }

/* --- Note Google -------------------------------------------------------- */

.note-google {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  font-size: .78rem;
  font-weight: 600;
  color: #f5bc63;
  white-space: nowrap;
}

/* --- Espace de travail à trois colonnes --------------------------------- */

/* Le corps ne défile pas : chaque colonne gère son propre défilement, comme
   dans un client mail. Sans ça, l'en-tête et les filtres partiraient vers le
   haut dès qu'on descend dans la liste. */
.page-espace {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-espace .entete { position: static; flex: 0 0 auto; }
.page-espace .bandeau-alerte { flex: 0 0 auto; }

.espace-travail {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 400px;
}
.espace-travail > * { min-height: 0; overflow-y: auto; }

.titre-colonne {
  display: block;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--texte-doux);
}

/* --- Colonne 1 : filtres ------------------------------------------------ */

.colonne-filtres {
  border-right: 1px solid var(--bordure);
  padding: .9rem .7rem 2rem;
  background: var(--fond);
}

.filtre-texte { margin-bottom: 1.1rem; }

/* Champ de recherche avec l'icône posée dedans, comme sur la référence. */
.champ-icone { position: relative; display: block; }
.champ-icone .ico {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--texte-doux);
  font-size: 1rem;
  pointer-events: none;
}
.champ-icone input { padding-left: 2.2rem; }

.workflow { display: flex; flex-direction: column; gap: .1rem; margin-bottom: 1.4rem; }
.workflow .titre-colonne { margin-bottom: .45rem; }

.entree-workflow {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--texte-doux);
  font-size: .88rem;
  min-height: 40px;
}
.entree-workflow.actif {
  background: rgba(245, 165, 36, .12);
  color: var(--texte);
}
.entree-workflow .libelle-workflow { flex: 1; }
.entree-workflow .compteur {
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  color: var(--texte);
}

/* Les badges de statut sont volontairement translucides ; un point de 9 px
   a besoin de couleurs pleines pour rester lisible. */
.pastille-statut {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.pastille-statut.statut-tous        { background: var(--texte-doux); }
.pastille-statut.statut-a-appeler   { background: #5b9df9; }
.pastille-statut.statut-appele      { background: #f5a524; }
.pastille-statut.statut-interesse   { background: #35c07f; }
.pastille-statut.statut-rdv-pris    { background: #a878e0; }
.pastille-statut.statut-rappeler    { background: #f2794b; }
.pastille-statut.statut-injoignable { background: #93a1b5; }
.pastille-statut.statut-refuse      { background: #f0567a; }

/* Le menu déroulant de la fiche porte lui aussi la couleur du statut :
   la teinte suit la donnée, pas le composant. */
.select-statut.statut-a-appeler   { border-color: rgba(91, 157, 249, .5);  color: #8fbcff; }
.select-statut.statut-appele      { border-color: rgba(245, 165, 36, .5);  color: #f5bc63; }
.select-statut.statut-interesse   { border-color: rgba(53, 192, 127, .5);  color: #63d6a1; }
.select-statut.statut-rdv-pris    { border-color: rgba(168, 120, 224, .5); color: #c4a2f0; }
.select-statut.statut-rappeler    { border-color: rgba(242, 121, 75, .5);  color: #f79b76; }
.select-statut.statut-injoignable { border-color: rgba(147, 161, 181, .5); color: #aab6c7; }
.select-statut.statut-refuse      { border-color: rgba(240, 86, 122, .5);  color: #f68aa5; }

.bloc-sidebar { margin-bottom: 1.4rem; }
.bloc-sidebar .titre-colonne { margin-bottom: .5rem; }

/* --- Filtres « Contact » ------------------------------------------------- */

.section-contact { margin-bottom: 1.4rem; }
.section-contact .titre-colonne {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .5rem;
}

.carte-filtres {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: .7rem;
}

.case-filtre {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  margin: 0;
  font-size: .85rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--texte);
  cursor: pointer;
}
.case-filtre .ico { color: var(--texte-doux); }

.libelle-logique {
  display: block;
  margin: .7rem 0 .3rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--texte-doux);
}
.carte-filtres select { font-size: .85rem; padding: .5rem 2rem .5rem .6rem; }

.liste-recherches-compacte { list-style: none; margin: 0 0 .5rem; padding: 0; }
.liste-recherches-compacte a {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .45rem .6rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--texte);
  font-size: .84rem;
}
.liste-recherches-compacte a.actif { background: rgba(245, 165, 36, .12); }

.detail-usage { font-size: .76rem; color: var(--texte-doux); margin-top: .8rem; }
.detail-usage summary { cursor: pointer; }
.detail-usage ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.detail-usage li { margin-bottom: .25rem; }

/* --- Colonne 2 : liste -------------------------------------------------- */

.colonne-liste { display: flex; flex-direction: column; }

.entete-colonne {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  padding: .7rem .8rem;
  background: var(--fond);
  border-bottom: 1px solid var(--bordure);
}
.titre-liste { font-size: 1.05rem; font-weight: 700; }
.compteur-total {
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  color: var(--texte-doux);
  background: var(--fond-carte-haut);
  border-radius: 999px;
  padding: .15rem .55rem;
}
.tout-selectionner {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--texte-doux);
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  cursor: pointer;
}
.entete-boutons { margin-left: auto; display: flex; gap: .5rem; }

.bouton-compact { width: auto; min-width: 0; padding: .45rem .8rem; font-size: .85rem; min-height: 34px; }
.bouton-filtres { padding: .4rem .6rem; }

/* --- Onglets par recherche ---------------------------------------------- */

.onglets-recherches {
  display: flex;
  gap: .4rem;
  padding: .6rem .8rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.onglets-recherches::-webkit-scrollbar { display: none; }

.onglet {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--bordure);
  background: var(--fond-carte);
  color: var(--texte-doux);
  font-size: .82rem;
  text-decoration: none;
  white-space: nowrap;
}
.onglet.actif {
  background: var(--fond-carte-haut);
  border-color: var(--ambre-sombre);
  color: var(--texte);
}
.onglet .compteur {
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
  color: var(--texte-doux);
}

/* --- Sélection multiple -------------------------------------------------- */

.barre-selection {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .7rem .8rem 0;
  padding: .5rem .7rem;
  border: 1px solid var(--ambre-sombre);
  background: rgba(245, 165, 36, .1);
  border-radius: 10px;
  font-size: .85rem;
}
.barre-selection > :first-child { flex: 1; }

.case-ligne {
  display: flex;
  align-items: center;
  padding: .6rem .1rem .6rem .7rem;
  margin: 0;
  cursor: pointer;
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--ambre);
  cursor: pointer;
}

.note-troncature, .bandeau-filtre { margin: .7rem .8rem 0; }

.liste-prospects { list-style: none; margin: 0; padding: .7rem .8rem 2rem; }

.ligne-prospect {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-left: 3px solid transparent;
  border-radius: 12px;
  margin-bottom: .5rem;
  padding-right: .5rem;
  transition: background .12s ease, border-color .12s ease;
}
.ligne-prospect:hover { background: var(--fond-carte-haut); }
.ligne-prospect.actif {
  border-color: var(--ambre-sombre);
  border-left-color: var(--ambre);
  background: rgba(245, 165, 36, .09);
}
.ligne-prospect.cochee { border-left-color: var(--texte-doux); }

.ligne-principal {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  background: none;
  border: none;
  border-radius: 10px;
  text-align: left;
  color: inherit;
  padding: .7rem .5rem;
  min-height: 58px;
}
.ligne-titre {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  max-width: 100%;
  min-width: 0;
}
.ligne-nom {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ligne-meta {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--texte-doux);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ligne-cote { display: flex; align-items: center; gap: .45rem; flex: 0 0 auto; }
.ligne-icones { display: flex; gap: .1rem; }
.icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--texte-doux);
  font-size: 1.05rem;
}
.icone:hover { background: var(--fond-carte-haut); color: var(--texte); }

/* --- Colonne 3 : détail ------------------------------------------------- */

.colonne-detail { border-left: 1px solid var(--bordure); padding: .9rem; }

.etat-vide { text-align: center; padding: 3rem 1rem; color: var(--texte-doux); }

.fiche-detail { display: flex; flex-direction: column; gap: .9rem; }

.detail-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; }
.detail-titre { min-width: 0; }
.detail-entete h2 {
  margin: 0 0 .3rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
  word-break: break-word;
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
}
.detail-entete .adresse { margin: 0; display: flex; align-items: center; gap: .35rem; }
.detail-entete .discret { margin: .2rem 0 0; }

.select-statut { width: auto; min-width: 132px; flex: 0 0 auto; font-size: .82rem; padding: .45rem 2rem .45rem .6rem; }

.detail-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.detail-actions > * { flex: 1 1 auto; }

/* Bloc téléphone : l'élément le plus cliqué de la fiche, donc le plus gros. */
.bloc-telephone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 52px;
  padding: .7rem 1rem;
  border-radius: var(--rayon);
  border: 1px solid rgba(91, 157, 249, .45);
  background: rgba(91, 157, 249, .14);
  color: #a9cdff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}
.bloc-telephone:hover { background: rgba(91, 157, 249, .2); }
.bloc-telephone-vide {
  border-style: dashed;
  border-color: var(--bordure);
  background: none;
  color: var(--texte-doux);
  font-size: .9rem;
  font-weight: 400;
  cursor: default;
}
.bloc-telephone-action { font-size: 1rem; }

.detail-identite {
  margin: 0;
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--fond-carte);
  padding: 0 .8rem;
}
.detail-identite > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .55rem 0;
  border-top: 1px solid var(--bordure);
}
.detail-identite > div:first-child { border-top: none; }
.detail-identite dt {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--texte-doux);
  font-size: .78rem;
  flex: 0 0 auto;
}
.detail-identite dd { margin: 0; font-size: .88rem; font-weight: 500; text-align: right; word-break: break-word; }

.ligne-champ { display: flex; gap: .5rem; align-items: flex-start; }
.ligne-champ > :first-child { flex: 1; min-width: 0; }
.ligne-champ button { flex: 0 0 auto; min-width: 48px; }

.bloc-siret summary { cursor: pointer; font-size: .82rem; color: var(--texte-doux); }
.bloc-siret input { margin-top: .5rem; }

.bouton-retour { display: none; }

/* --- Modale de recherche ------------------------------------------------ */

.modale {
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  background: var(--fond);
  color: var(--texte);
  width: min(520px, calc(100% - 2rem));
  padding: 1rem;
}
.modale::backdrop { background: rgba(0, 0, 0, .65); }
.modale-entete { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.modale-entete h2 { margin: 0; font-size: 1rem; }
.modale .carte { border: none; padding: 0; background: none; }

/* --- Écrans larges ------------------------------------------------------ */

@media (min-width: 640px) {
  .conteneur { padding: 1.4rem; }
  .bouton-principal { width: auto; min-width: 180px; }
  .actions > * { flex: 0 0 auto; }
  .bouton-danger { width: auto; }
  .liste-notes li, .liste-historique li { flex-wrap: nowrap; }
  .texte-note { flex: 1; }
}

@media (min-width: 1024px) {
  .bouton-filtres, .fermer-tiroir { display: none; }
}

/* --- Téléphone et tablette : une colonne à la fois ---------------------- */

@media (max-width: 1023px) {
  .espace-travail { grid-template-columns: 1fr; }

  /* Les filtres deviennent un tiroir : ils n'ont pas leur place en
     permanence sur un écran étroit. */
  .colonne-filtres {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 85vw);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .5);
    padding-top: calc(.9rem + env(safe-area-inset-top));
  }
  .espace-travail.filtres-ouverts .colonne-filtres { transform: none; }
  .fermer-tiroir { margin-bottom: .8rem; }

  /* Liste et détail occupent la même case : une seule est visible. */
  .colonne-liste, .colonne-detail { grid-area: 1 / 1; }
  .colonne-detail { border-left: none; }
  .espace-travail[data-vue="liste"] .colonne-detail { display: none; }
  .espace-travail[data-vue="detail"] .colonne-liste { display: none; }

  .bouton-retour {
    display: inline-flex;
    align-items: center;
    background: none;
    border: 1px solid var(--bordure);
    color: var(--texte);
    align-self: flex-start;
    font-size: .85rem;
    min-height: 40px;
  }

  .detail-entete { flex-direction: column; }
  .select-statut { width: 100%; }

  /* Le nom de l'entreprise est l'information qu'on lit en premier :
     il passe à la ligne plutôt que d'être tronqué. */
  .ligne-titre { flex-wrap: wrap; }
  .ligne-nom { white-space: normal; overflow: visible; font-size: .95rem; }
}
