/* plan_editeur.css — l'éditeur de plan d'un bien (plans.php, assets/plan_editeur.js). Préfixe `pl-`. */

.ui .pl-rangee { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ui .pl-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 0 1 auto; }
.ui .pl-rangee .pl-niveaux { flex: 1 1 360px; }
.ui .pl-props-plan { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.ui .pl-props-plan .pl-nom { font-size: 17px; font-weight: 600; width: 220px; }
.ui .pl-etat-enr { color: var(--encre-2, #6c6963); font-size: 12.5px; }

.ui .pl-etat { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--teinte); color: var(--accent); }
.ui .pl-etat.est-existant { background: #eef2f7; color: #334155; }
.ui .pl-gestes { text-align: right; }
.ui .pl-gestes form { margin: 0 0 0 4px; display: inline-block; vertical-align: middle; }
.ui .pl-nouveau { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ui .pl-nouveau .pl-fond-choix { min-width: 320px; flex: 1 1 320px; }

.ui .pl { display: flex; flex-direction: column; gap: 10px; }
.ui .pl-niveaux { display: flex; flex-wrap: wrap; gap: 6px; }
.ui .pl-niv { border: 1px solid var(--trait-2, #d6d1c6); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.ui .pl-niv.est-actif { background: var(--accent); border-color: var(--accent); color: #fff; }
.ui .pl-niv-plus { border-style: dashed; color: var(--accent); }
.ui .pl-niveaux { position: relative; align-items: center; }
.ui .pl-plein-btn { margin-left: auto; }
.ui .pl-menu { position: absolute; z-index: 30; min-width: 260px; max-height: 60vh; overflow-y: auto; background: #fff; border: 1px solid var(--trait);
  border-radius: 10px; box-shadow: 0 10px 30px #0000001f; padding: 6px; display: flex; flex-direction: column; }
.ui .pl-menu-titre { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-2, #6c6963); padding: 6px 8px 4px; }
.ui .pl-menu-item { text-align: left; background: none; border: 0; border-radius: 7px; padding: 7px 10px; font-size: 13.5px; cursor: pointer; color: var(--encre); }
.ui .pl-menu-item:hover { background: var(--teinte); color: var(--accent); }
.ui .pl-menu-item.est-deja { color: var(--encre-2, #6c6963); }
.ui .pl-menu-sep { height: 1px; background: var(--trait); margin: 4px 0; }

/* Plein écran : l'éditeur couvre la fenêtre, barre de navigation comprise. */
.ui .pl.est-plein { position: fixed; inset: 0; z-index: 60; background: var(--papier, #f4f3ef); padding: 10px 12px; overflow-y: auto; }
.ui .pl.est-plein .pl-corps { height: calc(100vh - 66px); }
html.pl-plein-ouvert { overflow: hidden; }
html.pl-plein-ouvert .flot-haut, html.pl-plein-ouvert #agent-bulle { display: none; }

/* La bibliothèque. */
.ui .pl-tab-liste { width: 100%; }
.ui .pl-tab-liste thead th, .ui .pl-tab-liste td { vertical-align: middle; text-align: left; }
.ui .pl-tab-liste th:nth-child(1), .ui .pl-tab-liste td:nth-child(1) { width: 26%; }
.ui .pl-tab-liste thead th.pl-num, .ui .pl-tab-liste td.pl-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui .pl-tab-liste td.pl-gestes { width: 1%; white-space: nowrap; }
.ui .pl-tab-liste + .pl-nouveau { margin-top: 14px; }

.ui .pl-corps { display: grid; grid-template-columns: 132px minmax(0, 1fr) 280px; gap: 10px; min-height: 520px; height: calc(100vh - 280px); }
.ui .pl-outils { display: flex; flex-direction: column; gap: 4px; }
.ui .pl-outil { text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; cursor: pointer; color: var(--encre); }
.ui .pl-outil:hover:not(:disabled) { background: var(--teinte); }
.ui .pl-outil.est-actif { background: var(--accent); color: #fff; }
.ui .pl-outil:disabled { opacity: .4; cursor: default; }
.ui .pl-outils-sep { height: 1px; background: var(--trait); margin: 6px 0; }

.ui .pl-vue { position: relative; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; background:
  linear-gradient(#0000000a 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, #0000000a 1px, transparent 1px) 0 0 / 24px 24px, #fff; }
.ui .pl-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; user-select: none; }
.ui .pl-aide { position: absolute; left: 10px; bottom: 10px; right: 10px; pointer-events: none; font-size: 12.5px; color: #374151;
  background: #ffffffe6; border: 1px solid var(--trait); border-radius: 8px; padding: 6px 10px; max-width: 640px; }

.ui .pl-props { border: 1px solid var(--trait); border-radius: 12px; background: #fff; padding: 12px 14px; overflow-y: auto; }
.ui .pl-props-titre { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-2, #6c6963); margin: 4px 0 10px; }
.ui .pl-props-titre:not(:first-child) { margin-top: 18px; }
.ui .pl-champ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12.5px; color: var(--encre-2, #6c6963); }
.ui .pl-champ input, .ui .pl-champ select { width: 100%; }
.ui .pl-props .ui-btn { margin: 4px 6px 0 0; }
.ui .pl-alerte { color: #8a5a10; background: #fdf6e7; border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.ui .pl-log { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ui .pl-log input { flex: 1; }
.ui .pl-legende { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.ui .pl-legende li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.ui .pl-legende i { width: 22px; height: 8px; border-radius: 2px; }

/* Le dessin (unités monde : l'épaisseur des traits suit le zoom par vector-effect). */
.ui .pl-svg .pl-mur { stroke: #11182755; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.ui .pl-svg .pl-mur.est-sel { stroke: #2563eb; stroke-width: 2.5; }
.ui .pl-svg .pl-piece { fill: #0f766e14; stroke: #0f766e66; stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; cursor: pointer; }
.ui .pl-svg .pl-piece.est-log { fill: #2563eb12; }
.ui .pl-svg .pl-piece.est-sel { fill: #2563eb26; stroke: #2563eb; stroke-dasharray: none; stroke-width: 2; }
.ui .pl-svg .pl-ouv { cursor: grab; }
.ui .pl-svg .pl-ouv-trou { fill: #fff; stroke: #111827; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ui .pl-svg .pl-ouv-trait { stroke: #111827; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.ui .pl-svg .pl-ouv-arc { fill: none; stroke: #111827; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ui .pl-svg .pl-ouv.est-sel .pl-ouv-trou { stroke: #2563eb; stroke-width: 2.5; }
.ui .pl-svg .pl-poignee { fill: #fff; stroke: #2563eb; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: move; }
.ui .pl-svg .pl-fantome { fill: #2563eb33; stroke: #2563eb; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.ui .pl-svg .pl-fantome-ligne { fill: none; stroke: #2563eb; stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.ui .pl-svg .pl-fantome-ligne.est-caler { stroke: #b45309; stroke-width: 2.5; stroke-dasharray: none; }
.ui .pl-svg .pl-fantome-ligne.est-mesure { stroke: #7c3aed; stroke-dasharray: none; stroke-width: 2; }
.ui .pl-svg .pl-curseur { fill: #2563eb; pointer-events: none; }
.ui .pl-svg .pl-curseur.est-accroche { fill: #16a34a; }
.ui .pl-svg .pl-txt { fill: #111827; pointer-events: none; font-family: inherit; paint-order: stroke; stroke: #fff; stroke-width: 3px; vector-effect: non-scaling-stroke; }
.ui .pl-svg .pl-txt-piece { font-weight: 600; }
.ui .pl-svg .pl-txt-sous { fill: #475569; }
.ui .pl-svg .pl-txt-cote { fill: #1d4ed8; font-weight: 600; }

/* Les métrés. */
.ui .pl-metres { border: 1px solid var(--trait); border-radius: 12px; background: #fff; padding: 12px 14px; }
.ui .pl-metres-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ui .pl-metres-tete .pl-props-titre { margin: 0; }
.ui .pl-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ui .pl-tuile { border: 1px solid var(--trait); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.ui .pl-tuile b { font-size: 17px; }
.ui .pl-tuile span { font-size: 12px; color: var(--encre-2, #6c6963); }
.ui .pl-metres-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.ui .pl-metres-bloc h4 { margin: 0 0 6px; font-size: 13px; }
.ui .pl-tab { border-collapse: collapse; width: 100%; font-size: 13px; }
.ui .pl-tab th, .ui .pl-tab td { padding: 4px 6px; border-bottom: 1px solid var(--trait); text-align: right; }
.ui .pl-tab th:first-child, .ui .pl-tab td:first-child { text-align: left; }
.ui .pl-liste { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }

@media (max-width: 900px) {
  .ui .pl-corps { grid-template-columns: 1fr; height: auto; }
  .ui .pl-outils { flex-direction: row; flex-wrap: wrap; }
  .ui .pl-vue { height: 60vh; }
}
