:root {
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --bg-card: #181822;
  --border: #26263a;
  --text: #e8e8ee;
  --text-dim: #9a9aae;
  --accent: #00d4aa;
  --accent-2: #7c3aed;
  --accent-grad: linear-gradient(135deg, #00d4aa 0%, #7c3aed 100%);
  --warn: #fbbf24;
  --danger: #ef4444;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1180px; margin: 0 auto;
}
.brand {
  font-weight: 800; font-size: 1.15rem;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-decoration: none;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--text-dim); text-decoration: none; font-size: 0.93rem;
  font-weight: 500; transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent-grad);
  color: #fff !important; padding: 9px 18px; border-radius: 999px;
  font-weight: 600 !important;
}

/* HERO */
.hero {
  padding: 100px 0 80px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px 400px at 50% -10%, rgba(124, 58, 237, 0.18), transparent),
              radial-gradient(600px 300px at 80% 50%, rgba(0, 212, 170, 0.10), transparent);
  pointer-events: none;
}
.hero > * { position: relative; }
.eyebrow {
  display: inline-block;
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent);
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 212, 170, 0.25);
}
h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
h1 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.18rem; color: var(--text-dim);
  max-width: 680px; margin: 0 auto 36px;
}
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem;
  text-decoration: none; cursor: pointer; border: 0;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.25);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(0, 212, 170, 0.35); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); }

/* TRUST BAR */
.trust {
  padding: 30px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px;
  text-align: center;
}
.trust-item .num {
  font-size: 1.8rem; font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.trust-item .lbl { font-size: 0.85rem; color: var(--text-dim); }

/* SECTIONS */
section { padding: 90px 0; }
.section-eyebrow {
  display: block; color: var(--accent); font-weight: 600;
  font-size: 0.88rem; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 12px; text-align: center;
}
h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800; text-align: center;
  letter-spacing: -0.01em; margin-bottom: 16px;
}
h2 + p.lead {
  text-align: center; max-width: 620px; margin: 0 auto 50px;
  color: var(--text-dim); font-size: 1.05rem;
}

/* GRID */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(0, 212, 170, 0.4); transform: translateY(-2px); }
.card .icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(0, 212, 170, 0.1); color: var(--accent);
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
  margin-bottom: 16px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 8px; font-weight: 700; }
.card p { color: var(--text-dim); font-size: 0.95rem; }

/* PRICING */
.pricing-wrap { padding: 90px 0; background: var(--bg-soft); }
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px; padding: 36px;
  position: relative;
}
.price-card.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(0, 212, 170, 0.06), var(--bg-card));
}
.price-card .badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent-grad); color: #fff;
  padding: 5px 14px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
}
.price-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
.price-card .desc { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 22px; }
.price-amount { font-size: 2.4rem; font-weight: 800; }
.price-amount .currency { font-size: 1.1rem; color: var(--text-dim); margin-right: 4px; }
.price-amount .period { font-size: 1rem; color: var(--text-dim); font-weight: 500; }
.price-setup {
  margin-top: 8px; padding: 10px 14px; border-radius: 10px;
  background: rgba(124, 58, 237, 0.10);
  color: #c4b5fd; font-size: 0.92rem;
  border: 1px solid rgba(124, 58, 237, 0.25);
}
.price-features { list-style: none; margin: 24px 0 28px; }
.price-features li {
  padding: 8px 0; color: var(--text-dim); font-size: 0.95rem;
  display: flex; gap: 10px; align-items: flex-start;
}
.price-features li::before {
  content: "✓"; color: var(--accent); font-weight: 700; flex-shrink: 0;
}

/* COMPARISON */
.compare { width: 100%; border-collapse: collapse; margin-top: 20px; }
.compare th, .compare td {
  padding: 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare th { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.compare td { color: var(--text-dim); font-size: 0.92rem; }
.compare .yes { color: var(--accent); font-weight: 700; }
.compare .no { color: var(--text-dim); }
.compare tr.featured { background: rgba(0, 212, 170, 0.05); }
.compare tr.featured td { color: var(--text); }

/* FAQ */
.faq-item {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 24px; margin-bottom: 12px;
  background: var(--bg-card);
}
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.5rem; color: var(--accent); font-weight: 400;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--text-dim); margin-top: 12px; font-size: 0.95rem; }

/* CTA FINAL */
.cta-final {
  background: var(--accent-grad);
  border-radius: 24px; padding: 60px 40px;
  text-align: center; margin: 0 24px;
}
.cta-final h2 { color: #fff; margin-bottom: 12px; }
.cta-final p { color: rgba(255,255,255,0.92); margin-bottom: 28px; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-final .btn-primary {
  background: #0a0a0f; color: #fff;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 30px;
  color: var(--text-dim); font-size: 0.9rem;
}
.foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.foot-row a { color: var(--text-dim); text-decoration: none; margin-left: 18px; }
.foot-row a:hover { color: var(--accent); }

/* PHONE MOCKUP */
.phone {
  width: 320px;
  margin: 50px auto 0;
  background: linear-gradient(180deg, #1a1a26, #0d0d14);
  border-radius: 44px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #2a2a3a,
    0 0 0 6px #0d0d14,
    0 0 0 7px #2a2a3a,
    0 30px 70px rgba(0, 212, 170, 0.15),
    0 50px 100px rgba(124, 58, 237, 0.18);
  position: relative;
}
.phone::before {
  content: ""; position: absolute;
  top: 22px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px; background: #0d0d14;
  border-radius: 0 0 18px 18px;
  z-index: 5;
}
.phone-screen {
  background: #0b141a;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
  min-height: 560px;
}
.phone-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 26px 6px;
  font-size: 12px; font-weight: 600; color: #e8e8ee;
  position: relative; z-index: 1;
}
.phone-status .signal { letter-spacing: 1px; }
.wa-header {
  display: flex; align-items: center; gap: 10px;
  background: #075E54;
  padding: 8px 14px;
  margin-top: 8px;
}
.wa-header .back { color: #fff; opacity: .8; font-size: 18px; }
.wa-header .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #00d4aa, #7c3aed);
  display: grid; place-items: center;
  font-size: 16px; color: #fff; font-weight: 700;
  flex-shrink: 0;
}
.wa-header .info { flex: 1; line-height: 1.2; }
.wa-header .info .name { color: #fff; font-weight: 600; font-size: 14px; }
.wa-header .info .stat { color: rgba(255,255,255,0.75); font-size: 11px; }
.wa-header .icons { color: #fff; font-size: 16px; opacity: .85; letter-spacing: 8px; }

.wa-chat {
  background: #0b141a;
  background-image:
    radial-gradient(rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 14px 10px;
  min-height: 380px;
}
.wa-chat .msg {
  padding: 7px 10px 18px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13.5px;
  max-width: 80%;
  position: relative;
  line-height: 1.35;
  color: #e9edef;
  word-wrap: break-word;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}
.wa-chat .msg.bot {
  background: #202c33;
  border-top-left-radius: 0;
}
.wa-chat .msg.bot::before {
  content: "";
  position: absolute; top: 0; left: -7px;
  width: 8px; height: 13px;
  background: #202c33;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.wa-chat .msg.user {
  background: #005c4b;
  margin-left: auto;
  border-top-right-radius: 0;
}
.wa-chat .msg.user::before {
  content: "";
  position: absolute; top: 0; right: -7px;
  width: 8px; height: 13px;
  background: #005c4b;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.wa-chat .msg .time {
  position: absolute; right: 10px; bottom: 3px;
  font-size: 10px; color: rgba(255,255,255,0.55);
}
.wa-chat .msg.user .time {
  color: rgba(167,255,235,0.7);
}
.wa-chat .msg.user .time::after {
  content: " ✓✓"; color: #53bdeb;
}
.wa-chat .msg.audio {
  background: #202c33;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 18px;
}
.wa-chat .msg.audio .play {
  width: 24px; height: 24px; border-radius: 50%;
  background: #00a884; color: #0b141a;
  display: grid; place-items: center;
  font-size: 11px; flex-shrink: 0;
}
.wa-chat .msg.audio .wave {
  flex: 1; height: 22px;
  background-image: linear-gradient(to right, #54656f 50%, transparent 50%);
  background-size: 3px 100%;
  background-repeat: repeat-x;
  position: relative;
}
.wa-chat .msg.audio .wave::after {
  content: ""; position: absolute; left: 30%; top: 50%;
  transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: #00a884;
}
.wa-chat .typing {
  display: inline-flex; gap: 3px; padding: 12px 14px;
  background: #202c33; border-radius: 8px; border-top-left-radius: 0;
}
.wa-chat .typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #8696a0;
  animation: blink 1.4s infinite;
}
.wa-chat .typing span:nth-child(2) { animation-delay: 0.2s; }
.wa-chat .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }

.wa-input {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #0b141a;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.wa-input .field {
  flex: 1; background: #2a3942; color: #8696a0;
  padding: 9px 12px; border-radius: 22px; font-size: 13px;
}
.wa-input .send {
  width: 36px; height: 36px; border-radius: 50%;
  background: #00a884; color: #fff;
  display: grid; place-items: center; font-size: 14px;
}

/* FLOAT WHATSAPP */
.wa-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 100;
  background: #25D366; color: #fff;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  text-decoration: none; font-size: 1.6rem;
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }

/* CONTACT FORM */
.contact-form { display: grid; gap: 18px; }
.contact-form .form-row {
  display: grid; gap: 18px;
  grid-template-columns: 1fr 1fr;
}
.contact-form label {
  display: flex; flex-direction: column; gap: 6px;
}
.contact-form label span {
  color: var(--text); font-size: 0.92rem; font-weight: 600;
}
.contact-form label span em {
  color: var(--accent); font-style: normal; font-weight: 700;
}
.contact-form .hint {
  color: var(--text-dim); font-size: 0.82rem; font-weight: 400; margin-top: 4px;
}
.contact-form input,
.contact-form select,
.contact-form textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color .15s, box-shadow .15s;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form button.btn { cursor: pointer; }

@media (max-width: 600px) {
  .contact-form .form-row { grid-template-columns: 1fr; }
}

/* RESPONSIVE */
@media (max-width: 720px) {
  .nav-links { gap: 14px; }
  .nav-links a:not(.nav-cta) { display: none; }
  section { padding: 60px 0; }
  .hero { padding: 70px 0 50px; }
  .cta-final { padding: 40px 24px; margin: 0 16px; }
}

/* =====================================================
   CHATWOOT DEMO ANIMATION
   Mockup omnicanal con cursor que toma control via ai-stop
   Layout fiel al UI real de Chatwoot
   ===================================================== */
.cw-demo { padding: 30px 0 90px; }
.cw-demo .container { max-width: 1080px; }
.cw-demo h2 { margin-bottom: 14px; }
.cw-demo code {
  background: rgba(239,68,68,0.12); color: #fca5a5;
  padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, monospace; font-size: 0.92em;
}

.cw-caption {
  max-width: 880px;
  margin: 30px auto 0;
  text-align: center;
  padding: 20px 26px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.cw-caption p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
}
.cw-caption strong { color: var(--accent); }
.cw-caption .sub {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--text-dim);
}
.cw-caption .sub strong { color: var(--text-dim); }

.cw-frame {
  position: relative;
  background: #1a1d24;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7),
              0 0 0 1px rgba(255,255,255,0.02);
  margin-top: 40px;
  font-size: 14px;
}
.cw-titlebar {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  background: #14161c;
  border-bottom: 1px solid #252834;
}
.cw-titlebar .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #ff5f57;
}
.cw-titlebar .dot.y { background: #ffbd2e; }
.cw-titlebar .dot.g { background: #28c840; }
.cw-titlebar .url {
  margin-left: 14px; padding: 3px 10px;
  background: #1a1d24; border: 1px solid #252834; border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem; color: #9aa0ad;
}
.cw-body {
  display: grid;
  grid-template-columns: 235px 340px 1fr;
  height: 600px;
  background: #1a1d24;
}

/* ===== Sidebar (left rail) ===== */
.cw-sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid #252834;
  background: #1a1d24;
  overflow: hidden;
}
.cw-sb-top {
  padding: 12px 14px 10px;
  border-bottom: 1px solid #252834;
}
.cw-sb-logo {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 12px;
}
.cw-sb-logo .badge {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #001712; font-size: 0.74rem;
}
.cw-sb-logo .name {
  font-weight: 600; font-size: 0.88rem; color: #d8dae3;
}
.cw-sb-search {
  display: grid; grid-template-columns: 1fr 30px; gap: 6px;
}
.cw-sb-search .box {
  background: #0f1116; border: 1px solid #252834;
  border-radius: 8px; padding: 6px 10px;
  font-size: 0.78rem; color: #6c7180;
}
.cw-sb-search .pencil {
  background: #0f1116; border: 1px solid #252834;
  border-radius: 8px; display: flex;
  align-items: center; justify-content: center;
  color: #9aa0ad; font-size: 0.85rem;
}
.cw-sb-nav {
  flex: 1; overflow: hidden; padding: 6px 8px;
}
.cw-sb-section {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  font-size: 0.84rem; color: #c1c5d1; font-weight: 500;
}
.cw-sb-section.expanded::after {
  content: "▾"; margin-left: auto;
  font-size: 0.7rem; color: #6c7180;
}
.cw-sb-section .ico { font-size: 0.95rem; opacity: 0.8; }
.cw-sb-section .count {
  margin-left: auto; font-size: 0.7rem; color: #6c7180;
  background: rgba(255,255,255,0.04);
  padding: 1px 7px; border-radius: 999px;
}
.cw-sb-section.active {
  background: rgba(255,255,255,0.04); border-radius: 7px;
  color: #fff;
}

.cw-sb-sub {
  display: flex; align-items: center;
  padding: 4px 8px 4px 30px;
  font-size: 0.78rem; color: #9aa0ad;
  border-radius: 6px;
  margin: 1px 0;
}
.cw-sb-sub.active {
  background: #232631; color: #fff;
}

.cw-sb-tag {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 8px;
  font-size: 0.78rem; color: #c1c5d1;
  border-radius: 6px;
  position: relative;
}
.cw-sb-tag .d {
  width: 8px; height: 8px; border-radius: 2px;
  flex-shrink: 0;
}
.cw-sb-tag .d.purple { background: #c084fc; }
.cw-sb-tag .d.blue   { background: #60a5fa; }
.cw-sb-tag .d.red    { background: #ef4444; }
.cw-sb-tag .d.green  { background: #22c55e; }
.cw-sb-tag .d.orange { background: #f97316; }
.cw-sb-tag .d.yellow { background: #eab308; }
.cw-sb-tag .d.rose   { background: #f43f5e; }

.cw-sb-foot {
  border-top: 1px solid #252834;
  padding: 10px 12px;
  display: flex; align-items: center; gap: 9px;
}
.cw-sb-foot .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #001712;
  flex-shrink: 0;
}
.cw-sb-foot .who { font-size: 0.78rem; font-weight: 600; color: #d8dae3; line-height: 1.2; }
.cw-sb-foot .em  { font-size: 0.66rem; color: #6c7180; line-height: 1.2; }

/* ===== Conversations list (middle) ===== */
.cw-list {
  display: flex; flex-direction: column;
  background: #1a1d24;
  border-right: 1px solid #252834;
  overflow: hidden;
}
.cw-list-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
}
.cw-list-head .ttl {
  font-weight: 700; font-size: 1rem; color: #fff;
}
.cw-list-head .pill {
  background: rgba(255,255,255,0.06); color: #c1c5d1;
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 500;
}
.cw-list-head .ico-row {
  margin-left: auto; display: flex; gap: 8px;
  color: #6c7180; font-size: 0.95rem;
}
.cw-tabs {
  display: flex; gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid #252834;
}
.cw-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  font-size: 0.8rem; color: #9aa0ad;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cw-tab .n {
  font-size: 0.7rem; padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: #9aa0ad;
}
.cw-tab.active {
  color: #fff; border-bottom-color: var(--accent);
}
.cw-tab.active .n {
  background: rgba(0,212,170,0.16);
  color: var(--accent);
}

.cw-list-items {
  flex: 1; overflow: hidden;
}
.cw-conv {
  display: grid; grid-template-columns: 38px 1fr auto;
  gap: 11px; align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid #232631;
  opacity: 0;
  animation: cwConv 16s ease-out infinite;
}
.cw-conv:nth-child(1) { animation-delay: 0.3s; }
.cw-conv:nth-child(2) { animation-delay: 0.7s; }
.cw-conv:nth-child(3) { animation-delay: 1.1s; }
.cw-conv:nth-child(4) { animation-delay: 1.5s; }
.cw-conv:nth-child(5) { animation-delay: 1.9s; }
.cw-conv.selected {
  background: rgba(255,255,255,0.04);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

.cw-conv .av {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  position: relative;
}
.cw-conv .av.a1 { background: linear-gradient(135deg, #2dd4bf, #0ea5e9); }
.cw-conv .av.a2 { background: linear-gradient(135deg, #f472b6, #db2777); }
.cw-conv .av.a3 { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.cw-conv .av.a4 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.cw-conv .av.a5 { background: linear-gradient(135deg, #34d399, #059669); }
.cw-conv .av .ch {
  position: absolute; bottom: -2px; right: -2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #1a1d24;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; line-height: 1; color: #fff;
}
.ch.wa  { background: #25d366; }
.ch.ig  { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.ch.tg  { background: #229ed9; }
.ch.web { background: #6b7280; }
.cw-conv .meta { min-width: 0; padding-top: 1px; }
.cw-conv .name-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}
.cw-conv .name {
  font-size: 0.86rem; font-weight: 600; color: #e8eaef;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cw-conv .t { font-size: 0.66rem; color: #6c7180; flex-shrink: 0; }
.cw-conv .preview {
  font-size: 0.76rem; color: #9aa0ad;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
  display: flex; align-items: center; gap: 4px;
}
.cw-conv .preview .ret { color: #6c7180; font-size: 0.85rem; }
.cw-conv .right {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px; padding-top: 1px;
}
.cw-conv .right .badge-new {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent);
  color: #001712; font-weight: 800; font-size: 0.62rem;
  border-radius: 999px; padding: 1px 7px; min-width: 18px;
}

/* Label chips inside conversation row */
.cw-row-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 5px;
}
.cw-row-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 0.66rem; font-weight: 600;
  background: rgba(255,255,255,0.04);
  color: #c1c5d1;
  line-height: 1.4;
  white-space: nowrap;
}
.cw-row-chip .d {
  width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0;
}
.cw-row-chip.green  { background: rgba(34,197,94,0.14);  color: #86efac; }
.cw-row-chip.green  .d { background: #22c55e; }
.cw-row-chip.yellow { background: rgba(234,179,8,0.14);  color: #fde68a; }
.cw-row-chip.yellow .d { background: #eab308; }
.cw-row-chip.orange { background: rgba(249,115,22,0.14); color: #fdba74; }
.cw-row-chip.orange .d { background: #f97316; }
.cw-row-chip.blue   { background: rgba(96,165,250,0.14); color: #93c5fd; }
.cw-row-chip.blue   .d { background: #60a5fa; }
.cw-row-chip.red    { background: rgba(239,68,68,0.16);  color: #fca5a5; }
.cw-row-chip.red    .d { background: #ef4444; }
.cw-row-chip.appear {
  opacity: 0; transform: scale(0.8);
  animation: cwRowChipAppear 16s ease-out infinite;
}

/* ===== Context menu + submenu (Asignar etiqueta) ===== */
.cw-ctxmenu {
  position: absolute;
  background: #1f2329;
  border: 1px solid #2e323d;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  padding: 4px;
  min-width: 220px;
  z-index: 15;
  opacity: 0; pointer-events: none;
  animation: cwCtxFade 16s ease-out infinite;
}
.cw-mi {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  font-size: 0.78rem; color: #d8dae3;
  border-radius: 5px;
  position: relative;
  white-space: nowrap;
}
.cw-mi .ico { width: 14px; opacity: 0.85; }
.cw-mi .arr {
  margin-left: auto; color: #6c7180; font-size: 0.85rem;
}
.cw-mi.mi-target {
  animation: cwMenuItemHi 16s ease-out infinite;
}
.cw-submenu {
  position: absolute;
  top: -4px; left: calc(100% + 4px);
  background: #1f2329;
  border: 1px solid #2e323d;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  padding: 4px;
  min-width: 175px;
  opacity: 0; pointer-events: none;
  animation: cwSubmFade 16s ease-out infinite;
}
.cw-submi {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px;
  font-size: 0.76rem; color: #d8dae3;
  border-radius: 5px;
  white-space: nowrap;
}
.cw-submi .d {
  width: 8px; height: 8px; border-radius: 2px;
  flex-shrink: 0;
}
.cw-submi .d.green  { background: #22c55e; }
.cw-submi .d.yellow { background: #eab308; }
.cw-submi .d.orange { background: #f97316; }
.cw-submi .d.red    { background: #ef4444; }
.cw-submi .d.blue   { background: #60a5fa; }
.cw-submi.sub-target {
  animation: cwSubItemHi 16s ease-out infinite;
}

/* ===== Conversation pane (right) ===== */
.cw-pane {
  display: flex; flex-direction: column;
  background: #1a1d24;
  position: relative;
}
.cw-pane-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  border-bottom: 1px solid #252834;
}
.cw-pane-head .av {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #2dd4bf, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
}
.cw-pane-head .who { font-weight: 600; font-size: 0.92rem; color: #e8eaef; }
.cw-pane-head .warn { color: #f59e0b; font-size: 0.85rem; }
.cw-pane-head .right {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
}
.cw-pane-head .resolver {
  background: transparent;
  border: 1px solid #2e323d;
  color: #d8dae3;
  padding: 5px 14px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 500;
}
.cw-pane-head .kebab { color: #6c7180; font-size: 1rem; padding: 0 4px; }

/* Messages */
.cw-msgs {
  flex: 1; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
}
.cw-msg-wrap {
  display: flex; align-items: flex-end; gap: 8px;
}
.cw-msg-wrap.right { justify-content: flex-end; }
.cw-msg-wrap.right .ag-av { order: 2; }
.cw-msg-wrap .cust-av {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #2dd4bf, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.cw-msg-wrap .ag-av {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800;
  flex-shrink: 0;
}
.cw-msg-wrap .ag-av.bot {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.cw-msg-wrap .ag-av.human {
  background: var(--accent-2); color: #fff;
}

.cw-msg {
  max-width: 70%; padding: 8px 12px;
  font-size: 0.85rem; line-height: 1.42;
  border-radius: 12px;
  position: relative;
}
.cw-msg .meta-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 4px; font-size: 0.62rem; color: rgba(255,255,255,0.55);
}
.cw-msg.user {
  background: #232631; color: #e8eaef;
  border-top-left-radius: 4px;
}
.cw-msg.bot {
  background: linear-gradient(135deg, #1d6dd9 0%, #2563eb 100%);
  color: #fff;
  border-top-right-radius: 4px;
}
.cw-msg.bot::before {
  content: "🤖 IA"; display: block;
  font-size: 0.58rem; font-weight: 800;
  letter-spacing: 0.05em; opacity: 0.85;
  margin-bottom: 3px;
}
.cw-msg.human {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
  color: #fff;
  border-top-right-radius: 4px;
  opacity: 0;
  animation: cwHuman 16s ease-out infinite;
}
.cw-msg.human::before {
  content: "👤 Carla · Operadora"; display: block;
  font-size: 0.58rem; font-weight: 800;
  letter-spacing: 0.05em; opacity: 0.9;
  margin-bottom: 3px;
}
.cw-msg-wrap.user2 {
  opacity: 0;
  animation: cwUser2 16s ease-out infinite;
}

/* Input area */
.cw-input-area {
  display: flex; flex-direction: column;
  border-top: 1px solid #252834;
  background: #16191f;
}
.cw-input-tabs {
  display: flex; gap: 4px;
  padding: 8px 12px 0;
}
.cw-input-tab {
  padding: 5px 13px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 500;
  color: #9aa0ad;
}
.cw-input-tab.active {
  background: #1a1d24; color: #e8eaef;
}
.cw-input-text {
  padding: 10px 16px;
  font-size: 0.78rem; color: #6c7180;
  min-height: 42px;
  position: relative;
}
.cw-input-text .placeholder {
  animation: cwHidePlaceholder 16s ease-out infinite;
}
.cw-input-text .typed {
  position: absolute; top: 10px; left: 16px; right: 16px;
  white-space: nowrap; overflow: hidden;
  width: 0;
  color: #e8eaef;
  border-right: 2px solid var(--accent);
  animation: cwType 16s steps(40) infinite;
}
.cw-input-tools {
  display: flex; align-items: center; gap: 14px;
  padding: 8px 16px 12px;
  color: #6c7180; font-size: 0.95rem;
}
.cw-input-tools .send {
  margin-left: auto;
  background: var(--accent-grad);
  color: #001712;
  font-weight: 700; font-size: 0.78rem;
  padding: 7px 14px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 6px;
}

/* ===== Cursor & ripple ===== */
.cw-cursor {
  position: absolute;
  width: 22px; height: 22px;
  pointer-events: none; z-index: 20;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.7));
  animation: cwCursorPath 16s cubic-bezier(.65,.05,.36,1) infinite;
}
.cw-cursor svg { width: 100%; height: 100%; }
.cw-cursor::after {
  content: ""; position: absolute;
  top: 0; left: 0;
  width: 0; height: 0; border-radius: 50%;
  background: rgba(124, 58, 237, 0.55);
  animation: cwCursorClick 16s ease-out infinite;
}

/* ==== Keyframes (16s loop) ==== */
@keyframes cwConv {
  0%, 1%   { opacity: 0; transform: translateX(-14px); }
  6%, 96%  { opacity: 1; transform: translateX(0); }
  100%     { opacity: 0; transform: translateX(-14px); }
}

@keyframes cwUser2 {
  0%, 20%   { opacity: 0; transform: translateY(8px); }
  24%, 96%  { opacity: 1; transform: translateY(0); }
  100%      { opacity: 0; transform: translateY(8px); }
}

@keyframes cwHuman {
  0%, 86%   { opacity: 0; transform: translateY(8px); }
  90%, 96%  { opacity: 1; transform: translateY(0); }
  100%      { opacity: 0; transform: translateY(8px); }
}

@keyframes cwHidePlaceholder {
  0%, 65%   { opacity: 1; }
  68%, 100% { opacity: 0; }
}

@keyframes cwType {
  0%, 67%   { width: 0; }
  82%, 96%  { width: 33ch; }
  100%      { width: 0; }
}

/* Context menu fade in/out: appears after right-click, closes after ai-stop click */
@keyframes cwCtxFade {
  0%, 33%   { opacity: 0; transform: scale(0.95); }
  37%, 60%  { opacity: 1; transform: scale(1); }
  64%, 100% { opacity: 0; transform: scale(0.95); }
}

/* Submenu opens after cursor hovers Asignar etiqueta */
@keyframes cwSubmFade {
  0%, 47%   { opacity: 0; transform: translateX(-4px); }
  51%, 60%  { opacity: 1; transform: translateX(0); }
  64%, 100% { opacity: 0; transform: translateX(-4px); }
}

/* Asignar etiqueta highlight while cursor hovers it */
@keyframes cwMenuItemHi {
  0%, 44%   { background: transparent; color: #d8dae3; }
  47%, 60%  { background: #2a2e38; color: #fff; }
  64%, 100% { background: transparent; color: #d8dae3; }
}

/* ai-stop submenu highlight at click moment */
@keyframes cwSubItemHi {
  0%, 53%   { background: transparent; color: #d8dae3; }
  56%, 60%  { background: #ef4444; color: #fff; }
  64%, 100% { background: transparent; color: #d8dae3; }
}

/* ai-stop chip appears in the conversation row after the click */
@keyframes cwRowChipAppear {
  0%, 60%   { opacity: 0; transform: scale(0.8); }
  64%, 96%  { opacity: 1; transform: scale(1); }
  100%      { opacity: 0; transform: scale(0.8); }
}

@keyframes cwCursorPath {
  /* enter mid-pane area */
  0%   { left: 60%; top: 70%; opacity: 0; }
  3%   { opacity: 1; }
  /* glide to Martín's row in the conversations list (right-click target) */
  28%  { left: 38%; top: 22%; }
  /* hold at row for right-click */
  33%, 38%  { left: 38%; top: 22%; opacity: 1; }
  /* travel down-right to "Asignar etiqueta" item in the menu */
  46%  { left: 45%; top: 47%; }
  /* hold (submenu opens) */
  50%, 53%  { left: 45%; top: 47%; }
  /* travel right to "ai-stop" in the submenu */
  58%  { left: 64%; top: 61%; }
  /* hold for click */
  60%, 62%  { left: 64%; top: 61%; }
  /* travel to input text area in the pane */
  72%  { left: 76%; top: 88%; }
  /* hover during typing */
  82%  { left: 76%; top: 88%; }
  /* travel to "Enviar" button */
  87%  { left: 90%; top: 95%; }
  /* hold for click */
  89%, 96%  { left: 90%; top: 95%; }
  100% { left: 90%; top: 95%; opacity: 0; }
}

@keyframes cwCursorClick {
  /* idle */
  0%, 32%   { width: 0; height: 0; opacity: 0;
              top: 0; left: 0; }
  /* RIGHT-CLICK on Martín's row (purple ripple) */
  35%       { width: 30px; height: 30px; opacity: 0.55;
              top: -13px; left: -13px;
              background: rgba(124,58,237,0.55); }
  41%       { width: 56px; height: 56px; opacity: 0;
              top: -26px; left: -26px;
              background: rgba(124,58,237,0.55); }
  /* idle */
  42%, 58%  { width: 0; height: 0; opacity: 0;
              top: 0; left: 0; }
  /* CLICK on ai-stop submenu item (red ripple) */
  60%       { width: 30px; height: 30px; opacity: 0.6;
              top: -13px; left: -13px;
              background: rgba(239,68,68,0.6); }
  66%       { width: 56px; height: 56px; opacity: 0;
              top: -26px; left: -26px;
              background: rgba(239,68,68,0.6); }
  /* idle */
  67%, 87%  { width: 0; height: 0; opacity: 0;
              top: 0; left: 0; }
  /* CLICK on Enviar (teal ripple) */
  89%       { width: 30px; height: 30px; opacity: 0.55;
              top: -13px; left: -13px;
              background: rgba(0,212,170,0.6); }
  95%       { width: 56px; height: 56px; opacity: 0;
              top: -26px; left: -26px;
              background: rgba(0,212,170,0.6); }
  100%      { width: 0; height: 0; opacity: 0;
              top: 0; left: 0; }
}

/* ===== Mobile collapse ===== */
@media (max-width: 940px) {
  .cw-body {
    grid-template-columns: 1fr;
    height: auto;
  }
  .cw-sidebar { display: none; }
  .cw-list {
    border-right: none;
    border-bottom: 1px solid #252834;
    max-height: 240px;
  }
  .cw-msgs { min-height: 280px; }
  .cw-cursor, .cw-ctxmenu { display: none; }
}
