/* ═══════════════════════════════════════════════════════════
   DTISoft — Modal actions documents (Imprimer / Email). Namespace « da- ».
   z-index 11400 : au-dessus des fiches (8000-9000) et du picker (11000),
   sous la recherche globale (11500) et le verrou de session.
   ═══════════════════════════════════════════════════════════ */
.da-overlay {
    position: fixed; inset: 0; z-index: 11400;
    background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.da-panel {
    background: var(--white); border-radius: 8px;
    width: min(1040px, 96vw); max-height: 90vh;   /* agrandi ×2 pour l'aperçu éditable */
    box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
    display: flex; flex-direction: column; overflow: hidden;
}
.da-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--gray-200);
}
.da-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--blue-dark); }
.da-x { border: none; background: none; font-size: 22px; line-height: 1; color: var(--gray-400); cursor: pointer; padding: 0 4px; }
.da-x:hover { color: var(--gray-700); }

.da-body { padding: 14px 16px; overflow-y: auto; }
.da-note { font-size: 12.5px; color: var(--gray-600); margin: 0 0 10px; }
.da-warn { color: #b45309; }

/* ── Aperçu / impression PDF dans une modale (lecteur PDF natif du navigateur) ── */
.da-panel--pdf { width: min(1100px, 96vw); height: 92vh; max-height: 92vh; }
.da-panel--pdf .da-body { padding: 0; flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.da-pdf-hint { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 12.5px; color: var(--gray-700); background: #eff6ff; border-bottom: 1px solid var(--gray-200); }
.da-pdf-hint i { color: var(--blue-mid); }
.da-pdf-stage { flex: 1 1 auto; display: flex; min-height: 0; background: var(--gray-100); }
.da-pdf-frame { flex: 1 1 auto; width: 100%; height: 100%; border: 0; background: var(--gray-100); }
.da-pdf-loading { margin: auto; color: var(--gray-500); font-size: 13px; padding: 24px; }

/* Toast « imprimé ✓ » (accusé d'impression silencieuse via l'agent local) */
.da-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
    z-index: 11600; max-width: 90vw;
    background: #111827; color: #fff; font-size: 13px; font-weight: 500;
    padding: 10px 18px; border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
    opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.da-toast--show { opacity: 1; transform: translate(-50%, 0); }

.da-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.da-field { display: flex; flex-direction: column; gap: 3px; }
.da-flabel { font-size: 11px; color: var(--gray-500); font-weight: 600; }
.da-input {
    border: 1px solid var(--gray-300); border-radius: 4px; padding: 5px 8px;
    font-size: 13px; font-family: inherit; color: var(--gray-900); background: var(--white);
    box-sizing: border-box; width: 100%; min-width: 0;
}
.da-input:focus { outline: 2px solid var(--blue-pale); outline-offset: -1px; border-color: var(--blue-light); }
.da-textarea { resize: vertical; }
.da-input--missing { border-color: #ef4444; background: #fef2f2; }

/* Éditeur riche du corps (composant partagé RteEditor, classes rte-*) */
.rte-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 5px; border: 1px solid var(--gray-200); border-bottom: none; border-radius: 4px 4px 0 0; background: #f9fafb; margin-top: 4px; }
.rte-b { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #374151; cursor: pointer; font-size: 12px; font-weight: 700; font-family: inherit; line-height: 1; }
.rte-b:hover { background: #e5e7eb; }
.rte-b.is-active { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.rte-sep { width: 1px; height: 18px; background: var(--gray-200); margin: 0 3px; }
.rte-color { position: relative; overflow: hidden; }
.rte-color input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: none; padding: 0; }
.da-rte { min-height: 220px; max-height: 46vh; overflow: auto; padding: 12px 14px; border: 1px solid var(--gray-200); border-radius: 0 0 4px 4px; background: #fff; font-size: 13px; line-height: 1.55; color: #1f2937; }
.da-rte:focus { outline: 2px solid #93c5fd; outline-offset: -1px; }
.da-rte img { max-width: 100%; height: auto; }
.da-rte-src { min-height: 220px; max-height: 46vh; border: 1px solid var(--gray-200); border-radius: 0 0 4px 4px; padding: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.5; resize: vertical; width: 100%; box-sizing: border-box; }

.da-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.da-row { font-size: 13px; color: var(--gray-700); }
.da-row--email { display: flex; align-items: center; gap: 8px; }
.da-doclabel { flex: 0 0 42%; min-width: 0; overflow: hidden; color: var(--gray-900); }
.da-gname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-gdocs { font-size: 11px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-input--email { flex: 1; }
.da-link { color: var(--blue-mid); text-decoration: none; }
.da-link:hover { text-decoration: underline; }

.da-foot {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 16px; border-top: 1px solid var(--gray-200);
}
.da-btn {
    border: 1px solid var(--gray-300); border-radius: 5px; padding: 6px 14px;
    font-size: 13px; font-family: inherit; background: var(--white); color: var(--gray-700); cursor: pointer;
}
.da-btn:hover { background: var(--gray-100); }
.da-btn--primary { background: var(--blue-mid); border-color: var(--blue-mid); color: #fff; }
.da-btn--primary:hover { background: var(--blue-dark); }
.da-btn:disabled { opacity: .6; cursor: default; }

@media (max-width: 560px) {
    .da-row--email { flex-direction: column; align-items: stretch; gap: 3px; }
    .da-doclabel { flex: none; white-space: normal; }
}
