/* wm-dialog : confirmations et messages en HTML (voir public/js/wm-dialog.js). Textes à 16-17 px, lisibles. */
.wm-dialog-overlay {
    position: fixed; inset: 0; z-index: 2147483100; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(20, 28, 32, .45); animation: wm-dialog-fade .16s ease-out;
}
.wm-dialog-overlay.is-leaving { animation: wm-dialog-fade .16s ease-in reverse forwards; }
html.wm-dialog-open { overflow: hidden; }
.wm-dialog {
    width: 100%; max-width: 440px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 30px 28px 26px; background: #fff; border-radius: 14px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
    font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1d2a2f; text-align: center;
    animation: wm-dialog-in .2s cubic-bezier(.22, .61, .36, 1);
}
.wm-dialog-icon { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.wm-dialog-icon svg { width: 28px; height: 28px; }
.wm-dialog-icon-warning { background: #fdf0e6; color: #b5541b; }
.wm-dialog-icon-error { background: #fbeaea; color: #b42318; }
.wm-dialog-icon-success { background: #e8f4ef; color: #2f6f5e; }
.wm-dialog-icon-info, .wm-dialog-icon-input { background: #eaf1f6; color: #2c5d7c; }
.wm-dialog-title { margin: 4px 0 0 !important; font-size: 20px !important; font-weight: 600 !important; line-height: 1.3 !important; font-family: inherit !important; color: #1d2a2f !important; letter-spacing: 0; text-transform: none; }
.wm-dialog-text { margin: 0; font-size: 16px; color: #4a565c; max-width: 380px; }
.wm-dialog-text p { margin: 0 0 .5em; }
.wm-dialog-input { width: 100%; box-sizing: border-box; min-height: 48px; margin-top: 4px; padding: 10px 14px; border: 1.5px solid #b9c2c7; border-radius: 8px;
    font: inherit; color: inherit; background: #fff; }
.wm-dialog-input:focus { outline: none; border-color: #2c5d7c; box-shadow: 0 0 0 4px rgba(44, 93, 124, .18); }
.wm-dialog-input[aria-invalid="true"] { border-color: #b42318; }
.wm-dialog-error { margin: 0; color: #b42318; font-size: 15px; font-weight: 600; }
.wm-dialog-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; width: 100%; }
.wm-dialog-btn { min-height: 46px; min-width: 120px; padding: 10px 22px; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer;
    font-size: 16px; font-weight: 600; line-height: 1.2; font-family: inherit; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.wm-dialog-btn-primary { background: #2f6f5e; color: #fff; }
.wm-dialog-btn-primary:hover { background: #245849; }
.wm-dialog-btn-danger { background: #b42318; color: #fff; }
.wm-dialog-btn-danger:hover { background: #912018; }
.wm-dialog-btn-ghost { background: #fff; color: #1d2a2f; border-color: #b9c2c7; }
.wm-dialog-btn-ghost:hover { border-color: #1d2a2f; }
.wm-dialog-btn:focus-visible { outline: 3px solid #2c5d7c; outline-offset: 2px; }
.wm-dialog-btn.is-busy { opacity: .65; cursor: progress; }

/* panneau large (listes, ex. dépendances) */
.wm-dialog-wide { max-width: 640px; }
.wm-dialog-wide .wm-dialog-text { max-width: none; width: 100%; }
.wm-deps { list-style: none; margin: 6px 0 0; padding: 0; width: 100%; display: grid; gap: 8px; max-height: 52vh; overflow: auto; text-align: left; }
.wm-dep a, .wm-dep > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid #dfe3e6; border-radius: 10px;
    color: #1d2a2f !important; text-decoration: none !important; font-size: 15px; line-height: 1.45; }
.wm-dep a:hover, .wm-dep a:focus-visible { border-color: #2f6f5e; background: #f5faf8; outline: none; }
.wm-dep strong { font-size: 16px; font-weight: 600; }
.wm-dep span b { font-weight: 600; color: #4a565c; }
.wm-deps-none { margin: 0; font-size: 16px; color: #4a565c; }

/* info-bulle en CSS seul : <i data-wm-tip="Texte" tabindex="0"> (survol et focus clavier).
   ::after uniquement : ::before reste libre pour les icônes Font Awesome. */
[data-wm-tip] { position: relative; cursor: help; }
[data-wm-tip]::after { content: attr(data-wm-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 1000;
    width: max-content; max-width: 300px; padding: 8px 12px; border-radius: 8px; background: #1d2a2f; color: #fff;
    font: 400 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; text-align: left; white-space: normal;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease; }
[data-wm-tip]:hover::after, [data-wm-tip]:focus-visible::after { opacity: 1; visibility: visible; }
/* variante « ligne » : la bulle s'affiche sous la ligne qui contient l'icône (ancêtre positionné, ex. .list-group-item),
   sur toute sa largeur, pour les colonnes étroites ou à défilement qui la couperaient */
[data-wm-tip][data-wm-tip-ligne] { position: static; }
[data-wm-tip][data-wm-tip-ligne]::after { left: 10px; right: 10px; top: calc(100% - 4px); bottom: auto; transform: none; width: auto; max-width: none; }

/* messages : bandeau discret en haut à droite, empilés */
.wm-notices { position: fixed; top: 18px; right: 18px; z-index: 2147483090; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 36px)); }
.wm-notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; background: #fff; border-radius: 12px; border-left: 5px solid #2c5d7c;
    box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .45); font: 400 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1d2a2f;
    animation: wm-notice-in .22s cubic-bezier(.22, .61, .36, 1); }
.wm-notice.is-leaving { animation: wm-notice-in .2s ease-in reverse forwards; }
.wm-notice-success { border-left-color: #2f6f5e; }
.wm-notice-error { border-left-color: #b42318; }
.wm-notice-warning { border-left-color: #b5541b; }
.wm-notice .wm-dialog-icon { width: 36px; height: 36px; }
.wm-notice .wm-dialog-icon svg { width: 20px; height: 20px; }
.wm-notice-body { flex: 1; min-width: 0; padding-top: 6px; }
.wm-notice-title { display: block; font-weight: 600; }
.wm-notice-text { color: #3d474c; overflow-wrap: anywhere; }
.wm-notice-close { flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #5b666c; font-size: 22px; line-height: 1; cursor: pointer; }
.wm-notice-close:hover { background: #eef1f3; color: #1d2a2f; }

@keyframes wm-dialog-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wm-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes wm-notice-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) {
    .wm-dialog { padding: 26px 20px 20px; }
    .wm-dialog-btn { flex: 1 1 100%; }
    .wm-notices { top: auto; bottom: 14px; right: 14px; left: 14px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .wm-dialog-overlay, .wm-dialog, .wm-notice { animation: none !important; }
}
