﻿/* ── CSS Variables ─────────────────────────────────────── */
:root {
    --notif-success: #2ecc71;
    --notif-error: #ef4444;
    --notif-info: #3498db;
}

/* ══════════════════════════════════════════════════════════
   Notification Panel
══════════════════════════════════════════════════════════ */
.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    width: 340px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    z-index: 1050;
    flex-direction: column;
    overflow: hidden;
}

    .notif-panel.open {
        display: inline-grid;
        animation: notif-in .2s ease;
        position: fixed;
        top: 70px; /* تحت الـ navbar */
        margin-left: 20px;
        margin-right: 20px;
        nav-left: root;
        z-index: 2000;
    }

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.notif-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notif-action-btn {
    font-size: .72rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background .15s;
}

    .notif-action-btn:hover {
        background: var(--bg-hover, rgba(0,0,0,.06));
    }

.notif-clear-btn:hover {
    color: var(--notif-error);
}

.notif-list {
    overflow-y: auto;
    flex: 1;
    padding: .5rem;
}

.notif-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: .85rem;
    padding: 2rem 0;
    margin: 0;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    padding: .625rem .75rem;
    border-radius: 10px;
    margin-bottom: .25rem;
    transition: background .15s;
    position: relative;
}

    .notif-item.unread {
        background: var(--bg-hover, rgba(0,0,0,.04));
    }

    .notif-item:hover {
        background: var(--bg-hover, rgba(0,0,0,.06));
    }

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-msg {
    font-size: .825rem;
    color: var(--text-primary);
    margin: 0 0 2px;
    line-height: 1.4;
}

.notif-time {
    font-size: .72rem;
    color: var(--text-secondary);
}

.notif-read-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    font-size: .8rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}

.notif-item:hover .notif-read-btn {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════
   Toast
══════════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-end: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .625rem;
    z-index: 9990;
    pointer-events: none;
}

.erp-toast {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    min-width: 260px;
    max-width: 360px;
    pointer-events: all;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .3s ease, transform .3s ease;
}

    .erp-toast.show {
        opacity: 1;
        transform: translateY(0);
    }

.toast-msg {
    flex: 1;
    font-size: .875rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 2px;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

    .toast-close:hover {
        color: var(--text-primary);
    }

/* ── Animations ─────────────────────────────────────────── */
@keyframes notif-in {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
