.notification-page { max-width: 900px; }
.notification-group { margin-bottom: 18px; }
.notification-group .dash-section-title { font-size: var(--fs-h3); margin-bottom: 12px; }
.notification-list { display: grid; gap: 8px; }
.notification-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; color: var(--dark2); text-decoration: none; border: 1px solid var(--bg-dark); border-radius: 8px; font-size: var(--fs-label); }
.notification-row:hover, .notification-row.is-unread { background: rgba(255, 0, 0, .06); border-color: var(--CTA); }
.notification-row time { flex: 0 0 auto; color: var(--text-muted); font-size: var(--fs-label); }
.notification-empty { font-size: var(--fs-label); }
.notification-bell-wrap { position: relative; }
.sidebar-top > .notification-bell-wrap:not(.notification-bell-wrap--mobile) { margin-top: -40px; }
.sidebar .notification-bell-wrap,
.sidebar .notification-bell-menu { width: 100%; }
.notification-bell-menu { position: relative; }
.notification-bell-menu > summary { display: flex; list-style: none; }
.notification-bell-menu > summary::-webkit-details-marker { display: none; }
.notification-bell-menu > summary::marker { content: ""; font-size: 0; }
.notification-bell { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 15px; box-sizing: border-box; background: transparent; color: var(--light); cursor: pointer; font-family: var(--ff-body); font-size: var(--fs-body); line-height: 1; text-decoration: none; white-space: nowrap; }
.sidebar .notification-bell { width: 100%; }
.sidebar .notification-bell-count { position: static; top: auto; left: auto; flex: 0 0 auto; margin-left: 4px; }
.notification-bell:hover { background: var(--light); color: var(--CTA); }
.notification-bell--active { background: var(--light); color: var(--CTA); }
.notification-bell-icon { width: 40px; height: 40px; flex: 0 0 40px; }
.notification-bell svg { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .notification-bell svg { width: 22px; height: 22px; flex: 0 0 22px; }
.notification-bell-count { position: absolute; top: 2px; left: 29px; min-width: 18px; min-height: 18px; padding: 0 3px; border-radius: 999px; background: var(--CTA); color: #fff; text-align: center; font-size: var(--fs-label); line-height: 18px; }
.notification-preview { position: absolute; z-index: 1200; top: 100%; left: 10px; display: flex; flex-direction: column; width: min(360px, calc(100vw - 24px)); max-height: calc(100vh - 32px); max-height: min(480px, calc(100dvh - 32px)); overflow: hidden; border: 1px solid var(--bg-dark); border-radius: 10px; background: var(--light); box-shadow: 0 12px 30px rgba(0,0,0,.22); color: var(--dark2); white-space: normal; }
.notification-bell-menu--contextual .notification-preview { position: fixed; top: 40px; left: var(--sidebar-w); }
.notification-preview-heading, .notification-preview-all { display: block; padding: 12px 14px; font-family: var(--ff-body); font-size: var(--fs-label); font-weight: 600; }
.notification-preview-heading, .notification-preview-all { flex: 0 0 auto; }
.notification-preview-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.notification-preview-item { display: grid; gap: 2px; padding: 10px 14px; color: var(--dark2); text-decoration: none; border-top: 1px solid var(--bg-dark); background: #fff; font-family: var(--ff-body); font-size: var(--fs-label); line-height: 1.25; }
.notification-preview-item:hover, .notification-preview-item.is-unread { background: rgba(255,0,0,.06); }
.notification-preview-section {
    color: var(--dark2);
    font-family: var(--ff-body);
    font-size: calc(var(--fs-label) + 1px);
    font-weight: 600;
}
.notification-preview-empty { padding: 10px 14px; font-size: var(--fs-label); }
.notification-preview-all { border-top: 1px solid var(--bg-dark); color: var(--dark2); text-decoration: none; }
.notification-preview-all:hover { color: var(--CTA); }
.notification-bell-wrap--mobile { display: none; }
.sidebar.collapsed .notification-bell-label { display: none; }
.sidebar.collapsed .notification-bell { justify-content: center; gap: 2px; padding: 8px; }
.sidebar.collapsed .notification-bell-icon { width: 32px; height: 32px; flex-basis: 32px; }
.sidebar.collapsed .notification-bell-count { margin-left: 0; padding-right: 2px; padding-left: 2px; }
html.rcr-sc .sidebar .notification-bell-label { display: none; }
html.rcr-sc .sidebar .notification-bell { justify-content: center; gap: 2px; padding: 8px; }
html.rcr-sc .sidebar .notification-bell-icon { width: 32px; height: 32px; flex-basis: 32px; }
html.rcr-sc .sidebar .notification-bell-count { margin-left: 0; padding-right: 2px; padding-left: 2px; }
@media (max-width: 768px) {
    .notification-bell-wrap--mobile { display: block; }
    .mobile-bar .notification-bell-wrap--mobile { flex: 0 0 auto; margin-right: 8px; }
    .mobile-bar .notification-bell-wrap--mobile .notification-bell { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 8px; box-sizing: border-box; background: transparent; color: var(--light); font-family: var(--ff-body); font-size: var(--fs-body); line-height: 1; }
    .mobile-bar .notification-bell-wrap--mobile .notification-bell.notification-bell--active { background: transparent; color: var(--light); }
    .mobile-bar .notification-bell-wrap--mobile .notification-bell-icon { width: 24px; height: 24px; flex: 0 0 24px; overflow: visible; }
    .mobile-bar .notification-bell-wrap--mobile .notification-bell svg { display: block; width: 22px; height: 22px; flex: 0 0 22px; }
    .mobile-bar .notification-bell-wrap--mobile .notification-bell-label { display: none; }
    .mobile-bar .notification-bell-wrap--mobile .notification-bell-count { position: static; top: auto; left: auto; min-width: 18px; min-height: 18px; margin: 0; }
    .mobile-bar #m-menu-btn { flex: 0 0 48px; width: 48px; min-width: 48px; height: 48px; margin-left: 4px; }
    .notification-bell-wrap--mobile .notification-preview { position: fixed; bottom: 86px; left: 8px; top: auto; }
    .notification-preview--mobile-portal { position: fixed !important; z-index: 9999 !important; right: 8px; bottom: calc(86px + env(safe-area-inset-bottom, 0px) + var(--notification-viewport-bottom-offset, 0px)); left: 8px; top: auto; width: auto; max-height: calc(var(--notification-viewport-height, 100vh) - 110px); max-height: min(480px, calc(var(--notification-viewport-height, 100vh) - 110px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
    .notification-preview--mobile-portal.is-visible { opacity: 1; pointer-events: auto; }
    .notification-bell-wrap:not(.notification-bell-wrap--mobile) { display: none; }
    .notification-row { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
    .notification-preview--mobile-portal { transition-duration: 1ms; }
}

/* ── Tema oscuro ── */
html.dark .notification-row {
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html.dark .notification-row time,
html.dark .notification-empty {
    color: var(--theme-secondary);
}

html.dark .notification-preview {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

html.dark .notification-preview-heading,
html.dark .notification-preview-section,
html.dark .notification-preview-all,
html.dark .notification-preview-item {
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html.dark .notification-preview-item {
    background: var(--theme-surface);
}

html.dark .notification-preview-empty {
    color: var(--theme-secondary);
}
