:root {
  --navy: #0b2a6b;
  --blue: #1d4ed8;
  --green: #25d366;
  --green-dark: #128c7e;
  --bg: #f2f6fc;
  --card: #ffffff;
  --line: #e3eaf5;
  --text: #14213d;
  --muted: #6b7a99;
  --wa-bg: #e5ddd5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue) 70%, #3b82f6 100%);
  color: white;
  padding: 34px 24px 40px;
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
}
.hero-inner {
  max-width: 1060px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.brand span { color: var(--green); }
.hero h1 { margin: 10px 0 4px; font-size: 30px; letter-spacing: -0.5px; }
.hero h1 em { color: var(--green); font-style: normal; }
.tagline { margin: 0; opacity: .85; font-weight: 600; letter-spacing: .06em; }
.badge-247 {
  background: white; color: var(--navy);
  border-radius: 16px; padding: 14px 18px; text-align: center;
  box-shadow: 0 10px 24px rgba(11, 42, 107, .35);
}
.badge-num {
  background: var(--blue); color: white; border-radius: 10px;
  font-size: 22px; font-weight: 800; padding: 4px 14px; display: inline-block;
}
.badge-txt { margin-top: 8px; font-size: 12px; font-weight: 700; }

main { max-width: 1060px; margin: -22px auto 0; padding: 0 24px 40px; }

/* ---------- stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 22px;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; gap: 10px; align-items: center;
  box-shadow: 0 4px 14px rgba(20, 33, 61, .05);
}
.stat-ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-size: 18px;
}
.stat-ico.g { background: #e9fbef; }
.stat-ico.b { background: #e8efff; }
.stat-val { font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 11.5px; }

/* ---------- layout ---------- */
.grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }

/* ---------- phone simulator ---------- */
.phone {
  background: #111; border-radius: 34px; padding: 10px;
  box-shadow: 0 24px 50px rgba(20, 33, 61, .25);
}
.phone-top {
  background: var(--green-dark); color: white;
  border-top-left-radius: 26px; border-top-right-radius: 26px;
  padding: 14px 16px; display: flex; gap: 12px; align-items: center;
}
.wa-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: white;
  display: grid; place-items: center; font-size: 20px;
}
.wa-name { font-weight: 700; }
.wa-status { font-size: 12px; opacity: .85; }
.wa-chat {
  background: var(--wa-bg);
  height: 420px; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.bubble {
  max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08); white-space: pre-wrap;
}
.bubble.user { align-self: flex-end; background: #dcf8c6; border-bottom-right-radius: 3px; }
.bubble.bot  { align-self: flex-start; background: white;   border-bottom-left-radius: 3px; }
.bubble.typing { color: var(--muted); font-style: italic; }
.wa-input {
  display: flex; gap: 8px; padding: 10px;
  background: #f0f0f0;
  border-bottom-left-radius: 26px; border-bottom-right-radius: 26px;
}
.wa-input input {
  flex: 1; border: 0; border-radius: 20px; padding: 10px 16px; font-size: 14px; outline: none;
}
.wa-input button {
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--green); color: white; font-size: 16px; cursor: pointer;
}
.phone-note { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 12px; }

/* ---------- side panels ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin-bottom: 18px;
  box-shadow: 0 4px 14px rgba(20, 33, 61, .05);
}
.panel h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: .02em; }
.feed { max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.feed-empty { color: var(--muted); font-size: 13px; }
.feed-item {
  display: flex; gap: 10px; font-size: 13px;
  border-left: 3px solid var(--line); padding: 4px 10px; border-radius: 4px;
}
.feed-item.in  { border-left-color: var(--blue); }
.feed-item.out { border-left-color: var(--green); }
.feed-item.error { border-left-color: #ef4444; }
.feed-who { font-weight: 700; white-space: nowrap; }
.feed-txt { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #eef4ff; border: 1px solid #dbe7ff; color: var(--navy);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600;
}

/* ---------- footer ---------- */
footer {
  background: var(--navy); color: white;
  display: flex; justify-content: center; gap: 34px; flex-wrap: wrap;
  padding: 14px 20px; font-size: 13px; font-weight: 600;
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- BI + agent panels ---------- */
.export { float: right; font-size: 12px; color: var(--blue); text-decoration: none; font-weight: 600; }
.bi-headline { display: flex; gap: 18px; margin-bottom: 8px; }
.bi-headline b { font-size: 24px; display: block; color: var(--navy); }
.bi-headline span { font-size: 11px; color: var(--muted); }
.bi-note { font-size: 13px; color: var(--muted); margin: 6px 0; }
.bi-note b { color: var(--green-dark); text-transform: capitalize; }
.bi-langs { display: flex; flex-direction: column; gap: 4px; }
.bi-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bi-row span { flex: 0 0 70px; text-transform: capitalize; color: var(--muted); }
.bi-row b { color: var(--green-dark); }
.bi-row i { color: var(--muted); font-style: normal; font-size: 12px; }
.agent-form { display: flex; flex-direction: column; gap: 8px; }
.agent-form input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.agent-form button { background: var(--navy); color: white; border: 0; border-radius: 8px; padding: 9px; font-weight: 600; cursor: pointer; }
.agent-note { font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
