/* ═══════════════════════════════════════════════════════════════════════════
   Vynex Solutions — WhatsApp growth platform
   Design system: matched to vynexagency.com (editorial light minimalist).
   Warm off-white canvas, deep charcoal ink, electric-violet → magenta → cyan
   brand gradient, glassmorphism, aura blobs & gradient-text animations.
   Type: Space Grotesk (display) · DM Sans (UI) · JetBrains Mono (code).
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Space+Grotesk:wght@300..700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Raw HSL triplets (same tokens as the Vynex website) */
  --background-h: 40 33% 98%;   /* Warm off-white */
  --foreground-h: 240 10% 10%;  /* Deep charcoal */
  --brand-h: 262 83% 58%;       /* Vynex electric violet */
  --brand-2-h: 322 84% 60%;     /* Magenta accent */
  --brand-3-h: 199 89% 56%;     /* Cyan accent */
  --border-h: 40 10% 85%;
  --muted-h: 40 20% 93%;

  /* App palette (legacy names kept so every existing reference re-themes) */
  --ink: hsl(240 10% 10%);        /* charcoal shell (was navy) */
  --ink-soft: hsl(240 8% 15%);
  --ink-hover: hsl(240 6% 22%);
  --surface: hsl(40 33% 98%);
  --card: #ffffff;
  --text: hsl(240 10% 10%);
  --muted: hsl(240 5% 45%);
  --faint: hsl(240 5% 62%);
  --border: hsl(40 10% 85%);
  --border-soft: hsl(40 14% 90%);
  /* Accent (kept the --coral-* names so every existing reference re-themes).
     Matched to the Vynex website brand: electric violet + magenta. */
  --coral: hsl(262 83% 58%);
  --coral-dark: hsl(262 70% 48%);
  --coral-soft: hsl(262 83% 96%);
  --salmon: hsl(322 84% 60%);
  --brand: hsl(262 83% 58%);
  --brand-2: hsl(322 84% 60%);
  --brand-3: hsl(199 89% 56%);
  --green: #10b981;
  --green-soft: #e7f8f2;
  --blue: #0369a1;
  --blue-soft: #e8f1f8;
  --amber: #d97706;
  --amber-soft: #fdf3e0;
  --red: #dc2626;
  --red-soft: #fdecec;
  --sky: hsl(199 89% 46%);
  --sky-soft: hsl(199 89% 95%);
  --slate-soft: hsl(40 20% 93%);

  --wa-bg: #e5ddd5;
  --wa-bubble: #ffffff;

  --s-queued: hsl(240 5% 62%);
  --s-sent: #0369a1;
  --s-delivered: #10b981;
  --s-read: hsl(199 89% 46%);
  --s-failed: #dc2626;

  --radius: 10px;
  --shadow: 0 1px 2px hsl(240 10% 10% / 0.04), 0 8px 24px hsl(240 10% 10% / 0.05);
  --shadow-lg: 0 24px 64px hsl(240 10% 10% / 0.22);
  /* Brand-tinted glow (the website's .shadow-glow) */
  --glow: 0 10px 40px -10px hsl(var(--brand-h) / 0.5), 0 4px 12px -4px hsl(var(--brand-h) / 0.3);

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { letter-spacing: -0.02em; text-wrap: balance; }
a { color: var(--coral-dark); text-decoration: none; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--slate-soft); padding: 1px 6px; border-radius: 5px; }

::selection { background-color: hsl(var(--brand-h) / 0.95); color: #fff; }

/* Custom scrollbar for a sleeker feel (matches the website) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: hsl(var(--muted-h)); }
::-webkit-scrollbar-thumb { background: hsl(var(--brand-h) / 0.5); border-radius: 999px; border: 2px solid hsl(var(--muted-h)); }
::-webkit-scrollbar-thumb:hover { background: hsl(var(--brand-h) / 0.8); }

/* ── Vynex website utilities ───────────────────────────────────────────── */
.font-display, .display { font-family: var(--display); }

/* Animated multi-stop gradient text */
.text-gradient {
  background-image: linear-gradient(120deg, var(--brand), var(--brand-2), var(--brand-3), var(--brand));
  background-size: 250% 250%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 6s ease infinite;
}

/* Glassmorphism surface */
.glass {
  background: hsl(var(--background-h) / 0.7);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}

/* Subtle grid / dotted backdrops */
.bg-grid {
  background-image:
    linear-gradient(to right, hsl(var(--foreground-h) / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--foreground-h) / 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
}
.bg-dots {
  background-image: radial-gradient(hsl(var(--foreground-h) / 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
}
.mask-radial-fade {
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
}

/* Soft colored aura blob */
.aura {
  background: radial-gradient(circle at center, hsl(var(--brand-h) / 0.55), transparent 65%);
  filter: blur(70px);
}
.animate-aura { animation: aura-drift 14s ease-in-out infinite; }
.animate-float { animation: float 8s ease-in-out infinite; }

/* Brand-tinted glow shadow for primary CTAs */
.shadow-glow { box-shadow: var(--glow); }

/* Animated gradient border card — renders a 1px gradient ring on hover */
.card-gradient-border { position: relative; }
.card-gradient-border::before {
  content: "";
  position: absolute; inset: 0; padding: 1px; border-radius: inherit;
  background: linear-gradient(140deg, var(--brand), hsl(var(--brand-2-h) / 0.2) 45%, transparent 60%, var(--brand-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none; opacity: 0; transition: opacity 0.4s ease;
}
.card-gradient-border:hover::before { opacity: 1; }

/* Continuous scrolling marquee */
.animate-scroll { animation: scroll 40s linear infinite; }
.fade-left-edge {
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

@keyframes gradient-pan {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}
@keyframes aura-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  33% { transform: translate(40px, -30px) scale(1.1); opacity: 0.9; }
  66% { transform: translate(-30px, 20px) scale(0.95); opacity: 0.6; }
}
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% - 2rem)); }
}

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

.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--ink); color: hsl(240 10% 82%);
  display: flex; flex-direction: column;
  padding: 20px 16px; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 4px 12px hsl(var(--brand-h) / 0.4); flex-shrink: 0; }
.brand-chip { background: #fff; border-radius: 10px; padding: 5px 9px; display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-chip img { height: 28px; display: block; }
.sidebar .brand h1 { margin: 0; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.02em; font-family: var(--display); }
.sidebar .brand p { margin: 1px 0 0; font-size: 11px; color: hsl(240 6% 55%); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .nav-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: hsl(240 6% 48%); padding: 14px 12px 5px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 999px;
  color: hsl(240 8% 72%); font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s; position: relative;
}
.nav a:hover { background: var(--ink-hover); color: #fff; }
.nav a.active { background: linear-gradient(90deg, hsl(var(--brand-h) / 0.9), hsl(var(--brand-2-h) / 0.55)); color: #fff; box-shadow: 0 4px 14px hsl(var(--brand-h) / 0.35); }
.nav a.active::before { content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(to bottom, var(--brand), var(--brand-2)); }
.nav a .ico { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.nav a .ico svg { width: 100%; height: 100%; display: block; }

.sidebar .foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 8px; }
.conn-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: hsl(240 6% 60%); padding: 9px 11px; background: rgba(255,255,255,0.04); border-radius: 999px; }
.conn-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(240 5% 45%); flex-shrink: 0; }
.conn-chip.ok { color: #d5f5e6; }
.conn-chip.ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,0.22); }
.side-link { font-size: 12px; color: hsl(240 6% 55%); padding: 2px 11px; }
.side-link:hover { color: #fff; }

/* Main column + app bar */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 30; height: 62px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
  background: hsl(var(--background-h) / 0.75); backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid hsl(var(--border-h) / 0.6);
}
.ab-left, .ab-right { display: flex; align-items: center; gap: 14px; }
.hamburger { display: none; background: none; border: none; padding: 6px; color: var(--ink); cursor: pointer; }
.hamburger svg { width: 22px; height: 22px; }
.workspace { display: flex; flex-direction: column; line-height: 1.15; }
.ws-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; }
.ws-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.usermenu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: none; cursor: pointer; letter-spacing: 0.02em; transition: box-shadow 0.2s; }
.avatar:hover { box-shadow: var(--glow); }
.umenu { position: absolute; right: 0; top: 46px; width: 224px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; display: none; flex-direction: column; gap: 2px; }
.usermenu.open .umenu { display: flex; }
.umenu .who { font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; word-break: break-all; }
.umenu a { padding: 9px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); font-weight: 500; }
.umenu a:hover { background: var(--slate-soft); }
.umenu button { width: 100%; margin-top: 2px; }

.content { flex: 1; min-width: 0; padding: 30px 34px 64px; max-width: 1200px; width: 100%; margin: 0 auto; }
.content-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.content-head h2 { margin: 0; font-size: 26px; font-weight: 700; font-family: var(--display); letter-spacing: -0.03em; }
.content-head .sub { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.head-actions { display: flex; gap: 10px; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: hsl(240 10% 10% / 0.5); z-index: 39; }
.sidebar-overlay.show { display: block; }

.view { display: none; }
.view.active { display: block; animation: fadein 0.35s cubic-bezier(.2,.8,.2,1); }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 920px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .hamburger { display: inline-flex; }
  .content { padding: 22px 18px 52px; }
  .appbar { padding: 0 16px; }
}

/* ── Cards / panels ────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover { border-color: hsl(var(--brand-h) / 0.25); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; font-family: var(--display); }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Stat tiles ────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.stat:hover { transform: translateY(-2px); border-color: hsl(var(--brand-h) / 0.3); }
.stat .n { font-size: 26px; font-weight: 700; font-family: var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.stat.accent .n {
  background-image: linear-gradient(120deg, var(--brand), var(--brand-2), var(--brand-3), var(--brand));
  background-size: 250% 250%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradient-pan 6s ease infinite;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  border: none; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.3s, border-color 0.2s, color 0.2s;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--ink); color: #fff; }
button.primary:hover:not(:disabled) { background: hsl(240 10% 18%); box-shadow: var(--glow); }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.ghost:hover:not(:disabled) { border-color: var(--text); background: var(--text); color: var(--surface); }
button.ghost.on-dark { color: hsl(240 8% 78%); border-color: rgba(255,255,255,0.18); background: transparent; }
button.ghost.on-dark:hover { background: #fff; border-color: #fff; color: var(--ink); }
button.danger { background: var(--red-soft); color: var(--red); }
button.danger:hover:not(:disabled) { background: #fbdcdc; }
button.small { padding: 7px 15px; font-size: 12.5px; }
button.link { background: none; padding: 4px 6px; color: var(--coral-dark); font-weight: 600; }
button.link:hover { text-decoration: underline; }
/* Anchor buttons reuse the same look */
a.ghost { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 600; border: 1px solid var(--border); color: var(--text); transition: all 0.2s; }
a.ghost:hover { border-color: var(--text); background: var(--text); color: var(--surface); }
a.ghost.small { padding: 7px 15px; font-size: 12.5px; }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field .hint { font-weight: 400; color: var(--faint); }
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--sans); font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px hsl(var(--brand-h) / 0.15);
}
.field small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field input.mono { font-family: var(--mono); font-size: 13px; }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 600; padding: 10px 14px;
  background: hsl(40 25% 96%); border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: hsl(var(--brand-h) / 0.04); }
td.phone, .phone { font-family: var(--mono); font-size: 12.5px; }
td.actions-cell { text-align: right; white-space: nowrap; }

/* ── Status pills / chips ──────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  text-transform: capitalize; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.queued    { background: var(--slate-soft); color: var(--muted); }
.pill.sent      { background: var(--blue-soft); color: var(--blue); }
.pill.delivered { background: var(--green-soft); color: var(--green); }
.pill.read      { background: var(--sky-soft); color: var(--sky); }
.pill.failed    { background: var(--red-soft); color: var(--red); }
.pill.draft     { background: var(--slate-soft); color: var(--muted); }
.pill.pending   { background: var(--amber-soft); color: var(--amber); }
.pill.approved  { background: var(--green-soft); color: var(--green); }
.pill.rejected  { background: var(--red-soft); color: var(--red); }
.pill.paused, .pill.disabled { background: var(--amber-soft); color: var(--amber); }
.pill.sending   { background: var(--coral-soft); color: var(--coral-dark); }
.pill.completed { background: var(--green-soft); color: var(--green); }
.pill.scheduled { background: var(--sky-soft); color: var(--sky); }
.pill.cancelled { background: var(--slate-soft); color: var(--muted); }
.pill.connected { background: var(--green-soft); color: var(--green); }

/* ── Empty states ──────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }
.empty h4 { margin: 0 0 6px; color: var(--text); font-size: 15px; font-family: var(--display); }
.empty p { margin: 0 auto 16px; max-width: 380px; font-size: 13px; line-height: 1.5; }

/* ── Dropzone ──────────────────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 38px 22px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: hsl(40 30% 97%);
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--coral-soft); }
.dropzone .big { font-size: 30px; margin-bottom: 8px; }
.dropzone h4 { margin: 0 0 5px; font-size: 14.5px; }
.dropzone p { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: hsl(240 10% 10% / 0.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 5vh 18px; z-index: 60; overflow-y: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 640px; max-width: 100%; padding: 26px;
  animation: pop 0.25s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { width: 860px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 17px; font-family: var(--display); }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--faint); padding: 2px 8px; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-foot .left { margin-right: auto; }

/* ── Wizard steps ──────────────────────────────────────────────────────── */
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.step {
  flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--faint);
  padding-bottom: 9px; border-bottom: 3px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}
.step.active { color: var(--coral-dark); border-image: linear-gradient(90deg, var(--brand), var(--brand-2)) 1; border-bottom: 3px solid; }
.step.done { color: var(--green); border-color: var(--green); }

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress { height: 8px; background: var(--slate-soft); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.progress-fill {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3), var(--brand));
  background-size: 250% 100%;
  animation: gradient-pan 6s ease infinite;
  transition: width 0.4s ease;
}

.tallies { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 10px; }
.tally { background: hsl(40 25% 96%); border: 1px solid var(--border-soft); border-radius: 10px; padding: 10px 12px; text-align: center; }
.tally .n { font-family: var(--display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally .l { font-size: 11px; color: var(--muted); text-transform: capitalize; margin-top: 1px; }
.tally[data-k="sent"] .n { color: var(--s-sent); }
.tally[data-k="delivered"] .n { color: var(--s-delivered); }
.tally[data-k="read"] .n { color: var(--s-read); }
.tally[data-k="failed"] .n { color: var(--s-failed); }
.tally[data-k="queued"] .n { color: var(--s-queued); }

/* ── WhatsApp template preview ─────────────────────────────────────────── */
.wa-preview {
  background: var(--wa-bg);
  border-radius: 12px; padding: 22px 18px; min-height: 200px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.wa-bubble {
  background: var(--wa-bubble); border-radius: 10px; border-top-left-radius: 2px;
  max-width: 92%; padding: 10px 12px 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
  font-size: 13.5px; line-height: 1.45; color: #111b21;
  overflow-wrap: anywhere;
}
.wa-bubble .wa-header { font-weight: 700; margin-bottom: 4px; }
.wa-bubble .wa-body { white-space: pre-wrap; }
.wa-bubble .wa-body .var { background: #d5f0e3; color: #0b6b4f; border-radius: 4px; padding: 0 4px; font-family: var(--mono); font-size: 12px; }
.wa-bubble .wa-footer { font-size: 11.5px; color: #667781; margin-top: 5px; }
.wa-bubble .wa-time { font-size: 10.5px; color: #8696a0; text-align: right; margin-top: 3px; }
.wa-buttons { max-width: 92%; margin-top: 5px; display: flex; flex-direction: column; gap: 4px; }
.wa-btn {
  background: var(--wa-bubble); color: #0a80f5; text-align: center;
  border-radius: 8px; padding: 8px; font-size: 13px; font-weight: 500;
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
}

/* ── Toasts ────────────────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
  border-radius: 12px; padding: 13px 18px; max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: toastin 0.3s cubic-bezier(.2,.8,.2,1);
  border-left: 4px solid var(--brand);
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ── Misc helpers ──────────────────────────────────────────────────────── */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.mt { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border-soft); margin: 18px 0; }
.banner {
  display: flex; align-items: center; gap: 12px;
  border-radius: 12px; padding: 13px 16px; font-size: 13.5px; margin-bottom: 18px;
}
.banner.warn { background: var(--amber-soft); color: #8a5a06; }
.banner.info { background: var(--coral-soft); color: var(--coral-dark); }
.banner button { margin-left: auto; flex-shrink: 0; }

.cost-table td { padding: 8px 14px; }
.cost-total td { font-weight: 700; border-top: 2px solid var(--border); }

/* ── Auth pages (login) ────────────────────────────────────────────────── */
body.auth {
  display: grid; place-items: center; min-height: 100vh;
  background: var(--surface); position: relative; overflow: hidden;
}
/* Editorial grid + drifting brand auras — the Vynex hero backdrop */
body.auth::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, hsl(var(--foreground-h) / 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(var(--foreground-h) / 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 75%);
}
.auth-aura { position: fixed; width: 34rem; height: 34rem; pointer-events: none; z-index: 0; }
.auth-aura.a1 { top: -12%; left: -10%; background: radial-gradient(circle at center, hsl(var(--brand-h) / 0.45), transparent 65%); filter: blur(70px); animation: aura-drift 14s ease-in-out infinite; }
.auth-aura.a2 { bottom: -14%; right: -8%; background: radial-gradient(circle at center, hsl(var(--brand-2-h) / 0.35), transparent 65%); filter: blur(70px); animation: aura-drift 14s ease-in-out infinite; animation-delay: -5s; }
.auth-aura.a3 { top: 30%; right: 25%; width: 24rem; height: 24rem; background: radial-gradient(circle at center, hsl(var(--brand-3-h) / 0.25), transparent 65%); filter: blur(70px); animation: aura-drift 14s ease-in-out infinite; animation-delay: -9s; }
.auth-card {
  position: relative; z-index: 1;
  background: hsl(0 0% 100% / 0.8);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid hsl(var(--border-h) / 0.8);
  border-radius: 18px;
  padding: 36px; width: 380px; max-width: 92vw;
  box-shadow: 0 24px 64px hsl(240 10% 10% / 0.12), var(--glow);
  animation: authin 0.6s cubic-bezier(.2,.8,.2,1);
}
@keyframes authin { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.auth-card .logo { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 24px; }
.auth-card .logo h1 { margin: 0; font-size: 20px; font-family: var(--display); }
.auth-card .logo p { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.auth-card .brand-logo { height: 54px; display: block; }
.auth-card .msg { min-height: 18px; font-size: 13px; margin: 4px 0 14px; }
.auth-card .msg.err { color: var(--red); }
.auth-card .msg.ok { color: var(--green); }
.auth-card button.primary { width: 100%; padding: 13px; box-shadow: var(--glow); }

/* ── Legacy topbar pages (owner console, docs) ─────────────────────────── */
.topbar {
  background: var(--ink); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 18px 28px; position: relative;
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand-3), var(--brand));
  background-size: 250% 100%;
  animation: gradient-pan 6s ease infinite;
}
.topbar .brand { display: flex; align-items: center; gap: 14px; }
/* Ghost buttons/links sitting on the dark topbar */
.topbar a.ghost, .topbar button.ghost { color: hsl(240 8% 80%); border-color: rgba(255,255,255,0.2); background: transparent; }
.topbar a.ghost:hover, .topbar button.ghost:hover:not(:disabled) { background: #fff; border-color: #fff; color: var(--ink); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; font-family: var(--display); }
.topbar p { margin: 2px 0 0; font-size: 12px; color: hsl(240 8% 65%); }
.status-strip {
  font-family: var(--mono); font-size: 12px; color: hsl(240 8% 65%);
  border: 1px solid rgba(255, 255, 255, 0.15); padding: 6px 12px; border-radius: 999px;
}
.status-strip.ok { color: #6ee7b7; border-color: rgba(110, 231, 183, 0.3); }
.status-strip.err { color: #fca5a5; border-color: rgba(252, 165, 165, 0.3); }
main.legacy, body > main {
  max-width: 1080px; margin: 0 auto; padding: 28px; display: grid; gap: 22px;
}
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: border-color 0.25s ease;
}
.panel:hover { border-color: hsl(var(--brand-h) / 0.25); }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 17px; font-family: var(--display); }
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  background-image: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.warn { color: var(--coral-dark); font-size: 13px; min-height: 18px; }
.count-badge { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.campaign-state {
  margin-left: auto; font-family: var(--mono); font-size: 12px;
  padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-soft);
}
.var-mapping .var-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.var-row code { font-family: var(--mono); }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.ledger { grid-column: 1 / -1; }
.hint { font-weight: 400; color: var(--faint); font-size: 12px; }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px 16px; gap: 6px; overflow-x: auto; }
  .sidebar .brand { padding: 0 10px 0 0; }
  .sidebar .brand p { display: none; }
  .nav { flex-direction: row; margin: 0; }
  .nav a { padding: 8px 12px; white-space: nowrap; }
  .nav a .ico { display: none; }
  .sidebar .foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .sidebar .foot .who { display: none; }
  .content { padding: 20px 16px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Key–value rows (owner client-detail cards) */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--muted); }
