#adminModal .modal-content {
  max-width: 1200px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal Co-propriétaires */
#coOwnerModal .modal-content {
  max-width: 480px;
  max-height: 80vh;
  margin: 10vh auto;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
}

#coOwnerModal .co-owners-list {
  flex: 1;
  overflow-y: auto;
  max-height: 40vh;
  margin-top: 1rem;
  padding: 0 4px;
}

/* Modal Developer Profile - Design moderne compact */
#developerProfileModal .modal-content {
  max-width: 380px;
  width: 92%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border-radius: 20px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: devProfileSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes devProfileSlideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

#developerProfileModal .profile-modal {
  border-radius: 20px;
  overflow: hidden;
}

#developerProfileModal .profile-modal-header {
  background: linear-gradient(165deg, rgba(30, 30, 50, 0.98), rgba(20, 20, 40, 0.99));
  padding: 20px 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

#developerProfileModal .profile-modal-header::before {
  display: none;
}

#developerProfileModal .profile-photo-container {
  position: relative;
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  z-index: 1;
}

#developerProfileModal .profile-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

#developerProfileModal .profile-photo-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.3);
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

#developerProfileModal .profile-modal-name {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  position: relative;
  z-index: 1;
}

#developerProfileModal .profile-modal-title {
  color: #818cf8;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
  position: relative;
  z-index: 1;
  letter-spacing: 0.3px;
}

#developerProfileModal .profile-modal-body {
  padding: 16px;
  background: linear-gradient(165deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 30, 0.99));
}

#developerProfileModal .profile-info-list {
  gap: 10px;
}

#developerProfileModal .profile-info-item {
  padding: 10px 12px;
  gap: 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 10px;
}

#developerProfileModal .profile-info-item:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateX(3px);
}

#developerProfileModal .profile-info-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 14px;
}

#developerProfileModal .profile-info-label {
  font-size: 10px;
  margin-bottom: 2px;
  opacity: 0.7;
}

#developerProfileModal .profile-info-value {
  font-size: 13px;
}

#developerProfileModal .profile-info-value a {
  color: #818cf8;
  text-decoration: none;
  transition: color 0.2s;
}

#developerProfileModal .profile-info-value a:hover {
  color: #a5b4fc;
}

#developerProfileModal .profile-modal-footer {
  padding: 12px 16px;
  background: rgba(15, 15, 30, 0.6);
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  text-align: center;
}

#developerProfileModal .profile-modal-footer p {
  color: rgba(148, 163, 184, 0.6);
  font-size: 11px;
  margin: 0;
  font-style: normal;
}

#developerProfileModal .close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

#developerProfileModal .close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.05);
}

.modal-active,
.modal-visible { 
  display: block !important; 
  visibility: visible !important;
  opacity: 1 !important;
}

.modal-inactive,
.modal-hidden { 
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: block !important;
  opacity: 1;
}

.modal-content {
  background: linear-gradient(165deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 30, 0.99));
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  margin: 4vh auto;
  padding: 0;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  width: 90%;
  max-width: 900px;
  max-height: 92vh;
  position: relative;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 100px rgba(99, 102, 241, 0.1);
  overflow-y: auto;
  overflow-x: hidden;
  animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar stylisée pour modales */
.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: rgba(15, 15, 30, 0.5);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.6);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===============================================
   MODAL ALL CARDS - Édition de cartes
   =============================================== */
#allCardsModal .modal-content {
  max-width: 700px;
}

/* Conteneur boutons création */
#allCardsModal .add-card-btn,
#allCardsModal .bulk-cards-btn {
  margin: 0 0 0 0;
}

#allCardsModal .modal-header + .add-card-btn {
  margin: 16px 20px 0 20px;
}

#allCardsModal .add-card-btn + .bulk-cards-btn {
  margin: 8px 20px 16px 20px;
}

/* Images dans les cartes - dimensions adaptatives */
#allCardsContent img {
  max-width: 100%;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}

#allCardsContent .card-info img {
  max-height: 120px;
}

/* Modales avec TinyMCE (ajout/édition carte) */
#addCardModal .modal-content,
#editCardModal .modal-content {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

/* TinyMCE dropdowns - doit être au-dessus des modales */
.tox-tinymce-aux {
  z-index: 100000 !important;
}

.tox-menu {
  z-index: 100001 !important;
}

.tox-dialog-wrap {
  z-index: 100002 !important;
}

#addCardModal h2,
#editCardModal h2 {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.99), rgba(20, 20, 40, 0.99));
  padding: 14px 20px;
  margin: 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 1.15rem;
  color: #fff;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#addCardModal form,
#editCardModal form {
  padding: 8px 20px 16px;
}

/* Cacher les labels "Texte avant" et "Texte arrière" */
#addCardModal label,
#editCardModal label {
  display: none;
}

/* Cacher le path dans la statusbar TinyMCE */
.tox-statusbar__path-item {
  display: none !important;
}

/* Wordcount à droite */
.tox-statusbar__wordcount {
  margin-left: auto !important;
}

/* Cacher le branding TinyMCE */
.tox-statusbar__branding {
  display: none !important;
}

/* Nom du groupe dans le titre modal */
.modal-group-name {
  margin-left: 8px;
  font-weight: normal;
  opacity: 0.8;
}

#addCardModal form > div,
#editCardModal form > div {
  margin-bottom: -22px;
}

/* Cacher le sélecteur de groupe - inutile car groupe déjà choisi */
#editCardModal form > div:has(#editCardGroup) {
  display: none;
}

#addCardModal button[type="submit"],
#editCardModal button[type="submit"] {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 2px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#addCardModal button[type="submit"]:hover,
#editCardModal button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

#addCardModal .close,
#editCardModal .close {
  position: sticky;
  top: 12px;
  float: right;
  margin-top: -46px;
  margin-right: 14px;
  margin-bottom: 0;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  transition: all 0.2s ease;
}

#addCardModal .close:hover,
#editCardModal .close:hover {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

.modal-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  padding: 24px 28px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header h2 i {
  color: #818cf8;
}

.modal-content > div:not(.modal-header) {
  padding: 24px 28px;
}

/* Modales simples sans .modal-header - padding direct */
.modal-content > h2 {
  margin: 0 0 20px 0;
  padding: 24px 28px 0 28px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

.modal-content > form {
  padding: 0 28px 28px 28px;
}

.modal-content > form > div {
  margin-bottom: 18px;
}

.modal-content > input,
.modal-content > button,
.modal-content > .error-message {
  margin-left: 28px;
  margin-right: 28px;
}

.modal-content > input {
  width: calc(100% - 56px);
  margin-bottom: 16px;
}

.modal-content > button:not(.close) {
  width: calc(100% - 56px);
  margin-bottom: 28px;
}

/* Close button modernisé */
.close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  color: #f87171;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: auto;
}

.close:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.9);
  color: white;
  transform: scale(1.05);
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-content label {
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 8px;
  display: block;
  font-size: 0.9rem;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"],
.modal-content select,
.modal-content textarea,
.editable-field {
  width: 100%;
  padding: 14px 18px;
  background: rgba(15, 15, 30, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  color: #fff;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus,
.editable-field:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.1);
  background: rgba(99, 102, 241, 0.08);
}

.modal-content textarea {
  min-height: 120px;
  resize: vertical;
}

.modal-content button[type="submit"] {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 16px 28px;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 8px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.modal-content button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
}

#adminModal .modal-content {
  position: relative;
  margin: 4vh auto;
  max-width: 1200px;
  width: 95%;
  max-height: 92vh;
}

/* Password modal doit être au-dessus du chat (qui a z-index: 100001) */
#passwordModal {
  z-index: 200000 !important;
}

/* Modales centrées (confirmation, password, etc.) */
#addDirectoryModal .modal-content,
#editGroupModal .modal-content,
#deleteGroupConfirmModal .modal-content,
#deleteConfirmModal .modal-content,
#passwordModal .modal-content,
#addGroupModal .modal-content,
#userLogsModal .modal-content {
  z-index: 200001 !important;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  background: linear-gradient(165deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 30, 0.99)) !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
  max-width: 480px !important;
  width: 90% !important;
  border-radius: 20px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
}

.modal:not(#adminModal) {
  background: rgba(0, 0, 0, 0.75) !important;
}

.modal[style*="display: block"] {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ================================================
   MODALES SIMPLES (sans .modal-header)
   addDirectoryModal, passwordModal, etc.
   ================================================ */

#addDirectoryModal h2,
#passwordModal h2,
#addGroupModal h2,
#editGroupModal h2,
#groupVisibilityModal h2,
#removeGroupConfirmModal h2 {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
  padding: 22px 28px;
  margin: 0;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  font-size: 1.3rem;
  color: #fff;
  font-weight: 700;
  border-radius: 20px 20px 0 0;
}

#addDirectoryModal form,
#passwordModal form,
#addGroupModal form,
#editGroupModal form {
  padding: 24px 28px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

#addDirectoryModal label,
#passwordModal label,
#addGroupModal label,
#editGroupModal label {
  display: block;
  margin-bottom: 10px;
  color: rgba(148, 163, 184, 0.9);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Spécifique checkbox-row dans addGroupModal */
#addGroupModal .checkbox-row {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#addGroupModal .checkbox-row label {
  display: inline;
  margin-bottom: 0;
  font-weight: 500;
}

#addDirectoryModal input,
#passwordModal input,
#addGroupModal input:not([type="checkbox"]),
#editGroupModal input,
#addDirectoryModal select,
#addGroupModal select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 15, 30, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

#addDirectoryModal input:focus,
#passwordModal input:focus,
#addGroupModal input:focus,
#editGroupModal input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: rgba(99, 102, 241, 0.08);
}

#addDirectoryModal button[type="submit"],
#passwordModal button[type="submit"],
#addGroupModal button[type="submit"],
#editGroupModal button[type="submit"] {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 16px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

#addDirectoryModal button[type="submit"]:hover,
#passwordModal button[type="submit"]:hover,
#addGroupModal button[type="submit"]:hover,
#editGroupModal button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

/* Close buttons pour modales simples */
#addDirectoryModal .close,
#passwordModal .close,
#addGroupModal .close,
#editGroupModal .close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s ease;
}

#addDirectoryModal .close:hover,
#passwordModal .close:hover,
#addGroupModal .close:hover,
#editGroupModal .close:hover {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}

/* Styles pour #passwordModal */
#passwordModal .modal-content {
  padding: 0 !important;
}

#passwordModal input,
#passwordModal button,
#passwordModal .error-message {
  margin-left: 28px;
  margin-right: 28px;
  width: calc(100% - 56px) !important;
}

#passwordModal input {
  margin-top: 24px;
}

#passwordModal button {
  margin-bottom: 24px;
}

#passwordModal .error-message {
  margin-bottom: 20px;
}

/* Styles pour #removeGroupConfirmModal */
#removeGroupConfirmModal .modal-content {
  padding: 0 !important;
  width: 450px !important;
  max-width: 90vw !important;
  margin-top: 30vh !important;
}

#removeGroupConfirmModal p {
  padding: 20px 28px;
  color: rgba(148, 163, 184, 0.9);
  line-height: 1.6;
  margin: 0;
}

#removeGroupConfirmModal .buttons {
  padding: 0 28px 24px;
  display: flex;
  gap: 12px;
}

#removeGroupConfirmModal button {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

#removeGroupConfirmModal #el_auto_remove_yes {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

#removeGroupConfirmModal #el_auto_remove_no {
  background: rgba(30, 30, 50, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: rgba(148, 163, 184, 0.9);
}

#changeNameModal .modal-content {
  max-width: 420px;
  width: 90%;
  padding: 0;
}

#sidebarOverlay,
.sidebar-overlay,
.modal-overlay {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -9999 !important;
  opacity: 0 !important;
}

#coOwnerModal .modal-content {
  max-width: 500px;
}

.modal-subtitle {
  color: rgba(148, 163, 184, 0.8);
  font-size: 14px;
  margin: 12px 0 24px;
  line-height: 1.5;
}

.modal-buttons {
  display: flex;
  gap: 14px;
  margin-top: 28px;
}

.modal-buttons .btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal-buttons .btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.modal-buttons .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.modal-buttons .btn-secondary {
  background: rgba(30, 30, 50, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: rgba(148, 163, 184, 0.9);
}

.modal-buttons .btn-secondary:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.modal-buttons .btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.modal-buttons .btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

#addToDirectoryModal .modal-content {
    max-width: 480px;
}

.profile-modal-header {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-modal-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

.profile-modal-name {
  color: white;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.profile-modal-title {
  color: rgba(255, 255, 255, 0.95);
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  position: relative;
  z-index: 1;
}

.profile-modal-body {
  padding: 28px;
  background: linear-gradient(165deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 30, 0.99));
}

.profile-modal-footer {
  padding: 20px 28px;
  background: rgba(15, 15, 30, 0.8);
  border-top: 1px solid rgba(99, 102, 241, 0.15);
  text-align: center;
}

.profile-modal-footer p {
  color: rgba(148, 163, 184, 0.7);
  font-size: 13px;
  margin: 0;
  font-style: italic;
}

/* Login/Register modals */
#loginModal .modal-content,
#registerModal .modal-content {
  max-width: 440px;
  padding: 0;
  max-height: none;
  overflow: visible;
  border-radius: 24px;
}

#loginModal .modal-content > div:not(.modal-header),
#registerModal .modal-content > div:not(.modal-header) {
  padding: 0;
}

#loginModal.show .modal-content,
#registerModal.show .modal-content {
  animation: authModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modales de confirmation suppression */
#deleteConfirmModal,
#deleteGroupConfirmModal {
  z-index: 10010 !important;
}

#deleteConfirmModal .modal-content,
#deleteGroupConfirmModal .modal-content {
  z-index: 10011 !important;
  max-width: 420px !important;
  padding: 0 !important;
  text-align: center;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
}

#deleteConfirmModal h2,
#deleteGroupConfirmModal h2 {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.08));
  padding: 20px 24px;
  margin: 0;
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 1.2rem;
  color: #f87171;
  font-weight: 700;
  border-radius: 20px 20px 0 0;
}

#deleteConfirmModal p,
#deleteGroupConfirmModal p {
  padding: 20px 24px;
  margin: 0;
  color: rgba(148, 163, 184, 0.9);
  line-height: 1.6;
}

#deleteConfirmModal .buttons,
#deleteGroupConfirmModal .buttons {
  padding: 0 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

#deleteConfirmModal .buttons button,
#deleteGroupConfirmModal .buttons button {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

#deleteConfirmModal .buttons button:first-child,
#deleteGroupConfirmModal .buttons button:first-child {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

#deleteConfirmModal .buttons button:first-child:hover,
#deleteGroupConfirmModal .buttons button:first-child:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
}

#deleteConfirmModal .buttons button:last-child,
#deleteGroupConfirmModal .buttons button:last-child {
  background: rgba(100, 116, 139, 0.2);
  color: rgba(148, 163, 184, 0.9);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

#deleteConfirmModal .buttons button:last-child:hover,
#deleteGroupConfirmModal .buttons button:last-child:hover {
  background: rgba(100, 116, 139, 0.3);
}

.modal-content.modal-large {
  max-width: 1200px;
  width: 95%;
}

/* Close button admin */
#adminModal .modal-content .close {
  position: absolute !important;
  right: 16px !important;
  top: 16px !important;
  width: 44px !important;
  height: 44px !important;
  cursor: pointer !important;
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  border-radius: 12px !important;
  color: #f87171 !important;
  font-size: 1.4rem !important;
  z-index: 99999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}

#adminModal .modal-content .close:hover {
  background: rgba(239, 68, 68, 0.9) !important;
  color: white !important;
}

#userLogsModal .modal-content {
  max-width: 600px;
  max-height: 75vh;
  overflow-y: auto;
  padding: 0;
  border-radius: 20px;
}

/* ================================================
   MODALES D'AUTHENTIFICATION (Login / Register)
   ================================================ */

/* Animation d'entrée */
@keyframes authModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Container de la modale auth */
.auth-modal {
    max-width: 440px !important;
    padding: 0 !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    max-height: 90vh !important;
    background: linear-gradient(165deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 30, 0.99)) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    display: flex;
    flex-direction: column;
    box-shadow: 
      0 25px 80px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(255, 255, 255, 0.05) inset !important;
}

/* Header de la modale */
.auth-modal-header {
    text-align: center;
    padding: 24px 28px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    flex-shrink: 0;
}

.auth-modal-header .auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.35);
}

.auth-modal-header .auth-icon i {
    font-size: 26px;
    color: #fff;
}

.auth-modal-header h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
}

.auth-modal-header .auth-subtitle {
    margin: 0;
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.9rem;
}

/* Formulaire */
.auth-form {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 180px);
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(148, 163, 184, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-form .form-group label i {
    margin-right: 8px;
    color: #818cf8;
}

.auth-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 15, 30, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.auth-form .form-group input::placeholder {
    color: rgba(100, 116, 139, 0.8);
}

.auth-form .form-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.08);
}

/* Bouton submit */
.btn-auth-submit {
    width: 100%;
    padding: 16px 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-auth-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-auth-submit:active {
    transform: translateY(-1px);
}

/* Footer de la modale */
.auth-footer {
    text-align: center;
    padding: 16px 28px 20px;
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    background: rgba(15, 15, 30, 0.5);
    flex-shrink: 0;
}

.auth-footer p {
    margin: 0;
    color: rgba(148, 163, 184, 0.8);
    font-size: 0.9rem;
}

.auth-footer a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: #a78bfa;
    text-decoration: underline;
}

/* Bouton fermer pour modales auth */
#loginModal .close,
#registerModal .close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #f87171;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#loginModal .close:hover,
#registerModal .close:hover {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

/* États d'affichage des modales auth */
#loginModal,
#registerModal {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#loginModal.display-block,
#registerModal.display-block {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#loginModal.show,
#registerModal.show {
    opacity: 1 !important;
}

#loginModal.display-none,
#registerModal.display-none {
    display: none !important;
    opacity: 0 !important;
}

/* Animation d'entrée pour le contenu */
#loginModal.show .auth-modal,
#registerModal.show .auth-modal {
    animation: authModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation de sortie */
#loginModal:not(.show) .auth-modal,
#registerModal:not(.show) .auth-modal {
    animation: none;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.25s ease;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .auth-modal {
        max-width: 95% !important;
        margin: 10px;
        max-height: 85vh !important;
    }
    
    .auth-modal-header {
        padding: 15px 20px 12px;
    }
    
    .auth-modal-header .auth-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }
    
    .auth-modal-header .auth-icon i {
        font-size: 20px;
    }
    
    .auth-modal-header h2 {
        font-size: 1.2rem;
    }
    
    .auth-modal-header .auth-subtitle {
        font-size: 0.85rem;
    }
    
    .auth-form {
        padding: 18px;
        max-height: calc(85vh - 160px);
    }
    
    .auth-form .form-group {
        margin-bottom: 14px;
    }
    
    .auth-form .form-group input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .auth-footer {
        padding: 12px 18px 15px;
    }
}

/* Lien mot de passe oublié */
.forgot-password-link {
    text-align: right;
    margin: -5px 0 15px 0;
}

.forgot-password-link a {
    color: var(--accent-color, #667eea);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
}

.forgot-password-link a:hover {
    color: var(--accent-hover, #764ba2);
    text-decoration: underline;
}

.forgot-password-link a i {
    margin-right: 5px;
}

/* Messages dans les modales auth */
.auth-message {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-align: center;
}

.auth-message.success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #2ecc71;
}

.auth-message.error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
}


/* Password visibility toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input {
    flex: 1;
    padding-right: 40px;
}
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.2s;
    z-index: 2;
}
.password-toggle:hover {
    color: rgba(255,255,255,0.8);
}
