/* ═══════════════════════════════════════════════════════════
   DTISoft — Éditeur « Étiquettes » (Options → Étiquettes, js/etiquettes-editor.js) — et-*
   Monté dans la section .opt-pane.et-pane de js/options.js (z-index de l'overlay Options : 10000).
   ═══════════════════════════════════════════════════════════ */
.opt-pane.et-pane.opt-pane-active { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.et-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.et-host-msg { padding: 12px; color: #b91c1c; font-size: 13px; }

.et-root {
    flex: 1; min-height: 520px; min-width: 0; display: flex; flex-direction: column;
    font-size: 12.5px; color: #1e293b; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
}
.et-root *, .et-root *::before, .et-root *::after { box-sizing: border-box; }
.et-spacer { flex: 1; }

/* Barre du haut */
.et-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.et-title { font-weight: 700; font-size: 14px; color: #334155; white-space: nowrap; }
.et-title i { color: #3498db; }
.et-ro { font-size: 11.5px; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 4px; padding: 3px 8px; }
.et-status { font-size: 12px; color: #64748b; max-width: 420px; }
.et-status-warn { color: #b45309; font-weight: 600; }
.et-status-err { color: #b91c1c; font-weight: 600; }
.et-status-ok { color: #15803d; font-weight: 600; }

.et-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 5px; border: 1px solid #cbd5e1; background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; color: #334155; font-family: inherit; }
.et-btn:hover:not(:disabled) { background: #f8fafc; border-color: #94a3b8; }
.et-btn:disabled { opacity: .5; cursor: default; }
.et-btn-primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.et-btn-primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
.et-btn-sm { padding: 4px 9px; font-size: 11.5px; }
.et-btn-danger { color: #b91c1c; border-color: #fecaca; }
.et-btn-danger:hover:not(:disabled) { background: #fef2f2; border-color: #fca5a5; }
.et-ibtn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #475569; cursor: pointer; padding: 0; font-size: 12px; flex-shrink: 0; }
.et-ibtn:hover:not(:disabled) { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.et-ibtn:disabled { opacity: .4; cursor: default; }
.et-ibtn-danger:hover:not(:disabled) { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }

/* États chargement / erreur */
.et-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #64748b; font-size: 13px; padding: 24px; }
.et-state-err { color: #b91c1c; }

/* Corps : 3 colonnes */
.et-body { flex: 1; display: flex; min-height: 0; min-width: 0; overflow-x: auto; }
.et-side { flex: 0 0 224px; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #e2e8f0; background: #fbfcfe; }
.et-center { flex: 1 1 0; min-width: 300px; display: flex; flex-direction: column; min-height: 0; }
.et-insp { flex: 0 0 300px; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid #e2e8f0; }
.et-col-h { padding: 7px 10px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; background: #f8fafc; border-bottom: 1px solid #eef2f6; }

/* Liste des layouts */
.et-side-acts { display: flex; gap: 5px; padding: 7px 8px; border-bottom: 1px solid #eef2f6; }
.et-new { flex: 1; min-width: 0; padding: 5px 6px; border: 1px solid #93c5fd; border-radius: 5px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 600; cursor: pointer; }
.et-new:disabled { opacity: .5; cursor: default; }
.et-list { flex: 1; min-height: 80px; overflow-y: auto; padding: 6px 8px; }
.et-list-empty { font-size: 12px; color: #94a3b8; font-style: italic; padding: 8px 2px; }
.et-grp { margin-bottom: 8px; }
.et-grp-h { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .03em; padding: 4px 2px; }
.et-grp-h i { color: #3498db; width: 14px; text-align: center; }
.et-item { display: flex; align-items: center; gap: 6px; padding: 6px 7px; margin-bottom: 4px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; cursor: pointer; }
.et-item:hover { border-color: #cbd5e1; background: #f8fafc; }
.et-item-sel { border-color: #3498db; background: #eff6ff; box-shadow: 0 0 0 1px #3498db inset; }
.et-item-txt { flex: 1; min-width: 0; }
.et-item-nm { font-size: 12px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.et-item-meta { font-size: 10.5px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.et-star { border: 0; background: none; padding: 2px; cursor: pointer; color: #cbd5e1; font-size: 12px; flex-shrink: 0; }
.et-star:hover:not(:disabled) { color: #f59e0b; }
.et-star-on { color: #f59e0b; }
.et-star:disabled { cursor: default; }

/* Imprimante du poste */
.et-printer { border-top: 1px solid #e2e8f0; background: #fff; }
.et-prn-row { display: flex; gap: 5px; padding: 8px 8px 4px; align-items: center; }
.et-prn-row .et-sel { flex: 1; min-width: 0; }
.et-prn-msg { padding: 2px 10px 10px; font-size: 11px; line-height: 1.45; color: #64748b; }
.et-prn-warn { color: #b45309; }
.et-prn-ok { color: #15803d; }

/* Barre d'outils du canevas */
.et-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #e2e8f0; background: #fff; flex-wrap: wrap; }
.et-palette, .et-elacts, .et-zoom { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.et-elacts { padding-left: 8px; border-left: 1px solid #e2e8f0; }
.et-tbtn { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 7px; border: 1px dashed #cbd5e1; border-radius: 5px; background: #fff; color: #475569; cursor: pointer; font-size: 12px; font-family: inherit; }
.et-tbtn i { color: #64748b; }
.et-tbtn:hover:not(:disabled) { border-color: #3498db; color: #1d4ed8; background: #f8fbff; }
.et-tbtn:disabled { opacity: .45; cursor: default; }
.et-tsel { height: 28px; max-width: 118px; padding: 0 6px; border: 1px dashed #cbd5e1; border-radius: 5px; background: #fff; color: #475569; font-size: 12px; cursor: pointer; }
.et-tsel:disabled { opacity: .45; cursor: default; }
.et-zoom-lbl { min-width: 48px; text-align: center; font-size: 11px; color: #64748b; font-variant-numeric: tabular-nums; }
.et-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #475569; cursor: pointer; user-select: none; }

/* Canevas */
.et-stage { flex: 1; min-height: 0; overflow: auto; display: flex; background: #e9edf2; outline: none; user-select: none; touch-action: none; }
.et-stage:focus-visible { box-shadow: inset 0 0 0 2px #93c5fd; }
.et-stage-in { margin: auto; padding: 24px; }
.et-label {
    position: relative; background: #fff; box-shadow: 0 2px 12px rgba(15,23,42,.2);
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif; color: #000;
}
.et-label.et-grid {
    background-image:
        linear-gradient(to right, rgba(148,163,184,.28) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(148,163,184,.28) 1px, transparent 1px);
}
.et-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; font-style: italic; background: #f1f5f9; padding: 20px; text-align: center; }
.et-hint { padding: 5px 10px; font-size: 10.5px; color: #94a3b8; border-top: 1px solid #eef2f6; background: #fff; }

.et-el { position: absolute; cursor: move; }
.et-el::before { content: ''; position: absolute; inset: -3px; }            /* zone de prise élargie (lignes fines) */
.et-el:hover { outline: 1px dashed rgba(37,99,235,.6); outline-offset: 0; }
.et-el-sel { outline: 1.5px solid #2563eb; z-index: 1; }
.et-el-sel:hover { outline: 1.5px solid #2563eb; }
.et-inner { position: absolute; transform-origin: 50% 50%; pointer-events: none; overflow: hidden; }
.et-txt { display: flex; flex-direction: column; line-height: 1.15; white-space: pre-wrap; overflow-wrap: anywhere; }
.et-va-top { justify-content: flex-start; }
.et-va-middle { justify-content: center; }
.et-va-bottom { justify-content: flex-end; }
.et-b { font-weight: 700; }
.et-i { font-style: italic; }
.et-txt-b { flex-shrink: 0; }
.et-clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.et-fld { background: rgba(37,99,235,.08); border-radius: 1px; }
.et-fld-x { background: #fee2e2; color: #b91c1c; border-radius: 1px; }
.et-line { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); background: #000; }
.et-box { border-style: solid; border-color: #000; box-sizing: border-box; }
.et-svg { display: block; }

/* Poignées de redimensionnement */
.et-h { position: absolute; width: 8px; height: 8px; background: #fff; border: 1.5px solid #2563eb; border-radius: 2px; z-index: 2; }
.et-h-nw { left: -4px; top: -4px; cursor: nwse-resize; }
.et-h-n  { left: calc(50% - 4px); top: -4px; cursor: ns-resize; }
.et-h-ne { right: -4px; top: -4px; cursor: nesw-resize; }
.et-h-e  { right: -4px; top: calc(50% - 4px); cursor: ew-resize; }
.et-h-se { right: -4px; bottom: -4px; cursor: nwse-resize; }
.et-h-s  { left: calc(50% - 4px); bottom: -4px; cursor: ns-resize; }
.et-h-sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.et-h-w  { left: -4px; top: calc(50% - 4px); cursor: ew-resize; }

/* Inspecteur */
.et-tabs { display: flex; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.et-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: #64748b; font-family: inherit; }
.et-tab:hover { color: #1e3a8a; }
.et-tab-on { color: #1e3a8a; border-bottom-color: #3498db; background: #fff; }
.et-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px; }
.et-p-empty { font-size: 12px; color: #94a3b8; font-style: italic; padding: 8px 2px; line-height: 1.5; }
.et-sec-h { margin: 12px 0 7px; padding-bottom: 3px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #64748b; border-bottom: 1px solid #eef2f6; }
.et-f { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 3px 8px; align-items: center; margin-bottom: 7px; }
.et-f-l { font-size: 11.5px; color: #475569; }
.et-f-c { min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.et-f-hint { grid-column: 2; font-size: 10.5px; color: #94a3b8; line-height: 1.4; }
.et-note { margin-top: 6px; }
.et-sel, .et-txt-in, .et-num, .et-ta { padding: 5px 7px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 12px; font-family: inherit; background: #fff; color: #1e293b; }
.et-sel, .et-txt-in, .et-ta { width: 100%; min-width: 0; }
.et-ta { resize: vertical; min-height: 54px; font-family: 'DejaVu Sans Mono', Consolas, monospace; font-size: 11.5px; }
.et-num { width: 82px; text-align: right; }
.et-sel:disabled, .et-txt-in:disabled, .et-num:disabled, .et-ta:disabled { background: #f8fafc; color: #64748b; }
.et-unit { display: inline-flex; align-items: center; gap: 4px; }
.et-unit-s { font-size: 11px; color: #94a3b8; min-width: 16px; }
.et-geo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin-bottom: 8px; }
.et-geo-c { display: flex; align-items: center; gap: 5px; }
.et-geo-l { width: 12px; font-size: 11px; font-weight: 700; color: #64748b; }
.et-geo .et-num { width: 70px; }
.et-seg, .et-seg-row { display: inline-flex; gap: 0; }
.et-seg-row { gap: 4px; }
.et-seg-b { min-width: 30px; height: 27px; padding: 0 8px; border: 1px solid #cbd5e1; background: #fff; color: #475569; cursor: pointer; font-size: 11.5px; font-family: inherit; }
.et-seg .et-seg-b + .et-seg-b { border-left: 0; }
.et-seg .et-seg-b:first-child { border-radius: 4px 0 0 4px; }
.et-seg .et-seg-b:last-child { border-radius: 0 4px 4px 0; }
.et-seg-row .et-seg-b { border-radius: 4px; }
.et-seg-b:hover:not(:disabled) { background: #eff6ff; color: #1d4ed8; }
.et-seg-on, .et-seg-on:hover:not(:disabled) { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; font-weight: 700; }
.et-seg-b:disabled { opacity: .55; cursor: default; }
.et-p-acts { display: flex; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid #eef2f6; }

/* Aperçu de planche */
.et-planche { margin-top: 6px; padding: 8px; background: #f1f5f9; border-radius: 6px; text-align: center; }
.et-planche-svg { display: block; margin: 0 auto 6px; box-shadow: 0 1px 4px rgba(15,23,42,.15); }
.et-planche-info { font-size: 11px; color: #475569; }
.et-planche-warn { margin-top: 5px; font-size: 11px; color: #b91c1c; font-weight: 600; }

/* Modale PDF de repli (si DTIEtiquettesPrint.apercuPdf absent) — au-dessus des Options (10000) */
.et-pdf-overlay { position: fixed; inset: 0; z-index: 10700; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.et-pdf-panel { width: 80vw; height: 86vh; background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.et-pdf-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: #f1f5f9; border-bottom: 1px solid #e2e8f0; font-weight: 600; color: #334155; font-size: 13px; }
.et-pdf-x { border: 0; background: none; font-size: 17px; color: #64748b; cursor: pointer; }
.et-pdf-x:hover { color: #0f172a; }
.et-pdf-frame { flex: 1; width: 100%; border: 0; }

/* Piège §7.41 : [hidden] doit gagner sur les classes qui déclarent display (spécificité 0,2,0, en fin de fichier). */
.et-root [hidden], .et-pdf-overlay [hidden] { display: none; }
