:root {
  --fond: #f4f6f9; --carte: #ffffff; --texte: #1c2433; --doux: #5b6576; --bord: #dde2ea;
  --marine: #1f2a44; --accent: #1f6feb; --accent-doux: #e8f0fe; --vert: #1b8a5a; --ambre: #b45309;
  --rouge: #c0392b; --violet: #6d28d9; --cyan: #0e7490; --ombre: 0 1px 3px rgba(20, 30, 50, .12);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 14px; color: var(--texte);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--fond); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 600; }

header .site.camping { min-width: 0; }                        /* le projet ouvert, comme le camping dans l'admin */
header .site.camping .nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien { background: none; border: 0; color: inherit; text-decoration: underline; padding: 0; }

body { display: flex; flex-direction: column; }            /* bandeau de la plateforme (hauteur de l'admin), puis la page */
.corps { display: flex; flex: 1; min-height: 0; }
.panneau { width: 380px; min-width: 300px; background: var(--carte); border-right: 1px solid var(--bord); overflow-y: auto; display: flex; flex-direction: column; }
.zone-carte { flex: 1; position: relative; min-width: 0; }
#carte { position: absolute; inset: 0; }

.bloc { padding: 14px 16px; border-bottom: 1px solid var(--bord); }
.bloc h2 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bloc h3 { font-size: 13px; color: var(--doux); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 12px; font-weight: 600; text-decoration: none; }
.btn.second { background: var(--accent-doux); color: var(--accent); }
.btn.danger { background: #fdecea; color: var(--rouge); }
.btn.petit { padding: 5px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.ligne-btn { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

label.champ { display: block; margin-bottom: 9px; font-size: 12px; color: var(--doux); }
label.champ input, label.champ select, label.champ textarea { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; border: 1px solid var(--bord); border-radius: 6px; background: #fff; font-size: 14px; }
label.champ textarea { min-height: 60px; resize: vertical; }
label.case { display: flex; gap: 8px; align-items: center; margin: 6px 0 9px; font-size: 13px; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.aide { font-size: 12px; color: var(--doux); margin: 4px 0 8px; line-height: 1.4; }

.onglets { display: flex; border-bottom: 1px solid var(--bord); position: sticky; top: 0; background: var(--carte); z-index: 2; }
.onglets button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 4px; font-size: 13px; color: var(--doux); }
.onglets button.actif { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.liste-projets { list-style: none; margin: 0; padding: 0; }
.liste-projets li { padding: 10px 16px; border-bottom: 1px solid var(--bord); cursor: pointer; }
.liste-projets li:hover { background: var(--accent-doux); }
.liste-projets .nom { font-weight: 600; }
.liste-projets .meta { font-size: 12px; color: var(--doux); margin-top: 2px; }
.vide { color: var(--doux); padding: 16px; text-align: center; }

.equip { list-style: none; margin: 0; padding: 0; }
.equip li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.equip li:hover, .equip li.sel { background: var(--accent-doux); }
.equip .pastille { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.equip .nom-eq { white-space: nowrap; font-weight: 600; }
.equip .sec { color: var(--doux); margin-left: auto; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: right; }

table.nomenc { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.nomenc th { text-align: left; color: var(--doux); font-weight: 600; padding: 4px; border-bottom: 1px solid var(--bord); }
table.nomenc td { padding: 5px 4px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
table.nomenc td.n { text-align: right; white-space: nowrap; }
table.nomenc tr.cat td { background: #f6f8fb; font-weight: 600; color: var(--doux); }
.total { display: flex; justify-content: space-between; font-weight: 700; margin-top: 10px; font-size: 15px; }
.alerte { font-size: 12.5px; padding: 6px 8px; border-radius: 6px; margin: 4px 0; cursor: pointer; }
.alerte.erreur { background: #fdecea; color: #8e2a1f; }
.alerte.attention { background: #fff4e0; color: #7a4a05; }
.alerte.info { background: #eef3fb; color: #2b4a7a; }
.bilan { font-size: 12px; color: var(--doux); background: #f6f8fb; border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.synthese { padding: 10px 12px; border-radius: 8px; font-weight: 600; margin-bottom: 8px; }
.synthese.bonne { background: #e6f4ea; color: #145c38; }
.synthese.correcte { background: #eef3fb; color: #2b4a7a; }
.synthese.renforcer { background: #f3f4f6; color: #3f4654; }

.recherche { position: absolute; top: 10px; left: 56px; z-index: 800; width: min(440px, calc(100% - 120px)); }
.recherche input { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--bord); box-shadow: var(--ombre); background: #fff; }
.resultats { list-style: none; margin: 4px 0 0; padding: 4px 0; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px rgba(20, 30, 50, .18); max-height: 320px; overflow-y: auto; }
.resultats li { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.resultats li:hover, .resultats li.act { background: var(--accent-doux); }
.resultats .src { color: var(--doux); font-size: 11px; margin-left: 6px; }

.outils { position: absolute; top: 58px; left: 56px; z-index: 800; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; background: #fff; border-radius: 8px; padding: 4px; box-shadow: var(--ombre); max-width: calc(100% - 120px); }
.outils button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 6px 9px; border-radius: 6px; font-size: 13px; }
.outils button:hover { background: var(--accent-doux); }
.outils button.actif { background: var(--accent); color: #fff; }
.outils select { border: 1px solid var(--bord); border-radius: 6px; padding: 5px 6px; font-size: 13px; background: #fff; }
.afficher { position: relative; font-size: 13px; }
.afficher summary { cursor: pointer; padding: 6px 9px; border-radius: 6px; list-style: none; }
.afficher summary::after { content: " ▾"; }
.afficher summary:hover, .afficher[open] summary { background: var(--accent-doux); }
.afficher > div { position: absolute; top: 34px; left: 0; background: #fff; border-radius: 8px; box-shadow: var(--ombre); padding: 8px 12px; min-width: 230px; z-index: 900; }
.afficher label { display: flex; gap: 7px; align-items: center; padding: 3px 0; white-space: nowrap; }
.afficher .aide { margin: 6px 0 0; font-size: 11.5px; color: var(--doux); white-space: normal; }
.outils .sep { width: 1px; height: 22px; background: var(--bord); margin: 0 2px; }
.ic { width: 14px; height: 14px; display: inline-block; border-radius: 50%; }
.ic-borne { background: var(--vert); }
.ic-coffret { background: var(--marine); border-radius: 2px; }
.ic-switch { background: var(--cyan); border-radius: 2px; height: 9px; }
.ic-onduleur { background: var(--rouge); border-radius: 2px; width: 9px; }
.ic-onde { background: conic-gradient(#2ea043, #fdd835, #f57c00, #d32f2f, #2ea043); }

.consigne { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 800; background: var(--marine); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--ombre); display: flex; gap: 12px; align-items: center; }
.consigne button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 6px; padding: 5px 9px; }
.legende { position: absolute; bottom: 24px; right: 10px; z-index: 800; background: #fff; border-radius: 8px; padding: 8px 10px; box-shadow: var(--ombre); font-size: 12px; width: 300px; max-width: calc(100% - 20px); }
.legende .l { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.legende .c { width: 14px; height: 10px; border-radius: 2px; }
.legende .bandes { display: flex; gap: 4px; margin-bottom: 6px; }
.legende .bandes button { flex: 1; border: 1px solid var(--bord); background: #fff; border-radius: 5px; padding: 3px 4px; font-size: 12px; }
.legende .bandes button.actif { background: var(--marine); color: #fff; border-color: var(--marine); }
.legende input[type=range] { width: 100%; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--marine); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 2000; box-shadow: var(--ombre); max-width: 90vw; }
.toast.erreur { background: var(--rouge); }

.mk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.mk.carre { border-radius: 4px; }
.mk.sel { outline: 3px solid #ffd33d; outline-offset: 1px; }
.mk-nom { background: rgba(31, 42, 68, .85); color: #fff; border: 0; border-radius: 4px; padding: 1px 5px; font-size: 11px; box-shadow: none; }
.mk-nom::before { display: none; }
.leaflet-container.placer { cursor: crosshair; }

/* connexion : page claire comme l'admin, la marque au-dessus du bouton (1.3.4) */
.page-connexion { display: grid; place-items: center; min-height: 100%; background: var(--bci-bg-alt); }
.carte-connexion { background: #fff; padding: 32px 30px 28px; border-radius: 12px; width: min(480px, 94vw);
  border: 1px solid var(--bci-border); box-shadow: 0 10px 30px rgba(44, 52, 87, .10); }
.carte-connexion .marque { max-width: 100%; }
.carte-connexion .marque { --mq-l: min(220px, 48vw); }
.carte-connexion .btn { margin-bottom: 14px; }
.carte-connexion label { display: block; font-size: 13px; color: var(--doux); margin-bottom: 10px; }
.carte-connexion input { display: block; width: 100%; padding: 9px; border: 1px solid var(--bord); border-radius: 6px; margin-top: 4px; }
.carte-connexion .btn { width: 100%; margin-top: 6px; }
.erreur { color: var(--rouge); }

@media (max-width: 760px) {
  .corps { flex-direction: column-reverse; }
  .panneau { width: 100%; min-width: 0; height: 45%; border-right: 0; border-top: 1px solid var(--bord); }
  .zone-carte { height: 55%; flex: none; }
  .recherche { left: 50px; width: calc(100% - 110px); }
  .outils { top: 54px; left: 50px; max-width: calc(100% - 60px); }
}

.mk.exist { opacity: .8; border-style: dashed; }
.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #eef1f5; color: var(--doux); margin-left: 4px; }
.badge.exist { background: #e8eefc; color: #2b4a7a; }
.badge.depose { background: #fdecea; color: #a4281b; }
.mk.retire { background: #9aa0a6 !important; opacity: .85; border-style: dashed; position: relative; }
.mk.retire::after { content: "×"; position: absolute; inset: -4px 0 0 0; color: #c0392b; font-size: 22px; font-weight: 700; line-height: 20px; text-align: center; }
.mk.futur { opacity: .3; }
.legende .vues { display: flex; gap: 4px; margin-bottom: 6px; }
.legende .vues button { flex: 1; border: 1px solid var(--bord); background: #fff; border-radius: 5px; padding: 3px 4px; font-size: 12px; }
.legende .vues button.actif { background: #0e7490; color: #fff; border-color: #0e7490; }
.legende .compare { font-size: 12px; margin: 4px 0 6px; padding: 5px 8px; border-radius: 6px; background: #f3f6fa; }
table.nomenc td.m { text-align: right; white-space: nowrap; color: var(--vert); }
table.nomenc td.m.neg { color: var(--rouge); }
.totaux { margin-top: 10px; border-top: 2px solid var(--bord); padding-top: 8px; font-size: 13px; }
.totaux div { display: flex; justify-content: space-between; margin: 3px 0; }
.totaux .fort { font-weight: 700; font-size: 15px; }
.totaux .marge { color: var(--vert); font-weight: 700; }
.cat-onglets { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.cat-onglets button { border: 1px solid var(--bord); background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 12px; }
.cat-onglets button.actif { background: var(--marine); color: #fff; border-color: var(--marine); }
tr.inactif td { opacity: .5; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: var(--accent-doux); }
.ajout-ligne { display: grid; grid-template-columns: 1fr 70px auto; gap: 6px; align-items: end; margin-top: 8px; }
.ajout-ligne select, .ajout-ligne input { padding: 6px; border: 1px solid var(--bord); border-radius: 6px; width: 100%; }
.legende .types { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.legende .types button { flex: 1 1 auto; border: 1px solid var(--bord); background: #fff; border-radius: 5px; padding: 3px 5px; font-size: 12px; }
.legende .types button.actif { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.legende details.details-couv { color: var(--doux); margin-top: 4px; }
.legende details.details-couv summary { cursor: pointer; }
.etiq-canal { display: inline-block; background: #1f2a44; color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 3px; line-height: 14px; white-space: nowrap; }
.mk.prop { background: #fff !important; color: #7c3aed; border: 2px dashed #7c3aed; font-weight: 700; cursor: pointer; }
.mk.prop.ecartee { opacity: .35; border-color: #9aa0a6; color: #9aa0a6; }
.popup-zone .champ { margin: 6px 0; }
.popup-zone .champ input, .popup-zone .champ select { width: 100%; }
.consigne select { margin-left: 6px; font-size: 12px; padding: 2px 4px; }
.plan-cale { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; max-width: none !important; max-height: none !important; image-rendering: auto; }
.plans li { display: block !important; }
.ctrl-plan { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.ctrl-plan select { font-size: 12px; }
.vue3d { position: absolute; inset: 0; z-index: 1500; background: #dfe9f3; display: flex; flex-direction: column; }
.vue3d canvas { display: block; flex: 1; }
.vue3d-barre { display: flex; align-items: center; gap: 12px; padding: 6px 10px; background: #1f2a44; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; }
.vue3d-barre button { margin-left: auto; background: #fff; color: #1f2a44; border: 0; border-radius: 5px; padding: 4px 10px; font-weight: 600; cursor: pointer; }
.vue3d-barre label { display: flex; align-items: center; gap: 4px; }
.vue3d-barre .aide3d { opacity: .7; font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
