/* ============================================
   MÓDULO DE NOTIFICACIONES - Universe CRM
   ============================================ */

/* Botón/Item de Notificaciones en Sidebar */
#notif-bell-btn {
    cursor: pointer;
}

#notif-badge {
    position: relative;
    background: #ff4757;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: notif-pulse 1.5s ease-in-out infinite;
    display: none;
    margin-left: auto; /* Empujar a la derecha en el menu item flex */
}

@keyframes notif-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.5); }
    50%       { transform: scale(1.15); box-shadow: 0 0 0 5px rgba(255, 71, 87, 0); }
}

/* Header & Filters */
.wb-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.notif-filters {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-tab {
    background: none;
    border: none;
    color: var(--wb-text-muted);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 7px;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    color: #fff;
}

.filter-tab.active {
    background: var(--wb-bg-second, #2d3a4b);
    color: var(--wb-accent-blue, #556ee6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: var(--wb-accent-blue, #556ee6);
    color: #fff;
    padding: 12px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(85, 110, 230, 0.2);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.selected-count {
    font-weight: 600;
    font-size: 14px;
}

.bulk-btns {
    display: flex;
    gap: 10px;
}

.btn-bulk {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-bulk:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-bulk.delete:hover {
    background: #ff4757;
    border-color: #ff4757;
}

.btn-close-bulk {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.btn-close-bulk:hover {
    color: #fff;
}

/* Vista de Notificaciones (Módulo) */
.notif-table-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.notif-row {
    transition: background 0.2s ease;
}

.notif-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-row.unread {
    background: rgba(85, 110, 230, 0.04);
}

.notif-row.unread .notif-subject {
    color: #fff;
    font-weight: 600;
}

/* Iconos de Tipo */
.notif-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.notif-type-icon.info    { background: rgba(86, 140, 255, 0.15); color: #568cff; }
.notif-type-icon.warning { background: rgba(247, 201, 72, 0.15);  color: #f7c948; }
.notif-type-icon.error   { background: rgba(255, 71, 87, 0.15);   color: #ff4757; }
.notif-type-icon.success { background: rgba(86, 171, 127, 0.15);  color: #56ab7f; }
.notif-type-icon.ai      { background: rgba(162, 93, 220, 0.15);  color: #a25ddc; }
.notif-type-icon.woocommerce_orders    { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.notif-type-icon.woocommerce_questions { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }

/* Checkboxes */
.notif-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--wb-accent-blue);
}

/* Contenido */
.notif-subject-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notif-subject {
    font-size: 14px;
    color: var(--wb-text-light, #e0e6f0);
}

.notif-body {
    font-size: 12px;
    color: var(--wb-text-muted, #8899a6);
    line-height: 1.4;
}

.notif-date-cell {
    font-size: 12px;
    color: var(--wb-text-muted, #8899a6);
}

/* Botones de acción */
.btn-notif-action {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-notif-action:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.btn-notif-action.delete:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* Empty State */
.notif-empty-state {
    padding: 80px 20px;
    text-align: center;
    color: var(--wb-text-muted);
}

.notif-empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.2;
}

.notif-empty-state h3 {
    margin: 0 0 10px;
    color: #fff;
}

/* ----------------------------------------------------
   MAQUETACIÓN MÓVIL NOTIFICACIONES (v9.5)
   ---------------------------------------------------- */
@media (max-width: 768px) {
    .header-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
    }
    
    .notif-filters {
        width: 100% !important;
        overflow-x: auto !important;
        display: flex !important;
        gap: 4px !important;
        -webkit-overflow-scrolling: touch !important; /* Desplazamiento elástico suave */
        padding: 3px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }
    
    .filter-tab {
        padding: 6px 12px !important;
        font-size: 11.5px !important;
        white-space: nowrap !important;
        flex: 1 1 auto !important;
        text-align: center !important;
    }
    
    .bulk-actions-bar {
        padding: 10px 15px !important;
        border-radius: 8px !important;
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
        position: relative !important;
    }
    
    .bulk-btns {
        width: 100% !important;
        gap: 8px !important;
    }
    
    .btn-bulk {
        flex: 1 1 auto !important;
        justify-content: center !important;
        padding: 8px 12px !important;
        font-size: 11px !important;
    }
    
    .btn-close-bulk {
        position: absolute !important;
        top: 6px !important;
        right: 10px !important;
        font-size: 16px !important;
    }
    
    .notif-table-container {
        border-radius: 8px !important;
        -webkit-overflow-scrolling: touch !important;
        overflow-x: auto !important;
        width: 100% !important;
    }
    
    .notif-table-container .wb-table th {
        padding: 10px 12px !important;
        font-size: 9px !important;
    }
    
    .notif-table-container .wb-table td {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    
    .notif-type-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
        border-radius: 6px !important;
    }
    
    .notif-subject {
        font-size: 12px !important;
    }
    
    .notif-body {
        font-size: 10.5px !important;
        line-height: 1.3 !important;
    }
    
    .notif-date-cell {
        font-size: 10px !important;
    }
    
    .btn-notif-action {
        padding: 4px !important;
    }
}

/* =======================================================
   ASISTENTE DE NOTIFICACIONES & MODAL DE GESTIÓN
   ======================================================= */
.notif-assistant-control-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-assistant-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 14px;
    transition: all 0.2s ease;
}

.notif-assistant-toggle-wrap:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(139, 92, 246, 0.3);
}

.notif-bot-icon {
    color: #8b5cf6;
    font-size: 15px;
}

.assistant-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.notif-assistant-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.notif-assistant-badge.on {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.notif-assistant-badge.off {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.notif-btn-manage {
    background: rgba(139, 92, 246, 0.12) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    color: #c4b5fd !important;
    border-radius: 10px !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
}

.notif-btn-manage:hover {
    background: rgba(139, 92, 246, 0.25) !important;
    color: #fff !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.2);
}

/* Modal Gestión de Asistente */
.notif-assistant-modal-content {
    max-width: 680px !important;
    width: 92% !important;
    background: rgba(20, 24, 35, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    color: #fff !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6) !important;
    position: relative;
    margin: auto;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-avatar-bot {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.notif-utilities-loading {
    text-align: center;
    padding: 40px;
    color: var(--wb-text-muted);
    font-size: 14px;
}

.notif-utilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    max-height: 460px;
    overflow-y: auto;
    padding: 10px 4px;
}

.notif-utilities-grid::-webkit-scrollbar {
    width: 6px;
}

.notif-utilities-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.utility-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.utility-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.utility-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.utility-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.utility-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.utility-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.utility-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.utility-badge {
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.utility-desc {
    font-size: 11.5px;
    color: var(--wb-text-muted);
    line-height: 1.4;
    margin: 0;
}

.wb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

@media (max-width: 900px) {
    .wb-header-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        flex-wrap: wrap;
    }
    
    .notif-assistant-control-bar {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* ============================================
   CANALES DEDICADOS DE NOTIFICACIÓN
   ============================================ */
.notif-channels-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.channel-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: all 0.25s ease;
}

.channel-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.channel-card:last-child {
    margin-bottom: 0;
}

.channel-status-label {
    transition: color 0.2s ease;
}



