/* ═══════════════════════════════════════════════
   v87 · INSIGNIA DE BOT Y CHAT COMPARTIDO (pestaña Control)
   Todo cuelga de .cz-ib: no toca ninguna otra tarjeta.
   El estado vive en atributos de la tarjeta, que pinta 24-insignia-bot.js:
     data-estado = ok | falta | pronto | pausa
     data-modo   = solo | todos
   ═══════════════════════════════════════════════ */

/* Acento morado de la marca, como las demás tarjetas con color propio */
#sectionInsigniaBot::before { background: rgba(145,71,255,0.3); }
#sectionInsigniaBot:hover::before { background: #9147ff; box-shadow: 0 0 8px rgba(145,71,255,0.4); }
#sectionInsigniaBot:hover { border-color: rgba(145,71,255,0.25); }
.cz-ib {
  background:
    radial-gradient(120% 70% at 100% 0%, rgba(145,71,255,0.10), transparent 60%),
    var(--bg2);
}

/* ── Cabecera: logo de Cocozi (con el aro de colores del logo de arriba) ── */
.cz-ib .section-card-header { margin-bottom: 18px; }
.cz-ib-logo { width: 30px; height: 30px; margin-right: 2px; }
.cz-ib-titulo { display: flex; flex-direction: column; line-height: 1.15; }
.cz-ib-titulo small {
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  color: var(--muted); letter-spacing: 0.2px;
}

.cz-ib-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
}
.cz-ib-pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.cz-ib[data-estado="ok"] .cz-ib-pill    { color: #22c55e; background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.35); }
.cz-ib[data-estado="ok"] .cz-ib-pill::before { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); animation: cz-ib-late 2.4s ease-out infinite; }
.cz-ib[data-estado="falta"] .cz-ib-pill { color: #f59e0b; background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.35); }
@keyframes cz-ib-late {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Texto de estado ── */
.cz-ib-estado {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
}
.cz-ib-estado b { color: var(--text); font-weight: 600; }
.cz-ib-estado-ico {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(145,71,255,0.14); color: var(--purple-light);
}
.cz-ib-estado-ico svg { width: 16px; height: 16px; }
.cz-ib[data-estado="ok"] .cz-ib-estado    { background: rgba(34,197,94,0.05);  border-color: rgba(34,197,94,0.2); }
.cz-ib[data-estado="ok"] .cz-ib-estado-ico { background: rgba(34,197,94,0.14); color: #22c55e; }
.cz-ib[data-estado="falta"] .cz-ib-estado    { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.22); }
.cz-ib[data-estado="falta"] .cz-ib-estado-ico { background: rgba(245,158,11,0.14); color: #f59e0b; }
.cz-ib-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cz-ib-btn {
  background: rgba(145,71,255,0.12); border: 1px solid rgba(145,71,255,0.35); color: var(--purple-light);
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}
.cz-ib-btn:hover { background: rgba(145,71,255,0.22); border-color: rgba(145,71,255,0.6); }

/* ── Vista previa del chat compartido ── */
.cz-ib-vista {
  margin-top: 14px; padding: 12px; border-radius: 14px;
  background: rgba(0,0,0,0.22); border: 1px dashed rgba(145,71,255,0.25);
}
.cz-ib-vista-cab {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: rgba(191,148,255,0.7); margin-bottom: 10px;
}
.cz-ib-chats { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.cz-ib-chat {
  position: relative; min-width: 0; min-height: 86px;
  background: #0b0b16; border: 1px solid rgba(255,255,255,0.07); border-radius: 10px;
  padding: 8px 10px 10px; font-family: 'Inter', 'DM Sans', sans-serif;
}
.cz-ib-chat-cab {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 600; color: rgba(240,240,255,0.45);
  padding-bottom: 7px; margin-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cz-ib-vivo { width: 6px; height: 6px; border-radius: 50%; background: #f43f5e; flex-shrink: 0; }
.cz-ib-msg {
  font-size: 12px; line-height: 1.5; color: #efeff1; word-break: break-word;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cz-ib-badge {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: -3px;
  width: 16px; height: 16px; border-radius: 4px; margin-right: 4px;
  background: #9147ff; color: #fff;
}
.cz-ib-badge svg { width: 12px; height: 12px; }
.cz-ib-user { font-weight: 700; color: #bf94ff; }
.cz-ib-txt { color: #dedee3; }
.cz-ib-solo {
  display: flex; align-items: center; gap: 5px;
  margin-top: 5px; font-size: 10.5px; font-style: italic; color: rgba(240,240,255,0.5);
}
.cz-ib-solo::before {
  content: ''; width: 10px; height: 10px; flex-shrink: 0; opacity: 0.8;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3C4 3 1.5 8 1.5 8S4 13 8 13s6.5-5 6.5-5S12 3 8 3zm0 8a3 3 0 110-6 3 3 0 010 6z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3C4 3 1.5 8 1.5 8S4 13 8 13s6.5-5 6.5-5S12 3 8 3zm0 8a3 3 0 110-6 3 3 0 010 6z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.cz-ib-vacio {
  position: absolute; left: 10px; right: 10px; bottom: 12px; top: 34px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11px; color: rgba(240,240,255,0.3);
  border: 1px dashed rgba(255,255,255,0.08); border-radius: 8px;
  transition: opacity 0.25s ease;
}
.cz-ib-enlace {
  display: flex; align-items: center; justify-content: center; color: rgba(191,148,255,0.55);
}
.cz-ib-enlace svg { width: 18px; height: 18px; }

/* El selector manda sobre la vista previa */
.cz-ib[data-modo="solo"]  .cz-ib-otro .cz-ib-msg { opacity: 0; transform: translateY(4px); }
.cz-ib[data-modo="solo"]  .cz-ib-vacio           { opacity: 1; }
.cz-ib[data-modo="todos"] .cz-ib-otro .cz-ib-msg { opacity: 1; transform: none; }
.cz-ib[data-modo="todos"] .cz-ib-vacio           { opacity: 0; }
.cz-ib[data-modo="todos"] .cz-ib-solo            { display: none; }

/* ── Opciones: dos BOTONES de verdad (v87.3) ──
   Relieve, borde visible, círculo de selección a la izquierda y efecto al
   pasar el ratón. El elegido se rellena en morado. */
.cz-ib-opciones { gap: 10px; }
.cz-ib-opciones .mode-option {
  justify-content: flex-start; text-align: left; column-gap: 8px;
  padding: 13px 14px 13px 44px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 2px 0 rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: transform .15s ease, border-color .2s, background .2s, box-shadow .2s;
  user-select: none;
}
/* círculo de selección */
.cz-ib-opciones .mode-option::before {
  content: ''; position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid rgba(255,255,255,0.32); background: rgba(0,0,0,0.25);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.cz-ib-opciones .mode-option:hover {
  transform: translateY(-1px);
  border-color: rgba(145,71,255,0.55);
  background: linear-gradient(180deg, rgba(145,71,255,0.14), rgba(145,71,255,0.05));
  box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.07);
}
.cz-ib-opciones .mode-option:hover::before { border-color: rgba(191,148,255,0.8); }
.cz-ib-opciones .mode-option:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,0.45); }

.cz-ib-opciones .mode-option.active {
  background: linear-gradient(135deg, rgba(145,71,255,0.38), rgba(145,71,255,0.16));
  border-color: #9147ff;
  box-shadow: 0 0 0 1px rgba(145,71,255,0.45), 0 6px 20px rgba(145,71,255,0.28), inset 0 1px 0 rgba(255,255,255,0.12);
}
.cz-ib-opciones .mode-option.active::before {
  border-color: #bf94ff; background: #9147ff;
  box-shadow: inset 0 0 0 3px #1a1030, 0 0 8px rgba(145,71,255,0.7);
}
.cz-ib-opciones .mode-option.active::after { display: none; }   /* el círculo ya dice cuál es */

.cz-ib-opciones .mode-option-icon {
  display: flex; align-items: center; justify-content: center; color: rgba(240,240,255,0.6);
}
.cz-ib-opciones .mode-option-icon svg { width: 20px; height: 20px; }
.cz-ib-opciones .mode-option-label { color: var(--text); font-weight: 700; }
.cz-ib-opciones .mode-option-desc  { flex-basis: 100%; color: rgba(240,240,255,0.55); }
.cz-ib-opciones .mode-option.active .mode-option-icon  { color: #fff; }
.cz-ib-opciones .mode-option.active .mode-option-label { color: #fff; }
.cz-ib-opciones .mode-option.active .mode-option-desc  { color: rgba(240,240,255,0.8); }

/* Móvil: los dos chats uno encima del otro */
@media (max-width: 520px) {
  .cz-ib-chats { grid-template-columns: 1fr; }
  .cz-ib-enlace { transform: rotate(90deg); height: 16px; }
  .cz-ib-opciones { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .cz-ib[data-estado="ok"] .cz-ib-pill::before { animation: none; }
  .cz-ib-msg, .cz-ib-vacio { transition: none; }
  .cz-ib-opciones .mode-option, .cz-ib-opciones .mode-option:hover { transition: none; transform: none; }
}
