/* BO notifications (10/10/2026 ; v2 = fiche technique et actions des tickets, cloche animée ; v3 = même erreur groupée ×N) : panneau latéral de la cloche, bloc de la fiche commande, formulaire.
   Thème clair par défaut, thème sombre sous body.bg-dark (« Inverser les contrastes »). */
.bo-notif {
    --bn-bg: #ffffff;
    --bn-text: #1f2933;
    --bn-muted: #616e7c;
    --bn-border: #e4e7eb;
    --bn-hover: #f2f4f7;
    --bn-unread: #eef4ff;
    --bn-reply: #f5f7fa;
    --bn-mine: #eef7f1;
    --bn-danger: #c62828;
    --bn-warning: #b26a00;
    --bn-info: #1d5fa8;
    width: min(440px, 100vw);
    background: var(--bn-bg);
    color: var(--bn-text);
}
.bo-notif-order, .bo-notif-form {
    --bn-text: inherit;
    --bn-muted: #616e7c;
    --bn-border: #e4e7eb;
    --bn-hover: #f2f4f7;
    --bn-unread: #eef4ff;
    --bn-danger: #c62828;
    --bn-warning: #b26a00;
    --bn-info: #1d5fa8;
}
body.bg-dark .bo-notif,
body.bg-dark .bo-notif-order {
    --bn-bg: #1e2329;
    --bn-text: #e6e9ed;
    --bn-muted: #9aa5b1;
    --bn-border: #323a44;
    --bn-hover: #29303a;
    --bn-unread: #22324a;
    --bn-reply: #262d36;
    --bn-mine: #213328;
    --bn-danger: #ef6b6b;
    --bn-warning: #f0b35a;
    --bn-info: #7fb2ef;
}
.bo-notif .offcanvas-header { border-bottom: 1px solid var(--bn-border); gap: .5rem; }
.bo-notif .offcanvas-title { font-size: 1.05rem; margin: 0; }
.bo-notif .bo-notif-close { color: var(--bn-muted); font-size: 1.15rem; line-height: 1; padding: .35rem .55rem; }
.bo-notif .bo-notif-close:hover, .bo-notif .bo-notif-close:focus-visible { color: var(--bn-text); background: var(--bn-hover); }
.bo-notif .nav-tabs { padding: .5rem 1rem 0; border-bottom-color: var(--bn-border); }
.bo-notif .nav-tabs .nav-link { color: var(--bn-muted); font-size: .9rem; padding: .35rem .75rem; }
.bo-notif .nav-tabs .nav-link.active { color: var(--bn-text); background: var(--bn-bg); border-color: var(--bn-border) var(--bn-border) var(--bn-bg); }
.bo-notif .offcanvas-body { padding: .75rem 1rem 1.5rem; }
.bo-notif .offcanvas-body[aria-busy="true"] { opacity: .6; }

.bo-notif-items { list-style: none; margin: 0; padding: 0; }
.bo-notif-items li + li { border-top: 1px solid var(--bn-border); }
.bo-notif-item {
    display: flex; align-items: flex-start; gap: .65rem; width: 100%;
    padding: .6rem .5rem; border: 0; background: transparent; color: inherit; text-align: left; border-radius: 6px;
}
.bo-notif-item:hover, .bo-notif-item:focus-visible { background: var(--bn-hover); }
.bo-notif-item.is-unread { background: var(--bn-unread); }
.bo-notif-item.is-unread .bo-notif-title { font-weight: 700; }
.bo-notif-item.is-closed { opacity: .75; }
.bo-notif-ico { flex: 0 0 1.25rem; padding-top: .1rem; color: var(--bn-info); }
.sev-warning .bo-notif-ico, .bo-notif-dtitle.sev-warning { color: var(--bn-warning); }
.sev-danger .bo-notif-ico, .bo-notif-dtitle.sev-danger { color: var(--bn-danger); }
.bo-notif-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.bo-notif-title { font-size: .9rem; overflow-wrap: anywhere; }
.bo-notif-meta { font-size: .78rem; color: var(--bn-muted); overflow-wrap: anywhere; }
.bo-notif-age { flex: 0 0 auto; font-size: .75rem; color: var(--bn-muted); white-space: nowrap; }
.bo-notif-empty { color: var(--bn-muted); padding: 1rem .25rem; margin: 0; }
.bo-notif-empty .fa-check-circle { color: #2e7d32; }
.bo-notif-more { font-size: .78rem; color: var(--bn-muted); margin: .5rem 0 0; }

.bo-notif-dtitle { font-size: 1rem; font-weight: 700; margin: 0 0 .25rem; overflow-wrap: anywhere; }
.bo-notif-body { white-space: normal; font-size: .9rem; padding: .6rem .75rem; border-left: 3px solid var(--bn-border); margin: .5rem 0; overflow-wrap: anywhere; }
.bo-notif-reply { background: var(--bn-reply); border-radius: 6px; padding: .5rem .65rem; margin-top: .5rem; font-size: .88rem; overflow-wrap: anywhere; }
.bo-notif-reply.is-mine { background: var(--bn-mine); }
body.bg-dark .bo-notif .form-control { background: #151a1f; color: var(--bn-text); border-color: var(--bn-border); }

.bo-notif-order .card-header { flex-wrap: wrap; }
.bo-notif-order .bo-notif-item { border-radius: 0; padding: .55rem .9rem; }
.bo-notif-order details .bo-notif-item { padding-left: 0; }

/* Ticket : fiche technique et actions (admins) */
.bo-notif-tech { margin: .5rem 0; font-size: .82rem; }
.bo-notif-tech summary { color: var(--bn-muted); cursor: pointer; }
.bo-notif-tech dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .75rem; margin: .5rem 0 0; }
.bo-notif-tech dt { color: var(--bn-muted); font-weight: 400; }
.bo-notif-tech dd { margin: 0; overflow-wrap: anywhere; }
.bo-notif-ticket { border: 1px solid var(--bn-border); border-radius: 6px; padding: .5rem .65rem; margin: .5rem 0; }
.bo-notif-ticket .form-label { font-size: .82rem; color: var(--bn-muted); }
body.bg-dark .bo-notif .form-select { background-color: #151a1f; color: var(--bn-text); border-color: var(--bn-border); }

/* Cloche animée (11/10/2026) : balancement quand un élément non lu arrive ou change (bo-notif-ring, posé par notifications.v2.js),
   point blanc sur la pastille tant qu'il reste des non lus (bo-notif-unread). Sans animation si le système demande moins de mouvement. */
#area-menu-top #bo_notif_btn.bo-notif-ring .fa-bell {
    transform-origin: 50% 8%;
    animation: bo-notif-swing 1.1s ease-in-out 2;
}
#area-menu-top #bo_notif_btn.bo-notif-unread .bo-badge::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e5383b;
}
#area-menu-top #bo_notif_btn.bo-notif-ring .bo-badge {
    animation: bo-notif-halo 1.1s ease-out 2;
}
@keyframes bo-notif-swing {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(16deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}
@keyframes bo-notif-halo {
    0% { box-shadow: 0 0 0 0 rgba(229, 56, 59, .55); }
    100% { box-shadow: 0 0 0 9px rgba(229, 56, 59, 0); }
}
@media (prefers-reduced-motion: reduce) {
    #area-menu-top #bo_notif_btn.bo-notif-ring .fa-bell,
    #area-menu-top #bo_notif_btn.bo-notif-ring .bo-badge {
        animation: none;
    }
}

/* Même erreur dans plusieurs tickets (v3, 11/10/2026) : compteur ×N sur la ligne, liste des occurrences dans le détail */
.bo-notif-times {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--bn-hover);
    border: 1px solid var(--bn-border);
    color: var(--bn-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    vertical-align: 1px;
}
.bo-notif-group {
    margin: 8px 0;
    font-size: 12.5px;
    color: var(--bn-muted);
}
.bo-notif-group summary {
    cursor: pointer;
    font-weight: 600;
}
.bo-notif-group ul {
    margin: 4px 0 0;
    padding-left: 18px;
    max-height: 160px;
    overflow-y: auto;
}
