/* ==========================================================================
   In-app notifications (bell + dropdown panel)
   ========================================================================== */

.notif-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-card);
    pointer-events: none;
}

.notif-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19990;
    background: transparent;
}

.notif-panel {
    position: fixed;
    top: calc(58px + var(--safe-area-top, env(safe-area-inset-top, 0px)));
    right: 12px;
    width: 370px;
    max-width: calc(100vw - 24px);
    max-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(8, 15, 30, 0.28);
    z-index: 19995;
    overflow: hidden;
    animation: notif-in 0.14s ease-out;
}

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

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.notif-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.notif-title i {
    color: var(--primary);
}

.notif-markall {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 7px;
    white-space: nowrap;
}

.notif-head-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.notif-clear-confirm {
    background: var(--danger);
    color: #fff;
}

.notif-markall:hover {
    background: var(--bg-surface-hover);
}

.notif-list {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notif-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    text-align: right;
    font: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

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

.notif-item:hover {
    background: var(--bg-surface-hover);
}

.notif-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
}

.notif-row .notif-item {
    flex: 1;
    min-width: 0;
    border-bottom: none;
}

.notif-del {
    flex-shrink: 0;
    align-self: center;
    margin: 0 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.notif-del:hover {
    background: color-mix(in srgb, var(--danger) 14%, transparent);
    color: var(--danger);
}

.notif-del.confirm {
    width: auto;
    padding: 0 12px;
    background: var(--danger);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

.notif-item.unread {
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.notif-ico {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
}

.notif-info .notif-ico { color: #2563eb; background: rgba(37, 99, 235, 0.12); }
.notif-update .notif-ico { color: #0d9488; background: rgba(13, 148, 136, 0.12); }
.notif-urgent .notif-ico { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

.notif-item-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
}

.notif-item-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 10.5px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.notif-dot {
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 34px 16px;
    color: var(--text-secondary);
    font-size: 12.5px;
}

.notif-empty i {
    font-size: 26px;
    opacity: 0.5;
}
