:root {
  --r: 16px;
  --r2: 22px;
  --t: .18s ease;
  --shadow-soft: 0 6px 18px rgba(0,0,0,.18);
  --shadow-glow: 0 0 20px rgba(57, 182, 255, 0.3);
  --logo-size: 72px; /* Hauteur PC (réduit de 20% : 90px -> 72px) */
  --logo-size-sm: 64px; /* Hauteur smartphone (réduit de 20% : 80px -> 64px) */
  --logo-width: 136px; /* Largeur PC (réduit de 20% : 170px -> 136px) */
  --logo-width-sm: 120px; /* Largeur smartphone (réduit de 20% : 150px -> 120px) */
}

@media (max-width: 768px) {
  :root { --logo-size: var(--logo-size-sm); }
}

/* Fix défilement */
html { scroll-behavior: auto; overflow-anchor: auto; }
body { overscroll-behavior-y: contain; }

html[data-theme="dark"] {
  --bg: #0a0e1f;
  --bg-gradient: linear-gradient(135deg, #0a0e1f 0%, #1a1f3a 100%);
  --panel: #11142b;
  --card: #14173a;
  --card-hover: #1a1f44;
  --line: #24284d;
  --txt: #eaf1ff;
  --muted: #aab7ff;
  --accent: #39b6ff;
  --accent2: #42ead8;
  --accent-glow: rgba(57, 182, 255, 0.4);
  --ok: #2fd08a;
  --warn: #f2c14e;
  --bad: #ff6b7a;
  --btn-text-dark: #031018;
  --lock: #7ea3ff;
  --nav-bg: #14183a;
  --nav-bg-hover: #182044;
}

html[data-theme="light"] {
  --bg: #f6f8ff;
  --bg-gradient: linear-gradient(135deg, #f6f8ff 0%, #e8ecff 100%);
  --panel: #ffffff;
  --card: #ffffff;
  --card-hover: #f8faff;
  --line: #dde3ff;
  --txt: #172045;
  --muted: #5a70ca;
  --accent: #2e8fff;
  --accent2: #39d7c9;
  --accent-glow: rgba(46, 143, 255, 0.3);
  --ok: #1aa06c;
  --warn: #c28a0c;
  --bad: #d64a5a;
  --btn-text-dark: #ffffff;
  --lock: #2e8fff;
  --nav-bg: #ffffff;
  --nav-bg-hover: #f0f4ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent2); }

/* Header / Nav */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 24, 58, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3px 20px; /* Padding vertical réduit de 30% (16px -> ~3px) */
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px; /* Réduit de 30% (10px -> 7px) */
  /* Hauteur déterminée par le logo et les autres éléments */
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px; /* Réduit de 30% (12px -> 8px) */
  color: var(--txt);
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 18px;
  min-height: calc(var(--logo-size) * 0.7); /* Réduit de 30% pour réduire hauteur header */
  padding: 0; /* Pas de padding supplémentaire */
}

.logo img {
  width: var(--logo-width);
  height: var(--logo-size);
  min-width: var(--logo-width);
  min-height: var(--logo-size);
  max-width: var(--logo-width);
  max-height: var(--logo-size);
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  transition: transform var(--t), filter var(--t);
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  background: transparent;
}

.logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

#logo-img[style*="display: none"] + .logo-text {
  margin-left: 0;
}

.logo-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .logo {
    gap: 6px; /* Réduit de 30% (8px -> 6px) */
    font-size: 16px;
    min-height: calc(var(--logo-size-sm) * 0.7); /* Réduit de 30% pour réduire hauteur header */
  }
  
  .logo img {
    width: var(--logo-width-sm) !important;
    height: var(--logo-size-sm) !important;
    min-width: var(--logo-width-sm) !important;
    min-height: var(--logo-size-sm) !important;
    max-width: var(--logo-width-sm) !important;
    max-height: var(--logo-size-sm) !important;
  }
  
  .logo-text {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  :root {
    --logo-size-sm: 52px; /* Hauteur pour petits smartphones (réduit de 20% : 65px -> 52px) */
    --logo-width-sm: 96px; /* Largeur pour petits smartphones (réduit de 20% : 120px -> 96px) */
  }
}

/* Theme Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; /* Réduit pour réduire hauteur header */
  height: 26px; /* Réduit pour réduire hauteur header */
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--txt);
  cursor: pointer;
  transition: all var(--t);
  padding: 4px; /* Réduit pour réduire hauteur header */
  outline: none;
}

.theme-toggle:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: scale(1.05);
}

.theme-toggle:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent), transparent 60%);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform var(--t);
}

/* Navigation Desktop */
.nav-desktop {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
}

.nav-desktop a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 18px; /* Réduit de 30% (10px -> 5px vertical, 20px -> 18px horizontal) */
  border-radius: 999px;
  color: var(--txt);
  background: var(--nav-bg);
  border: 1px solid var(--line);
  overflow: hidden;
  background-clip: padding-box;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t), box-shadow var(--t);
  outline: none;
  font-weight: 600;
  font-size: 0.85em; /* Réduction de la taille de police pour réduire hauteur */
}

.nav-desktop a:hover {
  background: var(--nav-bg-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(57, 182, 255, 0.2);
}

.nav-desktop a:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent), transparent 60%);
  border-color: color-mix(in oklab, var(--accent), transparent 40%);
}

.nav-desktop a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--btn-text-dark) !important;
  font-weight: 800;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* Bouton Déconnexion - même style que les autres boutons (PC et mobile) */
.nav-logout {
  /* Utilise les mêmes styles que les autres boutons nav */
  border: 1px solid var(--line) !important;
  background: var(--nav-bg) !important;
  color: var(--txt) !important;
  font-weight: 600;
}

.nav-logout:hover {
  background: var(--nav-bg-hover) !important;
  border-color: var(--line) !important;
}

/* Conteneur pour les contrôles mobile (theme + hamburger) */
.mobile-header-controls {
  display: none;
  align-items: center;
  gap: 8px; /* Réduit de 30% (12px -> 8px) */
}

/* Menu Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 3px; /* Réduit pour réduire hauteur header */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px; /* Réduit pour réduire hauteur header */
  z-index: 101; /* Au-dessus du menu mobile */
  position: relative;
}

.theme-toggle-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4px; /* Réduit pour réduire hauteur header */
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--txt);
  transition: all var(--t);
  width: 26px; /* Réduit pour réduire hauteur header */
  height: 26px; /* Réduit pour réduire hauteur header */
}

.theme-toggle-mobile:hover {
  background: var(--card);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .mobile-header-controls {
    display: flex;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .theme-toggle-mobile {
    display: flex;
  }
  
  .nav-desktop {
    display: none;
  }
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--txt);
  border-radius: 3px;
  transition: all var(--t);
}

/* Menu hamburger en blanc sur mobile */
@media (max-width: 768px) {
  .menu-toggle span {
    background: #ffffff; /* Blanc pour les traits du menu hamburger */
  }
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Navigation Mobile */
.nav-mobile {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  flex-direction: column;
  padding: 20px;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 98; /* Au-dessus du header mais en dessous du bouton hamburger */
  transform: translateY(-100%);
  opacity: 0;
  transition: transform var(--t), opacity var(--t);
}

.nav-mobile.active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.nav-mobile a {
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--txt);
  text-align: center;
  font-weight: 600;
  transition: all var(--t);
}

.nav-mobile a:hover,
.nav-mobile a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--btn-text-dark);
  transform: translateX(5px);
}

/* Champ facultatif avec fond vert citron */
.field-optional {
  background: linear-gradient(135deg, rgba(255, 255, 0, 0.15), rgba(200, 255, 0, 0.15));
  border: 1px solid rgba(200, 255, 0, 0.3);
  border-radius: 12px;
  padding: 12px;
  margin-left: auto;
}

@media (max-width: 950px) {
  .field-optional {
    margin-left: 0;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  padding: 12px 24px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--btn-text-dark);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  font-weight: 800;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(57, 182, 255, 0.4), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--card);
  color: var(--txt);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(57, 182, 255, 0.1);
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
}

.tg-header,
.hero-telegram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--btn-text-dark);
  font-weight: 800;
  font-size: 14px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  transition: all var(--t);
  text-decoration: none;
  cursor: pointer;
}

.tg-header:hover,
.hero-telegram:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(57, 182, 255, 0.4);
}

/* Layout & text */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px;
  min-height: calc(100vh - 200px);
}

#home {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.home-content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  transition: all var(--t);
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.hero-card {
  background: linear-gradient(135deg, rgba(57, 182, 255, 0.1), rgba(66, 234, 216, 0.1));
  border: 1px solid rgba(57, 182, 255, 0.2);
  text-align: center;
}

.hero-text {
  text-align: center;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: nowrap;
}

.hero-buttons .hero-telegram,
.hero-buttons .btn-primary {
  flex: 0 0 auto;
  width: auto;
  min-width: 220px;
  max-width: 220px;
  white-space: nowrap;
  text-align: center;
  font-weight: 800;
}

.hero-buttons .hero-telegram span {
  display: inline;
}

/* Carrousel d'images */
.image-carousel-container {
  width: 100%;
  margin: 32px auto;
  max-width: 1100px;
  padding: 0 20px;
}

@media (max-width: 768px) {
  .image-carousel-container {
    padding: 0 10px; /* Réduit de moitié l'espace sur les côtés (20px -> 10px) */
    margin-bottom: 6.4px; /* Réduit de 80% l'espace en dessous (32px -> 6.4px) */
  }
}

.image-carousel {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

@media (max-width: 768px) {
  .image-carousel {
    min-height: 375px;
  }
}

.image-carousel img {
  transition: opacity 0.5s ease-in-out;
  border-radius: 16px;
}

/* Texte descriptif centré */
.description-text {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
}

.description-text p {
  text-align: justify;
}

/* Réduction de l'espace entre les deux premières lignes uniquement sur PC */
@media (min-width: 769px) {
  .description-text p br.reduce-line-spacing {
    display: block;
    line-height: 0.5; /* Réduit de moitié l'espace */
  }
}

/* Puces modernes */
.modern-features {
  display: flex;
  justify-content: center;
  align-items: stretch; /* Assure que toutes les puces ont la même hauteur */
  gap: 40px;
  margin: 40px auto;
  max-width: 1000px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.feature-bullet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 30px;
  background: linear-gradient(135deg, rgba(57, 182, 255, 0.1), rgba(66, 234, 216, 0.1));
  border: 1px solid rgba(57, 182, 255, 0.3);
  border-radius: 20px;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
  flex: 1 1 0; /* Assure que toutes les puces ont la même largeur */
  min-width: 0; /* Permet au flex de fonctionner correctement */
  max-width: 100%; /* Empêche le débordement */
}

.feature-bullet::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(57, 182, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.feature-bullet:hover::before {
  left: 100%;
}

.feature-bullet:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(57, 182, 255, 0.3);
  border-color: var(--accent);
}

.bullet-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.feature-bullet span {
  color: var(--txt);
  font-weight: 600;
  font-size: 16px;
  text-align: center;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .image-carousel {
    flex-direction: column;
    gap: 0;
  }

  .hero-buttons {
    flex-direction: row;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-buttons .hero-telegram,
  .hero-buttons .btn-primary {
    min-width: 180px !important;
    max-width: 180px !important;
    width: 180px !important;
    font-size: 13px;
    padding: 10px 16px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
  }
  
  .hero-buttons .hero-telegram svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
  }

  .modern-features {
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: stretch; /* Assure que toutes les puces ont la même hauteur */
  }

  .feature-bullet {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 100% !important; /* Force la même hauteur minimale */
    padding: 15px 8px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    height: auto !important; /* Permet au flex de gérer la hauteur */
  }
  
  /* Assure que toutes les puces ont exactement la même hauteur */
  .modern-features .feature-bullet {
    height: 100%;
  }

  .feature-bullet span {
    font-size: 12px;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    text-align: center;
  }

  .description-text {
    margin: 30px auto;
  }
}

@media (max-width: 480px) {
  .image-carousel {
    min-height: 300px;
  }

  .hero-buttons .hero-telegram,
  .hero-buttons .btn-primary {
    min-width: 180px !important;
    max-width: 180px !important;
    width: 180px !important;
    font-size: 12px;
    padding: 10px 14px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
  }
  
  .hero-buttons .hero-telegram svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
  }
}

.grid {
  display: grid;
  gap: 16px;
}

.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Grille commissions : 2x2 sur mobile */
.commissions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Grille paramètres : 2x2 sur mobile */
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Grille profil chauffeur : 2 colonnes, 3 lignes + 1 ligne seule */
.driver-profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Grille pièces jointes chauffeur : 2 colonnes, 3 lignes */
.driver-docs-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 950px) {
  .g2, .g3 { grid-template-columns: 1fr; }
  
  /* Commissions : reste en 2x2 sur mobile */
  .commissions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* Paramètres : reste en 2x2 sur mobile */
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* Profil chauffeur : reste en 2 colonnes sur mobile */
  .driver-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  /* Pièces jointes : reste en 2 colonnes sur mobile */
  .driver-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

h1 {
  font-size: 32px;
  margin: 6px 0 8px;
  background: linear-gradient(135deg, var(--txt), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 22px;
  margin: 0 0 12px;
  color: var(--txt);
}

h3 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--muted);
}

.muted { color: var(--muted); }

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.input,
select,
textarea,
.file {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--txt);
  background: var(--panel);
  border: 1px solid var(--line);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: none;
  transition: all var(--t);
  caret-color: var(--accent);
  font-family: inherit;
}

.input::placeholder,
textarea::placeholder {
  color: #8a95d2;
}

.input:focus,
select:focus,
textarea:focus,
.file:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 182, 255, 0.25);
  background: var(--card);
}

.input.error,
select.error,
textarea.error,
.file.error {
  border-color: var(--bad) !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 122, 0.25) !important;
}

.err {
  color: var(--bad);
  font-size: 12px;
  margin-top: 4px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

/* Wrapper pour tableaux avec scroll horizontal sur mobile */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 12px;
}

.table-wrapper table {
  margin-top: 0;
  min-width: 600px; /* Largeur minimale pour tableaux complexes */
}

th, td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-block;
  font-weight: 600;
}

.s-pending {
  background: rgba(57, 182, 255, 0.12);
  color: #2a7fb0;
  border: 1px solid rgba(57, 182, 255, 0.33);
}

.s-ok {
  background: rgba(47, 208, 138, 0.12);
  color: #1d8b64;
  border: 1px solid rgba(47, 208, 138, 0.33);
}

.s-warn {
  background: rgba(242, 193, 78, 0.16);
  color: #a17716;
  border: 1px solid rgba(242, 193, 78, 0.33);
}

.lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--lock);
  border: 1px solid rgba(126, 163, 255, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
  margin-top: 8px;
}

.lock svg {
  width: 14px;
  height: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 60;
}

.modal .dialog {
  max-width: 520px;
  animation: modalSlideIn 0.3s ease;
}

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

footer {
  margin-top: 40px;
  padding: 36px 22px;
  color: #8a95d2;
  border-top: 1px solid var(--line);
  text-align: center;
}

.hint-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  margin-top: 2px;
  background: color-mix(in oklab, var(--accent), white 12%);
  color: var(--btn-text-dark);
  cursor: help;
  user-select: none;
  margin-left: 4px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Responsive improvements */
@media (max-width: 768px) {
  main {
    padding: 16px;
  }

  .card {
    padding: 16px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .toolbar .btn,
  .toolbar .input,
  .toolbar input[type="file"] {
    width: 100%;
  }

  /* Tables responsive - scroll horizontal via wrapper */
  .table-wrapper {
    border-radius: 8px;
    border: 1px solid var(--line);
  }

  th, td {
    padding: 10px 6px;
    font-size: 12px;
    min-width: 80px;
  }

  /* Espace admin - améliorations spécifiques */
  #admin .card,
  #admin-driver .card {
    padding: 16px;
    margin-top: 12px;
  }

  #admin h2,
  #admin-driver h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  /* Grilles admin - toujours en colonne unique sur mobile */
  #admin .grid.g2,
  #admin-driver .grid.g2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Toolbar admin - empiler les éléments */
  #admin .toolbar,
  #admin-driver .toolbar {
    flex-direction: column;
  }

  #admin .toolbar .input,
  #admin .toolbar input[type="file"],
  #admin .toolbar .btn,
  #admin-driver .toolbar .input,
  #admin-driver .toolbar .btn {
    width: 100%;
    margin: 0;
  }

  /* Canvas QR code responsive */
  #qr-canvas {
    max-width: 100%;
    height: auto;
  }

  /* Liste plateformes */
  #a-platforms {
    padding-left: 16px;
    font-size: 14px;
  }

  /* Champs admin - meilleur espacement */
  #admin .field,
  #admin-driver .field {
    margin-bottom: 12px;
  }

  /* Tableaux admin - colonnes plus compactes */
  #admin-pending,
  #admin-validated,
  #a-preview {
    font-size: 12px;
  }

  #admin-pending th,
  #admin-pending td,
  #admin-validated th,
  #admin-validated td,
  #a-preview th,
  #a-preview td {
    padding: 8px 4px;
    font-size: 11px;
  }
}

/* Responsive très petits écrans */
@media (max-width: 480px) {
  main {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 14px;
  }

  /* Tableaux encore plus compacts */
  th, td {
    padding: 8px 4px;
    font-size: 11px;
  }

  /* Boutons plus petits */
  .btn {
    padding: 8px 16px;
    font-size: 12px;
  }

  /* Inputs plus compacts */
  .input,
  select,
  textarea {
    padding: 10px 12px;
    font-size: 14px;
  }

  /* Espace admin - padding réduit */
  #admin .card,
  #admin-driver .card {
    padding: 12px;
  }

  #admin h2,
  #admin-driver h2 {
    font-size: 16px;
  }
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Loading states */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Smooth transitions */
* {
  transition-property: background-color, border-color, color, transform, box-shadow, opacity;
  transition-duration: 0.18s;
  transition-timing-function: ease;
}

/* QR Code dimensions */
#qr-code-image {
  width: 250px;
  height: 250px;
}

@media (max-width: 768px) {
  #qr-code-image {
    width: 200px;
    height: 200px;
  }
}

