/* GabAdèle Clients — orange du chalet, vert épinette, gris de brume */
:root {
  --orange: #fd9800;
  --orange-fonce: #a85f00;   /* texte orange lisible sur blanc */
  --orange-pale: #fff3df;
  --foret: #22352e;          /* menu : épinette */
  --foret-2: #2e463d;
  --brume: #eef1ee;          /* fond */
  --blanc: #ffffff;
  --encre: #1f2a26;
  --doux: #5b6862;
  --trait: #d9dfdb;
  --ok: #2f7a4a;
  --ok-pale: #e5f3ea;
  --non: #b3362c;
  --non-pale: #fbe9e7;
  --titre: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rayon: 8px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--texte); color: var(--encre); background: var(--brume); }
a { color: var(--orange-fonce); }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
code { font-size: .9em; background: var(--brume); padding: .1em .35em; border-radius: 4px; }
small { display: block; color: var(--doux); font-size: .85rem; }
h1, h2 { font-family: var(--titre); font-weight: 600; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 0 0 .8rem; }
h2 small { display: inline; font-family: var(--texte); font-weight: 400; margin-left: .4rem; }

/* ---------- Structure ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--foret); color: #e8eee9; display: flex; flex-direction: column; padding: 1.2rem .8rem; overflow-y: auto; z-index: 30; }
.marque { display: block; text-decoration: none; padding: .4rem .6rem 1.2rem; border-bottom: 1px solid var(--foret-2); margin-bottom: .8rem; }
.marque img { display: block; max-width: 180px; max-height: 70px; width: auto; height: auto; }
.marque-txt { font-family: var(--titre); font-size: 1.7rem; color: var(--orange); font-weight: 700; }
.marque-sous { display: block; color: #b9c6bf; font-size: .82rem; margin-top: .2rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-bas { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--foret-2); }
.nav a, .lien-nav { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 6px; color: #dfe7e2; text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.nav a:hover, .lien-nav:hover { background: var(--foret-2); color: #fff; }
.nav a.on { background: var(--orange); color: #1d1406; font-weight: 600; }
.nav a.on .ico { stroke: #1d1406; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pastille { margin-left: auto; background: var(--orange); color: #1d1406; border-radius: 999px; font-size: .75rem; padding: 0 .5rem; line-height: 1.5rem; }
.nav a.on .pastille { background: #fff; }

.avec-menu .page { margin-left: 250px; }
.barre { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 2rem; background: var(--blanc); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 10; }
.barre h1 { margin: 0; font-size: 1.45rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qui { color: var(--doux); font-size: .9rem; }
.btn-menu { display: none; background: none; border: 0; padding: .3rem; cursor: pointer; color: var(--encre); }
.contenu { padding: 1.6rem 2rem 3rem; max-width: 1240px; }
.voile { display: none; }

/* ---------- Éléments ---------- */
.carte { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; }
.etroit { max-width: 640px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .95rem; font-weight: 600; padding: .55rem 1rem; border-radius: 6px; border: 1px solid #c3ccc7; background: var(--blanc); color: var(--encre); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--encre); color: var(--encre); }
.btn-plein { background: var(--orange); border-color: var(--orange); color: #1d1406; }
.btn-plein:hover { background: #e88a00; border-color: #e88a00; color: #1d1406; }
.btn-danger { color: var(--non); border-color: #e4b3ad; }
.btn-danger:hover { background: var(--non-pale); color: var(--non); border-color: var(--non); }
.btn-petit { padding: .3rem .7rem; font-size: .85rem; }
.btn-lien { background: none; border: 0; padding: 0; font: inherit; font-size: .9rem; color: var(--doux); text-decoration: underline; cursor: pointer; }
.btn-lien:hover { color: var(--non); }
button:disabled, fieldset:disabled .btn { opacity: .5; cursor: not-allowed; }

.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
.form label small { font-weight: 400; margin-top: .25rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; font-size: 1rem; padding: .55rem .7rem; border: 1px solid #c3ccc7; border-radius: 6px; background: var(--blanc); color: var(--encre); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); outline: 2px solid var(--orange-pale); }
input[type=checkbox] { display: inline; width: auto; margin: 0 .5rem 0 0; accent-color: var(--orange); transform: translateY(1px); }
input[type=file] { padding: .4rem; }
input[readonly] { background: var(--brume); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form label.case { display: flex; align-items: flex-start; font-weight: 400; gap: .2rem; }
.rangee { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.rangee-bas { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.rangee-bas label { flex: 1; min-width: 200px; margin-bottom: 0; }
.aide { color: var(--doux); font-size: .92rem; margin: 0 0 .9rem; }
.vide { color: var(--doux); }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.avis { padding: .8rem 1rem; border-radius: 6px; margin-bottom: 1.2rem; border-left: 4px solid; }
.avis-ok { background: var(--ok-pale); border-color: var(--ok); }
.avis-err { background: var(--non-pale); border-color: var(--non); }

.etiq { display: inline-block; font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; background: var(--brume); color: var(--doux); font-weight: 600; }
.etiq-oui { background: var(--ok-pale); color: var(--ok); }
.etiq-non { background: var(--non-pale); color: var(--non); }
.etiq-encours { background: var(--orange-pale); color: var(--orange-fonce); }

.outils { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.outils .aide { margin: 0; }
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.filtres input, .filtres select { width: auto; margin: 0; min-width: 160px; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.actions form, .zone-danger form { display: inline; }
.zone-danger { display: flex; gap: .6rem; flex-wrap: wrap; }
.en-ligne { display: inline; margin-left: .5rem; }

.tableau-wrap { overflow-x: auto; padding: 0; }
.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th { text-align: left; font-size: .82rem; color: var(--doux); font-weight: 600; padding: .7rem 1rem; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.tableau td { padding: .7rem 1rem; border-bottom: 1px solid #edf0ee; vertical-align: top; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau.petit { font-size: .82rem; }
.tableau.petit td, .tableau.petit th { padding: .4rem .6rem; }
.tableau tr.suspect td { background: var(--non-pale); }

.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid #edf0ee; }
.liste li:last-child { border-bottom: 0; }
.liste li > span:last-child, .liste li > b { color: var(--doux); font-size: .9rem; text-align: right; }

.deux-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.deux-col > .carte, .pile > .carte { margin-bottom: 0; }
.pile { display: flex; flex-direction: column; gap: 1.2rem; }
details { margin-top: .8rem; }
details summary { cursor: pointer; font-weight: 600; color: var(--orange-fonce); }
details[open] summary { margin-bottom: .8rem; }

/* ---------- Tableau de bord ---------- */
.chiffres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 1.2rem; }
.chiffre { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.1rem 1.2rem; border-top: 4px solid var(--orange); }
.chiffre b { display: block; font-family: var(--titre); font-size: 2rem; line-height: 1.1; }
.chiffre span { color: var(--doux); font-size: .88rem; }
.bandeau { display: block; background: var(--orange); color: #1d1406; font-weight: 600; text-decoration: none; padding: .8rem 1.1rem; border-radius: var(--rayon); margin-bottom: 1.2rem; }
.bandeau:hover { color: #1d1406; background: #e88a00; }
.bandeau-calme { background: var(--orange-pale); color: var(--orange-fonce); font-weight: 400; }

/* ---------- Fiche client ---------- */
.etat-client { padding: .9rem 1.1rem; border-radius: var(--rayon); margin-bottom: 1.2rem; border: 1px solid; }
.etat-client.oui { background: var(--ok-pale); border-color: #b9dcc5; }
.etat-client.non { background: var(--non-pale); border-color: #efc4be; }
.etat-client small { margin-top: .3rem; }

/* ---------- Campagne : étapes, aperçu ---------- */
.etapes { display: flex; list-style: none; padding: 0; margin: 0 0 1.3rem; counter-reset: e; gap: 0; }
.etapes li { counter-increment: e; flex: 1; position: relative; padding: .6rem .8rem .6rem 3rem; background: var(--blanc); border: 1px solid var(--trait); color: var(--doux); font-weight: 600; font-size: .92rem; }
.etapes li:first-child { border-radius: var(--rayon) 0 0 var(--rayon); }
.etapes li:last-child { border-radius: 0 var(--rayon) var(--rayon) 0; }
.etapes li + li { border-left: 0; }
.etapes li::before { content: counter(e); position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid #c3ccc7; font-size: .85rem; }
.etapes li.fait { color: var(--ok); }
.etapes li.fait::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.etapes li.actuel { color: var(--encre); background: var(--orange-pale); }
.etapes li.actuel::before { border-color: var(--orange); background: var(--orange); color: #1d1406; }

.atelier { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.2rem; align-items: start; }
.atelier > .carte { margin-bottom: 0; }
.apercu-tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.apercu-tete h2 { margin: 0; }
.bascule { display: inline-flex; border: 1px solid #c3ccc7; border-radius: 6px; overflow: hidden; }
.bascule button { font: inherit; font-size: .88rem; padding: .35rem .8rem; border: 0; background: var(--blanc); cursor: pointer; color: var(--doux); }
.bascule button.on { background: var(--foret); color: #fff; }
.cadre-apercu { background: #e7e2db; border-radius: 6px; padding: 12px; display: flex; justify-content: center; }
.cadre-apercu iframe { width: 100%; height: 720px; border: 0; background: #efeae4; transition: width .25s ease; }
.cadre-apercu.mobile iframe { width: 375px; max-width: 100%; height: 740px; border: 8px solid #2b2b2b; border-radius: 26px; }
.bloque { background: var(--brume); padding: .7rem .9rem; border-radius: 6px; color: var(--doux); }

/* ---------- Demandes ---------- */
.onglets { display: flex; gap: .3rem; }
.onglets a { padding: .45rem .9rem; border-radius: 6px; text-decoration: none; color: var(--doux); font-weight: 600; }
.onglets a.on { background: var(--foret); color: #fff; }
.demande header { display: flex; justify-content: space-between; gap: 1rem; }
.demande .date { color: var(--doux); font-size: .88rem; white-space: nowrap; }
.demande .sujet { margin: .6rem 0 .3rem; }
.demande .sujet small { display: inline; }
.indices { background: var(--orange-pale); padding: .4rem .7rem; border-radius: 6px; font-size: .92rem; display: inline-block; margin: .3rem 0; }
.extrait { white-space: pre-wrap; font: .88rem/1.5 var(--texte); background: var(--brume); padding: .8rem; border-radius: 6px; max-height: 340px; overflow: auto; }
.demande .actions { margin-top: 1rem; }

/* ---------- Réglages ---------- */
.sommaire { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.sommaire a { font-size: .88rem; padding: .3rem .7rem; background: var(--blanc); border: 1px solid var(--trait); border-radius: 999px; text-decoration: none; color: var(--encre); }
.sommaire a:hover { border-color: var(--orange); }
section[id] { scroll-margin-top: 90px; }
.codes { background: var(--orange-pale); border: 1px solid #f3d29a; border-radius: 6px; padding: 1rem; margin-bottom: 1rem; }
.codes ul { columns: 2; padding-left: 1.2rem; margin: 0; }
.codes code { background: none; font-size: 1rem; letter-spacing: .05em; }
.qr { width: 200px; height: 200px; margin: .5rem 0 1rem; }
.qr svg { display: block; width: 200px; height: 200px; }
.cle { font-size: 1rem; letter-spacing: .05em; word-break: break-all; }
.copie { display: flex; gap: .5rem; align-items: flex-end; margin-bottom: .8rem; }
.copie label, .copie input { flex: 1; margin-bottom: 0; }
.logo-form { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--trait); }
.logo-actuel { background: var(--orange); display: inline-block; padding: 12px 18px; border-radius: 6px; margin-bottom: .8rem; }
.logo-actuel img { display: block; max-height: 60px; width: auto; }

.version ul { margin: 0; padding-left: 1.2rem; }
.version li { margin-bottom: .35rem; }
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }

/* ---------- Connexion et pages publiques ---------- */
.sans-menu { background: var(--foret); min-height: 100vh; }
.connexion { max-width: 440px; margin: 0 auto; padding: 3rem 1rem; }
.connexion-tete { text-align: center; margin-bottom: 1.4rem; color: #dfe7e2; }
.connexion-tete img { max-height: 90px; max-width: 240px; }
.connexion-tete p { margin: .3rem 0 0; }
.connexion .btn { width: 100%; }
.connexion.public { max-width: 520px; }
.sans-menu .contenu { padding: 0; max-width: none; }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .chiffres { grid-template-columns: 1fr 1fr; }
  .atelier, .deux-col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; }
  body.menu-ouvert .side { transform: none; }
  body.menu-ouvert .voile { display: block; position: fixed; inset: 0; background: rgba(20, 30, 26, .45); z-index: 20; }
  .avec-menu .page { margin-left: 0; }
  .btn-menu { display: block; }
  .barre { padding: .8rem 1rem; }
  .barre h1 { font-size: 1.2rem; }
  .qui { display: none; }
  .contenu { padding: 1rem 1rem 3rem; }
  .etapes li { padding-left: 2.6rem; font-size: .82rem; }
  .codes ul { columns: 1; }
}
@media (max-width: 520px) {
  .chiffres { grid-template-columns: 1fr; }
  .filtres input, .filtres select { min-width: 0; width: 100%; }
  .etapes { flex-direction: column; }
  .etapes li, .etapes li:first-child, .etapes li:last-child { border-radius: 0; border-left: 1px solid var(--trait); }
  .etapes li + li { border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
