/* Data Ore Perimeter (perimetre.js) : hôte data-ecran="perimetre". Jetons et classes d'app.css seulement (docs/INTERFACE.md,
   sections 8 et 9). En-tête, bandeau de messages, grille de grille.js en lecture seule ; boîte d'import ; panneau Versions. */

.metier-hote[data-ecran="perimetre"] { overflow: hidden; }
.per-ecran { flex: 1 1 0; min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--grid-bg); }
.per-tete { flex: none; overflow: hidden; }
.per-tete h2 { flex: 0 1 auto; }
.per-tete .puce { flex: none; }
.panneau-tete.per-tete .note { flex: 0 1 auto; margin-left: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.per-bandeau { flex: none; display: grid; gap: var(--e2); padding: var(--e2) var(--e4); background: var(--bg-1); border-bottom: 1px solid var(--line); }
.per-bandeau[hidden] { display: none; }
.per-ligne-msg { display: flex; align-items: center; gap: var(--e3); flex-wrap: wrap; }
.per-ligne-msg > .message { flex: 1 1 320px; }
.per-corps { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.per-corps > * { flex: 1 1 0; min-height: 0; }

/* Pied : lignes chargées sur le total (lecture par pages) et lecture de la page suivante. */
.per-pied { flex: none; display: flex; align-items: center; gap: var(--e3); min-width: 0; padding: var(--e1) var(--e4); background: var(--bg-1); border-top: 1px solid var(--line); font-size: var(--fs-s); }
.per-pied[hidden], .per-pied .btn[hidden] { display: none; }
.per-pied .btn { flex: none; }

/* Accès : verrou (lecture seule) ou import autorisé ; forme et texte en plus de la couleur. */
.per-acces { flex: none; display: inline-flex; align-items: center; gap: var(--e2); height: 18px; padding: 0 var(--e3); border: 1px solid currentColor; border-radius: var(--r1); font-size: var(--fs-s); font-weight: 600; white-space: nowrap; }
.per-acces .ic { flex: none; }
.per-verrou { color: var(--warn); background: var(--warn-bg); border-width: 2px; }
.per-autorise { color: var(--ok); background: var(--ok-bg); border-style: dashed; }
.d-titre .per-acces { margin-left: auto; height: 16px; font-size: var(--fs-xs); }

/* Colonne de statut de la grille : ligne verrouillée (« L », cadre épais) au lieu d'un statut du circuit. */
.per-ecran .grl-pastille[data-st="verrouille"] { font-size: 0; color: var(--warn); border-width: 2px; border-radius: 0; }
.per-ecran .grl-pastille[data-st="verrouille"]::before { content: "L"; font: 700 var(--fs-xxs)/1 var(--font); }

/* Boîte d'import en quatre étapes */
.per-dlg .dlg-corps { gap: var(--e3); }
.per-dlg section { display: grid; gap: var(--e3); min-width: 0; }
.per-dlg section[hidden] { display: none; }
.per-etapes { display: flex; flex-wrap: wrap; gap: var(--e2); margin: 0; padding: 0; list-style: none; font-size: var(--fs-s); color: var(--ink-2); }
.per-etapes li { padding: 1px var(--e3); border: 1px solid var(--line); border-radius: var(--r1); }
.per-etapes li.fait { border-style: dashed; }
.per-etapes li[aria-current="step"] { color: var(--ink); border-color: var(--line-fort); background: var(--bg-2); font-weight: 600; }
.per-dlg .coche { display: flex; align-items: flex-start; gap: var(--e3); color: var(--ink); font-size: var(--fs-m); line-height: 1.45; }
.per-dlg .coche[hidden] { display: none; }
.per-dlg .coche input { flex: none; margin-top: 2px; }
.per-colle { min-height: 96px; resize: vertical; font-family: var(--mono); font-size: var(--fs-s); white-space: pre; }
.per-h3 { margin: 0; font-size: var(--fs-m); font-weight: 600; }
.per-h4 { margin: var(--e2) 0 0; font-size: var(--fs-s); font-weight: 600; }
.per-table-defile { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r1); }
.per-corresp th:first-child { width: 30%; }
.per-corresp td:nth-child(2) { width: 30%; color: var(--ink-2); }
.per-corresp .champ { width: 100%; }
.per-alertes { table-layout: auto; }
.per-alertes td { white-space: normal; height: auto; padding-top: 2px; padding-bottom: 2px; line-height: 1.4; }
.per-alertes th.n, .per-alertes td.n { width: 56px; }
.per-al-erreur td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.per-al-attention td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.per-al-info td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.per-niveau { display: inline-block; padding: 0 var(--e2); border: 1px solid currentColor; border-radius: var(--r1); font-size: var(--fs-xs); font-weight: 600; }
.per-niveau[data-niveau="erreur"] { color: var(--bad); background: var(--bad-bg); border-width: 2px; }
.per-niveau[data-niveau="attention"] { color: var(--warn); background: var(--warn-bg); border-radius: 0; }
.per-niveau[data-niveau="info"] { color: var(--info); background: var(--info-bg); border-style: dashed; }
.per-indic .indicateur:last-child { border-right: 0; }
.per-details summary { cursor: pointer; color: var(--ink); font-size: var(--fs-s); }
.per-details summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.per-details .mono { margin: var(--e2) 0 0; overflow-wrap: anywhere; color: var(--ink-2); }
.per-pied-note { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Panneau Versions (dock) */
.per-versions, .per-journal { margin: 0; padding: 0; list-style: none; }
.per-v { display: grid; gap: 1px; padding: var(--e3) var(--e4); border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.per-v.active { box-shadow: inset 3px 0 0 var(--ok); }
.per-v.lue { background: var(--choisi-panneau); }
.per-v-tete { display: flex; align-items: center; gap: var(--e3); font-size: var(--fs-m); }
.per-puce-active { color: var(--ok); border-color: currentColor; }
.per-v-l { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.per-motif { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.per-v-actions { display: flex; flex-wrap: wrap; gap: var(--e2); margin-top: var(--e2); }
.per-v-actions:empty { display: none; }
.per-journal li { display: grid; gap: 1px; padding: var(--e2) var(--e4); border-bottom: 1px solid var(--grid-line); font-size: var(--fs-s); }
