[hidden] { display: none !important; }
/* AppliWeb – réseau Perdrix rouge. Mise en page inspirée des fiches cartes du réseau. */
:root {
  --fond: #f4f5f2;
  --papier: #ffffff;
  --encre: #1f2328;
  --discret: #5f6670;
  --trait: #9aa3ab;
  --accent: #1d5fa8;
  --rouge: #b42318;
  --rouge-fond: #fdecea;
  --orange: #9a5b00;
  --orange-fond: #fff4dc;
  --vert: #166534;
  --vert-fond: #e7f6ec;
  --repris: #8a8f96;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre);
       font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.25rem; margin: 0; }
.discret { color: var(--discret); font-size: .85em; font-weight: normal; }

.bandeau { background: #7a1f1f; color: #fff; padding: 10px 16px; display: flex; gap: 12px; align-items: baseline; }
.bandeau .marque { color: #fff; font-weight: 600; text-decoration: none; }
.bandeau .sous-titre { opacity: .8; font-size: .9em; }

/* ---------- accueil ---------- */
.carte-blanche { background: var(--papier); border: 1px solid var(--trait); padding: 20px; max-width: 720px; }
.choix { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.choix label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.choix select { min-width: 260px; }
.liste-circuits { list-style: none; padding: 0; }
.liste-circuits li { padding: 6px 0; border-bottom: 1px solid #e4e6e8; }

/* ---------- fiche ---------- */
.titre-fiche { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rappel { color: var(--rouge); margin: 4px 0 12px; }
.statut { padding: 2px 10px; border-radius: 12px; font-size: .85em; background: #e4e6e8; }
.statut.brouillon { background: var(--orange-fond); color: var(--orange); }
.statut.validee { background: var(--vert-fond); color: var(--vert); }

.fiche { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(460px, 560px); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .fiche { grid-template-columns: 1fr; } }
.carte-circuit { position: sticky; top: 8px; }
#carte { height: min(78vh, 720px); border: 1px solid var(--trait); background: #dde3e7; }
.etiquette-point { background: rgba(255, 255, 255, .85); border: none; box-shadow: none; padding: 0 4px;
                   font-weight: 600; font-size: 12px; color: #7a3e00; }
.etiquette-point::before { display: none; }

.saisie { background: var(--papier); border: 1px solid var(--encre); padding: 12px; }
.entete-fiche { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; border: 1px solid var(--encre); padding: 10px; }
.entete-fiche label, .meteo label, .saisie > details label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.entete-fiche .large, .saisie .large { grid-column: 1 / -1; }
.repetition { border: none; margin: 0; padding: 0; display: flex; gap: 12px; align-items: end; }
.repetition legend { font-weight: 600; padding: 0; margin-bottom: 3px; }
.repetition label { flex-direction: row; font-weight: normal; gap: 4px; }

input, select, textarea { font: inherit; padding: 5px 7px; border: 1px solid var(--trait); border-radius: 3px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
input.heure { width: 6.5em; font-variant-numeric: tabular-nums; }
.erreur:not(.msg) { border-color: var(--rouge) !important; background: var(--rouge-fond); }
.avertissement:not(.msg) { border-color: var(--orange) !important; background: var(--orange-fond); }
select.repris { color: var(--repris); font-style: italic; }

.info { margin: 10px 0 0; padding: 6px 10px; background: #eef4fb; border-left: 3px solid var(--accent); font-size: .9em; }

table.points { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.points th, table.points td { border: 1px solid var(--encre); padding: 3px 5px; text-align: left; }
table.points thead th { background: #f0f1ef; font-size: .9em; }
table.points input.nb { width: 4em; text-align: center; }
table.points select.ifm { width: 100%; }
table.points input.cause { width: 100%; margin-top: 3px; font-size: .85em; }
tr.active { background: #eef4fb; }
.nom-point { background: none; border: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--encre); }
.nom-point:hover { text-decoration: underline; }
.outils-tableau { display: flex; gap: 12px; align-items: center; margin: 8px 0; flex-wrap: wrap; }

details { margin-top: 10px; border: 1px solid var(--trait); padding: 6px 10px; }
summary { cursor: pointer; font-weight: 600; }
.meteo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; margin: 10px 0; }
@media (max-width: 600px) { .meteo, .entete-fiche { grid-template-columns: 1fr; } }
textarea { width: 100%; }

.msg { margin-top: 10px; padding: 8px 12px; border-left: 4px solid; }
.msg ul { margin: 4px 0 0; padding-left: 18px; }
.msg.erreur { background: var(--rouge-fond); border-color: var(--rouge); }
.msg.avertissement { background: var(--orange-fond); border-color: var(--orange); }
.msg.succes { background: var(--vert-fond); border-color: var(--vert); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
button { font: inherit; padding: 7px 14px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.secondaire { background: #fff; color: var(--accent); }
button.valider { background: var(--vert); border-color: var(--vert); }
button.danger { background: #fff; color: var(--rouge); border-color: var(--rouge); }

/* ---------- navigation et annonces ---------- */
.bandeau nav { margin-left: auto; display: flex; gap: 16px; }
.bandeau nav a { color: #fff; text-decoration: none; opacity: .9; }
.bandeau nav a:hover { text-decoration: underline; opacity: 1; }
#annonces { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; max-width: 420px; }
.annonce { padding: 10px 12px; border-left: 4px solid; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.annonce.succes { border-color: var(--vert); }
.annonce.erreur { border-color: var(--rouge); }
.annonce button { background: none; border: none; color: var(--discret); padding: 0 4px; float: right; font-size: 1.1em; }

/* ---------- résultats ---------- */
.large-bloc { max-width: none; margin-bottom: 16px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
fieldset.annees, fieldset.modele { border: 1px solid var(--trait); padding: 6px 10px; margin: 0; }
fieldset.annees legend, fieldset.modele legend { font-weight: 600; }
#annees { display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 520px; }
#annees label { font-weight: normal; flex-direction: row; gap: 4px; }
fieldset.modele label { display: flex; flex-direction: row; gap: 8px; font-weight: normal; margin: 4px 0; max-width: 620px; }
label.case { flex-direction: row !important; align-items: center; gap: 6px; font-weight: normal !important; }
#demande button[type=submit] { align-self: end; }
table.tableau { border-collapse: collapse; width: 100%; }
table.tableau th, table.tableau td { border-bottom: 1px solid #e0e3e6; padding: 5px 8px; text-align: left; vertical-align: top; }
table.tableau thead th { background: #f0f1ef; border-bottom: 1px solid var(--trait); }
td.nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.ligne-site td { background: #eef4fb; }
tr.non-fiable td { color: var(--discret); }
tr.choisi td { background: #fffbe6; }
td.etat.termine { color: var(--vert); }
td.etat.echec { color: var(--rouge); }

ol.etapes { margin: 8px 0 14px; padding-left: 22px; }
#formulaire-import { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- sites hors réseau ---------- */
a.bouton { display: inline-block; padding: 7px 14px; border-radius: 4px; background: var(--accent); color: #fff; text-decoration: none; }
.saisie h2 { margin: 16px 0 8px; }
.ligne-secteur { display: flex; gap: 6px; margin-bottom: 6px; }
.ligne-secteur input { flex: 1; }
fieldset.circuit-hr { border: 1px solid var(--trait); margin: 0 0 12px; padding: 8px 10px; }
fieldset.circuit-hr legend { font-weight: 600; }
fieldset.circuit-hr input.plat, fieldset.circuit-hr input.plon { width: 7.5em; }
fieldset.circuit-hr input.pnom { width: 7em; }
td.outils-point { white-space: nowrap; }
td.outils-point button, .ligne-secteur button { padding: 3px 8px; }
body.mode-placement #carte { cursor: crosshair; outline: 3px solid var(--accent); }

a.bouton.secondaire { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
#bloc-qgis input { display: block; margin-top: 6px; }

/* ---------- comptes ---------- */
.bandeau .qui { opacity: .75; font-size: .9em; border-left: 1px solid rgba(255,255,255,.4); padding-left: 12px; }
.formulaire-court { max-width: 560px; }
.formulaire-court form { display: flex; flex-direction: column; gap: 10px; }
.formulaire-court label { display: flex; flex-direction: column; gap: 3px; font-weight: 600; }
.info.rgpd { font-size: .9em; line-height: 1.5; }

/* ---------- EC / IKA ---------- */
fieldset.protocoles { border: 1px solid var(--trait); padding: 8px 12px; margin: 12px 0; }
fieldset.protocoles legend { font-weight: 600; }
fieldset.protocoles label { display: block; margin: 3px 0; }
.saisie-large { max-width: none; }
.entete-ec { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.entete-ec .info { grid-column: span 2; align-self: end; }
@media (max-width: 900px) { .entete-ec { grid-template-columns: 1fr 1fr; } }
.defilement { overflow-x: auto; }
table.observations th, table.observations td { white-space: nowrap; }
table.observations thead th { white-space: normal; font-size: .85em; vertical-align: bottom; }
table.observations input.c-nb { width: 4em; text-align: center; }
table.observations input.c-heure { width: 5.5em; }
table.observations input.c-liste { width: 12em; }
table.observations select { max-width: 11em; }
table.observations tfoot td, table.observations tfoot th { font-weight: 600; background: #f0f1ef; }
th.num { text-align: center; color: var(--discret); }
#repetitions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#repetitions label { flex-direction: row; font-weight: normal; gap: 4px; }
table.observations select.c-classe { width: 7.5em; }

/* ---------- carte des observations EC / IKA ---------- */
.carte-observations { margin: 12px 0; }
.carte-observations #carte { height: 380px; }
td.position { text-align: center; }
td.position button { padding: 2px 6px; }
td.position button.place { background: var(--vert-fond); border-color: var(--vert); }
select.deduit { background: var(--vert-fond); }
.repere-obs { background: #1d5fa8; color: #fff; border-radius: 50%; text-align: center; font: 600 12px/22px sans-serif;
              border: 2px solid #fff; box-shadow: 0 0 3px rgba(0,0,0,.5); }
table.observations input.c-texte { width: 9em; }

/* ---------- mode essai ---------- */
.bandeau-essai { background: #ffd84d; color: #3a2d00; padding: 8px 16px; border-bottom: 2px solid #b38f00; display: flex;
                 gap: 12px; align-items: center; flex-wrap: wrap; }
.bandeau-essai button { margin-left: auto; }
.bouton-mode { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); padding: 2px 10px; font-size: .9em; cursor: pointer; }
.bouton-mode.essai-actif { background: #ffd84d; color: #3a2d00; border-color: #ffd84d; font-weight: 600; }
.statut.essai { background: #ffd84d; color: #3a2d00; }
.bouton-garder { margin-left: 8px; }
label.desactive { color: var(--discret); cursor: not-allowed; }
/* ---------- journal ---------- */
.journal tr.cliquable { cursor: pointer; }
.journal tr.cliquable:hover { background: #eef3f9; }
.journal tr.delete td:nth-child(3) { color: var(--rouge); font-weight: 600; }
.journal tr.insert td:nth-child(3) { color: var(--vert); }
.journal table.detail { font-size: .9em; margin: 4px 0 8px 24px; }
.journal table.detail td { max-width: 480px; overflow-wrap: anywhere; }
