/* Site de la cellule innovation – feuille de style unique */
:root {
  --fond: #f4f5f2;
  --carte: #ffffff;
  --texte: #1f2a24;
  --doux: #5f6b64;
  --ligne: #dde1dc;
  --accent: #3d5a3c;
  --accent-clair: #e6ede4;
  --ok: #2f7a44;    --ok-fond: #e3f2e7;
  --info: #2c5d8a;  --info-fond: #e3edf7;
  --warn: #8a5a00;  --warn-fond: #fbefd5;
  --bad: #a4302a;   --bad-fond: #f8e1df;
  --violet: #5d3f8a; --violet-fond: #ece5f6;
  --rayon: 8px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
}
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h1 small { color: var(--doux); font-weight: 400; }
h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; }

/* ---------- Barre du haut ---------- */
.barre {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  background: var(--accent); color: #fff; padding: .55rem 1rem;
}
.barre a { color: #fff; text-decoration: none; }
.marque { font-weight: 700; font-size: 1.05rem; margin-right: .5rem; }
.barre nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
.menu { position: relative; }
.menu summary, .nav-lien {
  list-style: none; cursor: pointer; padding: .35rem .7rem; border-radius: 6px; display: inline-block;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; font-size: .8em; opacity: .8; }
.menu summary:hover, .nav-lien:hover, .menu[open] summary { background: rgba(255,255,255,.15); }
.sous {
  position: absolute; z-index: 10; top: 110%; left: 0; min-width: 210px;
  background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon);
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: .3rem;
}
.sous a { display: block; color: var(--texte); padding: .45rem .7rem; border-radius: 6px; }
.sous a:hover { background: var(--accent-clair); }
.moi { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.moi form { margin: 0; }
.role { opacity: .75; }
button.lien { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- Messages ---------- */
.flash { padding: .6rem .9rem; border-radius: var(--rayon); margin-bottom: .8rem; }
.flash.ok { background: var(--ok-fond); color: var(--ok); }
.flash.bad { background: var(--bad-fond); color: var(--bad); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent);
  border-radius: 6px; padding: .45rem .85rem; font: inherit; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.secondaire { background: var(--carte); color: var(--accent); }
.btn.danger { background: var(--bad); border-color: var(--bad); }

/* ---------- En-tête de page ---------- */
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.filtres { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .6rem 0; }
.filtres input[type=search] { min-width: 220px; }
.compte, .petit, .meta { color: var(--doux); font-size: .9rem; }
.meta { font-size: 1rem; }

/* ---------- Champs ---------- */
input, select, textarea {
  font: inherit; padding: .42rem .55rem; border: 1px solid var(--ligne); border-radius: 6px;
  background: #fff; color: var(--texte); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-clair); border-color: var(--accent); }
.formulaire { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 1rem; max-width: 640px; }
.formulaire.compact { max-width: none; display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.formulaire.compact .champ { margin: 0; }
.formulaire.compact .large { flex: 1; min-width: 260px; }
.champ { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .8rem; }
.champ > span { font-weight: 600; font-size: .92rem; }
.champ input, .champ select, .champ textarea { width: 100%; }
.champ small { color: var(--doux); }
.champ em { color: var(--bad); font-style: normal; font-size: .9rem; }
.champ.erreur input, .champ.erreur select, .champ.erreur textarea { border-color: var(--bad); }
.champ.case { flex-direction: row; align-items: center; }
.champ.case input { width: auto; }
.boutons { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.suppr { margin-top: 1rem; }

/* ---------- Tableaux ---------- */
.table-scroll { overflow-x: auto; background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); }
table { border-collapse: collapse; width: 100%; }
.donnees th, .donnees td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.donnees th { background: #fafbf9; font-size: .85rem; color: var(--doux); white-space: nowrap; position: sticky; top: 0; }
.donnees tr:hover td { background: #fafcf9; }
.ops { white-space: nowrap; text-align: right; }
.ops a { margin-left: .5rem; }
.vide { color: var(--doux); font-style: italic; }
.long { white-space: pre-wrap; }
.mini td, .mini th { padding: .3rem .4rem; border-bottom: 1px solid var(--ligne); text-align: left; font-size: .92rem; }
.mini th { color: var(--doux); font-weight: 600; font-size: .82rem; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .82rem; background: #eceeea; white-space: nowrap; }
.badge.ok { background: var(--ok-fond); color: var(--ok); }
.badge.info { background: var(--info-fond); color: var(--info); }
.badge.warn { background: var(--warn-fond); color: var(--warn); }
.badge.bad { background: var(--bad-fond); color: var(--bad); }
.badge.violet { background: var(--violet-fond); color: var(--violet); }

/* ---------- Tableau de bord ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.tuile {
  background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon);
  padding: .8rem; text-decoration: none; color: var(--texte); display: flex; flex-direction: column;
}
.tuile b { font-size: 1.45rem; }
.tuile span { color: var(--doux); font-size: .88rem; }
.tuile.alerte { border-color: #e8c47c; background: #fffaf0; }
.rapide { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: .8rem; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: .8rem 1rem; }
.carte h2 { margin-top: 0; display: flex; justify-content: space-between; align-items: baseline; }
.carte h2 a { font-size: .85rem; font-weight: 400; }
.texte { white-space: pre-wrap; }

/* ---------- Suivi de projet ---------- */
.fil { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.point { background: var(--carte); border: 1px solid var(--ligne); border-left: 4px solid var(--accent); border-radius: var(--rayon); padding: .6rem .9rem; }
.point header { color: var(--doux); font-size: .9rem; display: flex; gap: .6rem; }
.point header a { margin-left: auto; }
.point p { margin: .3rem 0 0; }

/* ---------- Connexion ---------- */
.boite-connexion { max-width: 380px; margin: 8vh auto; }
.boite-connexion .formulaire { max-width: none; }

/* ---------- Téléphone : tableaux en cartes ---------- */
@media (max-width: 700px) {
  html { font-size: 16px; }
  main { padding: .7rem; }
  .moi .role { display: none; }
  .donnees thead { display: none; }
  .donnees, .donnees tbody, .donnees tr, .donnees td { display: block; width: 100%; }
  .donnees tr { border-bottom: 2px solid var(--ligne); padding: .4rem 0; }
  .donnees td { border: 0; padding: .15rem .7rem; }
  .donnees td[data-label]::before { content: attr(data-label) " : "; color: var(--doux); font-size: .85rem; }
  .ops { text-align: left; }
  .ops a { margin: 0 .8rem 0 0; }
  .filtres input[type=search] { min-width: 0; flex: 1; }
}

/* Ajustements */
.donnees td:first-child { white-space: nowrap; }
.carte { overflow-x: auto; }
.mini td:last-child { white-space: nowrap; }
@media (max-width: 700px) {
  .filtres input[type=search] { flex: 1 1 100%; }
  .donnees td:empty { display: none; }
}

/* ---------- Météo de vol ---------- */
.meteo-bandeau { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.meteo-bandeau > a, .meteo-bandeau > div { flex: 1; min-width: 200px; border-radius: var(--rayon); padding: .7rem .9rem;
  text-decoration: none; color: #fff; background: #59645e; display: flex; flex-direction: column; gap: .1rem; }
.meteo-bandeau small { opacity: .9; font-size: .82rem; }
.meteo-bandeau b { font-size: 1.6rem; letter-spacing: .02em; }
.meteo-bandeau span { font-size: .9rem; }
.mv-raisons { font-weight: 600; }
.mv-verdict { flex: 1.4 !important; }
.go.mv-verdict, .go.mv-jour { background: #2f7a44; }
.prudence.mv-verdict, .prudence.mv-jour { background: #c98a12; color: #1d1300; }
.nogo.mv-verdict, .nogo.mv-jour { background: #a4302a; }
.mv-erreur { width: 100%; margin: 0; color: var(--warn); font-size: .88rem; }
.mv-pastille { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .8rem; font-weight: 700; background: #eceeea; }
.mv-pastille.go { background: var(--ok-fond); color: var(--ok); }
.mv-pastille.prudence { background: var(--warn-fond); color: var(--warn); }
.mv-pastille.nogo { background: var(--bad-fond); color: var(--bad); }
.mv-ligne.nuit td { color: var(--doux); }
.meteo-table td { white-space: nowrap; }
.formulaire h2 { font-size: 1.05rem; margin: 1rem 0 .6rem; }
.formulaire h2:first-of-type { margin-top: 0; }
.deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 .8rem; }
.reglage-ecran { max-width: 640px; margin-top: 1rem; }
.adresse { word-break: break-all; background: var(--accent-clair); padding: .2rem .4rem; border-radius: 4px; }
