/* ========================================
   📐 PARTIE 1 : FONDATIONS & SYSTÈME DE DESIGN - CORRIGÉE V2
   UNIFORMISATION HEADER 60px ET COMPENSATION UNIQUE
   ======================================== */
/* ========================================
   1. VARIABLES CSS ET DESIGN SYSTEM
   ======================================== */
:root {
  /* Palette de couleurs principales */
  --primary-color: oklch(0.67 0.145 248);
  --primary-dark: oklch(0.58 0.13 250);
  --primary-light: oklch(0.9 0.05 242);
  --secondary-color: oklch(0.67 0.19 38);
  --secondary-light: oklch(0.9 0.06 42);
  /* Couleurs d'état */
  --success-color: oklch(0.66 0.14 154);
  --warning-color: oklch(0.76 0.15 75);
  --error-color: oklch(0.62 0.21 28);
  --info-color: oklch(0.73 0.11 220);
  /* Échelle de gris */
  --white: oklch(0.99 0.002 250);
  --gray-50: oklch(0.985 0.003 248);
  --gray-100: oklch(0.965 0.004 248);
  --gray-200: oklch(0.94 0.005 248);
  --gray-300: oklch(0.89 0.008 248);
  --gray-400: oklch(0.8 0.012 248);
  --gray-500: oklch(0.7 0.016 248);
  --gray-600: oklch(0.57 0.02 248);
  --gray-700: oklch(0.49 0.022 248);
  --gray-800: oklch(0.4 0.02 248);
  --gray-900: oklch(0.3 0.017 248);
  /* Couleurs contextuelles métier */
  --vcs-color: oklch(0.53 0.12 248);
  --vcs-bg: oklch(0.94 0.035 235);
  --vacancier-color: oklch(0.51 0.11 152);
  --vacancier-bg: oklch(0.95 0.03 160);
  --partenaire-color: oklch(0.58 0.14 45);
  --partenaire-bg: oklch(0.96 0.03 78);
 
  /* 🔧 HAUTEURS UNIFORMISÉES - CORRECTION V2 */
  --header-height: 60px; /* Une seule variable pour tous les cas */
  --footer-height: 80px;
  --footer-height-tablet: 70px;
  --footer-height-mobile: 50px;
 
  /* Système d'ombres */
  --shadow-1: 0 1px 3px oklch(0.18 0.01 248 / 0.12);
  --shadow-2: 0 1px 6px oklch(0.18 0.01 248 / 0.15);
  --shadow-3: 0 4px 20px oklch(0.18 0.01 248 / 0.15);
  --shadow-4: 0 8px 25px oklch(0.18 0.01 248 / 0.15);
  /* Rayons de bordure */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  /* Espacements cohérents */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  /* Typographie */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  /* Animations */
  --transition-fast: 0.15s ease-out;
  --transition-base: 0.25s ease-out;
  --transition-slow: 0.35s ease-out;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  /* Z-index organisé */
  --z-base: 1;
  --z-messages: 10;
  --z-navigation: 200;
  --z-write-zone: 998;
  --z-bottom-bar: 999;
  --z-header: 1000;
  --z-modal: 1002;
  --z-toast: 9999;
  /* Points de rupture */
  --breakpoint-xs: 320px;
  --breakpoint-sm: 480px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1200px;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
}
/* ========================================
   2. RESET ET STYLES DE BASE
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}
/* 🔧 BODY SIMPLIFIÉ - FLEXBOX PROPRE */
body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--gray-800);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Plus de padding-top/bottom - flexbox gère tout */
  overscroll-behavior: none;
}
/* Éléments de base */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--gray-900);
}
p {
  margin: 0;
  line-height: var(--line-height-normal);
}
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
ul, ol, li {
  margin: 0;
  padding: 0;
  list-style: none;
}
button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
input, textarea, select {
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color var(--transition-base);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px oklch(0.67 0.145 248 / 0.22);
}
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  border-style: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
td, th {
  padding: 0;
  text-align: left;
}
/* Préservation du comportement par défaut pour les inputs */
#messageInput, #searchInput {
  white-space: pre-wrap !important;
  word-spacing: normal !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  user-select: text !important;
  -webkit-user-select: text !important;
  direction: ltr !important;
  unicode-bidi: normal !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
/* ========================================
   3. ACCESSIBILITÉ ET UTILITAIRES
   ======================================== */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
}
.skip-link:focus {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  white-space: normal;
  top: 6px;
  left: 6px;
}
.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ========================================
   ANIMATIONS ET KEYFRAMES DE BASE
   ======================================== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.2);
  }
}
@keyframes iconBounce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes zoomIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-2px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(2px);
  }
}
@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
@keyframes slideInFromTop {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Classes d'animation de base */
.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: iconBounce 0.3s ease-out; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-shake { animation: shake 0.5s ease-in-out; }
.animate-fade-in { animation: fadeIn var(--transition-base); }
.animate-zoom-in { animation: zoomIn var(--transition-base); }
.animate-fade-out { animation: fadeOut var(--transition-base); }
.animate-slide-in-top { animation: slideInFromTop var(--transition-base); }
/* Délais et durées d'animation */
.delay-75 { animation-delay: 75ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }
.duration-75 { animation-duration: 75ms; }
.duration-100 { animation-duration: 100ms; }
.duration-150 { animation-duration: 150ms; }
.duration-200 { animation-duration: 200ms; }
.duration-300 { animation-duration: 300ms; }
.duration-500 { animation-duration: 500ms; }
.animate-none { animation: none; }
.animate-pause { animation-play-state: paused; }
.animate-resume { animation-play-state: running; }
/* ========================================
   🔧 RESPONSIVE AJUSTÉ - HAUTEURS UNIFIÉES
   ======================================== */
/* Tablettes */
@media (max-width: 768px) {
  :root {
    --header-height: 50px; /* Réduit pour tablette */
  }
}
/* Mobiles */
@media (max-width: 480px) {
  :root {
    --header-height: 40px; /* Réduit pour mobile */
  }
}
/* Classes utilitaires */
.header-transition {
  transition: height var(--transition-base), padding var(--transition-base);
}
.layout-transition {
  transition: margin-top var(--transition-base), padding-top var(--transition-base);
}
/* ========================================
   FIN PARTIE 1 - FONDATIONS CORRIGÉES V2
   ======================================== *//* ========================================
   🏗️ PARTIE 2 : LAYOUT & STRUCTURE PRINCIPALE - CORRIGÉE V2
   Utilisation de flexbox propre sans compensations multiples
   ======================================== */
/* ========================================
   4. LAYOUT PRINCIPAL ET STRUCTURE
   ======================================== */
/* 🔧 HEADER FIXE UNIFIÉ - 60px partout */
.modern-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 0 var(--space-lg);
  box-shadow: var(--shadow-3);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  backdrop-filter: blur(10px);
  height: var(--header-height); /* Utilise la variable unifiée */
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  position: relative;
}
/* Nouveau : Permettre au header-center de prendre l'espace */
.header-content > .brand {
  flex: 0 0 auto;
}
.header-content > .header-center {
  flex: 1 1 auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.header-content > .header-center > * {
  pointer-events: auto;
}
.header-content > .header-status {
  flex: 0 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-2);
  border: 2px solid rgba(255, 255, 255, 0.2);
}
.brand-text h1 {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin: 0;
}
.brand-subtitle {
  font-size: var(--font-size-xs);
  opacity: 0.9;
  font-weight: 400;
}
/* 🔧 ZONE PRINCIPALE - FLEXBOX PROPRE */
.main-view,
.main-changeable-zone,
#chatView,
#reservationView {
  flex: 1 1 auto; /* Prend tout l'espace disponible */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin-top: var(--header-height); /* Une seule compensation */
  margin-bottom: var(--footer-height); /* Une seule compensation */
  max-width: 1200px;
  width: 100%;
  padding: 0 var(--space-md);
  align-self: center;
}
/* 🔧 FOOTER FIXE */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: var(--space-sm);
  z-index: var(--z-bottom-bar);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  height: var(--footer-height);
  flex-shrink: 0;
}
/* ========================================
   5. COMPOSANTS INTERACTIFS
   ======================================== */
/* Indicateur de connexion */
.connection-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(255, 255, 255, 0.1);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  font-size: var(--font-size-sm);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning-color);
  transition: var(--transition-base);
}
.status-dot.connected {
  background: var(--success-color);
}
.status-dot.error {
  background: var(--error-color);
}
.status-dot.pulsing {
  animation: pulse 2s infinite;
}
.status-dot.consent {
  background: #9C27B0;
  animation: pulse 2s infinite;
}
.status-text {
  font-size: var(--font-size-xs);
  font-weight: 500;
}
/* User status indicator */
.user-status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-sm);
}
#userStatusDisplay {
  font-weight: 500;
  color: var(--white);
}
/* Header status container */
.header-status {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
}
/* Icônes de la barre de navigation */
.bar-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
  color: var(--gray-500);
  min-width: 60px;
  user-select: none;
  position: relative;
}
.bar-icon:hover {
  background: var(--gray-100);
  transform: translateY(-2px);
  color: var(--primary-color);
}
.bar-icon.active {
  /* État actif volontairement "plein" (fond + ombre + translation).
     Le marqueur supérieur (::before) a été retiré pour éviter le double signal visuel
     et supprimer définitivement les "deux points" au-dessus des onglets. */
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  box-shadow: var(--shadow-2);
  transform: translateY(-3px);
}
.bar-icon:focus {
  outline: none;
}
.bar-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.86), 0 0 0 4px rgba(13, 71, 161, 0.26), var(--shadow-2);
}
@media (hover: none) and (pointer: coarse) {
  .bar-icon:focus-visible {
    box-shadow: var(--shadow-2);
  }
}
.bar-icon span:first-child {
  font-size: 24px;
  margin-bottom: 2px;
}
.icon-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
  text-align: center;
}
.qr-mini {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.qr-mini::before {
  content: "QR";
  font-size: 10px;
  font-weight: bold;
  color: var(--gray-700);
}
.bar-icon.active span:first-child {
  animation: iconBounce 0.3s ease-out;
}
/* Boutons génériques */
.button {
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 100px;
  justify-content: center;
  text-decoration: none;
  user-select: none;
  flex: 1;
  min-height: 44px;
  box-sizing: border-box;
}
.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}
.button:hover:not(:disabled) {
  transform: translateY(-2px);
}
.send-button {
  background: #2196F3;
  color: var(--white);
  box-shadow: var(--shadow-2);
}
.send-button:hover:not(:disabled) {
  background: #1976D2;
  box-shadow: var(--shadow-3);
}
.cancel-button {
  background: #9E9E9E;
  color: var(--white);
  box-shadow: var(--shadow-1);
}
.cancel-button:hover:not(:disabled) {
  background: #757575;
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.attach-button {
  background: linear-gradient(135deg, var(--info-color), #0097A7);
  color: var(--white);
  box-shadow: var(--shadow-2);
  min-width: 60px;
  flex: 0 0 auto;
}
.attach-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0097A7, #00796B);
}
.search-button {
  background: linear-gradient(135deg, var(--info-color), #0097A7);
  color: var(--white);
  padding: var(--space-sm);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
  font-size: var(--font-size-lg);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-button:hover {
  background: linear-gradient(135deg, #0097A7, #00796B);
  transform: translateY(-2px);
}
/* ========================================
   6. RESPONSIVE TABLETTES
   ======================================== */
@media (max-width: 768px) {
  .main-view,
  .main-changeable-zone,
  #chatView,
  #reservationView {
    margin-top: var(--header-height); /* 50px auto from variable */
    margin-bottom: var(--footer-height-tablet); /* 70px */
    padding: 0 var(--space-sm);
  }
 
  .bottom-bar {
    height: var(--footer-height-tablet);
    padding: var(--space-xs);
  }
 
  .bar-icon {
    min-width: 50px;
    padding: var(--space-xs) 6px;
  }
 
  .bar-icon span:first-child {
    font-size: 20px;
  }
 
  .icon-label {
    font-size: 10px;
  }
 
  .brand-text h1 {
    font-size: var(--font-size-base);
  }
 
  .brand-logo {
    width: 32px;
    height: 32px;
  }
}
/* ========================================
   7. RESPONSIVE MOBILES
   ======================================== */
@media (max-width: 480px) {
  .main-view,
  .main-changeable-zone,
  #chatView,
  #reservationView {
    margin-top: var(--header-height); /* 40px auto from variable */
    margin-bottom: var(--footer-height-mobile); /* 50px */
    padding: 0;
  }
 
  .bottom-bar {
    height: var(--footer-height-mobile);
    padding: 2px;
  }
 
  .bar-icon {
    min-width: 40px;
    padding: 2px 4px;
    gap: 2px;
  }
 
  .bar-icon span:first-child {
    font-size: 16px;
  }
 
  .icon-label {
    font-size: 8px;
  }
 
  .brand {
    gap: 4px;
  }
 
  .brand-logo {
    width: 28px;
    height: 28px;
  }
 
  .brand-text h1 {
    font-size: var(--font-size-sm);
  }
 
  .brand-subtitle {
    display: none;
  }
 
  .connection-indicator {
    padding: 2px 4px;
    font-size: 10px;
  }
 
  .status-dot {
    width: 6px;
    height: 6px;
  }
 
  .header-status {
    gap: var(--space-sm);
  }
}
/* ========================================
   FIN PARTIE 2 - LAYOUT CORRIGÉ V2
   ======================================== *//* ========================================
   💼 PARTIE 3 : FONCTIONNALITÉS MÉTIER
   Lignes ~1500-2250 | Cœur fonctionnel transport
   VERSION CORRIGÉE - Suppression des compensations conflictuelles
   + NOUVEAU : Style ticket expiré gris
   + NOUVEAU : QR Code parfaitement centré
   + 🔧 CORRECTION SPINNER : Anneaux entourent le logo
   ======================================== */
/* ========================================
   6. STYLES DES MESSAGES
   ======================================== */
.message-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-sm) 0;
  padding-bottom: 200px;
  margin-bottom: 0;
  position: relative;
  top: 0;
  scroll-behavior: smooth;
  list-style: none;
}
.message-list::-webkit-scrollbar {
  width: 6px;
}
.message-list::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 10px;
}
.message-list::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 10px;
  transition: var(--transition-base);
}
.message-list::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
.message-list li {
  background: var(--white);
  margin-bottom: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: var(--transition-base);
  border-left: 4px solid var(--gray-300);
  position: relative;
}
.message-list li:first-child {
  margin-top: 0;
}
.message-list li:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.message-list li.status-vcs {
  border-left-color: var(--vcs-color);
  background: linear-gradient(135deg, var(--white) 0%, var(--vcs-bg) 100%);
}
.message-list li.status-vacancier {
  border-left-color: var(--vacancier-color);
  background: linear-gradient(135deg, var(--white) 0%, var(--vacancier-bg) 100%);
}
.message-list li.status-partenaire {
  border-left-color: var(--partenaire-color);
  background: linear-gradient(135deg, var(--white) 0%, var(--partenaire-bg) 100%);
}
.message-content {
  font-size: var(--font-size-base);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  color: var(--gray-800);
}
.message-image {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: var(--shadow-1);
}
.message-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-2);
}
.message-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--gray-200);
  min-height: 24px;
}
.message-item.is-local-pending {
  border-left-color: var(--warning-color);
  background: linear-gradient(135deg, var(--white) 0%, #fff8ea 100%);
}
.message-footer.message-footer-pending {
  gap: var(--space-md);
  min-height: 24px;
  align-items: center;
}
.message-pending-status {
  font-size: var(--font-size-sm);
  font-style: italic;
  color: var(--gray-600);
  font-weight: 500;
}
.icons {
  display: flex;
  gap: var(--space-lg);
}
.icon {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  font-size: var(--font-size-sm);
  background: var(--gray-100);
  color: var(--gray-600);
  border: none;
  user-select: none;
}
.icon:hover {
  background: var(--gray-200);
  transform: translateY(-1px);
}
.icon.clicked-like {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.icon.clicked-love {
  background: var(--secondary-light);
  color: var(--secondary-color);
}
.icon-count {
  font-weight: 600;
  font-size: var(--font-size-xs);
}
.date-time {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  font-weight: 500;
}
.delete-cross {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: var(--error-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: var(--transition-base);
  box-shadow: var(--shadow-1);
}
.delete-cross:hover {
  background: #D32F2F;
  transform: scale(1.1);
}
/* Commentaires et signalements */
.comments-container, .report-container {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: var(--space-md);
}
.comment {
  background: var(--white);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  border-left: 3px solid var(--primary-color);
  box-shadow: var(--shadow-1);
}
.comment:last-child {
  margin-bottom: 0;
}
.comment .message-content {
  margin-bottom: var(--space-xs);
}
.comment .date-time {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}
/* États temporaires et de recherche */
.temp-comment {
  opacity: 0.7;
  border-left-color: var(--warning-color) !important;
  background: linear-gradient(135deg, var(--white) 0%, #FFF8E1 100%);
}
.temp-comment .message-content::after {
  content: " ⏳";
  color: var(--warning-color);
}
.search-comment {
  border-left-color: var(--info-color) !important;
  background: linear-gradient(135deg, var(--white) 0%, #E0F7FA 100%);
}
/* ========================================
  7. ZONES DE SAISIE ET RECHERCHE
  ======================================== */
.write-zone {
  background: var(--white);
  padding: var(--space-lg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  margin: 0;
  border: 1px solid var(--gray-200);
  border-bottom: none;
  position: fixed;
  bottom: var(--footer-height);
  left: 0;
  right: 0;
  z-index: var(--z-write-zone);
  min-height: 120px;
  box-sizing: border-box;
}
.input-container {
  position: relative;
  margin-bottom: var(--space-md);
}
#messageInput {
  width: 100%;
  min-height: 50px;
  max-height: 120px;
  padding: var(--space-md);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  line-height: 1.5;
  resize: none;
  transition: var(--transition-base);
  background: var(--gray-50);
}
#messageInput:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}
.character-count {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--gray-500);
  background: var(--white);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
}
.button-container {
  display: flex;
  gap: var(--space-md);
  justify-content: space-between;
  align-items: center;
}
.button-container .cancel-button {
  order: 1;
}
.button-container .attach-button {
  order: 2;
  flex: 0 0 auto;
}
.button-container .send-button {
  order: 3;
}
/* Barre de recherche */
.search-bar {
  background: var(--white);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  margin: 0;
  border: 1px solid var(--gray-200);
  position: fixed;
  bottom: var(--footer-height);
  left: 0;
  right: 0;
  z-index: var(--z-write-zone);
  box-sizing: border-box;
  border-top: 2px solid var(--info-color);
}
.search-container {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}
#searchInput {
  flex: 1;
  padding: var(--space-md);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: var(--transition-base);
  background: var(--gray-50);
  min-height: 44px;
}
#searchInput:focus {
  outline: none;
  border-color: var(--info-color);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
}
#cancelSearch {
  background: var(--error-color);
  color: var(--white);
}
#cancelSearch:hover {
  background: #D32F2F;
}
/* Prévisualisation d'images */
.image-preview {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.image-preview img {
  max-width: 100px;
  max-height: 100px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: var(--shadow-1);
}
.remove-image {
  background: var(--error-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: var(--transition-base);
}
.remove-image:hover {
  background: #D32F2F;
  transform: scale(1.1);
}
/* Zone principale dynamique */
.main-changeable-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  margin: 0;
  position: relative;
  overflow: hidden;
  min-height: 200px;
  transition: opacity var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}
/* États des contenus dans la zone principale */
.main-content {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.main-content.qr-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--white) 0%, var(--primary-light) 100%);
}
.main-content.rules-content {
  background: linear-gradient(135deg, var(--white) 0%, var(--gray-50) 100%);
  padding: var(--space-lg);
}
.issue-main-container {
  width: 100%;
}
.issue-report-form {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}
.issue-report-form label {
  display: grid;
  gap: 6px;
  font-size: var(--font-size-sm);
  color: var(--gray-700);
}
.issue-report-form label > span {
  font-weight: var(--font-weight-semibold);
}
.issue-report-form select,
.issue-report-form input,
.issue-report-form textarea {
  width: 100%;
}
.issue-report-form textarea {
  resize: vertical;
  min-height: 90px;
}
.button.button-secondary {
  background: var(--gray-100);
  color: var(--gray-800);
  border: 1px solid var(--gray-300);
}
.issue-privacy-note {
  margin-top: 6px;
  font-size: var(--font-size-xs);
}
.issue-recovery-zone {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--gray-200);
  display: grid;
  gap: 8px;
}
.issue-recovery-title {
  margin: 0;
  font-size: var(--font-size-xs);
}
.issue-recovery-code-block {
  margin-top: var(--space-sm);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  background: var(--primary-light);
}
.issue-recovery-code-title {
  margin: 0 0 4px 0;
  font-weight: var(--font-weight-semibold);
}
.issue-recovery-code-block code {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.06em;
}
.issue-separator {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-md) 0;
}
.issue-history-details {
  margin-top: 8px;
  border-top: 1px solid var(--gray-200);
  padding-top: 8px;
}
.issue-history-details > summary {
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  color: var(--gray-700);
  font-size: var(--font-size-sm);
  list-style: none;
}
.issue-history-details > summary::-webkit-details-marker {
  display: none;
}
.issue-history-details > summary::after {
  content: "▾";
  float: right;
  color: var(--gray-500);
}
.issue-history-details[open] > summary::after {
  content: "▴";
}
.issue-history-details .issue-ticket-list {
  margin-top: 8px;
}
.issue-my-title {
  margin: 0 0 var(--space-sm) 0;
  font-size: var(--font-size-base);
}
.issue-ticket-list {
  display: grid;
  gap: var(--space-sm);
}
.issue-ticket-card {
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
}
.issue-ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 4px;
}
.issue-ticket-status {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}
.issue-ticket-date {
  font-size: var(--font-size-xs);
  color: var(--gray-500);
}
.issue-ticket-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--gray-600);
  font-size: var(--font-size-xs);
  margin-bottom: 6px;
}
.issue-ticket-text {
  margin: 0;
  color: var(--gray-800);
  font-size: var(--font-size-sm);
}
.issue-ticket-reply {
  margin: 6px 0 0 0;
  font-size: var(--font-size-xs);
  line-height: 1.35;
}
.issue-ticket-reply-auto {
  color: var(--gray-700);
}
.issue-ticket-reply-manager {
  color: var(--primary-dark);
}
/* ========================================
  8. SYSTÈME DE RÉSERVATION
  ======================================== */
.reservation-view {
  padding: var(--space-lg);
  overflow-y: auto;
  position: relative;
  padding-top: 0;
  /* 🔧 SUPPRIMÉ : height: calc(100vh - 120px - 80px); */
}
.reservation-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  padding: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  margin: 0 0 var(--space-2xl) 0;
  z-index: 10;
}
.reservation-header h2 {
  font-size: var(--font-size-2xl);
  color: var(--gray-800);
  margin-bottom: var(--space-lg);
  font-weight: 700;
}
.date-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  background: var(--white);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  margin: 0 auto;
  max-width: 400px;
}
.nav-button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
  font-size: var(--font-size-lg);
  box-shadow: var(--shadow-2);
}
.nav-button:hover {
  background: linear-gradient(135deg, var(--primary-dark), #1565C0);
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}
.current-date {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--gray-800);
  min-width: 200px;
  text-align: center;
}
/* Grille des créneaux */
.slots-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl);
  max-width: 1000px;
  margin: 0 auto;
}
.slot-column {
  background: var(--white);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--gray-200);
}
.column-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  color: var(--gray-800);
  text-align: center;
  font-weight: 600;
}
.aller-column .column-title {
  color: var(--primary-color);
}
.retour-column .column-title {
  color: var(--secondary-color);
}
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-md);
  position: relative;
}
/* Créneaux horaires avec gestion des places */
.time-slot {
  padding: var(--space-sm);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  position: relative;
  overflow: hidden;
  animation: slotAppear 0.2s ease-out;
}
.time-slot:hover:not(.disabled-for-user):not(.full) {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.time-slot.available {
  border-color: var(--success-color);
  background: linear-gradient(135deg, var(--white) 0%, #E8F5E8 100%);
}
.time-slot.my-reservation {
  background: linear-gradient(135deg, var(--success-color), #388E3C);
  color: var(--white);
  border-color: var(--success-color);
  box-shadow: var(--shadow-2);
}
.time-slot.my-reservation:hover {
  background: linear-gradient(135deg, #388E3C, #2E7D32);
  transform: translateY(-2px);
}
.time-slot.full {
  background: linear-gradient(135deg, var(--error-color), #D32F2F);
  color: var(--white);
  border-color: var(--error-color);
  cursor: not-allowed;
  opacity: 0.8;
}
.time-slot.disabled-for-user {
  background: var(--gray-200);
  color: var(--gray-500);
  border-color: var(--gray-300);
  cursor: not-allowed;
  opacity: 0.6;
}
/* Tickets chauffeur - pleine largeur */
.driver-ticket {
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  color: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  box-shadow: var(--shadow-4);
  border: 4px solid #1B5E20;
  grid-column: 1 / -1;
  width: 100% !important;
  max-width: none !important;
  margin: var(--space-lg) 0 !important;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  animation: ticketPulse 2s infinite ease-in-out;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
/* 🆕 NOUVEAU : Style pour tickets expirés (>5 min après l'heure) */
.driver-ticket.expired {
  background: linear-gradient(135deg, #9E9E9E, #757575) !important;
  color: white !important;
  border-color: #616161 !important;
  animation: ticketPulseGray 2s infinite ease-in-out;
}
/* 🆕 NOUVEAU : Animation spécifique pour tickets expirés */
@keyframes ticketPulseGray {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-4);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 12px 40px rgba(158, 158, 158, 0.4);
  }
}
/* 🆕 NOUVEAU : Si un ticket est à la fois completed ET expired, le gris prime */
.driver-ticket.completed.expired {
  background: linear-gradient(135deg, #9E9E9E, #757575) !important;
}
.ticket-type {
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin: 0;
}
.ticket-time {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 0.9;
  text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
  font-family: 'Courier New', monospace;
  margin: var(--space-sm) 0;
}
.ticket-places {
  font-size: 5rem;
  font-weight: 900;
  line-height: 0.8;
  text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
  color: #FFEB3B;
  text-stroke: 2px #1B5E20;
  -webkit-text-stroke: 2px #1B5E20;
  margin: 0;
}
@keyframes ticketPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-4);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 0 12px 40px rgba(76, 175, 80, 0.4);
  }
}
@keyframes slotAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* ========================================
  9. MODALES ET OVERLAYS
  ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  backdrop-filter: blur(5px);
}
.modal-content {
  background: var(--white);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-4);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalFadeIn 0.3s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}
.modal-header h3 {
  font-size: var(--font-size-xl);
  color: var(--gray-800);
  margin: 0;
}
.close-modal {
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  color: var(--gray-500);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.close-modal:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
/* ========================================
   🎯 QR CODE CENTRAGE PARFAIT - NOUVEAU
   ======================================== */
/* Modal QR - Centrage absolu */
.qr-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(0, 0, 0, 0.8) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: var(--z-modal) !important;
  backdrop-filter: blur(5px) !important;
}
.qr-modal .modal-content {
  position: relative !important;
  background: var(--white) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-4) !important;
  max-width: 450px !important;
  width: 90% !important;
  max-height: 90vh !important;
  padding: var(--space-2xl) !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  transform: none !important;
}
/* Container QR - Centrage et espacement */
.qr-large-container {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: var(--space-xl) auto !important;
  padding: var(--space-xl) !important;
  background: var(--white) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-2) !important;
  min-height: 300px !important;
  width: 100% !important;
  max-width: 320px !important;
  border: 3px solid var(--gray-200) !important;
}
/* QR Code lui-même - Taille optimisée */
.qr-large-container canvas,
.qr-large-container img,
.qr-large-container > div {
  width: 280px !important;
  height: 280px !important;
  margin: 0 auto !important;
  display: block !important;
  border-radius: var(--radius-sm) !important;
}
/* Titre et textes - Centrage */
.qr-modal h2,
.qr-modal h3 {
  text-align: center !important;
  margin: 0 0 var(--space-lg) 0 !important;
  color: var(--gray-800) !important;
}
.qr-modal p {
  text-align: center !important;
  margin: var(--space-md) 0 !important;
  color: var(--gray-600) !important;
  line-height: 1.5 !important;
}
/* Bouton fermer - Position fixe */
.qr-modal .close-modal {
  position: absolute !important;
  top: var(--space-lg) !important;
  right: var(--space-lg) !important;
  background: var(--gray-100) !important;
  color: var(--gray-600) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: var(--font-size-lg) !important;
  transition: var(--transition-base) !important;
}
.qr-modal .close-modal:hover {
  background: var(--gray-200) !important;
  color: var(--gray-800) !important;
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* ========================================
  10. NOTIFICATIONS ET TOASTS
  ======================================== */
#toast, .toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast) !important;
  min-width: 250px;
  max-width: 350px;
  padding: 16px 20px;
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  animation: slideInRight 0.4s ease-out;
  transition: all 0.3s ease;
  display: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.toast.success-toast, #toast.success-toast {
  background: linear-gradient(135deg, #4CAF50, #388E3C) !important;
  color: white !important;
  border: 2px solid #e8f5e8;
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.3) !important;
}
.toast.error-toast, #toast.error-toast {
  background: linear-gradient(135deg, #f44336, #d32f2f) !important;
  color: white !important;
  border: 2px solid #ffebee;
  box-shadow: 0 6px 25px rgba(244, 67, 54, 0.3) !important;
}
.toast.warning-toast, #toast.warning-toast {
  background: linear-gradient(135deg, #FF9800, #F57C00) !important;
  color: white !important;
}
.toast.info-toast, #toast.info-toast {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  color: white;
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
/* ========================================
   🔧 SPINNER MODERNE - CORRECTION TAILLES
   ======================================== */
.modern-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  color: var(--white);
}
.spinner-container {
  text-align: center;
  position: relative;
}
/* 🎯 CORRECTION : Anneaux agrandis pour entourer le logo */
.spinner-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 3px solid transparent;
  border-top: 3px solid var(--white);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
  transform: translate(-50%, -50%);
}
/* Premier anneau - Plus proche du logo */
.spinner-ring:nth-child(1) {
  width: 180px; /* 🔧 ÉTAIT 200px */
  height: 180px; /* 🔧 ÉTAIT 200px */
}
/* Deuxième anneau - Intermédiaire */
.spinner-ring:nth-child(2) {
  width: 220px; /* 🔧 ÉTAIT 230px */
  height: 220px; /* 🔧 ÉTAIT 230px */
  animation-duration: 2s;
  animation-direction: reverse;
  opacity: 0.7;
}
/* Troisième anneau - Extérieur */
.spinner-ring:nth-child(3) {
  width: 260px; /* 🔧 INCHANGÉ */
  height: 260px; /* 🔧 INCHANGÉ */
  animation-duration: 2.5s;
  opacity: 0.4;
}
.spinner-text {
  margin-top: 70px;
  z-index: 1;
  position: relative;
}
/* 🎯 LOGO AGRANDI pour être plus visible */
.logo-mini {
  width: 140px; /* 🔧 ÉTAIT 120px */
  height: 140px; /* 🔧 ÉTAIT 120px */
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  border: 3px solid rgba(255, 255, 255, 0.3);
}
.logo-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spinner-text p {
  font-size: var(--font-size-lg);
  font-weight: 500;
  opacity: 0.9;
}
/* ========================================
   🔧 FIX SCROLL APRÈS RÉSERVATION ALLER
   À ajouter à la fin de style_3.css
   ======================================== */
/* ========================================
   🌍 SOLUTION UNIVERSELLE SCROLL
   Fix pour Safari, Chrome, Edge, Mobile
   À ajouter à la fin de style_3.css
   ======================================== */
/* 1. Fix HTML/Body pour Safari Mobile */
html {
  touch-action: manipulation !important;
  overscroll-behavior: contain !important;
  height: 100% !important;
}
body {
  touch-action: manipulation !important;
  overscroll-behavior: contain !important;
  /* Retirer position: relative si présent - bug Safari */
  position: static !important;
}
/* 2. Fix ReservationView - Container principal */
.reservation-view,
#reservationView {
  /* Fix flexbox-grid interaction */
  min-height: 0 !important;
 
  /* Safari Mobile scroll */
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  touch-action: manipulation !important;
 
  /* Force recalcul layout Safari */
  will-change: transform !important;
  transform: translateZ(0) !important;
}
/* 3. Fix Slots Container */
.slots-container {
  min-height: 0 !important;
  overflow: visible !important;
 
  /* Safari performance */
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
}
/* 4. Fix Time Slots Grid */
.time-slots {
  /* Évite grid blowout */
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  min-height: 0 !important;
}
/* 5. Fix Driver Ticket - Préserve design mais corrige layout */
.driver-ticket {
  /* Garde le design existant */
  grid-column: 1 / -1 !important;
  position: relative !important;
 
  /* Fix layout issues */
  contain: layout style !important;
  will-change: auto !important;
 
  /* Box model stable */
  box-sizing: border-box !important;
}
/* 6. Mobile Safari spécifique */
@supports (-webkit-touch-callout: none) {
  /* iPhone/iPad seulement */
 
  .reservation-view,
  #reservationView {
    /* Force GPU acceleration Safari */
    -webkit-transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
   
    /* Fix scroll momentum */
    -webkit-overflow-scrolling: touch !important;
   
    /* Reforce scroll après injection contenu */
    overflow-y: scroll !important;
  }
 
  /* Reset après changement de contenu */
  .driver-ticket {
    -webkit-transform: translateZ(0) !important;
  }
}
/* ========================================
   FIN PARTIE 3 - FONCTIONNALITÉS MÉTIER CORRIGÉES + TICKET EXPIRÉ + QR CENTRÉ + SPINNER CORRIGÉ
   ======================================== *//* ========================================
   📱 PARTIE 4 : RESPONSIVE & OPTIMISATIONS
   Lignes ~2250-3000+ | Adaptabilité multi-device
   VERSION CORRIGÉE - Suppression des règles conflictuelles
   + NOUVEAU : QR Code responsive parfait
   ======================================== */
/* ========================================
   14. RESPONSIVE DESIGN - TABLETTES
   ======================================== */
@media screen and (min-width: 768px) {
  .main-view {
    flex-direction: column !important;
  }
 
  .message-list {
    flex: 1 1 auto !important;
  }
 
  .write-zone {
    width: 100% !important;
    align-self: auto !important;
  }
}
@media (max-width: 768px) {
  #toast, .toast {
    top: calc(var(--header-height) + 10px);
    right: 10px;
    left: 10px;
    max-width: none;
  }
 
  /* 🔧 SUPPRIMÉ les anciennes règles de hauteur fixe */
 
  .write-zone {
    bottom: var(--footer-height-tablet);
  }
 
  .search-bar {
    bottom: var(--footer-height-tablet);
  }
 
  .bar-icon {
    min-width: 50px;
    padding: var(--space-xs) 6px;
  }
 
  .bar-icon span:first-child {
    font-size: 20px;
  }
 
  .icon-label {
    font-size: 10px;
  }
 
  .brand-text h1 {
    font-size: var(--font-size-lg);
  }
 
  .slots-container {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
 
  .time-slots {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-sm);
  }
 
  .time-slot {
    min-height: 70px;
    padding: var(--space-xs);
  }
 
  .slot-time {
    font-size: var(--font-size-base);
  }
 
  .slot-places {
    font-size: 10px;
  }
 
  .message-list {
    padding-bottom: 180px;
    padding-top: var(--space-sm);
  }
 
  .message-list li {
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
  }
 
  .write-zone {
    padding: var(--space-md);
  }
 
  .search-bar {
    padding: var(--space-md);
  }
 
  .search-container {
    gap: var(--space-sm);
    padding: 0;
  }
 
  #searchInput {
    padding: var(--space-sm);
    font-size: 14px;
    min-height: 40px;
  }
 
  .search-button, #cancelSearch {
    padding: var(--space-sm);
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
  }
 
  /* 🆕 NOUVEAU - QR Code responsive tablette */
  .qr-modal .modal-content {
    max-width: 400px !important;
    width: 95% !important;
    padding: var(--space-xl) !important;
  }
 
  .qr-large-container {
    min-height: 280px !important;
    max-width: 300px !important;
    padding: var(--space-lg) !important;
    margin: var(--space-lg) auto !important;
  }
 
  .qr-large-container canvas,
  .qr-large-container img,
  .qr-large-container > div {
    width: 260px !important;
    height: 260px !important;
  }
}
/* ========================================
   15. RESPONSIVE DESIGN - MOBILES
   ======================================== */
@media (max-width: 480px) {
  #toast, .toast {
    top: calc(var(--header-height) + 10px);
    right: 10px;
    left: 10px;
    max-width: none;
    padding: 12px 16px;
    font-size: 13px;
  }
 
  /* 🔧 SUPPRIMÉ les anciennes règles de hauteur fixe et compensations */
 
  .write-zone {
    bottom: var(--footer-height-mobile);
  }
 
  .search-bar {
    bottom: var(--footer-height-mobile);
  }
 
  .bar-icon {
    min-width: 40px;
    padding: 2px 4px;
    gap: 2px;
  }
 
  .bar-icon span:first-child {
    font-size: 16px;
  }
 
  .icon-label {
    font-size: 8px;
  }
 
  .brand {
    gap: 4px;
  }
 
  .brand-logo {
    width: 28px;
    height: 28px;
  }
 
  .brand-text h1 {
    font-size: 14px;
  }
 
  .brand-subtitle {
    display: none;
  }
 
  .connection-indicator {
    padding: 2px 4px;
    font-size: 10px;
  }
 
  .status-dot {
    width: 6px;
    height: 6px;
  }
 
  .message-list {
    padding: 4px 2px;
    padding-bottom: 140px;
    margin-bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    top: 0;
  }
 
  .message-list li {
    margin-bottom: 8px;
    padding: 8px 6px;
    border-radius: 8px;
    border-left-width: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: block;
    clear: both;
    position: relative;
    background: var(--white);
    z-index: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
 
  .message-list li:first-child {
    margin-top: 0;
  }
 
  .message-content {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
 
  .message-footer {
    padding-top: 6px;
    border-top: 1px solid var(--gray-200);
    min-height: 24px;
    flex-wrap: wrap;
    gap: 4px;
  }
 
  .write-zone {
    position: fixed;
    left: 0;
    right: 0;
    padding: 6px 4px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: var(--z-write-zone);
    min-height: 70px;
    max-height: 100px;
    background: var(--white);
    border-top: 1px solid var(--gray-300);
  }
 
  .input-container {
    margin-bottom: 4px;
  }
 
  #messageInput {
    min-height: 36px;
    max-height: 60px;
    padding: 6px 8px;
    font-size: 16px;
    margin-bottom: 4px;
  }
 
  .button-container {
    gap: 4px;
    height: 30px;
    align-items: center;
  }
 
  .button {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 28px;
    height: 28px;
    min-width: 60px;
  }
 
  .attach-button {
    min-width: 40px;
    flex: 0 0 40px;
  }
 
  .icons {
    flex-wrap: wrap;
    gap: 4px;
  }
 
  .icon {
    padding: 2px 4px;
    font-size: 10px;
    min-height: 20px;
  }
 
  .icon-count {
    font-size: 9px;
  }
 
  .date-time {
    font-size: 10px;
    white-space: nowrap;
  }

  .message-pending-status {
    font-size: 11px;
  }
 
  .delete-cross {
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
 
  .reservation-view {
    padding: 4px;
    padding-top: 0;
    overflow-y: auto;
    position: relative;
  }
 
  .reservation-header {
    margin-bottom: 8px;
    padding: 6px 0;
  }
 
  .reservation-header h2 {
    font-size: 16px;
    margin-bottom: 6px;
  }
 
  .date-selector {
    gap: 6px;
    padding: 6px;
  }
 
  .nav-button {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
 
  .current-date {
    font-size: 12px;
    min-width: 100px;
  }
 
  .slots-container {
    gap: 6px;
  }
 
  .slot-column {
    padding: 8px;
  }
 
  .time-slots {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
 
  .time-slot {
    padding: 3px 1px;
    min-height: 60px;
    font-size: 10px;
  }
 
  .slot-time {
    font-size: var(--font-size-sm);
    margin-bottom: 2px;
  }
 
  .slot-places {
    font-size: 9px;
  }
 
  .slot-progress {
    height: 3px;
  }
 
  .vcs-info {
    font-size: 8px;
    margin-top: 2px;
  }
 
  .slot-indicator {
    width: 8px;
    height: 8px;
    top: 2px;
    right: 2px;
  }
 
  .modal {
    z-index: var(--z-modal);
  }
 
  .modal-content {
    margin: calc(var(--header-height) + 5px) 4px 4px 4px;
    max-height: calc(100vh - var(--header-height) - 10px);
    overflow-y: auto;
    padding: 12px;
  }
 
  .search-bar {
    position: fixed;
    left: 0;
    right: 0;
    padding: 4px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: var(--z-write-zone);
    margin: 0;
    border-top: 1px solid var(--info-color);
    background: var(--white);
    min-height: 60px;
  }
 
  .search-container {
    gap: 4px;
    padding: 0;
    margin: 0;
  }
 
  #searchInput {
    padding: 6px 8px;
    font-size: 16px;
    min-height: 36px;
    border-radius: 6px;
  }
 
  .search-button, #cancelSearch {
    padding: 3px;
    min-width: 36px;
    min-height: 36px;
    font-size: 12px;
    border-radius: 6px;
  }
 
  .message-list.search-mode {
    padding-bottom: 140px;
  }
 
  .message-list::-webkit-scrollbar {
    width: 3px;
  }
 
  .driver-ticket {
    width: calc(100% - 4px);
    margin: var(--space-lg) 2px;
    min-height: 140px;
    padding: var(--space-md) var(--space-sm);
    border-radius: var(--radius-md);
  }
 
  .ticket-type {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
 
  .ticket-time {
    font-size: 3rem;
  }
 
  .ticket-places {
    font-size: 3.2rem;
  }
 
  /* 🆕 NOUVEAU - QR Code responsive mobile */
  .qr-modal {
    padding: var(--space-md) !important;
  }
 
  .qr-modal .modal-content {
    max-width: 350px !important;
    width: 98% !important;
    padding: var(--space-lg) !important;
    max-height: 95vh !important;
    overflow-y: auto !important;
  }
 
  .qr-large-container {
    min-height: 250px !important;
    max-width: 280px !important;
    padding: var(--space-md) !important;
    margin: var(--space-md) auto !important;
  }
 
  .qr-large-container canvas,
  .qr-large-container img,
  .qr-large-container > div {
    width: 240px !important;
    height: 240px !important;
  }
 
  .qr-modal h2,
  .qr-modal h3 {
    font-size: var(--font-size-lg) !important;
    margin-bottom: var(--space-md) !important;
  }
 
  .qr-modal p {
    font-size: var(--font-size-sm) !important;
  }
 
  .qr-modal .close-modal {
    top: var(--space-md) !important;
    right: var(--space-md) !important;
    width: 28px !important;
    height: 28px !important;
    font-size: var(--font-size-base) !important;
  }
}
/* ========================================
   16. TRÈS PETITS ÉCRANS
   ======================================== */
@media (max-width: 320px) {
  .message-list {
    padding-bottom: 140px;
  }
 
  .write-zone {
    min-height: 80px;
  }
 
  .message-list li {
    padding: 6px 4px;
  }
 
  .button {
    min-width: 50px;
    font-size: 10px;
  }
 
  .driver-ticket {
    width: calc(100% - 2px);
    margin: var(--space-lg) 1px;
    min-height: 120px;
    padding: var(--space-sm);
  }
 
  .ticket-type {
    font-size: 1rem;
  }
 
  .ticket-time {
    font-size: 2.5rem;
  }
 
  .ticket-places {
    font-size: 2.8rem;
  }
 
  /* 🆕 NOUVEAU - QR Code très petits écrans */
  .qr-modal .modal-content {
    max-width: 310px !important;
    width: 98% !important;
    padding: var(--space-md) !important;
  }
 
  .qr-large-container {
    min-height: 220px !important;
    max-width: 250px !important;
    padding: var(--space-sm) !important;
    margin: var(--space-sm) auto !important;
  }
 
  .qr-large-container canvas,
  .qr-large-container img,
  .qr-large-container > div {
    width: 200px !important;
    height: 200px !important;
  }
}
/* ========================================
   17. OPTIMISATIONS POUR MOBILES
   ======================================== */
@media (max-width: 480px) {
  .reduce-motion,
  .reduce-motion * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
  }
}
@media (hover: none) and (pointer: coarse) {
  .hover-lift:hover {
    transform: none;
  }
 
  .hover-lift:active {
    transform: scale(0.98);
  }
}
/* ========================================
   18. CORRECTIONS DE LARGEUR
   ======================================== */
.modern-header,
.bottom-bar,
.write-zone,
.search-bar {
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
}
/* ========================================
   19. UTILITAIRES FINAUX
   ======================================== */
.hidden {
  display: none !important;
}
.visible {
  display: block !important;
}
.flex-visible {
  display: flex !important;
}
/* ========================================
   OPTIMISATIONS WEBP ET FORMATS MODERNES
   ======================================== */
.webp-support .message-image,
.webp-support .brand-logo,
.webp-support img[src$=".jpg"],
.webp-support img[src$=".png"] {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: optimize-contrast;
}
.no-webp-support .message-image,
.no-webp-support .brand-logo {
  image-rendering: auto;
}
.image-placeholder {
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  min-height: 120px;
  transition: var(--transition-base);
}
.image-loading {
  background: linear-gradient(90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}
/* ========================================
   VIRTUAL SCROLLING OPTIMIZATIONS
   ======================================== */
.message-list.virtual-enabled {
  contain: layout style paint;
  will-change: scroll-position;
  transform: translateZ(0);
}
.virtual-container {
  position: relative;
  pointer-events: none;
}
.virtual-items {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: auto;
  contain: layout style paint;
}
.virtual-items li {
  contain: layout style paint;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}
/* ========================================
   INTERNATIONALISATION (I18N) STYLES
   ======================================== */
.language-selector {
  position: relative;
  margin-left: var(--space-md);
}
.language-button {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: var(--transition-base);
  font-size: var(--font-size-sm);
  font-weight: 500;
}
.language-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-xs);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  z-index: 1001;
  min-width: 200px;
  animation: slideInDown 0.2s ease-out;
}
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Support RTL pour les langues de droite à gauche */
[dir="rtl"] {
  text-align: right;
}
[dir="rtl"] .language-dropdown {
  left: 0;
  right: auto;
}
[dir="rtl"] .message-list li {
  border-left: none;
  border-right: 4px solid var(--gray-300);
}
[dir="rtl"] .write-zone {
  direction: rtl;
}
[dir="rtl"] .search-container {
  direction: rtl;
}
/* ========================================
   🔧 SUPPRIMÉ : Toutes les règles conflictuelles
   avec !important et compensations multiples
   ======================================== */
/* ========================================
   MASQUAGE BARRE D'ADRESSE SAFARI - MOBILE
   ======================================== */
@media screen and (max-width: 480px) {
  @supports (-webkit-touch-callout: none) {
    html {
      height: 100vh;
      height: -webkit-fill-available;
    }
   
    body {
      height: 100vh;
      height: -webkit-fill-available;
      overflow: hidden;
    }
  }
}
/* Mode PWA - Quand ajouté à l'écran d'accueil */
@media (display-mode: standalone) {
  html {
    height: 100vh;
  }
 
  body {
    height: 100vh;
    overflow: hidden;
  }
 
  .modern-header {
    padding-top: env(safe-area-inset-top, 0);
  }
 
  .bottom-bar {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}
/* Correction pour iPhone en landscape */
@media screen and (orientation: landscape) and (max-height: 500px) {
  @supports (-webkit-touch-callout: none) {
    /* Utilise les variables pour s'adapter automatiquement */
   
    .write-zone {
      bottom: var(--footer-height-mobile);
    }
   
    .search-bar {
      bottom: var(--footer-height-mobile);
    }
  }
}
/* ========================================
   🎯 UNIFORMISATION BOUTONS - FINALES
   ======================================== */
/* Boutons principaux et secondaires - Apparence unifiée */
.send-button,
.search-button {
  background: #2196F3 !important;
  color: white !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.15) !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 16px !important;
  font-size: 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.25s ease-out !important;
  cursor: pointer !important;
}
.cancel-button,
#cancelSearch {
  background: #9E9E9E !important;
  color: white !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
  border: none !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  min-height: 44px !important;
  min-width: 44px !important;
  padding: 16px !important;
  font-size: 1rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.25s ease-out !important;
  cursor: pointer !important;
}
/* Hover effects unifiés */
.send-button:hover:not(:disabled),
.search-button:hover:not(:disabled) {
  background: #1976D2 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
  transform: translateY(-2px) !important;
}
.cancel-button:hover:not(:disabled),
#cancelSearch:hover:not(:disabled) {
  background: #757575 !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.15) !important;
  transform: translateY(-1px) !important;
}
/* ========================================
   FIX AFFICHAGE QR CODE - ZONE PRINCIPALE
   ======================================== */
/* Fix pour tous les contenus de la zone principale */
.main-changeable-zone:not(.hidden) {
    position: fixed !important;
    top: calc(var(--header-height, 60px) + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(var(--footer-height, 80px) + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    z-index: 100 !important;
    display: flex !important;
    flex-direction: column !important;
    background: white !important;
    overflow: hidden !important;
}
/* Spécifique pour le QR Code */
.main-changeable-zone[data-content="qr"] {
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%) !important;
}
/* Contenu QR large */
.main-changeable-zone[data-content="qr"] .qr-content-large {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
/* Container principal QR */
.qr-main-container-large {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 90%;
    text-align: center;
}
/* Zone d'affichage du QR */
.qr-display-area-large,
#qrMainDisplayLarge {
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    min-height: 280px;
}
/* Le QR Code lui-même */
.qr-display-area-large img,
#qrMainDisplayLarge img {
    display: block !important;
    margin: 0 auto !important;
}

.qr-display-area-large canvas,
#qrMainDisplayLarge canvas {
    display: block;
    margin: 0 auto !important;
}
/* Titre et description */
.qr-main-header-large h3 {
    color: #1976D2;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
}
.qr-description-main-large {
    color: #616161;
    font-size: 1rem;
    margin-top: 20px;
    line-height: 1.5;
}
/* Footer info */
.qr-footer-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #9e9e9e;
    font-size: 0.9rem;
}
/* Spécifique pour les règles */
.main-changeable-zone[data-content="rules"] {
    padding: 20px;
    overflow-y: auto !important;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
}
/* Responsive tablettes */
@media (max-width: 768px) {
    .main-changeable-zone:not(.hidden) {
        top: calc(var(--header-height, 60px) + env(safe-area-inset-top, 0px)) !important;
        bottom: calc(var(--footer-height-tablet, 70px) + env(safe-area-inset-bottom, 0px)) !important;
    }
   
    .qr-main-container-large {
        padding: 20px;
        max-width: 350px;
    }
   
    .qr-display-area-large,
    #qrMainDisplayLarge {
        min-width: 240px;
        min-height: 240px;
        padding: 15px;
    }
}
/* Responsive mobiles */
@media (max-width: 480px) {
    .main-changeable-zone:not(.hidden) {
        top: calc(var(--header-height, 60px) + env(safe-area-inset-top, 0px)) !important;
        bottom: calc(var(--footer-height-mobile, 50px) + env(safe-area-inset-bottom, 0px)) !important;
    }
   
    .qr-main-container-large {
        padding: 15px;
        max-width: 320px;
        width: 95%;
    }
   
    .qr-display-area-large,
    #qrMainDisplayLarge {
        min-width: 220px;
        min-height: 220px;
        padding: 10px;
    }
   
    .qr-main-header-large h3 {
        font-size: 1.2rem;
    }
   
    .qr-description-main-large {
        font-size: 0.9rem;
    }
}
/* Animation d'entree/sortie harmonisee pour la zone principale */
.main-changeable-zone.entering {
    animation: mainZoneEnter 0.14s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes mainZoneEnter {
    from {
        transform: translateY(8px);
        opacity: 1;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.main-changeable-zone.exiting {
    animation: mainZoneExit 0.12s ease-out both;
}
@keyframes mainZoneExit {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(6px);
        opacity: 1;
    }
}
/* NOUVEAU: Style background bleu pour directeur */
.status-directeur {
    background: #E3F2FD !important;
    color: white !important;
    border-left: 4px solid #0D47A1 !important;
}
/* ========================================
   SYSTÈME ÉPINGLAGE - VERSION OPTIMISÉE
   ======================================== */
/* Conteneur épinglé fixe - au-dessus de messageList */
.pinned-container {
    position: fixed !important;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 150 !important;
    background: white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    padding: 10px !important;
    border-bottom: 1px solid var(--gray-200) !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}
/* Message dans conteneur épinglé */
.pinned-container .pinned-message {
    background: #ffe6ef !important;
    border: 2px solid #f39ab5 !important;
    border-radius: 8px !important;
    margin: 0 !important;
    position: relative !important;
    box-shadow: 0 4px 12px rgba(243, 154, 181, 0.35) !important;
    animation: none !important;
}

.message-item.is-pinned-message {
    background: #ffe6ef !important;
    border: 1px solid #f7b9cc !important;
}

.message-item.is-pinned-message .message-content .pinned-prefix {
    color: #d32f2f !important;
    font-weight: 700 !important;
}
/* Icône épingle dans footer des messages */
.pin-icon {
    color: #4caf50 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    background: rgba(76, 175, 80, 0.1) !important;
    border-radius: 6px !important;
    padding: 4px 6px !important;
}
.pin-icon:hover {
    color: #2e7d32 !important;
    background: rgba(76, 175, 80, 0.2) !important;
    transform: scale(1.05) !important;
}
.pin-icon.pin-active {
    color: #1b5e20 !important;
    background: rgba(76, 175, 80, 0.28) !important;
    box-shadow: inset 0 0 0 1px rgba(27, 94, 32, 0.25) !important;
}
.pin-icon .icon-label {
    display: none !important;
}
/* Animation d'apparition */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Responsive tablette */
@media (max-width: 768px) {
    .pinned-container {
        padding: 8px !important;
    }
   
    .pin-icon .icon-label {
        display: inline !important;
        font-size: 11px !important;
        margin-left: 2px !important;
    }
}
/* Responsive mobile */
@media (max-width: 480px) {
    .pinned-container {
        padding: 6px !important;
    }
   
    .pinned-container .pinned-message {
        border-radius: 6px !important;
        border-width: 1px !important;
    }
   
    .pin-icon {
        font-size: 12px !important;
        padding: 3px 5px !important;
    }
}
/* ========================================
   FIN SYSTÈME ÉPINGLAGE OPTIMISÉ
   ======================================== */
  
   /* Cacher l'ancienne croix rouge */
.delete-cross {
    display: none !important;
}
/* Styliser la nouvelle icône poubelle */
.message-footer .icons .delete-icon {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}
.message-footer .icons .delete-icon:hover {
    background-color: rgba(220, 53, 69, 0.2);
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}
.message-footer .icons .delete-icon:active {
    transform: scale(0.95);
}
.pause-meridienne {
    background: linear-gradient(135deg, #e0e0e0 25%, #d0d0d0 25%, #d0d0d0 50%, #e0e0e0 50%, #e0e0e0 75%, #d0d0d0 75%, #d0d0d0);
    background-size: 20px 20px;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    text-align: center;
    color: #666;
    font-weight: 500;
    position: relative;
    opacity: 0.8;
}
.pause-meridienne::before {
    content: "🍽️";
    margin-right: 8px;
}
/* Styles pour les boutons de réservation vélos */
.reserve-btn {
    width: 100%;
    padding: 12px 16px;
    margin-top: 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* État actif/disponible - Bleu */
.reserve-btn:not([disabled]) {
    background-color: #007AFF;
    color: white;
    border-color: #007AFF;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}
.reserve-btn:not([disabled]):hover {
    background-color: #0056CC;
    border-color: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}
.reserve-btn:not([disabled]):active {
    transform: translateY(0);
    background-color: #004499;
}
/* État inactif/désactivé - Gris */
.reserve-btn[disabled] {
    background-color: #F2F2F7;
    color: #8E8E93;
    border-color: #E5E5EA;
    cursor: not-allowed;
    box-shadow: none;
}
.reserve-btn[disabled]:hover {
    transform: none;
    background-color: #F2F2F7;
}
/* Animation de focus pour accessibilité */
.reserve-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}
/* Responsive pour mobile */
@media (max-width: 768px) {
    .reserve-btn {
        padding: 14px 16px;
        font-size: 15px;
        min-height: 50px;
    }
}
/* Indicateur visuel pour boutons avec conflits */
.reserve-btn.conflict-warning {
    background-color: #FF9500;
    border-color: #FF9500;
    color: white;
}
.reserve-btn.conflict-warning:hover {
    background-color: #E6830A;
    border-color: #E6830A;
}
/* ========================================
   🎭 SYSTÈME DE RÔLES - BADGES ET QUOTAS
   Styles pour badges utilisateur et affichage quotas
   ======================================== */
/* ========================================
   BADGES DE RÔLE - OVERLAY FIXE
   ======================================== */
/* Badge de rôle utilisateur - Position fixe */
.role-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    transition: all var(--transition-base);
    user-select: none;
    min-width: 80px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
/* Animation apparition badge */
.role-badge {
    animation: badgeSlideIn 0.4s ease-out;
}
@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
/* Couleurs spécifiques par rôle */
.role-badge.role-directeur {
    background: linear-gradient(135deg, #1565C0, #0D47A1);
    border-color: rgba(13, 71, 161, 0.3);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.4);
}
.role-badge.role-adjoint {
    background: linear-gradient(135deg, #3949AB, #283593);
    border-color: rgba(40, 53, 147, 0.3);
    box-shadow: 0 4px 12px rgba(57, 73, 171, 0.4);
}
.role-badge.role-animateur {
    background: linear-gradient(135deg, #43A047, #2E7D32);
    border-color: rgba(46, 125, 50, 0.3);
    box-shadow: 0 4px 12px rgba(67, 160, 71, 0.4);
}
.role-badge.role-employe_velo {
    background: linear-gradient(135deg, #FF7043, #D84315);
    border-color: rgba(216, 67, 21, 0.3);
    box-shadow: 0 4px 12px rgba(255, 112, 67, 0.4);
}
.role-badge.role-accueil {
    background: linear-gradient(135deg, #8E24AA, #6A1B9A);
    border-color: rgba(106, 27, 154, 0.3);
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.4);
}
.role-badge.role-partenaire {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    border-color: rgba(245, 124, 0, 0.3);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}
.role-badge.role-vacancier {
    background: linear-gradient(135deg, #00897B, #00695C);
    border-color: rgba(0, 105, 92, 0.3);
    box-shadow: 0 4px 12px rgba(0, 137, 123, 0.4);
}
/* Effet hover sur badge */
.role-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
/* ========================================
   QUOTAS DE MESSAGES - AFFICHAGE
   ======================================== */
/* Conteneur quotas - sous le badge de rôle */
#messageQuotas {
    position: fixed;
    top: 50px;
    right: 10px;
    z-index: 999;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity var(--transition-base);
    user-select: none;
    min-width: 120px;
    text-align: center;
}
/* Animation apparition quotas */
#messageQuotas {
    animation: quotasSlideIn 0.3s ease-out;
}
@keyframes quotasSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* États des quotas selon limite */
#messageQuotas.quota-ok {
    background: rgba(76, 175, 80, 0.8);
    border-color: rgba(76, 175, 80, 0.3);
}
#messageQuotas.quota-warning {
    background: rgba(255, 152, 0, 0.8);
    border-color: rgba(255, 152, 0, 0.3);
}
#messageQuotas.quota-critical {
    background: rgba(244, 67, 54, 0.8);
    border-color: rgba(244, 67, 54, 0.3);
    animation: quotasPulse 2s infinite;
}
@keyframes quotasPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}
/* ========================================
   PERMISSIONS ET ACTIONS RÔLES
   ======================================== */
/* Icône épinglage avec permission */
.pin-icon[data-has-permission="true"] {
    display: inline-flex !important;
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.2);
}
.pin-icon[data-has-permission="false"] {
    display: none !important;
}
/* Boutons avec permissions */
.button[data-requires-permission] {
    position: relative;
}
.button[data-requires-permission]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.button[data-requires-permission]:disabled::after {
    content: "🔒";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}
/* ========================================
   RESPONSIVE SYSTÈME DE RÔLES
   ======================================== */
/* Tablettes */
@media (max-width: 768px) {
    .role-badge {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 11px;
        min-width: 70px;
    }
   
    #messageQuotas {
        top: 42px;
        right: 8px;
        padding: 5px 8px;
        font-size: 10px;
        min-width: 100px;
    }
}
/* Mobiles */
@media (max-width: 480px) {
    .role-badge {
        top: 6px;
        right: 6px;
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
        border-radius: 12px;
    }
   
    #messageQuotas {
        top: 32px;
        right: 6px;
        padding: 4px 6px;
        font-size: 9px;
        min-width: 80px;
        border-radius: 8px;
    }
   
    /* Sur mobile, placer sous le header plutôt qu'en overlay */
    @media (max-height: 600px) {
        .role-badge {
            position: absolute;
            top: calc(var(--header-height) + 5px);
            right: 5px;
        }
       
        #messageQuotas {
            position: absolute;
            top: calc(var(--header-height) + 30px);
            right: 5px;
        }
    }
}
/* Mode paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) and (max-height: 500px) {
    .role-badge {
        font-size: 9px;
        padding: 3px 6px;
        min-width: 50px;
    }
   
    #messageQuotas {
        font-size: 8px;
        padding: 3px 5px;
        min-width: 70px;
    }
}
/* ========================================
   INTERACTIONS ET ACCESSIBILITÉ
   ======================================== */
/* Focus pour accessibilité */
.role-badge:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}
/* Mode sombre */
@media (prefers-color-scheme: dark) {
    .role-badge {
        border-color: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px) brightness(0.8);
    }
   
    #messageQuotas {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.05);
    }
}
/* Réduction des animations si demandé */
@media (prefers-reduced-motion: reduce) {
    .role-badge {
        animation: none;
        transition: none;
    }
   
    #messageQuotas {
        animation: none;
        transition: opacity 0.1s ease;
    }
   
    .quota-critical {
        animation: none;
    }
}
/* ========================================
   UTILITAIRES RÔLES
   ======================================== */
/* Classes helper pour affichage conditionnel */
.show-for-directeur { display: none; }
.show-for-animateur { display: none; }
.show-for-employe-velo { display: none; }
.user-directeur .show-for-directeur { display: inherit; }
.user-animateur .show-for-animateur { display: inherit; }
.user-employe-velo .show-for-employe-velo { display: inherit; }
/* Classe pour body selon rôle utilisateur */
body.user-directeur {
    --user-role-color: oklch(0.53 0.12 248);
}
body.user-animateur {
    --user-role-color: oklch(0.62 0.12 154);
}
body.user-employe-velo {
    --user-role-color: oklch(0.69 0.17 42);
}
body.user-partenaire {
    --user-role-color: oklch(0.76 0.15 75);
}
.velo-apartment-info {
    text-align: center;
    margin: 15px 0;
}
.combined-info {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
}
.velo-count {
    font-size: 72px;
    font-weight: 900;
}
.separator {
    margin: 0 15px;
    font-size: 48px;
}
.apartment-code {
    font-size: 48px;
    font-weight: 700;
}
.qr-code-display {
    margin: 20px auto;
    display: flex;
    justify-content: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.qr-error {
    color: #ff6b6b;
    text-align: center;
    padding: 20px;
    font-weight: bold;
}
/* Texte informatif navettes - uniquement directeur */
.navette-info {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 120px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.navette-info.director-only {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}
.navette-info.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.navette-info.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
}
.navette-info-main {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 2px;
}
.navette-info-detail {
    font-size: 10px;
    opacity: 0.9;
    font-weight: normal;
}
/* Assurer l'espace au-dessus de l'icône */
.transport-option,
[data-transport="navette"],
.navette-card {
    position: relative !important;
    margin-top: 50px;
    overflow: visible !important;
}
/* Animation subtile */
.navette-info.director-only {
    animation: infoGlow 3s ease-in-out infinite;
}
@keyframes infoGlow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 3px 12px rgba(76, 175, 80, 0.5);
    }
}
/* Responsive */
@media (max-width: 768px) {
    .navette-info {
        top: -40px;
        font-size: 11px;
        padding: 5px 10px;
        min-width: 100px;
    }
   
    .navette-info-main {
        font-size: 12px;
    }
   
    .navette-info-detail {
        font-size: 9px;
    }
}
/* Suppression complète des styles de badges */
.notification-badge,
.transport-badge {
    display: none !important;
}
/* ========================================
   🎛️ MENU SPÉCIALISÉ HEADER - STYLES
   Menu déroulant depuis le header avec croix centrale
   ======================================== */
/* ========================================
   🎛️ MENU SPÉCIALISÉ HEADER - STYLES CORRIGÉS
   ======================================== */
/* Conteneur central du header */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}
/* Croix/Moins dans le header */
.special-menu-trigger {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.special-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.special-menu-trigger.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
/* Panneau principal - FIX CENTRAGE */
.special-menu-panel {
    position: fixed !important;
    top: var(--header-height) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 400px !important;
    max-width: calc(100vw - 20px) !important;
    background: white !important;
    border-radius: 0 0 16px 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
    z-index: 1001 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.special-menu-panel.show {
    opacity: 1 !important;
    visibility: visible !important;
}
.special-menu-panel.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
}
/* Contenu du menu */
.special-menu-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}
/* Sections du menu */
.special-menu-section {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.special-menu-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.section-header h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
.section-icon {
    font-size: 16px;
}
.section-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #555;
}
.menu-item:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    transform: translateY(-1px);
}
.item-icon {
    font-size: 14px;
}
.item-label {
    flex: 1;
    text-align: left;
}
/* Loading et erreur */
.special-menu-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #666;
}
.special-menu-loading .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}
.special-menu-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #666;
    text-align: center;
}
.error-icon {
    font-size: 24px;
    margin-bottom: 10px;
}
.retry-button {
    margin-top: 15px;
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.retry-button:hover {
    background: #1976D2;
}
/* Footer du menu */
.special-menu-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
    color: #999;
}
/* Responsive tablettes */
@media (max-width: 768px) {
    .special-menu-trigger {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
   
    .special-menu-panel {
        width: 350px !important;
        max-width: calc(100vw - 16px) !important;
    }
}
/* Responsive mobiles */
@media (max-width: 480px) {
    .special-menu-trigger {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
   
    .special-menu-panel {
        width: 320px !important;
        max-width: calc(100vw - 10px) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
   
    .special-menu-content {
        padding: 15px;
        max-height: 350px;
    }
   
    .menu-item {
        padding: 10px;
        font-size: 14px;
    }
}
/* ========================================
   🔧 CORRECTION UI APERÇU IMAGE - ÉVITER TRONCATURE ET MASQUAGE BOUTONS
   Ajouts pour .image-preview et .button-container dans .write-zone
   ======================================== */
/* Aperçu image - Layout flex robuste sans chevauchement */
.image-preview {
  display: flex !important;
  align-items: center !important;
  gap: var(--space-sm) !important; /* Réduit pour mobile */
  margin-top: var(--space-sm) !important;
  padding: var(--space-sm) !important;
  background: var(--gray-50) !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--gray-200) !important;
  flex-wrap: nowrap !important; /* AJOUT : Empêche wrap qui masque boutons */
  max-width: 100% !important;
  overflow: hidden !important; /* AJOUT : Contient sans débordement */
  box-sizing: border-box !important;
}
/* Image miniature - Taille responsive, sans troncature */
.image-preview img {
  max-width: 120px !important; /* AJOUT : Augmenté de 100px pour visibilité */
  max-height: 120px !important; /* AJOUT : Augmenté de 100px */
  border-radius: var(--radius-sm) !important;
  object-fit: contain !important; /* AJOUT : 'contain' au lieu de 'cover' pour aspect ratio complet */
  flex-shrink: 0 !important; /* AJOUT : Empêche rétrécissement forcé */
  box-shadow: var(--shadow-1) !important;
  transition: transform var(--transition-fast) !important;
}
.image-preview img:hover {
  transform: scale(1.02) !important; /* Effet hover préservé */
}
/* Texte fichier - Non tronqué, flex pour adaptation */
.image-preview span {
  margin-left: var(--space-sm) !important;
  font-size: var(--font-size-xs) !important;
  color: var(--gray-600) !important;
  flex: 1 !important; /* AJOUT : Prend l'espace disponible sans push */
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: calc(100% - 140px) !important; /* AJOUT : Limite pour éviter overflow */
}
/* Bouton suppression - Position stable */
.image-preview .remove-image {
  background: var(--error-color) !important;
  color: var(--white) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: var(--font-size-sm) !important;
  transition: var(--transition-base) !important;
  flex-shrink: 0 !important; /* AJOUT : Empêche rétrécissement */
  margin-left: auto !important; /* AJOUT : Pousse à droite sans impact sur boutons */
}
.image-preview .remove-image:hover {
  background: #D32F2F !important;
  transform: scale(1.1) !important;
}
/* Write Zone - Assure visibilité boutons après insertion aperçu */
.write-zone .button-container {
  display: flex !important;
  gap: var(--space-sm) !important;
  justify-content: flex-end !important; /* AJOUT : Aligne boutons à droite, stable */
  align-items: center !important;
  margin-top: var(--space-sm) !important;
  position: relative !important;
  z-index: 1 !important; /* AJOUT : Au-dessus de l'aperçu si chevauchement */
  flex-wrap: nowrap !important; /* AJOUT : Empêche wrap des boutons */
  min-height: 40px !important;
}
.write-zone .button-container .send-button {
  order: 3 !important; /* AJOUT : Force position finale pour visibilité */
  flex-shrink: 0 !important;
  min-width: 80px !important; /* AJOUT : Taille minimale pour mobile */
}
/* Responsive mobile - Aperçu plus compact */
@media (max-width: 480px) {
  .image-preview {
    gap: var(--space-xs) !important;
    padding: var(--space-xs) !important;
    margin-top: var(--space-xs) !important;
  }
 
  .image-preview img {
    max-width: 80px !important;
    max-height: 80px !important;
  }
 
  .image-preview span {
    font-size: var(--font-size-xs) !important;
    max-width: calc(100% - 100px) !important;
  }
 
  .write-zone .button-container {
    gap: var(--space-xs) !important;
    min-height: 32px !important;
  }
 
  .write-zone .button-container .send-button {
    min-width: 60px !important;
    font-size: 12px !important;
  }
}
/* Animation d'apparition de l'aperçu pour fluidité */
.image-preview {
  animation: fadeIn 0.2s ease-out !important;
}
/* Dynamically increase height when preview present */
.write-zone.has-image-preview {
    max-height: 200px !important; /* Enough for input + preview + buttons */
    overflow-y: auto !important; /* Scroll if still too tall (e.g., multi-line input) */
    overscroll-behavior: contain !important; /* Prevent pull-to-refresh issues */
}
/* On mobile, compact further */
@media (max-width: 480px) {
    .write-zone.has-image-preview {
        max-height: 180px !important;
    }
   
    .image-preview img {
        max-width: 60px !important; /* Smaller to fit better */
        max-height: 60px !important;
    }
   
    .image-preview span {
        max-width: calc(100% - 90px) !important; /* Adjust for smaller img + button */
    }
}
/* Ensure buttons always visible at bottom */
.write-zone .button-container {
    position: sticky !important;
    bottom: 0 !important; /* Stick to bottom of writeZone if scrolled */
    background: white !important; /* Prevent transparency issues */
    padding-top: var(--space-xs) !important;
    z-index: 1 !important;
}
/* ========================================
   FIN PARTIE 4 - RESPONSIVE & OPTIMISATIONS CORRIGÉES
   ======================================== */

/* 🔧 CORRECTION AVANCÉE : APERÇU IMAGE MOBILE - ÉVITER MASQUAGE BOUTONS */
@media (max-width: 480px) {
  .write-zone.has-image-preview {
    max-height: 220px !important; /* Augmente pour input + preview + buttons */
    padding-bottom: var(--space-md) !important; /* Espace pour sticky buttons */
  }

  .image-preview {
    flex-direction: column !important; /* Stack vertical sur mobile pour économiser largeur */
    align-items: flex-start !important;
    gap: var(--space-xs) !important;
    max-height: 100px !important; /* Limite hauteur pour ne pas pousser buttons */
    overflow: hidden !important;
  }

  .image-preview img {
    max-width: 100% !important; /* Pleine largeur conteneur */
    max-height: 60px !important;
    width: auto !important;
  }

  .image-preview > div { /* Wrapper pour span + remove */
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .image-preview span {
    flex: 1 !important;
    max-width: calc(100% - 30px) !important; /* Ajuste pour remove */
    font-size: 0.7rem !important;
  }

  .write-zone .button-container {
    position: sticky !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important; /* Semi-transparent si scroll */
    backdrop-filter: blur(10px) !important;
    border-top: 1px solid var(--gray-200) !important; /* Séparation visuelle */
    z-index: 2 !important; /* Au-dessus de preview */
    padding: var(--space-xs) !important;
  }
}

/* Uniformité Globale : Ajout pour Tous Écrans */
.image-preview {
  flex-wrap: wrap !important; /* Permet wrap si nécessaire, au lieu de nowrap strict */
}

/* QR mini icon override: use real QR visual instead of text */
.qr-mini::before {
  content: none !important;
}
.qr-mini canvas,
.qr-mini img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.qr-mini-fallback {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #111827;
  border-radius: 4px;
  background-color: #ffffff;
  background-image:
    linear-gradient(90deg, #111827 0 2px, transparent 2px 4px),
    linear-gradient(#111827 0 2px, transparent 2px 4px);
  background-size: 4px 4px, 4px 4px;
  background-position: 0 0, 0 0;
}
.qr-mini-fallback::before,
.qr-mini-fallback::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  border: 2px solid #111827;
  background: #fff;
}
.qr-mini-fallback::before {
  top: 2px;
  left: 2px;
}
.qr-mini-fallback::after {
  top: 2px;
  right: 2px;
}

/* QR tab icon readability override (black on white) */
#qrCode .qr-mini {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px !important;
  padding: 2px !important;
  box-sizing: border-box;
}
#qrCode .qr-mini img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: contain;
  image-rendering: pixelated;
}


/* Info media cards: tap/click opens full image modal */
.info-media-card[data-info-media-open="1"] {
  cursor: zoom-in;
}

.info-media-card[data-info-media-open="1"]:focus-visible {
  outline: 2px solid var(--color-primary, #1f6feb);
  outline-offset: 2px;
}

.info-media-modal {
  z-index: 1406 !important;
}

.info-media-modal-content {
  width: min(96vw, 900px);
  max-width: 96vw;
  animation: none;
}

.info-media-modal-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.info-media-modal-loading {
  width: min(88vw, 560px);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--gray-600);
  font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 220% 100%;
  animation: loading 1.2s ease-in-out infinite;
}

.info-media-modal-body img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 64vh;
  border-radius: 10px;
  object-fit: contain;
}
