/* ═══════════════════════════════════════════════════════════════════
   DTISoft — Export d'articles  (namespace `ex-`)

   z-index 1200, comme la fenêtre d'import : la visionneuse de classeur
   (`fx-`, 1400) doit pouvoir s'ouvrir par-dessus.
   ═══════════════════════════════════════════════════════════════════ */

/* ⚠️ `[hidden]` NE MASQUE PLUS RIEN dès qu'une règle d'auteur fixe `display`.
   La feuille du navigateur pose `[hidden] { display: none }` avec une
   spécificité de (0,1,0) : n'importe quelle règle de classe qui déclare
   `display` la bat, et l'élément reste visible alors que le JS le croit caché.
   Constaté le 2026-08-05 : `.ex-item { display: flex }` rendait la recherche
   du sélecteur (fournisseurs, catégories, familles) totalement inopérante, et
   `.ex-prog { display: flex }` affichait en permanence une barre d'avancement
   vide. Cette règle-ci est en (0,2,0) : elle repasse devant, sans `!important`
   et sans qu'on ait à y penser à chaque nouvelle classe. */
.ex-overlay [hidden] { display: none; }

.ex-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(15, 23, 42, .55);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.ex-panel {
    background: #fff; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
    width: 980px; max-width: 100%; max-height: 90vh;
    display: flex; flex-direction: column; font-size: 13px; color: #1e293b;
}

.ex-head {
    display: flex; align-items: center;
    padding: 13px 18px; border-bottom: 1px solid #e5e7eb; background: #f8fafc;
    border-radius: 10px 10px 0 0;
}
.ex-title { font-weight: 600; font-size: 14px; }
.ex-title i { color: #16a34a; margin-right: 7px; }
/* `margin-right:auto` colle le bouton au titre : trois éléments en
   `space-between` partiraient aux trois coins et on cliquerait « Fichiers
   exportés » en visant la croix. */
.ex-head-btn {
    display: inline-flex; align-items: center; gap: 6px; margin: 0 auto 0 14px;
    border: 1px solid #cbd5e1; background: #fff; color: #334155;
    border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.ex-head-btn:hover { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.ex-close {
    border: 0; background: transparent; font-size: 24px; line-height: 1;
    color: #94a3b8; cursor: pointer; padding: 0 4px;
}
.ex-close:hover { color: #ef4444; }

.ex-body { padding: 16px 18px; overflow: auto; flex: 1; }
.ex-step { margin-bottom: 22px; }
.ex-h4 {
    margin: 0 0 10px 0; font-size: 12px; color: #64748b;
    text-transform: uppercase; letter-spacing: .5px;
    display: flex; align-items: center; gap: 8px;
}
.ex-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 19px; height: 19px; border-radius: 50%;
    background: #16a34a; color: #fff; font-size: 11px; font-weight: 700;
}
.ex-vide { padding: 26px 10px; text-align: center; color: #64748b; }
.ex-note { font-size: 11.5px; color: #94a3b8; font-weight: 400; }

/* ── Colonnes ───────────────────────────────────────────────────── */
.ex-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ex-rech {
    border: 1px solid #cbd5e1; border-radius: 6px; padding: 5px 9px;
    font-size: 12.5px; width: 220px; max-width: 100%;
}
.ex-lien {
    border: 0; background: transparent; color: #2563eb; cursor: pointer;
    font-size: 12px; padding: 2px 4px; text-decoration: underline;
}
.ex-compte { font-size: 12px; color: #64748b; margin-left: auto; }

/* Colonnes en grille : 146 cases en une seule liste seraient illisibles. */
.ex-groupes {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
    max-height: 300px; overflow: auto; padding: 2px;
    border: 1px solid #e5e7eb; border-radius: 7px; background: #fafafa;
}
.ex-groupe { border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; padding: 7px 9px; }
.ex-groupe-t {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 600; color: #334155;
    border-bottom: 1px solid #f1f5f9; padding-bottom: 5px; margin-bottom: 5px;
}
.ex-groupe-n { color: #94a3b8; font-weight: 400; font-size: 11px; }
.ex-cols { display: flex; flex-direction: column; gap: 1px; }
.ex-col {
    display: flex; align-items: center; gap: 6px; font-size: 12px;
    padding: 2px 3px; border-radius: 4px; cursor: pointer;
}
.ex-col:hover { background: #f1f5f9; }
/* Sans `min-width:0`, un libellé long refuse de se comprimer et le nom
   technique déborde de la carte (piège § 7.32). */
.ex-col-l { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-col-t { font-size: 10.5px; color: #cbd5e1; font-family: ui-monospace, monospace; flex: 0 0 auto; }
.ex-col-i { color: #f59e0b; font-size: 10px; flex: 0 0 auto; }

/* ── Sélection des articles ─────────────────────────────────────── */
.ex-radios { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ex-radio {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
    border: 1px solid #e5e7eb; border-radius: 20px; padding: 5px 12px;
    font-size: 12.5px; background: #fff;
}
.ex-radio:hover { background: #f8fafc; }
.ex-radio i { color: #94a3b8; }
.ex-radio:has(input:checked) { border-color: #86efac; background: #f0fdf4; color: #166534; }
.ex-radio:has(input:checked) i { color: #16a34a; }

.ex-selzone { border: 1px solid #e5e7eb; border-radius: 7px; padding: 10px; background: #fafafa; }
.ex-lbl { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.ex-ta {
    width: 100%; border: 1px solid #cbd5e1; border-radius: 6px; padding: 7px 9px;
    font-size: 12.5px; font-family: ui-monospace, monospace; resize: vertical;
}
.ex-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.ex-liste {
    max-height: 210px; overflow: auto;
    border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; padding: 4px;
}
.ex-item {
    display: flex; align-items: center; gap: 7px; font-size: 12.5px;
    padding: 3px 5px; border-radius: 4px; cursor: pointer;
}
.ex-item:hover { background: #f1f5f9; }

/* ── Filtres ────────────────────────────────────────────────────── */
.ex-filtres { display: flex; flex-direction: column; gap: 5px; }
.ex-ck { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.ex-ck-inline { display: inline-flex; margin-right: 12px; }
.ex-ck input[type="date"] {
    border: 1px solid #cbd5e1; border-radius: 5px; padding: 3px 6px; font-size: 12px; margin-left: 4px;
}
.ex-dates { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 4px; }
.ex-statuts { margin-top: 6px; font-size: 12.5px; color: #475569; }

.ex-bilan {
    margin-top: 11px; font-size: 12.5px; color: #166534;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 7px; padding: 9px 12px;
}
.ex-bilan i { margin-right: 6px; }
.ex-bilan-att { color: #92400e; background: #fffbeb; border-color: #fde68a; }

/* ── Rapport ────────────────────────────────────────────────────── */
.ex-rap { border: 1px solid #e5e7eb; border-radius: 7px; overflow: hidden; }
.ex-rap-l {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 6px 11px; font-size: 12.5px; border-bottom: 1px solid #f1f5f9;
}
.ex-rap-l:last-child { border-bottom: 0; }
.ex-rap-l span { color: #64748b; }
.ex-rap-att { background: #fffbeb; color: #92400e; }
.ex-rap-actions { display: flex; gap: 8px; margin: 11px 0 8px; flex-wrap: wrap; }

/* ── Pied ───────────────────────────────────────────────────────── */
.ex-foot {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 11px 18px; border-top: 1px solid #e5e7eb; background: #f8fafc;
    border-radius: 0 0 10px 10px;
}
.ex-msg { font-size: 12.5px; color: #64748b; flex: 1 1 auto; min-width: 0; }
.ex-msg-ok  { color: #166534; }
.ex-msg-err { color: #b91c1c; }
.ex-actions { display: flex; gap: 8px; margin-left: auto; }
.ex-btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid #cbd5e1; background: #fff; color: #334155;
    border-radius: 6px; padding: 6px 13px; font-size: 12.5px; cursor: pointer;
    text-decoration: none;
}
.ex-btn:hover:not(:disabled) { background: #f1f5f9; }
.ex-btn:disabled { opacity: .5; cursor: not-allowed; }
.ex-btn-go { background: #16a34a; border-color: #16a34a; color: #fff; }
.ex-btn-go:hover:not(:disabled) { background: #15803d; }

.ex-prog { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; }
.ex-prog-bar { flex: 1 1 auto; height: 7px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.ex-prog-fill { height: 100%; width: 0; background: #16a34a; transition: width .25s; }
.ex-prog-txt { font-size: 11.5px; color: #64748b; white-space: nowrap; }

@media (max-width: 760px) {
    .ex-overlay { padding: 8px; }
    .ex-head { flex-wrap: wrap; }
    .ex-groupes { grid-template-columns: 1fr; max-height: 240px; }
}
