/* Portail Roue Libre Aquitaine
   Le logo donne la direction : sérif classique, noir chaud, beaucoup de blanc.
   La palette reste quasi monochrome et n'admet qu'un seul accent, bordeaux —
   les couleurs vives sont réservées aux statuts, où elles portent un sens. */

:root {
  --encre:        #17140f;
  --texte:        #3b3630;
  --doux:         #8b8279;
  --tres-doux:    #aaa299;
  --trait:        #eae5dc;
  --trait-fort:   #ddd6ca;
  --fond:         #faf8f4;
  --carte:        #ffffff;

  --accent:       #7c2b38;
  --accent-doux:  #f7edee;
  --accent-fonce: #641f2b;

  --vert:         #2f6a4b;  --vert-doux:  #e9f2ec;
  --ambre:        #8a5518;  --ambre-doux: #fbf0e0;
  --rouge:        #97282c;  --rouge-doux: #f9ebeb;

  --r-xl:   18px;
  --r-lg:   14px;
  --r-md:   11px;
  --r-pill: 999px;

  --ombre: 0 1px 2px rgba(23, 20, 15, .04), 0 10px 30px -18px rgba(23, 20, 15, .16);
  --ombre-forte: 0 2px 4px rgba(23, 20, 15, .05), 0 18px 40px -20px rgba(23, 20, 15, .24);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-fonce); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--encre); letter-spacing: -.01em; }
h1 { font-size: 23px; margin: 0 0 5px; line-height: 1.3; }
h2 { font-size: 17px; margin: 28px 0 11px; }
.chapeau { color: var(--doux); margin: 0 0 18px; max-width: 74ch; font-size: 14px; }

/* ---------- barre de navigation ---------- */
.barre {
  display: flex; align-items: center; gap: 26px;
  padding: 0 28px; height: 68px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--trait);
  position: sticky; top: 0; z-index: 20;
}
.marque { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.marque img { height: 34px; width: auto; display: block; }
.marque .nom {
  font-family: var(--serif); font-size: 16px; color: var(--encre);
  line-height: 1.15; letter-spacing: .01em; white-space: nowrap;
}
.marque .nom small { display: block; font-family: var(--sans); font-size: 11px;
  color: var(--tres-doux); letter-spacing: .08em; text-transform: uppercase; }

.barre nav { display: flex; gap: 3px; margin-right: auto; margin-left: 12px; }
.barre nav a {
  padding: 8px 13px; border-radius: var(--r-pill); text-decoration: none;
  color: var(--texte); font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s ease, color .15s ease;
}
.barre nav a:hover { background: #f2efe9; color: var(--encre); }
.barre nav a.on { background: var(--accent-doux); color: var(--accent); font-weight: 600; }

.pastille {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--ambre); color: #fff; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.identite { display: flex; align-items: center; gap: 13px; font-size: 13px;
  white-space: nowrap; }
.role {
  font-weight: 600; padding: 5px 12px; border-radius: var(--r-pill); font-size: 12px;
  white-space: nowrap;
}
.role.admin  { background: var(--encre); color: #fff; }
.role.client { background: var(--accent-doux); color: var(--accent); }
.identite .email { color: var(--doux); }
.lien-discret { color: var(--doux); text-decoration: none; }
.lien-discret:hover { color: var(--encre); text-decoration: underline; }

/* ---------- structure ---------- */
main { max-width: 1320px; margin: 0 auto; padding: 26px 28px 64px; }
main.etroit { max-width: 470px; }

.carte {
  background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--r-xl); padding: 22px; margin-bottom: 18px;
  box-shadow: var(--ombre);
}
.entete-page { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.entete-page > div:first-child { margin-right: auto; }

/* ---------- indicateurs ---------- */
.indicateurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.indic {
  background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--r-lg); padding: 12px 16px; box-shadow: var(--ombre);
}
.indic .valeur {
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  color: var(--encre); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.indic .titre {
  font-size: 11px; color: var(--doux); text-transform: uppercase;
  letter-spacing: .07em; font-weight: 600; margin-top: 3px;
}
.indic.alerte-indic .valeur { color: var(--ambre); }

/* ---------- tableaux ---------- */
.tableau-enveloppe {
  overflow-x: auto; background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--r-xl); box-shadow: var(--ombre);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--doux); font-weight: 700; padding: 10px 14px;
  border-bottom: 1px solid var(--trait); white-space: nowrap; background: #fcfbf8;
}
th:first-child { border-top-left-radius: var(--r-xl); }
th:last-child  { border-top-right-radius: var(--r-xl); }
td { padding: 9px 14px; border-bottom: 1px solid #f4f1ea; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #fcfbf8; }
td a { color: var(--encre); text-decoration: none; font-weight: 600; }
td a:hover { color: var(--accent); text-decoration: underline; }
td.principal { font-weight: 600; color: var(--encre); }
.tronque { display: block; max-width: 34ch; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }

td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.secondaire { color: var(--doux); font-size: 12px; line-height: 1.4; }
.carte table td { border-bottom: 1px solid #f4f1ea; }
.carte table tr:last-child td { border-bottom: none; }

/* ---------- étiquettes ---------- */
.etiq {
  display: inline-block; padding: 3px 11px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: .01em;
}
.etiq.valide     { background: var(--vert-doux);  color: var(--vert); }
.etiq.a_verifier { background: var(--ambre-doux); color: var(--ambre); }
.etiq.rejete     { background: var(--rouge-doux); color: var(--rouge); }

/* ---------- formulaires ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--encre); }
.aide { font-weight: 400; color: var(--doux); font-size: 12.5px; margin-top: 6px; line-height: 1.5; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], textarea, select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--trait-fort);
  border-radius: var(--r-md); font-size: 14px; font-family: inherit;
  background: #fff; color: var(--texte); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--tres-doux); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(124, 43, 56, .11);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.champ { margin-bottom: 20px; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

button, .bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 20px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .06s ease;
}
button:hover, .bouton:hover { background: var(--accent-fonce); color: #fff; box-shadow: var(--ombre); }
button:active, .bouton:active { transform: translateY(1px); }
button.neutre, .bouton.neutre { background: #fff; color: var(--texte); border-color: var(--trait-fort); }
button.neutre:hover, .bouton.neutre:hover { background: #f7f4ef; color: var(--encre); }
button.danger { background: #fff; color: var(--rouge); border-color: #e8cdcd; }
button.danger:hover { background: var(--rouge-doux); color: var(--rouge); }
button.petit, .bouton.petit { padding: 7px 14px; font-size: 13px; }
/* Deconnexion : un POST (un simple lien se declencherait depuis n'importe
   quelle page tierce), mais qui garde l'allure d'un lien discret. */
form.en-ligne { display: inline; margin: 0; }
button.lien-bouton, button.lien-bouton:hover, button.lien-bouton:active {
  background: none; border: 0; padding: 0; box-shadow: none; transform: none;
  font: inherit; color: var(--doux); cursor: pointer;
}
button.lien-bouton:hover { color: var(--encre); text-decoration: underline; }
.actions { display: flex; gap: 11px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.actions .pousse { margin-left: auto; }

/* ---------- alertes et encadrés ---------- */
.alerte {
  padding: 13px 17px; border-radius: var(--r-lg); margin-bottom: 22px; font-size: 14px;
  border: 1px solid transparent;
}
.alerte.succes { background: var(--vert-doux);  color: var(--vert);  border-color: #cde3d6; }
.alerte.erreur { background: var(--ambre-doux); color: var(--ambre); border-color: #f0dcbb; }

/* Message d'un envoi sur place. La page n'ayant pas bougé, la confirmation
   doit venir a l'oeil plutot que d'attendre en haut, hors de vue. */
.alerte.flottante {
  position: fixed; z-index: 40; left: 50%; bottom: 26px; transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px)); margin: 0;
  box-shadow: 0 10px 30px rgba(30, 22, 18, .18);
  display: flex; align-items: flex-start; gap: 12px;
  animation: alerte-entree .22s ease-out;
}
.alerte.flottante button {
  background: none; border: 0; padding: 0; margin-left: auto; cursor: pointer;
  color: inherit; opacity: .55; font-size: 17px; line-height: 1;
}
.alerte.flottante button:hover { opacity: 1; }
@keyframes alerte-entree {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .alerte.flottante { animation: none; }
}

.encadre-info, .encadre-attention {
  padding: 13px 16px; border-radius: var(--r-lg); font-size: 13px;
  margin-bottom: 18px; line-height: 1.55;
}
.encadre-info { background: var(--accent-doux); border: 1px solid #eddbdd; color: #5c3b40; }
.encadre-attention { background: var(--ambre-doux); border: 1px solid #f0dcbb; color: #6d4514; }

/* ---------- divers ---------- */
.barre-filtres {
  display: flex; gap: 11px; margin-bottom: 20px; align-items: center; flex-wrap: wrap;
  background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--r-lg); padding: 13px 16px; box-shadow: var(--ombre);
}
.barre-filtres input[type=text] { max-width: 340px; }
.barre-filtres select { max-width: 200px; }
.vide { text-align: center; padding: 56px 24px; color: var(--doux); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: #f4f1ea; padding: 2px 6px; border-radius: 5px; }

/* ---------- page de connexion ---------- */
.connexion-cadre { margin-top: 8vh; text-align: center; }
.connexion-cadre .carte { text-align: left; padding: 38px; border-radius: 22px;
  box-shadow: var(--ombre-forte); }
.connexion-logo { height: 132px; width: auto; margin: 0 auto 26px; display: block; }
.connexion-cadre h1 { font-size: 24px; text-align: center; }
.connexion-cadre .chapeau { text-align: center; margin-bottom: 26px; }
.connexion-cadre button { width: 100%; padding: 13px; }
.pied { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--tres-doux); }

/* ---------- panneau a onglets ---------- */
/* L'onglet actif fait corps avec le tableau : il en est la prolongation vers le
   haut, pas un bouton pose au-dessus. Le trait du bandeau s'interrompt sous lui,
   ce qui suffit a dire que le contenu lui appartient. */
.panneau {
  background: var(--carte); border: 1px solid var(--trait);
  border-radius: var(--r-xl); box-shadow: var(--ombre);
  margin: 24px 0 18px; overflow: hidden;
}
.panneau .onglets {
  display: flex; gap: 0; padding: 0 10px;
  background: #f7f4ee; border-bottom: 1px solid var(--trait);
}
.panneau .onglets a {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 15px 22px 13px; margin-bottom: -1px;
  font-size: 14.5px; font-weight: 600; color: var(--doux); text-decoration: none;
  border: 1px solid transparent; border-bottom-color: var(--trait);
  border-radius: var(--r-md) var(--r-md) 0 0; white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}
.panneau .onglets a:hover { color: var(--encre); background: rgba(255, 255, 255, .55); }
.panneau .onglets a.on {
  background: var(--carte); color: var(--accent);
  border-color: var(--trait); border-bottom-color: var(--carte);
}
.panneau .onglets .compte {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--r-pill);
  background: rgba(23, 20, 15, .06); color: var(--doux);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.panneau .onglets a.on .compte { background: var(--accent-doux); color: var(--accent); }

/* Meme forme, posee sur la page : les reglages d'administration n'ont pas un
   tableau unique en dessous, mais plusieurs blocs. */
.onglets.autonomes {
  display: flex; gap: 0; padding: 0; margin: 0 0 22px;
  background: none; border: 0; border-bottom: 1px solid var(--trait);
}
.onglets.autonomes a {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 20px 11px; margin-bottom: -1px;
  font-size: 14.5px; font-weight: 600; color: var(--doux); text-decoration: none;
  border: 1px solid transparent; border-bottom-color: var(--trait);
  border-radius: var(--r-md) var(--r-md) 0 0; white-space: nowrap;
  transition: color .15s ease, background .15s ease;
}
.onglets.autonomes a:hover { color: var(--encre); background: rgba(255, 255, 255, .6); }
.onglets.autonomes a.on {
  background: var(--carte); color: var(--accent);
  border-color: var(--trait); border-bottom-color: var(--carte);
}
.onglets.autonomes .compte {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--r-pill);
  background: var(--ambre); color: #fff;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* La barre de recherche vit dans le panneau : elle appartient a l'onglet ouvert. */
.panneau .barre-filtres {
  margin: 0; padding: 14px 18px; background: none; border: 0;
  border-bottom: 1px solid var(--trait); border-radius: 0; box-shadow: none;
}
.panneau .tableau-enveloppe { border: 0; border-radius: 0; box-shadow: none; }
.panneau .vide { padding: 34px 18px; }

@media (max-width: 620px) {
  .panneau .onglets { padding: 0 4px; }
  .panneau .onglets a { flex: 1; justify-content: center; padding: 13px 10px 11px; }
}

/* ---------- carte OpenStreetMap ---------- */
/* Repliee par defaut : tant que personne ne l'ouvre, aucune tuile n'est
   demandee a openstreetmap.org. */
.carte-osm { margin-top: 14px; }
.carte-osm summary {
  cursor: pointer; display: inline-block; font-size: 13px; font-weight: 500;
  color: var(--accent); padding: 5px 11px; border: 1px solid var(--trait-fort);
  border-radius: var(--r-md); background: var(--carte); list-style: none;
}
.carte-osm summary::-webkit-details-marker { display: none; }
.carte-osm summary::before { content: "▸ "; color: var(--tres-doux); }
.carte-osm[open] summary::before { content: "▾ "; }
.carte-osm summary:hover { border-color: var(--accent); }
.carte-osm-corps { margin-top: 10px; }
.carte-osm iframe {
  width: 100%; height: 320px; border: 1px solid var(--trait-fort);
  border-radius: var(--r-md); display: block; background: var(--fond);
}
.carte-osm-pied {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 7px; font-size: 12.5px;
}

/* Sept entrees de navigation ne tiennent plus avec l'email en clair. */
@media (max-width: 1600px) {
  .identite .email { display: none; }
  .marque .nom small { display: none; }
}

@media (max-width: 900px) {
  .indicateurs { grid-template-columns: repeat(2, 1fr); }
  .grille2 { grid-template-columns: 1fr; }
  .barre { flex-wrap: wrap; height: auto; padding: 12px 18px; gap: 12px; }
  .barre nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .identite .email { display: none; }
  main { padding: 24px 18px 56px; }
}
