:root {
  --fond: #EEF0F1;
  --surface: #FFFFFF;
  --encre: #1F2528;
  --gris: #5E676C;
  --trait: #D5DADC;
  --bitume: #262C2F;
  --jaune: #F2C300;
  --vert: #1F7A4F;
  --vert-fond: #E2F2E9;
  --ambre: #9A5A00;
  --ambre-fond: #FCEFD9;
  --rouge: #B3362D;
  --rouge-fond: #FBE4E2;
  --condense: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --texte: 'Barlow', 'Segoe UI', Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 16px/1.45 var(--texte); }
[hidden] { display: none !important; }
a { color: var(--encre); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
code { font-size: 0.92em; background: var(--fond); padding: 1px 5px; border-radius: 4px; }

h1, h2 { font-family: var(--condense); font-weight: 700; margin: 0; line-height: 1.1; }
h2 { font-size: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 input { font-family: var(--texte); font-size: 16px; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--trait); background: var(--surface); cursor: pointer; text-decoration: none; font-weight: 500;
}
.btn:hover { border-color: var(--gris); }
.btn.principal { background: var(--bitume); border-color: var(--bitume); color: #fff; }
.btn.petit { min-height: 32px; padding: 0 10px; font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lien { background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 0; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select {
  min-height: 40px; padding: 6px 10px; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface);
}

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; background: var(--bitume); padding: 16px; }
.carte-connexion { background: var(--surface); border-radius: 14px; padding: 32px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; }
.carte-connexion h1 { font-size: 32px; margin-bottom: 12px; }
.erreur-form { color: var(--rouge); min-height: 1.4em; margin: 0; }

/* En-tête */
.entete {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 10px clamp(16px, 3vw, 32px); background: var(--bitume); color: #fff;
}
.entete a, .entete .lien { color: #fff; }
.titre-appli { font-family: var(--condense); font-weight: 700; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.pastille { background: var(--jaune); color: var(--bitume); border: 2px solid var(--bitume); box-shadow: 0 0 0 2px var(--jaune); padding: 0 6px; border-radius: 4px; font-size: 18px; }
.onglets { display: flex; gap: 4px; flex-wrap: wrap; }
.onglets button { background: none; border: 0; color: #C9CFD1; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.onglets button[aria-selected=true] { color: #fff; background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 -3px 0 var(--jaune); }
.entete-droite { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 15px; }
.mode { padding: 2px 10px; border-radius: 99px; font-weight: 600; font-size: 13px; }
.mode.demo { background: var(--jaune); color: var(--bitume); }
.mode.google { background: rgba(255, 255, 255, 0.15); }

.contenu { padding: 20px clamp(16px, 3vw, 32px) 48px; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.onglet { display: flex; flex-direction: column; gap: 20px; }

.bloc { background: var(--surface); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--trait); }
.bloc.alerte { border-color: #E5B567; box-shadow: inset 4px 0 0 var(--ambre); }
.barre-bloc { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.note { color: var(--gris); margin: 0; max-width: 75ch; }

/* État */
.etat { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.indic { background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 14px 16px; }
.indic .valeur { font-family: var(--condense); font-size: 30px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.indic .libelle { color: var(--gris); font-size: 14px; }
.indic.ko { border-color: #E3A39D; background: var(--rouge-fond); }
.indic.attention { border-color: #E5B567; background: var(--ambre-fond); }

/* Tableaux */
.table-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--gris); border-bottom: 2px solid var(--trait); padding: 8px 10px; white-space: nowrap; }
td { border-bottom: 1px solid var(--trait); padding: 8px 10px; vertical-align: top; }
tr.annule td { color: var(--gris); text-decoration: line-through; }
td.heure { font-family: var(--condense); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
td.vide { color: var(--gris); }
.vide-table { color: var(--gris); padding: 18px 10px; }

.statut { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.statut.ecrit, .statut.ok { background: var(--vert-fond); color: var(--vert); }
.statut.en_attente, .statut.deplacee { background: var(--ambre-fond); color: var(--ambre); }
.statut.erreur, .statut.non_place, .statut.introuvable { background: var(--rouge-fond); color: var(--rouge); }
.statut.annule { background: var(--fond); color: var(--gris); }
.valeur-xxxx { color: var(--gris); font-weight: 600; letter-spacing: 0.05em; }

/* Formulaires */
.formulaire h2:not(:first-child) { margin-top: 12px; }
.champ { display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.champ.court { max-width: 180px; }
.champ label { font-weight: 600; }
.case { display: flex; gap: 10px; align-items: center; }
.case input { width: 20px; height: 20px; }
.ligne-ajout { display: flex; gap: 8px; }
.jetons { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jetons li { background: var(--fond); border-radius: 99px; padding: 4px 6px 4px 12px; display: flex; gap: 6px; align-items: center; }
.jetons button { border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.actions-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.retour { color: var(--gris); }
.retour.ok { color: var(--vert); }
.retour.ko { color: var(--rouge); }

.evenements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.evenements time { color: var(--gris); margin-right: 8px; font-variant-numeric: tabular-nums; }

.filtres { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filtres .champ { min-width: 150px; flex: 0 1 auto; }
.filtres .boutons { flex-direction: row; gap: 8px; }
.resume { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; }

.dialogue { border: 0; border-radius: 12px; padding: 24px; max-width: min(480px, calc(100vw - 32px)); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); }
.dialogue::backdrop { background: rgba(38, 44, 47, 0.55); }
.dialogue p { margin: 0 0 16px; }

.verif { border-top: 1px solid var(--trait); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.verif p { margin: 0; }
