/* ================================================
   FASTPANEL — Notifications globales
   Compatible : administration, dashboard, representants, finance
   ================================================ */

/* ── Cloche ─────────────────────────────────────────────────────── */
.fp-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
}

#fpNotifBtn {
    position: relative;
}

.fp-notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: #f44336;
    color: #fff;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
    transition: transform .15s ease;
}

.fp-notif-badge.hidden {
    display: none;
}

.fp-notif-badge.fp-notif-pulse {
    animation: fp-notif-pop .25s ease;
}

@keyframes fp-notif-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

/* ── Dropdown ────────────────────────────────────────────────────── */
.fp-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: #111111;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    z-index: 10500;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    overflow: hidden;
    animation: fp-notif-slide .18s ease;
}

.fp-notif-dropdown.hidden {
    display: none;
}

@keyframes fp-notif-slide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Header dropdown ─────────────────────────────────────────────── */
.fp-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.fp-notif-header-title {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 7px;
}

.fp-notif-header-title i {
    color: #f97316;
}

.fp-notif-mark-all {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.fp-notif-mark-all:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.06);
}

.fp-notif-mute-btn {
    background: none;
    border: none;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    transition: color .15s, background .15s;
    line-height: 1;
}

.fp-notif-mute-btn:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.06);
}

/* ── Liste ───────────────────────────────────────────────────────── */
.fp-notif-list {
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.fp-notif-empty {
    padding: 32px 18px;
    text-align: center;
    color: #475569;
    font-size: 12px;
}

.fp-notif-empty i {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    opacity: .4;
}

/* ── Item ────────────────────────────────────────────────────────── */
.fp-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background .12s;
    position: relative;
}

.fp-notif-item:last-child {
    border-bottom: none;
}

.fp-notif-item:hover {
    background: rgba(255,255,255,0.04);
}

.fp-notif-item.fp-notif-unread {
    background: rgba(249,115,22,0.06);
}

.fp-notif-item.fp-notif-unread:hover {
    background: rgba(249,115,22,0.1);
}

/* Point non-lu */
.fp-notif-item.fp-notif-unread::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background: #f97316;
    border-radius: 50%;
}

/* ── Icône type ──────────────────────────────────────────────────── */
.fp-notif-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-top: 1px;
}

.fp-notif-icon.type-client-maintenance,
.fp-notif-icon.type-staff-maintenance  { background: rgba(244,67,54,0.15); color: #ef9a9a; }
.fp-notif-icon.type-client-service_suspendu { background: rgba(244,67,54,0.15); color: #ef9a9a; }
.fp-notif-icon.type-client-service_actif    { background: rgba(76,175,80,0.15); color: #a5d6a7; }
.fp-notif-icon.type-client-renouvellement_imminant { background: rgba(255,152,0,0.15); color: #ffcc80; }
.fp-notif-icon.type-client-facture_impayee  { background: rgba(244,67,54,0.15); color: #ef9a9a; }
.fp-notif-icon.type-client-message_support  { background: rgba(33,150,243,0.15); color: #90caf9; }
.fp-notif-icon.type-staff-ticket_ouvert     { background: rgba(33,150,243,0.15); color: #90caf9; }
.fp-notif-icon.type-staff-service_en_attente { background: rgba(255,152,0,0.15); color: #ffcc80; }
.fp-notif-icon.type-staff-mention_discussion { background: rgba(156,39,176,0.15); color: #ce93d8; }
.fp-notif-icon.type-system-annonce          { background: rgba(249,115,22,0.15); color: #fdba74; }

/* ── Corps texte ─────────────────────────────────────────────────── */
.fp-notif-body {
    flex: 1;
    min-width: 0;
}

.fp-notif-titre {
    font-size: 12px;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.fp-notif-msg {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.fp-notif-time {
    font-size: 10px;
    color: #475569;
    margin-top: 4px;
}

/* ── Bouton supprimer ────────────────────────────────────────────── */
.fp-notif-delete {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #475569;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity .15s, color .15s;
    align-self: center;
}

.fp-notif-item:hover .fp-notif-delete {
    opacity: 1;
}

.fp-notif-delete:hover {
    color: #ef5350;
}

/* ── Footer dropdown ─────────────────────────────────────────────── */
.fp-notif-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.fp-notif-load-more {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}

.fp-notif-load-more:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.06);
}

.fp-notif-load-more.hidden {
    display: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .fp-notif-dropdown {
        width: calc(100vw - 24px);
        right: -8px;
    }
}

/* ── Badges "Discussion" dans les navs header ────────────────────── */
.fp-nav-disc-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px !important;
    height: 18px !important;
    min-width: 0 !important;
    flex: none !important;
    border-radius: 50% !important;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 !important;
    margin-left: 3px;
    line-height: 1;
    flex-shrink: 0;
    overflow: hidden;
}
.fp-disc-mention { background: #f44336; }
.fp-disc-unread  { background: #4fc3f7; color: #0d1117; }
