/* =====================================================================
   Pages Prospection, Mon entreprise, Mes agents, Assistance (préfixe .ges-).
   Réutilise les tokens et composants d'app.css ; aucune couleur de marque en dur
   hors des couleurs d'agents transmises par l'API (--c).
   ===================================================================== */

.ges-gap { gap: 24px; }
.ges-modal-form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.ges-danger:hover { color: var(--red-ink); background: var(--red-soft); }
.ges-vide { padding: 8px 0; }

/* ------------------------------------------------------------------ interrupteurs & réglages */
.ges-switch { min-width: 64px; min-height: 34px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--border-strong); background: var(--surface); font: 700 13.5px/1 var(--font-text); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; }
.ges-switch:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.ges-switch.is-on { background: var(--t-green-bg); border-color: color-mix(in srgb, var(--green-ink) 40%, transparent); color: var(--green-ink); }
.ges-switch:disabled { cursor: progress; opacity: .7; }
.ges-set { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.ges-set:first-child { border-top: 0; padding-top: 0; }
.ges-set--col { flex-direction: column; align-items: stretch; gap: 10px; }
.ges-set--inline { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; }
.ges-mode.is-active { background: var(--t-amber-bg); color: var(--ink); border-color: var(--ink); }
.ges-mode:disabled { cursor: progress; }

/* ------------------------------------------------------------------ Mes agents */
.ges-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ges-agent { display: flex; flex-direction: column; gap: 14px; border-top: 4px solid var(--c); }
.ges-agent.is-off { background: var(--surface-2); border-top-color: var(--border-strong); }
.ges-agent.is-off .ges-agent__icon, .ges-agent.is-off .ges-agent__txt { opacity: .6; }
.ges-agent__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--c) 13%, white); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 33%, transparent); color: var(--c); }
.ges-agent__txt { display: flex; flex-direction: column; gap: 4px; }
.ges-agent .link { margin-top: auto; align-self: flex-start; }
.ges-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ges-agents-bas { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ges-learn__top { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.ges-rate { display: flex; flex-direction: column; gap: 4px; flex: 1 1 240px; min-width: 0; }
.ges-rate__val { font: 800 38px/1 var(--font-title); letter-spacing: -0.03em; color: var(--green-ink); font-variant-numeric: tabular-nums; }
.ges-histo { display: flex; gap: 10px; align-items: flex-end; }
.ges-histo__col { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 34px; }
.ges-histo__bar { width: 22px; border-radius: 6px 6px 3px 3px; background: color-mix(in srgb, var(--green) 35%, var(--cream-2)); }
.ges-histo__bar.is-last { background: var(--green); }
.ges-histo__pct { font: 700 11px/1 var(--font-text); color: var(--text-2); }
.ges-histo__lab { font-size: 11.5px; color: var(--text-3); }
.ges-consigne { display: flex; gap: 10px; margin: 16px 0 6px; }
.ges-consigne .input { flex: 1; min-width: 0; }
.ges-regles { display: flex; flex-direction: column; }
.ges-regle { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.ges-regle.is-pending { opacity: .7; }
.ges-regle__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }

/* ------------------------------------------------------------------ Assistance */
.ges-grid-assist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.ges-prefill { margin: -6px 0 14px; padding: 8px 12px; border-radius: 10px; background: var(--t-blue-bg); color: var(--t-blue); }
.ges-demandes { display: flex; flex-direction: column; }
.ges-demande { display: flex; flex-direction: column; gap: 6px; padding: 16px 0; border-top: 1px solid var(--border); }
.ges-demande:first-child { border-top: 0; padding-top: 0; }
.ges-reponse { margin-top: 4px; padding: 10px 14px; border-radius: 12px; background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); display: flex; flex-direction: column; gap: 4px; }
.ges-reponse .eyebrow { color: var(--green-ink); }

/* ------------------------------------------------------------------ Mon entreprise */
.ges-identite { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px; border-radius: var(--r-lg); background: var(--ink); color: #fff; }
.ges-identite .profile__avatar { background: var(--orange); color: var(--ink); width: 52px; height: 52px; font-size: 22px; }
.ges-identite .muted { color: #B9C0C6; }
.ges-identite__note { max-width: 340px; color: #B9C0C6; }
.ges-identite .link { color: var(--orange); }
.ges-identite .link:hover { color: #fff; }
.ges-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; grid-column: 1 / -1; }
.ges-items { display: flex; flex-direction: column; }
.ges-item { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--border); }
.ges-item:first-child { border-top: 0; padding-top: 0; }
.ges-item.is-off .ges-item__txt { opacity: .65; }
.ges-item__txt { gap: 6px; }
.ges-item__actions { display: flex; gap: 2px; align-items: center; flex: none; min-height: 38px; }
.ges-prix { font: 800 20px/1.2 var(--font-title); white-space: nowrap; flex: none; padding-top: 2px; }
.ges-pennylane { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-md); border: 1px dashed var(--border-strong); background: var(--surface-2); flex-wrap: wrap; }
.ges-pennylane .grow { flex: 1 1 260px; }
.ges-upload { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.ges-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 22px 16px; min-height: 120px; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.ges-drop:hover, .ges-drop.is-over { border-color: var(--orange); background: var(--orange-soft); }
.ges-drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.ges-drop.is-busy { cursor: progress; opacity: .8; }
.ges-drop__icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--orange-ink); box-shadow: var(--shadow-1); }
.ges-doc { flex-direction: column; align-items: stretch; gap: 12px; }
.ges-doc__row { display: flex; gap: 14px; align-items: flex-start; width: 100%; }
.ges-fiche { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.ges-fiche__btns { justify-content: flex-end; }

/* ------------------------------------------------------------------ Prospection */
.ges-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.ges-stat--good .stat__val { color: var(--green-ink); }
.ges-tag { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 6px 4px 12px; border-radius: var(--r-pill); background: var(--cream); border: 1px solid var(--border); font: 600 14px/1.2 var(--font-text); max-width: 100%; }
.ges-tag > span, .ges-tag { overflow-wrap: anywhere; }
.ges-tag__x { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.ges-tag__x:hover { background: var(--red-soft); color: var(--red-ink); }
.ges-rappel { margin-top: 14px; }
.ges-score { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font: 800 13.5px/1 var(--font-title); flex: none; }
.ges-score.is-lg { width: 46px; height: 46px; border-radius: 14px; font-size: 22px; }
.s-A { background: var(--t-green-bg); color: var(--t-green); }
.s-B { background: var(--t-orange-bg); color: var(--t-orange); }
.s-C { background: var(--t-neutral-bg); color: var(--t-neutral); }
.ges-kanban { position: relative; display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.ges-col { flex: 0 0 264px; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--border); scroll-snap-align: start; min-height: 180px; }
.ges-col__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 2px 4px; }
.ges-col__vide { text-align: center; padding: 18px 0; }
.ges-pcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.ges-pcard:hover { border-color: var(--border-strong); }
.ges-pcard.is-selected { box-shadow: inset 4px 0 0 var(--orange), var(--shadow-1); background: #FFF6F0; }
.ges-pcard__open { border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ges-pcard__open .strong:hover { text-decoration: underline; }
.ges-loc { gap: 4px; }
.ges-liste { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ges-liste__head, .ges-liste__row { display: grid; grid-template-columns: 40px 56px minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 1fr) 140px 80px; gap: 10px; align-items: center; padding: 12px 16px; }
.ges-liste__head { background: var(--surface-2); border-bottom: 1px solid var(--border); font: 600 12.5px/1.3 var(--font-text); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.ges-liste__row { border-bottom: 1px solid var(--border); cursor: pointer; background: var(--surface); }
.ges-liste__row:last-child { border-bottom: 0; }
.ges-liste__row:hover { background: #FCFAF6; }
.ges-liste__row.is-selected { background: #FFF6F0; box-shadow: inset 4px 0 0 var(--orange); }
.ges-liste__who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ges-liste__nom { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; cursor: pointer; }
.ges-liste__nom:hover { text-decoration: underline; }
.ges-only-m { display: none; }
.ges-infos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.ges-infos div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ges-infos dt { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.ges-infos dd { margin: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.ges-histo-fil { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ges-histo-fil li { padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); max-width: 88%; display: flex; flex-direction: column; gap: 3px; }
.ges-histo-fil li.is-moi { align-self: flex-end; background: var(--ink); color: #fff; border-color: var(--ink); border-bottom-right-radius: 5px; }
.ges-histo-fil li.is-moi .muted { color: #B9C0C6; }
.ges-histo-fil li.is-lui { border-bottom-left-radius: 5px; }
.ges-interet { max-width: 720px; display: flex; flex-direction: column; gap: 14px; padding: 32px; }
.ges-interet__titre { font-size: 30px; }
.ges-avantages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ges-avantages li { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14.5px; }
.ges-avantages li > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-ink); flex: none; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .ges-agents-bas { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .ges-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ges-grid-assist { grid-template-columns: minmax(0, 1fr); }
  .ges-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ges-liste__head, .ges-liste__row { grid-template-columns: 40px 48px minmax(0, 1fr) 130px; }
  .ges-hide-m { display: none; }
  .ges-only-m { display: block; }
}
@media (max-width: 700px) {
  .ges-agents { grid-template-columns: minmax(0, 1fr); }
  .ges-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ges-stats > :first-child { grid-column: 1 / -1; }
  .ges-upload { grid-template-columns: minmax(0, 1fr); }
  .ges-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ges-3 > :last-child { grid-column: 1 / -1; }
  .ges-infos .ges-infos__large { grid-column: 1 / -1; }
  .ges-avantages { grid-template-columns: minmax(0, 1fr); }
  .ges-interet { padding: 22px 18px; }
  .ges-interet__titre { font-size: 25px; }
  .ges-liste__head, .ges-liste__row { grid-template-columns: 34px 30px minmax(0, 1fr); padding: 12px; }
  .ges-liste__head > :nth-child(6), .ges-liste__row > :nth-child(6) { grid-column: 3; }
  .ges-liste__head > :not(:first-child) { display: none; }
  .ges-liste__head::after { content: 'Tout sélectionner'; grid-column: 2 / -1; text-transform: none; letter-spacing: 0; }
  .ges-head-wrap .card-head { flex-wrap: wrap; }
  .ges-head-wrap .card-head__txt { flex-basis: calc(100% - 60px); }
  .ges-head-wrap .card-head__actions { width: 100%; }
  .ges-head-wrap .card-head__actions .btn { flex: 1; }
  .ges-col { flex-basis: 78vw; }
  .ges-item { flex-wrap: wrap; gap: 10px; }
  .ges-item .ges-item__txt { flex: 1 1 100%; }
  .ges-prix { order: 3; margin-right: auto; align-self: center; padding-top: 0; }
  .ges-item__actions { order: 4; margin-left: auto; }
  .ges-item:not(:has(.ges-prix)):not(.ges-doc) { flex-wrap: nowrap; }
  .ges-item:not(:has(.ges-prix)):not(.ges-doc) .ges-item__txt { flex: 1 1 auto; }
  .ges-item:not(:has(.ges-prix)):not(.ges-doc) .ges-item__actions { flex-direction: column; margin-left: 0; }
  .ges-doc__row { flex-wrap: wrap; }
  .ges-doc .ges-item__txt { flex: 1 1 calc(100% - 60px) !important; }
  .ges-doc .ges-item__actions { width: 100%; justify-content: flex-end; }
  .ges-regle { flex-direction: column; gap: 8px; }
  .ges-regle__side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .ges-consigne { flex-direction: column; }
  .ges-identite { padding: 16px; }
  .ges-learn__top { padding: 14px; }
  .ges-histo { width: 100%; justify-content: space-between; }
}
