/* Mensajeria omnicanal — pantalla de Canales WhatsApp (vinculacion gateway). Prefijo .wgw- */

.wgw-wrap { padding: 0 4px 32px; }

.wgw-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border-bottom: 3px solid #d4af37;
    border-radius: 10px 10px 0 0;
    color: #fff;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.wgw-banner i { font-size: 26px; color: #25d366; }
.wgw-banner h2 { margin: 0; font-size: 20px; font-weight: 600; }
.wgw-banner p { margin: 2px 0 0; font-size: 13px; opacity: .85; }

.wgw-info {
    background: #f5f7fb;
    border: 1px solid #e0e4ec;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 16px 24px;
    margin-bottom: 20px;
}
.wgw-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.wgw-compare .wgw-opt {
    background: #fff; border: 1px solid #e0e4ec; border-radius: 8px; padding: 12px 14px;
}
.wgw-opt h4 { margin: 0 0 6px; font-size: 14px; color: #1e3a5f; display: flex; align-items: center; gap: 8px; }
.wgw-opt ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: #566; }
.wgw-opt.meta { border-left: 3px solid #1976d2; }
.wgw-opt.gateway { border-left: 3px solid #d4af37; }
.wgw-prov-pill {
    display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px;
    font-size: 11.5px; font-weight: 600; background: #1e3a5f; color: #fff;
}

.wgw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

.wgw-card {
    background: #fff; border: 1px solid #e0e4ec; border-radius: 12px;
    box-shadow: 0 2px 10px rgba(30,58,95,.06); overflow: hidden;
    display: flex; flex-direction: column;
}
.wgw-card__head {
    padding: 14px 18px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #eef1f6;
}
.wgw-card__head i { font-size: 22px; color: #2c5282; }
.wgw-card__head .t { font-weight: 600; color: #1e3a5f; }
.wgw-card__head .s { font-size: 12px; color: #8a97a8; }

.wgw-card__body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 12px; }

.wgw-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
    border-radius: 14px; font-size: 12.5px; font-weight: 600; width: fit-content;
}
.wgw-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.wgw-badge.conectado { background: #e7f6ec; color: #2e7d32; }
.wgw-badge.esperando { background: #fff4e0; color: #c77700; }
.wgw-badge.conectando { background: #e8f0fb; color: #1976d2; }
.wgw-badge.desconectado { background: #eef1f6; color: #6b7787; }
.wgw-badge.baneado { background: #fdeaea; color: #c62828; }

.wgw-tel { font-size: 13px; color: #445; }
.wgw-tel b { color: #1e3a5f; }

.wgw-qr {
    align-self: center; text-align: center; padding: 10px;
    background: #fff; border: 1px solid #e0e4ec; border-radius: 10px;
}
.wgw-qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.wgw-qr .hint { font-size: 12px; color: #8a97a8; margin-top: 6px; }

.wgw-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.wgw-unreachable {
    background: #fdeaea; color: #c62828; border: 1px solid #f3c6c6;
    border-radius: 8px; padding: 8px 12px; font-size: 12.5px;
}

/* Mini-card de salud del canal (Central de Mensajería C8 — seguro anti-ban) */
.wgw-salud {
    background: #f5f7fb; border: 1px solid #e0e4ec; border-radius: 10px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.wgw-salud__head { display: flex; align-items: center; gap: 8px; }
.wgw-salud__titulo { font-size: 12.5px; font-weight: 600; color: #1e3a5f; }

.wgw-semaforo {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.wgw-semaforo.verde { background: #2e7d32; }
.wgw-semaforo.ambar { background: #c77700; }
.wgw-semaforo.rojo { background: #c62828; }

.wgw-salud__sindatos { font-size: 12px; color: #8a97a8; font-style: italic; }

.wgw-warmup { display: flex; flex-direction: column; gap: 4px; }
.wgw-warmup__label {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #445;
}
.wgw-warmup__label i { color: #2c5282; margin-right: 4px; }

.wgw-warmbar {
    width: 100%; height: 7px; border-radius: 4px; background: #e0e4ec; overflow: hidden;
}
.wgw-warmbar__fill {
    height: 100%; border-radius: 4px; transition: width .3s ease;
}
.wgw-warmbar__fill.ok { background: #2e7d32; }
.wgw-warmbar__fill.alerta { background: #c77700; }
.wgw-warmbar__fill.critico { background: #c62828; }

.wgw-salud__fila { display: flex; gap: 14px; flex-wrap: wrap; }
.wgw-salud__item { font-size: 12px; color: #6b7787; }
.wgw-salud__item i { margin-right: 4px; }
.wgw-salud__item.resalta { color: #c77700; font-weight: 600; }
.wgw-salud__item.error { color: #c62828; font-weight: 600; }

.wgw-salud__uptime { font-size: 11.5px; color: #8a97a8; }

/* Modal disclaimer */
.wgw-modal-back {
    position: fixed; inset: 0; background: rgba(20,30,45,.55);
    /* 1055 como los demas modales del ERP: por DEBAJO del 1060 de SweetAlert, si no la confirmacion queda tapada. */
    display: flex; align-items: center; justify-content: center; z-index: 1055; padding: 16px;
}
.wgw-modal {
    background: #fff; border-radius: 12px; max-width: 560px; width: 100%;
    box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden;
}
.wgw-modal__head {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border-bottom: 3px solid #d4af37; color: #fff; padding: 16px 20px;
    font-weight: 600; display: flex; align-items: center; gap: 10px;
}
.wgw-modal__body { padding: 20px; font-size: 13.5px; color: #445; }
.wgw-legal {
    background: #fff9e8; border: 1px solid #f0e0b0; border-radius: 8px;
    padding: 12px 14px; margin: 12px 0; font-size: 12.5px; color: #6b5a20; line-height: 1.5;
}
.wgw-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; font-size: 13px; }
.wgw-check input { margin-top: 3px; }
.wgw-modal__foot { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #eef1f6; }

/* F6 — canales oficiales de Meta */
.wgw-oficiales { margin-top: 28px; background: #fff; border: 1px solid #e0e4ec; border-radius: 12px; padding: 18px 20px; }
.wgw-oficiales h3 { font-size: 16px; color: #1e3a5f; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.wgw-hint { font-size: 12.5px; color: #667; margin: 0 0 14px; }
.wgw-hint code { background: #f0f3f8; padding: 2px 6px; border-radius: 4px; color: #1e3a5f; font-size: 12px; }
.wgw-tabla { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.wgw-tabla th { background: #1e3a5f; color: #fff; font-size: 12px; text-align: left; padding: 8px 10px; }
.wgw-tabla td { padding: 8px 10px; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.wgw-vacio { text-align: center; color: #9aa7b8; }
.wgw-mono { font-family: monospace; font-size: 12px; color: #556; }
.wgw-canal-badge { background: #e8f0fb; color: #1976d2; border-radius: 10px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.wgw-del { border: none; background: transparent; color: #c62828; cursor: pointer; }
.wgw-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.wgw-form input, .wgw-form select { border: 1px solid #d7deea; border-radius: 6px; padding: 7px 10px; font-size: 13px; }
.wgw-form input { flex: 1; min-width: 140px; }

/* EXT-01 — agente IA */
.wgw-agente h3 i { color: #7c4dff; }
.wgw-agente-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; margin-bottom: 12px; }
.wgw-agente-activo { grid-column: 1 / -1; font-size: 13.5px; }
.wgw-agente-campo { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.wgw-agente-campo label { font-size: 12px; color: #667; font-weight: 600; }
.wgw-agente-campo input, .wgw-agente-campo select, .wgw-agente-campo textarea {
    border: 1px solid #d7deea; border-radius: 6px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.wgw-agente-campo textarea { resize: vertical; line-height: 1.45; }
.wgw-agente-horario { display: flex; align-items: center; gap: 8px; }
.wgw-agente-horario input { width: 80px; }
.wgw-agente-probar { margin-top: 16px; border-top: 1px dashed #e0e4ec; padding-top: 12px; }
.wgw-agente-probar > label { font-size: 12px; color: #667; font-weight: 600; display: block; margin-bottom: 6px; }
.wgw-agente-respuesta {
    background: #f3effd; border: 1px solid #ddd2f5; border-radius: 10px;
    padding: 10px 14px; font-size: 13.5px; color: #3d3358; margin-top: 8px; white-space: pre-wrap;
}
.wgw-agente-respuesta i { color: #7c4dff; margin-right: 6px; }
.wgw-agente-tokens { font-size: 11px; color: #9a8fc0; margin-top: 6px; }

/* Acciones fijas del agente ([DERIVAR], [CERRAR]) y reglas que se agregan al prompt */
.wgw-acc-lista { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.wgw-acc { border: 1px solid #e0e4ec; border-left: 3px solid var(--primario, #284A70); border-radius: 10px; padding: 12px 14px; background: #fafbfd; min-width: 0; }
.wgw-acc-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.wgw-acc-nombre { font-weight: 600; color: #1e3a5f; font-size: 14px; }
.wgw-acc-token { background: #f0f3f8; color: #1e3a5f; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.wgw-acc-det { margin: 0; font-size: 12.5px; }
.wgw-acc-det dt { color: #8a97a8; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; margin-top: 8px; }
.wgw-acc-det dd { margin: 2px 0 0; color: #3d4a5c; line-height: 1.45; }
.wgw-acc-ej { font-style: italic; color: #2c5282; }
.wgw-acc-reglas { margin-top: 14px; font-size: 12.5px; color: #3d4a5c; }
.wgw-acc-reglas summary { cursor: pointer; color: #2c5282; font-weight: 600; }
.wgw-acc-reglas ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.wgw-acc-reglas li + li { margin-top: 4px; }

/* ===================== F3 — Canales de mensajeria (hub + wizard) ===================== */

/* Banner badge de proveedor default */
.wgw-banner { position: relative; }
.wgw-prov-badge {
    margin-left: auto; font-size: 12px; color: #445;
    background: #eef3fb; border: 1px solid #dbe6f5; border-radius: 20px; padding: 6px 14px;
}
.wgw-prov-badge b { color: #1e3a5f; }

/* Hub con tabs laterales */
.wgw-hub { display: grid; grid-template-columns: 240px 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.wgw-hubnav { display: flex; flex-direction: column; gap: 8px; }
.wgw-hubtab {
    display: flex; align-items: center; gap: 12px; text-align: left;
    background: #fff; border: 1px solid #e0e4ec; border-radius: 12px; padding: 14px 16px;
    cursor: pointer; color: #445; transition: all .15s;
}
.wgw-hubtab i { font-size: 20px; color: #8a97a8; width: 24px; text-align: center; }
.wgw-hubtab span { display: flex; flex-direction: column; }
.wgw-hubtab b { font-size: 14px; color: #1e3a5f; }
.wgw-hubtab small { font-size: 11.5px; color: #8a97a8; }
.wgw-hubtab.activo { border-color: #2c5282; box-shadow: 0 2px 10px rgba(44,82,130,.12); }
.wgw-hubtab.activo i { color: #2c5282; }
.wgw-hubbody { min-width: 0; }

/* KPIs */
.wgw-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.wgw-kpi { background: #fff; border: 1px solid #e0e4ec; border-radius: 12px; padding: 14px 16px; border-left: 3px solid #2c5282; }
.wgw-kpi .k { font-size: 24px; font-weight: 700; color: #1e3a5f; }
.wgw-kpi .k small { font-size: 13px; font-weight: 400; color: #8a97a8; }
.wgw-kpi .l { font-size: 12px; color: #667; margin-top: 2px; }

.wgw-listhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wgw-listhead h3 { font-size: 16px; color: #1e3a5f; margin: 0; display: flex; align-items: center; gap: 8px; }
.wgw-vacio-box { background: #f7f9fc; border: 1px dashed #d7deea; border-radius: 10px; padding: 18px; text-align: center; color: #8a97a8; font-size: 13px; }

/* Lista: una fila por canal */
.wgw-lista { display: flex; flex-direction: column; gap: 10px; }
.wgw-fila { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e0e4ec; border-radius: 12px; padding: 14px 16px; }
.wgw-fila__icono { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex-shrink: 0; background: #6b7787; }
.wgw-fila__icono.wa { background: #25d366; }
.wgw-fila__icono.msn { background: #0084ff; }
.wgw-fila__icono.ig { background: linear-gradient(45deg,#f09433,#dc2743,#bc1888); }
.wgw-fila__icono.lead { background: #1976d2; }
.wgw-fila__icono.tg { background: #29a9eb; }
.wgw-fila__main { flex: 1; min-width: 0; }
.wgw-fila__linea1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wgw-fila__nombre { font-weight: 600; color: #1e3a5f; font-size: 14px; }
.wgw-fila__linea2 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: #8a97a8; }
.wgw-tipo { background: #eef1f6; color: #6b7787; border-radius: 8px; padding: 1px 8px; font-size: 11px; }
.wgw-ident i, .wgw-cola i { margin-right: 4px; }

.wgw-estado { font-size: 11.5px; font-weight: 600; border-radius: 12px; padding: 2px 10px; display: inline-flex; align-items: center; gap: 6px; }
.wgw-estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.wgw-estado.conectado { background: #e7f6ec; color: #2e7d32; }
.wgw-estado.esperando { background: #fff4e0; color: #c77700; }
.wgw-estado.conectando { background: #e8f0fb; color: #1976d2; }
.wgw-estado.desconectado { background: #eef1f6; color: #6b7787; }
.wgw-estado.baneado { background: #fdeaea; color: #c62828; }

.wgw-prov-chip { font-size: 11px; border-radius: 12px; padding: 2px 10px; font-weight: 600; }
.wgw-prov-chip.gateway { background: #fbf3dd; color: #9a7b1f; }
.wgw-prov-chip.meta { background: #e8f0fb; color: #1976d2; }
.wgw-ia-chip { font-size: 11px; border-radius: 12px; padding: 2px 10px; }
.wgw-ia-chip.on { background: #f3effd; color: #7c4dff; font-weight: 600; }
.wgw-ia-chip.off { background: #eef1f6; color: #9aa7b8; }

.wgw-minisalud { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.wgw-minisalud .wgw-warmbar { width: 90px; height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; }
.wgw-mini-item { font-size: 11.5px; color: #8a97a8; }
.wgw-mini-item i { margin-right: 3px; }
.wgw-mini-item.resalta { color: #c77700; font-weight: 600; }
.wgw-mini-item.error { color: #c62828; font-weight: 600; }

.wgw-fila__acciones { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Switch (toggle) */
.wgw-switch, .wgw-canaltoggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.wgw-switch input, .wgw-canaltoggle input { display: none; }
.wgw-switch__sl { width: 38px; height: 20px; background: #cfd7e3; border-radius: 12px; position: relative; transition: background .15s; flex-shrink: 0; }
.wgw-switch__sl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.wgw-switch input:checked + .wgw-switch__sl, .wgw-canaltoggle input:checked + .wgw-switch__sl { background: #2e7d32; }
.wgw-switch input:checked + .wgw-switch__sl::after, .wgw-canaltoggle input:checked + .wgw-switch__sl::after { transform: translateX(18px); }
.wgw-switch input:disabled + .wgw-switch__sl, .wgw-canaltoggle input:disabled + .wgw-switch__sl { opacity: .45; }
.wgw-switch__tx { font-size: 12px; color: #667; }

/* Wizard */
.wgw-modal--wide { max-width: 640px; }
.wgw-steps { margin-left: auto; display: flex; gap: 6px; }
.wgw-steps span { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.2); color: #cbd6e6; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.wgw-steps span.on { background: #d4af37; color: #1e3a5f; }
.wgw-wiz-tit { font-size: 15px; color: #1e3a5f; margin: 0 0 14px; }

.wgw-tipogrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.wgw-tipocard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; background: #fff; border: 2px solid #e0e4ec; border-radius: 12px; cursor: pointer; color: #445; position: relative; }
.wgw-tipocard i { font-size: 26px; color: #2c5282; }
.wgw-tipocard.sel { border-color: #2c5282; background: #f4f8fd; }
.wgw-tipocard.deshab { opacity: .55; cursor: not-allowed; }
.wgw-proximo { font-size: 10px; color: #c77700; background: #fff4e0; border-radius: 8px; padding: 1px 7px; }

.wgw-provgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wgw-provcard { text-align: left; background: #fff; border: 2px solid #e0e4ec; border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.wgw-provcard.sel { border-color: #2c5282; background: #f4f8fd; }
.wgw-provcard h5 { margin: 0 0 8px; font-size: 14px; color: #1e3a5f; display: flex; align-items: center; gap: 8px; }
.wgw-provcard ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: #566; }

.wgw-webhook { display: flex; align-items: center; gap: 8px; background: #f0f3f8; border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; }
.wgw-webhook code { flex: 1; font-size: 12px; color: #1e3a5f; word-break: break-all; }
.wgw-copy { border: none; background: #2c5282; color: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.wgw-nota24 { font-size: 12px; color: #8a97a8; margin: 8px 0 0; }
.wgw-nota24 i { color: #1976d2; margin-right: 4px; }

/* Sub-secciones de config / agente */
.wgw-sub { font-size: 14px; color: #1e3a5f; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.wgw-agente-master { font-size: 13.5px; margin-bottom: 16px; background: #f4f8fd; border: 1px solid #dbe6f5; border-radius: 10px; padding: 12px 14px; }
.wgw-canaltoggle { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid #f0f2f6; }
.wgw-canaltoggle i { font-size: 16px; color: #6b7787; }
.wgw-canaltoggle__nom { font-size: 13px; color: #1e3a5f; font-weight: 600; }

@media (max-width: 760px) {
    .wgw-hub { grid-template-columns: 1fr; }
    .wgw-hubnav { flex-direction: row; }
    .wgw-provgrid { grid-template-columns: 1fr; }
}

/* Advertencia inline del wizard de canales (no popup detras del modal) */
.wgw-wiz-alert {
    margin: 4px 20px 0;
    padding: 9px 12px;
    background: #fff4e5;
    border: 1px solid #ffd8a8;
    border-left: 3px solid var(--secundario, #fe7800);
    border-radius: 8px;
    color: #8a5300;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Contenedor de la lista de canales: ancla el InsiSpinner (Mode=List) mientras carga */
.wgw-lista-wrap {
    position: relative;
    min-height: 90px;
}

/* ── Perfiles del agente IA (SQL 50): uno por producto/negocio ── */
.wgw-perfiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.wgw-perfil {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 230px;
    padding: 10px 12px;
    border: 1px solid var(--linea-suave, #e0e4ec);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s, box-shadow .15s;
}

.wgw-perfil:hover { border-color: #b9c6dd; box-shadow: 0 2px 8px rgba(30,58,95,.08); }

.wgw-perfil.activo {
    border-color: var(--primario, #284A70);
    box-shadow: 0 0 0 2px rgba(40,74,112,.12);
}

.wgw-perfil__ico {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef3fa;
    color: var(--primario, #284A70);
}

.wgw-perfil__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wgw-perfil__txt b { font-size: .86rem; color: #1e3a5f; }
.wgw-perfil__txt small { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.wgw-perfil__del {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #c62828;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
}

.wgw-perfil__del:hover { background: #fdecea; }

.wgw-perfil--nuevo {
    border-style: dashed;
    background: #fafbfd;
}

.wgw-perfil--nuevo .wgw-perfil__ico { background: #f0f2f6; color: #6b7a90; }

/* Selector de perfil dentro de la fila de canal */
.wgw-perfil-sel {
    margin-left: auto;
    max-width: 210px;
    padding: 4px 8px;
    font-size: .8rem;
    border: 1px solid var(--linea-suave, #e0e4ec);
    border-radius: 6px;
    background: #fff;
    color: #1e3a5f;
}

/* ══ Plan Chat Conexiones: catálogo "Agregar conexión" + fila de conexión ═══════════════════ */

/* Tarjetas del catálogo: título + descripción, como la referencia del user */
.wgw-tipogrid--catalogo { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.wgw-tipocard { text-align: left; align-items: flex-start; gap: 6px; }
.wgw-tipocard__tit { font-weight: 800; font-size: 13.5px; color: #1e3a5f; }
.wgw-tipocard__desc { font-size: 12px; color: #667085; line-height: 1.4; font-weight: 400; }
.wgw-tipocard.deshab .wgw-tipocard__tit,
.wgw-tipocard.deshab .wgw-tipocard__desc { color: #98a2b3; }

/* Color de marca por tipo (icono de la tarjeta y de la fila) */
.wgw-tipocard--wsp i, .wgw-fila__icono.wsp { color: #25D366; }
.wgw-tipocard--cloud i, .wgw-fila__icono.cloud { color: #128C7E; }
.wgw-tipocard--msn i, .wgw-fila__icono.msn { color: #0084FF; }
.wgw-tipocard--ig i, .wgw-fila__icono.ig { color: #E1306C; }
.wgw-tipocard--lead i, .wgw-fila__icono.lead { color: #fe7800; }
.wgw-tipocard--tg i, .wgw-fila__icono.tg { color: #229ED9; }
.wgw-tipocard--web i, .wgw-fila__icono.web { color: #1976d2; }
.wgw-tipocard--tiktok i, .wgw-fila__icono.tiktok { color: #111; }
.wgw-tipocard--sandbox i, .wgw-fila__icono.sandbox { color: #7b61ff; }

/* Chip de contexto (para qué es la conexión) */
.wgw-ctx-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: #eef1f6;
    color: #55607a;
}
.wgw-ctx-chip--crm { background: #e7f0fb; color: #1565c0; }
.wgw-ctx-chip--cobranza { background: #fff3e6; color: #b45309; }
.wgw-ctx-chip--helpdesk { background: #ede9fe; color: #6d28d9; }

/* Conexión deshabilitada: atenuada pero visible (se puede volver a habilitar) */
.wgw-fila--off { opacity: .6; background: #fafbfd; }
.wgw-fila--off .wgw-fila__icono { filter: grayscale(1); }

/* Botón habilitar/deshabilitar: mismo tamaño que el de eliminar, color neutro */
.wgw-del--soft { color: #55607a; }
.wgw-del--soft:hover { background: #eef1f6; color: #1e3a5f; }

/* ── Sandbox (E4): simulador de cliente ── */
.wgw-sbx-intro {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f3f0ff;
    border: 1px solid #ddd6fe;
    color: #3b3170;
    line-height: 1.45;
}
.wgw-sbx-intro i { color: #7b61ff; font-size: 20px; margin-top: 2px; }
.wgw-sbx .wgw-sub i { color: #7b61ff; }
.wgw-sbx-chat {
    margin: 10px 0;
    padding: 10px;
    min-height: 120px;
    max-height: 260px;
    overflow-y: auto;
    border-radius: 10px;
    background: #f5f7fb;
    border: 1px solid #e0e4ec;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wgw-sbx-vacio { color: #7a8599; font-size: 12.5px; text-align: center; padding: 30px 10px; }
.wgw-sbx-msg {
    max-width: 78%;
    padding: 7px 11px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.35;
    background: #fff;
    border: 1px solid #e0e4ec;
    align-self: flex-start;
}
.wgw-sbx-msg.asesor, .wgw-sbx-msg.bot { align-self: flex-end; background: #e7f0fb; border-color: #cfe0f5; }
.wgw-sbx-msg.bot { background: #f3f0ff; border-color: #ddd6fe; }
.wgw-sbx-msg__quien { font-size: 10.5px; font-weight: 700; color: #55607a; margin-bottom: 2px; }
.wgw-sbx-msg.bot .wgw-sbx-msg__quien { color: #6d28d9; }
.wgw-sbx-msg__texto { white-space: pre-wrap; word-break: break-word; color: #223; }
.wgw-sbx-envio { display: flex; gap: 8px; align-items: center; }
.wgw-sbx-envio input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    font-size: 13px;
}
/* Contexto "salud": faltaba, así que su chip salía sin color y se leía como "sin contexto" */
.wgw-ctx-chip--salud { background: #e6f7f1; color: #0f766e; }
