.corpsContact {
  padding: 1rem;
  margin-top:100px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
}

/* ==================================================
   Sidebar (col-md-3)
================================================== */
.sidebarAdmin {
  background: var(--bg-alt);
  border-radius: .5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.sidebarAdmin .navigation .btn {
  width: 100%;
  background: var(--primary);
  border-color: var(--primary);
  color: var(--bg-alt);
  font-weight: 600;
  margin-bottom: 1rem;
  transition: .2s;
}
.sidebarAdmin .navigation .btn:hover {
  background: var(--primary-h);
  border-color: var(--primary-h);
}
.sidebarAdmin .nav-link {
  color: var(--text-light);
  padding: .5rem .75rem;
  border-radius: .375rem;
  transition: .2s;
}
.sidebarAdmin .nav-link:hover,
.sidebarAdmin .nav-link.active {
  background: var(--bg-hover);
  color: #fff;
}

/* ==================================================
   Contenu messages (col-md-9)
================================================== */
.adminDroit {
  background: var(--bg-alt);
  border-radius: .5rem;
  padding: 1rem;
}

/* Form actions */
@media (max-width: 767px) {
  .adminDroit form button {
    width: 100%;
    margin-bottom: .75rem;
  }
}
@media (min-width: 768px) {
  .adminDroit form button {
    display: inline-block;
    margin-right: .5rem;
    width: auto;
  }
}
.adminDroit .btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.adminDroit .btn-secondary {
  background: var(--muted);
  border-color: var(--muted);
  color: #fff;
}

/* ==================================================
   Table responsive container
================================================== */
.table-container {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: .5rem;
  overflow-x: auto;
  margin-top: .5rem;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

/* Header */
.custom-table thead {
  background: var(--bg-hover);
}
.custom-table thead th {
  padding: .75rem 1rem;
  color: var(--primary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

/* Body */
.custom-table tbody tr:nth-child(odd) {
  background: var(--bg-page);
}
.custom-table tbody tr:nth-child(even) {
  background: var(--bg-alt);
}
.custom-table tbody td {
  padding: .75rem 1rem;
  color: var(--text-light);
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.custom-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Indicateur non‑lu */
.non-lu {
  font-weight: bold;
  position: relative;
}
.non-lu td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 25%;
  width: 4px; height: 50%;
  background: var(--primary);
  border-radius: 2px;
}

/* Badges statut */
.badge-danger { background: var(--danger) !important; }
.badge-success { background: var(--success) !important; }

/* ==================================================
   Chat windows container
================================================== */
.chat-windows-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  /* la fenêtre la plus récente à droite */
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 0.5rem;
  z-index: 1100;
}

/* ==================================================
   Conteneur de chaque fenêtre
================================================== */
.chat-window {
  width: 320px;
  max-height: 500px;
  background: var(--bg-alt);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  position: relative;
}

/* Entête */
.chat-window-header {
  background: var(--bg-hover);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-light);
  font-weight: 600;
}
.chat-window-header h5 {
  margin: 0;
  font-size: 1rem;
}
.chat-window-close {
  background: none;
  border: none;
  color: var(--text-mid);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.chat-window-close:hover {
  color: var(--text-light);
}

/* Corps de la fenêtre */
.chat-window-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 0.75rem 1rem;
}

/* Zone d’affichage des messages */
.chat-content {
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}
/* Bulles de message */
.chat-content .message {
  margin: 0.25rem 0;
  padding: 0.5rem;
  border-radius: 0.375rem;
  max-width: 80%;
  line-height: 1.3;
}
.chat-content .message.incoming {
  background: var(--bg-page);
  color: var(--text-light);
  align-self: flex-start;
}
.chat-content .message.outgoing {
  background: var(--primary);
  color: #111827;
  align-self: flex-end;
}

/* Zone de saisie */
.chat-input {
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg-page);
  color: var(--text-light);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 0.5rem;
}

/* Placeholder */
.chat-input::placeholder {
  color: var(--text-mid);
  opacity: 1;
}

/* Focus */
.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-alt);
}

/* Bouton Envoyer */
.chat-send {
  align-self: flex-end;
  background: var(--primary);
  border: none;
  color: #111827;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}
.chat-send:hover {
  background: var(--primary-h);
}

/* Scrollbars personnalisées */
.chat-content::-webkit-scrollbar,
.chat-input::-webkit-scrollbar {
  width: 6px;
}
.chat-content::-webkit-scrollbar-track,
.chat-input::-webkit-scrollbar-track {
  background: var(--bg-alt);
}
.chat-content::-webkit-scrollbar-thumb,
.chat-input::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ==================================================
   Layout responsive for columns
================================================== */
/* by default both 100% */
.sidebarAdmin,
.adminDroit {
  flex: 1 1 100%;
  max-width: 100%;
}
/* desktop: 25% / 75% */
@media (min-width: 768px) {
  .sidebarAdmin {
    flex: 0 0 25%;
    max-width: 25%;
    margin-bottom: 0;
  }
  .adminDroit {
    flex: 0 0 75%;
    max-width: 75%;
  }
@media (max-width: 576px) {
  .chat-windows-container {
    bottom: 0.5rem;
    right: 0.5rem;
    gap: 0.25rem;
  }
  .chat-window {
    width: calc(100% - 1rem);
    max-height: 60vh;
  }
}
