/* GP Chat — front */
.gpchat-account-link .link-item { display: flex; align-items: center; gap: .4rem; }
.gpchat-badge { background: #a23b32; color: #fff; border-radius: 999px; padding: 0 .4rem; font-size: .75rem; }

/* ---- Page dédiée ---- */
.gpchat-page { max-width: 1080px; margin: 0 auto; }
.gpchat-back { margin-bottom: 1rem; }
.gpchat-back a { text-decoration: none; }

/* Vue vendeur : la page vit dans la colonne .col-lg-9 de l'espace vendeur.
   (L'alignement du .row est géré par vendor-dashboard.css §01bis — ne pas
   zéroer la marge ici, sinon le menu latéral se décale de 12px vs les autres
   pages vendeur.) */
.gpchat-page--seller { max-width: none; margin: 0; }
.gpchat-page--seller .gpchat-layout { flex-wrap: wrap; }
@media (max-width: 1200px) {
  .gpchat-page--seller .gpchat-layout { flex-direction: column-reverse; }
  .gpchat-page--seller .gpchat-context { flex-basis: auto; width: 100%; }
}

.gpchat-layout { display: flex; gap: 1.25rem; align-items: flex-start; }
.gpchat-layout .gpchat-conversation { flex: 1 1 auto; min-width: 0; }
.gpchat-context { flex: 0 0 290px; }
@media (max-width: 860px) {
  .gpchat-layout { flex-direction: column-reverse; }
  .gpchat-context { flex-basis: auto; width: 100%; }
}

.gpchat-conversation {
  border: 1px solid #d9ddd4; border-radius: 12px; background: #fff; overflow: hidden;
  display: flex; flex-direction: column;
}

/* ---- Panneau contextuel ---- */
.gpchat-context-block { border: 1px solid #e2e6dd; border-radius: 10px; background: #fff; padding: .85rem 1rem; margin-bottom: .85rem; font-size: .9rem; }
.gpchat-context-block h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #7a8577; margin: 0 0 .5rem; }
.gpchat-context-tag { display: inline-block; background: #2f7d4f; color: #fff; border-radius: 999px; padding: .15rem .7rem; font-size: .8rem; font-weight: 600; }
.gpchat-context-date { margin: .5rem 0 0; color: #888; font-size: .82rem; }
.gpchat-context-block dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; }
.gpchat-context-block dt { color: #8a9387; font-weight: 400; }
.gpchat-context-block dd { margin: 0; font-weight: 600; word-break: break-word; }
.gpchat-context-subtitle { margin: .6rem 0 .2rem; font-size: .82rem; color: #8a9387; }
.gpchat-context-items { margin: 0; padding-left: 1.1rem; }
.gpchat-context-items li { margin: .1rem 0; }
.gpchat-context-hint { font-size: .8rem; margin: .5rem 0 0; }
.gpchat-mediator-btn { width: 100%; }
.gpchat-mediator-done { margin: 0; padding: .5rem .7rem; background: #eef5f0; border: 1px solid #cfe6d8; border-radius: 8px; color: #2f7d4f; font-size: .85rem; text-align: center; }
.gpchat-conv-head {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: 1rem 1.25rem; border-bottom: 1px solid #eceee8; background: #f6f7f4;
}
.gpchat-conv-title { font-size: 1.15rem; margin: 0; }
.gpchat-conv-with { margin: .2rem 0 0; font-size: .9rem; }
.gpchat-conv-actions { margin-left: auto; display: flex; align-items: center; gap: .25rem; }
.gpchat-conv-head .gpchat-gdpr { background: none; border: 0; font-size: 1.1rem; cursor: pointer; opacity: .6; }
.gpchat-conv-head .gpchat-gdpr:hover { opacity: 1; }
.gpchat-close-btn { color: #8a9387; font-size: .85rem; padding: .15rem .5rem; }

.gpchat-closed-banner { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .9rem 1rem; background: #f6f7f4; border-top: 1px solid #eceee8; color: #7a8577; font-size: .9rem; }

.gpchat-messages { overflow-y: auto; max-height: min(60vh, 520px); padding: .75rem 1rem; background: #fff; display: flex; flex-direction: column; gap: .6rem; }

/* Vue vendeur : la conversation occupe toute la hauteur dispo sous le menu ;
   seule .gpchat-messages scroll (hauteur posée en JS par sizeSellerConversation()),
   pas la page. */
.gpchat-page--seller .gpchat-conversation { max-height: none; }
.gpchat-page--seller .gpchat-messages { flex: 1 1 auto; max-height: none; min-height: 0; }
.gpchat-msg { padding: .7rem .95rem; font-size: .95rem; line-height: 1.5; max-width: 82%; border: 1px solid #e7e9e3; border-radius: 12px; }
.gpchat-msg > header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .3rem; }
.gpchat-msg .gpchat-author { font-weight: 700; }
.gpchat-msg time { color: #999; font-size: .8rem; }
.gpchat-msg.gpchat-role-admin .gpchat-author { color: #2f7d4f; }

/* mes messages à droite, ceux de l'interlocuteur à gauche */
.gpchat-msg.gpchat-mine { margin-left: auto; background: #eef5f0; border-color: #d3e6db; border-bottom-right-radius: 3px; }
.gpchat-msg.gpchat-mine > header { flex-direction: row-reverse; }
.gpchat-msg.gpchat-theirs { margin-right: auto; background: #fff; border-bottom-left-radius: 3px; }
.gpchat-msg.gpchat-role-admin.gpchat-theirs { background: #f0f7f2; border-color: #cfe6d8; }

.gpchat-sys { align-self: center; max-width: 92%; background: #fef7e6; color: #7a5416; font-size: .85rem; font-style: italic; text-align: center; border-color: #f0e2bf; }
.gpchat-sys > header { display: none; }
.gpchat-atts img { max-width: 180px; border-radius: 8px; margin-top: .5rem; display: block; }
.gpchat-file { display: inline-block; margin-top: .5rem; font-size: .85rem; }

/* Indicateur « en train d'écrire » */
.gpchat-typing { display: flex; align-items: center; gap: .5rem; padding: .5rem 1.25rem .7rem; color: #777; font-size: .85rem; font-style: italic; }
.gpchat-typing-dots { display: inline-flex; gap: 3px; }
.gpchat-typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: #9aa39a; display: inline-block; animation: gpchat-bounce 1.2s infinite ease-in-out both; }
.gpchat-typing-dots i:nth-child(1) { animation-delay: -.24s; }
.gpchat-typing-dots i:nth-child(2) { animation-delay: -.12s; }
@keyframes gpchat-bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .gpchat-typing-dots i { animation: none; opacity: .7; } }

.gpchat-form { display: flex; align-items: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid #eceee8; background: #f6f7f4; }
.gpchat-form textarea { flex: 1; resize: vertical; border: 1px solid #ddd; border-radius: 8px; padding: .5rem .7rem; font: inherit; min-height: 2.4rem; max-height: 140px; }
.gpchat-form button[type=submit] { background: #2f7d4f; color: #fff; border: 0; border-radius: 8px; padding: .55rem 1.1rem; cursor: pointer; }
.gpchat-attach { cursor: pointer; font-size: 1.3rem; align-self: center; }
.gpchat-attach input { display: none; }

.gpchat-loading { text-align: center; color: #999; }
.gpchat-error { text-align: center; color: #b0304a; background: #fceef1; border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; }

/* ---- Liste « Mes conversations » ----
   Réutilise l'habillage .gp-vendor-orders* de la page Commandes vendeur
   (vendor-dashboard.css §10). Ici : uniquement les pastilles de statut. */
.gpchat-threads .gpchat-tl-status {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.gpchat-threads .gpchat-tl-status--open { color: #2f7d4f; background: #e8f3ec; border: 1px solid #cfe6d8; }
.gpchat-threads .gpchat-tl-status--closed { color: #8a5a12; background: #fdf3e3; border: 1px solid #f0e2bf; }

/* Onglets Tous / En cours / Clôturé */
.gpchat-threads__tabs {
  display: flex; flex-wrap: wrap; gap: .4rem;
  padding: 16px 24px;
  background: var(--color-background-soft, #f6f7f4);
  border-bottom: 1px solid var(--color-border, #e2e6dd);
}
.gpchat-threads__tab {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .9rem;
  background: var(--color-background, #fff);
  border: 1px solid var(--color-border, #d9ddd4);
  border-radius: 999px;
  color: var(--color-text, #45514b);
  font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.gpchat-threads__tab:hover { border-color: var(--color-primary, #2f7d4f); }
.gpchat-threads__tab.is-active {
  background: var(--color-primary, #2f7d4f);
  border-color: var(--color-primary, #2f7d4f);
  color: var(--color-text-light, #fff);
}
.gpchat-threads__tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4em; height: 1.4em; padding: 0 .35em;
  background: rgba(0, 0, 0, .08);
  border-radius: 999px;
  font-size: .78em; line-height: 1;
}
.gpchat-threads__tab.is-active .gpchat-threads__tab-count { background: rgba(255, 255, 255, .22); }

/* le mode « carte » mobile de .gp-vendor-orders__table force tr{display:block} :
   rétablir l'effet de l'attribut [hidden] posé par le filtre JS */
.gpchat-threads tr[hidden] { display: none !important; }

/* ---- Bloc « Service client » sur la page /contact ---- */
.gpchat-support { max-width: 640px; }
.gpchat-support-login-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0; }
.gpchat-support-form .form-label { font-weight: 600; }
.gpchat-support-threads { margin-top: 2rem; }
