/* ============================================================
   Messagerie (chat) client <-> admin — MadaPayExchange
   Icône flottante + fenêtre de discussion (côté client), et styles
   du panneau "Messages" côté admin. Fichier séparé pour ne toucher
   à aucun style existant dans style.css.
   ============================================================ */

#mp-chat-bubble {
  /* Même gabarit que les icônes de contact du pied de page (ex. Facebook,
     30x30) pour rester discret et cohérent avec le reste du site, au lieu
     d'un gros bouton disproportionné. */
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px) + 14px);
  bottom: max(18px, env(safe-area-inset-bottom, 0px) + 14px);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d97e, #00b869);
  border: none;
  box-shadow: 0 6px 16px rgba(0, 217, 126, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99998;
  transition: transform .15s ease;
}
#mp-chat-bubble:hover { transform: scale(1.08); }
#mp-chat-bubble svg { width: 16px; height: 16px; color: #06110c; }

#mp-chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5c5c;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #0b0f14;
}

#mp-chat-window {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px) + 14px);
  bottom: max(62px, env(safe-area-inset-bottom, 0px) + 56px);
  width: 340px;
  max-width: calc(100vw - 24px);
  height: 460px;
  max-height: calc(100vh - 130px);
  background: #121a24;
  border: 1px solid #1e2833;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: 'Inter', system-ui, sans-serif;
}
#mp-chat-window.mp-open { display: flex; }
#mp-chat-window.mp-minimized { height: auto; }
#mp-chat-window.mp-minimized #mp-chat-body,
#mp-chat-window.mp-minimized #mp-chat-input-row,
#mp-chat-window.mp-minimized #mp-chat-hint { display: none; }

#mp-chat-header {
  background: #0f151d;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e2833;
  cursor: pointer;
  flex-shrink: 0;
}
#mp-chat-header-title { display: flex; flex-direction: column; gap: 2px; }
#mp-chat-header-title .mp-t1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #e7ecef;
}
#mp-chat-header-title .mp-t2 {
  font-size: 11px;
  color: #00d97e;
  display: flex;
  align-items: center;
  gap: 5px;
}
#mp-chat-header-title .mp-t2 .mp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #00d97e;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(0,217,126,.6);
  animation: mp-pulse 1.6s infinite;
}
@keyframes mp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,217,126,.5); }
  70% { box-shadow: 0 0 0 6px rgba(0,217,126,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,217,126,0); }
}
#mp-chat-header-actions { display: flex; gap: 8px; }
#mp-chat-header-actions button {
  background: transparent;
  border: none;
  color: #7c8894;
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 6px;
}
#mp-chat-header-actions button:hover { color: #e7ecef; background: #1e2833; }
#mp-chat-header-actions svg { width: 16px; height: 16px; }

#mp-chat-hint {
  font-size: 11px;
  color: #7c8894;
  padding: 8px 14px;
  border-bottom: 1px solid #1e2833;
  flex-shrink: 0;
}

#mp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mp-msg { max-width: 78%; display: flex; flex-direction: column; gap: 4px; }
.mp-msg.mp-from-client { align-self: flex-end; align-items: flex-end; }
.mp-msg.mp-from-admin { align-self: flex-start; align-items: flex-start; }

/* Ligne contenant la bulle + les boutons (emoji, ⋮), pour pouvoir placer
   ces derniers du côté "extérieur" de la bulle selon l'expéditeur — comme
   dans Messenger, où les actions apparaissent juste à côté du message. */
.mp-msg-row { display: flex; align-items: flex-end; gap: 1px; max-width: 100%; }
.mp-msg.mp-from-client .mp-msg-row { flex-direction: row-reverse; }
.mp-msg.mp-from-admin .mp-msg-row { flex-direction: row; }

.mp-bubble {
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.42;
  color: #e7ecef;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
}
.mp-from-client .mp-bubble {
  background: linear-gradient(135deg, #00d97e, #00a862);
  color: #06110c;
  border-bottom-right-radius: 5px;
}
.mp-from-admin .mp-bubble { background: #1c2733; border-bottom-left-radius: 5px; }
.mp-bubble-deleted { font-style: italic; opacity: .7; }
.mp-from-client .mp-bubble-deleted { background: #1c2733; color: #9aa4ae; }

.mp-bubble img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin-top: 4px;
  cursor: pointer;
}

.mp-msg-time { font-size: 10px; color: #7c8894; padding: 0 2px; }
.mp-edited-tag { font-size: 10px; margin-left: 5px; font-style: italic; opacity: .65; }
.mp-from-admin .mp-edited-tag { color: rgba(231,236,239,0.6); }
.mp-deleted-label { font-size: 12px; color: #9aa4ae; }

/* Barre de réactions emoji, façon Messenger : petites pastilles rondes qui
   chevauchent le coin bas de la bulle. Admin et client peuvent chacun
   poser leur propre réaction, indépendamment l'un de l'autre. */
.mp-reaction-bar {
  display: flex;
  gap: 2px;
  margin-top: -10px;
  z-index: 2;
  position: relative;
}
.mp-msg.mp-from-client .mp-reaction-bar { align-self: flex-end; margin-right: 6px; }
.mp-msg.mp-from-admin .mp-reaction-bar { align-self: flex-start; margin-left: 6px; }
.mp-reaction-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border-radius: 999px;
  background: #1c2733;
  border: 2px solid #0f151d;
  font-size: 12px;
  line-height: 1;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.mp-reaction-pill.mp-reaction-mine { cursor: pointer; }
.mp-reaction-pill.mp-reaction-mine:active { transform: scale(0.9); }

/* Citation du message auquel on répond, affichée en haut de la bulle. */
.mp-reply-quote {
  display: block;
  border-left: 2px solid rgba(231,236,239,0.5);
  padding: 3px 7px;
  margin-bottom: 5px;
  border-radius: 4px;
  background: rgba(0,0,0,0.18);
  font-size: 11.5px;
  line-height: 1.35;
  color: rgba(231,236,239,0.75);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mp-reply-quote .mp-reply-who { display: block; font-weight: 700; color: #00d97e; font-size: 11px; }

/* Boutons d'action par message : réagir (emoji) et menu ⋮ (répondre /
   modifier / supprimer). Discrets par défaut, bien visibles au survol sur
   ordinateur ; toujours visibles (mais atténués) sur mobile/tactile, où il
   n'y a pas de survol. */
.mp-msg-menu-btn, .mp-emoji-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #7c8894;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .6;
  transition: background .12s ease, opacity .12s ease, color .12s ease;
}
.mp-msg-menu-btn:hover, .mp-emoji-btn:hover { background: #1e2833; color: #e7ecef; opacity: 1; }
.mp-msg-menu-btn svg { width: 14px; height: 14px; }
.mp-emoji-btn { font-size: 14px; }

.mp-msg { position: relative; }
.mp-msg-menu {
  position: absolute;
  top: 24px;
  z-index: 5;
  display: none;
  flex-direction: column;
  min-width: 190px;
  background: #1c2733;
  border: 1px solid #2a3946;
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.4);
  overflow: hidden;
  padding: 4px;
}
.mp-msg.mp-from-client .mp-msg-menu { right: 0; }
.mp-msg.mp-from-admin .mp-msg-menu { left: 0; }
.mp-msg-menu.mp-show { display: flex; }

/* ============================================================
   Panneau admin (#chatAdminBody) : on inverse les côtés par rapport au
   widget public ci-dessus. Dans le widget public, "soi" = le client, donc
   ses messages sont à droite. Dans le panneau admin, "soi" = l'admin : ses
   propres messages doivent donc être à droite (bulle verte), et ceux du
   client à gauche (bulle grise) — l'inverse des règles .mp-from-client /
   .mp-from-admin définies plus haut, qui restent inchangées pour le widget
   public (elles servent aussi à d'autres pages).
   ============================================================ */
#chatAdminBody .mp-msg.mp-from-admin { align-self: flex-end; align-items: flex-end; }
#chatAdminBody .mp-msg.mp-from-client { align-self: flex-start; align-items: flex-start; }

#chatAdminBody .mp-msg.mp-from-admin .mp-msg-row { flex-direction: row-reverse; }
#chatAdminBody .mp-msg.mp-from-client .mp-msg-row { flex-direction: row; }

#chatAdminBody .mp-from-admin .mp-bubble {
  background: linear-gradient(135deg, #00d97e, #00a862);
  color: #06110c;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 5px;
}
#chatAdminBody .mp-from-client .mp-bubble {
  background: #1c2733;
  color: #e7ecef;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 5px;
}
/* Un message supprimé reste gris/atténué quel qu'en soit l'auteur. */
#chatAdminBody .mp-from-admin .mp-bubble-deleted { background: #1c2733; color: #9aa4ae; }
/* Le tag "modifié" doit rester lisible sur la bulle verte (texte foncé). */
#chatAdminBody .mp-from-admin .mp-edited-tag { color: rgba(6,17,12,0.6); }

#chatAdminBody .mp-msg.mp-from-admin .mp-reaction-bar { align-self: flex-end; margin-right: 6px; margin-left: 0; }
#chatAdminBody .mp-msg.mp-from-client .mp-reaction-bar { align-self: flex-start; margin-left: 6px; margin-right: 0; }

#chatAdminBody .mp-msg.mp-from-admin .mp-msg-menu { right: 0; left: auto; }
#chatAdminBody .mp-msg.mp-from-client .mp-msg-menu { left: 0; right: auto; }
.mp-msg-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #e7ecef;
  text-align: left;
  font-size: 12.5px;
  font-family: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.mp-msg-menu button:hover { background: #263340; }
.mp-msg-menu button.mp-menu-danger { color: #ff5c5c; }
.mp-msg-menu button.mp-menu-danger:hover { background: rgba(255,92,92,0.12); }
.mp-msg-menu .mp-menu-emoji { font-size: 14px; line-height: 1; }

/* ============================================================
   Sélecteur d'emojis flottant — utilisé pour réagir à un message ET pour
   insérer un emoji dans le champ de saisie. Beaucoup d'emojis, organisés
   par catégories, avec une rangée "réactions rapides" en haut.
   ============================================================ */
.mp-emoji-picker {
  position: fixed;
  z-index: 100010;
  width: 300px;
  max-width: calc(100vw - 20px);
  max-height: 340px;
  background: #16202b;
  border: 1px solid #2a3946;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.mp-emoji-picker.mp-show { display: flex; }
.mp-emoji-quickrow {
  display: flex;
  justify-content: space-between;
  padding: 8px 8px 4px;
  flex-shrink: 0;
  border-bottom: 1px solid #1e2833;
}
.mp-emoji-quickrow button {
  background: transparent;
  border: none;
  font-size: 21px;
  line-height: 1;
  padding: 5px;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .1s ease, background .1s ease;
}
.mp-emoji-quickrow button:hover { background: #1e2833; transform: scale(1.15); }
.mp-emoji-body { overflow-y: auto; padding: 6px 8px 10px; }
.mp-emoji-cat-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #7c8894;
  padding: 8px 4px 4px;
}
.mp-emoji-cat-label:first-child { padding-top: 4px; }
.mp-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
}
.mp-emoji-grid button {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
}
.mp-emoji-grid button:hover { background: #1e2833; }
.mp-emoji-picker-close {
  display: none;
}
@media (max-width: 480px) {
  .mp-emoji-picker {
    left: 8px !important;
    right: 8px !important;
    bottom: max(10px, env(safe-area-inset-bottom, 0px) + 8px) !important;
    top: auto !important;
    width: auto;
    max-height: 46vh;
    border-radius: 18px 18px 14px 14px;
  }
  .mp-emoji-picker-close {
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #7c8894;
    background: transparent;
    border: none;
    border-top: 1px solid #1e2833;
    width: 100%;
    cursor: pointer;
    flex-shrink: 0;
  }
}

/* Bannière au-dessus du champ de saisie : "Réponse à ..." ou "Modifier le
   message", avec un bouton pour annuler. */
#mp-chat-composer-banner { display: none; padding: 0 10px; }
#mp-chat-composer-banner.mp-show { display: block; }
.mp-composer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #0f151d;
  border: 1px solid #1e2833;
  border-left: 3px solid #00d97e;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.mp-edit-banner { border-left-color: #ffb020; }
.mp-banner-text { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.mp-banner-text strong { font-size: 11.5px; color: #e7ecef; }
.mp-banner-text span {
  font-size: 11.5px;
  color: #7c8894;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.mp-composer-banner button {
  background: transparent;
  border: none;
  color: #7c8894;
  cursor: pointer;
  display: flex;
  padding: 3px;
  flex-shrink: 0;
}
.mp-composer-banner button:hover { color: #e7ecef; }
.mp-composer-banner button svg { width: 13px; height: 13px; }

#mp-chat-empty {
  margin: auto;
  text-align: center;
  color: #7c8894;
  font-size: 12px;
  padding: 20px;
}

#mp-chat-login-notice {
  margin: auto;
  text-align: center;
  padding: 24px 18px;
  color: #7c8894;
  font-size: 13px;
}
#mp-chat-login-notice a.btn {
  display: inline-block;
  margin-top: 12px;
}

#mp-chat-input-row {
  border-top: 1px solid #1e2833;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
#mp-chat-input {
  flex: 1;
  resize: none;
  max-height: 80px;
  min-height: 36px;
  background: #0f151d;
  border: 1px solid #1e2833;
  border-radius: 10px;
  color: #e7ecef;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
}
#mp-chat-input:focus { outline: none; border-color: #00d97e; }

#mp-chat-attach-btn, #mp-chat-emoji-btn, #mp-chat-send-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#mp-chat-attach-btn, #mp-chat-emoji-btn {
  background: #1c2733;
  color: #7c8894;
}
#mp-chat-attach-btn:hover, #mp-chat-emoji-btn:hover { color: #e7ecef; }
#mp-chat-send-btn {
  background: #00d97e;
  color: #06110c;
}
#mp-chat-send-btn:hover { background: #00c473; }
#mp-chat-send-btn:disabled { opacity: .5; cursor: default; }
#mp-chat-attach-btn svg, #mp-chat-send-btn svg { width: 17px; height: 17px; }

#mp-chat-preview {
  padding: 0 10px 8px;
  display: none;
}
#mp-chat-preview.mp-show { display: flex; align-items: center; gap: 8px; }
#mp-chat-preview img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 8px;
  border: 1px solid #1e2833;
}
#mp-chat-preview button {
  background: transparent; border: none; color: #ff5c5c; cursor: pointer; font-size: 12px;
}

@media (max-width: 480px) {
  #mp-chat-window {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: max(58px, env(safe-area-inset-bottom, 0px) + 52px);
  }
  #mp-chat-bubble {
    right: max(14px, env(safe-area-inset-right, 0px) + 10px);
    bottom: max(14px, env(safe-area-inset-bottom, 0px) + 10px);
  }
}

/* Variantes génériques (classe, pas id) des mêmes éléments — réutilisées
   côté panneau admin, qui a ses propres identifiants DOM. */
.mp-composer-banner-wrap { display: none; padding: 0 10px; }
.mp-composer-banner-wrap.mp-show { display: block; }

/* ============================================================
   Panneau admin — onglet "Messages"
   ============================================================ */

.chat-admin-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: 600px;
  max-height: 74vh;
}
@media (max-width: 760px) {
  .chat-admin-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 210px);
    min-height: 420px;
    max-height: none;
    position: relative;
    overflow: hidden;
  }
  /* Sur mobile, la liste et la conversation occupent chacune tout l'écran
     et on bascule de l'une à l'autre — comme dans l'appli Messenger —
     plutôt que de les empiler en scroll, illisible sur petit écran. */
  .chat-admin-layout .chat-conv-col,
  .chat-admin-layout .chat-admin-panel {
    position: absolute;
    inset: 0;
    transition: transform .22s ease;
  }
  .chat-admin-layout .chat-admin-panel { transform: translateX(100%); }
  .chat-admin-layout.mp-chat-open .chat-conv-col { transform: translateX(-100%); }
  .chat-admin-layout.mp-chat-open .chat-admin-panel { transform: translateX(0); }
  #chatAdminBackBtn { display: flex !important; }
}

.chat-conv-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-conv-col #chatClientSearch {
  flex-shrink: 0;
}
.chat-conv-list {
  background: transparent;
  border: 1px solid #1e2833;
  border-radius: 14px;
  overflow-y: auto;
  padding: 6px;
  flex: 1;
  min-height: 0;
}
.chat-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  animation: mpConvItemIn 0.28s ease both;
}
.chat-conv-item:hover { background: rgba(255, 255, 255, 0.05); transform: translateX(1px); }
.chat-conv-item.active { background: rgba(0, 217, 126, 0.1); border: 1px solid #00d97e; }
.chat-conv-item.active { padding: 8px 9px; }
.chat-conv-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-conv-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.chat-conv-name { font-weight: 600; font-size: 13px; color: #e7ecef; }
.chat-conv-preview {
  font-size: 12px;
  color: #7c8894;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes mpConvItemIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-conv-unread {
  background: transparent;
  background-image: linear-gradient(135deg, #00d97e, #00b368);
  color: #06251a;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(0, 217, 126, 0.55);
  animation: mpUnreadPop 0.3s ease, mpUnreadPulse 2s ease-in-out infinite 0.3s;
}
@keyframes mpUnreadPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes mpUnreadPulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(0, 217, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 217, 126, 0); }
}

/* Avatar rond avec initiales, façon Messenger — utilisé dans la liste des
   conversations et dans l'en-tête du panneau de discussion. La couleur est
   dérivée du nom pour que chaque client garde toujours la même teinte. */
.mp-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #06110c;
  font-family: 'Space Grotesk', sans-serif;
}
.mp-avatar.mp-avatar-sm { width: 30px; height: 30px; font-size: 12px; }

.chat-admin-panel {
  background: #0f151d;
  border: 1px solid #1e2833;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-admin-panel-header {
  padding: 10px 16px;
  border-bottom: 1px solid #1e2833;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.chat-admin-panel-header .hint { font-weight: 400; }
.chat-admin-panel-header-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chat-admin-panel-header-text .hint { font-size: 11.5px; }
#chatAdminBackBtn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #e7ecef;
  cursor: pointer;
  flex-shrink: 0;
}
#chatAdminBackBtn:hover { background: #1e2833; }
#chatAdminBackBtn svg { width: 18px; height: 18px; }
.chat-admin-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 15% 8%, rgba(0,217,126,0.05), transparent 45%),
    #0f151d;
}
.chat-admin-input-row {
  border-top: 1px solid #1e2833;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.chat-admin-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  background: #121a24;
  border: 1px solid #1e2833;
  border-radius: 10px;
  color: #e7ecef;
  padding: 9px 11px;
  font-family: inherit;
  font-size: 13px;
}
.chat-admin-input-row textarea:focus { outline: none; border-color: #00d97e; }
.chat-admin-input-row textarea {
  transition: border-color .15s ease;
  line-height: 1.4;
}
/* Les boutons héritent de .btn (width:100%, margin-top:24px), ce qui
   déformait la ligne de saisie ; on neutralise ça ici pour que le champ
   de texte, le trombone et "Envoyer" s'alignent proprement. */
.chat-admin-input-row .btn {
  width: auto;
  margin-top: 0;
  flex-shrink: 0;
}
.chat-admin-input-row #chatAdminAttachBtn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-admin-input-row #chatAdminAttachBtn svg { width: 16px; height: 16px; }
.chat-admin-input-row #chatAdminSendBtn {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-admin-input-row #chatAdminSendBtn svg { width: 15px; height: 15px; }

/* ============================================================
   Visionneuse d'image plein écran (lightbox) — widget client.
   Permet de bien voir une image déjà envoyée/reçue dans le chat,
   puis de revenir directement à la conversation en la fermant.
   Même esprit visuel que la modale d'images du panneau admin.
   ============================================================ */

#mp-img-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
#mp-img-modal.mp-open { display: flex; }
#mp-img-modal img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  cursor: default;
}
#mp-img-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}
#mp-img-modal-hint {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  text-align: center;
  color: #9aa4ae;
  font-size: 12px;
  font-family: 'Inter', system-ui, sans-serif;
}
