/* Notifications Dropdown */
.notifications-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    width: 360px;
    max-height: 480px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 100;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.notifications-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1f2937;
}

.notifications-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.notifications-action-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #059669;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.notifications-action-btn svg {
    width: 12px;
    height: 12px;
}

.notifications-action-btn:hover {
    background: rgba(5, 150, 105, 0.1);
}

.notifications-clear-btn {
    color: #6b7280;
}

.notifications-clear-btn:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

.notifications-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
}

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

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: rgba(5, 150, 105, 0.04);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #059669;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon svg {
    width: 18px;
    height: 18px;
}

.notifications-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted, #9ca3af);
}

.notifications-empty-icon svg {
    width: 40px;
    height: 40px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #1f2937;
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.notification-body {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.6875rem;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

.notifications-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.notifications-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.notifications-empty p {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.notifications-empty span {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.notifications-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.notifications-footer a {
    color: #059669;
    font-weight: 500;
    font-size: 0.8125rem;
    text-decoration: none;
}

.notifications-footer a:hover {
    text-decoration: underline;
}

/* Dark mode support (Dashboard) */
html.dark-mode .notifications-dropdown,
body.dark-mode .notifications-dropdown,
[data-theme="dark"] .notifications-dropdown,
body.dashboard-themed[data-theme="dark"] .notifications-dropdown {
    background: var(--bg-card, #242220);
    border-color: var(--border-subtle, #3a3633);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

html.dark-mode .notifications-header,
body.dark-mode .notifications-header,
[data-theme="dark"] .notifications-header {
    border-bottom-color: var(--border-subtle, #3a3633);
}

html.dark-mode .notifications-title,
body.dark-mode .notifications-title,
[data-theme="dark"] .notifications-title {
    color: var(--text-primary, #E8E6E3);
}

html.dark-mode .notification-item,
body.dark-mode .notification-item,
[data-theme="dark"] .notification-item {
    border-bottom-color: var(--border-subtle, #3a3633);
}

html.dark-mode .notification-item:hover,
body.dark-mode .notification-item:hover,
[data-theme="dark"] .notification-item:hover {
    background: var(--bg-elevated, #2d2a28);
}

html.dark-mode .notification-item.unread,
body.dark-mode .notification-item.unread,
[data-theme="dark"] .notification-item.unread {
    background: rgba(127, 168, 127, 0.06);
}

html.dark-mode .notification-item.unread::before,
body.dark-mode .notification-item.unread::before,
[data-theme="dark"] .notification-item.unread::before {
    background: var(--accent-light, #7FA87F);
}

html.dark-mode .notification-title,
body.dark-mode .notification-title,
[data-theme="dark"] .notification-title {
    color: var(--text-primary, #E8E6E3);
}

html.dark-mode .notification-body,
body.dark-mode .notification-body,
[data-theme="dark"] .notification-body {
    color: var(--text-secondary, #9E9689);
}

html.dark-mode .notifications-action-btn,
body.dark-mode .notifications-action-btn,
[data-theme="dark"] .notifications-action-btn {
    color: var(--accent-light, #7FA87F);
}

html.dark-mode .notifications-action-btn:hover,
body.dark-mode .notifications-action-btn:hover,
[data-theme="dark"] .notifications-action-btn:hover {
    background: rgba(127, 168, 127, 0.1);
}

html.dark-mode .notifications-clear-btn,
body.dark-mode .notifications-clear-btn,
[data-theme="dark"] .notifications-clear-btn {
    color: #9E9689;
}

html.dark-mode .notifications-clear-btn:hover,
body.dark-mode .notifications-clear-btn:hover,
[data-theme="dark"] .notifications-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

html.dark-mode .notifications-footer,
body.dark-mode .notifications-footer,
[data-theme="dark"] .notifications-footer {
    border-top-color: var(--border-subtle, #3a3633);
}

html.dark-mode .notifications-footer a,
body.dark-mode .notifications-footer a,
[data-theme="dark"] .notifications-footer a {
    color: var(--accent-light, #7FA87F);
}

html.dark-mode .notifications-empty p,
body.dark-mode .notifications-empty p,
[data-theme="dark"] .notifications-empty p {
    color: var(--text-primary, #E8E6E3);
}

html.dark-mode .notifications-empty span,
body.dark-mode .notifications-empty span,
[data-theme="dark"] .notifications-empty span {
    color: var(--text-muted, #78716C);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .notifications-dropdown {
        position: fixed;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
        top: 4.5rem;
    }
}

#notifications-bell { position:relative; display:flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; background:transparent; border:0; border-radius:8px; color:inherit; cursor:pointer; }
#notifications-bell > svg { width:22px; height:22px; }
#notifications-badge { position:absolute; top:-2px; right:-2px; min-width:18px; height:18px; padding:0 4px; border-radius:20px; background:#dc2626; color:white; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; }
#notifications-badge.hidden, .notifications-dropdown.hidden { display:none; }
#notifications-bell:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
