/* =========================================================
   WatiTaxi — feuille de style unique (style WhatsApp/Uber)
   v=35 — topbar fixed + env(safe-area-inset-top) iOS + padding screens
   ========================================================= */
:root {
  --green: #00A86B;
  --green-2: #00C882;
  --green-dark: #007A4D;
  --green-soft: #E6F7F1;
  --black: #1F2937;
  --muted: #6B7280;
  --bg: #F3F4F6;
  --white: #FFFFFF;
  --line: #E5E7EB;

  --dispatch-red: #D32F2F;
  --urgent-red: #EF4444;
  --accepted-blue: #1976D2;
  --in-progress-blue: #1976D2;
  --completed-gray: #9CA3AF;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);

  --bottom-nav-h: 68px;
  --topbar-h: 64px;
  /* Hauteur réelle du header planning (1 ligne : 14px + 40px bouton + 16px) */
  --planning-header-h: 70px;

  /* ── Z-index scale ── */
  --z-base: 1;
  --z-nav: 10;
  --z-topbar: 100;
  --z-modal: 200;
  --z-overlay: 500;
  --z-toast: 900;
  --z-splash: 9999;
}

* { box-sizing: border-box; }

/* ── ANTI-ZOOM iOS / mobile ── */
input, select, textarea, button {
  font-size: 16px; /* empêche le zoom auto sur focus iOS */
  touch-action: manipulation; /* supprime le délai 300ms + double-tap zoom */
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;             /* bloque tout débordement horizontal */
  touch-action: pan-y;            /* scroll vertical uniquement, pas de pinch-zoom */
  -webkit-text-size-adjust: 100%; /* empêche Safari d'agrandir le texte en rotation */
  overscroll-behavior: none;      /* supprime le bounce iOS qui simule un agrandissement */
  margin: 0; padding: 0;
  background: #00A86B;   /* VERT : iOS échantillonne le fond du body pour la barre d'état (PWA). Le contenu reste gris via .screen */
  color: var(--black);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ── Barre d'état iOS (PWA standalone) ──
   iOS échantillonne le fond de la racine <html> pour colorer la barre système.
   On met l'élément racine en VERT pour que la barre se fonde avec les headers.
   Le body + .screen restent gris (--bg) et couvrent tout le contenu, donc le vert
   n'apparaît QUE dans le liseré de la barre d'état (au-dessus du viewport).
   La carte thermique hors-ligne pose son propre fond noir en inline (home.js),
   qui surcharge cette règle → cette page reste intacte. */
html { background-color: #00A86B; }

/* ── Accessibilité : réduit les animations si demandé par l'OS ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.screen { display: none; min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.screen.active { display: block; }

.container { max-width: 480px; margin: 0 auto; padding: 16px; }
/* Contenu principal : toujours visible au-dessus de la bottom nav + safe-area */
.container-bottom-nav { padding-bottom: 120px; } /* nav 68px + safe-area iOS max 34px + marge */

[hidden] { display: none !important; }

/* ====== LOGO ====== */
.logo { font-weight: 800; letter-spacing: -0.5px; display: inline-flex; align-items: baseline; user-select: none; }
.logo-wati { color: var(--black); }
.logo-taxi { color: var(--green); }
.logo-xl { font-size: 48px; }
.logo-lg { font-size: 28px; }
.logo-md { font-size: 22px; }
.logo-sm { font-size: 18px; }

/* Logo bulle ronde "W" */
.logo-bubble {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C882, #00A86B);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,168,107,0.30);
  position: relative;
  flex-shrink: 0;
}
.logo-bubble::after {
  content: "";
  position: absolute;
  bottom: -2px; right: 6px;
  width: 12px; height: 12px;
  background: linear-gradient(135deg, #00C882, #00A86B);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.logo-bubble span {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.logo-bubble-sm { width: 36px; height: 36px; }
.logo-bubble-sm span { font-size: 18px; }
.logo-bubble-xl { width: 64px; height: 64px; }
.logo-bubble-xl span { font-size: 32px; }

/* ====== TITRES ====== */
.title { font-size: 26px; margin: 8px 0 4px; font-weight: 700; }
.title-sm { font-size: 20px; margin: 8px 0; font-weight: 700; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

/* ====== TOPBAR ====== */
/*
   position: fixed garantit que le header reste collé en haut sur TOUS les
   navigateurs mobiles, y compris iOS PWA (position:sticky y est peu fiable).
   padding-top: env(safe-area-inset-top) respecte la barre de statut iOS/Android
   avec viewport-fit=cover.
*/
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  background: #00A86B;
  border-bottom: none;
  padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 10px;
  min-height: var(--topbar-h);
}

/*
   Chaque screen qui possède un .topbar fixe doit commencer
   en dessous de lui : topbar-h + safe-area-inset-top.
*/
#screen-home,
#screen-rides,
#screen-credits,
#screen-chat,
#screen-inbox,
#screen-messages,
#screen-profile,
#screen-availability {
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
}
/* #screen-proposed-planning a son propre header vert (.ap-topbar, sticky,
   gère lui-même la safe-area). Ne PAS réserver l'espace du .topbar global,
   sinon une bande vide apparaît au-dessus du header (blanc en haut iOS). */
.topbar-title { font-size: 17px; margin: 0; font-weight: 600; flex: 1; text-align: center; color: #fff; }
/* Icônes dans tous les topbar → blanches */
.topbar .icon-btn svg path,
.topbar .icon-btn svg rect,
.topbar .icon-btn svg circle,
.topbar .icon-btn svg line,
.topbar .icon-btn svg polyline { stroke: rgba(255,255,255,0.92) !important; }

.topbar-actions { display: flex; gap: 4px; align-items: center; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }

.topbar-home { padding: max(10px, env(safe-area-inset-top, 10px)) 14px 10px; }
.topbar-chat .chat-head { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar-chat .chat-head-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-chat .chat-head-sub { font-size: 12px; color: var(--muted); }

.icon-btn {
  background: transparent; border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer; position: relative;
  color: var(--black);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.icon-btn-circle { background: var(--bg); }
.icon-btn-circle:hover { background: var(--line); }

.bell-dot {
  position: absolute; top: 8px; right: 8px;
  width: 9px; height: 9px;
  background: var(--green);
  border: 2px solid var(--white);
  border-radius: 50%;
}

/* FAB création */
.fab-create {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,168,107,0.35);
}
.fab-create:hover { background: var(--green-dark); }

/* ── Banner notification push ──────────────────────── */
#fcm-notif-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  left: 12px;
  right: 12px;
  background: #1F2937;
  color: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 9999;
  animation: fcm-slide-up 0.3s ease;
}
@keyframes fcm-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.fcm-banner-icon { font-size: 22px; flex-shrink: 0; }
.fcm-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fcm-banner-text strong { font-size: 14px; font-weight: 600; }
.fcm-banner-text span   { font-size: 12px; opacity: 0.7; }
.fcm-banner-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.fcm-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  line-height: 1;
}

/* ====== BOTTOM NAV ====== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 600; /* au-dessus des overlays carte (z-index:500) */
  max-width: 480px;
  margin: 0 auto;
}
.nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  position: relative;
}
.nav-btn.active { color: var(--green); }
.nav-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 8px; }
.nav-btn.active svg path,
.nav-btn.active svg circle { stroke: var(--green); }

/* Badge rouge notifications sur le bouton Répertoire */
.nav-btn-icon-wrap { position: relative; display: inline-flex; }
.nav-notif-badge {
  position: absolute;
  top: -4px; right: -6px;
  background: #EF4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #fff;
  line-height: 1;
}
.nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 22px);
  background: var(--urgent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 18px;
  padding: 1px 5px;
  line-height: 14px;
}

/* ====== BOUTONS ====== */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform .05s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
a.btn { text-decoration: none; }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: var(--white); color: var(--black); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--dispatch-red); color: #fff; }
.btn-reset-demo {
  background: var(--white); color: var(--muted);
  border: 1.5px dashed var(--line);
  font-size: 14px;
}
.btn-block { display: flex; width: 100%; margin-top: 8px; }
.btn-pill  { border-radius: 999px; padding: 10px 16px; min-height: 44px; font-size: 14px; }
.btn-sm    { padding: 8px 12px; min-height: 44px; font-size: 13px; border-radius: 10px; }

/* ====== FORMULAIRES ====== */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 16px; color: var(--black);
  font-family: inherit; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--green);
  border-color: transparent;
}
.field-check {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: pointer;
}
.field-check input { width: 20px; height: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ====== SEARCH BAR ====== */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--white);
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 12px 16px;
  margin-top: 8px;
}
.search-bar input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
}

/* ====== FILTER CHIPS ====== */
.filters {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter-chip {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  color: var(--black);
  display: inline-flex; align-items: center;
}
.filter-chip.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.filter-chip:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ====== DEPT SELECT ====== */
.dept-select {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 12px 0;
  overflow: hidden;
}
.dept-select summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px;
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  list-style: none;
}
.dept-select summary::-webkit-details-marker { display: none; }
.dept-select summary span:first-of-type { flex: 1; }
.dept-select[open] .dept-chevron { transform: rotate(180deg); }
.dept-chevron { transition: transform 0.15s; }

.dept-list { border-top: 1px solid var(--line); }
.dept-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  background: transparent;
  border-left: none; border-right: none; border-top: none;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--black);
}
.dept-item:hover { background: var(--bg); }
.dept-item:last-child { border-bottom: none; }
.dept-item.active::before {
  content: "✓"; color: var(--green); font-weight: 700;
}
.dept-item:not(.active)::before {
  content: ""; width: 14px;
}
.dept-item-code {
  font-weight: 800;
  font-size: 14px;
  width: 26px;
}
.dept-color-75 { color: #2563EB; }
.dept-color-77 { color: #2563EB; }
.dept-color-78 { color: #00A86B; }
.dept-color-91 { color: #F59E0B; }
.dept-color-92 { color: #A855F7; }
.dept-color-93 { color: #F59E0B; }
.dept-color-94 { color: #EF4444; }
.dept-color-95 { color: #06B6D4; }

/* ====== LISTE COURSES (style chat WhatsApp) ====== */
.rides-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.empty {
  color: var(--muted); text-align: center;
  padding: 32px 16px;
  font-style: italic;
  font-size: 14px;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--black); margin-bottom: 8px; }
.empty-desc { font-size: 13px; line-height: 1.5; }

.ride-row {
  display: flex; gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  align-items: stretch;
}
.ride-row:active { background: var(--bg); }
.ride-row.urgent { border-color: #FECACA; }

.ride-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  color: #fff;
  background: var(--green);
}
.ride-avatar.status-DRAFT        { background: var(--completed-gray); }
.ride-avatar.status-DISPATCHED   { background: var(--green); }
.ride-avatar.status-DISPATCHED.urgent { background: var(--urgent-red); }
.ride-avatar.status-ACCEPTED     { background: var(--accepted-blue); }
.ride-avatar.status-IN_PROGRESS  { background: var(--in-progress-blue); }
.ride-avatar.status-CLIENT_ON_BOARD { background: var(--in-progress-blue); }
.ride-avatar.status-COMPLETED    { background: var(--completed-gray); }
.ride-avatar.status-CANCELLED    { background: var(--completed-gray); }
.ride-avatar::after {
  content: ""; position: absolute;
  bottom: 2px; right: 2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
}

.ride-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ride-row-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.ride-cities { font-size: 16px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ride-cities .dept-tag { font-weight: 800; }
.dept-tag-all { background:#EDE9FE !important; color:#5B21B6 !important; font-size:10px; padding:1px 6px; border-radius:4px; }
.ride-cities .arrow { color: var(--green); margin: 0 4px; font-weight: 800; }
.ride-time { font-size: 13px; color: var(--muted); flex-shrink: 0; }

.ride-meta { display: flex; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ride-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.ride-meta-item.green { color: var(--green); font-weight: 600; }

.ride-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 8px; }
.ride-pax { font-size: 12px; color: var(--muted); display: inline-flex; gap: 8px; }
.ride-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.pill-DISPATCHED   { background: var(--green-soft); color: var(--green); }
.pill-DISPATCHED.urgent { background: #FEE2E2; color: var(--urgent-red); }
.pill-ACCEPTED     { background: #FEF3C7; color: #92400E; }
.pill-IN_PROGRESS  { background: #DBEAFE; color: #1E40AF; }
.pill-CLIENT_ON_BOARD { background: #DBEAFE; color: #1E40AF; }
.pill-COMPLETED    { background: var(--bg); color: var(--muted); }
.pill-CANCELLED    { background: var(--bg); color: var(--muted); text-decoration: line-through; }
.pill-DRAFT        { background: var(--bg); color: var(--muted); }
.pill-mine         { background: #EDE9FE; color: #5B21B6; }

/* Course créée par moi, visible dans le pool */
.ride-row-mine {
  border-left: 3px solid #7C3AED;
}

.ride-immediate-tag {
  display: inline-block;
  background: var(--dispatch-red);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
}

/* ====== CHAT ====== */
/* ====== CARTE COURSE (au-dessus du chat) ====== */
.chat-ride-card {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.ride-card-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.ride-card-section:last-child { border-bottom: none; }

/* Client */
.ride-card-client {
  display: flex; align-items: center; gap: 12px;
}
.ride-card-client-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00C882, #00A86B);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ride-card-client-info { flex: 1; min-width: 0; }
.ride-card-client-name {
  font-weight: 700; font-size: 15px;
  color: var(--black);
}
.ride-card-client-phone {
  color: var(--green-dark); font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.btn-call {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: inline-flex;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,168,107,0.30);
  text-decoration: none;
  flex-shrink: 0;
}
.btn-call:hover { background: var(--green-dark); }

/* Route */
.route-step {
  display: flex;
  gap: 12px;
  position: relative;
}
.route-step.pickup-step { padding-bottom: 16px; }
.route-step.pickup-step::after {
  content: "";
  position: absolute;
  left: 5px; top: 18px; bottom: 0;
  width: 2px;
  background: var(--line);
}
.route-bullet {
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  z-index: 1;
}
.route-bullet.pickup { background: var(--green); box-shadow: 0 0 0 3px rgba(0,168,107,0.15); }
.route-bullet.drop   { background: var(--dispatch-red); box-shadow: 0 0 0 3px rgba(211,47,47,0.15); }
.route-content { flex: 1; min-width: 0; }
.route-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}
.route-address {
  font-size: 14px;
  font-weight: 600;
  color: var(--black);
  margin: 2px 0 8px;
  line-height: 1.3;
}
.route-nav {
  display: flex;
  gap: 8px;
}
.route-nav .btn { padding: 8px 14px; }
.nav-icon {
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  border-radius: 50%;
}
.nav-waze  { background: #34CDFA; }
.nav-gmaps { background: linear-gradient(135deg,#EA4335 0%,#FBBC04 50%,#34A853 100%); }

/* Meta pills */
.ride-card-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 16px;
  background: var(--bg);
}
.meta-pill {
  background: var(--white);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  border: 1px solid var(--line);
}
.meta-pill.green { color: var(--green); border-color: #BBF7D0; }
.meta-pill.red   { color: #991B1B; border-color: #FECACA; }
.meta-pill.blue  { color: #1E40AF; border-color: #BFDBFE; }

.chat-messages {
  padding: 16px;
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)); /* place pour composer + actions + safe-area */
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    linear-gradient(rgba(243,244,246,0.95), rgba(243,244,246,0.95)),
    radial-gradient(circle at 20% 30%, #DCFCE7 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, #BBF7D0 1px, transparent 1px);
  background-size: cover, 24px 24px, 24px 24px;
  min-height: calc(100vh - var(--topbar-h) - 100px);
}

.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.bubble-time { font-size: 10px; color: var(--muted); margin-top: 2px; text-align: right; }

.bubble-system {
  align-self: center;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  text-align: center;
  max-width: 92%;
  box-shadow: var(--shadow);
}
.bubble-system .icon { margin-right: 6px; }
.bubble-system.success { background: var(--green-soft); color: var(--green-dark); }
.bubble-system.warning { background: #FEF3C7; color: #92400E; }
.bubble-system.danger  { background: #FEE2E2; color: var(--urgent-red); }
.bubble-system.info    { background: #DBEAFE; color: #1E40AF; }

.bubble-mine {
  align-self: flex-end;
  background: #DCF8C6;
  color: var(--black);
  border-bottom-right-radius: 4px;
}
.bubble-other {
  align-self: flex-start;
  background: var(--white);
  color: var(--black);
  border-bottom-left-radius: 4px;
}
.bubble-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 2px;
}

.chat-actions {
  position: fixed;
  left: 0; right: 0;
  /* au-dessus du composeur, lui-même ajusté pour la safe-area */
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  display: flex; gap: 8px;
  flex-wrap: wrap;
  max-width: 480px;
  margin: 0 auto;
  z-index: 4;
}
.chat-actions:empty { display: none; }
.chat-actions .btn { flex: 1; min-width: 120px; padding: 10px 12px; font-size: 14px; }

.chat-composer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  /* padding-bottom respecte la home indicator iOS */
  padding: 8px 10px max(8px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  display: flex; gap: 8px;
  max-width: 480px;
  margin: 0 auto;
  z-index: 5;
  align-items: center;
}
.chat-composer input {
  flex: 1; border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.chat-composer input:focus { border-color: var(--green); }
.chat-send {
  width: 44px; height: 44px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
}

/* Bouton pièce jointe */
.chat-attach-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #F3F4F6;
  color: #6B7280; cursor: pointer;
  transition: background .15s, color .15s;
}
.chat-attach-btn:hover { background: #E5E7EB; color: #374151; }
.chat-attach-btn:active { background: #D1FAE5; color: #00A86B; }

/* Preview de l'image avant envoi */
.chat-preview-wrap {
  position: fixed; left: 0; right: 0; bottom: 68px;
  background: rgba(255,255,255,0.97);
  border-top: 1px solid #E5E7EB;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  max-width: 480px; margin: 0 auto;
  z-index: 6; box-shadow: 0 -4px 16px rgba(0,0,0,0.07);
}
.chat-preview-thumb {
  width: 56px; height: 56px; border-radius: 10px;
  object-fit: cover; border: 1px solid #E5E7EB; flex-shrink: 0;
}
.chat-preview-file-icon {
  width: 56px; height: 56px; border-radius: 10px;
  background: #F3F4F6; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.chat-preview-info { flex: 1; min-width: 0; }
.chat-preview-name { font-size: 13px; font-weight: 600; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview-size { font-size: 11px; color: #9CA3AF; margin-top: 2px; }
.chat-preview-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: #F3F4F6; color: #6B7280;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; flex-shrink: 0;
}
.chat-preview-send {
  height: 36px; padding: 0 14px; border-radius: 18px;
  border: none; background: #00A86B; color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; flex-shrink: 0;
}

/* Bulles image / fichier dans le chat */
.bubble-img-wrap {
  max-width: 220px; border-radius: 12px; overflow: hidden;
  cursor: pointer; display: block;
}
.bubble-img-wrap img {
  width: 100%; height: auto; display: block;
  border-radius: 12px;
}
.bubble-file-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,0.05); border-radius: 10px;
  padding: 10px 12px; max-width: 220px;
}
.bubble-mine .bubble-file-card { background: rgba(255,255,255,0.2); }
.bubble-file-card-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 150px;
}
.bubble-file-card-size { font-size: 11px; opacity: 0.7; margin-top: 1px; }

/* ──────────────────────────────────────────────
   LIGHTBOX IMAGE (chat)
   ────────────────────────────────────────────── */
#chat-img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  flex-direction: column;
}

.lb-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  flex-shrink: 0;
}

.lb-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  color: #fff;
}
.lb-btn:active { background: rgba(255, 255, 255, 0.25); }

.lb-filename {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 24px;
  overflow: hidden;
}

.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
}

/* ====== DETAIL BLOCKS (utilisé dans modale détail course) ====== */
.detail-block {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.detail-block h3 {
  margin: 0 0 8px; font-size: 14px;
  text-transform: uppercase; color: var(--muted);
  letter-spacing: 0.5px;
}
.detail-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.detail-row:last-child { border-bottom: none; }
.detail-key { color: var(--muted); font-size: 13px; }
.detail-val { font-weight: 600; font-size: 14px; text-align: right; }

/* ====== CHANNELS / PILLS ====== */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.channel-pill {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px;
  text-align: center; cursor: pointer;
  font-size: 14px; font-weight: 600;
  user-select: none;
  font-family: inherit;
}
.channel-pill.active {
  background: var(--green); color: #fff; border-color: var(--green);
}

/* ====== VEHICLE TYPE CARDS ====== */
.vtype-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.vtype-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 8px 12px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.vtype-card:active {
  transform: scale(0.97);
}
.vtype-card.vtype-active {
  border-color: #0D9488;
  background: #F0FDFA;
  box-shadow: 0 0 0 1px #0D9488;
}
.vtype-icon-wrap {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: #F0FDFA;
  border-radius: 10px;
  margin-bottom: 2px;
}
.vtype-active .vtype-icon-wrap {
  background: #CCFBF1;
}
.vtype-label {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  text-align: center;
}
.vtype-active .vtype-label {
  color: #0F766E;
}
.vtype-sub {
  font-size: 10px;
  color: #9CA3AF;
  text-align: center;
  line-height: 1.3;
}
.vtype-active .vtype-sub {
  color: #14B8A6;
}
.vtype-check-ring {
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid #D1D5DB;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.vtype-check-ring.checked {
  background: #0D9488;
  border-color: #0D9488;
}
.vtype-warn-msg {
  font-size: 12px;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  margin-bottom: 2px;
  line-height: 1.5;
}
/* Badge states for prof-vehicles header */
.vtype-badge-ok {
  background: #ECFDF5;
  color: #007A4D;
  border-color: #BBF7D0;
}
.vtype-badge-warn {
  background: #FFFBEB;
  color: #92400E;
  border-color: #FDE68A;
}
/* "Véhicule non précisé" chip dans la liste réseau */
.ride-chip-unset {
  color: #9CA3AF;
  font-style: italic;
  border-color: #E5E7EB !important;
}

/* ====== STARS ====== */
.stars { display: flex; gap: 4px; font-size: 28px; cursor: pointer; }
.star { color: var(--line); }
.star.filled { color: #FBBF24; }

/* ====== PROFIL — section commune ====== */
.prof-section {
  background: var(--white); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  border: 1.5px solid var(--line);
}
.prof-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.prof-section-head h3 {
  margin: 0; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted);
}

/* ====== Accordion Profil ====== */
.prof-acc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 6px;
  margin: -4px;
  padding: 4px;
  transition: background 0.12s;
}
.prof-acc-head:active { background: rgba(0,0,0,0.04); }
.prof-acc-head h3 {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
/* Chevron — pointe à droite (fermé), tourne 90° vers le bas (ouvert) */
.prof-acc-chevron {
  flex-shrink: 0;
  color: #9CA3AF;
  transition: transform 0.22s ease;
}
.prof-acc-chevron.acc-open {
  transform: rotate(90deg);
}
/* Corps pliable — grid trick (animation fluide sans JS de hauteur) */
.prof-acc-body {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 0.22s ease;
}
.prof-acc-body.acc-closed {
  grid-template-rows: 0fr;
}
.prof-acc-inner {
  min-height: 0;
  overflow: hidden;
  padding-top: 12px;   /* espace entre le header et le contenu */
}

/* ====== 1. HERO CARD ====== */
.prof-hero-card {
  background: linear-gradient(145deg, #00A86B, #007A4D);
  border-radius: var(--radius); padding: 24px 16px 20px;
  text-align: center; color: #fff; margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0,168,107,0.35);
}
.prof-hero-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.20); border: 3px solid rgba(255,255,255,0.50);
  font-size: 34px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.prof-hero-name  { font-size: 22px; font-weight: 800; color: #fff; }
.prof-hero-role  {
  display: inline-block; margin-top: 4px;
  background: rgba(255,255,255,0.20); padding: 3px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.prof-hero-stars {
  margin-top: 10px; font-size: 20px; color: #FDE68A;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.prof-hero-stars-val   { font-size: 15px; font-weight: 700; color: #FDE68A; }
.prof-hero-stars-count { font-size: 12px; color: rgba(255,255,255,0.75); }
.prof-hero-no-rating   { margin-top: 8px; font-size: 13px; color: rgba(255,255,255,0.65); }
.prof-hero-kpis {
  display: flex; align-items: stretch; justify-content: center;
  margin-top: 18px; background: rgba(0,0,0,0.12);
  border-radius: 12px; overflow: hidden;
}
.prof-kpi {
  flex: 1; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.prof-kpi-val { font-size: 22px; font-weight: 800; color: #fff; }
.prof-kpi-lbl { font-size: 10px; color: rgba(255,255,255,0.75); text-transform: uppercase; letter-spacing: 0.3px; }
.prof-kpi-sep { width: 1px; background: rgba(255,255,255,0.20); margin: 10px 0; }

/* ====== 2. INFOS PERSONNELLES ====== */
.prof-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px;
}
.prof-info-row:last-child { border-bottom: none; }
.prof-info-row-edit { padding: 8px 0; }
.prof-info-key { color: var(--muted); font-size: 13px; flex-shrink: 0; min-width: 90px; }
.prof-info-val { font-weight: 600; font-size: 14px; text-align: right; color: var(--black); }
.prof-info-input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  color: var(--black); background: var(--bg);
  outline: none; text-align: right;
  transition: border-color .15s;
}
.prof-info-input:focus { border-color: var(--green); background: #fff; }

.prof-btn-edit-link {
  font-size: 13px; font-weight: 600; color: var(--green);
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: inherit;
}
.prof-edit-btns { display: flex; gap: 8px; }
.prof-btn-secondary {
  padding: 7px 14px; border-radius: 8px;
  border: 1.5px solid var(--line); background: var(--white);
  font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.prof-btn-primary {
  padding: 7px 16px; border-radius: 8px;
  border: none; background: var(--green); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.prof-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ====== 3. DOCUMENTS ====== */
.prof-docs-soon {
  font-size: 11px; color: var(--muted);
  background: #F3F4F6; padding: 2px 8px; border-radius: 999px;
}
.prof-doc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.prof-doc-row:last-child { border-bottom: none; }
.prof-doc-icon { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; }
.prof-doc-info { flex: 1; min-width: 0; }
.prof-doc-label { font-size: 14px; font-weight: 500; color: var(--black); display: block; }
.prof-doc-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; margin-top: 2px;
}
.doc-todo    { background: #F3F4F6; color: #6B7280; }
.doc-pending { background: #EFF6FF; color: #2563EB; }
.doc-valid   { background: #D1FAE5; color: #065F46; }
.doc-refused { background: #FEE2E2; color: #DC2626; }
.prof-doc-actions { flex-shrink: 0; }
.prof-doc-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--white); cursor: pointer;
  font-family: inherit; color: var(--muted);
}
.prof-doc-btn:disabled { opacity: .5; cursor: not-allowed; }
.prof-doc-view { border-color: #BFDBFE; color: #2563EB; background: #EFF6FF; }

/* ====== 4. STATISTIQUES ====== */
.prof-period-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: #F3F4F6; border-radius: 10px; padding: 3px;
}
.prof-period-btn {
  flex: 1; padding: 7px 4px; border: none; border-radius: 8px;
  background: transparent; font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.prof-period-btn.active {
  background: var(--white); color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* KPI cards 2×2 */
.prof-kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px;
}
.prof-kpi-card {
  background: var(--bg); border-radius: 10px;
  padding: 12px; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}
.prof-kpi-card.prof-kpi-green { background: var(--green-soft); }
.prof-kpi-num { font-size: 22px; font-weight: 800; color: var(--black); }
.prof-kpi-txt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }

/* Donut */
.prof-donut-row {
  display: flex; align-items: center; gap: 16px; margin-bottom: 16px;
}
.prof-donut {
  width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
  position: relative;
}
.prof-donut-inner {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%; background: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.prof-donut-num { font-size: 17px; font-weight: 800; color: var(--black); line-height: 1; }
.prof-donut-lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; }
.prof-donut-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.prof-legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--black); }
.prof-legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.ld-green { background: #00A86B; }
.ld-red   { background: #EF4444; }
.ld-gray  { background: #D1D5DB; }

/* Barres horizontales */
.prof-bars { display: flex; flex-direction: column; gap: 10px; }
.prof-bar-row { display: flex; align-items: center; gap: 8px; }
.prof-bar-label { font-size: 12px; color: var(--muted); min-width: 120px; }
.prof-bar-val   { font-size: 13px; font-weight: 700; color: var(--black); min-width: 24px; text-align: right; }
.prof-bar-track {
  flex: 1; height: 8px; background: #E5E7EB; border-radius: 4px; overflow: hidden;
}
.prof-bar-fill  { height: 100%; border-radius: 4px; background: var(--green); transition: width .4s ease; }
.prof-bar-fill.bar-green { background: #00A86B; }
.prof-bar-fill.bar-red   { background: #EF4444; }
.prof-bar-fill.bar-blue  { background: #2563EB; }

/* ====== 6. ACTIONS ====== */
.prof-actions-list {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1.5px solid var(--line);
  overflow: hidden; margin-bottom: 12px;
}
.prof-action-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border: none; background: transparent;
  cursor: pointer; font-size: 15px; font-weight: 500;
  font-family: inherit; color: var(--black);
  border-bottom: 1px solid var(--line);
  transition: background .15s; text-align: left;
}
.prof-action-item:last-child { border-bottom: none; }
.prof-action-item:hover:not(:disabled) { background: var(--bg); }
.prof-action-item:disabled { opacity: .45; cursor: not-allowed; }
.prof-action-arrow { margin-left: auto; color: #9CA3AF; }
.prof-action-logout { color: #DC2626; }
.prof-action-logout svg { color: #DC2626; }
.prof-action-reset { color: var(--muted); }
.prof-action-disabled { }
.prof-soon-tag {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: #F3F4F6; color: var(--muted);
  padding: 2px 8px; border-radius: 999px;
}
.prof-version {
  text-align: center; font-size: 12px; color: #9CA3AF;
  margin: 4px 0 24px;
}

/* Garder la compatibilité des anciens IDs profile-* */
.profile-help {
  font-size: 12px; color: var(--muted); margin: 4px 0 8px; line-height: 1.5;
}

/* ====== TOAST ====== */
.toast-container {
  position: fixed; top: 16px; left: 0; right: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  z-index: 1000; pointer-events: none;
}
.toast {
  background: var(--black); color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  max-width: calc(100% - 32px);
  animation: toast-in .2s ease-out;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--dispatch-red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ====== MODALE ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 700; /* au-dessus de la bottom-nav (z-index:600) */
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--white);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  animation: modal-up .2s ease-out;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius-lg); }
}
@keyframes modal-up { from { transform: translateY(20%); } to { transform: translateY(0); } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px; }
.modal-actions {
  display: flex; gap: 8px;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.modal-actions .btn { flex: 1; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   ÉCRAN LOGIN — Premium 2026
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

#screen-login {
  /* Fond porté par #lp-bg (couche fixed dégradé). Transparent ici. */
  background: transparent;
  position: relative;
  overflow: hidden;
}
#screen-login.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}

/* ── Blobs décoratifs flous ── */
.lp-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.lp-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
}
.lp-blob-1 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #86EFAC 0%, #00A86B 100%);
  top: -100px; right: -100px;
}
.lp-blob-2 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, #BBF7D0 0%, #00C882 100%);
  bottom: 80px; left: -70px;
  opacity: 0.35;
}
.lp-blob-3 {
  width: 130px; height: 130px;
  background: radial-gradient(circle, #A7F3D0, #059669);
  bottom: 220px; right: 10px;
  opacity: 0.18;
}

/* ── Wrapper ── */
.lp-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 56px 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ── Section brand ── */
.lp-brand {
  text-align: center;
  margin-bottom: 36px;
}

/* Logo badge */
.lp-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  background: #ffffff;
  border-radius: 28px;
  margin-bottom: 22px;
  box-shadow: 0 8px 32px rgba(0,168,107,0.22), 0 2px 8px rgba(0,0,0,0.08);
}
.lp-logo img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

/* Titre — grand, coupé Wati/Taxi */
.lp-title {
  font-size: 44px;
  font-weight: 900;
  margin: 0 0 10px;
  letter-spacing: -2px;
  line-height: 1;
}
.lp-title-wati { color: #0F172A; }
.lp-title-taxi  { color: #00A86B; }

.lp-subtitle {
  font-size: 15px;
  color: #475569;
  font-weight: 500;
  margin: 0 0 5px;
  line-height: 1.4;
}
.lp-region {
  font-size: 13px;
  color: #00A86B;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.4px;
}

/* ── Carte glassmorphism ── */
.lp-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 24px;
  padding: 28px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.08),
    0 2px 8px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.90);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Label + groupe de champ */
.lp-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lp-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #64748B;
}

/* Input */
.lp-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.90);
  border-radius: 14px;
  padding: 0 16px;
  border: 1.5px solid #E2E8F0;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.lp-input-wrap:focus-within {
  border-color: #00A86B;
  box-shadow: 0 0 0 3px rgba(0,168,107,0.12);
  background: #fff;
}
.lp-input-icon { flex-shrink: 0; }
.lp-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 15px 0 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #0F172A !important;
  outline: none !important;
  letter-spacing: 0.5px;
}
.lp-input::placeholder {
  color: #CBD5E1 !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

/* Bouton Continuer */
.lp-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #00C882 0%, #007A4D 100%);
  color: #fff;
  border: none;
  border-radius: 15px;
  padding: 17px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.2px;
  box-shadow:
    0 4px 20px rgba(0,168,107,0.42),
    0 1px 4px rgba(0,168,107,0.20);
  transition: transform 0.12s, box-shadow 0.12s;
  touch-action: manipulation;
}
.lp-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(0,168,107,0.28);
}

/* Note sécurité */
.lp-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
}

/* Pied de page */
.lp-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 22px;
  font-size: 12px;
  color: #CBD5E1;
  font-weight: 500;
}

/* Compatibilité anciens sélecteurs */
.login-trust-card, .login-illustration, .login-note,
.login-brand, .login-title, .login-subtitle,
.login-secure, .btn-login { display: none !important; }
/* =============================================
   PLANNING — header vert + switch + cartes
   ============================================= */
.planning-header {
  background: #00A86B;
  padding: max(14px, env(safe-area-inset-top, 14px)) 16px 16px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 12px;
}

/* Screen planning : commence sous le header fixe */
#screen-planning {
  padding-top: calc(var(--planning-header-h) + env(safe-area-inset-top, 0px));
}

.planning-title {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
  grid-column: 2;
}
.planning-iconbtn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.10);
}
.planning-iconbtn.ghost {
  background: transparent;
  box-shadow: none;
}
.planning-actions {
  grid-column: 3;
  display: flex; gap: 8px;
}
.planning-subheader {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex; align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.planning-toggle {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 3px;
  display: inline-flex;
  flex: 1;
  max-width: 240px;
}
.planning-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.planning-toggle-btn.active {
  background: #fff;
  color: var(--green);
}
.planning-today-link {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 8px;
  margin-left: auto;
}

.planning-datebar {
  background: var(--bg);
  display: flex; align-items: center;
  padding: 12px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.datebar-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
}
.datebar-label {
  flex: 1;
  text-align: center;
  background: var(--white);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--line);
  min-width: 140px;
}
.datebar-stats {
  display: flex; gap: 6px;
  margin-left: auto;
}
.stat-pill {
  background: var(--black);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.planning-list-wrap { padding: 16px 16px calc(var(--bottom-nav-h) + 32px); }
.planning-list { display: flex; flex-direction: column; gap: 10px; }

/* Bouton flottant « Retour à domicile » — icône seule, ronde, au-dessus de la
   bottom-nav. OFF = blanc/vert ; ON = vert plein. Présent sur Planning + Courses. */
.pl-home-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-nav-h, 60px) + 14px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 52px; height: 52px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid #BDEBD5; border-radius: 50%;
  background: #fff; color: #00875A;
  box-shadow: 0 6px 18px rgba(16,24,40,.18);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.pl-home-fab:active { transform: scale(.94); }
.pl-home-fab.is-on {
  background: linear-gradient(180deg, #00A86B 0%, #019d64 100%);
  border-color: #019d64; color: #fff;
  box-shadow: 0 8px 22px rgba(0,168,107,.40);
}
.pl-home-fab svg { width: 22px; height: 22px; flex: 0 0 auto; }
/* L'app perso s'affiche en mobile ; on masque ce FAB dans le cadre desktop Pro. */
body.is-logged.dpro-frame .pl-home-fab { display: none; }

/* Swipe-to-delete wrapper */
.pl-swipe-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.pl-swipe-delete {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 72px;
  display: flex; align-items: stretch;
  border-radius: 0 var(--radius) var(--radius) 0;
  overflow: hidden;
}
.pl-delete-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; background: #EF4444; border: none; cursor: pointer;
  width: 100%; border-radius: 0 var(--radius) var(--radius) 0;
}

/* Carte planning (rides normaux + réservations clients) */
.planning-card,
.pl-booking-card {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 14px 14px 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  border-left: 4px solid var(--green);
  align-items: center;
  margin-bottom: 8px;
}
.planning-card.cancelled { opacity: 0.45; }

/* Course acceptée en tant que chauffeur → teinte bleue */
.planning-card.card-driver {
  background: #EFF6FF;
  border-left-color: #3B82F6;
}

.pl-time-col {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.pl-time {
  font-size: 16px;
  font-weight: 800;
  color: var(--black);
  line-height: 1.1;
}
/* Tag "Chauffeur" sous l'heure */
.pl-role-tag {
  font-size: 9px;
  font-weight: 700;
  color: #2563EB;
  background: #DBEAFE;
  border-radius: 4px;
  padding: 2px 5px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.pl-body {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pl-client {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Villes départ / arrivée — deux lignes, non gras */
.pl-from,
.pl-to {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.pl-from::before { content: "↑ "; font-size: 10px; }
.pl-to::before   { content: "↓ "; font-size: 10px; }

.pl-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.pl-status {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-align: center;
}
.pl-status.a-dispatcher { background: #FEE2E2; color: #B91C1C; }
.pl-status.dispatching  { background: #FEF3C7; color: #B45309; }
.pl-status.acceptee     { background: #D1FAE5; color: #065F46; }
.pl-status.en-route     { background: #D1FAE5; color: #065F46; }
.pl-status.aboard       { background: #DBEAFE; color: #1E40AF; }
.pl-status.terminee     { background: #F3F4F6; color: #6B7280; }
.pl-status.annulee      { background: #FEE2E2; color: #991B1B; }

/* Boutons DRAFT dans la carte planning */
.pl-draft-btns {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-end;
}
.pl-dispatch-btn {
  background: #DC2626;
  color: #fff; border: none; border-radius: 999px;
  padding: 5px 11px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.pl-dispatch-btn:hover  { background: #B91C1C; }
.pl-dispatch-btn:active { transform: scale(0.97); }

.pl-start-btn {
  background: #F97316;
  color: #fff; border: none; border-radius: 999px;
  padding: 5px 11px; font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.pl-start-btn:hover  { background: #EA580C; }
.pl-start-btn:active { transform: scale(0.97); }

/* Redispatcher — couleur ambre pour signaler le retour après expiration */
.pl-redispatch-btn {
  background: #B45309 !important;  /* ambre sombre */
}
.pl-redispatch-btn:hover { background: #92400E !important; }

/* Badge "Expiré ×N" affiché sous la route dans la carte planning */
.pl-expired-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  background: #FEF3C7;  /* ambre très clair */
  color: #B45309;
  border: 1px solid #FCD34D;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ── Barre d'actions côte à côte (fiche course) ── */
.cd-action-bar {
  display: flex; gap: 10px; padding: 12px 0 4px;
  border-top: 1px solid var(--line); margin-top: 4px;
}
.cd-bar-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 10px; border-radius: var(--radius);
  border: none; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: opacity .15s, transform .1s;
}
.cd-bar-btn:active { transform: scale(0.97); }

.cd-bar-start    { background: #F97316; color: #fff; }
.cd-bar-start:hover { background: #EA580C; }

.cd-bar-onboard  { background: #3B82F6; color: #fff; }
.cd-bar-onboard:hover { background: #2563EB; }

.cd-bar-complete { background: var(--green); color: #fff; }
.cd-bar-complete:hover { background: var(--green-dark); }

.cd-bar-dispatch { background: #DC2626; color: #fff; }
.cd-bar-dispatch:hover { background: #B91C1C; }

/* Reprendre (retirer du pool) — gris neutre, action réversible */
.cd-bar-undispatch { background: #6B7280; color: #fff; }
.cd-bar-undispatch:hover { background: #4B5563; }
.cd-bar-undispatch:disabled { opacity: .6; cursor: wait; }

.cd-bar-badge {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 13px 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; text-align: center;
}
.cd-bar-badge-dispatching { background: #FEF3C7; color: #B45309; }
.cd-bar-badge-accepted    { background: #D1FAE5; color: #065F46; }

.pl-edit-btn {
  background: #EDE9FE;
  color: #5B21B6;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}
.pl-edit-btn:hover { background: #DDD6FE; }

/* ================================================
   CALENDRIER PICKER (bottom-sheet)
   ================================================ */
.calendar-picker {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100vw);
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 32px;
  z-index: 700; /* au-dessus de la bottom-nav (z-index:600) */
  box-shadow: 0 -6px 40px rgba(0,0,0,0.18);
  animation: slideUp .25s ease;
}
.cal-handle {
  width: 40px; height: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 0 auto 16px;
}
.cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal-month-lbl {
  font-size: 16px; font-weight: 700; color: var(--black);
}
.cal-nav {
  width: 36px; height: 36px;
  border: none; background: var(--bg);
  border-radius: 50%; cursor: pointer;
  font-size: 22px; color: var(--black);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.cal-nav:hover { background: var(--line); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 6px;
}
.cal-weekdays span {
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 4px 0;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; color: var(--black);
  border-radius: 50%; cursor: pointer;
  position: relative;
  transition: background .12s;
  line-height: 1;
}
.cal-cell:not(.cal-empty):hover { background: var(--bg); }
.cal-empty { cursor: default; }
.cal-today { color: var(--green); font-weight: 800; }
.cal-today::after {
  content: "";
  position: absolute; bottom: 5px;
  width: 4px; height: 4px;
  border-radius: 50%; background: var(--green);
}
.cal-selected {
  background: var(--green) !important;
  color: #fff !important;
  font-weight: 700;
}
.cal-selected.cal-today::after { background: #fff; }
.cal-dot {
  position: absolute; bottom: 4px;
  width: 4px; height: 4px;
  border-radius: 50%; background: var(--green);
}
.cal-dot-inv { background: #fff; }
.cal-go-today {
  display: block; width: 100%;
  margin-top: 14px; padding: 13px;
  background: var(--bg);
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 700; color: var(--green);
  cursor: pointer; font-family: inherit;
  transition: background .12s;
}
.cal-go-today:hover { background: var(--line); }

.form-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* Quick dispatch popover */
.dispatch-popover {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--white);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  z-index: 710; /* au-dessus de la bottom-nav (z-index:600) */
  max-width: 480px;
  margin: 0 auto;
  animation: modal-up 0.2s ease-out;
  max-height: 85dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.dispatch-popover-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.dispatch-popover-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dispatch-chip {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  text-align: center;
}
.dispatch-chip:hover, .dispatch-chip:active { background: var(--green-soft); border-color: var(--green); }
.dispatch-popover-cancel {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
}

.login-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
  border-left: 3px solid var(--green);
}
.login-note strong { color: var(--green-dark); }
.profile-help {
  font-size: 12px; color: var(--muted);
  margin: 4px 0 8px;
}
.login-trust-card {
  margin-top: 18px; width: 100%;
  background: var(--white); border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
  text-align: left;
}
.login-trust-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--green-soft);
  display: flex; align-items: center; justify-content: center;
}
.login-trust-title { font-weight: 700; font-size: 15px; }

/* ==========================================================
   COURSE DETAIL — MODE POOL (vue chauffeur potentiel)
   ========================================================== */

.cd-pool-badge {
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-weight: 700; font-size: 15px;
  background: var(--green-soft); color: var(--green-dark);
  border: 2px solid var(--green);
}
.cd-pool-badge.urgent {
  background: #FEF2F2; color: #EF4444; border-color: #EF4444;
}

.cd-pool-time-card {
  text-align: center; padding: 20px !important;
}
.cd-pool-time-big {
  font-size: 42px; font-weight: 800;
  color: var(--black); letter-spacing: -1px;
  line-height: 1;
}
.cd-pool-date {
  font-size: 14px; color: var(--muted);
  margin-top: 4px; text-transform: capitalize;
}

.cd-pool-route {
  display: flex; flex-direction: column; gap: 0;
}
.cd-pool-city-block {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.cd-pool-city-dot {
  width: 14px; height: 14px;
  border-radius: 50%; flex-shrink: 0;
}
.cd-pool-city-label {
  font-size: 11px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.cd-pool-city-name {
  font-size: 20px; font-weight: 800; color: var(--black);
  margin-top: 2px;
}
.cd-pool-line-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 4px 6px;
}
.cd-pool-line {
  width: 2px; height: 24px; background: var(--line);
}

.cd-pool-infos {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.cd-pool-info-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--black);
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.cd-pool-info-item.green { color: var(--green-dark); background: var(--green-soft); }
.cd-pool-info-item.red   { color: #991B1B; background: #FEF2F2; }
.cd-pool-info-icon { font-size: 16px; }
.cd-pool-price { font-size: 18px; font-weight: 800; }

.cd-pool-dispatcher {
  display: flex !important; align-items: center; gap: 12px;
}
.cd-pool-dispatcher-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.cd-pool-dispatcher-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.cd-pool-dispatcher-name  { font-size: 15px; font-weight: 700; }
.cd-pool-channel-badge {
  margin-left: auto;
  background: var(--green-soft); color: var(--green-dark);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}

/* Gros bouton Accepter */
.cd-pool-accept-wrap {
  padding: 8px 0 16px;
}
.cd-btn-accept {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 18px;
  background: var(--green); color: #fff;
  font-size: 18px; font-weight: 800;
  border: none; border-radius: var(--radius);
  cursor: pointer; letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(0,168,107,0.35);
  transition: background 0.15s, transform 0.1s;
}
.cd-btn-accept:active { transform: scale(0.98); }

/* ==========================================================
   MESSAGES — liste de conversations
   ========================================================== */
.msg-conv-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.msg-conv-item:hover { box-shadow: var(--shadow-lg); }
.msg-conv-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 700;
  flex-shrink: 0;
}
.msg-conv-body { flex: 1; min-width: 0; }
.msg-conv-top {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; margin-bottom: 4px;
}
.msg-conv-name { font-weight: 700; font-size: 15px; }
.msg-conv-date { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.msg-conv-sub  { margin-bottom: 6px; }
.msg-conv-route{ font-size: 13px; color: var(--muted); }
.msg-conv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-conv-badge{
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  letter-spacing: 0.3px; white-space: nowrap;
}
.msg-conv-role { font-size: 12px; color: var(--muted); }
.msg-conv-arrow { flex-shrink: 0; }

/* Placeholder onglet Messages */
.msg-placeholder-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - var(--nav-h));
}
.msg-placeholder {
  text-align: center;
  padding: 32px 24px;
}
.msg-placeholder-icon {
  font-size: 56px;
  margin-bottom: 16px;
  line-height: 1;
}
.msg-placeholder-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
}
.msg-placeholder-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

/* ==========================================================
   COURSE DETAIL (cd-*)
   ========================================================== */

/* Header vert */
.cd-header {
  background: var(--green);
  padding: env(safe-area-inset-top, 0px) 16px 0;
  display: flex;
  align-items: flex-end; /* contenu sous la safe-area */
  gap: 8px;
  min-height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}

#screen-course-detail {
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
}
.cd-title {
  flex: 1;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cd-iconbtn {
  width: 40px; height: 40px;
  border: none;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.cd-iconbtn.ghost { background: transparent; }

/* Body */
.cd-body { padding-top: 16px; }
/* Fiche course (recap) : cartes plus larges — marge latérale 16px → 10px.
   Cible UNIQUEMENT la fiche course (.cd-body), pas le Planning/Accueil/autres. */
.container.cd-body { padding-left: 10px; padding-right: 10px; }

/* Barre statut */
.cd-status-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.cd-status-badge {
  display: inline-block;
  color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.cd-datetime { font-size: 13px; color: var(--muted); flex: 1; }
.cd-edit-inline-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--white);
  font-size: 13px; font-weight: 600; color: #374151;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.cd-edit-inline-btn:hover { background: var(--bg); }

/* Sections */
.cd-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.cd-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.cd-trip-type {
  background: var(--green-soft); color: var(--green-dark);
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.5px;
}

/* Client */
.cd-client-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.cd-client-name { font-size: 17px; font-weight: 700; }
.cd-client-phone { font-size: 14px; color: var(--muted); margin-top: 2px; }
.cd-call-btn {
  width: 44px; height: 44px;
  background: var(--green-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; flex-shrink: 0;
}

/* Adresses GPS */
.cd-addr-block {
  display: flex; align-items: flex-start; gap: 12px;
}
.cd-addr-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-top: 4px; flex-shrink: 0;
}
.dot-green { background: var(--green); }
.dot-black { background: var(--black); }
.cd-addr-info { flex: 1; min-width: 0; }
.cd-addr-label {
  font-size: 11px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.cd-addr-text {
  font-size: 14px; font-weight: 500; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis;
}
.cd-gps-btn {
  width: 36px; height: 36px;
  background: var(--green-soft); border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.cd-addr-connector {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 6px 5px;
}
.cd-connector-line {
  width: 2px; height: 20px; background: var(--line);
}
.cd-dist-badge {
  font-size: 11px; color: var(--muted);
  background: var(--bg); border-radius: 20px;
  padding: 2px 8px;
}

/* Paiement */
.cd-payment-chips {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.cd-payment-chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  background: var(--bg); color: var(--muted);
  border: 2px solid var(--line);
}
.cd-payment-chip.active {
  background: var(--green-soft); color: var(--green-dark);
  border-color: var(--green);
}
.cd-amounts { display: flex; gap: 20px; flex-wrap: wrap; }
.cd-amount-item { display: flex; flex-direction: column; gap: 2px; }
.cd-amount-label {
  font-size: 11px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.cd-amount-value { font-size: 20px; font-weight: 700; color: var(--black); }
.cd-amount-empty { font-size: 13px; color: var(--muted); font-style: italic; }

/* Bloc estimation dispatcheur (course-detail) */
.cd-estimate-block {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
}
.cd-estimate-block.cd-estimate-cpam {
  background: #F9FAFB;
  border-color: #E5E7EB;
}
.cd-estimate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cd-estimate-label {
  font-size: 12px;
  font-weight: 600;
  color: #15803D;
}
.cd-estimate-block.cd-estimate-cpam .cd-estimate-label {
  color: var(--muted);
  font-style: italic;
}
.cd-estimate-value {
  font-size: 15px;
  font-weight: 700;
  color: #15803D;
}
.cd-estimate-sub {
  font-size: 11px;
  color: #166534;
  opacity: 0.8;
  margin-top: 2px;
}

/* Dispatch */
.cd-dispatch-row { display: flex; gap: 8px; align-items: center; }
.cd-channel-select {
  flex: 1; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--white); font-family: inherit; font-size: 15px;
  color: var(--black);
}
.cd-dispatch-btn { flex-shrink: 0; }

/* ETA Grid */
.cd-eta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.cd-eta-chip {
  padding: 10px 0; border-radius: var(--radius-sm);
  background: var(--bg); border: 2px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--black);
  cursor: pointer; text-align: center;
}
.cd-eta-chip:hover { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.cd-eta-chip:active { transform: scale(0.97); }
.cd-eta-chip.selected {
  background: var(--green); border-color: var(--green); color: var(--white);
}

/* Chauffeur attribué */
.cd-driver-row {
  display: flex; align-items: center; gap: 12px;
}
.cd-driver-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.cd-driver-name { font-weight: 700; font-size: 16px; }
.cd-driver-eta { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Timeline */
.cd-timeline {
  display: flex; align-items: flex-start;
  overflow-x: auto; padding-bottom: 4px;
}
.cd-step-wrap {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; position: relative; min-width: 46px;
}
.cd-step {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  position: relative; z-index: 1; flex-shrink: 0;
}
.cd-step.done   { background: var(--green); color: #fff; }
.cd-step.active { background: var(--green); color: #fff; box-shadow: 0 0 0 4px var(--green-soft); }
.cd-step.pending{ background: var(--bg); color: var(--muted); border: 2px solid var(--line); }
.cd-step-label  { font-size: 9px; text-align: center; margin-top: 4px; line-height: 1.2; max-width: 52px; }
.cd-step-label.done   { color: var(--green); font-weight: 600; }
.cd-step-label.active { color: var(--green); font-weight: 700; }
.cd-step-label.pending{ color: var(--muted); }
.cd-step-line {
  position: absolute; top: 14px;
  left: 50%; width: 100%; height: 2px;
  background: var(--line); z-index: 0;
}
.cd-step-line.done { background: var(--green); }
.cd-cancelled-banner {
  text-align: center; padding: 10px;
  background: #FEF2F2; color: #EF4444;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15px;
}

/* Actions */
.cd-actions { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.cd-btn-complete { background: var(--green-dark) !important; }
.cd-btn-cancel   { color: var(--muted); }

/* Bouton Messages */
.cd-messages-btn {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  width: 100%; padding: 14px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--black); font-size: 15px; font-weight: 600;
  cursor: pointer; margin-bottom: 16px;
  font-family: inherit;
}
.cd-messages-btn:hover { border-color: var(--green); color: var(--green); }

/* GPS modale */
.cd-gps-addr {
  font-weight: 600; font-size: 15px; margin-bottom: 16px;
}
.cd-gps-apps { display: flex; flex-direction: column; gap: 10px; }
.cd-gps-app-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--radius);
  background: var(--bg); text-decoration: none;
  color: var(--black); font-weight: 600; font-size: 15px;
}
.cd-gps-app-btn:hover { background: var(--green-soft); }

/* Modale terminer */
.cd-complete-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px;
}

/* Étoiles de notation */
.cd-stars {
  display: flex; gap: 6px; justify-content: center; margin-top: 12px;
}
.cd-star {
  font-size: 34px; color: var(--line);
  background: none; border: none; cursor: pointer;
  transition: color 0.15s; padding: 0; line-height: 1;
}
.cd-star.active { color: #F59E0B; }

/* =========================================================
   BOUTON ACCEPTER — carte du pool
   ========================================================= */
.btn-accept-ride {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 20px;
  background: var(--green); color: #fff;
  font-size: 13px; font-weight: 700; border: none;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 2px 8px rgba(0,168,107,0.35);
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-accept-ride:hover  { background: var(--green-dark); }
.btn-accept-ride:active { transform: scale(0.96); }

/* =========================================================
   BOTTOM SHEET — confirmation acceptation course
   ========================================================= */
.accept-sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--white); border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 651; box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
  animation: slideUp 0.25s ease;
  max-height: 92vh;
  overflow-y: auto;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}

.accept-sheet-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--line); margin: 0 auto 16px;
}
.accept-sheet-title {
  font-size: 17px; font-weight: 700; color: var(--black);
  text-align: center; margin-bottom: 16px;
}

/* Carte résumé de la course */
.accept-sheet-card {
  background: var(--bg); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
  border: 1.5px solid var(--line);
}
.accept-route { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.accept-city  { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.accept-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.from-dot     { background: var(--green); }
.to-dot       { background: #EF4444; }

.accept-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.accept-price { color: var(--green); font-weight: 700; }
.accept-dispatcher { font-size: 13px; color: var(--muted); }

.accept-hint {
  font-size: 13px; color: var(--muted); text-align: center;
  margin: 0 0 16px;
}

.accept-actions {
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
}
.accept-btn-cancel {
  padding: 14px; border-radius: var(--radius);
  background: var(--bg); border: 1.5px solid var(--line);
  color: var(--muted); font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.accept-btn-confirm {
  padding: 14px; border-radius: var(--radius);
  background: var(--green); color: #fff;
  border: none; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,168,107,0.3);
  transition: background 0.15s;
}
.accept-btn-confirm:hover    { background: var(--green-dark); }
.accept-btn-confirm:disabled { opacity: 0.6; cursor: default; }

/* =========================================================
   ACCEPT MODAL — bloc ETA (courses immédiates)
   ========================================================= */
.accept-eta-section {
  background: var(--green-soft);
  border: 1.5px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.accept-eta-label {
  font-size: 14px; font-weight: 700; color: var(--black);
  margin-bottom: 10px;
}
.accept-eta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.accept-eta-chip {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding: 12px 0;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 18px; font-weight: 800;
  color: var(--black);
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s, background .12s, color .12s;
}
.accept-eta-chip:active { transform: scale(0.97); }
.accept-eta-chip.selected {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}
.accept-eta-chip-unit {
  font-size: 11px; font-weight: 600;
}
.accept-eta-hint {
  font-size: 12px; color: var(--muted); margin: 8px 0 0;
  line-height: 1.4;
}

/* Infos heure + médical dans la modal accept */
.accept-time-info {
  font-size: 13px; color: var(--muted);
  margin-bottom: 6px;
}
.accept-medical {
  font-size: 13px; font-weight: 700; color: #1D4ED8;
  margin-bottom: 6px;
}

/* =========================================================
   POOL CARDS — nouvelle présentation compacte (home.js v=11)
   ========================================================= */

/* Corps central : villes en colonne */
.pool-body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  gap: 2px;
}
.pool-from {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pool-city {
  font-size: 16px; font-weight: 700; color: var(--black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pool-sep {
  font-size: 14px; color: var(--green); font-weight: 700;
  line-height: 1; padding: 0 0 0 2px;
}
.pool-to {
  font-size: 14px; font-weight: 600; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Badge médical compact */
.pool-medical-badge {
  display: inline-block;
  background: #EFF6FF; color: #1D4ED8;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  margin-top: 4px;
}

/* Colonne droite : heure / badge IMMÉDIAT + bouton */
.pool-right {
  display: flex; flex-direction: column;
  align-items: flex-end; justify-content: space-between;
  flex-shrink: 0; gap: 6px;
  min-width: 96px;
}
.pool-badge-imm {
  background: var(--dispatch-red); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 6px;
  letter-spacing: 0.4px; white-space: nowrap;
}
.pool-time {
  font-size: 15px; font-weight: 700; color: var(--black);
}

/* Bouton Accepter dans la carte */
.btn-accept-ride {
  background: var(--green); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-accept-ride:hover  { background: var(--green-dark); }
.btn-accept-ride:active { opacity: 0.85; }

/* Pill "Ma course" pour les courses créées par le user connecté */
.pool-mine-pill {
  background: #EDE9FE; color: #5B21B6;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}

/* =========================================================
   RÉPERTOIRE CLIENTS
   ========================================================= */

/* Barre de recherche */
.clients-search-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px;
  border: 1.5px solid var(--line);
}
.clients-search-wrap input {
  flex: 1; border: none; outline: none;
  font-size: 15px; color: var(--black);
  background: transparent; font-family: inherit;
}
.clients-search-wrap input::placeholder { color: var(--muted); }

/* Liste clients */
.clients-list { display: flex; flex-direction: column; gap: 10px; }

/* Une ligne client */
.client-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
  border: 1.5px solid var(--line);
}

/* Avatar initiale */
.client-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-dark);
  font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Infos client */
.client-info { flex: 1; min-width: 0; }
.client-name  { font-weight: 600; font-size: 15px; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-phone { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Actions */
.client-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.client-btn-call {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #ECFDF5; text-decoration: none;
  transition: background 0.15s;
}
.client-btn-call:hover { background: #D1FAE5; }

.client-btn-ride {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--green); color: var(--white);
  font-size: 13px; font-weight: 600; border: none;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.client-btn-ride:hover { background: var(--green-dark); }

.client-btn-delete {
  width: 30px; height: 30px; border-radius: 50%;
  background: none; border: none; color: var(--muted);
  font-size: 15px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.client-btn-delete:hover { color: #EF4444; background: #FEF2F2; }

/* État vide */
.clients-empty {
  text-align: center; padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.clients-empty-icon  { font-size: 48px; }
.clients-empty-title { font-size: 17px; font-weight: 700; color: var(--black); }
.clients-empty-desc  { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* =========================================================
   AUTOCOMPLÉTION — formulaire création course
   ========================================================= */
.client-name-wrap { position: relative; }

.client-suggest {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  z-index: 200; overflow: hidden;
  margin-top: 2px;
}

.client-suggest-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.client-suggest-item:last-child { border-bottom: none; }
.client-suggest-item:hover { background: var(--green-soft); }

.csi-name  { font-weight: 600; font-size: 14px; color: var(--black); }
.csi-phone { font-size: 13px; color: var(--muted); }
.login-trust-desc { color: var(--muted); font-size: 13px; }

/* =========================================================
   AUTOCOMPLÉTION ADRESSES — Geoapify
   ========================================================= */

/* Wrapper relatif pour positionner la liste */
.addr-field-wrap {
  position: relative;
}

/* Liste de suggestions */
.addr-suggest {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 2px);
  z-index: 200;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow: hidden;
  /* Animation d'apparition */
  animation: addr-drop 0.15s ease-out;
}
@keyframes addr-drop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Une ligne de suggestion */
.addr-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  outline: none;
}
.addr-item:last-child { border-bottom: none; }
.addr-item:hover,
.addr-item:focus { background: var(--green-soft); }

/* Icône pin */
.addr-item-icon { flex-shrink: 0; margin-top: 2px; }

/* Textes */
.addr-item-text {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0;
}
.addr-item-main {
  font-size: 14px; font-weight: 600; color: var(--black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.addr-item-sub {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* En-tête + items « Adresses récentes » */
.addr-recent-head {
  padding: 8px 12px 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: #9CA3AF;
}
.addr-item-recent .addr-item-icon { opacity: .9; }

/* =========================================================
   RÉPERTOIRE — Clients + Chauffeurs
   ========================================================= */

/* Barre de recherche */
.rep-search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px;
  margin: 12px 16px 0; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.rep-search-wrap input {
  flex: 1; border: none; outline: none; font-size: 14px;
  color: var(--black); background: transparent; font-family: inherit;
}

/* Onglets Clients / Chauffeurs */
.rep-tabs-wrap {
  display: flex; gap: 0; margin: 12px 16px 0;
  background: #F3F4F6; border-radius: var(--radius);
  padding: 3px;
}
.rep-tab {
  flex: 1; padding: 9px 0; border: none; border-radius: calc(var(--radius) - 2px);
  background: transparent; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.rep-tab.active {
  background: var(--white); color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.rep-tab-count {
  font-size: 11px; font-weight: 500;
  opacity: .65; margin-left: 2px;
}

/* Liste */
.rep-list {
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 16px;
}

/* =========================================================
   RÉPERTOIRE — Ligne compacte (liste principale)
   ========================================================= */
.rep-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border-radius: var(--radius);
  padding: 11px 14px; box-shadow: var(--shadow);
  border: 1.5px solid var(--line);
  cursor: pointer; transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.rep-row:hover, .rep-row:focus { background: var(--green-soft); outline: none; }

.rep-row-name {
  flex: 1; min-width: 0;
  font-weight: 600; font-size: 15px; color: var(--black);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Bouton téléphone dans la ligne */
.rep-call-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--green-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background .15s;
}
.rep-call-btn:hover { background: #BBF7D0; }
.rep-call-placeholder { width: 38px; height: 38px; flex-shrink: 0; }

/* Avatar */
.rep-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-dark);
  font-weight: 700; font-size: 17px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.rep-avatar-driver { background: #EFF6FF; color: #2563EB; }

/* Badge disponibilité (réutilisé dans la fiche détaillée) */
.rep-avail {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
}
.avail-green  { background: #D1FAE5; color: #065F46; }
.avail-orange { background: #FEF3C7; color: #92400E; }
.avail-gray   { background: #F3F4F6; color: #6B7280; }

/* =========================================================
   RÉPERTOIRE — Fiche détaillée (bottom sheet)
   ========================================================= */
.rep-detail-sheet { max-height: 80vh; }

/* En-tête avatar + nom + bouton appel */
.rep-detail-header {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.rep-detail-avatar {
  width: 64px; height: 64px; font-size: 26px;
  margin-bottom: 4px;
}
.rep-detail-name {
  font-size: 20px; font-weight: 700; color: var(--black);
  text-align: center;
}
.rep-detail-call {
  display: flex; align-items: center; gap: 6px;
  background: var(--green-soft); color: var(--green-dark);
  padding: 8px 18px; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 14px;
  margin-top: 4px; transition: background .15s;
}
.rep-detail-call:hover { background: #BBF7D0; }

/* Corps : lignes de détail */
.rep-detail-body {
  padding: 14px 20px; overflow-y: auto; flex: 1;
}
.rep-detail-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.rep-detail-row:last-child { border-bottom: none; }
.rep-detail-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.rep-detail-val {
  font-size: 14px; color: var(--black); line-height: 1.4; flex: 1; word-break: break-word;
}
.rep-detail-notes { color: var(--muted); font-style: italic; }

/* Boutons modifier / supprimer */
.rep-detail-actions {
  display: flex; gap: 10px; padding: 12px 20px 0;
  flex-shrink: 0; border-top: 1px solid var(--line);
}
.rep-detail-btn-edit, .rep-detail-btn-delete {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  border: 1.5px solid var(--line); transition: background .15s, color .15s;
}
.rep-detail-btn-edit {
  background: var(--white); color: var(--black);
}
.rep-detail-btn-edit:hover { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
.rep-detail-btn-delete {
  background: var(--white); color: #EF4444; border-color: #FCA5A5;
}
.rep-detail-btn-delete:hover { background: #FEF2F2; }

/* Bouton fermer */
.rep-detail-btn-back {
  display: block; width: calc(100% - 40px); margin: 10px 20px 6px;
  padding: 13px; border-radius: var(--radius);
  border: none; background: #F3F4F6; color: var(--muted);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.rep-detail-btn-back:hover { background: #E5E7EB; }

/* Compatibilité ancienne (certaines lignes CSS référencent encore ces classes) */
.rep-card { display: none; }
.rep-card-inner { display: none; }

/* État vide */
.rep-empty {
  text-align: center; padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.rep-empty-icon  { font-size: 48px; }
.rep-empty-title { font-size: 17px; font-weight: 700; color: var(--black); }
.rep-empty-desc  { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* =========================================================
   RÉPERTOIRE — Bottom sheet ajout / édition
   ========================================================= */
.rep-add-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 700;                 /* au-dessus de la bottom-nav (z 600) — sinon le bouton "Ajouter" est masqué */
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 0 0 env(safe-area-inset-bottom,16px);
  max-height: 90vh; display: flex; flex-direction: column;
  animation: slideUp .22s ease;
}
.rep-sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: #D1D5DB; margin: 10px auto 0; flex-shrink: 0;
}
.rep-sheet-title {
  font-size: 17px; font-weight: 700; color: var(--black);
  padding: 14px 20px 8px; flex-shrink: 0;
}

/* Switcher type (Client / Chauffeur) */
.rep-type-pills {
  display: flex; gap: 0; margin: 0 20px 12px;
  background: #F3F4F6; border-radius: var(--radius);
  padding: 3px; flex-shrink: 0;
}
.rep-type-pill {
  flex: 1; padding: 8px 0; border: none; border-radius: calc(var(--radius) - 2px);
  background: transparent; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.rep-type-pill.active {
  background: var(--white); color: var(--green-dark);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

/* Formulaire scrollable */
.rep-sheet-form {
  overflow-y: auto; padding: 0 20px; flex: 1;
}
.rep-sheet-form .field { margin-bottom: 12px; }

/* Actions save / cancel */
.rep-sheet-actions {
  display: flex; gap: 10px; padding: 12px 20px 6px;
  flex-shrink: 0; border-top: 1px solid var(--line);
}
.rep-sheet-cancel {
  flex: 1; padding: 13px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--white);
  font-size: 15px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.rep-sheet-save {
  flex: 2; padding: 13px; border-radius: var(--radius);
  border: none; background: var(--green); color: var(--white);
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.rep-sheet-save:hover { background: var(--green-dark); }

/* Bouton import contacts téléphone */
.rep-import-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 40px); margin: 0 20px 14px;
  padding: 12px 16px; border-radius: 12px;
  background: #F0FDF4; border: 1.5px dashed #00A86B;
  color: #00A86B; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.rep-import-btn:hover { background: #DCFCE7; }
.rep-import-btn:active { background: #BBF7D0; }
.rep-import-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rep-import-btn-done {
  background: #F0FDF4 !important; border-style: solid !important;
  color: #007A4D !important; pointer-events: none;
}

/* ================================================
   CARTE THERMIQUE DES ZONES
   ================================================ */

/* ══════════════════════════════════════════════════════════
   HEATMAP v=8 — Nouveaux éléments
   ══════════════════════════════════════════════════════════ */

/* Pills filtre type */
.hm-pills {
  display: flex; gap: 8px;
  margin-bottom: 10px;
}
.hm-pill {
  flex: 1;
  padding: 8px 0;
  font-size: 13px; font-weight: 600;
  border: 1.5px solid #E5E7EB;
  border-radius: 20px;
  background: #fff;
  color: #6B7280;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.hm-pill.active {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(34,197,94,.3);
}

/* Chip zone sur la carte */
.hm-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1.5px solid currentColor;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  backdrop-filter: blur(4px);
}
.hm-chip-empty {
  background: rgba(156,163,175,.15) !important;
  border-color: #D1D5DB !important;
  color: #9CA3AF !important;
  font-size: 11px;
}
.hm-chip-dept { font-size: 11px; opacity: .85; }
.hm-chip-cnt  { font-size: 14px; font-weight: 800; }

/* Popup amélioré */
.hm-pop-close {
  position: absolute; top: 10px; right: 10px;
  background: #F3F4F6; border: none; border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #6B7280;
}
.hm-pop-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.hm-pop-name { font-size: 16px; font-weight: 800; color: #111827; }
.hm-pop-dept { font-size: 12px; color: #9CA3AF; margin-top: 2px; }
.hm-pop-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
}
.hm-pop-total {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 10px;
}
.hm-pop-num  { font-size: 28px; font-weight: 800; line-height: 1; }
.hm-pop-unit { font-size: 13px; color: #374151; font-weight: 600; }
.hm-pop-split { font-size: 12px; color: #9CA3AF; margin-left: 4px; }
.hm-pop-cities-title {
  font-size: 11px; font-weight: 700; color: #9CA3AF;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 6px;
}
.hm-pop-cities { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.hm-pop-city {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.hm-pop-city-name { color: #374151; }
.hm-pop-city-cnt  { font-weight: 700; font-size: 13px; }
.hm-pop-btn {
  width: 100%;
  padding: 11px;
  background: #111827; color: #fff;
  border: none; border-radius: 12px;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
  transition: background .15s;
}
.hm-pop-btn:active { background: #22c55e; }

/* Panneau résumé bas de page */
#hm-summary { margin-top: 12px; }
.hm-sum-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid #F3F4F6;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  margin-bottom: 10px;
}
.hm-sum-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: #374151;
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 12px;
}
.hm-sum-live { color: #22c55e; margin-left: auto; font-size: 11px; }
.hm-sum-row  { display: flex; align-items: center; gap: 0; margin-bottom: 12px; }
.hm-sum-block { flex: 1; text-align: center; }
.hm-sum-num   { font-size: 26px; font-weight: 800; color: #111827; }
.hm-sum-lbl   { font-size: 11px; color: #9CA3AF; margin-top: 2px; }
.hm-num-imm   { color: #ef4444; }
.hm-num-rsv   { color: #3b82f6; }
.hm-sum-sep   { width: 1px; height: 36px; background: #F3F4F6; }
.hm-hot-row {
  display: flex; align-items: center; gap: 10px;
  background: #F9FAFB;
  border-radius: 10px;
  padding: 10px 12px;
  border-left-width: 3px;
  border-left-style: solid;
}
.hm-hot-info { display: flex; flex-direction: column; flex: 1; }
.hm-hot-name { font-size: 14px; font-weight: 700; color: #111827; }
.hm-hot-label { font-size: 11px; color: #9CA3AF; }
.hm-hot-cnt  { font-size: 13px; font-weight: 800; }
.hm-sum-empty {
  display: flex; align-items: center; gap: 12px;
  background: #F9FAFB; border-radius: 16px;
  padding: 16px; border: 1px solid #F3F4F6;
}
.hm-sum-empty-title { font-size: 14px; font-weight: 700; color: #374151; }
.hm-sum-empty-sub   { font-size: 12px; color: #9CA3AF; margin-top: 2px; }

/* Légende strip */
.hm-legend-strip {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  background: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid #F3F4F6;
}
.hm-leg {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: #6B7280; font-weight: 500;
}
.hm-leg-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}

/* Bouton heatmap dans le header home */
.hm-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  margin-right: 8px;
  transition: background .15s, border-color .15s;
}
.hm-nav-btn:hover { background: var(--green-soft); border-color: var(--green); }

/* Header de l'écran */
.hm-header {
  display: flex; align-items: center;
  padding: max(14px, env(safe-area-inset-top, 14px)) 16px 12px;
  background: #00A86B;
  border-bottom: none;
  position: sticky; top: 0; z-index: 10;
}
.hm-title {
  flex: 1; text-align: center;
  font-size: 17px; font-weight: 700; color: #fff;
  margin: 0;
}
/* Icônes heatmap header → blanches */
.hm-header .icon-btn svg path,
.hm-header .icon-btn svg rect { stroke: rgba(255,255,255,0.92) !important; }
.hm-header-spacer { width: 40px; }

/* Body scrollable */
.hm-body {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg);
}

/* Conteneur carte Leaflet */
.hm-map-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  height: 340px;
}
#hm-map {
  width: 100%;
  height: 100%;
  background: #1c2331;
}

/* Fond sombre pour les cartes dark (ofl + heatmap) — évite le blanc au pan */
#ofl-map,
#hm-map {
  background: #1c2331 !important;
}
/* Étiquette de zone sur la carte */
.hm-zone-chip {
  display: flex; flex-direction: column; align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-family: inherit;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  white-space: nowrap;
}
.hm-zone-dept { font-size: 13px; font-weight: 800; line-height: 1.2; }
.hm-zone-cnt  { font-size: 10px; font-weight: 600; opacity: .85; }

/* Popup zone */
.hm-popup {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px 14px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  animation: modal-up .18s ease-out;
  z-index: 20;
}
.hm-popup-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none;
  font-size: 15px; color: var(--muted);
  cursor: pointer; padding: 2px 6px;
}
.hm-popup-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.hm-popup-name {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.hm-popup-row {
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.hm-popup-row strong { color: var(--text); }
.hm-popup-icon { font-size: 14px; }

/* Badges niveau */
.hm-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  letter-spacing: .3px;
}
.hm-badge-low  { background: #DCFCE7; color: #00A86B; }
.hm-badge-mid  { background: #FEF3C7; color: #B45309; }
.hm-badge-high { background: #FEE2E2; color: #DC2626; }

/* Légende */
.hm-legend {
  display: flex; justify-content: center; gap: 20px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.hm-legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text);
}
.hm-dot {
  width: 13px; height: 13px; border-radius: 50%;
  flex-shrink: 0;
}
.hm-dot-low  { background: rgba(34,197,94,.6);  border: 2px solid #00A86B; }
.hm-dot-mid  { background: rgba(249,115,22,.55); border: 2px solid #F97316; }
.hm-dot-high { background: rgba(239,68,68,.55);  border: 2px solid #EF4444; }

/* Stats strip */
.hm-stats {
  display: flex; gap: 10px;
}
.hm-stat {
  flex: 1;
  background: #fff;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  display: flex; flex-direction: column; gap: 4px;
}
.hm-stat-val {
  font-size: 22px; font-weight: 800; color: var(--text);
}
.hm-stat-hot { color: #EF4444; }
.hm-stat-key {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
}

/* Note bas de page */
.hm-note {
  text-align: center; font-size: 12px; color: var(--muted);
  margin: 0;
}

/* ── Labels ville heatmap — discrets, pas de rond ── */
.hm-city-tag {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  white-space: nowrap;
  --tag-color: #22c55e;
}
.hm-city-tag-name {
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-shadow:
    0 1px 3px rgba(0,0,0,1),
    0 0 8px rgba(0,0,0,0.9),
    1px 1px 0 rgba(0,0,0,0.8);
  letter-spacing: 0.01em;
}
.hm-city-tag-cnt {
  color: var(--tag-color);
  font-size: 10px;
  font-weight: 700;
  text-shadow:
    0 1px 3px rgba(0,0,0,1),
    0 0 6px rgba(0,0,0,0.9);
}

/* =========================================================
   STATUT CHAUFFEUR — bouton icône topbar
   ========================================================= */

/* Bouton bonhomme dans le topbar */
.dsb-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease;
  padding: 0;
}
.dsb-btn.dsb-on  { background: #DCFCE7; color: var(--green); }
.dsb-btn.dsb-off { background: #FEE2E2; color: #EF4444; }

/* Petit point de statut en bas à droite */
.dsb-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 2px solid white;
  transition: background 0.3s ease;
}
.dsb-btn.dsb-on  .dsb-dot { background: var(--green); }
.dsb-btn.dsb-off .dsb-dot { background: #EF4444; }

/* Anneau de pulse quand disponible */
@keyframes dsb-pulse {
  0%   { opacity: 0.6; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.8); }
  100% { opacity: 0;   transform: scale(1.8); }
}
.dsb-btn.dsb-on::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--green);
  opacity: 0;
  animation: dsb-pulse 2.4s ease-out infinite;
}

/* ── Bandeau compteur de courses (page Home) ── */
.home-count-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--green);
  color: #fff;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
}
.home-count-label {
  opacity: 0.9;
  letter-spacing: .3px;
}
.home-count-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  background: rgba(255,255,255,0.18);
  padding: 2px 12px;
  border-radius: 20px;
  min-width: 36px;
  text-align: center;
}

/* ── Dispatch sheet (planning + course-detail) ── */
.dispatch-sheet-handle {
  width: 36px; height: 4px; background: #E5E7EB;
  border-radius: 2px; margin: 0 auto 16px;
}
.dispatch-section-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin: 16px 0 8px;
}
.dispatch-section-label-opt { display: flex; align-items: center; gap: 6px; }
.dispatch-opt-hint {
  font-size: 11px; font-weight: 400; color: #9CA3AF;
  text-transform: none; letter-spacing: 0;
}
/* Chips canal — état sélectionné */
.dispatch-chip.selected {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
/* Recherche chauffeur */
.dsp-search-wrap {
  position: relative; margin-bottom: 6px;
}
.dsp-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  pointer-events: none;
}
.dsp-search-input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px 9px 32px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; background: var(--bg);
  outline: none;
}
.dsp-search-input:focus { border-color: var(--green); background: #fff; }
/* Avatar groupe (Tous mes chauffeurs) */
.dsp-avatar-group {
  background: #F3F4F6; color: #6B7280;
  display: flex; align-items: center; justify-content: center;
}
.dsp-avatar-group-on {
  background: var(--green) !important; color: #fff !important;
}
/* Liste chauffeurs */
.dispatch-driver-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 150px; overflow-y: auto;
}
.dispatch-driver-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff; cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s;
  width: 100%;
}
.dispatch-driver-item.selected {
  border-color: var(--green);
  background: var(--green-soft);
}

/* =========================================================
   ASSISTANT PLANNING — Section profil
   ========================================================= */
.prof-assistant-section { margin-bottom: 8px; }
.pa-switch { display: flex; align-items: center; cursor: pointer; gap: 8px; }
.pa-switch input { display: none; }
.pa-switch-track {
  width: 44px; height: 24px; border-radius: 999px;
  background: #D1D5DB; position: relative; flex-shrink: 0;
  transition: background 0.3s ease;
}
.pa-switch input:checked + .pa-switch-track { background: var(--green); }
.pa-switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: left 0.3s ease;
}
.pa-switch input:checked + .pa-switch-track .pa-switch-thumb { left: 22px; }
.pa-home-wrap { margin: 12px 0; }
.pa-home-label { font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 6px; display: block; }
.pa-home-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); font-size: 14px;
  background: #fff; box-sizing: border-box;
}
.pa-home-input:focus { border-color: var(--green); outline: none; }
.pa-home-save-btn {
  margin-top: 8px; padding: 8px 16px; border-radius: 8px;
  border: 1.5px solid var(--green); background: #F0FDF4;
  color: var(--green); font-size: 13px; font-weight: 600; cursor: pointer;
}
.pa-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pa-btn {
  padding: 12px; border-radius: 12px; font-size: 14px;
  font-weight: 600; cursor: pointer; border: none; text-align: center;
}
.pa-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pa-btn-secondary { background: #F3F4F6; color: #374151; border: 1.5px solid var(--line); }
.pa-btn-primary { background: var(--green); color: white; }
/* =========================================================
   ÉCRAN DISPONIBILITÉS
   ========================================================= */
.av-form { display: flex; flex-direction: column; gap: 16px; }
.av-row { display: flex; gap: 12px; }
.av-row .av-field { flex: 1; }
.av-field { display: flex; flex-direction: column; gap: 6px; }
.av-label { font-size: 13px; font-weight: 600; color: var(--dark); }
.av-input {
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); font-size: 14px;
  background: white; width: 100%; box-sizing: border-box;
}
.av-input:focus { border-color: var(--green); outline: none; }
.av-input-km { display: flex; align-items: center; gap: 6px; }
.av-input-km .av-input { flex: 1; }
.av-km { font-size: 13px; color: var(--muted); font-weight: 600; }
.av-toggle-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; cursor: pointer; }
.av-home-preview { font-size: 12px; color: var(--muted); margin-top: 4px; padding: 6px 10px; background: #F9FAFB; border-radius: 8px; }
/* =========================================================
   PLANNING PROPOSÉ
   ========================================================= */
.pp-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; gap: 16px; color: var(--muted); font-size: 14px; }
.pp-loading-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #E5E7EB; border-top-color: var(--green); animation: pp-spin 0.8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }
.pp-empty { display: flex; flex-direction: column; align-items: center; padding: 60px 24px; gap: 12px; text-align: center; }
.pp-empty-icon { font-size: 48px; }
.pp-empty-title { font-size: 17px; font-weight: 700; color: var(--dark); }
.pp-empty-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.pp-summary-card { margin: 16px 16px 0; background: white; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.pp-summary-grid { display: flex; flex-wrap: wrap; gap: 0; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.pp-stat-box { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 60px; padding: 4px 8px; }
.pp-stat-box + .pp-stat-box { border-left: 1px solid var(--line); }
.pp-stat-num { font-size: 16px; font-weight: 800; color: var(--dark); }
.pp-stat-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.pp-stat-revenue .pp-stat-num { color: var(--green); }
.pp-summary-actions { display: flex; gap: 10px; padding: 12px 16px; }
.pp-btn-secondary { flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--line); background: white; font-size: 13px; font-weight: 600; color: #6B7280; cursor: pointer; }
.pp-btn-accept-all { flex: 2; padding: 10px 16px; border-radius: 10px; border: none; background: var(--green); color: white; font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,168,107,.3); }
.pp-btn-done { flex: 2; padding: 10px 16px; border-radius: 10px; border: none; background: #F0FDF4; color: var(--green); font-size: 14px; font-weight: 700; }
.pp-timeline { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 0; }
.pp-tl-row { display: flex; gap: 12px; position: relative; }
.pp-tl-dot { width: 14px; height: 14px; border-radius: 50%; background: #E5E7EB; border: 2px solid white; box-shadow: 0 0 0 2px #E5E7EB; flex-shrink: 0; margin-top: 18px; z-index: 1; }
.pp-tl-dot-ok { background: var(--green); box-shadow: 0 0 0 2px #BBF7D0; }
.pp-tl-dot-ko { background: #EF4444; box-shadow: 0 0 0 2px #FECACA; }
.pp-tl-row + .pp-tl-row::before { content: ""; position: absolute; left: 6px; top: -20px; width: 2px; height: 20px; background: #E5E7EB; }
.pp-tl-body { flex: 1; padding-bottom: 16px; }
.pp-deadhead { font-size: 11px; color: var(--muted); padding: 3px 8px; background: #F9FAFB; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.pp-deadhead-min { color: #9CA3AF; }
.pp-item-card { background: white; border-radius: 14px; border: 1.5px solid var(--line); box-shadow: var(--shadow); padding: 12px 14px; }
.pp-item-card.pp-item-accepted { border-color: #BBF7D0; background: #F0FDF4; }
.pp-item-card.pp-item-unavail  { border-color: #FECACA; background: #FFF1F2; opacity: .7; }
.pp-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pp-item-time { font-size: 16px; font-weight: 800; color: var(--dark); }
.pp-item-time-end { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.pp-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.pp-badge-ok { background: #DCFCE7; color: var(--green-dark); }
.pp-badge-ko { background: #FEE2E2; color: #DC2626; }
.pp-item-route { display: flex; flex-direction: column; gap: 0; margin: 6px 0; }
.pp-route-pickup, .pp-route-dropoff { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dark); padding: 3px 0; }
.pp-route-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pp-route-dot-from { background: var(--green); }
.pp-route-dot-to   { background: #EF4444; }
.pp-route-line { width: 2px; height: 14px; background: #E5E7EB; margin-left: 3px; }
.pp-item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pp-item-meta span { font-size: 11px; color: var(--muted); background: #F3F4F6; border-radius: 6px; padding: 2px 8px; }
.pp-item-footer { margin-top: 10px; }
.pp-item-btn { width: 100%; padding: 10px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer; border: none; }
.pp-item-btn-ok { background: var(--green); color: white; }
.pp-item-btn-ko { background: #F3F4F6; color: #9CA3AF; }

/* ── Planning : sections titres ── */
.pp-section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; padding: 16px 16px 6px;
  display: flex; align-items: center;
}
.pp-section-ok { color: #00A86B; }
.pp-section-ko { color: #EF4444; margin-top: 8px; }

/* ── Score badge 0-100 ── */
.pp-score-badge {
  font-size: 12px; font-weight: 800;
  min-width: 30px; text-align: center;
  padding: 2px 7px; border-radius: 8px;
}
.pp-score-high { background: #DCFCE7; color: #15803D; }
.pp-score-mid  { background: #FEF9C3; color: #854D0E; }
.pp-score-low  { background: #FEE2E2; color: #991B1B; }

/* ── Marge horaire badge ── */
.pp-margin-badge {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
}
.pp-margin-badge.good  { background: #F0FDF4; color: #15803D; }
.pp-margin-badge.ok    { background: #FFFBEB; color: #92400E; }
.pp-margin-badge.tight { background: #FFF1F2; color: #9F1239; }

/* ── Raison d'acceptation ── */
.pp-item-reason {
  font-size: 11px; line-height: 1.4;
  padding: 5px 8px; border-radius: 6px;
  margin-top: 6px; display: flex; gap: 5px; align-items: flex-start;
}
.pp-reason-ok { background: #F0FDF4; color: #15803D; }

/* ── Courses refusées ── */
.pp-rejected-list {
  padding: 4px 16px 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.pp-rejected-item {
  background: white;
  border: 1.5px solid #FEE2E2;
  border-radius: 12px;
  padding: 10px 12px;
}
.pp-rejected-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 4px;
}
.pp-rejected-time {
  display: flex; flex-direction: column; gap: 1px;
}
.pp-rejected-time > span:first-child {
  font-size: 14px; font-weight: 800; color: #1F2937;
}
.pp-rejected-route {
  font-size: 12px; color: #6B7280;
}
.pp-rejected-icon {
  font-size: 16px; flex-shrink: 0;
}
.pp-rejected-reason {
  font-size: 12px; color: #DC2626;
  line-height: 1.4; margin-bottom: 4px;
}
.pp-rejected-meta {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px;
}
.pp-rejected-meta span {
  font-size: 11px; color: #6B7280;
  background: #F3F4F6; border-radius: 5px;
  padding: 2px 7px;
}

/* ── Tag de test ── */
.pp-test-tag {
  font-size: 10px; color: #0D9488;
  background: #F0FDFA; border-radius: 5px;
  padding: 2px 8px; margin-top: 5px;
  font-style: italic;
}
.pp-test-tag.ko {
  color: #D97706; background: #FFFBEB;
}

/* ── Résumé vide ── */
.pp-summary-empty-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
}

/* ── Boutons test planning dans le profil ── */
.prof-action-test-create {
  color: #0D9488 !important;
}
.prof-action-test-create:hover { background: #F0FDFA !important; }
.prof-action-test-delete {
  color: #EF4444 !important;
}
.prof-action-test-delete:hover { background: #FFF1F2 !important; }

  background: var(--green-soft);
}
.dispatch-driver-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dispatch-driver-all { background: #6B7280; font-size: 16px; }
.dispatch-driver-info { display: flex; flex-direction: column; gap: 1px; }
.dispatch-driver-name { font-size: 14px; font-weight: 600; color: var(--black); }
.dispatch-driver-sub  { font-size: 11px; color: var(--muted); }

/* Badge "hors appli" pour chauffeurs sans compte WatiTaxi */
.dispatch-no-link {
  display: inline-block;
  font-size: 10px; color: #92400E;
  background: #FEF3C7; border-radius: 4px;
  padding: 1px 5px; margin-left: 4px;
  vertical-align: middle;
}
/* Note d'avertissement sous la liste quand chauffeur hors appli sélectionné */
.dispatch-no-link-hint {
  font-size: 12px; color: #92400E;
  background: #FFFBEB; border: 1px solid #FDE68A;
  border-radius: 8px; padding: 8px 10px;
  margin: 6px 0 0; line-height: 1.4;
}
/* Message vide si répertoire chauffeurs vide */
.dispatch-no-driver-hint {
  font-size: 13px; color: var(--muted);
  text-align: center; line-height: 1.5;
  padding: 10px 0;
}
.dispatch-popover-actions {
  display: flex; gap: 8px; margin-top: 18px;
}
.dispatch-popover-actions .dispatch-popover-cancel {
  flex: 1; padding: 11px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff;
  color: var(--muted); font-size: 14px; cursor: pointer;
}
.dispatch-confirm-btn {
  flex: 2; padding: 11px; border-radius: 10px;
  background: var(--green); color: #fff;
  font-size: 14px; font-weight: 700; border: none; cursor: pointer;
}
.dispatch-confirm-btn.disabled,
.dispatch-confirm-btn.dispatch-confirm-inactive {
  background: #D1FAE5; color: #9CA3AF; cursor: default;
  pointer-events: none;
}
/* Badge cible dans course-detail */
.cd-target-badge {
  background: #EFF6FF; border: 1px solid #BFDBFE;
  color: #1D4ED8; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; margin-bottom: 10px;
}
.cd-dispatch-driver-row {
  margin-top: 8px; display: flex; flex-direction: column; gap: 4px;
}
.cd-dispatch-driver-label {
  font-size: 12px; color: var(--muted); font-weight: 600;
}

/* =========================================================
   ALERTE COURSE IMMÉDIATE — v2 Premium
   WhatsApp · Bolt · Uber Driver
   ========================================================= */

/* ── Conteneur positionné ── */
.imm-alert {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%) translateY(-115%);
  width: min(460px, calc(100vw - 24px));
  z-index: 9999;
  /* Espace depuis le haut : safe-area iOS + 16 px pour ne pas coller à la barre nav */
  padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
  padding-left: 0; padding-right: 0; padding-bottom: 0;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.imm-alert.imm-alert-in {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ── Carte ── */
.imm-alert-inner {
  background: #FFF5F5;
  border-radius: 22px;
  border: 1.5px solid #FECACA;
  box-shadow:
    0 24px 64px rgba(239, 68, 68, 0.22),
    0 6px 20px rgba(0, 0, 0, 0.10);
  overflow: hidden;
}

/* ── Barre du haut : badge + bouton fermer ── */
.imm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 6px;
}
.imm-badge {
  background: #EF4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 99px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.imm-close-btn {
  background: rgba(0,0,0,0.07);
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: #6B7280;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

/* ── Corps : villes + distance ── */
.imm-body {
  padding: 2px 16px 10px;
}
.imm-route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}
.imm-city {
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: -0.4px;
  line-height: 1.1;
}
.imm-city-arrow {
  color: #EF4444;
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
}
.imm-dist {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}

/* ── Chrono MM:SS centré + barre ── */
.imm-timer-wrap {
  padding: 0 16px 10px;
  text-align: center;
}
.imm-timer-display {
  font-size: 42px;
  font-weight: 900;
  color: #F97316;          /* orange au début */
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 10px;
  transition: color 0.5s ease;
}
.imm-timer-display.timer-critical { color: #EF4444; }

.imm-timer-track {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.imm-timer-fill {
  height: 100%;
  width: 100%;
  background: #F97316;     /* orange au début */
  border-radius: 99px;
  transition: width 1s linear, background 0.5s ease;
}
.imm-timer-fill.timer-critical { background: #EF4444; }

/* ── Boutons ── */
.imm-actions {
  display: flex;
  gap: 10px;
  padding: 10px 16px 16px;
}
.imm-btn-dismiss {
  flex: 0 0 auto;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.imm-btn-dismiss:active { background: #F9FAFB; }

.imm-btn-accept {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(0,168,107,0.45);
  animation: imm-accept-pulse 1.8s ease infinite;
  -webkit-tap-highlight-color: transparent;
}
.imm-btn-accept:active {
  transform: scale(0.97);
  animation: none;
  box-shadow: 0 2px 10px rgba(0,168,107,0.35);
}
@keyframes imm-accept-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0,168,107,0.45); }
  50%       { box-shadow: 0 6px 30px rgba(0,168,107,0.70); }
}

/* ── Sélecteur de délai (inline dans .imm-actions après clic ACCEPTER) ── */
.imm-actions.imm-delay-mode {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.imm-delay-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  padding: 2px 0 4px;
}
.imm-delay-subtitle {
  text-align: center;
  font-size: 12px;
  color: #6B7280;
  margin-top: -4px;
  margin-bottom: 2px;
}
.imm-eta-row {
  display: flex;
  gap: 8px;
  justify-content: stretch;
}
.imm-eta-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 12px 4px;
  border-radius: 12px;
  border: 2px solid var(--green);
  background: #fff;
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
}
.imm-eta-chip small {
  font-size: 10px;
  font-weight: 500;
  color: #6B7280;
  letter-spacing: 0;
}
.imm-eta-chip:active {
  background: var(--green);
  color: #fff;
}
.imm-eta-chip:active small { color: rgba(255,255,255,0.8); }
.imm-btn-retour {
  width: 100%;
  padding: 8px;
  border: none;
  background: none;
  color: #9CA3AF;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

/* ─────────────────────────────────────────────
   DISPATCH DIRECT — surcharges visuelles
   Carte bleue/teal au lieu de rouge pour
   distinguer d'une course immédiate du réseau.
───────────────────────────────────────────── */
.dd-alert .imm-alert-inner {
  background: #EFF6FF;
  border-color: #BFDBFE;
}
.dd-badge {
  background: #1D4ED8;
  color: #fff;
}
.dd-retry-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #F59E0B;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.dd-timer-fill {
  background: #1D4ED8;
}
.dd-alert .imm-timer-display { color: #1D4ED8; }
.dd-alert .imm-timer-display.timer-critical { color: #EF4444; }
.dd-alert .dd-timer-fill.timer-critical     { background: #EF4444; }
.dd-from {
  font-size: 13px;
  color: #374151;
  margin-bottom: 4px;
}
.dd-datetime {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1D4ED8;
  background: #EFF6FF;
  border-radius: 8px;
  padding: 5px 10px;
  display: inline-block;
}
.dd-alert .imm-btn-accept {
  background: #1D4ED8;
}
.dd-alert .imm-btn-accept:active { background: #1E40AF; }


/* =========================================================
   REDESIGN v2 — WhatsApp / Uber Driver / Bolt
   Mobile-first · Noir + Vert · Cartes modernes
   ========================================================= */

/* ── Variables enrichies ── */
:root {
  --bg:          #F0F2F5;
  --surface:     #FFFFFF;
  --surface-2:   #F7F8FA;
  --green-hdr:   #00A86B;      /* header vert uniforme WatiTaxi */
  --green:       #00A86B;
  --green-2:     #00C882;
  --green-light: #DCFCE7;
  --bottom-nav-h: 72px;
  --topbar-h:    60px;
  --card-radius: 14px;
  --shadow-card: 0 1px 4px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.04);
}

/* ── TOPBAR HOME — fond vert sombre style WhatsApp ── */
.topbar-home {
  background: var(--green-hdr) !important;
  border-bottom: none !important;
  padding: max(10px, env(safe-area-inset-top, 10px)) 16px 10px !important;
  justify-content: space-between !important;
}
.topbar-home .fab-create {
  background: var(--green-2) !important;
  box-shadow: 0 3px 10px rgba(34,197,94,0.4) !important;
}
.topbar-home .hm-nav-btn {
  background: rgba(255,255,255,0.12) !important;
  border-radius: 10px !important;
  padding: 8px !important;
  border: none !important;
}

/* ── Rangée « Retour à domicile » (switch) au-dessus de la liste Courses ── */
.hr-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin: 4px 0 12px;
  padding: 11px 14px;
  border: 1px solid #E6EDF2; border-radius: 14px;
  background: #fff; cursor: pointer; text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.hr-row-ic { flex: 0 0 auto; display: inline-flex; color: #94A3B8; transition: color .15s ease; }
.hr-row-ic svg { width: 20px; height: 20px; }
.hr-row-lbl { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: #475569; transition: color .15s ease; }
.hr-switch {
  flex: 0 0 auto; position: relative;
  width: 44px; height: 26px; border-radius: 999px;
  background: #CBD5E1; transition: background .18s ease;
}
.hr-switch-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.25);
  transition: transform .18s ease;
}
/* État actif */
.hr-row.is-on { background: #E6F7F0; border-color: #BDEBD5; }
.hr-row.is-on .hr-row-ic { color: #00875A; }
.hr-row.is-on .hr-row-lbl { color: #00875A; font-weight: 700; }
.hr-row.is-on .hr-switch { background: #00A86B; }
.hr-row.is-on .hr-switch-thumb { transform: translateX(18px); }

/* ── BOUTON STATUT CHAUFFEUR — pill texte visible ── */
.dsb-pill {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 13px !important;
  border-radius: 999px !important;
  border: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  transition: background 0.2s, color 0.2s !important;
  white-space: nowrap !important;
}
.dsb-pill.dsb-on {
  background: rgba(255,255,255,0.18) !important;
  color: #fff !important;
}
.dsb-pill.dsb-off {
  background: rgba(239,68,68,0.28) !important;
  color: #fff !important;
}
.dsb-pill .dsb-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  position: static !important;
  border: none !important;
}
.dsb-pill.dsb-on  .dsb-dot { background: #4ADE80 !important; }
.dsb-pill.dsb-off .dsb-dot { background: #F87171 !important; }
/* 3ᵉ état : Retour maison — pastille BLANCHE pleine, accents verts (Option A) */
.dsb-pill.dsb-home { background: #fff !important; color: #00875A !important; }
.dsb-pill.dsb-home .dsb-dot { background: #00A86B !important; }

/* ── Menu déroulant sous la pastille de statut ── */
#dsb-status-menu { position: fixed; inset: 0; z-index: 9000; }
.dsb-menu-backdrop { position: absolute; inset: 0; background: transparent; }
.dsb-menu-card {
  position: fixed; min-width: 224px; max-width: 264px;
  background: #fff; border-radius: 16px; padding: 6px;
  box-shadow: 0 14px 34px rgba(16,24,40,.22);
  transform-origin: top right;
  opacity: 0; transform: translateY(-6px) scale(.97);
  transition: opacity .16s ease, transform .16s ease;
}
#dsb-status-menu.dsb-menu-open .dsb-menu-card { opacity: 1; transform: translateY(0) scale(1); }
.dsb-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 12px;
  border: none; background: transparent; border-radius: 12px;
  cursor: pointer; text-align: left;
  transition: background .12s ease;
}
.dsb-menu-item:active { background: #F1F5F9; }
.dsb-mi-ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.dsb-menu-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dsb-menu-item b { font-size: 14.5px; color: #0F172A; font-weight: 700; line-height: 1.2; }
.dsb-menu-item small { font-size: 12px; color: #64748B; }
.dsb-menu-off b { color: #475569; }

/* ── BRAND HOME (nom centré dans la topbar) ── */
/* NE PAS écraser position: fixed hérité de .topbar — le centrage absolu fonctionne dans un parent fixed */
.home-brand {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  pointer-events: none !important;
}
.home-brand-w {
  font-size: 19px !important;
  font-weight: 900 !important;
  color: #4ADE80 !important;
  line-height: 1 !important;
}
.home-brand-name {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: rgba(255,255,255,0.92) !important;
  line-height: 1 !important;
  letter-spacing: -0.2px !important;
}

/* ── PILLS FILTER BAR ── */
.home-pills-wrap {
  position: relative;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
/* Fade gradient droite — indique que la barre est scrollable */
.home-pills-wrap::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(to left, #fff 20%, transparent);
  pointer-events: none;
  z-index: 1;
}
.home-pills-bar {
  display: flex !important;
  gap: 8px !important;
  padding: 10px 14px !important;
  background: transparent !important;
  border-bottom: none !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  /* NE PAS mettre en sticky : risque de chevauchement sur iOS */
}
.home-pills-bar::-webkit-scrollbar { display: none !important; }

.h-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  border-radius: 20px !important;
  border: 1.5px solid var(--line) !important;
  background: #fff !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  -webkit-tap-highlight-color: transparent !important;
  flex-shrink: 0 !important;
}
.h-pill:active { transform: scale(0.97) !important; }

.h-pill-cnt {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: 9px !important;
  background: var(--line) !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

/* Pill active — Toutes / Réservations */
.h-pill.active {
  background: var(--green-soft) !important;
  border-color: var(--green) !important;
  color: var(--green-dark) !important;
  font-weight: 600 !important;
}
.h-pill.active .h-pill-cnt {
  background: var(--green) !important;
  color: #fff !important;
}

/* Pill Immédiates active — rouge */
.h-pill.h-pill-imm.active {
  background: #FFF5F5 !important;
  border-color: #FC8181 !important;
  color: #C53030 !important;
}
.h-pill.h-pill-imm.active .h-pill-cnt {
  background: #FC8181 !important;
  color: #fff !important;
}

/* ── INDICATEUR EN DIRECT ── */
.h-live-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 16px 3px;
  background: #fff;
}
.h-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: live-pulse 1.8s ease-in-out infinite;
}
.h-live-txt {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.75); }
}

/* ── BOUTON "PASSER EN LIGNE" dans l'empty-state offline ── */
.offline-go-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 20px !important;
  padding: 14px 32px !important;
  background: var(--green) !important;
  color: #fff !important;
  border-radius: 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0,168,107,0.35) !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: transform 0.12s, box-shadow 0.12s !important;
}
.offline-go-btn:active {
  transform: scale(0.97) !important;
  box-shadow: 0 2px 8px rgba(0,168,107,0.25) !important;
}

/* ── ZONE CONTENU HOME (fond légèrement gris) ── */
#screen-home .container {
  background: var(--bg) !important;
  padding: 12px 12px !important;
  padding-bottom: 12px !important; /* réinitialisé explicitement */
}
/* Container avec espace nav bas — doit surpasser le padding !important ci-dessus */
#screen-home .container-bottom-nav {
  padding-bottom: 120px !important; /* nav 68px + safe-area 34px + marge */
}

/* ── SEARCH BAR ── */
#screen-home .search-bar,
#screen-home .search-compact {
  background: var(--surface) !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 9px 12px !important;
  box-shadow: var(--shadow-card) !important;
  margin: 0 0 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
#screen-home .search-compact input {
  font-size: 16px !important; /* 16px min pour éviter zoom iOS */
  color: var(--black) !important;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  flex: 1 !important;
  padding: 0 !important;
}

/* ── FILTER CHIPS ── */
#screen-home .filters { padding: 0 0 8px !important; gap: 8px !important; }
#screen-home .filter-chip {
  border-radius: 8px !important;
  font-size: 13px !important;
  padding: 7px 14px !important;
  border: none !important;
  background: var(--surface) !important;
  color: var(--muted) !important;
  box-shadow: var(--shadow-card) !important;
  font-weight: 600 !important;
}
#screen-home .filter-chip.active {
  background: var(--green) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(0,168,107,0.35) !important;
}

/* ── DEPT SELECT ── */
#screen-home .dept-select {
  border-radius: 12px !important;
  box-shadow: var(--shadow-card) !important;
  border: none !important;
  margin: 0 0 10px !important;
}

/* ── LISTE COURSES ── */
#screen-home .rides-list { gap: 10px !important; margin-top: 0 !important; }

/* ── CARTE COURSE MODERNE (style Uber/Bolt) ── */
.ride-row {
  background: var(--surface) !important;
  border-radius: var(--card-radius) !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden !important;
  display: block !important;
  cursor: pointer !important;
}
.ride-row:active { opacity: .93 !important; transform: scale(0.99) !important; }
.ride-row.urgent { border-left: 4px solid #EF4444 !important; border-radius: var(--card-radius) !important; }
.ride-row-mine  { border-left: 4px solid #7C3AED !important; }

/* Partie haute de la carte */
.ride-card-top {
  display: flex;
  align-items: flex-start;
  padding: 14px 14px 10px;
  gap: 12px;
}

/* Colonne route (dots + ligne) */
.ride-route-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  flex-shrink: 0;
  gap: 0;
}
.route-dot-from {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--green);
  flex-shrink: 0;
}
.route-dot-line {
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, var(--green), #D1D5DB);
  flex-shrink: 0;
}
.route-dot-to {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #6B7280;
  flex-shrink: 0;
}

/* Infos route */
.ride-route-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ride-from-row, .ride-to-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ride-city-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ride-city-name.to { color: #374151; font-weight: 600; }
.ride-dept-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
  background: #EFF6FF;
  color: #1D4ED8;
}

/* Colonne droite : heure + action */
.ride-right-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  min-width: 84px;
}
.ride-time-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.pool-badge-imm {
  background: #EF4444 !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  letter-spacing: 0.3px !important;
}

/* Bas de carte : chips infos + nom dispatcher */
.ride-card-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px 10px;
  border-top: 1px solid #F3F4F6;
  gap: 5px;
}
.ride-dispatcher-name {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ride-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.ride-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.ride-chip.price {
  background: var(--green-light);
  color: var(--green-hdr);
  font-weight: 700;
}
/* Estimation auto — légèrement moins saturée que le prix manuel */
.ride-chip.price-estimate {
  background: #F0FDF4;
  color: #15803D;
  font-weight: 600;
  border: 1px solid #BBF7D0;
}
.ride-chip.medical {
  background: #FEF2F2;
  color: #B91C1C;
}

/* Bouton Accepter moderne */
.btn-accept-ride {
  background: var(--green) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 9px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(0,168,107,0.30) !important;
  transition: background 0.15s !important;
}
.btn-accept-ride:hover { background: var(--green-dark) !important; }
.btn-accept-ride:active { transform: scale(0.97) !important; }

.pool-mine-pill {
  background: #EDE9FE !important;
  color: #5B21B6 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 7px 12px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
}

/* ── BOTTOM NAV MODERNE ── */
.bottom-nav {
  /* La height s'étend pour couvrir la safe-area iOS (notch bas).
     Le padding-bottom pousse les boutons vers le haut, hors de la zone home indicator.
     box-sizing:border-box : height inclut le padding → les boutons gardent 68px. */
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)) !important;
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  background: var(--surface) !important;
  border-top: 1px solid #EAECEF !important;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06) !important;
}
.nav-btn {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #9CA3AF !important;
  gap: 4px !important;
  padding: 10px 4px 8px !important;
  border-radius: 0 !important;
  position: relative !important;
  transition: color 0.15s !important;
}
.nav-btn svg path, .nav-btn svg rect, .nav-btn svg circle, .nav-btn svg polyline, .nav-btn svg line {
  stroke: #9CA3AF !important;
  transition: stroke 0.15s !important;
}
.nav-btn.active { color: var(--green) !important; }
.nav-btn.active svg path, .nav-btn.active svg rect,
.nav-btn.active svg circle, .nav-btn.active svg polyline, .nav-btn.active svg line {
  stroke: var(--green) !important;
}
/* Indicateur ligne verte en haut */
.nav-btn.active::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--green);
  border-radius: 0 0 3px 3px;
}

/* ── BOUTON + CENTRAL DANS LA NAV ── */
.nav-btn-plus {
  background: #00A86B !important;
  border-radius: 50% !important;
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  flex: 0 0 54px !important;
  padding: 0 !important;
  margin-top: -14px !important;
  box-shadow: 0 4px 18px rgba(0,168,107,0.45) !important;
  border: 3px solid var(--surface, #fff) !important;
  color: #fff !important;
  align-self: center !important;
}
.nav-btn-plus svg path { stroke: #fff !important; }
.nav-btn-plus::before { display: none !important; }
.nav-btn-plus:active { transform: scale(0.93) !important; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   BARRE FILTRE 1 LIGNE (search + dept + urgent)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.filter-bar {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 12px 6px !important;
  max-width: 480px !important;
  margin: 0 auto !important;
}

/* Champ de recherche — flex 1 */
.fb-search {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #F3F4F6 !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 10px !important;
  padding: 7px 10px !important;
  height: 36px !important;
}
.fb-search input {
  flex: 1 !important;
  border: none !important;
  background: transparent !important;
  font-size: 16px !important; /* 16px minimum pour éviter le zoom iOS */
  color: #1F2937 !important;
  min-width: 0 !important;
  outline: none !important;
  padding: 0 !important;
}
.fb-search input::placeholder { color: #9CA3AF !important; }

/* Dropdown département — même largeur que la recherche */
.fb-dept {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  position: relative !important;
}
.fb-dept summary {
  display: flex !important;
  align-items: center !important;
  gap: 3px !important;
  background: #F3F4F6 !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 10px !important;
  padding: 7px 8px !important;
  height: 36px !important;
  width: 100% !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #374151 !important;
  cursor: pointer !important;
  list-style: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  -webkit-appearance: none !important;
}
.fb-dept summary::-webkit-details-marker { display: none !important; }
.fb-dept .dept-list {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  min-width: 200px !important;
  background: #fff !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14) !important;
  z-index: 200 !important;
  max-height: 280px !important;
  overflow-y: auto !important;
  padding: 6px !important;
}

/* Chip urgentes */
.filter-bar .filter-chip {
  flex-shrink: 0 !important;
  height: 36px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  border: 1px solid #FECACA !important;
  background: #FEF2F2 !important;
  color: #EF4444 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
}
.filter-bar .filter-chip.active {
  background: #EF4444 !important;
  color: #fff !important;
  border-color: #EF4444 !important;
}

/* Icônes nav — forcer couleurs explicites Safari PWA */
.nav-btn svg path,
.nav-btn svg rect,
.nav-btn svg circle,
.nav-btn svg polyline,
.nav-btn svg line {
  stroke: #9CA3AF;
}
.nav-btn.active svg path,
.nav-btn.active svg rect,
.nav-btn.active svg circle,
.nav-btn.active svg polyline,
.nav-btn.active svg line {
  stroke: #00A86B;
}

/* ── FORMULAIRE CRÉATION COURSE ── */
#screen-create-ride { background: var(--bg) !important; }
/* override supprimé — .cr2-header gère le header formulaire */
#screen-create-ride .container { padding: 16px 14px !important; }

/* Groupes de champs en carte */
.form-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  padding: 4px 0;
  overflow: hidden;
}
.form-card-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 12px 16px 6px;
}
.form-card .field {
  padding: 8px 16px !important;
  gap: 4px !important;
  border-bottom: 1px solid var(--line);
}
.form-card .field:last-child { border-bottom: none; }
.form-card .field-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--muted) !important;
}
.form-card .field input,
.form-card .field select,
.form-card .field textarea {
  border: none !important;
  background: transparent !important;
  padding: 6px 0 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: var(--black) !important;
  border-radius: 0 !important;
}
.form-card .field input:focus,
.form-card .field select:focus {
  outline: none !important;
  border-bottom: 2px solid var(--green) !important;
}
.form-card .field-check {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 12px 16px !important;
  font-size: 16px !important; /* 16px min pour éviter zoom iOS */
  font-weight: 500 !important;
}
.form-card .grid-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 !important;
}
.form-card .grid-2 .field { border-right: 1px solid var(--line); }
.form-card .grid-2 .field:last-child { border-right: none; }

/* Bouton submit moderne */
#cr-submit-btn {
  background: var(--green) !important;
  border-radius: var(--card-radius) !important;
  height: 54px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  box-shadow: 0 4px 14px rgba(0,168,107,0.35) !important;
  margin-top: 20px !important;
}

/* ── SECTION-TITLE dans form ── */
.section-title {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  color: var(--muted) !important;
  margin: 20px 0 6px !important;
}

/* ── EMPTY STATE ── */
.empty-state {
  background: var(--surface) !important;
  border-radius: var(--card-radius) !important;
  margin: 8px 0 !important;
  padding: 40px 24px !important;
  box-shadow: var(--shadow-card) !important;
}

/* ── HEATMAP — barre filtre département ── */
.hm-dept-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}
.hm-dept-select {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #1F2937;
  font-family: inherit;
  cursor: pointer;
  outline: none;
}

/* ── FILTRE CHIP "Urgentes" seul ── */
#screen-home .filter-chip[data-filter="urgent"] {
  background: #FEF2F2 !important;
  color: #B91C1C !important;
  border: 1px solid #FECACA !important;
  box-shadow: none !important;
}
#screen-home .filter-chip[data-filter="urgent"].active {
  background: #EF4444 !important;
  color: #fff !important;
  border-color: #EF4444 !important;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3) !important;
}

/* =========================================================
   UI/UX PRO MAX — Améliorations design WatiTaxi
   Basé sur : Inter font, 44px touch targets, transitions,
   glassmorphism, depth cards, cursor-pointer partout
   ========================================================= */

/* ── 1. POLICE INTER (Google Fonts) ── */
*, *::before, *::after {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ── 2. CURSOR POINTER — tous les éléments interactifs ── */
button, [role="button"], .nav-btn, .h-pill, .ride-row,
.btn-accept-ride, .home-counter, .dept-item, .filter-chip,
.modal-action-btn, .accept-btn-confirm, .accept-btn-cancel,
.lp-btn, .dsb-pill, .hm-nav-btn, .fab-create, .nav-btn-plus,
a, summary, .notif-item, .msg-thread-item, details > summary {
  cursor: pointer !important;
}

/* ── 3. TRANSITIONS FLUIDES 150ms sur tous les interactifs ── */
button, .h-pill, .ride-row, .nav-btn, .dept-item,
.filter-chip, .home-counter, .accept-btn-confirm,
.accept-btn-cancel, .lp-btn, .dsb-pill {
  transition: background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease,
              transform 0.12s ease, opacity 0.15s ease !important;
}

/* ── 4. TOUCH TARGETS 44px minimum (UX Pro Max — severity HIGH) ── */
.nav-btn {
  min-height: 44px !important;
  min-width: 44px !important;
}
.btn-accept-ride {
  min-height: 40px !important;
  padding: 8px 16px !important;
}
.h-pill {
  min-height: 36px !important;
}
.dsb-pill {
  min-height: 36px !important;
}
.hm-nav-btn {
  min-width: 44px !important;
  min-height: 44px !important;
}
.lp-btn {
  min-height: 52px !important;
}

/* ── 5. CARTES RIDE — depth + ombre améliorée ── */
.ride-row {
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04) !important;
  border-radius: 16px !important;
  transition: box-shadow 0.18s ease, transform 0.12s ease !important;
}
.ride-row:active {
  transform: scale(0.985) !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06) !important;
}

/* ── 6. TOPBAR HOME — glassmorphism renforcé ── */
.topbar-home {
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* ── 7. BOTTOM NAV — ombre haut de gamme ── */
.bottom-nav {
  box-shadow: 0 -1px 0 rgba(0,0,0,0.06), 0 -4px 20px rgba(0,0,0,0.06) !important;
}

/* ── 8. BOUTON LOGIN — effet press tactile ── */
.lp-btn:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(0,168,107,0.25) !important;
}

/* ── 9. PILLS — hover plus visible ── */
.h-pill:hover:not(.active) {
  background: #F9FAFB !important;
  border-color: #9CA3AF !important;
  color: #374151 !important;
}

/* ── 10. NAV BTN — hover state ── */
.nav-btn:hover {
  opacity: 0.8 !important;
}
.nav-btn:active {
  transform: scale(0.92) !important;
}

/* ── 11. CARTES ACCEPT SHEET — ombre depth ── */
.accept-sheet {
  box-shadow: 0 -4px 40px rgba(0,0,0,0.15), 0 -1px 0 rgba(0,0,0,0.05) !important;
}

/* ── 12. INPUT FOCUS — outline discret (pas de rectangle visible) ── */
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: var(--green) !important;
}
.lp-input:focus {
  box-shadow: 0 0 0 2px rgba(0,168,107,0.20) !important;
}

/* ── 13. BOUTON ACCEPTER — hover plus visible ── */
.btn-accept-ride:hover {
  background: var(--green-dark) !important;
  transform: scale(1.02) !important;
}

/* ── 14. RIDE ROW URGENT — animation subtile ── */
.ride-row.urgent {
  border-left: 3px solid #EF4444 !important;
}

/* ── 15. EMPTY STATE — centrage parfait ── */
.empty-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 48px 24px !important;
  gap: 8px !important;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   OPC — Offline Premium Card (état hors-ligne chauffeur)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Wrapper centrage vertical */
.opc-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 4px;
  min-height: 380px;
}

/* Carte blanche */
.opc-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  padding: 36px 24px 28px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: opcIn .35s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes opcIn {
  from { opacity:0; transform:translateY(14px) scale(.97); }
  to   { opacity:1; transform:translateY(0)   scale(1);   }
}

/* ─── Icône radar (CSS pur — 3 cercles concentriques) ─── */
.opc-radar {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.opc-ring {
  position: absolute;
  border-radius: 50%;
  animation: opcPulse 2.4s ease-in-out infinite;
}
.opc-ring-3 {
  width: 96px; height: 96px;
  background: rgba(239,68,68,0.08);
  animation-delay: 0s;
}
.opc-ring-2 {
  width: 68px; height: 68px;
  background: rgba(239,68,68,0.16);
  animation-delay: .15s;
}
.opc-ring-1 {
  width: 44px; height: 44px;
  background: rgba(239,68,68,0.25);
  animation-delay: .30s;
}
.opc-dot {
  width: 18px; height: 18px;
  background: #EF4444;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.20);
}
@keyframes opcPulse {
  0%,100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.08); opacity: .8; }
}

/* ─── Textes ─── */
.opc-title {
  font-size: 20px;
  font-weight: 700;
  color: #1F2937;
  margin: 0 0 14px;
  line-height: 1.2;
}
.opc-sep {
  width: 40px;
  height: 3px;
  background: #EF4444;
  border-radius: 99px;
  margin: 0 auto 18px;
  opacity: .75;
}
.opc-desc {
  font-size: 14px;
  color: #6B7280;
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 240px;
}

/* ─── Bouton "Passer en ligne" ─── */
.opc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: #00A86B;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 54px;
  box-shadow: 0 4px 16px rgba(0,168,107,.38);
  transition: transform .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .1px;
}
.opc-btn:active {
  transform: scale(.97);
  box-shadow: 0 2px 8px rgba(0,168,107,.25);
}

/* ─── Hint "position invisible" ─── */
.opc-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  background: #F9FAFB;
  border-radius: 12px;
  text-align: left;
  width: 100%;
}
.opc-hint-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FEE2E2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.opc-hint span {
  font-size: 12px;
  color: #6B7280;
  line-height: 1.55;
  padding-top: 2px;
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   PLANNING — Onglets Mon planning / Mon réseau   (v37)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* ── Barre d'onglets ── */
.pl-tabs-bar {
  display: flex;
  background: #fff;
  border-bottom: 1.5px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 10;
}
.pl-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 18px 8px;
  font-size: 14px;
  font-weight: 700;
  color: #6B7280;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.pl-tab.active {
  color: #00A86B;
  border-bottom-color: #00A86B;
}
/* Réseau : onglet bleu quand actif */
.pl-tab[data-tab="network"].active {
  color: #1976D2;
  border-bottom-color: #1976D2;
}

/* ── Header bleu pour l'onglet "Mon réseau" ── */
.planning-header.pl-header-network {
  background: linear-gradient(180deg, #42A5F5 0%, #1976D2 100%) !important;
}

/* ── Carte réseau (fond légèrement bleuté) ── */
.planning-card.planning-card-net {
  border-left: 3px solid #1976D2 !important;
  background: #F0F7FF !important;
}

/* ── Nouvelle rangée chauffeur dans la carte réseau ── */
.pl-driver-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.pl-driver-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1976D2;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pl-driver-name {
  font-size: 12px;
  color: #1976D2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-eta {
  font-size: 11px;
  color: #6B7280;
  background: #E5E7EB;
  border-radius: 99px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ── Route simplifiée (flèche inline) ── */
.pl-route {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  min-width: 0;
}
.pl-city {
  font-size: 12px;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* ── Tag IMM ── */
.pl-imm-tag {
  font-size: 9px;
  font-weight: 700;
  background: #FEF3C7;
  color: #B45309;
  border-radius: 4px;
  padding: 1px 4px;
  margin-top: 2px;
  display: block;
  text-align: center;
}

/* ── Bouton Dispatcher (rouge) — simple, sans cercle ── */
.pl-dispatch-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 8px 14px !important;
  background: #DC2626 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  min-height: 36px !important;
  white-space: nowrap !important;
  transition: transform .1s, background .1s !important;
  -webkit-tap-highlight-color: transparent !important;
}
.pl-dispatch-btn:active {
  transform: scale(.96) !important;
  background: #B91C1C !important;
}

/* ── Carte expirée (Non prise, Redispatcher) ── */
.pl-card-expired {
  border-left: 3px solid #9CA3AF;
  background: #F9FAFB;
  opacity: 0.92;
}
.pl-expired-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: #6B7280;
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  margin-top: 4px;
  letter-spacing: 0.3px;
}

/* ── Carte réservation directe en attente ── */
.pl-card-incoming {
  border-left: 3px solid #F59E0B;
  background: #FFFBEB;
}
.pl-incoming-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: #F59E0B;
  color: #fff;
  border-radius: 999px;
  padding: 2px 6px;
  margin-top: 4px;
  letter-spacing: 0.3px;
}
.pl-incoming-from {
  font-size: 11px;
  color: #6B7280;
  margin-top: 2px;
}

/* ── Chips infos passagers + prix (card planning acceptée) ── */
.pl-info-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.pl-info-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #6B7280;
  background: #F3F4F6;
  border-radius: 4px;
  padding: 2px 6px;
  gap: 2px;
}
.pl-info-chip--price {
  color: #00A86B;
  background: #DCFCE7;
}

.pl-incoming-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}
.pl-accept-btn {
  background: #00A86B;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.pl-accept-btn:active { transform: scale(0.96); background: #007A4D; }
.pl-refuse-btn {
  background: transparent;
  color: #DC2626;
  border: 1.5px solid #DC2626;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.pl-refuse-btn:active { transform: scale(0.96); }

/* ── Pills de statut ── */
.pl-status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
  text-align: center;
}
.pl-status-dispatching { background: #FEF3C7; color: #B45309; }
.pl-status-accepted    { background: #D1FAE5; color: #065F46; }
.pl-status-inprogress  { background: #DCFCE7; color: #166534; }
.pl-status-aboard      { background: #DBEAFE; color: #1E40AF; }
.pl-status-done        { background: #F3F4F6; color: #6B7280; }
.pl-status-cancelled   { background: #FEE2E2; color: #991B1B; }

/* Groupe badge + poubelle (courses terminées/annulées) */
.pl-right-done {
  display: flex; align-items: center; gap: 6px;
}
.pl-delete-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex-shrink: 0;
  background: transparent; border: 1px solid #FECACA;
  border-radius: 8px; color: #EF4444; cursor: pointer;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.pl-delete-btn:hover  { background: #FEF2F2; border-color: #EF4444; }
.pl-delete-btn:active { transform: scale(.94); }
.pl-delete-btn:disabled { opacity: .4; pointer-events: none; }

/* Pills réseau */
.net-accepted    { background: #D1FAE5; color: #065F46; }
.net-inprogress  { background: #DCFCE7; color: #166534; }
.net-aboard      { background: #DBEAFE; color: #1E40AF; }
.net-done        { background: #F3F4F6; color: #6B7280; }

/* ── Carte annulée ── */
.planning-card.pl-card-cancelled {
  opacity: .55 !important;
}

/* ──────────────────────────────────────────────
   MODE SÉLECTION / SUPPRESSION GROUPÉE (planning)
   Header : croix gauche + poubelle rouge droite
   ────────────────────────────────────────────── */

/* Liste grisée en mode sélection */
#planning-list.pl-select-mode .planning-card {
  opacity: 0.5;
  transition: opacity .15s;
}
/* Card cochée → pleine opacité + contour vert */
#planning-list.pl-select-mode .planning-card:has(.pl-sel-checked) {
  opacity: 1;
  box-shadow: 0 0 0 2px #22c55e;
}

/* Cercle de sélection en haut à droite de la card */
.pl-sel-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  pointer-events: none;
}
.pl-sel-indicator.pl-sel-checked {
  background: #22c55e;
  border-color: #22c55e;
}

/* Card position:relative pour ancrer l'indicateur */
.planning-card { position: relative; }

/* Titre qui s'efface en mode sélection */
#planning-title-el {
  transition: opacity .2s;
}

/* ──────────────────────────────────────────────
   ACCENT COULEUR (bordure gauche) selon le rôle
   Vert = ma course (dispatcheur)
   Bleu plus épais = course prise sur le réseau
   !important pour écraser border-left: 4px solid var(--green) de la règle de base
   ────────────────────────────────────────────── */
.planning-card.pl-card-mine {
  border-left: 3px solid #22c55e !important;
}

.planning-card.pl-card-driver {
  border-left: 5px solid #3B82F6 !important;
}

/* ── Bouton Supprimer (course-detail.js v10) ── */
.cd-btn-delete {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: 100% !important;
  padding: 12px !important;
  margin-top: 6px !important;
  background: transparent !important;
  color: #EF4444 !important;
  border: 1.5px solid #FECACA !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  min-height: 44px !important;
  transition: background .15s, border-color .15s !important;
  -webkit-tap-highlight-color: transparent !important;
}
.cd-btn-delete:active {
  background: #FEF2F2 !important;
  border-color: #EF4444 !important;
}

/* =========================================================
   SPLASH SCREEN
   ========================================================= */
#screen-splash {
  position: fixed;
  inset: 0;
  /* Fond porté par #sp-bg (couche fixed dégradé). Transparent ici. */
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .45s ease, transform .45s ease;
}
#screen-splash.sp-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Anneaux décoratifs */
.sp-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sp-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(0,168,107,.18);
  left: 50%; top: 42%;
  transform: translate(-50%, -50%) scale(0);
  animation: sp-ring-grow 2.4s ease-out forwards;
}
.sp-ring-1 { width: 260px; height: 260px; animation-delay: .1s; }
.sp-ring-2 { width: 400px; height: 400px; animation-delay: .35s; border-color: rgba(0,168,107,.1); }
.sp-ring-3 { width: 560px; height: 560px; animation-delay: .6s;  border-color: rgba(0,168,107,.06); }
@keyframes sp-ring-grow {
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Corps central */
.sp-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

/* Logo */
.sp-logo-wrap {
  width: 108px; height: 108px;
  background: #fff;
  border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 0 rgba(0,168,107,.5);
  animation: sp-logo-in .55s cubic-bezier(.34,1.56,.64,1) forwards,
             sp-pulse 2s ease-in-out 1s infinite;
  opacity: 0;
  transform: scale(.5);
}
@keyframes sp-logo-in {
  to { opacity: 1; transform: scale(1); }
}
@keyframes sp-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,168,107,.4); }
  50%      { box-shadow: 0 0 0 14px rgba(0,168,107,.0); }
}
.sp-logo { display: block; width: 88px; height: 88px; object-fit: contain; }

/* Nom de marque */
.sp-brand {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -.5px;
  opacity: 0;
  animation: sp-fade-up .5s ease .45s forwards;
}
.sp-wati { color: #fff; }
.sp-taxi { color: #00A86B; }

/* Tagline */
.sp-tagline {
  font-size: 14px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
  margin: 0;
  opacity: 0;
  animation: sp-fade-up .5s ease .65s forwards;
}
.sp-region {
  font-size: 12px;
  color: rgba(0,168,107,.7);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
  opacity: 0;
  animation: sp-fade-up .5s ease .8s forwards;
}

@keyframes sp-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Barre de progression */
.sp-progress-wrap {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,.07);
}
.sp-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00A86B, #00C882);
  border-radius: 0 2px 2px 0;
  transition: width linear;
}

/* ==========================================================
   COURSE EN COURS — Layout carte + bottom-sheet
   ========================================================== */

/* Pill statut dans le header (ex: "À démarrer") */
.cd-status-pill {
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Map Leaflet */
.cd-map-hidden { display: none; height: 0; overflow: hidden; }
.cd-map-visible {
  display: block;
  height: 210px;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

/* ── Mode FULL / POOL : même layout flex que CEC pour que la bottom-nav
   reste toujours visible sans dépendre de position:fixed.
   Sur mobile (Safari/WebKit), position:sticky sur le header crée un
   stacking context qui peut faire "remonter" un nav position:fixed. ── */
#screen-course-detail.active:not(.cec-mode) {
  display: flex !important;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}
#screen-course-detail.active:not(.cec-mode) #cd-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Cartes plus larges : marge latérale unifiée à 10px (identique au mode cec) */
  padding-left: 10px !important;
  padding-right: 10px !important;
  /* FIX largeur : dans le parent flex-colonne, "margin:0 auto" (de .container) empêchait
     l'étirement → #cd-body se rétrécissait à la largeur du contenu (adresses courtes = carte étroite).
     On force la pleine largeur, indépendamment de la longueur des adresses. */
  width: 100% !important;
  align-self: stretch !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
}
/* La bottom-nav devient un flex item stable — plus de position:fixed */
#screen-course-detail.active:not(.cec-mode) #cd-bottom-nav {
  position: static !important;
  flex-shrink: 0;
  height: var(--bottom-nav-h);
  /* Restore les styles visuels que position:fixed portait */
  width: 100%;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.06), 0 -4px 20px rgba(0,0,0,0.06);
}

/* ── Mode "Course en cours" : layout flex colonne propre ──────── */
#screen-course-detail.active.cec-mode {
  display: flex !important;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: #00A86B;
}
/* cd-body = zone scrollable qui prend tout l'espace disponible */
#screen-course-detail.active.cec-mode #cd-body {
  flex: 1 1 0;
  min-height: 0;          /* important pour que flex ne déborde pas */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #F9FAFB;
  border-radius: 20px 20px 0 0;
  margin-top: -20px;
  z-index: 2;
  position: relative;
  padding: 0 10px 20px 10px;   /* marge latérale 10px = identique au mode récap (cartes alignées) */
}
/* Masquer la bottom-nav, montrer le CTA (flex item, pas absolu) */
#screen-course-detail.active.cec-mode #cd-bottom-nav { display: none !important; }
#screen-course-detail.active.cec-mode #cd-sticky-cta {
  display: flex !important;
  flex-shrink: 0;           /* ne se compresse pas */
}

/* ─── Bottom-sheet handle ─── */
.cec-handle {
  width: 40px; height: 4px;
  background: #E5E7EB;
  border-radius: 2px;
  margin: 10px auto 0;
}

/* ─── Carte client en haut du bottom-sheet ─── */
.cec-client-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.cec-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #E5E7EB;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #6B7280;
  flex-shrink: 0;
}
.cec-client-info { flex: 1; min-width: 0; }
.cec-client-name {
  font-size: 17px; font-weight: 800; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cec-call-btn {
  width: 44px; height: 44px;
  background: #DCFCE7;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; flex-shrink: 0;
  transition: background 0.15s;
}
.cec-call-btn:hover { background: #BBF7D0; }

/* ─── Badges (Aller simple / Immédiate) ─── */
.cec-badges {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 0 18px 14px;
}
.cec-badge {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 700;
  background: #F0FDF4; color: #166534;
  border: 1.5px solid #BBF7D0;
}

/* ─── Séparateur ─── */
.cec-divider {
  height: 1px;
  background: #F3F4F6;
  margin: 0 18px;
}

/* ─── Adresses ─── */
.cec-addresses {
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 0;
}
.cec-addr-row {
  display: flex; align-items: flex-start; gap: 12px;
}
.cec-addr-icon-col {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 2px; width: 20px; flex-shrink: 0;
}
.cec-dot-pickup {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #00A86B;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #00A86B;
  flex-shrink: 0;
}
.cec-dot-dropoff {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #111827;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #111827;
  flex-shrink: 0;
}
.cec-connector {
  width: 2px; flex: 1; min-height: 24px;
  background: repeating-linear-gradient(
    to bottom,
    #D1D5DB 0px, #D1D5DB 4px,
    transparent 4px, transparent 8px
  );
  margin: 4px 0;
}
.cec-addr-text { flex: 1; min-width: 0; padding-bottom: 2px; }
.cec-addr-street {
  font-size: 15px; font-weight: 700; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cec-addr-city {
  font-size: 13px; color: #6B7280; margin-top: 1px;
}
.cec-nav-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%;
  background: #F0FDF4;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: 8px;
  transition: background 0.15s;
  align-self: center;
}
.cec-nav-btn:hover { background: #DCFCE7; }

/* ─── Séparateur adresses → stepper ─── */
.cec-addr-spacer { height: 4px; }

/* ─── Stepper 3 étapes ─── */
.cec-stepper {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px 18px 10px;
  gap: 0;
  position: relative;
}
.cec-step-item {
  display: flex; flex-direction: column; align-items: center;
  flex: 1;
  position: relative;
}
.cec-step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  border: 2px solid #E5E7EB;
  background: #fff;
  color: #9CA3AF;
  z-index: 1;
  position: relative;
}
.cec-step-circle.done {
  background: #00A86B; color: #fff; border-color: #00A86B;
}
.cec-step-circle.active {
  background: #00A86B; color: #fff; border-color: #00A86B;
  box-shadow: 0 0 0 5px #DCFCE7;
}
.cec-step-label {
  font-size: 11px; text-align: center; margin-top: 6px;
  line-height: 1.3; color: #9CA3AF; font-weight: 600;
  max-width: 60px;
}
.cec-step-label.active { color: #00A86B; font-weight: 700; }
.cec-step-label.done   { color: #00A86B; }
.cec-step-line {
  position: absolute;
  top: 15px; left: calc(50% + 16px); right: calc(-50% + 16px);
  height: 2px; background: #E5E7EB; z-index: 0;
}
.cec-step-line.done { background: #00A86B; }

/* ─── Info texte sous le stepper ─── */
.cec-info-text {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 4px 18px 14px;
  background: #F9FAFB;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px; color: #6B7280; line-height: 1.5;
}

/* ─── Détails dispatcheur (vue après acceptation) ─── */
.cec-details-card {
  margin: 0 18px 14px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.cec-details-title {
  font-size: 13px; font-weight: 700; color: #111827;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #F3F4F6;
}
.cec-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: 13px;
  gap: 12px;
}
.cec-detail-row + .cec-detail-row {
  border-top: 1px solid #F9FAFB;
}
.cec-detail-label {
  color: #6B7280;
  font-weight: 500;
  flex-shrink: 0;
}
.cec-detail-value {
  color: #111827;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}
.cec-detail-strong {
  color: #00A86B;
  font-size: 14px;
  font-weight: 700;
}
.cec-detail-link {
  color: #00A86B !important;
  text-decoration: none;
}
.cec-detail-medical {
  color: #DC2626;
}
.cec-info-icon { flex-shrink: 0; margin-top: 1px; color: #9CA3AF; }

/* ─── Lien messages (en bas du sheet) ─── */
.cec-msg-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 18px 18px;
  padding: 13px;
  border-radius: 12px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-size: 14px; font-weight: 600; color: #374151;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.cec-msg-btn:hover { border-color: #00A86B; color: #00A86B; }

/* ─── Bouton CTA — flex item en bas (PAS absolu) ─── */
.cd-sticky-cta {
  /* position: static (flex child, pas absolu) */
  padding: 12px 18px max(20px, env(safe-area-inset-bottom, 20px));
  background: #fff;
  border-top: 1px solid #F3F4F6;
  z-index: 10;
  flex-direction: column;
  gap: 0;
}
.cd-cta-btn {
  width: 100%; height: 56px;
  border-radius: 16px;
  background: #00A86B;
  color: #fff;
  font-size: 17px; font-weight: 800;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(0,168,107,0.35);
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
}
.cd-cta-btn:hover  { background: #007A4D; }
.cd-cta-btn:active { transform: scale(0.98); }
.cd-cta-btn.onboard { background: #2563EB; box-shadow: 0 4px 16px rgba(37,99,235,0.30); }
.cd-cta-btn.onboard:hover { background: #1D4ED8; }
.cd-cta-btn.complete { background: #059669; box-shadow: 0 4px 16px rgba(5,150,105,0.30); }
.cd-cta-btn.complete:hover { background: #047857; }

/* ── Parcours 4 étapes : couleurs des boutons (CTA sticky + barre d'action) ──
   En approche = bleu · Sur place = orange · Client à bord = vert · Terminer = noir */
.cd-cta-approach { background: #2563EB !important; color: #fff !important; box-shadow: 0 4px 16px rgba(37,99,235,.30); }
.cd-cta-arrived  { background: #F97316 !important; color: #fff !important; box-shadow: 0 4px 16px rgba(249,115,22,.30); }
.cd-cta-onboard  { background: #00A86B !important; color: #fff !important; box-shadow: 0 4px 16px rgba(0,168,107,.30); }
.cd-cta-complete { background: #1F2937 !important; color: #fff !important; box-shadow: 0 4px 16px rgba(31,41,55,.30); }
.cd-cta-approach:hover { background: #1D4ED8 !important; }
.cd-cta-arrived:hover  { background: #EA580C !important; }
.cd-cta-onboard:hover  { background: #007A4D !important; }
.cd-cta-complete:hover { background: #111827 !important; }

/* Cancel (lien discret) */
.cec-cancel-link {
  display: block; text-align: center;
  font-size: 13px; color: #EF4444; font-weight: 600;
  cursor: pointer; margin: -4px 18px 16px;
  padding: 8px;
  background: none; border: none; font-family: inherit;
  text-decoration: underline;
}
.cec-cancel-link:hover { color: #DC2626; }

.cec-abandon-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: calc(100% - 36px); margin: -4px 18px 16px;
  padding: 10px; border-radius: 10px;
  background: #FEF2F2; border: 1.5px solid #FECACA;
  color: #EF4444; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.cec-abandon-btn:active { background: #FEE2E2; }


/* =========================================================
   PROPOSITION DE COURSE — Overlay plein ecran
   Style Uber Driver / Bolt v1
   ========================================================= */

/* ── ancien overlay cpo-* définitivement désactivé ── */
#cpo, .cpo-overlay { display: none !important; }

/* conservé pour éviter les erreurs si du CSS vieux est encore référencé */
.cpo-overlay-legacy {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  flex-direction: column;
  background: #1a1a1a;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cpo-overlay-legacy.cpo-in { opacity: 1; }

.cpo-map-zone {
  position: relative;
  flex: 0 0 40vh;
  min-height: 180px;
  background: #E8F0E8;
}
.cpo-map { position: absolute; inset: 0; z-index: 0; }

.cpo-header {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  left: 12px; right: 12px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 10px 14px;
  z-index: 10;
}
.cpo-title-block { flex: 1; min-width: 0; }
.cpo-main-title { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.2; }
.cpo-sub-title  { font-size: 12px; font-weight: 500; color: #00A86B; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cpo-icon-btn {
  width: 36px; height: 36px; border: none;
  background: #F3F4F6; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.cpo-icon-btn:hover { background: #E5E7EB; }
.cpo-icon-btn.cpo-muted { background: #FEE2E2; }

.cpo-timer-wrap { position: relative; width: 54px; height: 54px; flex-shrink: 0; }
.cpo-timer-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #00A86B;
  transition: color 0.5s; font-variant-numeric: tabular-nums;
}

.cpo-sheet {
  flex: 1; min-height: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  margin-top: -22px;
  position: relative; z-index: 5;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  padding: 0 18px;
}

.cpo-handle {
  width: 36px; height: 4px;
  background: #E5E7EB; border-radius: 2px;
  margin: 10px auto 12px; flex-shrink: 0;
}

.cpo-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-shrink: 0;
}
.cpo-sheet-title { font-size: 17px; font-weight: 800; color: #111827; }
.cpo-badge-imm {
  display: flex; align-items: center; gap: 4px;
  background: #FEF3C7; color: #D97706;
  font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 20px; letter-spacing: 0.3px;
}

.cpo-trip-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-shrink: 0;
}
.cpo-trip-label { font-size: 10px; font-weight: 600; color: #9CA3AF; letter-spacing: 0.5px; text-transform: uppercase; }
.cpo-trip-val   { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: #374151; }

.cpo-cities {
  display: flex; align-items: center; gap: 6px;
  background: #F9FAFB; border-radius: 16px;
  padding: 12px 14px; margin-bottom: 12px; flex-shrink: 0;
}
.cpo-city-col { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.cpo-city-col-right { justify-content: flex-end; flex-direction: row-reverse; text-align: right; }
.cpo-city-col-right .cpo-city-info { text-align: right; }

.cpo-marker {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.cpo-marker-a { background: #00A86B; }
.cpo-marker-b { background: #111827; }

.cpo-city-name {
  font-size: 19px; font-weight: 800; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.1;
}
.cpo-city-sub { font-size: 10px; font-weight: 500; color: #9CA3AF; margin-top: 2px; }

.cpo-city-arrow {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; flex-shrink: 0; color: #D1D5DB;
}
.cpo-city-dots { width: 1px; height: 8px; background: #D1D5DB; }

.cpo-infos {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px; flex-shrink: 0;
}
.cpo-info-item {
  display: flex; align-items: flex-start; gap: 7px;
  background: #F9FAFB; border-radius: 10px; padding: 9px 10px;
}
.cpo-info-ico { flex-shrink: 0; margin-top: 1px; }
.cpo-info-lbl { font-size: 9px; font-weight: 600; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.4px; line-height: 1; }
.cpo-info-val { font-size: 13px; font-weight: 700; color: #111827; margin-top: 3px; line-height: 1; }

.cpo-actions {
  display: flex; gap: 10px;
  padding: 4px 0 max(14px, env(safe-area-inset-bottom, 14px));
  flex-shrink: 0; margin-top: auto;
}
.cpo-btn-refuse {
  flex: 1; height: 54px;
  background: #fff; border: 2px solid #E5E7EB; border-radius: 16px;
  color: #374151; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; transition: border-color 0.15s, color 0.15s; font-family: inherit;
}
.cpo-btn-refuse:hover { border-color: #EF4444; color: #EF4444; }

.cpo-btn-accept {
  flex: 2; height: 54px;
  background: #00A86B; border: none; border-radius: 16px;
  color: #fff; font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,168,107,0.40);
  transition: background 0.15s, transform 0.1s; font-family: inherit;
}
.cpo-btn-accept:hover  { background: #007A4D; }
.cpo-btn-accept:active { transform: scale(0.97); }

.cpo-eta-wrap { width: 100%; padding: 8px 0 max(12px, env(safe-area-inset-bottom, 12px)); }
.cpo-eta-title { font-size: 14px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 12px; }
.cpo-eta-chips { display: flex; gap: 8px; justify-content: center; }
.cpo-eta-chip {
  flex: 1; max-width: 64px; height: 64px;
  background: #F0FDF4; border: 2px solid #00A86B; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, transform 0.1s; font-family: inherit;
}
.cpo-eta-chip:hover  { background: #DCFCE7; }
.cpo-eta-chip:active { transform: scale(0.95); }
.cpo-eta-num  { font-size: 20px; font-weight: 800; color: #00A86B; line-height: 1; }
.cpo-eta-unit { font-size: 11px; font-weight: 600; color: #6B7280; margin-top: 2px; }

/* .cpo-footer supprimé — bouton son dans le header suffit */

/* ============================================================
   CREATION COURSE v2 - Design premium mobile-first
   ============================================================ */
/* Flexbox column — s'adapte automatiquement aux ouvertures/fermetures du clavier mobile */
.cr2-screen {
  background: #F0FDF4;
  /* display géré par .screen / .screen.active — ne pas écraser ici */
  flex-direction: column;
}
/* Actif → écran VERROUILLÉ au viewport (position:fixed + inset:0). Le header reste
   en haut, le formulaire scrolle dans .cr2-body. Évite la fuite du fond vert du body
   au retour du clavier iOS (plus de hauteur 100dvh figée qui décale la page). */
.cr2-screen.active {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
}

/* Header */
.cr2-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 16px 0; min-height: calc(56px + env(safe-area-inset-top, 0px));
  background: #00A86B;
  border-bottom: none;
  flex-shrink: 0;        /* ne se compresse jamais */
  z-index: 10;
}
.cr2-header-title { flex: 1; text-align: center; font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
/* Icônes formulaire header → blanches */
.cr2-header .icon-btn svg path,
.cr2-header .icon-btn svg rect { stroke: rgba(255,255,255,0.92) !important; }

/* Body — flex:1 remplace le height calculé : zéro bande blanche au retour clavier */
.cr2-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #F0FDF4;  /* même teinte que cr2-screen → pas de bande blanche au scroll */
}
.cr2-form { padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 12px; }

/* ── Section « Options » repliable (Paiement & Détails masqués par défaut) ── */
.cr2-options-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 52px; padding: 0 16px;
  background: #fff; border: 1.5px solid #E5E7EB; border-radius: 14px;
  font-family: inherit; font-size: 14px; font-weight: 600; color: #374151;
  cursor: pointer; transition: border-color .18s, background .18s;
}
.cr2-options-toggle:active { background: #F9FAFB; }
.cr2-options-toggle-txt { display: flex; align-items: center; gap: 8px; }
.cr2-options-toggle-txt > svg { color: #00A86B; flex-shrink: 0; }
.cr2-options-sub { color: #9CA3AF; font-weight: 500; font-size: 12.5px; }
.cr2-options-chevron { color: #9CA3AF; flex-shrink: 0; transition: transform .22s ease; }
.cr2-options-toggle[aria-expanded="true"] { border-color: #00A86B; }
.cr2-options-toggle[aria-expanded="true"] .cr2-options-chevron { transform: rotate(180deg); }
.cr2-options-wrap { display: none; flex-direction: column; gap: 12px; }
.cr2-options-wrap.open { display: flex; }

/* ── Estimation toujours visible (hors section Options) ── */
.cr2-estimate-always {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 50px; padding: 10px 16px;
  background: #ECFDF3; border: 1.5px solid #A7F3D0; border-radius: 14px;
}
.cr2-est-lbl { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #047857; }
.cr2-est-lbl svg { color: #10B981; flex-shrink: 0; }
.cr2-est-val { font-size: 18px; font-weight: 800; color: #065F46; letter-spacing: -.3px; }
.cr2-est-val.is-cpam { font-size: 12.5px; font-weight: 600; color: #6B7280; }

/* ── Bannière client sélectionné ── */
.cr2-client-banner {
  background: linear-gradient(90deg, #F0FDF4 0%, #DCFCE7 100%);
  border-bottom: 1px solid #BBF7D0;
  padding: 0 16px;
  height: 44px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.cr2-client-banner[hidden] { display: none !important; }
.cr2-banner-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #00A86B; color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: 0.5px;
}
.cr2-banner-name {
  flex: 1; font-size: 13px; font-weight: 700; color: #007A4D;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cr2-banner-tag {
  font-size: 10px; font-weight: 500; color: #00A86B;
  background: #DCFCE7; border-radius: 6px; padding: 2px 7px;
  flex-shrink: 0;
}
.cr2-banner-clear {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.06); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #6B7280; flex-shrink: 0;
}

/* ── Option "Créer client" dans dropdown ── */
.client-suggest-create {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid #F0FDF4;
  color: #00A86B; font-weight: 600; font-size: 13px;
  cursor: pointer;
}
.client-suggest-create:active { background: #F0FDF4; }

/* Cards */
.cr2-card { background: #fff; border-radius: 16px; padding: 18px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04); }
.cr2-card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: #374151;
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: 14px;
}

/* Visually hidden (keep in DOM for JS) */
.cr2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Segmented ALLER / RETOUR / A/R Attente */
.cr2-seg-group {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: #F3F4F6; border-radius: 10px; padding: 4px;
}
.cr2-seg-btn {
  flex: 1; min-height: 44px; padding: 4px; border-radius: 7px; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #6B7280; background: transparent;
  border: none; cursor: pointer; transition: all .18s;
  white-space: nowrap; line-height: 1.2;
}
.cr2-seg-btn.active {
  background: #fff; color: #00A86B;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
/* Couleur spéciale pour le bouton A/R Attente actif */
.cr2-seg-btn[data-seg-val="AR_ATTENTE"].active {
  color: #6366F1;
}

/* ── Bloc A/R avec attente ── */
.cr2-ar-block-inner { margin-top: 12px; }

.cr2-ar-sep {
  display: flex; align-items: center; gap: 8px;
  margin: 14px 0 10px;
}
.cr2-ar-sep-line {
  flex: 1; height: 1px; background: #E5E7EB;
}
.cr2-ar-sep-label {
  font-size: 11px; font-weight: 600; color: #6366F1;
  white-space: nowrap; display: flex; align-items: center;
}

/* Chips temps d'attente */
.cr2-wait-section { margin-top: 14px; }
.cr2-wait-chips-group {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.cr2-wait-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 15px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer;
  border: 1.5px solid #E5E7EB;
  background: #fff; color: #6B7280;
  transition: all .15s;
}
.cr2-wait-chip.active {
  background: #EEF2FF; color: #6366F1;
  border-color: #6366F1;
}
.cr2-wait-chip:hover:not(.active) {
  border-color: #C7D2FE; color: #6366F1;
}

/* Route block */
.cr2-route-block { display: flex; gap: 10px; align-items: stretch; }
.cr2-route-icons { display: flex; flex-direction: column; align-items: center; padding-top: 13px; }
.cr2-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.cr2-dot-green { background: #00A86B; }
.cr2-dot-black { background: #111827; }
.cr2-route-line { width: 2px; flex: 1; background: #E5E7EB; margin: 5px 0; min-height: 24px; }
.cr2-route-inputs { flex: 1; display: flex; flex-direction: column; gap: 8px; }

/* Swap button */
.cr2-swap-btn {
  align-self: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid #E5E7EB; background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #9CA3AF;
  transition: border-color .18s, color .18s, transform .25s;
}
.cr2-swap-btn:hover { border-color: #00A86B; color: #00A86B; transform: rotate(180deg); }

/* Inputs */
.cr2-input {
  width: 100%; height: 48px; border: 1.5px solid #E5E7EB; border-radius: 12px;
  padding: 0 14px; font-size: 16px; color: #111827; background: #fff;
  outline: none; box-sizing: border-box;
  transition: border-color .18s, box-shadow .18s; -webkit-appearance: none; appearance: none;
}
.cr2-input:focus { border-color: #00A86B; box-shadow: 0 0 0 3px rgba(0,168,107,.12); }
.cr2-input::placeholder { color: #9CA3AF; }

/* Input with icon */
.cr2-input-icon-wrap { position: relative; display: flex; align-items: center; }
.cr2-input-icon { position: absolute; left: 14px; pointer-events: none; }
.cr2-input-pl { padding-left: 42px; }

/* Timing toggle */
.cr2-timing-toggle { display: flex; gap: 8px; margin-bottom: 16px; }
.cr2-timing-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 12px 8px; border-radius: 12px; border: 1.5px solid #E5E7EB;
  background: #F9FAFB; font-size: 13px; font-weight: 600; color: #6B7280;
  cursor: pointer; transition: all .18s;
}
.cr2-timing-btn.cr2-timing-active { border-color: #00A86B; background: #DCFCE7; color: #007A4D; }

/* Date/time grid */
.cr2-datetime-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Field label */
.cr2-field { display: flex; flex-direction: column; gap: 5px; }
.cr2-field-label { font-size: 13px; font-weight: 600; color: #6B7280; }

/* Privacy badge */
.cr2-private-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
  background: #FEF9C3; color: #92400E; font-size: 10px; font-weight: 600;
  padding: 2px 7px 2px 5px; border-radius: 20px; letter-spacing: .2px;
}

/* Sublabel */
.cr2-sublabel { font-size: 11px; font-weight: 700; color: #9CA3AF;
  letter-spacing: .5px; text-transform: uppercase; display: block; margin-bottom: 8px; }

/* Chips group */
.cr2-chips-group { display: flex; flex-wrap: wrap; gap: 8px; }
.cr2-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 44px; padding: 0 18px; border-radius: 24px; border: 1.5px solid #E5E7EB;
  background: #F9FAFB; font-size: 13px; font-weight: 600; color: #6B7280;
  cursor: pointer; transition: all .18s;
}
.cr2-chip.active { border-color: #00A86B; background: #DCFCE7; color: #007A4D; }
.cr2-chip-cpam.active { border-color: #0369A1; background: #E0F2FE; color: #0369A1; }
.cr2-chip-medical.active { border-color: #DC2626; background: #FEE2E2; color: #DC2626; }

/* Grid 2 col */
.cr2-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Estimation de prix ──────────────────────────────────── */
#cr-price-estimate {
  margin-top: 14px;
  border-radius: 12px;
  border: 1.5px solid #BBF7D0;
  background: #F0FDF4;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Ligne principale : horloge + libellé + prix */
.cr-estimate-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #15803D;
}

/* Prix total en gros à droite */
.cr-estimate-price {
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  color: #15803D;
  letter-spacing: -0.3px;
}

/* Lignes de détail (tarif, attente) */
.cr-estimate-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cr-estimate-detail span {
  font-size: 11.5px;
  color: #166534;
  opacity: 0.85;
}

/* Mode conventionné CPAM */
.cr-estimate-cpam {
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  text-align: center;
  padding: 4px 0;
  letter-spacing: 0.1px;
}

/* Stepper */
.cr2-stepper-wrap { display: flex; flex-direction: column; gap: 8px; }
.cr2-stepper-label { font-size: 12px; font-weight: 600; color: #6B7280; }
.cr2-stepper {
  display: flex; align-items: center; border: 1.5px solid #E5E7EB;
  border-radius: 12px; overflow: hidden; background: #fff; height: 48px;
}
.cr2-step-btn {
  width: 48px; height: 100%; font-size: 22px; font-weight: 300; color: #374151;
  background: #F9FAFB; border: none; cursor: pointer; flex-shrink: 0;
  transition: background .15s; display: flex; align-items: center; justify-content: center;
}
.cr2-step-btn:active { background: #E5E7EB; }
.cr2-stepper-val {
  flex: 1; text-align: center; font-size: 17px; font-weight: 700; color: #111827;
  border: none; outline: none; background: transparent;
  -moz-appearance: textfield; pointer-events: none;
}
.cr2-stepper-val::-webkit-inner-spin-button,
.cr2-stepper-val::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Submit area */
.cr2-submit-area { margin-top: 4px; }
.cr2-submit-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 56px; border-radius: 16px; background: #00A86B; color: #fff;
  font-size: 16px; font-weight: 700; border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,168,107,.35);
  transition: background .18s, transform .1s, box-shadow .18s; letter-spacing: -.2px;
}
.cr2-submit-btn:active { background: #007A4D; transform: scale(.98); box-shadow: 0 2px 8px rgba(0,168,107,.25); }
.cr2-submit-btn:disabled { background: #9CA3AF; box-shadow: none; cursor: not-allowed; }
.cr2-submit-btn.cr2-loading { opacity: .75; cursor: wait; }
/* Deux boutons côte à côte, MÊME gabarit (box-sizing → bordures incluses) */
.cr2-btn-row { display: flex; gap: 10px; align-items: stretch; }
.cr2-btn-row .cr2-submit-btn {
  flex: 1 1 0; width: auto;
  box-sizing: border-box;       /* tailles identiques même avec bordure */
  height: 48px; min-height: 48px;  /* touch target ≥44px */
  margin: 0;                    /* annule l'espacement vertical hérité */
  font-size: 14px; gap: 7px;
  border: none;                 /* aucun contour → pas de décalage de hauteur */
  border-radius: 13px;
}
.cr2-btn-row .cr2-submit-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
/* Dispatcher = rouge */
.cr2-btn-dispatch {
  background: #DC2626; color: #fff;
  box-shadow: 0 3px 10px rgba(220,38,38,.28);
}
.cr2-btn-dispatch:active { background: #B91C1C; transform: scale(.98); box-shadow: 0 2px 6px rgba(220,38,38,.22); }
/* Créer = vert */
.cr2-btn-create {
  background: #00A86B; color: #fff;
  box-shadow: 0 3px 10px rgba(0,168,107,.28);
}
.cr2-btn-create:active { background: #007A4D; transform: scale(.98); box-shadow: 0 2px 6px rgba(0,168,107,.22); }
/* L'ancien style ID #cr-submit-btn (height 54px + margin-top 20px) cassait l'alignement
   dans la rangée à 2 boutons. Sélecteur plus spécifique → on rétablit la parité. */
.cr2-btn-row #cr-submit-btn {
  height: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  border-radius: 13px !important;
  font-size: 14px !important;
  box-shadow: 0 3px 10px rgba(0,168,107,.28) !important;
}
.cr2-hint { text-align: center; font-size: 12px; color: #9CA3AF; margin-top: 10px; }

/* Back button (header) */
.cr2-back-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer; color: #fff;
  border-radius: 12px; transition: background .15s;
}
.cr2-back-btn:hover { background: #F3F4F6; }

/* Address field wrap (input + autocomplete dropdown) */
.cr2-addr-field-wrap { position: relative; flex: 1; }
/* Ligne ville détectée (sous l'adresse) */
.cr2-city-row {
  display: flex; align-items: flex-start; gap: 5px;
  margin-top: 4px; padding: 0 4px;
}
.cr2-city-input {
  flex: 1; border: none; border-bottom: 1px dashed #D1FAE5;
  background: transparent; font-size: 16px; font-family: inherit;
  color: #16A34A; font-weight: 600; outline: none;
  padding: 1px 0;
}
.cr2-city-input::placeholder { color: #9CA3AF; font-weight: 400; }

/* ════════════════════════════════════════════════════════════════════
   NOTIFICATION COURSE IMMÉDIATE (v2) — full screen + bottom sheet
   Inspiré Uber Driver / Bolt, couleurs WatiTaxi
   ════════════════════════════════════════════════════════════════════ */
.imm2-overlay {
  position: fixed; inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.imm2-overlay.imm2-overlay-in {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Carte Leaflet en haut ─── */
.imm2-map {
  flex: 0 0 38vh;
  min-height: 200px;
  background: #E5E7EB;
  position: relative;
}
.imm2-map .leaflet-container { width: 100%; height: 100%; }

/* Fond sombre sur toutes les cartes Leaflet (tuiles CartoDB dark) —
   évite le flash blanc au pan/zoom pendant le chargement des tuiles */
.leaflet-container {
  background: #1c2331 !important;
}

/* Pastille flottante km • min (style Uber/Bolt) */
.imm2-map-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  letter-spacing: 0.2px;
  pointer-events: none;
}

/* Message discret si la destination n'est pas encore connue */
.imm2-map-awaiting {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 12px;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── Bottom sheet ─── */
.imm2-sheet {
  flex: 1 1 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  margin-top: -16px;
  padding: 8px 20px calc(env(safe-area-inset-bottom, 0px) + 18px);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.10);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.imm2-sheet-handle {
  width: 40px; height: 4px;
  background: #D1D5DB;
  border-radius: 99px;
  margin: 6px auto 4px;
}

/* ─── Header : titre + badge immédiate ─── */
.imm2-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -4px;
}
.imm2-sheet-title {
  font-size: 22px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
  letter-spacing: -0.3px;
}
.imm2-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FFEDD5;
  color: #C2410C;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 99px;
}
.imm2-badge svg { color: #F97316; }

/* ─── Compte à rebours horizontal ─── */
.imm2-countdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.imm2-countdown-label {
  font-size: 15px;
  color: #475569;
  font-weight: 500;
}
.imm2-countdown-secs {
  font-size: 22px;
  font-weight: 900;
  color: #F97316;
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
  margin-left: 2px;
}
.imm2-overlay.imm2-critical .imm2-countdown-secs {
  color: #DC2626;
}
.imm2-countdown-track {
  width: 100%;
  height: 6px;
  background: #F3F4F6;
  border-radius: 99px;
  overflow: hidden;
}
.imm2-countdown-fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #FB923C 0%, #F97316 60%, #EA580C 100%);
  transition: width 1s linear, background 0.4s ease;
}
.imm2-overlay.imm2-critical .imm2-countdown-fill {
  background: linear-gradient(90deg, #F87171 0%, #EF4444 50%, #B91C1C 100%);
  animation: imm2-pulse-red 0.9s ease-in-out infinite;
}
@keyframes imm2-pulse-red {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

/* ─── Route ville → ville (vertical, style Uber) ─── */
.imm2-route {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Chaque ligne stop = dot + nom ville */
.imm2-route-stop {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Ligne verticale entre les deux dots */
.imm2-route-vline {
  width: 2px;
  height: 14px;
  background: #D1D5DB;
  margin-left: 12px;   /* centre sous le dot (26px/2 - 2px/2 = 12px) */
  flex-shrink: 0;
}
.imm2-route-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.imm2-route-dot-a { background: #16A34A; }
.imm2-route-dot-b { background: #0F172A; }
/* Nom de ville : toute la largeur restante, tronqué proprement */
.imm2-route-city {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

/* ─── Type de trajet (chip compact dans la carte route) ─── */
.imm2-trip-chip {
  margin-top: 8px;
  width: fit-content;       /* ne pas étirer sur toute la largeur */
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  color: #16A34A;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ─── Grille 2x2 d'infos ─── */
.imm2-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.imm2-info-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 12px;
}
.imm2-info-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.imm2-info-body { min-width: 0; flex: 1; }
.imm2-info-label {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.imm2-info-value {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Boutons d'action — sticky en bas pour rester toujours visibles ─── */
.imm2-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;        /* pousse les boutons tout en bas */
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 4px);
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  box-shadow: 0 -8px 16px rgba(255,255,255,0.95);
  z-index: 2;
}
.imm2-btn-refuse {
  flex: 0 0 auto;
  min-width: 110px;
  padding: 16px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  color: #475569;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
}
.imm2-btn-refuse:hover, .imm2-btn-refuse:active { background: #F8FAFC; border-color: #CBD5E1; }

.imm2-btn-accept {
  flex: 1;
  padding: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #16A34A;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(22, 163, 74, 0.35);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, transform .15s;
}
.imm2-btn-accept:hover { background: #15803D; }
.imm2-btn-accept:active { transform: scale(0.97); }

/* ─── Mode "choix du délai" ─── */
.imm2-actions.imm2-delay-mode {
  flex-direction: column;
  gap: 10px;
}
.imm2-delay-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  padding-top: 4px;
}
.imm2-delay-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.imm2-delay-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 4px;
  background: #fff;
  border: 2px solid #16A34A;
  border-radius: 12px;
  color: #16A34A;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, color .12s;
}
.imm2-delay-chip:hover, .imm2-delay-chip:active {
  background: #16A34A;
  color: #fff;
}
.imm2-delay-num {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}
.imm2-delay-unit {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
  opacity: 0.85;
}
.imm2-btn-back {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Badge urgent (dernière chance) ─── */
.imm2-badge.imm2-badge-urgent {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FCA5A5;
}
.imm2-badge.imm2-badge-urgent svg { color: #DC2626; }

/* ─── Badge dispatch direct (bleu indigo) ─── */
.imm2-badge.imm2-badge-direct {
  background: #EEF2FF;
  color: #4338CA;
  border-color: #A5B4FC;
}
.imm2-badge.imm2-badge-direct svg { color: #4338CA; }

/* ─── Bandeau "vous avez été choisi directement" ─── */
.imm2-dd-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  border: 1px solid #C7D2FE;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: #3730A3;
  margin-bottom: 2px;
}
.imm2-dd-banner svg { flex-shrink: 0; color: #4338CA; }
.imm2-dd-banner strong { color: #1E1B4B; font-weight: 700; }

/* ─── Meta dispatch direct (expéditeur + date) ─── */
.imm2-dd-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 2px;
  font-size: 13px;
  color: #475569;
}
.imm2-dd-from strong { color: #0F172A; font-weight: 700; }
.imm2-dd-date {
  font-size: 12px;
  font-weight: 600;
  color: #16A34A;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  padding: 2px 9px;
}

/* ─── Timer critique (50 % du temps écoulé) ─── */
.imm2-countdown-fill.imm2-countdown-fill-critical {
  background: linear-gradient(90deg, #F87171 0%, #EF4444 50%, #B91C1C 100%);
}
.imm2-countdown-secs.imm2-countdown-secs-critical { color: #DC2626; }

/* ─── Delay picker (alias pour compatibilité DD alert) ─── */
.imm2-delay-subtitle {
  text-align: center;
  font-size: 12px;
  color: #64748B;
  margin-top: -4px;
}
.imm2-eta-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.imm2-eta-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 4px;
  background: #fff;
  border: 2px solid #16A34A;
  border-radius: 12px;
  color: #16A34A;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, color .12s;
}
.imm2-eta-chip small {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
  opacity: 0.85;
}
.imm2-eta-chip:hover, .imm2-eta-chip:active {
  background: #16A34A;
  color: #fff;
}
.imm2-btn-retour {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Très petits écrans : compacter ─── */
@media (max-height: 700px) {
  .imm2-map { flex: 0 0 28vh; min-height: 150px; }
  .imm2-sheet { gap: 10px; }
  .imm2-sheet-title { font-size: 20px; }
  .imm2-route-city { font-size: 14px; }
  .imm2-info-card { padding: 8px 10px; }
  .imm2-dd-banner { padding: 7px 10px; font-size: 12px; }
}

/* ═══════════════════════════════════════════════════════
   TOPBAR HOME — hors ligne : même apparence qu'en ligne
   (l'indicateur offline est visible via le badge texte)
   ═══════════════════════════════════════════════════════ */
/* .topbar-home.topbar-home-offline — aucun style spécifique */

/* Carte hors-ligne active : topbar caché (l'overlay le recouvre mais backdrop-filter
   crée un stacking context qui peut passer au-dessus → on cache directement) */
#screen-home.ofl-active .topbar-home {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Bouton carte thermique désactivé en mode hors ligne */
.topbar-home-offline #btn-heatmap {
  opacity: 0.38;
  pointer-events: none;
}

/* ── Bottom-sheets statut (confirmation hors ligne + menu « Mon statut ») ── */
#dsb-confirm-sheet, #dsb-status-sheet {
  position: fixed; inset: 0;
  z-index: 9000;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  pointer-events: all;
}
.dsb-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.25s;
}
#dsb-confirm-sheet.dsb-sheet-visible .dsb-sheet-backdrop,
#dsb-status-sheet.dsb-sheet-visible .dsb-sheet-backdrop { opacity: 1; }
.dsb-sheet-card {
  position: relative; z-index: 1;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 28px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
#dsb-confirm-sheet.dsb-sheet-visible .dsb-sheet-card,
#dsb-status-sheet.dsb-sheet-visible .dsb-sheet-card { transform: translateY(0); }
.dsb-sheet-handle {
  width: 36px; height: 4px;
  background: #E5E7EB; border-radius: 2px;
  margin: 0 auto 20px;
}
.dsb-sheet-icon { display:flex; justify-content:center; margin-bottom: 16px; }
.dsb-sheet-title {
  font-size: 17px; font-weight: 700;
  color: #111827; margin: 0 0 8px;
}
.dsb-sheet-desc {
  font-size: 14px; color: #6B7280;
  margin: 0 0 24px; line-height: 1.55;
}
.dsb-sheet-actions { display: flex; gap: 10px; }
.dsb-sheet-cancel {
  flex: 1; padding: 14px;
  border-radius: 12px;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-size: 15px; font-weight: 600; color: #374151;
  cursor: pointer; font-family: inherit;
}
.dsb-sheet-confirm {
  flex: 1; padding: 14px;
  border-radius: 12px; border: none;
  background: #EF4444;
  font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer; font-family: inherit;
}
.dsb-sheet-cancel:active  { background: #F9FAFB; }
.dsb-sheet-confirm:active { background: #DC2626; }

/* ═══════════════════════════════════════════════════════
   OFL — Carte GPS hors ligne (remplace radar)
   ═══════════════════════════════════════════════════════ */

.ofl-wrap {
  padding: 16px 12px;
}

.ofl-card {
  background: #111827;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
  animation: oflIn .32s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes oflIn {
  from { opacity:0; transform:translateY(12px) scale(.98); }
  to   { opacity:1; transform:none; }
}

.ofl-map-zone {
  position: relative;
  width: 100%;
  height: 200px;
  background: #1F2937;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ofl-map-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #6B7280;
  font-size: 13px;
}

.ofl-map-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ofl-info {
  padding: 16px 18px 20px;
}

.ofl-location-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ofl-address {
  font-size: 13px;
  font-weight: 600;
  color: #F3F4F6;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ofl-desc {
  font-size: 12px;
  color: #6B7280;
  margin: 0 0 16px;
  line-height: 1.5;
}

.ofl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 50px;
  box-shadow: 0 4px 14px rgba(22,163,74,0.45);
  transition: transform .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: .1px;
}
.ofl-btn:active {
  transform: scale(.97);
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}

/* ═══════════════════════════════════════════════════════
   OFFLINE SCREEN — Design premium dark (Bolt / Uber / WhatsApp)
   ═══════════════════════════════════════════════════════ */

/* Body sombre quand la carte hors-ligne est active → status bar iOS transparente */
body:has(#screen-home.ofl-active) {
  background: #0d0d0d;
}

/* Overlay fixe — plein écran edge-to-edge (comme Google Maps / Uber) */
#ofl-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0; /* inset:0 explicite pour Safari */
  margin: 0; padding: 0;                 /* aucun espace parasite */
  z-index: 500;
  overflow: hidden;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  /* Forcer le rendu sur toute la surface, y compris derrière la status bar */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Carte MapLibre plein écran */
#ofl-map {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #141c22; /* fond sombre CARTO Dark — évite le flash blanc avant les tuiles */
}
/* Fond des tuiles pendant le chargement */
.ofl-tiles { background: #141c22; }

/* Colonne de contrôles carte (zoom + localiser) bas-droite */
.ofl2-map-controls {
  position: absolute;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 130px);
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.ofl2-map-btn {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.10);
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: transform .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.ofl2-map-btn:first-child { border-radius: 12px 12px 0 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.ofl2-map-btn:nth-child(2) { border-radius: 0 0 12px 12px; border-top: none; }
.ofl2-map-btn:active { transform: scale(.93); background: rgba(34,197,94,0.18); }
.ofl2-map-sep { height: 10px; }
.ofl2-map-btn-locate { border-radius: 50% !important; border: 1px solid rgba(255,255,255,0.12) !important; }
.ofl2-map-btn-locate:active { background: rgba(34,197,94,0.25) !important; }
.ofl2-map-btn-locate.locating { color: #4ade80; animation: ofl2-spin 1s linear infinite; }

/* ── En-tête ── */
.ofl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, calc(env(safe-area-inset-top, 18px) + 10px)) 20px 16px;
  flex-shrink: 0;
}

.ofl-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ofl-logo-w {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  color: #052e16;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.ofl-logo-name {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.ofl-status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #9CA3AF;
  white-space: nowrap;
}

.ofl-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

/* ── Corps principal — centré, sans bouton (bouton dans bottom-bar) ── */
.ofl-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px 8px;
  gap: 12px;
  text-align: center;
}

/* ── Icône lune hors-ligne ── */
.ofl-moon-wrap {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(74,222,128,0.07);
  border: 1.5px solid rgba(74,222,128,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* ── Cercles pulsants hors-ligne (conservés pour compatibilité) ── */
@keyframes ofl-ring-out {
  0%   { transform: scale(.6); opacity: .7; }
  100% { transform: scale(2.8); opacity: 0; }
}

.ofl-pulse-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.ofl-pulse {
  position: absolute;
  border-radius: 50%;
  background: rgba(239,68,68,0.25);
  border: 1.5px solid rgba(239,68,68,0.5);
  width: 80px;
  height: 80px;
  animation: ofl-ring-out 2.4s ease-out infinite;
}
.ofl-pulse-2 { animation-delay: .8s; }
.ofl-pulse-3 { animation-delay: 1.6s; }

.ofl-pulse-dot {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239,68,68,0.7);
  z-index: 1;
}

.ofl-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -0.4px;
}

.ofl-subtitle {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
  max-width: 240px;
}

/* Dernière synchronisation */
.ofl-last-sync {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #6B7280;
  margin-bottom: 6px;
}

/* ── Zone basse : stats + bouton + GPS ── */
.ofl-bottom-bar {
  flex-shrink: 0;
  width: 100%;
  padding: 10px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Bouton "Passer en ligne" — pill arrondi, logo rond collé à gauche */
.ofl2-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;      /* libellé centré sur toute la largeur */
  width: calc(100% - 32px);
  max-width: 360px;
  padding: 5px;                 /* le logo rond tient dans la courbe */
  min-height: 60px;
  background: #00A86B;
  border: none;
  border-radius: 999px;         /* pill totalement arrondi */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 22px rgba(0,168,107,0.40);
}
.ofl2-btn:active {
  filter: brightness(.94);
}

/* ── Grille statistiques (4 cartes) ── */
.ofl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 14px 0;
  width: 100%;
  box-sizing: border-box;
}

.ofl-stat {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 12px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.ofl-stat-icon {
  color: #4ade80;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.ofl-stat-value {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}

.ofl-stat-label {
  font-size: 9px;
  font-weight: 500;
  color: #4B5563;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

/* ── Ligne confidentialité ── */
.ofl-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px 6px;
  color: #F97316;   /* orange — avertissement GPS */
  font-size: 12px;
  font-weight: 500;
}

/* Badge "Hors-ligne" flottant en haut centre */
.ofl2-badge {
  position: absolute;
  top: max(16px, calc(env(safe-area-inset-top, 16px) + 8px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.08);
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 99px;
  white-space: nowrap;
  z-index: 1000 !important;
  letter-spacing: .2px;
}
.ofl2-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}
/* Barre du bas — flotte au-dessus de la bottom nav */
.ofl2-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  /* padding-bottom = bottom-nav + safe-area + marge, pour rester visible au-dessus de la nav */
  padding: 40px 20px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 20px);
  background: transparent;
  z-index: 1000 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
/* Logo rond collé à gauche, épouse l'arrondi du pill */
.ofl2-logo {
  position: absolute;           /* sorti du flux → n'influence pas le centrage */
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.ofl2-logo img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}
.ofl2-btn-label {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .3px;
  padding: 0 24px;
}
.ofl2-hint {
  font-size: 12px;
  color: rgba(209,213,219,0.95);
  margin: 0;
  text-align: center;
  line-height: 1.5;
}
.ofl2-taxi-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.ofl2-plat { display: none; }
.ofl2-glow { display: none; }
.ofl2-locate-btn { display: none; }

@keyframes ofl2-spin {
  to { transform: rotate(360deg); }
}

/* Séparateur vertical + montant CA dans la pill Hors-ligne */
.ofl2-badge-sep {
  width: 1px;
  height: 14px;
  background: rgba(0,0,0,0.18);
  border-radius: 1px;
  flex-shrink: 0;
}
.ofl2-badge-ca {
  font-size: 13px;
  font-weight: 700;
  color: #00955a;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   POPUP DÉTAIL VILLE (tap sur un label de la carte)
   ══════════════════════════════════════════════════════════ */
.ofl-city-popup {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 155px);
  background: rgba(12,12,12,0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px 16px;
  z-index: 700;
  animation: ofl-popup-in .18s ease-out;
}
@keyframes ofl-popup-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.ofl-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.ofl-popup-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.ofl-popup-split {
  font-size: 12px;
  color: rgba(209,213,219,0.70);
  margin-top: 3px;
}
.ofl-popup-total {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.80);
}
.ofl-popup-total strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.ofl-popup-close {
  background: rgba(255,255,255,0.10);
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  padding: 0;
}
.ofl-popup-close:active { background: rgba(255,255,255,0.20); }

/* ── Bouton "Passer en ligne" — pulsation pour inciter le chauffeur ──
   On combine un "battement" (scale, jamais rogné par overflow:hidden)
   et un halo dégradé vert (box-shadow). */
@keyframes ofl2-pulse {
  0% {
    transform: scale(1);
    box-shadow:
      0 6px 22px rgba(0,168,107,0.40),
      0 0 0 0  rgba(0,196,125,0.55);
  }
  55% {
    transform: scale(1.035);
    box-shadow:
      0 9px 30px rgba(0,168,107,0.60),
      0 0 0 13px rgba(0,196,125,0.08);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 6px 22px rgba(0,168,107,0.40),
      0 0 0 0  rgba(0,196,125,0);
  }
}
.ofl2-btn-pulse {
  animation: ofl2-pulse 1.5s ease-in-out infinite;
}

/* Halo dégradé vert qui respire derrière le bouton (toujours visible) */
@keyframes ofl2-glow {
  0%, 100% { opacity: .35; transform: translate(-50%, -50%) scale(1);    }
  55%      { opacity: .75; transform: translate(-50%, -50%) scale(1.06); }
}
.ofl2-btn-pulse::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #00A86B;
  filter: blur(10px);
  z-index: -1;
  animation: ofl2-glow 1.5s ease-in-out infinite;
}

/* ─────────────────────────────────────────────
   MARQUEUR CHAUFFEUR PULSANT (carte course + tracking)
   ───────────────────────────────────────────── */
.driver-dot-wrap {
  position: relative;
  width: 24px;
  height: 24px;
}
.driver-dot {
  position: absolute;
  top: 5px; left: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #00A86B;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px #00A86B;
  z-index: 2;
}
.driver-dot-pulse {
  position: absolute;
  top: 0; left: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0, 168, 107, 0.35);
  animation: driver-pulse 1.6s ease-out infinite;
  z-index: 1;
}
@keyframes driver-pulse {
  0%   { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ─────────────────────────────────────────────
   BOUTON PARTAGER LE SUIVI (vue CEC chauffeur)
   ───────────────────────────────────────────── */
.cec-share-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #15803D;
  cursor: pointer;
  text-align: left;
  margin-top: 10px;
  transition: background 0.15s;
}
.cec-share-btn:active { background: #DCFCE7; }

/* ─────────────────────────────────────────────
   ÉCRAN DE SUIVI PUBLIC — /?track={rideId}
   ───────────────────────────────────────────── */
.trk-wrap {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #F9FAFB;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

.trk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  background: #fff;
  border-bottom: 1px solid #E5E7EB;
  flex-shrink: 0;
}

.trk-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.trk-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.3px;
}

.trk-status-badge {
  font-size: 12px;
  font-weight: 600;
  color: #00A86B;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

.trk-map {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.trk-info-card {
  background: #fff;
  border-top: 1px solid #E5E7EB;
  padding: 16px 18px;
  flex-shrink: 0;
}
.trk-addr-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trk-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trk-dot-green { background: #00A86B; }
.trk-dot-black { background: #111827; }
.trk-connector {
  width: 2px; height: 14px;
  background: #E5E7EB;
  margin: 4px 0 4px 4px;
}
.trk-addr-text {
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trk-expired {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F0FDF4;
  border-top: 1px solid #BBF7D0;
  padding: 14px 18px;
  font-size: 13px;
  color: #15803D;
  font-weight: 500;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   INBOX — Messagerie (liste des conversations + swipe)
   ═══════════════════════════════════════════════════════ */
.ibx-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Conteneur swipe (position relative pour accueillir le bouton rouge) */
.ibx-swipe-wrap {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #F3F4F6;
  background: #fff;
}

/* Bouton rouge "Supprimer" caché à droite */
.ibx-delete-btn {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 88px;
  background: #EF4444;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.ibx-delete-btn:active {
  background: #DC2626;
}

/* Ligne conversation */
.ibx-row {
  display: flex;
  will-change: transform; /* optimisation GPU pour le swipe */
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
  text-decoration: none;
  position: relative;
  z-index: 1;
}
.ibx-row:active {
  background: #F9FAFB;
}

/* Avatar */
.ibx-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: #00A86B;
}
.ibx-avatar-driver {
  background: #2563EB;
}
.ibx-avatar-dispatch {
  background: #00A86B;
}

/* Corps */
.ibx-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ibx-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ibx-name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ibx-time {
  font-size: 12px;
  color: #9CA3AF;
  flex-shrink: 0;
}
.ibx-route {
  font-size: 13px;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ibx-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 1px;
}

/* Badge statut */
.ibx-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .2px;
}
.ibx-badge-wait     { background: #FEF3C7; color: #92400E; }
.ibx-badge-ok       { background: #DBEAFE; color: #1D4ED8; }
.ibx-badge-progress { background: #D1FAE5; color: #065F46; }
.ibx-badge-done     { background: #F3F4F6; color: #6B7280; }
.ibx-badge-cancel   { background: #FEE2E2; color: #B91C1C; }

.ibx-role {
  font-size: 11px;
  color: #9CA3AF;
}
.ibx-client {
  font-size: 11px;
  color: #9CA3AF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ibx-client::before { content: "· "; }

/* Chevron */
.ibx-chevron {
  flex-shrink: 0;
  opacity: .5;
}

/* Colonne droite : heure + badge non lus (comme WhatsApp) */
.ibx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
  min-width: 36px;
}

/* Badge non lus sur la conversation (vert WatiTaxi comme WhatsApp) */
.ibx-conv-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #00A86B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Nom en gras quand non lus */
.ibx-name-unread {
  font-weight: 700;
  color: #111827;
}

/* ═══════════════════════════════════════════════════════════
   FEUILLE "NOUVEAU MESSAGE" (style WhatsApp)
   ═══════════════════════════════════════════════════════════ */
.nm-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 700; /* au-dessus de la bottom-nav (z-index:600) */
  display: flex;
  align-items: flex-end;
  transition: background .28s ease;
}
.nm-sheet-overlay--open {
  background: rgba(0,0,0,.45);
}
.nm-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.25,.46,.45,.94);
  overflow: hidden;
}
.nm-sheet-overlay--open .nm-sheet {
  transform: translateY(0);
}
.nm-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #E5E7EB;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.nm-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  flex-shrink: 0;
}
.nm-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}
.nm-close-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  transition: background .15s;
}
.nm-close-btn:hover { background: #F3F4F6; }
.nm-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 16px 12px;
  background: #F3F4F6;
  border-radius: 12px;
  padding: 10px 14px;
  flex-shrink: 0;
}
.nm-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #111827;
  flex: 1;
  min-width: 0;
}
.nm-search-input::placeholder { color: #9CA3AF; }
.nm-list {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 max(16px, env(safe-area-inset-bottom, 16px));
}
.nm-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background .15s;
}
.nm-contact-row:hover,
.nm-contact-row:active { background: #F9FAFB; }
.nm-contact-body {
  flex: 1;
  min-width: 0;
}
.nm-contact-name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nm-contact-route {
  font-size: 12px;
  color: #6B7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.nm-contact-role {
  font-size: 11px;
  color: #00A86B;
  font-weight: 600;
  margin-top: 2px;
}

/* ─── Éléments supplémentaires du sheet "Nouveau message" ─── */
.nm-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 16px 4px;
}
.nm-empty {
  font-size: 13px;
  color: #9CA3AF;
  text-align: center;
  padding: 12px 16px;
  margin: 0;
  line-height: 1.5;
}
.nm-contact-tel {
  font-size: 12px;
  color: #6B7280;
  margin-top: 1px;
}
.nm-conv-tag {
  font-size: 10px;
  font-weight: 700;
  color: #00A86B;
  background: #DCFCE7;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}
.nm-no-conv-tag {
  font-size: 10px;
  font-weight: 600;
  color: #9CA3AF;
  background: #F3F4F6;
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}
.nm-phone-section {
  padding: 10px 16px 14px;
}
.nm-found-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  background: #F0FDF4;
  margin: 0 12px;
  border-radius: 14px;
  margin-bottom: 10px;
}
.nm-add-btn {
  flex: 1;
  background: #00A86B;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .15s;
}
.nm-add-btn:hover { background: #009060; }
.nm-add-btn:disabled { opacity: .6; cursor: default; }
.nm-chat-btn {
  background: #F3F4F6;
  color: #374151;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.nm-chat-btn:hover { background: #E5E7EB; }

/* ═══════════════════════════════════════════════════════════
   CHAT BANNER — Notification flottante iOS style
   ═══════════════════════════════════════════════════════════ */

/* Conteneur principal */
.cb-banner {
  position: fixed;
  /* Position : en dessous de la status bar iOS, 12 px de marge */
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  left: 12px;
  right: 12px;
  /* Centré dans 480 px max (même largeur que l'app) */
  max-width: calc(480px - 24px);
  margin-left: auto;
  margin-right: auto;
  z-index: 1100;  /* au-dessus des toasts (1000) et du topbar (100) */

  /* Fond blanc dépoli — effet verre iOS */
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.07),
    0 10px 32px rgba(0, 0, 0, 0.12),
    0 0 0 0.5px rgba(0, 0, 0, 0.06);

  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;

  /* État initial : au-dessus de l'écran, invisible */
  transform: translateY(calc(-100% - 20px));
  opacity: 0;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.28, 0.64, 1),
    opacity 0.28s ease;
  will-change: transform, opacity;
}

/* État visible */
.cb-banner--in {
  transform: translateY(0);
  opacity: 1;
}

/* État sortie (auto-dismiss) */
.cb-banner--out {
  transform: translateY(calc(-100% - 20px));
  opacity: 0;
  transition:
    transform 0.32s ease-in,
    opacity 0.24s ease-in;
}

/* ── Avatar ── */
.cb-avatar {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-avatar-driver   { background: linear-gradient(135deg, #00C47A, #007A4C); }
.cb-avatar-dispatch { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }

.cb-avatar-letter {
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.3px;
}

/* Petit badge WatiTaxi en bas-droite de l'avatar (comme logo WhatsApp) */
.cb-app-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.cb-app-badge svg { display: block; }

/* ── Corps du message ── */
.cb-body {
  flex: 1;
  min-width: 0;
}

.cb-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cb-preview {
  font-size: 13px;
  color: #4B5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}

/* ── Heure ── */
.cb-time {
  flex-shrink: 0;
  font-size: 11px;
  color: #9CA3AF;
  font-weight: 500;
  align-self: flex-start;
  padding-top: 2px;
}

/* ── BADGE NAV (onglet Messages) ── */
.nav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-msg-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: #EF4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 1.5px solid #fff;
  z-index: 10;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity   0.18s ease;
}
.nav-msg-badge.badge-show {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
@keyframes badge-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.38); }
  65%  { transform: scale(0.88); }
  100% { transform: scale(1); }
}
.nav-msg-badge.badge-pulse {
  animation: badge-pulse 0.40s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ================================================
   SHEET "SIGNALER UN PROBLEME" / ABANDON
   ================================================ */
.abandon-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 700; /* au-dessus de la bottom-nav (z-index:600) */
  display: flex;
  align-items: flex-end;
  transition: background 0.3s ease;
  pointer-events: none;
}
.abandon-overlay--open {
  background: rgba(0,0,0,.45);
  pointer-events: all;
}

.abandon-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 32px;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.34,1.28,0.64,1);
  box-shadow: 0 -4px 32px rgba(0,0,0,.12);
}
.abandon-sheet--open {
  transform: translateY(0);
}

.abandon-handle {
  width: 36px;
  height: 4px;
  background: #E5E7EB;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.abandon-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.abandon-header span {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.abandon-desc {
  font-size: 13px;
  color: #6B7280;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Reason chips */
.abandon-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.abandon-reason-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 72px;
}
.abandon-reason-btn:active {
  background: #F3F4F6;
}
.abandon-reason-btn.selected {
  border-color: #EF4444;
  background: #FEF2F2;
  color: #EF4444;
}
.abandon-reason-btn.selected svg {
  stroke: #EF4444;
}

/* Details textarea */
.abandon-details-wrap {
  margin-bottom: 16px;
}
.abandon-details-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  background: #F9FAFB;
}
.abandon-details-input:focus {
  border-color: #EF4444;
  background: #fff;
}

/* Actions row */
.abandon-actions {
  display: flex;
  gap: 10px;
}
.abandon-actions .btn {
  flex: 1;
}

/* Trigger button */
.cd-btn-abandon {
  background: #FEF2F2;
  color: #EF4444;
  border: 1.5px solid #FECACA;
  font-weight: 600;
}
.cd-btn-abandon:active {
  background: #FEE2E2;
}
.cd-btn-abandon svg {
  stroke: #EF4444;
}

/* ================================================================
   PROFIL v26 — Hero épuré + Quick Config + Actions plates
   ================================================================ */

/* ── Hero v3 ── */
.prof3-hero-card {
  background: linear-gradient(135deg, #0F172A 0%, #064E3B 60%, #052E16 100%);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
}
.prof3-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.prof3-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.prof3-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16A34A, #4ADE80);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.2);
}
.prof3-verified {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #16A34A;
  border: 2px solid #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
}
.prof3-hero-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.prof3-name {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.prof3-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(74,222,128,0.15);
  color: #4ADE80;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(74,222,128,0.3);
  width: fit-content;
}
.prof3-stars {
  display: flex;
  align-items: center;
  gap: 5px;
}
.prof3-stars-ico {
  color: #FBBF24;
  font-size: 13px;
  letter-spacing: 1px;
}
.prof3-stars-val {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.prof3-stars-cnt {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
}
.prof3-hero-footer {
  display: flex;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.prof3-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.prof3-stat-num {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.prof3-stat-lbl {
  color: rgba(255,255,255,0.45);
  font-size: 11px;
}
.prof3-stat-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.prof3-edit-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s;
  margin-left: 10px;
  flex-shrink: 0;
  min-height: 34px;
}
.prof3-edit-btn:active { background: rgba(255,255,255,0.25); }

/* ── Quick Config ── */
.prof3-quick-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  margin-bottom: 12px;
  overflow: hidden;
}
.prof3-qc-section {
  padding: 14px 16px;
}
.prof3-qc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.prof3-qc-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.prof3-qc-right {
  flex: 1;
  min-width: 0;
}
.prof3-qc-label {
  display: block;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 9px;
}
.prof3-qc-sep {
  height: 1px;
  background: #F3F4F6;
}
/* Chips canaux */
.prof3-channels-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prof3-ch-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #6B7280;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 32px;
  min-width: 44px;
}
.prof3-ch-chip.active {
  background: #DCFCE7;
  border-color: #16A34A;
  color: #15803D;
}
.prof3-ch-chip:active { opacity: 0.75; }
/* Segmented véhicule */
.prof3-vehicle-seg {
  display: flex;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
}
.prof3-vseg-btn {
  flex: 1;
  padding: 8px 4px;
  background: #F9FAFB;
  border: none;
  border-right: 1.5px solid #E5E7EB;
  color: #6B7280;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 38px;
}
.prof3-vseg-btn:last-child { border-right: none; }
.prof3-vseg-btn.active {
  background: #16A34A;
  color: #fff;
}
.prof3-vseg-btn:active { opacity: 0.8; }

/* ── Actions plates ── */
.prof3-actions-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  margin-bottom: 12px;
  overflow: hidden;
}
.prof3-act-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid #F3F4F6;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.prof3-act-row:first-child { border-top: none; }
.prof3-act-row:active { background: #F9FAFB; }
.prof3-act-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.prof3-act-label {
  flex: 1;
  font-size: 14px;
  color: #1F2937;
  line-height: 1.3;
}
.prof3-act-arrow { flex-shrink: 0; }
.prof3-act-divider {
  height: 6px;
  background: #F9FAFB;
  border-top: 1px solid #F3F4F6;
  border-bottom: 1px solid #F3F4F6;
}

/* ── Label droit dans les accordéons ── */
.prof3-acc-right-lbl {
  color: #9CA3AF;
  font-size: 13px;
  margin-right: 4px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── LIEN DE RÉSERVATION (profil chauffeur) ──────────────── */
.bkl-card {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: 16px;
  padding: 16px;
  margin: 0 0 12px;
}
.bkl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 12px;
}
.bkl-slug-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bkl-url-box {
  flex: 1;
  min-width: 0;
  background: #F3F6F4;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
.bkl-url-prefix { font-size: 12px; color: #6B7280; white-space: nowrap; }
.bkl-url-slug   { font-size: 13px; font-weight: 700; color: #00A86B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bkl-btn-copy, .bkl-btn-share, .bkl-btn-edit {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  color: #1F2937;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  transition: all 0.15s;
}
.bkl-btn-copy:hover, .bkl-btn-share:hover, .bkl-btn-edit:hover { background: #F3F6F4; }
.bkl-btn-share { color: #007A4D; border-color: #D1FAE5; background: #F0FFF8; }
.bkl-btn-share:hover { background: #D1FAE5; }
.bkl-edit-row {
  display: none;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.bkl-slug-input {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1.5px solid #00A86B;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color: #1F2937;
}
.bkl-check { font-size: 11px; white-space: nowrap; }
.bkl-btn-save, .bkl-btn-cancel {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.bkl-btn-save   { background: #00A86B; color: #fff; }
.bkl-btn-cancel { background: #F3F4F6; color: #6B7280; }
.bkl-hint { font-size: 11px; color: #9CA3AF; margin-top: 10px; }

/* ══════════════════════════════════════════════════════════
   DEMANDES CLIENTS (client-requests.js)
   Section dans screen-home pour les réservations clientBookings
   ══════════════════════════════════════════════════════════ */
.cr-section {
  background: #fff;
  border-bottom: 2px solid #E5E7EB;
  padding: 0;
}
.cr-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 10px;
  gap: 8px;
}
.cr-header-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: #1F2937;
}
.cr-badge {
  background: #EF4444; color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  min-width: 20px; text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
}
.cr-title { font-size: 14px; font-weight: 700; color: #0D1B2A; }
.cr-toggle {
  background: none; border: none; font-size: 13px;
  color: #9CA3AF; cursor: pointer; padding: 4px 8px;
  border-radius: 6px; font-family: inherit;
}
.cr-toggle:hover { background: #F3F4F6; }

.cr-list { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.cr-group-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: #6B7280;
  padding: 4px 4px 0;
}
.cr-group-muted { opacity: .7; }

/* Cards */
.cr-card {
  border-radius: 14px; padding: 14px;
  border: 1.5px solid #E5E7EB;
  background: #FAFAFA;
}
.cr-card-pending {
  border-color: #FCD34D;
  background: #FFFBEB;
}
.cr-card-active { border-color: #6EE7B7; background: #F0FFF8; }
.cr-card-recent { padding: 10px 14px; background: #F9FAFB; }

.cr-card-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.cr-card-ref  { font-size: 12px; font-weight: 700; color: #6B7280; letter-spacing: .4px; }
.cr-card-name { font-size: 14px; font-weight: 600; color: #1F2937; }
.cr-card-meta-row { display: flex; gap: 12px; align-items: center; }
.cr-card-date { font-size: 12px; color: #9CA3AF; }

.cr-client-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.cr-client-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: #F59E0B; color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cr-avatar-green { background: #00A86B; }
.cr-client-info { flex: 1; }
.cr-client-name  { font-size: 14px; font-weight: 700; color: #1F2937; }
.cr-client-phone {
  font-size: 13px; color: #00A86B; font-weight: 600;
  text-decoration: none;
}
.cr-client-phone:hover { text-decoration: underline; }

.cr-route { margin-bottom: 8px; }
.cr-route-from, .cr-route-to {
  font-size: 13px; font-weight: 600; color: #1F2937;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cr-route-arr { font-size: 11px; color: #D1D5DB; margin-left: 4px; }

.cr-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 12px; color: #6B7280;
  margin-bottom: 8px;
}
.cr-meta span {
  background: #F3F4F6; border-radius: 6px;
  padding: 3px 8px;
}
.cr-note {
  font-size: 12px; color: #6B7280; margin-bottom: 8px;
  padding: 6px 10px; background: #F9FAFB;
  border-radius: 8px; border-left: 3px solid #D1D5DB;
}

/* Action buttons */
.cr-actions { display: flex; gap: 8px; margin-top: 4px; }
.cr-btn-accept, .cr-btn-refuse {
  flex: 1; padding: 11px; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: none; font-family: inherit; transition: opacity .15s;
}
.cr-btn-accept:hover, .cr-btn-refuse:hover { opacity: .85; }
.cr-btn-accept:disabled, .cr-btn-refuse:disabled { opacity: .5; cursor: not-allowed; }
.cr-btn-accept { background: #00A86B; color: #fff; }
.cr-btn-refuse { background: #FEE2E2; color: #DC2626; }

/* Dots route (remplacent les emojis) */
.cr-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 6px;
  vertical-align: middle;
}
.cr-dot-green { background: #22c55e; }
.cr-dot-gray  { background: transparent; border: 2px solid #9CA3AF; }
.cr-route-from, .cr-route-to { display: flex; align-items: center; }
.cr-route-arr { display: flex; align-items: center; margin-left: 16px; margin-bottom: 2px; }

/* Bouton gérer la course (carte active) */
.cr-btn-manage {
  display: block; width: 100%; margin-top: 10px;
  padding: 11px; border-radius: 10px;
  background: #0F172A; color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: none; font-family: inherit; text-align: center;
  transition: opacity .15s;
}
.cr-btn-manage:hover { opacity: .85; }

/* Status badges */
.cr-status-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 20px; white-space: nowrap;
}
.cr-status-PENDING         { background: #FEF3C7; color: #92400E; }
.cr-status-ACCEPTED        { background: #D1FAE5; color: #065F46; }
.cr-status-REFUSED         { background: #FEE2E2; color: #991B1B; }
.cr-status-ASSIGNED        { background: #DBEAFE; color: #1D4ED8; }
.cr-status-IN_PROGRESS     { background: #EDE9FE; color: #5B21B6; }
.cr-status-CLIENT_ON_BOARD { background: #E0E7FF; color: #3730A3; }
.cr-status-COMPLETED       { background: #D1FAE5; color: #065F46; }
.cr-status-CANCELLED_CLIENT, .cr-status-CANCELLED_DRIVER { background: #F3F4F6; color: #6B7280; }

/* Badges urgence — remplacement du badge "En attente" générique */
.cr-urgency-badge {
  font-size: 11px; font-weight: 800; padding: 3px 10px;
  border-radius: 20px; white-space: nowrap; letter-spacing: .4px;
}
/* Immédiat → rouge vif avec pulse */
.cr-urgency-now {
  background: #FEE2E2; color: #B91C1C;
  border: 1.5px solid #FCA5A5;
  animation: cr-pulse-red 1.6s ease-in-out infinite;
}
@keyframes cr-pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}
/* Résa planifiée → vert clair */
.cr-urgency-planned {
  background: #ECFDF5; color: #065F46;
  border: 1.5px solid #6EE7B7;
}

/* Cartes confirmées cliquables dans le planning */
.pl-booking-clickable { cursor: pointer; }
.pl-booking-clickable:active { opacity: .85; }

/* ══════════════════════════════════════════════════════════
   HOME — Section réservations clients
   ══════════════════════════════════════════════════════════ */
.h-client-bookings-header {
  font-size: 11px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; color: #007A4D;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #D1FAE5;
  background: #F0FFF8;
  margin: 0 -4px 4px;
  display: flex; align-items: center;
  justify-content: space-between;
  user-select: none;
}
.h-client-bookings-toggle:active { background: #DCFCE7; }

.h-bookings-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px;
  background: #22c55e; color: #fff;
  border-radius: 10px; font-size: 11px; font-weight: 800;
  padding: 0 5px;
}

.h-client-bookings-list {
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.h-client-booking-row {
  border-left: 4px solid #22c55e !important;
  background: #F8FFF9 !important;
}

.h-client-badge {
  display: inline-block;
  font-size: 9px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase;
  background: #D1FAE5; color: #065F46;
  border-radius: 4px; padding: 1px 5px;
  margin-left: 6px; vertical-align: middle;
}

.h-booking-actions {
  display: flex; gap: 6px;
  margin-top: 6px; justify-content: flex-end;
}

.h-booking-refuse-btn,
.h-booking-accept-btn {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  min-width: 80px;
  transition: opacity .15s;
}
.h-booking-refuse-btn {
  background: #FEE2E2; color: #991B1B;
}
.h-booking-accept-btn {
  background: #22c55e; color: #fff;
}
.h-booking-refuse-btn:disabled,
.h-booking-accept-btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   ASSISTANT PLANNING — Écran "Mes disponibilités" (av2-*)
   ========================================================= */
.av2-intro {
  font-size: 13px; color: #6B7280; line-height: 1.5; margin-bottom: 16px;
}
.av2-card {
  background: #fff; border-radius: 18px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05), 0 0 0 0.5px rgba(0,0,0,0.04);
}
.av2-card-hd {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
}
.av2-cic {
  width: 34px; height: 34px; border-radius: 10px; background: #ECFDF5;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.av2-card-hd strong { font-size: 15px; color: #0F172A; }
.av2-field + .av2-field { margin-top: 16px; }
.av2-lbl {
  font-size: 13px; font-weight: 600; color: #374151;
  margin-bottom: 8px; display: block;
}
.av2-help {
  font-size: 12px; color: #6B7280; display: block; margin: -4px 0 8px;
}
.av2-input {
  width: 100%; min-height: 46px; border: 1.5px solid #E5E7EB; border-radius: 11px;
  padding: 0 12px; font-size: 15px; color: #0F172A; font-family: inherit; background: #fff;
}
.av2-input:focus { outline: none; border-color: #00A86B; }

/* Chips */
.av2-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.av2-chip {
  padding: 9px 14px; border-radius: 11px; border: 1.5px solid #E5E7EB;
  background: #fff; font-size: 13.5px; font-weight: 600; color: #374151;
  cursor: pointer; min-height: 42px; display: flex; align-items: center;
  font-family: inherit;
}
.av2-chip.on { background: #ECFDF5; border-color: #00A86B; color: #007A4D; }

/* Mode jour / semaine (segmented) */
.av2-seg { display: flex; gap: 4px; background: #F1F5F9; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.av2-seg button { flex: 1; border: none; background: none; min-height: 40px; border-radius: 9px;
  font: 700 14px/1 inherit; color: #64748B; cursor: pointer; }
.av2-seg button.is-on { background: #fff; color: #0F172A; box-shadow: 0 1px 4px rgba(16,24,40,.12); }
/* Cases jours de la semaine */
.av2-days { display: flex; gap: 5px; }
.av2-days button { flex: 1 1 0; min-width: 0; padding: 0; min-height: 46px; border: 1.5px solid #E5E7EB; border-radius: 10px;
  background: #fff; font: 700 12.5px/1 inherit; color: #374151; cursor: pointer; }
.av2-days button.is-on { background: #ECFDF5; border-color: #00A86B; color: #007A4D; }
/* Pause */
.av2-pause-toggle { display: flex; align-items: center; gap: 11px; font: 600 14px/1 inherit; color: #374151; cursor: pointer; }
.av2-pause-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.av2-pause-toggle input:checked + .av2-sw-track { background: #00A86B; }
.av2-pause-toggle input:checked + .av2-sw-track .av2-sw-thumb { transform: translateX(19px); }
.av2-weekcount { margin: 14px 0 0; font: 600 13px/1.4 inherit; color: #007A4D; background: #ECFDF5;
  border: 1px solid #BBF7D0; border-radius: 10px; padding: 9px 12px; }

/* Heures */
.av2-time-row { display: flex; gap: 10px; }
.av2-time-col { flex: 1; }
.av2-time-col span { font-size: 11.5px; color: #9CA3AF; display: block; margin-bottom: 5px; }

/* Toggle domicile */
.av2-home-toggle {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1.5px solid #E5E7EB; border-radius: 12px; cursor: pointer; position: relative;
}
.av2-ht-txt { flex: 1; }
.av2-ht-txt b { font-size: 14px; display: block; color: #0F172A; }
.av2-ht-txt small { font-size: 12px; color: #6B7280; }
.av2-sw-input { position: absolute; opacity: 0; width: 0; height: 0; }
.av2-sw-track {
  width: 46px; height: 27px; border-radius: 20px; background: #D1D5DB;
  position: relative; flex-shrink: 0; transition: background 0.2s;
}
.av2-sw-thumb {
  position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: #fff; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.av2-sw-input:checked + .av2-sw-track { background: #00A86B; }
.av2-sw-input:checked + .av2-sw-track .av2-sw-thumb { transform: translateX(19px); }

.av2-home-addr {
  margin-top: 10px; font-size: 13px; color: #007A4D;
  background: #ECFDF5; border: 1px solid #BBF7D0; border-radius: 10px;
  padding: 9px 12px; align-items: center; gap: 7px;
}
.av2-home-addr-empty { color: #EF4444; background: #FEF2F2; border-color: #FECACA; }

/* Stepper km */
.av2-stepper {
  display: flex; align-items: center; border: 1.5px solid #E5E7EB;
  border-radius: 12px; overflow: hidden; width: 100%;
}
.av2-stepper button {
  width: 52px; min-height: 46px; border: none; background: #F9FAFB;
  font-size: 22px; color: #00A86B; cursor: pointer; font-weight: 600; font-family: inherit;
}
.av2-stepper button:active { background: #ECFDF5; }
.av2-stepval { flex: 1; text-align: center; font-size: 16px; font-weight: 700; color: #0F172A; }
.av2-stepval em { font-size: 13px; color: #9CA3AF; font-weight: 500; font-style: normal; margin-left: 3px; }

/* Barre Enregistrer collante */
.av2-savebar {
  position: sticky; bottom: 0; left: 0; right: 0;
  padding: 14px;
  background: linear-gradient(to top, #fff 70%, transparent);
}
.btn-av2-save {
  width: 100%; min-height: 52px; border: none; border-radius: 14px;
  background: #00A86B; color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,168,107,0.3); font-family: inherit;
}
.btn-av2-save:disabled { opacity: .6; cursor: not-allowed; }

/* ── État vide « Réseau en veille » (pool réseau vide) ── */
.net-idle-card { background: #fff; border: 1px solid #EAF0ED; border-radius: 18px;
  padding: 20px 18px 24px; box-shadow: 0 4px 18px rgba(15,23,42,.05); text-align: center; margin-top: 4px; }
.net-idle-badge { display: inline-flex; align-items: center; gap: 8px; background: #F1F8F4;
  color: #0F766E; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; }
.net-idle-dot { width: 8px; height: 8px; border-radius: 50%; background: #00A86B;
  box-shadow: 0 0 0 4px rgba(0,168,107,.15); animation: netIdlePulse 2s ease-in-out infinite; }
@keyframes netIdlePulse { 0%,100% { box-shadow: 0 0 0 3px rgba(0,168,107,.18); } 50% { box-shadow: 0 0 0 6px rgba(0,168,107,.06); } }
.net-idle-illu { max-width: 290px; margin: 10px auto 2px; }
.net-idle-illu svg { display: block; width: 100%; height: auto; }
.net-idle-title { font-size: 20px; font-weight: 800; color: #0F172A; margin-top: 2px; }
.net-idle-desc { font-size: 14px; line-height: 1.55; color: #64748B; margin-top: 8px; max-width: 300px; margin-left: auto; margin-right: auto; }
.net-idle-btn { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; height: 48px;
  padding: 0 22px; border: 1.5px solid #E2E8F0; background: #fff; border-radius: 13px;
  font-size: 14.5px; font-weight: 700; color: #0F172A; cursor: pointer; transition: border-color .15s; }
.net-idle-btn svg { color: #00A86B; }
.net-idle-btn:hover { border-color: #00A86B; }
@media (prefers-reduced-motion: reduce) { .net-idle-dot { animation: none; } }

/* ── Modale "Crédits épuisés" ── */
.nocred-sheet { background: #fff; border-radius: 24px 24px 0 0; padding: 32px 24px 36px; max-width: 480px; width: 100%; margin: auto; margin-top: auto; text-align: center; position: fixed; bottom: 0; left: 0; right: 0; }
.nocred-icon { display: flex; justify-content: center; margin-bottom: 16px; }
.nocred-title { font-size: 19px; font-weight: 800; color: #1F2937; margin: 0 0 8px; }
.nocred-sub { font-size: 14px; color: #6B7280; margin: 0 0 24px; line-height: 1.5; }
.nocred-btn-primary { width: 100%; height: 52px; background: #00A86B; color: #fff; border: none; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.nocred-btn-primary:hover { background: #009760; }
.nocred-btn-ghost { width: 100%; height: 44px; background: transparent; color: #6B7280; border: none; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ── Bouton "Crédits requis" dans le pool ── */
.btn-no-credit { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; background: #FEF2F2; color: #EF4444; border: 1.5px solid #FECACA; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-no-credit:active { background: #FEE2E2; }

/* ── Bandeau "Crédits requis" dans le profil ── */
.bkl-no-credit { display: flex; align-items: center; gap: 7px; background: #FEF2F2; border: 1px solid #FECACA; border-radius: 10px; padding: 9px 12px; font-size: 13px; color: #DC2626; font-weight: 600; margin-top: 8px; }
.bkl-recharge { margin-left: auto; height: 32px; padding: 0 12px; background: #fff; color: #00A86B; border: 1.5px solid #00A86B; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
