/* ==========================================================================
   Notifications — cloche du header (Espace Commercial) et page « Mes notifications »
   Réutilise les variables et composants du design system (app.css : dropdown, topbar-btn, empty-icon…).
   ========================================================================== */

/* Pastille du nombre de notifications non lues, sur la cloche */
.nt-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--em-radius-pill);
    background: var(--em-brand);
    box-shadow: 0 0 0 2px var(--em-card-bg);
    color: #fff;
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

/* Menu de la cloche */
.nt-menu { width: 360px; padding-bottom: 0; overflow: hidden; }
.nt-menu .dropdown-header { align-items: center; gap: 12px; }
.nt-form { margin: 0; }

.nt-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--em-primary);
    cursor: pointer;
}
.nt-link .em-icon { width: 16px; height: 16px; }
.nt-link:hover { color: var(--em-primary-hover); text-decoration: underline; }

.nt-list { max-height: 380px; overflow-y: auto; border-top: 1px solid var(--em-border); }

/* Une notification */
.nt-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid var(--em-border);
    transition: background-color .15s ease;
}
.nt-item:last-child { border-bottom: 0; }
.nt-item.is-unread { background-color: rgba(var(--em-brand-rgb), .04); }
.nt-item:hover { background-color: var(--em-hover-bg); }

.nt-item-open { flex: 1 1 auto; min-width: 0; }
.nt-item-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 6px 12px 18px;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--em-body-color);
    text-align: left;
    cursor: pointer;
}
.nt-item-main:focus-visible { outline: 2px solid rgba(var(--em-primary-rgb), .4); outline-offset: -2px; }

.nt-item-icon {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--em-primary-rgb), .12);
    color: var(--em-primary);
}
.nt-item.is-unread .nt-item-icon { background: rgba(var(--em-brand-rgb), .1); color: var(--em-brand); }
.nt-item-icon .em-icon { width: 18px; height: 18px; }

.nt-item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nt-item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.nt-item-name { font-size: .875rem; font-weight: 600; color: var(--em-heading-color); overflow-wrap: anywhere; }
.nt-item.is-unread .nt-item-name { font-weight: 700; }
.nt-item-title .vi-tag { margin-top: 0; }
.nt-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--em-brand); }

.nt-item-text { font-size: .8125rem; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.nt-item-metas { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; }
.nt-item-meta { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; color: var(--em-muted); }
.nt-item-meta strong { font-weight: 600; color: var(--em-body-color); }
.nt-item-meta .em-icon { flex: 0 0 auto; width: 14px; height: 14px; }

.nt-item-action { flex: 0 0 auto; padding: 10px 10px 0 0; }
.nt-item-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--em-muted);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.nt-item-read .em-icon { width: 18px; height: 18px; }
.nt-item-read:hover,
.nt-item-read:focus-visible { background: rgba(var(--em-success-rgb), .12); color: var(--em-success); }

.nt-footer-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    border-top: 1px solid var(--em-border);
    font-size: .875rem;
    font-weight: 500;
    color: var(--em-primary);
    text-decoration: none;
}
.nt-footer-link .em-icon { width: 16px; height: 16px; }
.nt-footer-link:hover { background-color: var(--em-hover-bg); color: var(--em-primary-hover); }

/* Page « Mes notifications » */
.nt-card-icon { background: rgba(var(--em-brand-rgb), .1); color: var(--em-brand); }
.nt-tab-count {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: var(--em-radius-pill);
    background: var(--em-light);
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
    color: var(--em-body-color);
}
.nt-tab-count.is-unread { background: var(--em-brand); color: #fff; }

.nt-page .nt-list { max-height: none; overflow: visible; border-top: 0; }
.nt-page .nt-item-main { gap: 14px; padding: 16px 8px 16px 24px; }
.nt-page .nt-item-icon { flex-basis: 40px; width: 40px; height: 40px; }
.nt-page .nt-item-name { font-size: .9375rem; }
.nt-page .nt-item-text { font-size: .875rem; }
.nt-page .nt-item-meta { font-size: .8125rem; }
.nt-page .nt-item-action { padding: 14px 20px 0 0; }

@media (max-width: 767.98px) {
    .nt-page .nt-item-main { padding: 14px 6px 14px 16px; }
    .nt-page .nt-item-action { padding: 12px 12px 0 0; }
}
