/* =============================================================================
   LOC RÉACTION S.A.S — Version 2
   Espace chauffeur : thème de nuit (lisible au volant, de jour comme de nuit)
   Commun à l'accueil chauffeur et à l'écran de course.
   ============================================================================= */
.theme-nuit {
  --fond: #0A1A38;
  --surface: #13274D;
  --surface-2: #1B3461;
  --ligne: #2A4677;
  --texte-2: #B6C4DC;
  background: var(--fond);
  color: var(--blanc);
}
.theme-nuit a { color: var(--or); }
/* Un lien en forme de bouton garde la couleur du bouton (or sur or serait illisible) */
.theme-nuit a.bouton-principal, .theme-nuit a.bouton-principal:hover { color: var(--nuit); }
.theme-nuit .saisie { background: var(--surface-2); border-color: var(--ligne); color: var(--blanc); }
.theme-nuit .saisie::placeholder { color: #8A9BBA; }
/* Erreurs de saisie lisibles sur fond de nuit */
.theme-nuit .erreur-champ { color: #FFB4AE; }
.theme-nuit .saisie[aria-invalid='true'] { border-color: #FF8A80; }
.theme-nuit .suggestions { background: var(--surface-2); border-color: var(--ligne); }
.theme-nuit .suggestion[aria-selected='true'], .theme-nuit .suggestion:hover { background: var(--surface); }
.theme-nuit .suggestion-detail, .theme-nuit .aide { color: var(--texte-2); }
.theme-nuit .suggestion-etiquette { color: #7FD3A1; }
.theme-nuit .bouton-secondaire { color: var(--blanc); border-color: var(--blanc); }
.theme-nuit .bouton-secondaire:hover { background: rgba(255, 255, 255, 0.08); }
.theme-nuit .bouton-texte { color: var(--or); }
.theme-nuit .alerte { background: #4A1A1A; color: #FFD6D3; }
.theme-nuit .alerte-info { background: var(--surface-2); color: var(--blanc); }
.theme-nuit .case input { accent-color: var(--or); }

/* Barre du haut */
.barre { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 var(--marge); max-width: var(--largeur); margin: 0 auto; }
.barre .marque { color: var(--blanc); }
.barre .marque img { filter: brightness(0) invert(1); }
.pastille-etat {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; white-space: nowrap;
  border-radius: var(--rayon-pastille); background: var(--surface-2); font-weight: 600; font-size: 15px;
}
/* Téléphone étroit (moins de 380 px) : le logo seul, pour garder sur une ligne
   l'état « En ligne » et la cloche des notifications */
@media (max-width: 379px) { .barre .marque span { display: none; } }
.pastille-etat::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #8A9BBA; }
.pastille-etat[data-en-ligne='true'] { background: #13432A; }
.pastille-etat[data-en-ligne='true']::before { background: #4ADE80; }

/* Mise en page : une colonne sur téléphone, carte à gauche sur ordinateur */
.espace-chauffeur { display: grid; gap: 12px; padding: 0 var(--marge) 40px; max-width: var(--largeur); margin: 0 auto; }
@media (min-width: 960px) {
  .espace-chauffeur { grid-template-columns: 3fr 2fr; align-items: start; }
  .espace-chauffeur .carte { grid-row: 1 / span 4; height: 76vh; position: sticky; top: 12px; }
}
.carte { height: 34vh; min-height: 220px; border-radius: var(--rayon-feuille); overflow: hidden; background: var(--surface); }
.panneau { background: var(--surface); border-radius: var(--rayon-feuille); padding: 18px; display: grid; gap: 14px; }
.panneau h2 { font-size: 22px; font-weight: 600; }

/* Bouton « Passer en ligne » : l'action principale, grande et sans ambiguïté */
.bouton-en-ligne { min-height: 60px; font-size: 20px; }
.bouton-en-ligne[data-en-ligne='true'] { background: transparent; color: var(--blanc); border-color: #4ADE80; }

/* Chiffres du jour */
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.chiffres div { background: var(--surface-2); border-radius: var(--rayon-champ); padding: 12px; }
.chiffres dt { color: var(--texte-2); font-size: 14px; }
.chiffres dd { margin: 2px 0 0; font-family: var(--police-titre); font-weight: 700; font-size: 26px; }

/* Listes de courses */
.liste-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.course-carte { background: var(--surface-2); border-radius: var(--rayon-champ); padding: 14px; display: grid; gap: 6px; }
.course-carte .entete-course { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.course-carte .moment { font-weight: 600; }
.course-carte .montant { font-family: var(--police-titre); font-weight: 700; font-size: 22px; color: var(--or); }
.course-carte .adresses { color: var(--texte-2); font-size: 15px; }
.course-carte .bouton { justify-self: start; min-height: 44px; }
.vide { color: var(--texte-2); }

/* Demande entrante : plein écran */
.demande { position: fixed; inset: 0; z-index: 50; background: rgba(4, 10, 24, 0.94); display: grid; place-items: end center; padding: 16px; }
@media (min-width: 600px) { .demande { place-items: center; } }
.demande-contenu { width: min(100%, 480px); background: var(--surface); border-radius: var(--rayon-feuille); border-top: 6px solid var(--or); padding: 22px; display: grid; gap: 14px; }
.demande-titre { font-family: var(--police-titre); font-weight: 700; font-size: 24px; }
.decompte { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.decompte span { display: block; height: 100%; background: var(--or); transform-origin: left center; }
.demande-prix { font-family: var(--police-titre); font-weight: 700; font-size: 56px; line-height: 1; }
.demande-approche { color: var(--texte-2); font-weight: 500; }
.demande-trajet { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.demande-trajet li { padding-left: 22px; position: relative; }
.demande-trajet li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 9px; height: 9px; border: 2.5px solid var(--blanc); border-radius: 50%; }
.demande-trajet li:last-child::before { border-radius: 0; background: var(--blanc); }
.demande-infos { color: var(--texte-2); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.demande-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.demande-actions .bouton { min-height: 60px; font-size: 19px; }

/* Repère de position du chauffeur sur la carte */
.repere-moi { width: 20px; height: 20px; border-radius: 50%; background: var(--or); border: 4px solid var(--blanc); box-shadow: 0 0 0 6px rgba(200, 168, 75, 0.35); }

/* =============================================================================
   Onglets : Accueil, Revenus, Courses, Compte
   ============================================================================= */
/* Barre d'onglets en bas de l'écran, au-dessus de la zone du geste système */
.onglets-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border-top: 1px solid var(--ligne);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
@media (min-width: 760px) { .onglets-bas { grid-template-columns: repeat(4, minmax(0, 170px)); justify-content: center; } }
.theme-nuit .onglet-bas {
  display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 62px; padding: 6px 4px;
  color: var(--texte-2); text-decoration: none; font-size: 13px; font-weight: 600;
  border-top: 3px solid transparent;
}
.theme-nuit .onglet-bas[aria-current='page'] { color: var(--or); border-top-color: var(--or); }
.theme-nuit .onglet-bas:focus-visible { outline: 3px solid var(--or); outline-offset: -3px; }
/* Place pour la barre : le bas du contenu et les messages restent visibles */
body.avec-onglets main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
body.avec-onglets .zone-messages { bottom: calc(82px + env(safe-area-inset-bottom)); }

/* Onglets Revenus, Courses, Compte : une colonne lisible */
.vue-onglet { display: grid; gap: 12px; align-content: start; padding: 0 var(--marge) 24px; max-width: 760px; margin: 0 auto; min-width: 0; }
.vue-titre { font-size: 30px; font-weight: 700; padding-top: 4px; }
.etiquette-nuit { color: var(--texte-2); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Choix exclusif sur toute la largeur (Jour / Semaine / Mois…) */
.theme-nuit .bascule { background: var(--surface); }
.bascule-large { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.bascule-large span { justify-content: center; width: 100%; padding: 0 8px; }
.theme-nuit .bascule input:checked + span { background: var(--or); color: var(--nuit); }

/* Période : précédente, libellé, suivante */
.periode { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 8px; }
.periode-libelle { text-align: center; font-family: var(--police-titre); font-weight: 600; font-size: 20px; }
.bouton-icone { min-width: 48px; padding: 0; font-size: 28px; line-height: 1; }
.theme-nuit .bouton-icone { background: var(--surface); color: var(--blanc); border-color: var(--ligne); }

/* Lignes « libellé … valeur » */
.lignes-valeurs { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 0; }
.lignes-valeurs dt { color: var(--texte-2); }
.lignes-valeurs dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.lignes-valeurs .retrait { padding-left: 14px; font-size: 15px; font-weight: 500; }
.lignes-valeurs .total { color: var(--blanc); font-weight: 700; border-top: 1px solid var(--ligne); padding-top: 8px; }
/* Le filet du total passe sous l'espace entre les deux colonnes */
.lignes-valeurs dd.total { margin-left: -16px; padding-left: 16px; }
/* Variante empilée (libellé au-dessus de la valeur) : valeurs longues sur téléphone */
.lignes-valeurs.empilees { grid-template-columns: minmax(0, 1fr); gap: 0; }
.lignes-valeurs.empilees dt { font-size: 14px; }
.lignes-valeurs.empilees dd { text-align: left; margin-bottom: 10px; }
.lignes-valeurs.empilees dd:last-child { margin-bottom: 0; }
.lignes-valeurs dd.libre { text-align: left; grid-column: 1 / -1; font-weight: 500; }

/* État d'une course : Terminée, Annulée */
.etat-course { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--rayon-pastille);
  font-size: 13px; font-weight: 700; background: var(--surface); color: var(--blanc); white-space: nowrap; }
.etat-course[data-statut='terminee'] { background: #13432A; color: #B7F0CB; }
.etat-course[data-statut='annulee'] { background: #4A1A1A; color: #FFD6D3; }

/* Avertissement (document à renouveler…) */
.theme-nuit .alerte-attention { background: #4A3A12; color: #FFE7A8; }
