/* ═══════════════════════════════════════════════════════════
   DTISoft — Document Detail Popup
   ═══════════════════════════════════════════════════════════ */

.dd-overlay {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
}
/* Bloc « création note de crédit interdite » (orpheline hors doc-suite) */
.dd-nc-block { max-width: 560px; padding: 26px 30px; line-height: 1.55; font-size: 14px; color: #1e293b; }
.dd-nc-block p { margin: 0 0 12px; }
.dd-nc-block .fa-info-circle { color: #d97706; margin-right: 6px; }
.dd-nc-block-hint { color: #64748b; font-size: 12.5px; }
.dd-nc-block kbd { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 4px; padding: 1px 5px; font-size: 11px; }
.dd-overlay-min {
    background: transparent;
    pointer-events: none;
    align-items: flex-end; justify-content: flex-start;
    padding: 0 0 40px 8px;
}
.dd-overlay-min .dd-panel { pointer-events: auto; }

.dd-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
    width: 90vw; height: 95vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    font-size: 14px;
    transition: width .2s, height .2s, border-radius .2s;
}
.dd-panel.dd-minimized {
    width: 320px; height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.dd-panel.dd-minimized .dd-content { display: none; }
.dd-panel.dd-minimized .dd-statusbar { display: none; }

.dd-loading {
    padding: 40px; text-align: center; color: var(--gray-400); font-size: 16px;
    flex: 1; display: flex; align-items: center; justify-content: center;
}

/* ── Header ──────────────────────────────────────────────── */
.dd-header {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px;
    background: var(--gray-100); border-bottom: 1px solid var(--gray-200);
    flex: 0 0 auto;
}
.dd-title { font-weight: 700; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Situation juridique tiers (BCE / INSEE) à droite du nom client : pastille icône + libellé italique coloré */
.dd-tier-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    cursor: help;
    user-select: none;
    vertical-align: 1px;
}
.dd-tier-status-icon {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.dd-tier-status-text {
    font-style: italic;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2px;
}
.dd-tier-status.risk-green  .dd-tier-status-icon { background: #16a34a; }
.dd-tier-status.risk-orange .dd-tier-status-icon { background: #ea580c; }
.dd-tier-status.risk-gray   .dd-tier-status-icon { background: #6b7280; }
.dd-tier-status.risk-red    .dd-tier-status-icon {
    background: #dc2626;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .7);
    animation: dd-tier-pulse 1.8s ease-in-out infinite;
}
.dd-tier-status.risk-green  .dd-tier-status-text { color: #16a34a; }
.dd-tier-status.risk-orange .dd-tier-status-text { color: #c2410c; }
.dd-tier-status.risk-gray   .dd-tier-status-text { color: #4b5563; }
.dd-tier-status.risk-red    .dd-tier-status-text { color: #b91c1c; }
@keyframes dd-tier-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); }
    50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
/* Paperclip button */
.dd-pj-btn {
    border: 1px solid var(--gray-200); background: var(--white); border-radius: 6px;
    padding: 4px 10px; cursor: pointer; font-size: 16px; color: var(--gray-500);
    flex: 0 0 auto; display: flex; align-items: center; gap: 4px;
}
.dd-pj-btn { position: relative; transition: background .15s ease, color .15s ease; }
.dd-pj-btn:hover { background: var(--gray-50); color: var(--gray-700); }
/* Badge « notification » du bouton PJ = total de la chaîne doc-suite. */
.dd-pj-badge {
    position: absolute; top: -7px; right: -7px;
    min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    background: var(--gray-500); color: #fff; border-radius: 9px;
    font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
    border: 2px solid var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
/* Des PJ héritées d'autres documents de la chaîne existent → badge bleu. */
.dd-pj-badge-chain { background: #2563eb; }

/* Back-Orders button (journaux clients) + badge « notifications non lues » */
.dd-bo-btn {
    position: relative;
    border: 1px solid var(--gray-200); background: var(--white); border-radius: 6px;
    padding: 4px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--gray-600);
    flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dd-bo-btn i { color: #b45309; }
.dd-bo-btn:hover { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
/* Bouton PRPs — même gabarit que Back-Orders (il partage `.dd-bo-badge`), mais
   une teinte distincte : les deux boutons sont côte à côte et comptent des
   choses différentes (lignes de commande ouvertes vs bons de préparation). */
.dd-prp-btn {
    position: relative;
    border: 1px solid var(--gray-200); background: var(--white); border-radius: 6px;
    padding: 4px 10px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--gray-600);
    flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dd-prp-btn i { color: #7c3aed; }
.dd-prp-btn:hover { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.dd-bo-badge {
    position: absolute; top: -7px; right: -7px;
    min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    background: #dc2626; color: #fff; border-radius: 9px;
    font-size: 10px; font-weight: 700; line-height: 18px; text-align: center;
    border: 2px solid var(--white); box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
/* Popup Back-Orders : lignes des journaux sans droit de LECTURE retirées par le serveur
   (api/client-backorders.php → `masques`, 2026-09-30) — seul leur NOMBRE est affiché, en tête
   du corps (visible sans défiler) ; dans l'état vide, sous « Aucun back-order ouvert visible. ». */
.dd-bo-masques {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 16px; font-size: 12px; line-height: 1.4;
    color: var(--gray-500); background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.dd-bo-masques i { flex: 0 0 auto; color: var(--gray-400); }
.dd-bo-empty + .dd-bo-masques { justify-content: center; border-bottom: 0; border-top: 1px solid var(--gray-200); }
/* Liste Back-Orders TRONQUÉE (plafond SQL de 1000 lignes, drapeau serveur `truncated` — F11/F13, 2026-09-30) :
   avertissement du pied, et état vide qui ne prétend pas « aucun back-order ». Double classe sur l'état vide :
   les styles `.dd-bo-*` injectés par le JS (_injectBoStyles) arrivent APRÈS cette feuille. */
.dd-bo-tronque { color: #b91c1c; }
.dd-bo-empty.dd-bo-empty-tronque { color: #b45309; }
.dd-bo-empty.dd-bo-empty-tronque i { color: #d97706; }

/* Aperçu / Imprimer / Email (icône seule) — trio du toolbar principal, près de Back-Orders */
.dd-actbtns { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.dd-preview-btn, .dd-print-btn, .dd-email-btn, .dd-email-var-btn {
    border: 1px solid var(--gray-200); background: var(--white); border-radius: 6px;
    width: 30px; height: 28px; cursor: pointer; font-size: 13px; color: var(--gray-600);
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dd-preview-btn:hover, .dd-print-btn:hover, .dd-email-btn:hover { background: var(--blue-pale); color: var(--blue-mid); border-color: var(--blue-light); }
/* Étiquettes (2026-10-01) : même gabarit que le trio Aperçu / Imprimer / Email ; désactivé tant que le document n'est
   pas enregistré (info-bulle). Masqué en fiche réduite avec tout .dd-actbtns (style.css). */
.dd-etiq-btn {
    border: 1px solid var(--gray-200); background: var(--white); border-radius: 6px;
    width: 30px; height: 28px; cursor: pointer; font-size: 13px; color: var(--gray-600);
    flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dd-etiq-btn:hover:not(:disabled) { background: var(--blue-pale); color: var(--blue-mid); border-color: var(--blue-light); }
.dd-etiq-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Envoi sous un TITRE alternatif (ex. « Confirmation de commande » sur CO1).
   ⚠️ Teinte ambre volontaire : le bouton voisin est lui aussi une enveloppe et
      déclenche lui aussi un envoi RÉEL à un client. Deux icônes quasi identiques
      en gris, et on envoie le mauvais document sans s'en apercevoir — un mail
      parti ne se rattrape pas. La couleur, elle, se voit avant le clic. */
.dd-email-var-btn { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.dd-email-var-btn:hover { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.dd-save-btn {
    border: 1px solid #2563eb; background: #2563eb; color: #fff; border-radius: 6px;
    padding: 5px 16px; cursor: pointer; font-size: 12px; font-weight: 600;
    flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.dd-save-btn:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; box-shadow: 0 2px 4px rgba(37,99,235,.25); }
.dd-save-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

/* Bouton « Payer » (encaissement depuis CO1/NEV/VENS) — même famille bleue */
.dd-payer-btn {
    border: 1px solid #2563eb; background: #fff; color: #1d4ed8; border-radius: 6px;
    padding: 5px 14px; cursor: pointer; font-size: 12px; font-weight: 600;
    flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
    transition: background .15s ease, color .15s ease;
}
.dd-payer-btn:hover:not(:disabled) { background: #2563eb; color: #fff; }
.dd-payer-btn:disabled, .dd-payer-btn.dd-payer-done {
    background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-300); cursor: default;
}
.dd-save-btn:disabled, .dd-save-btn-saved {
    background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-300);
    cursor: default; box-shadow: none;
}
.dd-save-btn-saved i { color: var(--gray-500); }

/* Ligne dont le prix vient de changer : repère visuel qui s'estompe.
   Sélecteur `.dd-grid tbody` : le <tbody> de la grille n'a AUCUNE classe (l'ancien `.dd-items-tbody` ne
   s'appliquait jamais — A01, 2026-09-30). Fondu vers le fond NORMAL de la cellule : keyframe `to` omise et
   pas de `forwards` — sinon `transparent` restait imposé après l'animation (la classe n'est retirée qu'au
   prochain rendu) et effaçait les fonds « perte », « déjà reporté » et des colonnes diagnostic. */
@keyframes ddReprice { from { background: #fef9c3; } }
.dd-grid tbody tr.dd-row-reprice > td { animation: ddReprice 2.4s ease-out; }

/* ── Overlay de confirmation (recalcul des prix, bilan) ───────────────────
   Même famille visuelle que .dd-keycode-overlay. z-index au-dessus de la
   fiche : celle-ci est déjà un overlay. */
.dd-confirm-overlay {
    position: fixed; inset: 0; z-index: 10300; background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center;
}
.dd-confirm-box {
    background: #fff; border-radius: 10px; width: min(520px, 94vw); max-height: 90vh; overflow-y: auto;
    box-shadow: 0 18px 50px rgba(15,23,42,.35); outline: none;
}
.dd-confirm-title {
    display: flex; align-items: center; gap: 8px; padding: 13px 18px; border-bottom: 1px solid var(--gray-200);
    font-weight: 700; color: #1e3a8a; font-size: 14px;
}
.dd-confirm-body { padding: 14px 18px; font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.dd-confirm-body p { margin: 0 0 8px; }
.dd-confirm-list { margin: 8px 0 0; padding-left: 18px; }
.dd-confirm-list li { margin-bottom: 4px; }
.dd-confirm-note { color: var(--gray-500); font-size: 12.5px; }
.dd-confirm-err { color: #b91c1c; background: #fef2f2; border-radius: 5px; padding: 7px 10px; margin-top: 10px; }
/* Lignes protégées (tarif calculé à 0, prix existant conservé) : information,
   pas erreur — le garde-fou a fait son travail. */
.dd-confirm-warn { color: #92400e; background: #fffbeb; border-radius: 5px; padding: 7px 10px; margin-top: 10px; }
.dd-confirm-warn .dd-confirm-note { color: #a16207; }
.dd-confirm-btns {
    display: flex; justify-content: flex-end; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--gray-200);
}
.dd-confirm-btns button {
    border: 1px solid var(--gray-300); background: #fff; border-radius: 6px; padding: 6px 14px;
    cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--gray-700);
}
.dd-confirm-btns button:hover { background: var(--gray-100); }
.dd-confirm-ok { background: #2563eb !important; border-color: #2563eb !important; color: #fff !important; }
.dd-confirm-ok:hover { background: #1d4ed8 !important; }

.dd-prepare-btn {
    border: 1px solid #16a34a; background: #16a34a; color: #fff; border-radius: 6px;
    padding: 5px 14px; cursor: pointer; font-size: 12px; font-weight: 600;
    flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-right: 6px;
    transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.dd-prepare-btn:hover { background: #15803d; border-color: #15803d; box-shadow: 0 2px 4px rgba(22,163,74,.25); }
.dd-prepare-btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(0,0,0,.1); }

.dd-solde-box {
    text-align: right; padding: 4px 14px;
    border-radius: 6px; border: 1px solid var(--gray-200); background: var(--white);
    flex: 0 0 auto;
    transition: opacity .15s ease, box-shadow .15s ease;
}
.dd-solde-label { font-size: 10px; color: var(--gray-400); display: block; }
.dd-solde-val { font-weight: 700; font-size: 16px; }
.dd-solde-pos .dd-solde-val { color: var(--gray-700); }
.dd-solde-neg .dd-solde-val { color: #16a34a; }
/* 2026-10-12 (demande utilisateur) : noir = ouvert NON échu, rouge = échu. Un solde qui contient de l'échu s'affiche
   sur DEUX lignes (ddSoldeAfficher) : « En cours » (#ddSoldeVal, noir) puis « Échu » (#ddSoldeEchu, rouge).
   Avant : une seule valeur, toute rouge dès qu'il y avait de l'échu. */
.dd-solde-echu .dd-solde-val { color: var(--gray-700); font-size: 13px; display: block; white-space: nowrap; }
.dd-solde-echu-val { display: block; font-weight: 700; font-size: 13px; color: #dc2626; white-space: nowrap; }
.dd-solde-echu-val[hidden] { display: none !important; }   /* §7.41 : une classe qui déclare display annule [hidden] */
.dd-solde-lib { font-weight: 400; font-size: 10px; margin-right: 6px; }
.dd-solde-box:hover { opacity: .8; }

.dd-winctrls { display: flex; gap: 2px; flex: 0 0 auto; }
.dd-winbtn {
    background: none; border: none; cursor: pointer;
    font-size: 14px; color: var(--gray-500); padding: 4px 8px;
    border-radius: 3px;
}
.dd-winbtn:hover { background: var(--gray-200); color: var(--gray-700); }
.dd-close-btn:hover { background: #dc2626; color: #fff; }

/* ── Content wrapper ─────────────────────────────────────── */
.dd-content {
    flex: 1; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
}

/* ── Field rows ──────────────────────────────────────────── */
.dd-row {
    display: flex; gap: 6px; padding: 4px 12px; align-items: flex-end;
    flex: 0 0 auto;
}
.dd-row-top { padding-top: 8px; }
.dd-row-sub { padding-top: 0; }
/* Post-it « Mémo » du client (Tiers.Notes) : bloc jaune poussé à droite de la 1re ligne. */
.dd-memo-postit {
    margin-left: auto;                 /* pousse le post-it à l'extrême droite de la ligne */
    align-self: center;
    flex: 0 1 260px; max-height: 56px; overflow: auto;
    background: #fef08a; color: #57534e;
    border: 1px solid #eab308; border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    padding: 5px 9px 6px; font-size: 12px; line-height: 1.3;
    white-space: pre-wrap; word-break: break-word;
}
.dd-memo-postit::before {
    content: "\1F4DD Mémo";            /* 📝 */
    display: block; font-weight: 700; font-size: 9.5px;
    color: #a16207; margin-bottom: 1px; letter-spacing: .03em;
    position: sticky; top: 0; background: #fef08a;
}
/* Traduction (T3b1) : hors français, le titre vient de l'attribut posé par le JS (français : règle ci-dessus, inchangée). */
.dd-memo-postit[data-dd-ph]::before { content: attr(data-dd-ph); }
.dd-memo-postit[hidden] { display: none; }
.dd-fld { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dd-fld label { font-size: 11px; color: var(--gray-500); white-space: nowrap; line-height: 1.2; }
.dd-fld input, .dd-fld textarea, .dd-fld select {
    border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 4px 8px; font-size: 13px; font-family: inherit;
    background: #ffffff; color: #1f2937;
    min-width: 0; height: 28px; box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.dd-fld input:hover:not([readonly]):not(:focus),
.dd-fld textarea:hover:not([readonly]):not(:focus),
.dd-fld select:hover:not(:disabled):not(:focus) {
    border-color: #d1d5db;
}
.dd-fld input:focus, .dd-fld textarea:focus, .dd-fld select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.dd-fld input[readonly], .dd-fld textarea[readonly] {
    background: #eef0f3; color: #6b7280; cursor: default; border-color: #e5e7eb;
}
.dd-fld input[readonly]:hover, .dd-fld textarea[readonly]:hover { border-color: #e5e7eb; }
.dd-fld select { cursor: pointer; }
.dd-fld select:disabled { background: #eef0f3; color: #9ca3af; cursor: default; border-color: #e5e7eb; }
.dd-fld textarea { height: auto; resize: none; }
.dd-fld-grow { flex: 1; min-width: 0; }

/* ── Autocomplete searchbar ──────────────────────────────── */
.dd-ac-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.dd-ac-wrap .dd-ac-input { width: 100%; }
.dd-ac-icon { position: absolute; left: 5px; font-size: 10px; color: var(--gray-400); z-index: 1; pointer-events: none; }
.dd-ac-input { padding-left: 20px !important; }
.dd-ac-input[readonly] + .dd-ac-list { display: none !important; }
.dd-ac-list {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    z-index: 200; background: var(--white);
    border: 1px solid var(--gray-300); border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 160px; overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.dd-ac-item {
    padding: 4px 8px; font-size: 12px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-ac-item:hover { background: var(--blue-pale); }
.dd-ac-active { background: var(--blue-pale); font-weight: 600; }

/* ── Ref search active item ──────────────────────────────── */
.dd-ref-active { background: var(--blue-pale); }

/* ── Bouton « Voir la table de remise » (colonne Formule) ───
   Était en 9px gris pâle SANS bordure ni fond : une pastille de quelques
   pixels collée derrière le texte de la formule, que personne ne voyait
   (signalé le 2026-07-28 — « je ne le vois pas quand j'ouvre une OFF »).
   Il lui fallait une forme de bouton pour se distinguer du texte voisin. */
.dd-remise-btn {
    border: 1px solid var(--gray-300); background: var(--white); cursor: pointer;
    color: var(--primary); font-size: 10px; line-height: 1;
    padding: 2px 5px; margin-left: 5px; border-radius: 3px;
    display: inline-flex; align-items: center; vertical-align: middle;
    transition: background .12s, border-color .12s, color .12s;
}
.dd-remise-btn:hover { background: var(--blue-pale); border-color: var(--blue-light); color: var(--blue-mid); }
.dd-remise-btn:active { background: var(--gray-100); }

/* ── « Prix par quantité » (paliers, § 7.24 : SONDÉS au moteur) ─────────── */
.dd-paliers-btn {
    border: 1px solid var(--gray-300); background: var(--white); cursor: pointer;
    color: var(--gray-500); font-size: 10px; line-height: 1;
    padding: 2px 5px; margin-left: 5px; border-radius: 3px;
    display: inline-flex; align-items: center; vertical-align: middle;
    transition: background .12s, border-color .12s, color .12s;
}
.dd-paliers-btn:hover { background: var(--blue-pale); border-color: var(--blue-light); color: var(--primary); }
.dd-paliers-pop {
    position: fixed; z-index: 10200; background: #fff; border: 1px solid #cbd5e1;
    border-radius: 6px; box-shadow: 0 12px 32px rgba(15,23,42,.22);
    padding: 10px 12px; min-width: 280px; max-width: calc(100vw - 16px);
}
.dd-paliers-t { font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.dd-paliers-tb { border-collapse: collapse; font-size: 12px; width: 100%; }
.dd-paliers-tb th {
    text-align: right; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
    color: #94a3b8; padding: 2px 8px; border-bottom: 1px solid var(--gray-200);
}
.dd-paliers-tb th:first-child { text-align: left; }
.dd-paliers-tb td { padding: 3px 8px; border-bottom: 1px solid var(--gray-100); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dd-paliers-tb tbody tr { cursor: pointer; }
.dd-paliers-tb tbody tr:hover { background: var(--gray-50); }

/* ── A1 (2026-10-28) : repère « Meilleur prix à partir de X pièces » dans la cellule Qté — même code visuel que le
   badge « palier supérieur moins cher » des commandes fournisseurs automatiques (.rf-tier-hint, violet). La cellule
   devient le repère de position du bouton ; la saisie garde la place à droite. */
.dd-grid td.dd-mpq-td { position: relative; }
.dd-grid td.dd-mpq-td .dd-cell-inp { padding-right: 34px; }
.dd-mpq-btn {
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    border: 1px solid #c4b5fd; background: #f5f3ff; color: #7c3aed;
    font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap;
    padding: 2px 4px; border-radius: 8px; cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}
.dd-mpq-btn:hover { background: #ede9fe; border-color: #8b5cf6; color: #5b21b6; }

/* Vente à PERTE (journaux clients) : marge/bénéfice négatifs — même code
   visuel que la table des remises (.rd-perte) */
.dd-grid td.dd-perte { color: #b91c1c; font-weight: 700; background: #fef2f2; }

/* Popup « Impayés échus » : survol + ligne sélectionnée (simple clic) */
.dd-echu-table .dd-echu-doc:hover { background: var(--gray-50); }
.dd-echu-table .dd-echu-doc.dd-echu-sel { background: var(--blue-pale); }
/* Revue r3 (2026-10-08) : textes allongés (notes + puces) ⇒ la popup dépassait 860 px et l'overlay centré la rognait
   en haut ET en bas, sans défilement (1366×768 : bouton Fermer hors écran). Hauteur bornée à l'écran : le CORPS défile,
   les boutons (Revérifier / Autoriser / Fermer) restent toujours visibles en bas. */
.dd-echu-blocked-overlay .dd-risk-alert { max-height: calc(100vh - 24px); display: flex; flex-direction: column; box-sizing: border-box; }
.dd-echu-blocked-overlay .dd-echu-corps { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.dd-echu-blocked-overlay .dd-echu-boutons { flex: 0 0 auto; padding-top: 10px; }

/* Cases « À actualiser » de la fenêtre Recalculer les prix */
.dd-refresh-choix { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 8px 8px; }
.dd-refresh-choix label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; }
.dd-paliers-r { text-align: right; }
.dd-paliers-actif { background: var(--blue-pale); font-weight: 700; }
.dd-paliers-perte { color: #b91c1c; font-weight: 700; }
.dd-paliers-load { font-size: 12px; color: var(--gray-500); padding: 4px 2px; }
.dd-paliers-note { font-size: 11px; color: #94a3b8; margin-top: 6px; }
/* La formule et son bouton restent sur une seule ligne : sans ça, une formule
   un peu longue renvoie le bouton à la ligne suivante, où il passe inaperçu. */
.dd-grid td[data-col-id="formule"] { white-space: nowrap; }
.dd-formule-text { vertical-align: middle; }
/* « ? » — formule présente mais origine introuvable (lien orphelin ou jamais
   renseigné). Volontairement DISCRET et non cliquable : il informe, il ne
   promet pas d'ouvrir une fiche qui n'existe plus. L'infobulle explique quoi
   faire (bouton « Prix »). */
.dd-remise-stale {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; margin-left: 5px; vertical-align: middle;
    border: 1px dashed var(--gray-400); border-radius: 3px;
    color: var(--gray-500); font-size: 9px; font-weight: 700; cursor: help;
}
.dd-remise-stale:hover { border-color: var(--gray-500); color: var(--gray-700); background: var(--gray-50); }

/* ── Historique des prix de vente (bouton « Historique ») ─────────────────
   Fenêtre large : deux tableaux de 7 et 10 colonnes, illisibles à l'étroit. */
.dd-histo-prix-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 3px 9px; font-size: 12px; line-height: 1.4;
    background: var(--white); color: var(--gray-700);
    border: 1px solid var(--gray-300); border-radius: 3px;
    cursor: pointer; white-space: nowrap; font-weight: 500;
}
.dd-histo-prix-btn:hover { background: var(--blue-pale); border-color: var(--blue-light); color: var(--blue-mid); }
.dd-histo-prix-btn i { font-size: 11px; color: var(--gray-500); }
.dd-histo-prix-btn:hover i { color: var(--blue-mid); }

.dd-histo-box {
    background: #fff; border-radius: 10px; width: min(1180px, 96vw);
    max-height: 92vh; display: flex; flex-direction: column;
    box-shadow: 0 18px 50px rgba(15,23,42,.35); outline: none;
}
.dd-histo-box .dd-confirm-body { overflow-y: auto; }
.dd-histo-close {
    margin-left: auto; border: none; background: none; cursor: pointer;
    color: var(--gray-400); font-size: 20px; line-height: 1; padding: 0 4px;
}
.dd-histo-close:hover { color: #dc2626; }
.dd-histo-art { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 10px; }
.dd-histo-mut { color: var(--gray-500); font-weight: 400; }
.dd-histo-t {
    display: flex; align-items: center; gap: 12px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--gray-500); margin: 4px 0 5px;
}
.dd-histo-t--doc { margin-top: 16px; }
.dd-histo-radio { display: flex; gap: 12px; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: var(--gray-700); }
.dd-histo-radio label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
/* Chaque tableau scrolle DANS son cadre : sinon la fenêtre entière défile et
   on perd les en-têtes de colonnes. */
.dd-histo-scroll { max-height: 34vh; overflow: auto; border: 1px solid var(--gray-200); border-radius: 5px; }
.dd-histo-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.dd-histo-tbl th {
    position: sticky; top: 0; z-index: 1;
    background: var(--gray-100); padding: 5px 7px; text-align: left;
    font-weight: 600; font-size: 10.5px; color: var(--gray-600);
    border-bottom: 1px solid var(--gray-300); white-space: nowrap;
}
.dd-histo-tbl td { padding: 3px 7px; border-bottom: 1px solid var(--gray-100); white-space: nowrap; }
.dd-histo-tbl tbody tr:hover { background: var(--blue-pale); }
.dd-histo-tbl code { font-family: Consolas, monospace; font-size: 11px; color: #1e3a8a; }
.dd-histo-clic { cursor: pointer; }
.dd-histo-clic:hover { background: var(--blue-pale); }
.dd-histo-sep td {
    background: var(--gray-50); font-size: 10.5px; font-weight: 700; color: var(--gray-500);
    text-transform: uppercase; letter-spacing: .03em; padding: 5px 7px;
}
.dd-histo-vide { color: var(--gray-500); font-style: italic; padding: 12px 7px; }
/* Lignes de documents reprenables par double-clic. `user-select: none` évite
   le surlignage bleu de texte que produit tout double-clic dans un tableau. */
.dd-histo-appl { cursor: pointer; user-select: none; }
.dd-histo-appl:hover { background: var(--blue-pale); }
.dd-histo-appl:active { background: #dbeafe; }
.dd-histo-aide {
    margin: 8px 0 0; font-size: 11.5px; color: var(--gray-600);
    display: flex; align-items: center; gap: 6px;
}
.dd-histo-aide i { color: var(--blue-mid); }
.dd-histo-aide--off { color: var(--gray-500); font-style: italic; }
.dd-histo-aide--off i { color: var(--gray-400); }
/* « Manuel » = prix saisi à la main, pas de condition : c'est une information
   utile, pas une anomalie — d'où un gris neutre et non un rouge. */
.dd-histo-manuel { color: var(--gray-500); font-style: italic; }

/* ── Livraison column : date input + recompute (↻) button ── */
.dd-liv-wrap { display: flex; align-items: center; gap: 2px; }
.dd-liv-wrap input[type="date"] {
    border: none; background: transparent; font: inherit; color: inherit;
    width: 108px; padding: 1px 2px;
}
.dd-liv-recalc-btn {
    border: none; background: none; cursor: pointer; color: var(--gray-400);
    font-size: 10px; padding: 0 2px; display: inline-flex; align-items: center; flex: 0 0 auto;
}
.dd-liv-recalc-btn:hover { color: var(--primary); }
.dd-grid th[data-col-id="delai"], .dd-grid td[data-col-id="delai"] { text-align: center; }
.dd-grid th[data-col-id="livraison"] { min-width: 128px; }

/* ── KeyCode popup ───────────────────────────────────────── */
.dd-keycode-overlay {
    /* z-index 13000 : le prompt de code doit passer AU-DESSUS de tout overlay qui
       peut l'ouvrir — notamment « Impayés échus » (.dd-risk-alert-overlay 10010,
       bouton « Autoriser (code responsable) ») et le palier 12000 (paiement /
       confirmations). À 10000 il s'ouvrait DERRIÈRE le popup échu (bug 2026-09-28). */
    position: fixed; inset: 0; z-index: 13000;
    background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center;
}
.dd-keycode-box {
    background: var(--white); border-radius: 8px; padding: 20px 24px;
    width: 300px; box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.dd-keycode-title {
    font-size: 14px; font-weight: 700; margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px; color: var(--gray-700);
}
.dd-keycode-input {
    width: 100%; box-sizing: border-box; padding: 8px 12px;
    border: 1px solid var(--gray-300); border-radius: 4px;
    font-size: 14px; font-family: inherit;
}
.dd-keycode-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.dd-keycode-error { color: #dc2626; font-size: 12px; margin-top: 6px; }
.dd-keycode-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dd-keycode-cancel {
    padding: 6px 16px; border: 1px solid var(--gray-300); border-radius: 4px;
    background: var(--white); cursor: pointer; font-size: 13px;
}
.dd-keycode-cancel:hover { background: var(--gray-50); }
.dd-keycode-ok {
    padding: 6px 20px; border: 1px solid #222; border-radius: 4px;
    background: #222; color: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
}
.dd-keycode-ok:hover { background: #444; }
.dd-chk-inline { flex-direction: row; align-items: center; gap: 4px; }
.dd-chk { font-size: 13px; color: var(--gray-600); display: flex; align-items: center; gap: 4px; cursor: default; }
/* Badge « Payé » (mode de paiement réel via DocPaiements) */
.dd-paye-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600; color: #16a34a;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 4px;
    padding: 2px 8px; white-space: nowrap;
}

/* ── Tabs ────────────────────────────────────────────────── */
.dd-tabs {
    display: flex; gap: 0; padding: 0 12px;
    border-bottom: 1px solid var(--gray-200);
    margin-top: 4px; flex: 0 0 auto;
    align-items: stretch;
}
.dd-tab {
    padding: 5px 14px; font-size: 13px; cursor: pointer;
    border: 1px solid transparent; border-bottom: none;
    border-radius: 3px 3px 0 0; color: var(--gray-500);
    margin-bottom: -1px;
}
.dd-tab:hover { color: var(--gray-700); background: var(--gray-50); }
.dd-tab.active {
    background: var(--white); color: var(--gray-800);
    border-color: var(--gray-200); font-weight: 600;
}
.dd-tab-content { display: none; flex: 1; min-height: 0; overflow: hidden; }
.dd-tab-content.active { display: flex; flex-direction: column; }

/* ── Chain toolbar (prev / next / cmdOrigine) ────────────── */
.dd-chain-bar {
    margin-left: auto; display: flex; gap: 4px; align-items: center;
    padding-bottom: 2px;
}
.dd-chain-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; font-size: 12px; line-height: 1.4;
    background: var(--white); color: var(--gray-700);
    border: 1px solid var(--gray-300); border-radius: 3px;
    cursor: pointer; white-space: nowrap;
}
.dd-chain-btn:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-900); }
.dd-chain-btn:active { background: var(--gray-100); }
.dd-chain-btn[hidden] { display: none; }
.dd-chain-btn i { font-size: 11px; color: var(--gray-500); }
.dd-chain-btn:hover i { color: var(--gray-700); }
.dd-chain-lbl { font-weight: 500; }

/* ── Groupe ACTIONS de la sous-barre, À GAUCHE des boutons doc-suite ──────
   Destiné à accueillir d'autres boutons d'action sur le document. Le filet de
   séparation évite de confondre « agir sur ce document » (à gauche) et
   « naviguer dans la chaîne » (à droite) : deux gestes très différents.
   `margin-right: auto` sur ce groupe ne suffirait pas — c'est `.dd-chain-bar`
   qui porte déjà `margin-left: auto` ; on sépare donc par une bordure. */
.dd-actions-bar {
    display: flex; gap: 4px; align-items: center;
    padding-right: 8px; margin-right: 4px; border-right: 1px solid var(--gray-200);
}
.dd-actions-bar:empty { display: none; }          /* pas de filet orphelin */
/* Trio B / I / U : boutons carrés serrés, volontairement distincts des boutons
   à libellé de la sous-barre. `.dd-fmt-on` = bit actif sur la ligne visée. */
.dd-fmt-grp { display: inline-flex; gap: 2px; margin-right: 4px; }
.dd-fmt-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 24px; padding: 0; font-size: 13px; line-height: 1;
    background: var(--white); color: var(--gray-700);
    border: 1px solid var(--gray-300); border-radius: 3px;
    cursor: pointer; font-family: Georgia, 'Times New Roman', serif;
}
.dd-fmt-btn:hover:not(:disabled) { background: var(--blue-pale); border-color: var(--blue-light); color: var(--blue-mid); }
.dd-fmt-btn.dd-fmt-on { background: var(--blue-mid); border-color: var(--blue-mid); color: var(--white); }
.dd-fmt-btn:disabled { opacity: .4; cursor: default; }
/* Même gabarit que .dd-chain-btn : la sous-barre doit rester homogène. */
.dd-refresh-prix-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 3px 9px; font-size: 12px; line-height: 1.4; min-width: 78px;
    background: var(--white); color: var(--gray-700);
    border: 1px solid var(--gray-300); border-radius: 3px;
    cursor: pointer; white-space: nowrap; font-weight: 500;
}
.dd-refresh-prix-btn:hover:not(:disabled) { background: var(--blue-pale); border-color: var(--blue-light); color: var(--blue-mid); }
.dd-refresh-prix-btn:active:not(:disabled) { background: var(--gray-100); }
.dd-refresh-prix-btn:disabled { opacity: .7; cursor: default; }
.dd-refresh-prix-btn i { font-size: 11px; color: var(--gray-500); }
.dd-refresh-prix-btn:hover:not(:disabled) i { color: var(--blue-mid); }

/* ── Popup intermédiaire (split — plusieurs enfants) ───── */
.dd-chain-pick-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
}
.dd-chain-pick-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    min-width: 480px; max-width: 720px; max-height: 70vh;
    display: flex; flex-direction: column; overflow: hidden;
}
.dd-chain-pick-header {
    padding: 10px 14px; font-size: 14px; font-weight: 600;
    color: var(--gray-800); background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: 8px;
}
.dd-chain-pick-header i { color: var(--gray-500); }
.dd-chain-pick-close {
    margin-left: auto; background: transparent; border: 0; cursor: pointer;
    color: var(--gray-500); padding: 2px 6px; font-size: 14px;
}
.dd-chain-pick-close:hover { color: var(--gray-800); }
.dd-chain-pick-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    flex: 1; overflow: auto; display: block;
}
.dd-chain-pick-table thead {
    background: var(--gray-100); position: sticky; top: 0;
}
.dd-chain-pick-table th, .dd-chain-pick-table td {
    padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--gray-100);
}
.dd-chain-pick-table th { font-weight: 600; color: var(--gray-700); font-size: 12px; }
.dd-chain-pick-row { cursor: pointer; }
.dd-chain-pick-row:hover { background: var(--gray-50); }
.dd-chain-pick-row.active { background: #dbeafe; color: #1e3a8a; outline: none; }
.dd-chain-pick-row.active td { font-weight: 500; }
.dd-chain-pick-footer {
    padding: 8px 14px; font-size: 11px; color: var(--gray-500);
    background: var(--gray-50); border-top: 1px solid var(--gray-200);
}
.dd-chain-pick-hint { font-style: italic; }

/* ── Doc suite modals (F11) ─────────────────────────────── */
/* ⚠️ z-index AU-DESSUS de TOUTES les fiches (client .dd-overlay=8000,
   transfert .tr-overlay=9500, stock .sd-overlay=1000) : ce popup est lancé
   par F11 depuis n'importe quelle fiche, y compris la fiche TRANSFERT — à
   9100 il passait DERRIÈRE elle (signalé par l'utilisateur). Reste sous la
   visionneuse fx- (11800) et le verrou de session. */
.dd-suite-overlay {
    position: fixed; inset: 0; z-index: 10500;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
}
.dd-suite-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.35);
    min-width: 480px; max-width: 760px; max-height: 80vh;
    display: flex; flex-direction: column; overflow: hidden;
}
.dd-suite-panel-wide {
    min-width: 900px; max-width: 95vw; width: 1200px;
}
.dd-suite-header {
    padding: 10px 14px; font-size: 14px; font-weight: 600;
    color: var(--gray-700); background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: 8px;
}
.dd-suite-header i { color: var(--gray-500); }
.dd-suite-close {
    margin-left: auto; background: transparent; border: 0; cursor: pointer;
    color: var(--gray-500); padding: 2px 6px; font-size: 14px;
}
.dd-suite-close:hover { color: var(--gray-700); }
.dd-suite-subhead {
    padding: 6px 14px; font-size: 12px; color: var(--gray-500);
    border-bottom: 1px solid var(--gray-100); background: var(--white);
}
.dd-suite-subhead b { color: var(--gray-700); }

/* Tableau choix journal */
.dd-suite-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    flex: 1; overflow: auto; display: block;
}
.dd-suite-table thead { background: var(--gray-100); position: sticky; top: 0; z-index: 1; }
.dd-suite-table th, .dd-suite-table td {
    padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--gray-100);
}
.dd-suite-table th { font-weight: 600; color: var(--gray-700); font-size: 12px; }
.dd-suite-row { cursor: pointer; }
.dd-suite-row:hover { background: var(--gray-50); }
.dd-suite-row.active { background: #dbeafe; color: #1e3a8a; outline: none; }

/* Tableau sélection lignes */
.dd-suite-grid-wrap {
    flex: 1; overflow: auto; min-height: 0;
}
.dd-suite-grid {
    width: 100%; border-collapse: collapse; font-size: 12px;
}
.dd-suite-grid thead { background: var(--gray-100); position: sticky; top: 0; z-index: 1; }
.dd-suite-grid th, .dd-suite-grid td {
    padding: 4px 8px; border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}
.dd-suite-grid th {
    font-weight: 600; color: var(--gray-700); font-size: 11px;
    text-align: left; background: var(--gray-100);
}
.dd-suite-grid .dd-th-r { text-align: right; }
.dd-suite-grid .dd-th-c { text-align: center; width: 32px; }
.dd-suite-grid .dd-th-edit { background: #fef3c7; }
.dd-suite-grid tbody tr:hover { background: var(--gray-50); }
.dd-suite-grid .dd-suite-lib { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.dd-suite-qu {
    width: 80px; padding: 2px 4px; font-size: 12px;
    border: 1px solid var(--gray-300); border-radius: 2px;
    text-align: right;
}
.dd-suite-qu:focus { outline: 2px solid #3b82f6; border-color: #3b82f6; }

/* Couleurs lignes (stock) */
.dd-suite-grid tr.dd-row-rupture { background: #fee2e2; }
.dd-suite-grid tr.dd-row-rupture:hover { background: #fecaca; }
.dd-suite-grid tr.dd-row-partiel { background: #fed7aa; }
.dd-suite-grid tr.dd-row-partiel:hover { background: #fdba74; }
.dd-suite-grid td.dd-cell-rupture { color: #b91c1c; font-weight: 600; }

/* Footer + boutons */
.dd-suite-footer {
    padding: 8px 14px; font-size: 12px;
    background: var(--gray-50); border-top: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: 12px;
}
.dd-suite-hint { color: var(--gray-500); display: inline-flex; align-items: center; gap: 6px; }
.dd-leg {
    display: inline-block; width: 12px; height: 12px; border-radius: 2px;
    margin: 0 2px 0 8px; vertical-align: middle;
}
.dd-leg-rupture { background: #fee2e2; border: 1px solid #fca5a5; }
.dd-leg-partiel { background: #fed7aa; border: 1px solid #fdba74; }
.dd-suite-cancel, .dd-suite-ok {
    padding: 5px 14px; font-size: 13px; border-radius: 3px; cursor: pointer;
    border: 1px solid var(--gray-300); margin-left: 4px;
}
.dd-suite-cancel { background: var(--white); color: var(--gray-700); }
.dd-suite-cancel:hover { background: var(--gray-50); }
.dd-suite-ok { background: #1e40af; color: var(--white); border-color: #1e40af; font-weight: 600; }
.dd-suite-ok:hover { background: #1e3a8a; }
.dd-suite-ok i { margin-right: 4px; }

/* ── Grid (articles) ─────────────────────────────────────── */
.dd-grid-wrap {
    flex: 1; overflow: auto; min-height: 0;
}
.dd-grid {
    width: max-content; min-width: 100%; border-collapse: collapse; font-size: 13px;
}
.dd-grid thead { position: sticky; top: 0; z-index: 2; }
.dd-grid th {
    background: var(--gray-100); padding: 4px 6px;
    text-align: left; font-weight: 600; font-size: 11px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    border-right: 1px solid var(--gray-200);
    white-space: nowrap; position: sticky; top: 0;
}
.dd-grid th:last-child { border-right: none; }
.dd-grid td {
    padding: 2px 6px;
    border-bottom: 1px solid var(--gray-100);
    border-right: 1px solid var(--gray-100);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-grid td:last-child { border-right: none; }
.dd-grid tbody tr:hover { background: var(--blue-pale); }
.dd-th-num { width: 30px; min-width: 30px; text-align: center; }
.dd-th-lib { min-width: 360px; }
.dd-th-r { text-align: left; }
/* 190 px (et non 220) : plancher de la colonne Référence. Ce n'est qu'un
   PLANCHER — `field-sizing: content` (l. ~775) laisse la colonne s'élargir
   d'elle-même pour les références longues (moyenne réelle 11 caractères,
   maximum 40, 6,5 % dépassent 16). */
.dd-th-ref { min-width: 190px; }
.dd-th-qty { width: 50px; min-width: 50px; }
.dd-td-num { text-align: center; color: var(--gray-400); font-size: 11px; }
.dd-td-ref { font-weight: 600; color: var(--gray-700); min-width: 190px; }
.dd-td-lib { min-width: 360px; }
.dd-td-r { text-align: left; }
.dd-row-title td {
    font-weight: 700; background: var(--gray-50); padding: 5px 6px;
    color: var(--gray-700);
}
.dd-col-resize {
    position: absolute; top: 0; right: -2px; width: 5px; height: 100%;
    cursor: col-resize; z-index: 2;
}
.dd-col-resize:hover { background: var(--primary); opacity: .3; }
.dd-th-resizable { overflow: hidden; text-overflow: ellipsis; }
.dd-row-comment td { color: var(--gray-400); font-style: italic; font-size: 12px; }
.dd-row-total td { font-weight: 700; border-top: 1px solid var(--gray-300); }
/* Ligne 100 % reportée en doc suite (QuSuite == Qu) — docs client/fournisseur/
   transfert : fond légèrement grisé + texte atténué, pour faire ressortir les
   lignes restant à traiter. Les .dd-cell-inp étant transparents (color:inherit),
   le grisage traverse jusqu'au texte des cellules. */
.dd-grid tbody tr.dd-line-done td { background: #eef1f5; }
.dd-grid tbody tr.dd-line-done { color: #9aa5b4; }
.dd-grid tbody tr.dd-line-done:hover td { background: #e5e9ef; }
/* Colonnes diag « Stock Def » / « Casier Def » : valeurs calculées côté serveur (lecture seule, gris) */
.dd-th-def, .dd-td-def {
    background: #f8fafc;
    color: #64748b;
    font-style: italic;
    font-size: 11px;
}

/* ── Transport tab ───────────────────────────────────────── */
.dd-transport-form {
    padding: 12px; display: flex; flex-direction: column; gap: 4px;
    max-width: 500px; overflow-y: auto; flex: 1;
}

/* ── Popup Select ────────────────────────────────────────── */
.dd-popsel {
    border: 1px solid var(--gray-200); border-radius: 2px;
    padding: 3px 6px; font-size: 13px; background: var(--white);
    color: var(--gray-700); height: 26px; box-sizing: border-box;
    display: flex; align-items: center; cursor: pointer;
    user-select: none;
}
.dd-popsel:hover { border-color: var(--gray-400); }
.dd-popsel-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-popsel-arrow { font-size: 9px; color: var(--gray-400); margin-left: 6px; }

.dd-popsel-popup {
    position: fixed; z-index: 10000;
    background: var(--white); border: 1px solid var(--gray-300);
    border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.2);
    max-height: 260px; display: flex; flex-direction: column;
}
.dd-popsel-search {
    border: none; border-bottom: 1px solid var(--gray-200);
    padding: 6px 10px; font-size: 12px; font-family: inherit;
    outline: none;
}
.dd-popsel-list { overflow-y: auto; flex: 1; }
.dd-popsel-item {
    padding: 5px 10px; font-size: 12px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dd-popsel-item:hover { background: var(--blue-pale); }
.dd-popsel-active { background: var(--blue-pale); font-weight: 600; }
.dd-popsel-empty { color: var(--gray-400); font-style: italic; }

/* ── Editable grid cells (modern, flat, transparent) ─────── */
.dd-cell-inp {
    border: 1px solid transparent; border-radius: 4px;
    background: transparent; font-size: inherit; font-family: inherit;
    color: inherit; padding: 0 4px; margin: 0; width: 100%; box-sizing: border-box;
    outline: none; height: calc(100% - 2px);
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
    /* ⚠️ CLÉ DE LA LARGEUR DES COLONNES.
       Un <input> impose par défaut une largeur intrinsèque de 20 CARACTÈRES,
       quel que soit son contenu. `.dd-grid` étant en `width: max-content`
       (l. 680), c'était CET input — et non le texte affiché — qui fixait la
       largeur des colonnes : toutes les colonnes saisissables étaient bloquées
       à 170 px, même « TVA » (en-tête 35 px, valeur « 21 » 29 px).
       `width: 100%` ne corrige rien : un pourcentage est traité comme `auto`
       dans le calcul intrinsèque, on retombe donc sur les 20 caractères.
       `field-sizing: content` fait dimensionner l'intrinsèque sur le CONTENU
       réel : chaque colonne vaut alors max(en-tête, valeur la plus longue).
       Mesuré au navigateur sur la grille réelle à 29 colonnes :
       table 3211 px → 2335 px, TVA 170→37, % 170→47, Unité 170→51,
       Stock 170→52, Casier 170→63, P.U. 170→75 — et AUCUNE valeur tronquée
       (« 762.9600 » tient dans les 75 px de P.U.).
       `width: 100%` est conservé : la largeur UTILISÉE reste celle de la
       cellule, seul le calcul intrinsèque change. Vérifié aussi : quand la
       table déborde déjà de son conteneur (cas réel), taper dans une cellule
       n'élargit QUE cette colonne — les autres ne bougent pas d'un pixel.
       Navigateurs sans `field-sizing` : repli silencieux sur l'ancien
       comportement (colonnes à 170 px), aucune régression. */
    field-sizing: content;
}
/* Seule colonne dont le contenu peut être très long (un libellé de 100
   caractères ferait 616 px). On la borne à sa largeur actuelle : le plafond est
   posé sur la CELLULE et non sur l'input, afin que celui-ci continue de remplir
   toute la cellule (mesuré 373/386) au lieu d'être bridé à l'intérieur. */
.dd-td-lib { max-width: 373px; }
.dd-cell-inp:hover {
    background: rgba(59, 130, 246, .06);
    border-color: rgba(59, 130, 246, .15);
}
.dd-cell-inp:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .18);
    position: relative; z-index: 5;
}
.dd-cell-inp[readonly] {
    background: #eef0f3; color: #6b7280; cursor: default;
}
.dd-cell-inp[readonly]:hover {
    background: #eef0f3; border-color: transparent; box-shadow: none;
}

/* Cellules de la grille sans input éditable (calculées / readonly) */
.dd-item-row td:not(.dd-td-num):not(.dd-td-c):not([colspan]):not(:has(input)):not(:has(.dd-cell-inp)) {
    background: #eef0f3;
    color: #6b7280;
}

/* ── Article reference field with arrow ───────────────────── */
.dd-ref-wrap { position: relative; width: 100%; display: flex; align-items: center; }
.dd-ref-arrow {
    border: none; background: none; cursor: pointer; color: var(--gray-400);
    font-size: 10px; padding: 0 3px; flex-shrink: 0;
}
.dd-ref-arrow:hover { color: var(--primary); }
.dd-picker-row:hover { background: var(--blue-pale) !important; }
.dd-cell-inp.dd-r { text-align: left; }

/* ── Row selection ───────────────────────────────────────── */
.dd-item-row .dd-td-num { cursor: pointer; user-select: none; }
.dd-item-row .dd-td-num:hover { background: var(--blue-pale); }
.dd-row-sel td { background: rgba(59, 130, 246, .12) !important; }

        /* ── Mise en forme d'une ligne (boutons B / I / U) ────────────────
           ⚠️ Chaque règle doit cibler `td` ET `.dd-cell-inp`. Le texte visible
           des colonnes Réf., Qté, Libellé, PU, %… est à l'intérieur d'un
           <input>, et `.dd-cell-inp` (l. 762) n'hérite QUE font-size /
           font-family / color : la feuille de style du navigateur pose un
           `font:` sur les form controls, et une déclaration bat l'héritage.
           text-decoration ne traverse pas non plus un contrôle de formulaire
           (boîte inline atomique). Sans les deux sélecteurs, seules les ~8
           cellules calculées (rendues en <span>) changeraient d'aspect et le
           bouton passerait pour cassé. Même contrainte déjà rencontrée l. 1018
           pour l'italique de la colonne Casier des lignes groupées. */
        /* ⚠️ LE GRAS NE DOIT PAS ÊTRE `font-weight` ICI — il élargissait la grille.
           Mesuré au navigateur (grille réelle à 29 colonnes, conteneur 1728px) :
           `font-weight: 700` sur `.dd-cell-inp` fait passer le tableau de 3412 à
           3707 px, soit **+295 px**, chaque colonne portant un <input> gagnant
           exactement +23 px (170 → 193). La cause n'est pas le texte affiché mais
           la **largeur intrinsèque par défaut d'un <input>** — 20 caractères —
           recalculée dans la graisse ; `.dd-grid` étant en `width: max-content`
           (l. 680), tout le tableau suit.
           `-webkit-text-stroke` (+ `text-shadow` en repli hors Chromium) épaissit
           le glyphe SANS toucher à son avance : largeur mesurée identique au pixel
           près (383 px dans les deux cas), et delta 0 sur les 29 colonnes.
           Italique et souligné, eux, coûtent 0 px (mesuré) → attributs réels.
           ⚠️ Ceci ne concerne QUE la grille d'édition. Le PDF garde un
           `font-weight: bold` RÉEL (layouts/render-document.php ~l. 1157) : là il
           n'y a ni <input> ni largeur de colonne dictée par un contrôle. */
        .dd-fmt-b td, .dd-fmt-b .dd-cell-inp {
            -webkit-text-stroke: .35px currentColor;
            text-shadow: 0 0 .35px currentColor;
        }
        .dd-fmt-i td, .dd-fmt-i .dd-cell-inp { font-style: italic; }
        .dd-fmt-u td, .dd-fmt-u .dd-cell-inp { text-decoration: underline; }

        /* Ligne visée par les boutons de mise en forme. Un liseré à gauche
           plutôt qu'un fond : le fond est déjà pris par la sélection (.dd-row-sel),
           par la ligne soldée (.dd-line-done) et par le survol. */
        .dd-item-row.dd-row-cur > td:first-child { box-shadow: inset 3px 0 0 var(--blue-mid); }
.dd-new-row td { opacity: .5; }
.dd-new-row:focus-within td { opacity: 1; }

/* ── Context menu ────────────────────────────────────────── */
.dd-ctx-menu {
    position: fixed; z-index: 10001;
    background: var(--white); border: 1px solid var(--gray-300);
    border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.2);
    padding: 4px 0; min-width: 180px;
}
.dd-ctx-item {
    padding: 6px 12px; font-size: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
}
.dd-ctx-item:hover { background: var(--blue-pale); }
.dd-ctx-danger { color: #dc2626; }
.dd-ctx-danger:hover { background: #fee2e2; }
.dd-ctx-sep { height: 1px; background: var(--gray-200); margin: 3px 0; }

/* ── Footer area (charges + totals) ──────────────────────── */
.dd-footer-area {
    display: flex; gap: 10px; padding: 6px 12px;
    border-top: 1px solid var(--gray-200);
    flex: 0 0 auto; flex-wrap: nowrap; align-items: flex-start;
}
.dd-charges { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.dd-charges-row { display: flex; gap: 4px; align-items: flex-end; flex-wrap: nowrap; }
.dd-charges-row .dd-fld label { font-size: 9px; }
.dd-charges-row .dd-fld input { height: 22px; font-size: 12px; padding: 1px 4px; }
.dd-notes-fld { max-width: 50%; }
.dd-notes-fld textarea {
    width: 100%; border: 1px solid var(--gray-200);
    border-radius: 2px; padding: 3px 5px; font-size: 12px;
    background: var(--gray-50); font-family: inherit;
}

/* ── Totals block ────────────────────────────────────────── */
.dd-totals {
    flex: 0 0 220px; display: flex; flex-direction: column;
    border: 1px solid var(--gray-200); border-radius: 4px;
    padding: 6px 10px; background: var(--gray-50);
}
.dd-totals-info { flex: 0 0 180px; background: var(--white); }
.dd-tot-line {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 1px 0; font-size: 14px;
}
.dd-tot-line span:last-child { font-variant-numeric: tabular-nums; }
.dd-tot-sep { border-top: 1px solid var(--gray-200); padding-top: 2px; margin-top: 2px; }
.dd-tot-ttc {
    border-top: 2px solid var(--gray-400); padding-top: 3px; margin-top: 3px;
    font-weight: 700; font-size: 15px;
}
.dd-tot-big { color: #16a34a; font-size: 16px; }

/* ── Status bar ──────────────────────────────────────────── */
.dd-statusbar {
    display: flex; gap: 16px; padding: 5px 12px;
    background: var(--gray-50); border-top: 1px solid var(--gray-200);
    font-size: 11px; color: var(--gray-500);
    flex: 0 0 auto;
}

/* PJ popup */
.dd-pj-popup {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 200; background: var(--white); border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25); width: 560px; max-height: 400px;
    display: flex; flex-direction: column;
}
.dd-pj-header {
    padding: 8px 12px; font-weight: 700; font-size: 13px;
    background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
    border-radius: 6px 6px 0 0; display: flex; align-items: center; gap: 6px;
}
.dd-pj-header .dd-pj-close {
    margin-left: auto; border: none; background: none; cursor: pointer;
    color: var(--gray-500); font-size: 14px;
}
.dd-pj-grid-wrap { overflow-y: auto; flex: 1; }
.dd-pj-grid { width: 100%; border-collapse: collapse; font-size: 12px; }
.dd-pj-grid th { background: var(--gray-50); padding: 4px 8px; text-align: left; position: sticky; top: 0; border-bottom: 1px solid var(--gray-200); }
.dd-pj-grid td { padding: 4px 8px; border-bottom: 1px solid var(--gray-100); }
.dd-pj-row { cursor: pointer; }
.dd-pj-row:hover { background: var(--blue-pale); }
.dd-pj-footer {
    padding: 6px 12px; display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: var(--gray-500); border-top: 1px solid var(--gray-200);
}
.dd-pj-ok {
    padding: 4px 16px; border: 1px solid var(--gray-300); border-radius: 3px;
    background: var(--white); cursor: pointer; font-size: 12px;
}
.dd-pj-ok:hover { background: var(--gray-50); }

/* ── F12 — Merge / Import (Phase 3) ────────────────────── */
/* Réutilise .dd-suite-overlay comme conteneur d'arrière-plan */

.dd-merge-title {
    padding: 10px 14px; font-size: 14px; font-weight: 600;
    color: var(--gray-700); background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; gap: 8px;
}
.dd-merge-foot {
    padding: 8px 14px; background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex; justify-content: flex-end; gap: 8px;
}
.dd-merge-foot button {
    padding: 6px 16px; border: 1px solid var(--gray-300); border-radius: 3px;
    background: var(--white); cursor: pointer; font-size: 13px;
}
.dd-merge-cancel:hover { background: var(--gray-50); }
.dd-merge-import-go { background: var(--primary, #2563eb); color: #fff; border-color: var(--primary, #2563eb); }
.dd-merge-import-go:hover:not(:disabled) { background: #1d4ed8; }
.dd-merge-import-go:disabled { opacity: 0.5; cursor: not-allowed; }

/* Modal #1 — choix Document/Fichier */
.dd-merge-choice-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.35);
    min-width: 480px; max-width: 600px;
    display: flex; flex-direction: column; overflow: hidden;
}
.dd-merge-choices {
    display: flex; gap: 16px; padding: 24px;
}
.dd-merge-btn {
    flex: 1; padding: 24px 16px; border: 2px solid var(--gray-300); border-radius: 8px;
    background: var(--white); cursor: pointer; text-align: center;
    transition: border-color 0.1s, background 0.1s;
}
.dd-merge-btn i { font-size: 32px; color: var(--gray-500); margin-bottom: 8px; }
.dd-merge-btn-lbl { font-size: 16px; font-weight: 600; color: var(--gray-700); }
.dd-merge-btn-sub { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.dd-merge-btn:hover, .dd-merge-btn-focus { border-color: var(--primary, #2563eb); background: #eff6ff; }
.dd-merge-btn:hover i, .dd-merge-btn-focus i { color: var(--primary, #2563eb); }

/* Modal #2 — tableau de candidats Document */
.dd-merge-doc-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.35);
    min-width: 1100px; max-width: 95vw; width: 1400px; max-height: 85vh;
    display: flex; flex-direction: column; overflow: hidden;
    outline: none;
}
.dd-merge-doc-tablewrap {
    flex: 1; overflow: auto; min-height: 0;
}
.dd-merge-doc-table {
    width: 100%; border-collapse: collapse; font-size: 12px;
}
.dd-merge-doc-table thead {
    background: var(--gray-100); position: sticky; top: 0; z-index: 1;
}
.dd-merge-doc-table th, .dd-merge-doc-table td {
    padding: 4px 8px; border-bottom: 1px solid var(--gray-100); white-space: nowrap;
}
.dd-merge-doc-table th { font-weight: 600; color: var(--gray-700); font-size: 11px; text-align: left; }
.dd-merge-doc-table .dd-r { text-align: right; }
.dd-merge-doc-table tbody tr { cursor: pointer; }
.dd-merge-doc-table tbody tr:hover { background: var(--gray-50); }
.dd-merge-row-sel, .dd-merge-row-sel:hover { background: #dbeafe; }

/* Modal #3 — upload fichier (focus programmatique à l'ouverture pour recevoir Échap, 2026-09-30 : pas de
   liseré, comme les modals #2 et résultat) */
.dd-merge-file-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.35);
    min-width: 500px; max-width: 700px;
    display: flex; flex-direction: column; overflow: hidden;
    outline: none;
}
.dd-merge-file-body { padding: 16px; font-size: 13px; color: var(--gray-700); }
.dd-merge-file-body p { margin: 0 0 8px 0; }
.dd-merge-file-body ul { margin: 0 0 12px 20px; padding: 0; }
.dd-merge-file-body code { background: var(--gray-100); padding: 1px 6px; border-radius: 3px; font-family: monospace; }
.dd-merge-file-body input[type="file"] { display: block; margin-top: 8px; }
.dd-merge-file-status { margin-top: 12px; font-size: 12px; }

/* Modal résultat import */
.dd-merge-result-panel {
    background: var(--white); border-radius: 6px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.35);
    min-width: 520px; max-width: 800px; max-height: 80vh;
    display: flex; flex-direction: column; overflow: hidden;
    outline: none;
}
.dd-import-stats {
    padding: 12px 16px; font-size: 13px;
    display: flex; gap: 24px; border-bottom: 1px solid var(--gray-100);
}
.dd-import-stat-fail { color: #b91c1c; }
.dd-import-success { padding: 16px; color: #16a34a; font-size: 13px; }
.dd-import-errors-title { padding: 10px 16px 4px; font-size: 12px; font-weight: 600; color: var(--gray-700); }
.dd-import-errors-wrap { flex: 1; overflow: auto; padding: 0 16px 12px; min-height: 0; }
.dd-import-errors-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dd-import-errors-table th, .dd-import-errors-table td {
    padding: 4px 8px; border-bottom: 1px solid var(--gray-100); text-align: left;
}
.dd-import-errors-table th { background: var(--gray-50); color: var(--gray-700); font-weight: 600; font-size: 11px; }
.dd-import-errors-table tbody tr:hover { background: #fff7ed; }

/* ── Column drag reorder ─────────────────────────────────────── */
.dd-grid thead th.dd-th-draggable     { cursor: grab; }
.dd-grid thead th.dd-th-draggable:active { cursor: grabbing; }
.dd-grid thead th.dd-th-dragging      { opacity: .45; }
.dd-grid thead th.dd-th-drop-target   { box-shadow: inset 3px 0 0 0 #2563eb; }

/* ── Grouped row (Phase 5) ────────────────────────────────────── */
.dd-row-grouped { background: #f8fafc; }
.dd-row-grouped .dd-cell-inp { background: transparent; pointer-events: none; color: var(--gray-700); }
.dd-row-grouped .dd-ref-arrow { display: none; }
.dd-row-grouped td[data-item-field="Casier"] input,
.dd-row-grouped input[data-item-field="Casier"] { font-style: italic; }

/* ── Stock availability cell coloring (Phase 3) ───────────────── */
.dd-stock-ok    { background-color: #d1fae5 !important; }   /* vert  : casier suffit */
.dd-stock-split { background-color: #fed7aa !important; }   /* orange: split possible */
.dd-stock-neg   { background-color: #fecaca !important; }   /* rouge : stock global insuffisant */
.dd-stock-none  { background-color: #e5e7eb !important; }   /* gris  : aucun def configurable */
.dd-stock-ok    .dd-cell-inp { background: transparent; }
.dd-stock-split .dd-cell-inp { background: transparent; }
.dd-stock-neg   .dd-cell-inp { background: transparent; }
.dd-stock-none  .dd-cell-inp { background: transparent; }

/* ── Risk alert popup (situation juridique tiers) ─────────────── */
.dd-risk-alert-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 10010;
    backdrop-filter: blur(2px);
    animation: ddRiskFadeIn 0.18s ease-out;
}
@keyframes ddRiskFadeIn { from { opacity: 0; } to { opacity: 1; } }
.dd-risk-alert {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    padding: 28px 32px 22px;
    min-width: 480px; max-width: 600px;
    text-align: center;
    border-top: 6px solid #dc2626;
    animation: ddRiskPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ddRiskPopIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dd-risk-alert.risk-orange { border-top-color: #ea580c; }
.dd-risk-alert.risk-gray   { border-top-color: #6b7280; }
.dd-risk-alert-icon {
    width: 60px; height: 60px; margin: 0 auto 14px;
    border-radius: 50%;
    background: #dc2626; color: #fff;
    font-size: 32px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35);
}
.dd-risk-alert.risk-orange .dd-risk-alert-icon { background: #ea580c; box-shadow: 0 8px 20px rgba(234, 88, 12, 0.35); }
.dd-risk-alert.risk-gray   .dd-risk-alert-icon { background: #6b7280; box-shadow: 0 8px 20px rgba(107, 114, 128, 0.35); }
.dd-risk-alert-title {
    font-size: 20px; font-weight: 700;
    color: #111827; margin-bottom: 6px;
}
.dd-risk-alert-tier {
    font-size: 15px; font-weight: 600;
    color: #374151; margin-bottom: 4px;
}
.dd-risk-alert-alias { color: #6b7280; font-weight: 400; font-size: 13px; }
.dd-risk-alert-situation {
    font-size: 13px; font-style: italic;
    color: #dc2626; margin-bottom: 14px;
}
.dd-risk-alert.risk-orange .dd-risk-alert-situation { color: #ea580c; }
.dd-risk-alert.risk-gray   .dd-risk-alert-situation { color: #6b7280; }
.dd-risk-alert-situation small { font-style: normal; color: #9ca3af; }
.dd-risk-alert-msg {
    font-size: 14px; color: #4b5563; line-height: 1.5;
    margin-bottom: 14px;
    padding: 0 8px;
}
.dd-risk-alert-action {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-left: 4px solid #d97706;
    color: #78350f;
    font-size: 13.5px;
    padding: 12px 14px 10px;
    border-radius: 6px;
    margin: 0 4px 20px;
    text-align: left;
    line-height: 1.5;
}
.dd-risk-alert-action-head {
    font-weight: 700;
    color: #78350f;
    margin-bottom: 8px;
    font-size: 14px;
}
.dd-risk-alert-action-head i {
    color: #d97706;
    margin-right: 6px;
}
.dd-risk-alert-action-list {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}
.dd-risk-alert-action-list li {
    margin: 4px 0;
}
.dd-risk-alert-action b { color: #78350f; }
.dd-risk-alert-btn {
    background: #2563eb; color: #fff;
    border: none; border-radius: 6px;
    padding: 10px 28px; font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.dd-risk-alert-btn:hover  { background: #1d4ed8; }
.dd-risk-alert-btn:focus  { outline: 2px solid #93c5fd; outline-offset: 2px; }

/* ── Popup Alertes article/tiers (jaune & rouge) ── */
.dd-risk-alert.risk-yellow { border-top-color: #f59e0b; }
.dd-risk-alert.risk-yellow .dd-risk-alert-icon { background: #f59e0b; box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35); }
.dd-alerte-list { margin: 14px 0 18px; text-align: left; display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow-y: auto; }
.dd-alerte-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.45;
    border: 1px solid; border-left-width: 5px;
}
.dd-alerte-item i { margin-top: 2px; font-size: 15px; }
.dd-alerte-jaune { background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b; color: #78350f; }
.dd-alerte-jaune i { color: #d97706; }
.dd-alerte-rouge { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; color: #7f1d1d; font-weight: 600; }
.dd-alerte-rouge i { color: #dc2626; }
.dd-alerte-msg { white-space: pre-wrap; }

/* ── Retrait de taxe par ligne (petit × dans la cellule Code Taxe) ────── */
.dd-taxe-del, .dd-taxe-restore {
    border: none; background: none; cursor: pointer;
    margin-left: 4px; padding: 0 2px;
    font-weight: 700; font-size: 12px; line-height: 1; vertical-align: middle;
}
.dd-taxe-del { color: #9ca3af; }
.dd-taxe-del:hover { color: #dc2626; }
.dd-taxe-restore { color: #2563eb; }
.dd-taxe-off { opacity: .55; }
/* Code TVA de la ligne non soumis à l'écotaxe (décision 2026-09-30) : « Exo TVA », sans × ni ↻ */
.dd-taxe-exo { color: #6b7280; white-space: nowrap; }
.dd-taxe-exo-lbl {
    margin-left: 4px; padding: 0 4px; border-radius: 3px;
    background: #f3f4f6; color: #4b5563; font-size: 10px; font-weight: 600; vertical-align: middle;
}
/* Délai d'escompte rempli automatiquement (défaut des Options, documents clients) */
.dd-charges input.dd-delai-esc-auto { font-style: italic; color: #2563eb; }
