/* Voltanet — demos WhatsApp (bot y agente): simulador de chat estilo WhatsApp con paleta Voltanet */

.wa-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .wa-layout { grid-template-columns: 1fr; } .wa-side { order: 2; } }

/* ---------- teléfono ---------- */
.phone {
  width: 100%; max-width: 420px; margin: 0 auto;
  border-radius: 26px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 18px 48px rgba(25,35,45,.16);
  background: #EFE7DE;
  display: flex; flex-direction: column;
  height: 640px;
}
.wa-header {
  background: var(--navy); color: #fff;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.wa-header img { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 3px; }
.wa-header .wh-info { flex: 1; min-width: 0; }
.wa-header .wh-name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.wa-header .wh-status { font-size: 11px; color: #A7F3D0; }
.wa-header .wh-model {
  font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  background: var(--primary); padding: 3px 8px; border-radius: 999px; white-space: nowrap;
}

.wa-chat {
  flex: 1; overflow-y: auto; padding: 16px 12px;
  background:
    radial-gradient(circle at 20% 30%, rgba(221,66,29,.035) 0 22%, transparent 23%),
    radial-gradient(circle at 80% 70%, rgba(25,35,45,.03) 0 18%, transparent 19%),
    #EFE7DE;
  display: flex; flex-direction: column; gap: 8px;
}
.msg {
  max-width: 82%; padding: 8px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  white-space: pre-line; word-wrap: break-word;
}
.msg.in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.msg.out { align-self: flex-end; background: #FFE4DA; border-top-right-radius: 4px; }
.msg .m-time { display: block; font-size: 10px; color: #9CA3AF; text-align: right; margin-top: 3px; }
.msg b { font-weight: 700; }

.typing { align-self: flex-start; background: #fff; border-radius: 12px; padding: 10px 14px; display: flex; gap: 4px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: #C4C9CF;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.wa-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; background: #EFE7DE; flex-shrink: 0; }
.wa-quick button {
  font-size: 11.5px; font-weight: 600; color: var(--primary-dark);
  background: #fff; border: 1px solid rgba(221,66,29,.35);
  border-radius: 999px; padding: 5px 11px; transition: all .12s;
}
.wa-quick button:hover { background: var(--primary-50); }
.wa-quick button:active { transform: scale(.95); }

.wa-inputrow {
  display: flex; gap: 8px; padding: 10px 12px; background: #F5F0EA;
  border-top: 1px solid #E3DCD3; flex-shrink: 0;
}
.wa-inputrow input {
  flex: 1; border: 1px solid #E3DCD3; border-radius: 999px;
  padding: 10px 16px; font-size: 13px; background: #fff; outline: none;
}
.wa-inputrow input:focus { border-color: var(--primary); }
.wa-send {
  width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all .12s; font-size: 16px;
}
.wa-send:hover { background: var(--primary-dark); }
.wa-send:active { transform: scale(.92); }

/* ---------- panel lateral ---------- */
.wa-side { display: flex; flex-direction: column; gap: 14px; }
.wa-side .card-body p { margin: 6px 0; font-size: 13px; }

/* reglas del bot */
.rule-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid #F3F4F6;
}
.rule-row:last-child { border-bottom: none; }
.rule-kw { display: flex; gap: 4px; flex-wrap: wrap; min-width: 130px; }
.rule-resp { flex: 1; font-size: 12.5px; color: #4B5563; white-space: pre-line; }
.rule-del { color: #DC2626; font-size: 15px; padding: 2px 6px; border-radius: 8px; }
.rule-del:hover { background: #FEF2F2; }

/* análisis */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-item { font-size: 12px; }
.bar-item .b-head { display: flex; justify-content: space-between; margin-bottom: 4px; color: #374151; font-weight: 600; }
.bar-track { height: 8px; border-radius: 999px; background: #F3F4F6; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.bar-fill.alt { background: var(--navy); }
.insight {
  display: flex; gap: 10px; padding: 11px 14px; border-radius: 12px;
  background: var(--primary-50); border: 1px solid rgba(221,66,29,.18);
  font-size: 12.5px; line-height: 1.55; margin-bottom: 8px;
}
.sent-row { display: flex; gap: 8px; margin-top: 6px; }
.sent-chip { flex: 1; text-align: center; border-radius: 12px; padding: 10px 6px; font-size: 12px; font-weight: 700; }
.sent-pos { background: #D1FAE5; color: #065F46; }
.sent-neu { background: #F3F4F6; color: #374151; }
.sent-neg { background: #FEE2E2; color: #991B1B; }
.sent-chip span { display: block; font-size: 17px; margin-bottom: 2px; }

/* selector de modelo */
.model-pick { display: flex; gap: 10px; }
.model-card {
  flex: 1; border: 2px solid var(--border); border-radius: 14px; padding: 13px;
  text-align: center; transition: all .15s; cursor: pointer; background: #fff;
}
.model-card:hover { border-color: rgba(221,66,29,.4); }
.model-card.active { border-color: var(--primary); background: var(--primary-50); }
.model-card b { display: block; font-size: 13.5px; }
.model-card span { font-size: 11px; color: #6B7280; }
.stack-line {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: #4B5563;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-top: 10px;
}
.dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex-shrink: 0; }
