/* =============================================================================
 * notifications.css — módulo de Notificaciones.
 *
 * Campanita del header (badge + dropdown estilo Facebook) y vista del buzón.
 * Usa los tokens de app-modern.css (--surface, --border, --text, --primary…)
 * para verse bien en tema claro y oscuro sin reglas duplicadas.
 * ========================================================================== */

/* ============================ CAMPANITA (header) ============================ */
.ntf-bell > a.ntf-bell-btn{
    position:relative;
    font-size:17px;
    line-height:1;
}
.ntf-bell > a.ntf-bell-btn .ntf-badge{
    position:absolute;
    top:7px; right:4px;
    min-width:18px; height:18px;
    padding:0 5px;
    border-radius:9px;
    background:#ef4444;
    color:#fff !important;
    font-size:11px; font-weight:700;
    display:inline-flex; align-items:center; justify-content:center;
    border:2px solid var(--surface, #fff);
    pointer-events:none;
}

/* Dropdown (alineado a la derecha, ancho fijo con scroll) */
.ntf-bell .dropdown-menu.ntf-dd{
    right:0; left:auto;
    width:372px; max-width:92vw;
    padding:0;
    border-radius:14px;
    overflow:hidden;
    background:var(--surface, #fff);
    border:1px solid var(--border, #d7dbe6);
    box-shadow:0 24px 60px -18px rgba(0,0,0,.35);
}
.ntf-dd-head{
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 16px;
    font-weight:700; font-size:15px;
    color:var(--text, #0f172a);
    border-bottom:1px solid var(--border-soft, #e7eaf3);
}
.ntf-dd-head i{ color:var(--primary, #4f46e5); margin-right:6px; }
.ntf-dd-head .ntf-dd-all{
    font-size:12px; font-weight:600;
    color:var(--primary, #4f46e5);
}
.ntf-dd-body{ padding:0; }
.ntf-dd-list{
    max-height:380px;
    overflow-y:auto;
}
.ntf-dd-foot{ border-top:1px solid var(--border-soft, #e7eaf3); }
.ntf-dd-foot a{
    display:block; text-align:center;
    padding:10px 12px !important;
    font-weight:600; font-size:13px;
    color:var(--primary, #4f46e5) !important;
}
.ntf-dd-foot a:hover{ background:var(--surface-2, #f4f6fb) !important; }

/* Item del dropdown (estilo feed de Facebook) */
a.ntf-item{
    display:flex; gap:10px; align-items:flex-start;
    padding:10px 14px;
    color:var(--text, #0f172a);
    text-decoration:none;
    border-bottom:1px solid var(--border-soft, #e7eaf3);
    position:relative;
}
a.ntf-item:last-child{ border-bottom:none; }
a.ntf-item:hover{ background:var(--surface-2, #f4f6fb); }
a.ntf-item.is-unread{ background:var(--primary-soft, rgba(79,70,229,.10)); }
a.ntf-item.is-unread:hover{ background:var(--primary-soft, rgba(79,70,229,.16)); }
.ntf-item .ntf-txt{ flex:1; min-width:0; display:block; }
.ntf-item .ntf-title{
    display:block; font-weight:700; font-size:13px; line-height:1.3;
    color:var(--text, #0f172a);
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ntf-item .ntf-body{
    display:block; font-size:12px; line-height:1.4;
    color:var(--text-muted, #475569);
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.ntf-item .ntf-time{
    display:block; font-size:11px; margin-top:2px;
    color:var(--primary, #4f46e5); font-weight:600;
}
.ntf-dot{
    width:10px; height:10px; border-radius:50%;
    background:var(--primary, #4f46e5);
    flex:none; margin-top:6px;
}

/* Ícono circular por tipo (dropdown y vista) */
.ntf-ico{
    width:38px; height:38px; flex:none;
    border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:15px; color:#fff;
    background:var(--primary, #4f46e5);
}
.ntf-ico.nt-stock{ background:#f59e0b; }
.ntf-ico.nt-cxc{   background:#3b82f6; }
.ntf-ico.nt-pay{   background:#ef4444; }
.ntf-ico.nt-bank{  background:#0f766e; }
.ntf-ico.nt-req{   background:#7c3aed; }
.ntf-ico.nt-pla{   background:#0891b2; }
.ntf-ico.nt-test{  background:#10b981; }
.ntf-ico.nt-sys{   background:#64748b; }

/* Vacío (dropdown y vista) */
.ntf-empty{
    padding:26px 16px;
    text-align:center;
    color:var(--text-soft, #64748b);
    font-size:13px;
}
.ntf-empty i{ display:block; font-size:26px; margin-bottom:8px; opacity:.6; }
.ntf-empty.big{ padding:48px 16px; font-size:14px; }
.ntf-empty.big i{ font-size:40px; }

/* Botón "Activar notificaciones" del menú del usuario */
.hdr-acct-menu .ntf-push-toggle.is-on .ntf-push-label{ font-weight:600; }
.hdr-acct-menu .ntf-push-toggle.is-on i{ color:var(--on-success); }

/* ============================ VISTA: BUZÓN ============================ */
.ntf-wrap .ntf-title-h{ display:flex; align-items:center; gap:10px; }
.ntf-wrap .ntf-title-h i{ color:var(--primary, #4f46e5); }
.ntf-wrap .ntf-sub{ color:var(--text-soft, #64748b); font-size:15px; }

.ntf-panel{
    background:var(--surface, #fff);
    border:1px solid var(--border, #d7dbe6);
    border-radius:14px;
    box-shadow:var(--shadow, 0 10px 30px -18px rgba(0,0,0,.18));
    margin-bottom:18px;
    overflow:hidden;
}
.ntf-panel-head{
    padding:11px 16px;
    font-weight:700; font-size:14px;
    color:var(--text, #0f172a);
    border-bottom:1px solid var(--border-soft, #e7eaf3);
}
.ntf-panel-head i{ color:var(--primary, #4f46e5); margin-right:6px; }
.ntf-panel-head.ntf-dark{ background:var(--surface-2, #f4f6fb); }
.ntf-panel-body{ padding:14px 16px; }

/* Tarjeta de activación de push */
.ntf-push-card{
    display:flex; align-items:center; justify-content:space-between;
    gap:16px; padding:16px;
    flex-wrap:wrap;
}
.ntf-push-info{ display:flex; gap:14px; align-items:flex-start; flex:1; min-width:260px; }
.ntf-push-ico{
    width:46px; height:46px; flex:none;
    border-radius:12px;
    background:var(--primary-soft, rgba(79,70,229,.10));
    color:var(--primary, #4f46e5);
    display:inline-flex; align-items:center; justify-content:center;
    font-size:20px;
}
.ntf-push-title{ font-weight:700; font-size:15px; color:var(--text, #0f172a); }
.ntf-push-desc{ font-size:12.5px; color:var(--text-muted, #475569); margin-top:3px; max-width:640px; }
.ntf-push-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.ntf-push-actions .ntf-push-toggle.is-on{
    background:#10b981 !important;
    border-color:#10b981 !important;
}
#ntf-sound-toggle.is-off{ color:var(--text-soft, #64748b) !important; }
#ntf-sound-toggle.is-off i{ opacity:.75; }

/* Filtros */
.ntf-filters{ display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
.ntf-field label{
    display:block; font-size:11px; font-weight:700;
    text-transform:uppercase; letter-spacing:.4px;
    color:var(--text-soft, #64748b); margin-bottom:4px;
}
.ntf-field.ntf-grow{ flex:1; min-width:200px; }
.ntf-actions{
    display:flex; gap:8px; flex-wrap:wrap;
    margin-top:12px; padding-top:12px;
    border-top:1px dashed var(--border-soft, #e7eaf3);
}

/* Fila de notificación en la vista */
.ntf-list-wrap{ padding:0; }
.ntf-row{
    display:flex; gap:12px; align-items:flex-start;
    padding:14px 16px;
    border-bottom:1px solid var(--border-soft, #e7eaf3);
    cursor:pointer;
}
.ntf-row:last-child{ border-bottom:none; }
.ntf-row:hover{ background:var(--surface-2, #f4f6fb); }
.ntf-row.is-unread{
    background:var(--primary-soft, rgba(79,70,229,.08));
    box-shadow:inset 3px 0 0 var(--primary, #4f46e5);
}
.ntf-row-main{ flex:1; min-width:0; }
.ntf-row-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.ntf-row .ntf-title{ font-weight:700; font-size:14px; color:var(--text, #0f172a); }
.ntf-row .ntf-body{ font-size:13px; color:var(--text-muted, #475569); margin-top:2px; }
.ntf-row .ntf-time{ font-size:11.5px; color:var(--text-soft, #64748b); margin-top:4px; }
.ntf-tag{
    font-size:10.5px; font-weight:700;
    padding:2px 8px; border-radius:999px;
    color:#fff; letter-spacing:.3px;
}
/* Con texto blanco encima, los acentos medios no alcanzan (ámbar 2,15:1,
   azul 3,68:1, rojo 3,76:1, verde 2,40:1). Fondos un par de tonos más
   hundidos —blanco de 4,8:1 hacia arriba— y el ámbar, que oscurecido se
   vuelve café, conserva su color con tinta oscura. */
.ntf-tag.nt-stock{ background:#f59e0b; color:#1f2937; }
.ntf-tag.nt-cxc{   background:#1d4ed8; }
.ntf-tag.nt-pay{   background:#dc2626; }
.ntf-tag.nt-bank{  background:#0f766e; }
.ntf-tag.nt-req{   background:#6d28d9; }
.ntf-tag.nt-pla{   background:#0e7490; }
.ntf-tag.nt-test{  background:#047857; }
.ntf-tag.nt-sys{   background:#64748b; }
.ntf-row-actions{ display:flex; gap:6px; flex:none; align-items:center; }

@media (max-width: 560px){
    .ntf-bell .dropdown-menu.ntf-dd{ position:fixed; top:52px; right:2vw; }
    .ntf-push-card{ flex-direction:column; align-items:stretch; }
}
