/* ==========================================================================
   nevaone-plan.css — Éditeur de plan du simulateur d'alarme.
   Complète css/nevaone-simulateur.css.
   ========================================================================== */

.nvplan { margin-top: 22px; }

.nvplan__intro {
  font-size: .88rem;
  color: #6b7280;
  line-height: 1.65;
  margin: 0 0 16px;
}

/* ---------- Dépôt du fichier ---------- */

.nvplan-depot {
  display: block;
  border: 2px dashed #cfd5df;
  border-radius: 12px;
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
  background: #fafbfc;
}
.nvplan-depot:hover,
.nvplan-depot.is-survol { border-color: #4ea272; background: #f3f9f5; }
/* Une fois le plan chargé, le dépôt se fait discret : il ne sert plus qu'à
   changer de plan, et il ne doit pas concurrencer la palette. */
.nvplan-depot.is-charge { padding: 13px 18px; border-style: solid; background: #fff; }
.nvplan-depot.is-charge .nvplan-depot__gros { display: none; }

.nvplan-depot input[type="file"] { position: absolute; left: -9999px; }
.nvplan-depot__gros { font-size: 1.6rem; color: #4ea272; display: block; margin-bottom: 8px; }
.nvplan-depot strong { display: block; font-size: .95rem; margin-bottom: 4px; }
.nvplan-depot span { font-size: .82rem; color: #6b7280; }

/* ---------- État ---------- */

.nvplan-etat {
  font-size: .85rem;
  line-height: 1.55;
  margin: 12px 0;
  padding: 10px 13px;
  border-radius: 9px;
  background: #f1f3f7;
  color: #4a5060;
}
.nvplan-etat.is-ok { background: rgba(78, 162, 114, .12); color: #2f7a52; }
.nvplan-etat.is-ko { background: rgba(192, 57, 43, .1); color: #a93226; }
.nvplan-etat:empty { display: none; }

/* ---------- Pages d'un PDF ---------- */

.nvplan-pages { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.nvplan-pages > span { font-size: .82rem; color: #6b7280; margin-right: 4px; }
.nvplan-page {
  min-width: 30px;
  padding: 5px 9px;
  border: 1px solid #dfe3ea;
  border-radius: 7px;
  background: #fff;
  font-size: .82rem;
  cursor: pointer;
}
.nvplan-page.on { background: #4ea272; border-color: #4ea272; color: #fff; font-weight: 600; }

/* ---------- Plan et marqueurs ---------- */

.nvplan-travail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .nvplan-travail { grid-template-columns: 1fr; } }

/* ---------- La lucarne ----------
 * Hauteur fixe plutôt que proportion du plan : un plan très allongé occuperait
 * sinon trois écrans de haut, et l'on perdrait la palette de vue en le
 * parcourant. Le plan se déplace dans la fenêtre, la fenêtre ne bouge pas.
 */
.nvplan-vue {
  position: relative;
  height: 62vh;
  min-height: 340px;
  max-height: 680px;
  border: 1px solid #e6e8ee;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f6f8;
  /* Sans cela, un glissement à deux doigts fait défiler la page au lieu de
     déplacer le plan. */
  touch-action: none;
  cursor: grab;
}
.nvplan-vue.is-glisse { cursor: grabbing; }
.nvplan-vue.is-arme { cursor: crosshair; }

.nvplan-monde {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  line-height: 0;
  box-shadow: 0 2px 14px rgba(15, 20, 30, .16);
}
.nvplan-monde canvas { display: block; }

/* La couche des repères se superpose exactement à la toile. */
.nvplan-couche { position: absolute; inset: 0; }

/* ---------- Commandes d'affichage ---------- */

.nvplan-outils {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 10px rgba(15, 20, 30, .2);
  backdrop-filter: blur(4px);
}
.nvplan-outils button {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #14161c;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.nvplan-outils button:hover { background: #eef1f5; }
.nvplan-outils__txt { font-size: .8rem !important; font-weight: 600; }
.nvplan-outils span {
  min-width: 46px;
  text-align: center;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  color: #6b7280;
}

/* Annuler se place à l'opposé des commandes de zoom : c'est un geste de
   correction, pas de navigation, et les confondre coûte un repère. */
.nvplan-annuler {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 13px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 10px rgba(15, 20, 30, .2);
  font-size: .82rem;
  font-weight: 600;
  color: #14161c;
  cursor: pointer;
}
.nvplan-annuler:hover { background: #fff; color: #a93226; }

/* La consigne du moment, en haut de la lucarne : elle dit quoi faire
   maintenant, et rien d'autre. */
.nvplan-aide {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(20, 22, 28, .82);
  color: #fff;
  font-size: .82rem;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  transition: opacity .25s ease;
}
.nvplan-aide:empty { opacity: 0; }

/* ---------- Recherche dans la palette ---------- */

.nvplan-chercher { position: relative; display: block; }
.nvplan-chercher__ic {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b93a1;
  line-height: 0;
}
.nvplan-chercher input {
  width: 100%;
  padding: 9px 12px 9px 33px;
  border: 1px solid #e6e8ee;
  border-radius: 9px;
  font-size: .86rem;
  background: #fff;
}
.nvplan-chercher input:focus { outline: 2px solid rgba(78, 162, 114, .35); border-color: #4ea272; }
.nvplan-fam.is-vide { display: none; }
.nvplan-eq.is-vide { display: none; }

.nvplan-mk {
  position: absolute;
  /* L'échelle inverse du zoom : le repère garde sa taille à l'écran. Voir
     appliquer() dans nevaone-plan.js. */
  transform: translate(-50%, -50%) scale(var(--nvpl-inv, 1));
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #4ea272;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: grab;
  padding: 0;
  box-shadow: 0 2px 8px rgba(15, 20, 30, .3);
  /* Sans cela, le navigateur interprète le glissement comme un défilement de
     la page et le marqueur ne suit pas le doigt. */
  touch-action: none;
  transition: box-shadow .15s ease, transform .12s ease;
}
.nvplan-mk:hover { box-shadow: 0 4px 14px rgba(15, 20, 30, .4); }
.nvplan-mk.is-glisse { cursor: grabbing;
  transform: translate(-50%, -50%) scale(calc(var(--nvpl-inv, 1) * 1.12)); }

/* Le numéro se pose en pastille sur le bord : dans le rond, il masquerait le
   pictogramme qui dit de quel équipement il s'agit. */
.nvplan-mk__n {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 100px;
  background: #14161c;
  color: #fff;
  font-size: .64rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ---------- Palette ---------- */

.nvplan-cote { display: flex; flex-direction: column; gap: 14px; }

.nvplan-fam h4 {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8b93a1;
  margin: 0 0 7px;
}
.nvplan-fam + .nvplan-fam { margin-top: 12px; }
.nvplan-fam__g { display: grid; gap: 6px; }

.nvplan-eq {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 2px 10px;
  align-items: center;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid #e6e8ee;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.nvplan-eq svg { grid-row: span 2; color: #4ea272; }
.nvplan-eq__n { font-size: .86rem; font-weight: 600; color: #14161c; }
.nvplan-eq__r { font-size: .76rem; color: #8b93a1; line-height: 1.4; }
.nvplan-eq:hover { border-color: #b9c2cf; background: #fafbfc; }
.nvplan-eq.on { border-color: #4ea272; background: #f1f8f4; box-shadow: 0 0 0 3px rgba(78, 162, 114, .13); }

/* ---------- Détail d'un équipement ---------- */

.nvplan-detail {
  border: 1px solid #e6e8ee;
  border-left: 3px solid #4ea272;
  border-radius: 10px;
  padding: 15px 17px;
  background: #fff;
  font-size: .86rem;
  line-height: 1.65;
  color: #4a5060;
}
.nvplan-detail__tete { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 10px; }
.nvplan-detail__ic { color: #4ea272; flex: none; }
.nvplan-detail__img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.nvplan-detail h4 { font-size: .96rem; font-weight: 700; color: #14161c; margin: 0 0 2px; }
.nvplan-detail h4 em { font-style: normal; font-weight: 500; font-size: .8rem; color: #8b93a1; }
.nvplan-detail__r { margin: 0; font-size: .82rem; color: #6b7280; }
.nvplan-detail p { margin: 0 0 9px; }
.nvplan-detail__pose { font-size: .82rem; color: #6b7280; }

.nvplan-suppr {
  margin-top: 4px;
  padding: 6px 13px;
  border: 1px solid rgba(192, 57, 43, .3);
  border-radius: 100px;
  background: rgba(192, 57, 43, .08);
  color: #a93226;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.nvplan-suppr:hover { background: rgba(192, 57, 43, .16); }

/* ---------- Récapitulatif ---------- */

.nvplan-recap { border: 1px solid #e6e8ee; border-radius: 10px; padding: 14px 16px; background: #fafbfc; }
.nvplan-recap h4 { font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #8b93a1; margin: 0 0 9px; }

.nvplan-liste { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.nvplan-liste li { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.nvplan-liste li svg { color: #4ea272; flex: none; }
.nvplan-liste li span { flex: 1; min-width: 0; }
.nvplan-liste li strong { font-variant-numeric: tabular-nums; }
.nvplan-liste__vide { color: #8b93a1; font-size: .82rem; }
.nvplan-liste__tot { border-top: 1px solid #e6e8ee; margin-top: 5px; padding-top: 8px; font-weight: 700; }

.nvplan-vider {
  margin-top: 11px;
  padding: 6px 13px;
  border: 1px solid #dfe3ea;
  border-radius: 100px;
  background: #fff;
  font-size: .8rem;
  color: #6b7280;
  cursor: pointer;
}
.nvplan-vider:hover { border-color: #b9c2cf; color: #14161c; }
