/* ═══════════════════════════════════════════════════════════
   DTISoft — Éditeur « Layouts Documents » (js/layout-editor.js) — le-*
   ═══════════════════════════════════════════════════════════ */
.le-overlay {
    position: fixed; inset: 0; z-index: 10600;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
}
.le-panel {
    background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.35);
    width: 90vw; max-width: 90vw; height: 90vh; max-height: 90vh;
    display: flex; flex-direction: column; font-size: 13px; color: #1e293b;
}
.le-head {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px;
    background: #f1f5f9; border-bottom: 1px solid #e2e8f0; border-radius: 8px 8px 0 0;
}
.le-title { font-weight: 700; font-size: 15px; color: #334155; }
.le-title i { color: #3498db; margin-right: 6px; }
.le-head .le-spacer { flex: 1; }
.le-jrn-wrap { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; }
.le-jrn { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 12px; background: #fff; max-width: 260px; }
.le-status { font-size: 12px; color: #64748b; min-width: 80px; }
.le-btn { padding: 6px 14px; border-radius: 5px; border: 1px solid #cbd5e1; background: #fff; cursor: pointer; font-size: 12px; font-weight: 600; color: #334155; }
.le-btn:hover { background: #f8fafc; }
.le-btn-save { background: #2563eb; border-color: #2563eb; color: #fff; }
.le-btn-save:hover { background: #1d4ed8; }
.le-btn-save:disabled { opacity: .5; cursor: default; }
.le-close { background: none; border: 0; font-size: 18px; color: #64748b; cursor: pointer; padding: 2px 6px; }
.le-close:hover { color: #0f172a; }

.le-panel *, .le-panel *::before, .le-panel *::after { box-sizing: border-box; }
.le-body { flex: 1; display: flex; min-height: 0; min-width: 0; overflow-x: auto; }   /* filet : < ~640px, scroll horizontal plutôt qu'inspecteur coupé */
.le-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.le-col-blocks { flex: 0 0 280px; border-right: 1px solid #e2e8f0; }
.le-col-settings { flex: 0 0 320px; border-right: 1px solid #e2e8f0; }
.le-col-preview { flex: 1 1 0; min-width: 160px; background: #e9edf2; }
.le-col-h { padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #64748b; background: #f8fafc; border-bottom: 1px solid #eef2f6; }
.le-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px; }

/* Liste des blocs */
.le-block {
    display: flex; align-items: center; gap: 7px; padding: 7px 8px; margin-bottom: 5px;
    border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; cursor: pointer;
}
.le-block:hover { border-color: #cbd5e1; background: #f8fafc; }
.le-block.le-sel { border-color: #3498db; background: #eff6ff; box-shadow: 0 0 0 1px #3498db inset; }
.le-block.le-hidden { opacity: .5; }
.le-block.le-drag-over { border-top: 2px solid #3498db; }
.le-grip { color: #cbd5e1; cursor: grab; font-size: 12px; }
.le-block-label { flex: 1; font-size: 12px; font-weight: 600; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.le-block-type { font-size: 10px; color: #94a3b8; }
.le-vis { cursor: pointer; }
.le-del { color: #cbd5e1; cursor: pointer; font-size: 12px; }
.le-del:hover { color: #dc2626; }
.le-badge-jrn { font-size: 9px; background: #dbeafe; color: #1d4ed8; border-radius: 3px; padding: 0 4px; font-weight: 700; }
.le-pin { font-size: 10px; color: #f59e0b; }
.le-footer-field { background: #fffbeb; border: 1px solid #fde68a; border-radius: 5px; padding: 8px 9px; }
.le-footer-field label { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 600; color: #92400e; cursor: pointer; }
.le-footer-field .fa-thumbtack { color: #f59e0b; }
.le-footer-hint { font-size: 10px; color: #b45309; margin-top: 4px; }

/* Groupe de ligne (colonnes) dans la sidebar */
.le-rowgroup { border: 1px dashed #cbd5e1; border-radius: 6px; padding: 4px; margin-bottom: 5px; background: #f8fafc; }
.le-rowgroup-h { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #64748b; padding: 2px 4px 4px; }
.le-rowgroup-h i { color: #3498db; }
.le-rowgroup .le-block { margin-bottom: 4px; }
.le-rowgroup .le-block:last-child { margin-bottom: 0; }
.le-block-col { margin-left: 10px; }
.le-colicon { color: #3498db; font-size: 10px; }
.le-tog-off { opacity: .45; }
/* Drop au CENTRE d'un bloc = mise en colonne (distinct du réordonnancement au bord haut). */
.le-block.le-drop-col { outline: 2px solid #3498db; outline-offset: -2px; background: #eaf4fc; border-top-color: transparent; }
.le-block.le-drop-col::after { content: "\f337"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #3498db; font-size: 11px; }
.le-split-cols { display: block; width: 100%; margin-bottom: 8px; padding: 7px 8px; border: 1px solid #bfdbfe; border-radius: 5px; background: #eff6ff; cursor: pointer; font-size: 11px; color: #1d4ed8; font-weight: 600; }
.le-split-cols:hover { background: #dbeafe; }
.le-split-cols i { margin-right: 5px; }
.le-hint { margin-top: 8px; padding: 6px 8px; background: #f8fafc; border-radius: 5px; font-size: 10.5px; line-height: 1.45; color: #64748b; }
.le-hint i { color: #f59e0b; margin-right: 4px; }
.le-reset-all { display: block; width: 100%; margin-top: 8px; padding: 7px 8px; border: 1px solid #fecaca; border-radius: 5px; background: #fff5f5; cursor: pointer; font-size: 11px; color: #b91c1c; }
.le-reset-all:hover { background: #fee2e2; }

.le-palette { border-top: 1px solid #eef2f6; padding: 8px; max-height: 42%; overflow-y: auto; }
.le-palette-h { font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 6px; }
.le-palette-jrn { display: inline-block; font-size: 9px; font-weight: 700; background: #dbeafe; color: #1d4ed8; border-radius: 999px; padding: 1px 7px; margin-left: 4px; text-transform: none; }
.le-add { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; padding: 6px 8px; margin-bottom: 4px; border: 1px dashed #cbd5e1; border-radius: 5px; background: #fff; cursor: pointer; font-size: 12px; color: #475569; }
.le-add > .fas:first-child { width: 14px; text-align: center; color: #94a3b8; flex-shrink: 0; }
.le-add > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-add-plus { color: #cbd5e1; font-size: 10px; }
.le-add:hover:not(.le-add-off) { border-color: #3498db; color: #1d4ed8; background: #f8fbff; }
.le-add:hover:not(.le-add-off) > .fas:first-child, .le-add:hover:not(.le-add-off) .le-add-plus { color: #3498db; }
.le-add-off { opacity: .55; cursor: not-allowed; border-style: solid; background: #f8fafc; }
.le-add-badge { font-size: 9px; font-weight: 700; background: #e2e8f0; color: #64748b; border-radius: 3px; padding: 0 5px; white-space: nowrap; }
.le-tico { width: 14px; text-align: center; color: #94a3b8; font-size: 11px; flex-shrink: 0; }
.le-block.le-sel .le-tico { color: #3498db; }

/* Réglages */
.le-set-field { margin-bottom: 12px; }
.le-set-field label { display: block; font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 3px; }
.le-set-field input[type=text], .le-set-field textarea, .le-set-field select {
    width: 100%; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 12px; font-family: inherit; color: #1e293b;
}
.le-set-field textarea { min-height: 70px; resize: vertical; }
/* Champ inactif (« Titre des horaires » hors PDV fixe, 2026-10-07) : grisé — son libellé, inchangé, dit pourquoi. */
.le-set-field input[type=text]:disabled { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; cursor: not-allowed; }
.le-set-cols label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin-bottom: 4px; cursor: pointer; }
.le-set-empty { color: #94a3b8; font-style: italic; font-size: 12px; padding: 10px 4px; }
.le-jrn-note { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 5px; padding: 7px 9px; font-size: 11px; color: #1e40af; margin-bottom: 12px; }
.le-jrn-note b { font-weight: 700; }
.le-ovr-tag { display: inline-block; font-size: 10px; background: #dbeafe; color: #1d4ed8; border-radius: 3px; padding: 0 5px; font-weight: 700; margin-left: 6px; }
.le-reset { font-size: 11px; color: #2563eb; cursor: pointer; background: none; border: 0; padding: 0; margin-top: 3px; }
.le-reset:hover { text-decoration: underline; }
.le-reset-cols { font-size: 11px; color: #2563eb; cursor: pointer; background: none; border: 0; padding: 0; margin-top: 5px; display: block; }
.le-reset-cols:hover { text-decoration: underline; }
/* Ordre verrouillé en mode journal : dit POURQUOI le glisser-déposer ne répond
   pas, là où on essaie de l'utiliser (la liste de blocs) — pas dans un panneau
   voisin qu'on ne regarde pas à ce moment-là. */
.le-dnd-note {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: 5px;
    padding: 7px 9px; font-size: 11px; color: #92400e; margin-bottom: 8px; line-height: 1.45;
}
.le-dnd-note i { margin-right: 5px; }
.le-dnd-note b { font-weight: 700; }
/* Libellés de colonnes : la source entre parenthèses, en plus discret. */
.le-set-cols label { line-height: 1.35; }
/* ── Colonnes réordonnables ─────────────────────────────────────────────
   L'ordre des lignes EST l'ordre d'impression : la poignée doit se voir, sinon
   personne ne devine qu'on peut glisser. */
.le-col-tools { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; flex-wrap: wrap; }
.le-col-all, .le-col-none {
    font-size: 11px; color: #2563eb; cursor: pointer; background: none;
    border: 1px solid #bfdbfe; border-radius: 4px; padding: 2px 7px;
}
.le-col-all:hover, .le-col-none:hover { background: #eff6ff; }
.le-col-hint { font-size: 10.5px; color: #94a3b8; margin-left: auto; }
.le-col-list { border: 1px solid #e5e7eb; border-radius: 5px; padding: 3px; background: #fff; }
.le-col-row {
    display: flex; align-items: center; gap: 6px;
    padding: 2px 4px; border-radius: 4px; cursor: grab; background: #fff;
}
.le-col-row:hover { background: #f8fafc; }
.le-col-row label { margin-bottom: 0; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.le-col-grip { color: #cbd5e1; font-size: 11px; flex: 0 0 auto; }
.le-col-row:hover .le-col-grip { color: #94a3b8; }
.le-col-dragging { opacity: .45; }
/* Trait d'insertion : dit OÙ la ligne va atterrir, plutôt que de colorer la
   cible — qu'on confondrait avec une sélection. */
.le-col-over { box-shadow: inset 0 2px 0 0 #2563eb; }
/* Épingle « haut de page » : même icône que le pied, retournée — l'orientation
   suffit à distinguer les deux sans ajouter un second symbole à apprendre. */
.le-pin-up { transform: rotate(180deg); }

/* Aperçu — page A4 rendue à 794px puis mise à l'échelle de la place disponible (fitPreview) */
.le-preview-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 6px 12px; background: #f8fafc; border-bottom: 1px solid #eef2f6; font-size: 11px; color: #64748b; }
.le-preview-bar .le-spacer { flex: 1; }
/* « Aperçu pour : <magasin> » (2026-10-07) — magasin du document d'exemple. */
.le-apercu-wrap { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; color: #475569; font-weight: 600; white-space: nowrap; }
.le-apercu-pdv { padding: 2px 6px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 11px; font-weight: 400; background: #fff; color: #1e293b; max-width: 230px; }
.le-zoom { font-size: 10px; font-weight: 700; color: #94a3b8; background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; padding: 1px 8px; }
.le-preview-wrap { flex: 1; overflow: auto; padding: 14px; }
.le-preview-sizer { margin: 0 auto; position: relative; }
.le-preview-frame { width: 794px; height: 1123px; background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 2px 10px rgba(0,0,0,.12); transform-origin: top left; display: block; }
.le-preview-loading { color: #94a3b8; font-style: italic; padding: 20px; }

/* ── Inspecteur (droite) : onglets Contenu / Design ── */
.le-col-inspector { flex: 0 0 344px; border-left: 1px solid #e2e8f0; }
.le-col-preview { border-left: 1px solid #e2e8f0; }
.le-theme { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 12px; background: #fff; }
.le-tabs { display: flex; border-bottom: 1px solid #e2e8f0; background: #f8fafc; flex-shrink: 0; }
.le-tab { flex: 1; padding: 9px 8px; border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: #64748b; border-bottom: 2px solid transparent; }
.le-tab.le-tab-active { color: #1e3a8a; border-bottom-color: #3498db; background: #fff; }
.le-tab i { margin-right: 4px; }

/* Panneau Design */
.le-design-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 10px; font-weight: 700; font-size: 12px; color: #334155; }
.le-reset-block { font-size: 11px; color: #2563eb; background: none; border: 0; cursor: pointer; }
.le-reset-block:hover { text-decoration: underline; }
.le-acc { margin-bottom: 8px; border: 1px solid #eef2f6; border-radius: 6px; overflow: hidden; }
.le-acc-h { padding: 6px 9px; background: #f8fafc; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #64748b; }
.le-acc-body { padding: 8px 9px; }
.le-df { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.le-df > label { flex: 0 0 42%; font-size: 11px; color: #475569; display: flex; align-items: center; gap: 5px; }
.le-df-ctl { flex: 1; display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.le-df-ctl select { width: 100%; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 12px; background: #fff; }
.le-num { flex: 1; display: flex; align-items: center; gap: 4px; }
.le-num input[type=number] { width: 100%; padding: 4px 6px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 12px; }
.le-unit { font-size: 10px; color: #94a3b8; min-width: 14px; }
.le-color-wrap input[type=color] { width: 32px; height: 24px; border: 1px solid #cbd5e1; border-radius: 4px; padding: 0; background: none; cursor: pointer; }
.le-color-set input[type=color] { box-shadow: 0 0 0 2px rgba(52,152,219,.35); }
.le-align { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 4px; overflow: hidden; }
.le-align button { border: 0; background: #fff; padding: 4px 7px; cursor: pointer; color: #64748b; font-size: 11px; border-left: 1px solid #eef2f6; }
.le-align button:first-child { border-left: 0; }
.le-align button.le-align-on { background: #eff6ff; color: #1d4ed8; }
.le-tog { position: relative; display: inline-block; width: 34px; height: 18px; }
.le-tog input { display: none; }
.le-tog span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 10px; transition: .15s; }
.le-tog span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .15s; }
.le-tog input:checked + span { background: #3498db; }
.le-tog input:checked + span::before { transform: translateX(16px); }
.le-reset-1 { border: 0; background: none; color: #cbd5e1; cursor: pointer; font-size: 12px; padding: 0 2px; }
.le-reset-1:hover { color: #2563eb; }

/* Sélecteur de police (façon Photoshop : survol = aperçu, gris = police actuelle) */
.le-fontpick { position: relative; flex: 1; min-width: 0; }
.le-fontpick-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; cursor: pointer; font-size: 12px; text-align: left; }
.le-fontpick-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.le-fontpick-btn i { color: #94a3b8; font-size: 10px; flex-shrink: 0; }
.le-fontpick-menu { position: fixed; z-index: 10700; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #cbd5e1; border-radius: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.le-fontpick-opt { padding: 7px 10px; font-size: 14px; line-height: 1.1; cursor: pointer; white-space: nowrap; border-bottom: 1px solid #f5f7fa; }
.le-fontpick-opt:hover { background: #eff6ff; }
.le-fontpick-opt.le-font-current { background: #ececec; }
.le-fontpick-opt.le-font-current:hover { background: #e2e8f0; }

/* ── Éditeur de texte riche (blocs texte) ── */
.le-rt { border-radius: 5px; }
.le-rt-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: #f8fafc; border: 1px solid #cbd5e1; border-bottom: 0; border-radius: 5px 5px 0 0; }
.le-rt-btn { width: 26px; height: 24px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; color: #475569; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.le-rt-btn:hover { background: #e2e8f0; color: #1e3a8a; }
.le-rt-sep { width: 1px; background: #e2e8f0; margin: 2px 3px; }
.le-rt-ed { min-height: 90px; max-height: 240px; overflow-y: auto; border: 1px solid #cbd5e1; border-radius: 0 0 5px 5px; padding: 7px 9px; font-size: 12px; line-height: 1.5; background: #fff; color: #1e293b; }
.le-rt-ed:focus { outline: none; border-color: #3498db; box-shadow: 0 0 0 2px rgba(52,152,219,.15); }
.le-rt-ed ul, .le-rt-ed ol { margin: 4px 0; padding-left: 20px; }

/* ── Responsive : l'aperçu A4 s'auto-réduit (fitPreview), les sidebars gardent
     une largeur utile et ne sortent plus de la fenêtre sur écran étroit ── */
@media (max-width: 1500px) {
    .le-col-blocks { flex-basis: 244px; }
    .le-col-inspector { flex-basis: 308px; }
}
@media (max-width: 1250px) {
    .le-panel { width: 97vw; max-width: 97vw; height: 95vh; max-height: 95vh; }
    .le-head { flex-wrap: wrap; row-gap: 6px; }
    .le-jrn { max-width: 190px; }
    .le-col-blocks { flex-basis: 220px; }
    .le-col-inspector { flex-basis: 284px; }
}
@media (max-width: 1000px) {
    .le-col-blocks { flex-basis: 198px; }
    .le-col-inspector { flex-basis: 262px; }
    .le-df { flex-wrap: wrap; }
    .le-df > label { flex-basis: 100%; }
}
