/* ═══════════════════════════════════════════════════════════
   DTISoft — Duplicata d'un document (js/dup-document.js, window.DTIDupDoc) — 2026-10-02
   Préfixe dupd-. Popup au-dessus des fiches (≤ 9700) et des menus : z-index 11300 (contrat dup-overlay).
   Boutons « Dupliquer » des fiches document (.dd-actbtns) et transfert (.tr-header) : classe .dupd-fiche-btn.
   ═══════════════════════════════════════════════════════════ */

.dupd-overlay {
    position: fixed; inset: 0; z-index: 11300;
    background: rgba(15,23,42,.55);
    display: flex; align-items: center; justify-content: center;
}
/* §7.41 : [hidden] doit gagner sur toute classe qui déclare display (spécificité 0,2,0). */
.dupd-overlay [hidden] { display: none; }

.dupd-panel {
    background: #fff; border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    width: 540px; max-width: 94vw; max-height: 88vh;
    display: flex; flex-direction: column; overflow: hidden; outline: none;
    font-size: 13px; color: #1f2937; line-height: 1.45;
}
.dupd-overlay-options .dupd-panel { width: 920px; }
.dupd-head {
    padding: 12px 18px; background: #1e3a8a; color: #fff;
    font-weight: 700; font-size: 14px;
    display: flex; align-items: center; gap: 8px;
}
.dupd-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dupd-close {
    border: 0; background: none; color: #fff; opacity: .8;
    cursor: pointer; font-size: 15px; padding: 2px 4px; line-height: 1;
}
.dupd-close:hover:not(:disabled) { opacity: 1; }
.dupd-body {
    padding: 14px 18px; overflow-y: auto; flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.dupd-msg { margin: 0; }
.dupd-note { margin: 0; font-size: 11.5px; color: #64748b; }
.dupd-note-attention { color: #b45309; }
.dupd-section-titre { font-weight: 700; color: #92400e; font-size: 13px; }
.dupd-section-titre i { color: #d97706; }

/* Tableau des lignes à vérifier : défile seul, en-tête collant. */
.dupd-table-wrap {
    border: 1px solid #e5e7eb; border-radius: 6px;
    max-height: 40vh; overflow: auto; min-width: 0;
}
.dupd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dupd-table th {
    position: sticky; top: 0; z-index: 1;
    background: #f8fafc; color: #475569; font-weight: 600; text-align: left;
    padding: 6px 8px; border-bottom: 1px solid #e5e7eb; white-space: nowrap;
}
.dupd-table td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.dupd-table tr:last-child td { border-bottom: 0; }
.dupd-num { color: #64748b; text-align: right; white-space: nowrap; }
.dupd-ref, .dupd-rempl-ref { font-weight: 600; white-space: nowrap; }
.dupd-lib { color: #334155; max-width: 260px; overflow-wrap: anywhere; }
.dupd-rempl { max-width: 300px; overflow-wrap: anywhere; }
.dupd-rempl-lib { color: #475569; }
.dupd-aucun, .dupd-garde { color: #94a3b8; font-style: italic; }
.dupd-th-chk, .dupd-td-chk { text-align: center; white-space: nowrap; }
.dupd-tout-lbl { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.dupd-chk, .dupd-tout, .dupd-prix { cursor: pointer; width: 15px; height: 15px; margin: 0; vertical-align: middle; }

.dupd-badge {
    display: inline-block; padding: 1px 7px; border-radius: 9px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.dupd-badge-mini { margin-left: 6px; font-size: 10px; }
.dupd-st-1 { background: #fef3c7; color: #92400e; }
.dupd-st-2 { background: #fee2e2; color: #991b1b; }
.dupd-st-inconnu { background: #e2e8f0; color: #334155; }

.dupd-opt { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.dupd-err {
    color: #b91c1c; font-size: 12.5px;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; padding: 6px 10px;
}
.dupd-liste { margin: 0; padding-left: 18px; font-size: 12.5px; color: #334155; }
.dupd-liste li { margin: 2px 0; overflow-wrap: anywhere; }
.dupd-plus { color: #64748b; font-style: italic; list-style: none; }

.dupd-foot {
    padding: 10px 18px; border-top: 1px solid #e5e7eb;
    display: flex; justify-content: flex-end; gap: 8px;
}
.dupd-btn {
    padding: 7px 14px; border: 1px solid #cbd5e1; background: #fff; color: #1f2937;
    border-radius: 4px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.dupd-btn:hover:not(:disabled) { background: #f8fafc; }
.dupd-btn:disabled { opacity: .55; cursor: default; }
.dupd-btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; font-weight: 600; }
.dupd-btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.dupd-occupe .dupd-table-wrap { opacity: .7; }

/* Toast de repli (quand DTIDup.toast n'est pas disponible) : pas de classe « -overlay » (jamais « au premier plan »). */
.dupd-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    z-index: 11400; max-width: min(640px, 92vw);
    background: #0f172a; color: #fff; border-radius: 6px;
    padding: 9px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.3);
    transition: opacity .5s ease; opacity: 1; pointer-events: none;
}
.dupd-toast.dupd-toast-out { opacity: 0; }

/* ── Bouton « Dupliquer » des fiches ───────────────────────────────────────────────────────────── */
/* Fiche document (mini toolbar .dd-actbtns, masqué en fiche réduite avec tout .dd-actbtns — style.css) :
   même gabarit que le trio Aperçu / Imprimer / Email et le bouton Étiquettes. */
.dd-actbtns .dupd-fiche-btn {
    border: 1px solid var(--gray-200, #e5e7eb); background: var(--white, #fff); border-radius: 6px;
    width: 30px; height: 28px; cursor: pointer; font-size: 13px; color: var(--gray-600, #4b5563);
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dd-actbtns .dupd-fiche-btn:hover:not(:disabled) {
    background: var(--blue-pale, #eff6ff); color: var(--blue-mid, #2563eb); border-color: var(--blue-light, #93c5fd);
}
/* Fiche transfert (en-tête bleu) : même gabarit que .tr-etiq-btn. */
.tr-header .dupd-fiche-btn {
    background: rgba(255,255,255,.15); color: #fff; border: 0;
    width: 30px; height: 30px; border-radius: 4px; cursor: pointer; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center; margin-left: 4px;
}
.tr-header .dupd-fiche-btn:hover:not(:disabled) { background: rgba(255,255,255,.28); }
.dupd-fiche-btn:disabled { opacity: .45; cursor: not-allowed; }
/* §7.43 : en fiche réduite, seuls titre + réduire + fermer restent visibles. */
.dti-minimized .dupd-fiche-btn { display: none !important; }
