/* =========================================================
 * AFF CHAT - DESIGN MODERNE
 * ========================================================= */

.aff-space {
  max-width: 980px;
  margin: 40px auto;
  padding: 0 var(--aff-space-md);
}

.aff-space h2 {
  font-size: var(--aff-font-size-3xl);
  font-weight: var(--aff-font-weight-bold);
  background: var(--aff-gradient-warm);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--aff-space-md);
}

.aff-space-header {
  margin-bottom: var(--aff-space-lg);
}

.aff-muted {
  color: var(--aff-gray-600);
}

/* Grid pour liste de demandes */
.aff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--aff-space-md);
  margin-bottom: var(--aff-space-lg);
}

/* Cards */
.aff-card {
  background: white;
  border: 1px solid var(--aff-gray-200);
  border-radius: var(--aff-radius-lg);
  padding: var(--aff-space-lg);
  box-shadow: var(--aff-shadow-sm);
  transition: all 0.2s ease;
}

.aff-card:hover {
  box-shadow: var(--aff-shadow-md);
  transform: translateY(-2px);
}

.aff-card h3 {
  font-size: var(--aff-font-size-xl);
  font-weight: var(--aff-font-weight-semibold);
  color: var(--aff-gray-900);
  margin: 0 0 var(--aff-space-sm) 0;
}

.aff-card h4 {
  font-size: var(--aff-font-size-lg);
  font-weight: var(--aff-font-weight-semibold);
  color: var(--aff-gray-900);
  margin: 0 0 var(--aff-space-md) 0;
}

/* Badges */
.aff-badges {
  display: flex;
  gap: var(--aff-space-sm);
  flex-wrap: wrap;
  margin: var(--aff-space-sm) 0;
}

.aff-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--aff-space-xs);
  padding: 4px 12px;
  border-radius: var(--aff-radius-full);
  font-size: var(--aff-font-size-sm);
  font-weight: var(--aff-font-weight-medium);
  background: var(--aff-gray-100);
  color: var(--aff-gray-700);
  border: 1px solid var(--aff-gray-200);
}

.aff-badge-soft {
  background: white;
}

/* Boutons */
.aff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--aff-space-xs);
  padding: 10px 20px;
  border-radius: var(--aff-radius-md);
  background: var(--aff-gradient-warm);
  color: white;
  text-decoration: none;
  font-weight: var(--aff-font-weight-medium);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--aff-shadow-warm);
}

.aff-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--aff-shadow-warm-lg);
}

/* Vue demande */
.aff-demande-view {
  max-width: 900px;
  margin: 0 auto;
}

.aff-demande-view h3 {
  font-size: var(--aff-font-size-2xl);
  font-weight: var(--aff-font-weight-bold);
  color: var(--aff-gray-900);
  margin-bottom: var(--aff-space-md);
}

/* Contenu demande */
.aff-demand-content {
  background: var(--aff-gray-50);
  border: 1px solid var(--aff-gray-200);
  padding: var(--aff-space-md);
  border-radius: var(--aff-radius-lg);
  margin-top: var(--aff-space-md);
  line-height: var(--aff-line-height-relaxed);
}

/* Notifications email */
.aff-email-notify {
  background: linear-gradient(135deg, rgba(240, 103, 53, 0.05), rgba(240, 161, 55, 0.05));
  border: 1px solid rgba(240, 103, 53, 0.2);
  padding: var(--aff-space-md);
  border-radius: var(--aff-radius-lg);
  margin: var(--aff-space-md) 0;
}

.aff-email-notify label {
  font-weight: var(--aff-font-weight-semibold);
  color: var(--aff-gray-900);
  margin-bottom: var(--aff-space-sm);
}

.aff-email-notify input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--aff-primary);
}

.aff_email_notify_status {
  font-size: var(--aff-font-size-sm);
  color: var(--aff-gray-600);
}

/* Thread de messages (accordéon) */
.aff-thread {
  background: var(--aff-gray-50);
  border: 1px solid var(--aff-gray-200);
  border-radius: var(--aff-radius-lg);
  overflow: hidden;
}

.aff-msg {
  padding: 12px 16px;
  border-bottom: 1px solid var(--aff-gray-200);
  transition: background 0.2s ease;
}

.aff-msg:last-child {
  border-bottom: none;
}

.aff-msg:hover {
  background: rgba(255, 255, 255, 0.6);
}

/* Message header with avatar */
.aff-msg-author {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.aff-msg-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--aff-gradient-warm);
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.aff-msg-meta-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.aff-msg-meta-info strong {
  font-size: 13px;
  color: var(--aff-gray-900);
  line-height: 1.3;
}

.aff-msg-date {
  font-size: 11px;
  color: var(--aff-gray-500);
  line-height: 1.3;
}

/* Preview (visible when collapsed) */
.aff-msg-preview {
  margin-top: 8px;
  font-size: 13px;
  color: var(--aff-gray-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Full content (hidden when collapsed) */
.aff-thread .aff-msg .aff-msg-full {
  display: none !important;
  margin-top: 10px;
}

/* Expanded state */
.aff-thread .aff-msg.aff-msg-expanded .aff-msg-preview {
  display: none !important;
}

.aff-thread .aff-msg.aff-msg-expanded .aff-msg-full {
  display: block !important;
}

.aff-msg-expanded {
  background: white;
}

/* Toggle button */
.aff-msg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--aff-primary, #f06735);
  transition: color 0.2s ease;
}

.aff-msg-toggle:hover {
  color: var(--aff-primary-dark, #d4562a);
  text-decoration: underline;
}

/* Full content styling */
.aff-msg .aff-msg-content {
  background: white;
  border: 1px solid var(--aff-gray-200);
  padding: var(--aff-space-md);
  border-radius: var(--aff-radius-md);
  line-height: var(--aff-line-height-relaxed);
  color: var(--aff-gray-700);
}

.aff-msg-meta {
  color: var(--aff-gray-600);
  font-size: var(--aff-font-size-sm);
  margin-bottom: var(--aff-space-xs);
  font-weight: var(--aff-font-weight-medium);
}

.aff-msg-body {
  background: white;
  border: 1px solid var(--aff-gray-200);
  padding: var(--aff-space-md);
  border-radius: var(--aff-radius-md);
  line-height: var(--aff-line-height-relaxed);
  color: var(--aff-gray-700);
}

.aff-msg.me .aff-msg-body {
  background: linear-gradient(135deg, rgba(240, 103, 53, 0.08), rgba(240, 161, 55, 0.08));
  border-color: rgba(240, 103, 53, 0.2);
}

.aff-msg.them .aff-msg-body {
  background: white;
}

/* Formulaire de réponse */
.aff-demande-view form {
  margin-top: var(--aff-space-md);
}

.aff-demande-view textarea {
  width: 100%;
  max-width: 100%;
  min-height: 120px;
  padding: var(--aff-space-md);
  border: 1px solid var(--aff-gray-300);
  border-radius: var(--aff-radius-md);
  font-family: inherit;
  font-size: var(--aff-font-size-base);
  line-height: var(--aff-line-height-relaxed);
  resize: vertical;
  transition: all 0.2s ease;
}

.aff-demande-view textarea:focus {
  outline: none;
  border-color: var(--aff-primary);
  box-shadow: 0 0 0 3px rgba(240, 103, 53, 0.1);
}

.aff-demande-view input[type="file"] {
  display: block;
  width: 100%;
  padding: var(--aff-space-sm);
  border: 2px dashed var(--aff-gray-300);
  border-radius: var(--aff-radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.aff-demande-view input[type="file"]:hover {
  border-color: var(--aff-primary);
  background: rgba(240, 103, 53, 0.02);
}

.aff-demande-view label {
  display: block;
  font-weight: var(--aff-font-weight-medium);
  color: var(--aff-gray-700);
  margin-bottom: var(--aff-space-xs);
}

/* Résultats */
.aff-result {
  margin-top: var(--aff-space-md);
  padding: var(--aff-space-md);
  border-radius: var(--aff-radius-md);
  font-weight: var(--aff-font-weight-medium);
  animation: slideDown 0.3s ease;
}

.aff-result.ok {
  background: var(--aff-success-bg);
  border: 1px solid var(--aff-success-border);
  color: var(--aff-success-text);
}

.aff-result.err {
  background: var(--aff-error-bg);
  border: 1px solid var(--aff-error-border);
  color: var(--aff-error-text);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .aff-space {
    margin: var(--aff-space-lg) auto;
    padding: 0 var(--aff-space-sm);
  }

  .aff-grid {
    grid-template-columns: 1fr;
  }

  .aff-msg {
    padding: 10px 12px;
  }

  .aff-msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .aff-msg-toggle {
    font-size: 13px;
    padding: 6px 0;
  }
}

/* =========================================================
 * AUDIO MESSAGES - STYLES
 * ========================================================= */

/* Audio Recorder Container */
.aff-audio-recorder {
  background: linear-gradient(135deg, rgba(240, 103, 53, 0.03), rgba(240, 161, 55, 0.03));
  border: 1px solid rgba(240, 103, 53, 0.15);
  border-radius: var(--aff-radius-lg);
  padding: var(--aff-space-md);
}

/* Record Button */
.aff-audio-record-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--aff-space-sm);
  transition: all 0.2s ease;
}

.aff-audio-record-btn:hover {
  background: rgba(240, 103, 53, 0.1);
}

.aff-audio-record-icon {
  font-size: 1.2em;
}

/* Recording State */
.aff-audio-recording {
  padding: var(--aff-space-md);
}

.aff-audio-recording-indicator {
  display: flex;
  align-items: center;
  gap: var(--aff-space-md);
  margin-bottom: var(--aff-space-md);
  padding: var(--aff-space-sm) var(--aff-space-md);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--aff-radius-md);
}

.aff-recording-dot {
  width: 12px;
  height: 12px;
  background: #EF4444;
  border-radius: 50%;
  animation: pulse-recording 1s ease-in-out infinite;
}

@keyframes pulse-recording {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.aff-recording-text {
  color: #EF4444;
  font-weight: var(--aff-font-weight-medium);
  flex: 1;
}

.aff-recording-time {
  font-family: monospace;
  font-size: var(--aff-font-size-lg);
  color: #EF4444;
  font-weight: var(--aff-font-weight-bold);
}

.aff-audio-recording-controls {
  display: flex;
  gap: var(--aff-space-sm);
}

/* Button Danger Style */
.aff-btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626) !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.aff-btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Preview State */
.aff-audio-preview {
  padding: var(--aff-space-md);
}

.aff-audio-preview audio {
  width: 100%;
  margin-bottom: var(--aff-space-md);
}

.aff-audio-preview-controls {
  display: flex;
  gap: var(--aff-space-sm);
  justify-content: flex-end;
}

/* Audio Player in Messages */
.aff-audio-message {
  display: flex;
  align-items: center;
  gap: var(--aff-space-md);
  padding: var(--aff-space-sm);
  background: linear-gradient(135deg, rgba(240, 103, 53, 0.08), rgba(240, 161, 55, 0.08));
  border-radius: var(--aff-radius-md);
  margin-bottom: var(--aff-space-sm);
}

.aff-audio-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.aff-audio-player {
  flex: 1;
  height: 40px;
  border-radius: var(--aff-radius-sm);
}

/* Custom audio player styling */
.aff-audio-player::-webkit-media-controls-panel {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.95));
}

.aff-audio-player::-webkit-media-controls-play-button {
  background-color: var(--aff-primary);
  border-radius: 50%;
}

/* Ghost Button Style */
.aff-btn-ghost {
  background: transparent;
  color: var(--aff-gray-700);
  border: 1px solid var(--aff-gray-300);
  box-shadow: none;
}

.aff-btn-ghost:hover {
  background: var(--aff-gray-100);
  box-shadow: none;
  transform: none;
}

/* Responsive Audio */
@media (max-width: 768px) {

  .aff-audio-recording-controls,
  .aff-audio-preview-controls {
    flex-direction: column;
  }

  .aff-audio-message {
    flex-direction: column;
    align-items: flex-start;
  }

  .aff-audio-player {
    width: 100%;
  }
}

/* =========================================================
 * MICROPHONE ERROR & HELP
 * ========================================================= */

/* Error Container */
.aff-audio-error {
  margin-top: var(--aff-space-md);
  padding: var(--aff-space-md);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--aff-radius-md);
  color: #991B1B;
}

.aff-audio-error .aff-error-header {
  margin-bottom: var(--aff-space-sm);
}

.aff-audio-error p {
  margin: 0 0 var(--aff-space-md) 0;
  font-size: var(--aff-font-size-sm);
}

/* Small Button */
.aff-btn-sm {
  padding: 6px 12px;
  font-size: var(--aff-font-size-sm);
}

/* Help Modal */
.aff-help-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: var(--aff-space-md);
}

.aff-help-modal-content {
  background: white;
  border-radius: var(--aff-radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--aff-shadow-lg);
}

.aff-help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--aff-space-md) var(--aff-space-lg);
  border-bottom: 1px solid var(--aff-gray-200);
}

.aff-help-modal-header h3 {
  margin: 0;
  font-size: var(--aff-font-size-xl);
  color: var(--aff-gray-900);
}

.aff-help-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--aff-gray-500);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.aff-help-modal-close:hover {
  color: var(--aff-gray-700);
}

.aff-help-modal-body {
  padding: var(--aff-space-lg);
  overflow-y: auto;
  flex: 1;
}

.aff-help-section {
  margin-bottom: var(--aff-space-lg);
}

.aff-help-section:last-child {
  margin-bottom: 0;
}

.aff-help-section h4 {
  margin: 0 0 var(--aff-space-sm) 0;
  color: var(--aff-gray-900);
  font-size: var(--aff-font-size-lg);
}

.aff-help-section ol,
.aff-help-section ul {
  margin: 0;
  padding-left: var(--aff-space-lg);
}

.aff-help-section li {
  margin-bottom: var(--aff-space-xs);
  line-height: 1.6;
}

.aff-help-section p {
  margin: var(--aff-space-sm) 0;
  color: var(--aff-gray-600);
  font-size: var(--aff-font-size-sm);
}

.aff-help-modal-footer {
  padding: var(--aff-space-md) var(--aff-space-lg);
  border-top: 1px solid var(--aff-gray-200);
  display: flex;
  justify-content: flex-end;
}

/* Responsive Help Modal */
@media (max-width: 768px) {
  .aff-help-modal {
    padding: var(--aff-space-sm);
  }

  .aff-help-modal-content {
    max-height: 90vh;
  }

  .aff-help-modal-header,
  .aff-help-modal-body,
  .aff-help-modal-footer {
    padding: var(--aff-space-md);
  }
}

/* =========================================================
 * RESEND EMAIL BUTTON & TOAST NOTIFICATIONS
 * ========================================================= */

/* Resend email button styling */
.aff-resend-email-btn {
  font-size: var(--aff-font-size-xs) !important;
  padding: 4px 10px !important;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.aff-resend-email-btn:hover {
  opacity: 1;
  background: rgba(240, 103, 53, 0.1) !important;
  border-color: var(--aff-primary) !important;
  color: var(--aff-primary) !important;
}

.aff-resend-email-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Message header layout */
.aff-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--aff-space-sm);
}

/* =========================================================
 * READ RECEIPT (Accusé de lecture)
 * ========================================================= */
.aff-read-receipt {
  font-size: 11px;
  margin-top: 4px;
  padding: 2px 0;
  color: #10B981;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.aff-read-receipt.unread {
  color: var(--aff-gray-400);
  font-style: italic;
  font-weight: 400;
}

/* Toast Notifications */
.aff-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  border-radius: var(--aff-radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: var(--aff-space-sm);
  box-shadow: var(--aff-shadow-lg);
  z-index: 10001;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 380px;
  border: 1px solid var(--aff-gray-200);
}

.aff-toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.aff-toast-success {
  border-left: 4px solid #10B981;
}

.aff-toast-error {
  border-left: 4px solid #EF4444;
}

.aff-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.aff-toast-message {
  font-size: var(--aff-font-size-sm);
  color: var(--aff-gray-700);
  line-height: 1.4;
}

/* Responsive toast */
@media (max-width: 768px) {
  .aff-toast {
    left: 15px;
    right: 15px;
    bottom: 15px;
    max-width: none;
  }

  .aff-msg-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .aff-resend-email-btn {
    margin-top: var(--aff-space-xs);
  }
}

/* =========================================================
 * GOOGLE MEET INTEGRATION STYLES
 * ========================================================= */

/* Meeting Section */
.aff-meeting-section {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.05));
  border: 1px solid rgba(66, 133, 244, 0.2);
  border-radius: var(--aff-radius-lg);
  padding: var(--aff-space-lg);
  margin-top: var(--aff-space-lg);
}

.aff-meeting-section h4 {
  margin: 0 0 var(--aff-space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--aff-space-sm);
  color: var(--aff-gray-900);
}

/* Google Connect Button */
.aff-google-connect-btn {
  background: white;
  border: 1px solid var(--aff-gray-300);
  padding: 8px 16px;
  border-radius: var(--aff-radius-md);
  font-size: var(--aff-font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: var(--aff-space-xs);
}

.aff-google-connect-btn:hover:not(.disabled):not(.connected) {
  background: #4285F4;
  color: white;
  border-color: #4285F4;
}

.aff-google-connect-btn.connected {
  background: #34A853;
  color: white;
  border-color: #34A853;
  cursor: default;
}

.aff-google-connect-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Meeting Actions */
.aff-meeting-actions {
  display: flex;
  gap: var(--aff-space-sm);
  flex-wrap: wrap;
  margin-top: var(--aff-space-md);
}

/* Instant Meeting Button */
.aff-meeting-instant-btn {
  background: linear-gradient(135deg, #EA4335, #D93025) !important;
  box-shadow: 0 4px 15px rgba(234, 67, 53, 0.3);
}

.aff-meeting-instant-btn:hover {
  box-shadow: 0 6px 20px rgba(234, 67, 53, 0.4);
}

/* Schedule Meeting Button */
.aff-meeting-schedule-btn {
  background: linear-gradient(135deg, #4285F4, #3367D6) !important;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.aff-meeting-schedule-btn:hover {
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

/* Meeting Result Box */
.aff-meeting-result {
  background: white;
  border: 1px solid var(--aff-gray-200);
  border-radius: var(--aff-radius-lg);
  padding: var(--aff-space-lg);
  margin-top: var(--aff-space-md);
}

.aff-meeting-link-box {
  margin-bottom: var(--aff-space-md);
}

.aff-meeting-link-label {
  display: block;
  font-weight: var(--aff-font-weight-semibold);
  color: var(--aff-gray-700);
  margin-bottom: var(--aff-space-xs);
}

.aff-meeting-link-input {
  width: 100%;
  padding: var(--aff-space-sm) var(--aff-space-md);
  border: 1px solid var(--aff-gray-300);
  border-radius: var(--aff-radius-md);
  font-size: var(--aff-font-size-sm);
  background: var(--aff-gray-50);
}

.aff-meeting-code {
  font-size: var(--aff-font-size-sm);
  color: var(--aff-gray-600);
  margin-bottom: var(--aff-space-md);
}

.aff-meeting-code strong {
  font-family: monospace;
  background: var(--aff-gray-100);
  padding: 2px 8px;
  border-radius: var(--aff-radius-sm);
}

/* Share Buttons */
.aff-meeting-share-btns {
  display: flex;
  gap: var(--aff-space-sm);
  flex-wrap: wrap;
}

.aff-meeting-share-btns .aff-btn {
  background: var(--aff-gray-100);
  color: var(--aff-gray-700);
  box-shadow: none;
}

.aff-meeting-share-btns .aff-btn:hover {
  background: var(--aff-gray-200);
}

.aff-copy-link:hover {
  background: #4285F4 !important;
  color: white !important;
}

.aff-share-whatsapp:hover {
  background: #25D366 !important;
  color: white !important;
}

.aff-share-email:hover {
  background: var(--aff-primary) !important;
  color: white !important;
}

.aff-share-telegram:hover {
  background: #0088CC !important;
  color: white !important;
}

/* Meeting Modal */
.aff-meeting-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--aff-space-md);
}

.aff-meeting-modal {
  background: white;
  border-radius: var(--aff-radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--aff-shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.aff-meeting-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--aff-space-md) var(--aff-space-lg);
  border-bottom: 1px solid var(--aff-gray-200);
}

.aff-meeting-modal-header h3 {
  margin: 0;
  font-size: var(--aff-font-size-xl);
}

.aff-meeting-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--aff-gray-500);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.aff-meeting-modal-close:hover {
  color: var(--aff-gray-700);
}

#affScheduleMeetingForm {
  padding: var(--aff-space-lg);
}

.aff-form-group {
  margin-bottom: var(--aff-space-md);
}

.aff-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--aff-space-md);
}

.aff-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--aff-space-sm);
  cursor: pointer;
}

.aff-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--aff-primary);
}

.aff-meeting-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--aff-space-sm);
  padding-top: var(--aff-space-md);
  border-top: 1px solid var(--aff-gray-200);
  margin-top: var(--aff-space-md);
}

/* Meetings List */
.aff-meetings-list {
  margin-top: var(--aff-space-md);
}

.aff-meeting-item {
  background: white;
  border: 1px solid var(--aff-gray-200);
  border-radius: var(--aff-radius-md);
  padding: var(--aff-space-md);
  margin-bottom: var(--aff-space-sm);
}

.aff-meeting-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--aff-space-xs);
}

.aff-meeting-date {
  font-size: var(--aff-font-size-sm);
  color: var(--aff-gray-500);
}

.aff-meeting-item-title {
  font-weight: var(--aff-font-weight-semibold);
  color: var(--aff-gray-900);
  margin-bottom: var(--aff-space-xs);
}

.aff-meeting-item-link {
  display: flex;
  align-items: center;
  gap: var(--aff-space-xs);
}

.aff-meeting-item-link .aff-link {
  font-size: var(--aff-font-size-sm);
  color: #4285F4;
  text-decoration: none;
  word-break: break-all;
}

.aff-meeting-item-link .aff-link:hover {
  text-decoration: underline;
}

.aff-btn-icon {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.aff-btn-icon:hover {
  opacity: 1;
}

/* Notification Toast */
.aff-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 20px;
  border-radius: var(--aff-radius-lg);
  z-index: 10001;
  font-weight: var(--aff-font-weight-medium);
  box-shadow: var(--aff-shadow-lg);
}

.aff-notification-success {
  background: #34A853;
  color: white;
}

.aff-notification-error {
  background: #EA4335;
  color: white;
}

.aff-animate-fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Badge Success */
.aff-badge-success {
  background: rgba(52, 168, 83, 0.1);
  color: #34A853;
  border-color: rgba(52, 168, 83, 0.3);
}

/* Responsive Meeting Styles */
@media (max-width: 768px) {
  .aff-meeting-actions {
    flex-direction: column;
  }

  .aff-meeting-actions .aff-btn {
    width: 100%;
  }

  .aff-form-row {
    grid-template-columns: 1fr;
  }

  .aff-meeting-share-btns {
    justify-content: center;
  }

  .aff-meeting-modal {
    margin: var(--aff-space-sm);
  }
}

/* =========================================================
 * DRAFT MESSAGE (Brouillon - référent uniquement)
 * ========================================================= */

/* Draft save button */
.aff-btn-draft {
  background: transparent !important;
  color: #B45309 !important;
  border: 1px solid #D97706 !important;
  box-shadow: none !important;
  font-size: var(--aff-font-size-sm);
  transition: all 0.2s ease;
}

.aff-btn-draft:hover {
  background: rgba(217, 119, 6, 0.1) !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15) !important;
  transform: none;
}

.aff-btn-draft:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Draft loaded indicator */
.aff-draft-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin-bottom: 8px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  border-radius: var(--aff-radius-md);
  color: #92400E;
  font-size: var(--aff-font-size-sm);
  font-weight: var(--aff-font-weight-medium);
  animation: slideDown 0.3s ease;
}

/* =========================================================
 * GOOGLE DOCS EXPORT BUTTON
 * ========================================================= */

.aff-gdoc-export-btn {
  background: transparent !important;
  color: #4285F4 !important;
  border: 1px solid #4285F4 !important;
  box-shadow: none !important;
  font-size: var(--aff-font-size-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.aff-gdoc-export-btn:hover {
  background: rgba(66, 133, 244, 0.1) !important;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.15) !important;
  transform: none;
}

.aff-gdoc-export-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.aff-gdoc-connect-btn {
  background: transparent !important;
  color: var(--aff-gray-600) !important;
  border: 1px solid var(--aff-gray-300) !important;
  box-shadow: none !important;
  font-size: var(--aff-font-size-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.aff-gdoc-connect-btn:hover:not(.connected) {
  background: #4285F4 !important;
  color: white !important;
  border-color: #4285F4 !important;
}

.aff-gdoc-connect-btn.connected {
  background: rgba(52, 168, 83, 0.1) !important;
  color: #34A853 !important;
  border-color: rgba(52, 168, 83, 0.3) !important;
  cursor: default;
}

.aff-gdoc-connect-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}