/* ============================================================
   HECM Parakou — Notifications & fenêtres de confirmation
   (admin + espace professeur)
   ============================================================ */

/* ── Notifications (show_alert + toutes les .alert Bootstrap) ── */
.alert:not(.alert-light):not(.alert-secondary):not(.alert-dark) {
    border: 0;
    border-left: 5px solid currentColor;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(17, 51, 28, .08);
    padding: 14px 44px 14px 16px;
    font-size: .9rem;
    line-height: 1.5;
}
.alert-success { background: #ecf8ef; color: #155a2b; }
.alert-danger  { background: #fdeeee; color: #8f1d22; }
.alert-warning { background: #fff7e3; color: #7a5600; }
.alert-info    { background: #eaf3fc; color: #1d4f86; }
.alert:not(.alert-light) a { color: inherit; font-weight: 600; }

.hecm-alert { display: flex; align-items: flex-start; gap: 13px; animation: hecmAlertIn .35s cubic-bezier(.2,.8,.2,1); }
.hecm-alert__icon {
    flex: none; width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
    background: rgba(255, 255, 255, .75); box-shadow: 0 2px 6px rgba(0, 0, 0, .06);
}
.hecm-alert__body { flex: 1; min-width: 0; }
.hecm-alert__title { font-weight: 700; font-size: .92rem; margin-bottom: 2px; }
.hecm-alert__msg { color: #33433a; word-break: break-word; }
.hecm-alert .btn-close { top: 50%; transform: translateY(-50%); padding: 12px; opacity: .45; }
.hecm-alert .btn-close:hover { opacity: .8; }
@keyframes hecmAlertIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Boîtes de message de l'espace professeur */
.msg-box { border-radius: 12px !important; box-shadow: 0 6px 20px rgba(17, 51, 28, .07); border-left-width: 5px !important; }

/* Pastilles de comptage (menus) */
.hecm-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: #ff5a5f; color: #fff; font-size: .64rem; font-weight: 700; line-height: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
}
.nav-sub .hecm-count { margin-left: auto; box-shadow: none; }

/* ── Fenêtre de confirmation ── */
.hecm-confirm-ov {
    position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center;
    background: rgba(12, 32, 18, .48); backdrop-filter: blur(2px); padding: 16px;
    opacity: 0; transition: opacity .2s;
}
.hecm-confirm-ov.is-in { opacity: 1; }
.hecm-confirm {
    width: 100%; max-width: 420px; background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28); transform: translateY(14px) scale(.97); transition: transform .22s;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}
.hecm-confirm-ov.is-in .hecm-confirm { transform: none; }
.hecm-confirm__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.hecm-confirm__icon {
    flex: none; width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
    background: #e5f6ea; color: #1a6b2f;
}
.hecm-confirm--danger .hecm-confirm__icon { background: #fdeaea; color: #d1373f; }
.hecm-confirm__title { font-size: 1.05rem; font-weight: 700; color: #1a2e1d; margin: 0; }
.hecm-confirm__msg { padding: 8px 22px 4px 80px; color: #4a5a50; font-size: .9rem; line-height: 1.5; white-space: pre-line; word-break: break-word; }
.hecm-confirm__field { padding: 10px 22px 0 80px; }
.hecm-confirm__field label { font-size: .78rem; font-weight: 600; color: #495057; margin-bottom: 4px; display: block; }
.hecm-confirm__field textarea {
    width: 100%; border: 1px solid #dee2e6; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .85rem; resize: vertical; min-height: 64px;
}
.hecm-confirm__field textarea:focus { outline: none; border-color: #1a6b2f; box-shadow: 0 0 0 3px rgba(26, 107, 47, .12); }
.hecm-confirm__actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 20px; }
.hecm-confirm__btn {
    border: 0; border-radius: 9px; padding: 10px 18px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px; transition: filter .15s, transform .15s;
}
.hecm-confirm__btn:hover { filter: brightness(.95); transform: translateY(-1px); }
.hecm-confirm__btn--cancel { background: #f1f3f5; color: #495057; }
.hecm-confirm__btn--ok { background: linear-gradient(135deg, #124d22, #1a6b2f); color: #fff; }
.hecm-confirm--danger .hecm-confirm__btn--ok { background: linear-gradient(135deg, #b52a31, #e04b52); }
@media (max-width: 480px) {
    .hecm-confirm__msg, .hecm-confirm__field { padding-left: 22px; }
    .hecm-confirm__actions { flex-direction: column-reverse; }
    .hecm-confirm__btn { justify-content: center; }
}

/* ── Boutons d'action avec libellé (icône + nom du rôle) ── */
.btn-lbl { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 600; }
.btn-lbl i { font-size: .85em; }
.act-group { display: flex; flex-wrap: wrap; gap: 5px; }
.act-group .btn { font-size: .74rem; padding: 4px 9px; border-radius: 7px; }
/* Boutons carrés « .ab » de l'espace professeur : icône + libellé */
.ab.ab-lbl { width: auto !important; padding: 0 9px; gap: 5px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.ab.ab-lbl i { font-size: .76rem; }
.action-btns { flex-wrap: wrap; }

/* ── Sélection multiple (hecm-bulk.js) ── */
.bulk-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between;
    background: #f6faf7; border: 1px solid #dcebdf; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
    position: sticky; top: 72px; z-index: 5; transition: background .2s, border-color .2s;
}
.bulk-bar.has-sel { background: #fff8e6; border-color: #f0d38a; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.bulk-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bulk-bar > :not(.bulk-ctl) { display: flex; flex-wrap: wrap; gap: 6px; }
.bulk-bar .btn { font-size: .76rem; padding: 4px 10px; border-radius: 7px; }
.bulk-count { font-size: .8rem; color: #495057; padding: 0 4px; }
.bulk-cb, .bulk-all { width: 17px; height: 17px; cursor: pointer; accent-color: #1a6b2f; vertical-align: middle; }
tr.bulk-selected > td, .bulk-row.bulk-selected { background: #fff8e6 !important; }
@media (max-width: 680px) { .bulk-bar { position: static; } }

/* Impression de la sélection seulement (hecm-bulk : data-bulk-print) */
@media print {
    .bulk-bar, .bulk-cb, .bulk-all { display: none !important; }
    body.bulk-printing .bulk-hide { display: none !important; }
    tr.bulk-selected > td, .bulk-row.bulk-selected { background: transparent !important; }
}
