/* ============================================================
   Sistema de Notificaciones (FASE 1G.3.6)
   Campana + panel desplegable del navbar
   Respeto del Design System existente (variables CSS de main.css)
   ============================================================ */

.navbar-notificaciones {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.navbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--bg-white, #ffffff);
    color: var(--text-primary, #1e293b);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar-bell:hover,
.navbar-bell[aria-expanded="true"] {
    background: #f1f5f9;
    color: var(--primary, #0f766e);
}

.navbar-bell-badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--danger, #dc2626);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.notificaciones-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 40;
    width: 22rem;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-md, 0.5rem);
    background: var(--bg-white, #ffffff);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.15));
}

.notificaciones-panel-header,
.notificaciones-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-light, #eef2f7);
    font-size: 0.85rem;
    font-weight: 600;
}

.notificaciones-panel-footer {
    justify-content: center;
    border-bottom: 0;
    border-top: 1px solid var(--border-light, #eef2f7);
}

.notificaciones-panel-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary, #0f766e);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.notificaciones-panel-link:hover {
    text-decoration: underline;
}

.notificaciones-panel-list {
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 21rem;
    overflow-y: auto;
}

.notificaciones-panel-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-light, #eef2f7);
}

.notificaciones-panel-item.is-noleida {
    background: #f0fdfa;
}

.notificaciones-panel-item.is-leida {
    opacity: 0.7;
}

.notificaciones-panel-item:last-child {
    border-bottom: 0;
}

.notificaciones-panel-enlace {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--text-primary, #1e293b);
    text-decoration: none;
}

.notificaciones-panel-titulo {
    font-size: 0.82rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.notificaciones-panel-fecha {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
}

.notificaciones-panel-marcar {
    flex-shrink: 0;
    margin: 0;
}

.notificaciones-panel-marcar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 0.375rem);
    background: #fff;
    color: var(--primary, #0f766e);
    cursor: pointer;
}

.notificaciones-panel-marcar-btn:hover {
    background: var(--primary, #0f766e);
    color: #fff;
}

.notificaciones-panel-empty {
    padding: 1.25rem 0.85rem;
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
    text-align: center;
}

@media (max-width: 768px) {
    .navbar-notificaciones {
        margin-right: 0.25rem;
    }

    .notificaciones-panel {
        position: fixed;
        top: 3.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
    }
}
