/* ============================================================
   ConvoKit — Premium SaaS Design System v2
   ============================================================ */

/* Fonts loaded via head.ejs */

/* ---- Variables ---- */
:root {
  /* Backgrounds */
  --bg: #07080d;
  --bg2: #0d0f1a;
  --bg3: #13162b;

  /* Cards & Glass */
  --card: rgba(255,255,255,0.03);
  --card-hover: rgba(255,255,255,0.06);
  --glass: rgba(255,255,255,0.04);
  --glass-hover: rgba(255,255,255,0.08);

  /* Borders */
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);
  --border-glow: rgba(139,92,246,0.3);

  /* Brand Colors */
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --cyan: #22d3ee;
  --emerald: #10b981;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --pink: #ec4899;
  --red: #ef4444;
  --neon: #10b981;

  /* Glow */
  --glow-purple: rgba(139,92,246,0.3);
  --glow-cyan: rgba(34,211,238,0.2);
  --glow-neon: rgba(16,185,129,0.2);
  --glow-blue: rgba(59,130,246,0.2);

  /* Text */
  --text: #f8fafc;
  --text2: #94a3b8;
  --text3: #64748b;

  --sidebar-w: 240px;
  --header-h: 64px;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-size: 0.9375rem;
  font-weight: 400;
}
h1,h2,h3,h4,h5 { font-family: 'Inter', sans-serif; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.logo-mark {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, var(--purple-light), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 2px;
}
.logo-sub {
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section-label {
  font-size: 0.65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 8px 6px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--card);
  color: var(--text);
}
.nav-item.active {
  background: rgba(139,92,246,0.1);
  color: var(--purple-light);
  border: 1px solid rgba(139,92,246,0.2);
  box-shadow: 0 0 12px rgba(139,92,246,0.1);
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-badge {
  margin-left: auto;
  background: var(--purple);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  letter-spacing: 0.3px;
}

.sidebar-bottom {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.connect-wa-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.18);
  color: var(--emerald);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
  width: 100%;
}
.connect-wa-btn:hover {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.3);
}
.upgrade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--purple));
  background-size: 200% auto;
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all var(--transition);
  width: 100%;
  box-shadow: 0 4px 20px rgba(139,92,246,0.35);
  animation: shimmer-btn 3s linear infinite;
}
@keyframes shimmer-btn {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.upgrade-btn:hover {
  box-shadow: 0 6px 28px rgba(139,92,246,0.5);
  transform: translateY(-1px);
}

/* ---- Main content ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Header ---- */
.header {
  height: var(--header-h);
  background: rgba(7,8,13,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-title {
  flex: 1;
}
.header-title h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.header-title p {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 1px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--text2);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ---- Page body ---- */
.page-body {
  flex: 1;
  padding: 28px 32px;
  max-width: 1320px;
  width: 100%;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* -- Glass Card -- */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition);
}
.card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(139,92,246,0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(139,92,246,0.15), 0 0 0 1px rgba(139,92,246,0.1);
}

/* -- Buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition);
  line-height: 1;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--purple));
  background-size: 200% auto;
  color: white;
  box-shadow: 0 4px 20px rgba(139,92,246,0.35);
  animation: shimmer-btn 3s linear infinite;
}
.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(139,92,246,0.5);
  transform: translateY(-1px);
}
.btn-neon {
  background: var(--emerald);
  color: #07080d;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25);
}
.btn-neon:hover {
  box-shadow: 0 6px 20px rgba(16,185,129,0.38);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text2);
}
.btn-outline:hover {
  background: var(--glass);
  color: var(--text);
  border-color: rgba(139,92,246,0.3);
}
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ghost:hover {
  background: var(--glass-hover);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.18);
}
.btn-sm { padding: 7px 14px; font-size: 0.78rem; }
.btn-lg { padding: 13px 26px; font-size: 0.9375rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; justify-content: center; }

/* -- Inputs -- */
.input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.875rem;
  transition: all var(--transition);
  outline: none;
}
.input:focus {
  border-color: var(--purple);
  background: rgba(139,92,246,0.06);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.input::placeholder { color: var(--text3); }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(240,240,248,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select.input option { background: #1a1a2e; }

.input-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.input-group { display: flex; flex-direction: column; gap: 4px; }

/* -- Badge -- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-purple { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.2); }
.badge-neon   { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.2); }
.badge-blue   { background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }
.badge-amber  { background: rgba(245,158,11,0.12); color: #fcd34d; border: 1px solid rgba(245,158,11,0.2); }
.badge-pink   { background: rgba(236,72,153,0.12); color: #f9a8d4; border: 1px solid rgba(236,72,153,0.2); }
.badge-red    { background: rgba(239,68,68,0.1);   color: #fca5a5; border: 1px solid rgba(239,68,68,0.18); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal {
  background: rgba(13,15,26,0.98);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 540px;
  width: 100%;
  position: relative;
  transform: translateY(20px) scale(0.97);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 0 60px rgba(139,92,246,0.15), 0 40px 80px rgba(0,0,0,0.5);
}
.modal-wide { max-width: 760px; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--card-hover); color: var(--text); }
.modal-header { margin-bottom: 24px; }
.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.modal-header p { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }
.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

/* ============================================================
   DASHBOARD
   ============================================================ */

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.kpi-card:hover::after { opacity: 1; }
.kpi-purple::after { background: radial-gradient(circle at 100% 0%, rgba(139,92,246,0.08), transparent 60%); }
.kpi-neon::after   { background: radial-gradient(circle at 100% 0%, rgba(16,185,129,0.08), transparent 60%); }
.kpi-blue::after   { background: radial-gradient(circle at 100% 0%, rgba(59,130,246,0.08), transparent 60%); }
.kpi-amber::after  { background: radial-gradient(circle at 100% 0%, rgba(245,158,11,0.08), transparent 60%); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.kpi-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.kpi-icon.purple { background: rgba(139,92,246,0.15); }
.kpi-icon.neon   { background: rgba(16,185,129,0.12); }
.kpi-icon.blue   { background: rgba(59,130,246,0.12); }
.kpi-icon.amber  { background: rgba(245,158,11,0.12); }

.kpi-trend {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.kpi-trend.up { color: var(--emerald); }
.kpi-trend.down { color: var(--red); }

.kpi-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}
.kpi-label {
  font-size: 0.78rem;
  color: var(--text2);
  font-weight: 500;
}

/* Chart section */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card { padding: 24px; }
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.chart-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.chart-legend {
  display: flex;
  gap: 14px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text2);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.chart-wrapper {
  height: 200px;
  position: relative;
}

/* Activity feed */
.activity-card { padding: 24px; }
.activity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.activity-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  border-radius: 0;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { opacity: 0.8; }
.activity-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.activity-info { flex: 1; min-width: 0; }
.activity-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-preview {
  font-size: 0.75rem;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-meta {
  font-size: 0.7rem;
  color: var(--text3);
  flex-shrink: 0;
  text-align: right;
}

/* ============================================================
   AI SALES FLOWS
   ============================================================ */
.flows-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
}
.flow-builder { padding: 24px; }
.flow-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.flow-builder-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}
.flow-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 8px 0;
}

/* Flow blocks */
.flow-block {
  width: 100%;
  max-width: 480px;
  position: relative;
}
.flow-block-inner {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.flow-block-inner:hover {
  border-color: var(--border-strong);
  background: var(--card-hover);
  transform: translateX(3px);
}
.block-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.block-icon.msg-type    { background: rgba(139,92,246,0.15); }
.block-icon.q-type      { background: rgba(59,130,246,0.15); }
.block-icon.cond-type   { background: rgba(245,158,11,0.12); }
.block-icon.offer-type  { background: rgba(16,185,129,0.12); }
.block-icon.cta-type    { background: rgba(236,72,153,0.12); }

.block-content { flex: 1; }
.block-type-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.block-type-label.msg   { color: #a78bfa; }
.block-type-label.q     { color: #93c5fd; }
.block-type-label.cond  { color: #fcd34d; }
.block-type-label.offer { color: #6ee7b7; }
.block-type-label.cta   { color: #f9a8d4; }

.block-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}
.block-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.block-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0;
}
.flow-block-inner:hover .block-btn { opacity: 1; }
.block-btn:hover { background: var(--card-hover); color: var(--text); }

/* Connector arrow */
.flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 4px 0;
}
.connector-line {
  width: 2px;
  height: 24px;
  background: linear-gradient(180deg, var(--purple), var(--blue));
  opacity: 0.4;
  border-radius: 2px;
}
.connector-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.5;
}
.add-block-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px dashed var(--border-strong);
  background: transparent;
  color: var(--text2);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-top: 8px;
}
.add-block-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(139,92,246,0.06);
}

/* Branches for condition block */
.branch-row {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  padding: 8px 0;
}
.branch-path {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.branch-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--amber);
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 100px;
  padding: 2px 10px;
}

/* Flow sidebar: block palette */
.block-palette { padding: 22px; }
.palette-header {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text2);
}
.palette-blocks { display: flex; flex-direction: column; gap: 8px; }
.palette-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: grab;
  transition: all var(--transition);
}
.palette-block:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
}
.palette-block:active { cursor: grabbing; }
.palette-block-label { font-size: 0.82rem; font-weight: 500; }
.palette-block-desc { font-size: 0.72rem; color: var(--text2); margin-top: 1px; }

/* Flow preview card */
.flow-preview { padding: 22px; margin-top: 16px; }
.flow-preview h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   CHAT SIMULATOR
   ============================================================ */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
.chat-phone-wrapper {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}
.chat-phone {
  width: 380px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  height: 600px;
}
.wa-header {
  background: #1f2c34;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.wa-back {
  color: #53bdeb;
  font-size: 1.1rem;
}
.wa-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.wa-info { flex: 1; }
.wa-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e9edef;
  line-height: 1.2;
}
.wa-status {
  font-size: 0.7rem;
  color: #8696a0;
}
.wa-actions {
  display: flex;
  gap: 12px;
  color: #aebac1;
  font-size: 1rem;
}
.wa-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect width='100' height='100' fill='%23111b21'/%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wa-messages::-webkit-scrollbar { width: 3px; }
.wa-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.wa-bubble {
  max-width: 78%;
  padding: 8px 12px 6px;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.45;
  position: relative;
  animation: bubbleIn 0.25s ease forwards;
  opacity: 0;
}
@keyframes bubbleIn {
  from { opacity:0; transform: translateY(6px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
.wa-bubble.bot {
  background: #202c33;
  color: #e9edef;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.wa-bubble.user {
  background: #005c4b;
  color: #e9edef;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.wa-bubble .bubble-time {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}
.wa-bubble.user .bubble-time .read-tick { color: #53bdeb; }
.wa-offer-card {
  background: #1f2c34;
  border: 1px solid rgba(83,189,235,0.2);
  border-radius: 8px;
  padding: 10px;
  margin-top: 6px;
}
.wa-offer-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #53bdeb;
  margin-bottom: 4px;
}
.wa-offer-desc { font-size: 0.75rem; color: #8696a0; }
.wa-offer-price {
  font-size: 1rem;
  font-weight: 700;
  color: #e9edef;
  margin-top: 6px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #202c33;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  align-self: flex-start;
  width: fit-content;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8696a0;
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.wa-input-bar {
  background: #1f2c34;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wa-text-input {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 24px;
  padding: 9px 16px;
  color: #e9edef;
  font-size: 0.83rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.wa-text-input::placeholder { color: #8696a0; }
.wa-send-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #00a884;
  border: none;
  color: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.wa-send-btn:hover { background: #00c49f; }

/* Simulator sidebar */
.sim-sidebar { display: flex; flex-direction: column; gap: 16px; }
.sim-flow-card { padding: 20px; }
.sim-flow-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.sim-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text2);
}
.sim-step:last-child { border-bottom: none; }
.sim-step.active { color: var(--text); }
.step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.sim-step.active .step-num {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}
.sim-step.done .step-num {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #07080d;
}

/* ============================================================
   CLIENTS
   ============================================================ */
.clients-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.clients-search {
  flex: 1;
  max-width: 340px;
  position: relative;
}
.clients-search .input { padding-left: 38px; }
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 0.85rem;
  pointer-events: none;
}
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.client-card {
  padding: 22px;
  transition: all var(--transition);
}
.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  border-color: var(--border-strong);
}
.client-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.client-avatar {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.client-info { flex: 1; }
.client-name {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 3px;
}
.client-type {
  font-size: 0.72rem;
  color: var(--text2);
}
.client-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.client-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text2);
}
.client-detail-icon { color: var(--text3); font-size: 0.75rem; }
.client-flow-select {
  margin-bottom: 14px;
}
.client-actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   PRICING MODAL
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.pricing-card.popular {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.06);
  box-shadow: 0 0 40px rgba(139,92,246,0.15), 0 20px 60px rgba(0,0,0,0.4);
}
.pricing-card.popular::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), var(--cyan), var(--purple));
  background-size: 200% auto;
  animation: shimmer-btn 3s linear infinite;
}
.popular-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pricing-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.pricing-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: 4px;
  line-height: 1;
}
.pricing-period {
  font-size: 0.75rem;
  color: var(--text2);
  margin-bottom: 20px;
}
.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 22px;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text2);
}
.feature-check { color: var(--emerald); font-size: 0.9rem; }

/* ============================================================
   ONBOARDING POPUP
   ============================================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboarding-modal {
  background: rgba(13,15,26,0.98);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 28px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 80px rgba(139,92,246,0.2), 0 40px 80px rgba(0,0,0,0.6);
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: pulse-glow 3s ease-in-out infinite;
}
.onboarding-emoji { font-size: 3rem; margin-bottom: 16px; }
.onboarding-modal h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.onboarding-modal p {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 28px;
}
.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
  text-align: left;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
}
.step-status {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.step-status.done {
  background: var(--emerald);
  color: #07080d;
}
.step-status.pending {
  background: var(--card);
  border: 2px solid var(--border-strong);
  color: var(--text3);
}
.onboarding-skip {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  margin-top: 14px;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition);
}
.onboarding-skip:hover { color: var(--text2); }

/* ============================================================
   CONNECT WHATSAPP MODAL
   ============================================================ */
.qr-placeholder {
  width: 180px; height: 180px;
  border-radius: var(--radius-md);
  background: white;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.qr-grid {
  display: grid;
  grid-template-columns: repeat(9, 16px);
  grid-template-rows: repeat(9, 16px);
  gap: 2px;
  padding: 12px;
}
.qr-cell {
  border-radius: 2px;
  background: #1a1a1a;
}
.qr-cell.white { background: white; }
.wa-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.wa-step {
  display: flex;
  gap: 12px;
  font-size: 0.83rem;
  color: var(--text2);
  align-items: flex-start;
}
.wa-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wa-coming-soon {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--amber);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.waitlist-input-row {
  display: flex;
  gap: 8px;
}
.waitlist-input-row .input { flex: 1; }
.waitlist-success {
  display: none;
  text-align: center;
  color: var(--neon);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px;
}

/* ============================================================
   BLOCK EDITOR MODAL
   ============================================================ */
.block-type-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.block-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}
.block-type-btn:hover, .block-type-btn.selected {
  border-color: var(--purple);
  background: rgba(139,92,246,0.1);
  color: #a78bfa;
}
.block-type-btn .icon { font-size: 1.1rem; }
.wa-preview-bubble {
  background: #202c33;
  border-radius: 12px;
  border-bottom-left-radius: 2px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #e9edef;
  margin-top: 8px;
  min-height: 40px;
  line-height: 1.45;
  max-width: 80%;
}
.char-counter {
  font-size: 0.7rem;
  color: var(--text3);
  text-align: right;
  margin-top: 4px;
}

/* ============================================================
   EMPTY STATES & MISC
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text2);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 14px; opacity: 0.5; }
.empty-state h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 0.82rem; line-height: 1.6; max-width: 280px; margin: 0 auto; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text2);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.3); }
  50%       { box-shadow: 0 0 40px rgba(139,92,246,0.6); }
}
@keyframes counter-up {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
  opacity: 0;
}
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.10s; }
.fade-in-3 { animation-delay: 0.15s; }
.fade-in-4 { animation-delay: 0.20s; }
.fade-in-5 { animation-delay: 0.25s; }

/* Staggered fade-up for page entrance */
.animate-fade-up {
  animation: fadeUp 0.5s ease-out forwards;
  opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  animation: pulse 2s ease-in-out infinite;
  display: inline-block;
}

/* ============================================================
   DASHBOARD — MONEY HERO CARDS
   ============================================================ */
.money-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.money-card {
  padding: 20px;
  overflow: hidden;
}
.money-card-inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.money-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.money-body { flex: 1; min-width: 0; }
.money-label {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 6px;
}
.money-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 8px;
}
.money-value.green { color: var(--emerald); }
.money-value.blue  { color: var(--cyan); }
.money-value.purple{ color: var(--purple-light); }
.money-value.amber { color: var(--amber); }
.money-growth {
  display: flex;
  align-items: center;
  gap: 6px;
}
.growth-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}
.growth-badge.up {
  background: rgba(0,232,122,0.12);
  color: #00e87a;
}
.growth-badge.down {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}
.money-vs {
  font-size: 0.7rem;
  color: var(--text3);
}
.money-sparkline {
  margin-top: 4px;
  height: 36px;
}

/* ============================================================
   DASHBOARD — MAIN ROW
   ============================================================ */
.dash-main-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-panel {}
.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px;
}
.chart-panel-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.legend-dot-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text2);
}
.legend-dot-item span {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* ---- Live Feed ---- */
.live-feed-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.live-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.live-feed-header h3 { font-size: 0.9rem; font-weight: 600; }
.live-feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}
.live-feed::-webkit-scrollbar { width: 3px; }
.live-feed::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: var(--card); }
.feed-item-new {
  background: rgba(0,232,122,0.04);
  animation: feedSlideIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes feedSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.feed-icon {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.feed-icon.hot   { background: rgba(245,158,11,0.12); }
.feed-icon.money { background: rgba(0,232,122,0.1); }
.feed-icon.new   { background: rgba(77,127,255,0.1); }
.feed-icon.booked{ background: rgba(168,85,247,0.1); }
.feed-content { flex: 1; min-width: 0; }
.feed-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.feed-detail {
  font-size: 0.72rem;
  color: var(--text2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-tag {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.feed-tag.hot    { background: rgba(245,158,11,0.15); color: #f59e0b; }
.feed-tag.money  { background: rgba(0,232,122,0.12); color: #00e87a; }
.feed-tag.new    { background: rgba(77,127,255,0.12); color: #4d7fff; }
.feed-tag.booked { background: rgba(168,85,247,0.12); color: #a855f7; }
.feed-time {
  font-size: 0.65rem;
  color: var(--text3);
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}

/* ============================================================
   DASHBOARD — BOTTOM ROW
   ============================================================ */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.panel-header h3 { font-size: 0.9rem; font-weight: 600; }

/* Conversation preview */
.convo-preview-panel {}
.convo-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.convo-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all var(--transition);
}
.convo-card:hover {
  border-color: var(--border-strong);
  background: var(--card-hover);
  transform: translateY(-1px);
}
.convo-avatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #060610;
  flex-shrink: 0;
}
.convo-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.convo-preview { display: flex; }
.bubble {
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 10px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.bot-bubble {
  background: rgba(77,127,255,0.1);
  border: 1px solid rgba(77,127,255,0.15);
  border-bottom-left-radius: 3px;
  color: var(--text2);
}
.user-bubble {
  background: rgba(0,92,75,0.6);
  border-bottom-right-radius: 3px;
  margin-left: auto;
  color: var(--text);
}
.convo-result {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 3px;
}
.result-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.result-badge.qualified { background: rgba(0,232,122,0.12); color: #00e87a; }
.result-badge.closed    { background: rgba(168,85,247,0.12); color: #a855f7; }
.result-badge.pending   { background: rgba(245,158,11,0.12); color: #f59e0b; }

/* Quick stats column */
.quick-stats-col { display: flex; flex-direction: column; gap: 12px; }
.quick-stat-card { padding: 18px 20px; }
.qs-label {
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 8px;
}
.qs-name { font-size: 0.92rem; font-weight: 700; margin-bottom: 4px; }
.qs-big {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.qs-detail { font-size: 0.75rem; color: var(--text2); margin-bottom: 10px; }
.qs-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.qs-bar { height: 100%; border-radius: 4px; }
.qs-pct { font-size: 0.68rem; color: var(--text3); }

/* neon alias for the new green */
:root { --neon: #00e87a; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- Large screens: constrain max-width ---- */
@media (min-width: 1400px) {
  .page-body { max-width: 1400px; }
  .app-shell { max-width: 1600px; }
}

/* ---- Tablet (1024px) ---- */
@media (max-width: 1024px) {
  :root {
    --sidebar-w: 200px;
  }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .chart-row { grid-template-columns: 1fr; }
  .flows-grid { grid-template-columns: 1fr; }
  .simulator-layout { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; gap: 12px; }
  .money-hero-row { grid-template-columns: repeat(2, 1fr); }
  .dash-main-row { grid-template-columns: 1fr; }
  .dash-bottom-row { grid-template-columns: 1fr; }
  .page-body { padding: 20px 24px; }
  .money-value { font-size: 1.6rem; }
  .kpi-value { font-size: 1.75rem; }
}

/* ---- Mobile (< 768px) ---- */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 260px;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }
  .main-content { margin-left: 0; }
  .hamburger {
    display: flex;
    min-height: 44px;
    min-width: 44px;
  }
  .page-body { padding: 16px; }
  .header { padding: 0 16px; }
  .clients-header-row { flex-wrap: wrap; gap: 10px; }
  .clients-search { max-width: 100%; flex: 100%; order: 2; }
  .chart-row { grid-template-columns: 1fr; }
  .simulator-layout { grid-template-columns: 1fr; }
  .money-hero-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-main-row { grid-template-columns: 1fr; }
  .dash-bottom-row { grid-template-columns: 1fr; }
  .modal { padding: 20px 16px; }
  .onboarding-modal { padding: 28px 20px; }
  .header h1 { font-size: 1rem; }
  .header p { display: none; }
  .kpi-card { padding: 16px 14px; }
  .kpi-value { font-size: 1.5rem; }
  .kpi-icon { width: 32px; height: 32px; }
  .money-card { padding: 16px; }
  .money-value { font-size: 1.4rem; }
  .quick-stat-card { padding: 14px 16px; }
  .qs-big { font-size: 1.5rem; }
  .live-feed-panel { max-height: 320px; }
  .sim-sidebar { gap: 12px; }
}

/* ---- Small mobile (< 480px) ---- */
@media (max-width: 480px) {
  :root {
    --sidebar-w: 260px;
    font-size: 14px;
  }
  body { font-size: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-value { font-size: 1.3rem; }
  .kpi-card { padding: 12px 10px; }
  .kpi-label { font-size: 0.68rem; }
  .kpi-icon { width: 28px; height: 28px; font-size: 0.9rem; }
  .money-hero-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .money-value { font-size: 1.2rem; }
  .money-label { font-size: 0.6rem; }
  .page-body { padding: 12px; }
  .header { padding: 0 12px; }
  .header-actions { gap: 6px; }
  .btn { padding: 8px 14px; font-size: 0.8rem; min-height: 40px; }
  .btn-sm { padding: 6px 12px; font-size: 0.75rem; min-height: 36px; }
  .btn-lg { padding: 10px 20px; font-size: 0.85rem; }
  .kpi-trend { font-size: 0.62rem; }
  .growth-badge { font-size: 0.62rem; padding: 2px 5px; }
  .modal { padding: 16px 12px; border-radius: 16px; }
  .modal-wide { max-width: calc(100vw - 32px); }
  .modal-overlay { padding: 12px; }
  .onboarding-modal { padding: 20px 16px; border-radius: 20px; }
  .onboarding-emoji { font-size: 2.2rem; }
  .onboarding-modal h2 { font-size: 1.15rem; }
  .onboarding-steps { gap: 8px; }
  .onboarding-step { padding: 10px 12px; font-size: 0.8rem; }
  .block-type-selector { grid-template-columns: repeat(3, 1fr); }
  .chart-card { padding: 16px; }
  .chart-panel-header { padding: 14px 14px 12px; }
  .chart-card-header { padding: 16px 16px 14px; }
  .convo-card { padding: 12px; }
  .feed-item { padding: 8px 12px; }
  .qs-big { font-size: 1.3rem; }
  .qs-label { font-size: 0.62rem; }
  .qs-name { font-size: 0.82rem; }
  .quick-stat-card { padding: 12px 14px; }
  .client-card { padding: 16px; }
  .client-actions { flex-wrap: wrap; gap: 6px; }
  .client-actions .btn { flex: 1; min-width: 0; }
  .clients-grid { grid-template-columns: 1fr; }
  .flows-grid { grid-template-columns: 1fr; }
  .flow-builder { padding: 16px; }
  .block-palette { padding: 16px; }
  .flow-block { max-width: 100%; }
  .flow-block-inner { padding: 12px 14px; }
  .block-icon { width: 28px; height: 28px; }
  .block-text { font-size: 0.8rem; }
  .sim-phone-wrap { min-height: auto; }
  .chat-phone {
    width: 100%;
    max-width: 340px;
    height: 540px;
  }
  .chat-phone-wrapper { padding: 12px 0; }
  .wa-header { padding: 10px 12px; }
  .wa-avatar { width: 32px; height: 32px; }
  .wa-name { font-size: 0.82rem; }
  .wa-bubble { font-size: 0.78rem; max-width: 85%; padding: 7px 10px 5px; }
  .wa-send-btn { width: 36px; height: 36px; }
  .wa-text-input { padding: 7px 12px; font-size: 0.78rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card { padding: 18px 14px; }
  .pricing-price { font-size: 1.7rem; }
  .sidebar-logo { padding: 16px 14px; }
  .logo-mark { font-size: 1.1rem; }
  .nav-item { padding: 9px 10px; font-size: 0.82rem; }
  .nav-icon { width: 16px; height: 16px; }
  .connect-wa-btn { padding: 9px 12px; font-size: 0.75rem; }
  .upgrade-btn { padding: 9px 12px; font-size: 0.75rem; }
  .block-type-btn { padding: 8px 2px; }
  .block-type-btn .icon { font-size: 0.95rem; }
  .flow-builder-header { flex-wrap: wrap; gap: 8px; }
  .flow-builder-header > div:last-child { flex-wrap: wrap; }
  .feed-name { font-size: 0.72rem; }
  .feed-detail { font-size: 0.65rem; }
  .feed-time { font-size: 0.6rem; }
  .feed-tag { font-size: 0.55rem; padding: 1px 4px; }
  .convo-avatar { width: 32px; height: 32px; font-size: 0.62rem; }
  .convo-preview { gap: 4px; }
  .bubble { font-size: 0.68rem; padding: 4px 8px; max-width: 200px; }
  .result-badge { font-size: 0.6rem; padding: 2px 6px; }
  .chart-panel-header h3 { font-size: 0.85rem; }
  .panel-header h3 { font-size: 0.82rem; }
  .wa-offer-title { font-size: 0.72rem; }
  .wa-offer-desc { font-size: 0.65rem; }
  .wa-offer-price { font-size: 0.82rem; }
  .wa-preview-bubble { font-size: 0.75rem; }
  .char-counter { font-size: 0.62rem; }
  .chart-wrapper { height: 160px; }
}

/* ---- Extra small (< 360px) ---- */
@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .money-hero-row { grid-template-columns: 1fr; }
  .kpi-value { font-size: 1.15rem; }
  .money-value { font-size: 1.1rem; }
  .page-body { padding: 10px; }
  .header { padding: 0 10px; }
  .btn { padding: 8px 10px; font-size: 0.75rem; min-height: 38px; }
  .btn-sm { min-height: 34px; }
  .modal { padding: 14px 10px; }
  .modal-wide { max-width: calc(100vw - 20px); }
  .onboarding-modal { padding: 16px 12px; }
  .block-type-selector { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .chat-phone { height: 480px; }
  .clients-grid { grid-template-columns: 1fr; }
  .convo-card { padding: 10px; }
  .quick-replies-wrap { padding: 10px; }
  .wa-bubble { font-size: 0.72rem; }
}

/* ---- Touch targets (minimum 44px) ---- */
@media (max-width: 768px) {
  .btn, button { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .nav-item { min-height: 44px; }
  .input { min-height: 44px; padding: 10px 12px; }
  .hamburger { min-height: 44px; min-width: 44px; }
  .connect-wa-btn { min-height: 44px; }
  .upgrade-btn { min-height: 44px; }
  .wa-send-btn { min-height: 44px; min-width: 44px; }
  .block-type-btn { min-height: 56px; }
  .sim-step { min-height: 40px; }
  .feed-item { min-height: 44px; }
  .convo-card { min-height: 60px; }
}

/* ---- Sidebar overlay for mobile ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ---- Horizontal overflow prevention ---- */
@media (max-width: 768px) {
  * { max-width: 100vw; }
  .app-shell { overflow-x: hidden; }
  .page-body { overflow-x: hidden; }
  .kpi-card, .money-card, .card { max-width: 100%; overflow: hidden; }
  .flow-block { overflow: visible; }
  .sim-sidebar { overflow-x: hidden; }
}
