:root {
  --navy: #03035d;
  --navy-2: #020242;
  --cyan: #00a0e6;
  --lime: #96be14;
  --orange: #fa7800;
  --pink: #f03c6e;
  --white: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --soft: #f5f7fb;
  --line: rgba(255,255,255,.14);
  --card: rgba(255,255,255,.96);
  --shadow: 0 22px 55px rgba(3,3,93,.20);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(0,160,230,.24), transparent 34%), radial-gradient(circle at bottom right, rgba(240,60,110,.20), transparent 34%), #eef2ff;
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
.app-shell { display: grid; grid-template-columns: 310px 1fr; min-height: 100vh; transition: grid-template-columns .22s ease; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px;
  background: linear-gradient(170deg, var(--navy) 0%, var(--navy-2) 68%, #0b0b72 100%);
  color: var(--white); overflow-x: hidden; overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar-head { display: grid; gap: 12px; }
.sidebar::before { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(0,160,230,.28), transparent 70%); top: -120px; right: -160px; }
.sidebar::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(250,120,0,.22), transparent 68%); bottom: -120px; left: -120px; }
.brand-card, .nav, .side-footer, .sidebar-toggle, .sidebar-head { position: relative; z-index: 1; }
.brand-card { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.08); backdrop-filter: blur(16px); }
.brand-logo { width: 74px; height: 74px; object-fit: cover; border-radius: 19px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: var(--lime); }
.brand-card h1 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.brand-card span { color: rgba(255,255,255,.72); font-size: 13px; }
.sidebar-toggle { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.08); color: var(--white); cursor: pointer; transition: .2s ease; }
.sidebar-toggle:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.toggle-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,.14); font-size: 14px; line-height: 1; }
.toggle-text { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nav { display: grid; gap: 10px; margin-top: 28px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 15px 16px; color: rgba(255,255,255,.74); border-radius: 18px; border: 1px solid transparent; transition: .2s ease; font-weight: 700; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); color: white; border-color: rgba(255,255,255,.16); transform: translateX(4px); }
.nav-icon { display: inline-grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 10px; background: rgba(255,255,255,.12); color: white; font-size: 13px; font-weight: 900; letter-spacing: .02em; }
.nav-label { white-space: nowrap; }
.sidebar-spacer { flex: 1 0 28px; }
.side-footer { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: rgba(255,255,255,.10); border: 1px solid var(--line); border-radius: 20px; }
.side-footer div { display: flex; flex-direction: column; gap: 3px; }
.side-footer strong { display: block; line-height: 1.2; }
.side-footer p { margin: 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.45; }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 8px rgba(150,190,20,.18); }
.main { padding: 26px; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 18px; }
.topbar h2 { margin: 0; font-size: 34px; letter-spacing: -.04em; color: var(--navy); }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 11px 17px; border-radius: 14px; font-weight: 800; border: 0; cursor: pointer; transition: .2s ease; }
.btn-primary { color: white; background: linear-gradient(135deg, var(--cyan), var(--pink)); box-shadow: 0 13px 26px rgba(0,160,230,.28); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 36px rgba(240,60,110,.26); }
.btn-outline { border: 1px solid rgba(3,3,93,.12); color: var(--navy); background: white; }
.pill { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.pill.green { background: rgba(150,190,20,.15); color: #527000; }
.pill.cyan { background: rgba(0,160,230,.13); color: #006b98; }
.pill.pink { background: rgba(240,60,110,.12); color: #af1645; }
.pill.orange { background: rgba(250,120,0,.13); color: #a54c00; }
.message-stack { display: grid; gap: 8px; margin-bottom: 16px; }
.flash { padding: 13px 15px; border-radius: 16px; background: white; border: 1px solid rgba(3,3,93,.10); box-shadow: 0 10px 25px rgba(3,3,93,.07); font-weight: 700; }
.flash.success { border-left: 5px solid var(--lime); }
.flash.error { border-left: 5px solid var(--pink); }
.flash.warning { border-left: 5px solid var(--orange); }
.hero-grid { margin-bottom: 18px; }
.glass-card, .card, .metric-card { background: var(--card); border: 1px solid rgba(255,255,255,.70); box-shadow: var(--shadow); border-radius: 28px; }
.hero-panel { display: grid; grid-template-columns: 1.2fr .8fr; min-height: 360px; overflow: hidden; position: relative; }
.hero-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(3,3,93,.96), rgba(3,3,93,.76)); }
.hero-copy, .orbit-card { position: relative; z-index: 1; }
.hero-copy { padding: 42px; color: white; }
.hero-copy h3 { font-size: 42px; line-height: 1.02; margin: 18px 0 16px; letter-spacing: -.05em; max-width: 850px; }
.hero-copy p { color: rgba(255,255,255,.75); line-height: 1.7; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero-actions .btn-outline { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.20); }
.orbit-card { display: grid; place-items: center; min-height: 330px; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.13); }
.orbit-a { width: 330px; height: 330px; animation: spin 12s linear infinite; }
.orbit-b { width: 230px; height: 230px; border-color: rgba(150,190,20,.28); animation: spin 8s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.phone-mock { position: relative; z-index: 2; width: 260px; min-height: 430px; border-radius: 38px; padding: 18px; background: linear-gradient(180deg, #f8fafc, #e2e8f0); box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.phone-header { display: flex; gap: 5px; justify-content: center; padding: 10px; }
.phone-header span { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.chat-bubble { padding: 14px; margin: 18px 0; border-radius: 18px; font-size: 13px; line-height: 1.45; }
.incoming { background: white; color: #0f172a; border-bottom-left-radius: 4px; }
.outgoing { background: linear-gradient(135deg, var(--lime), #c2df4e); color: #172500; border-bottom-right-radius: 4px; }
.mini-flow { display: flex; gap: 7px; flex-wrap: wrap; font-size: 11px; align-items: center; color: #334155; }
.mini-flow span { padding: 6px 8px; border-radius: 999px; background: #fff; }
.metrics-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { padding: 20px; min-height: 126px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -35px; top: -35px; width: 90px; height: 90px; border-radius: 50%; background: linear-gradient(135deg, rgba(0,160,230,.14), rgba(240,60,110,.16)); }
.metric-card span { color: var(--muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { display: block; margin: 10px 0 6px; color: var(--navy); font-size: 33px; letter-spacing: -.05em; }
.metric-card em { font-style: normal; color: var(--muted); font-size: 13px; }
.content-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide-left { grid-template-columns: 1.2fr .8fr; }
.card { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card h3 { margin: 0; color: var(--navy); font-size: 24px; letter-spacing: -.03em; }
.card h4 { margin: 0 0 8px; color: var(--navy); }
.muted { color: var(--muted); line-height: 1.7; }
.module-list { display: grid; gap: 12px; }
.module-list a { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: #f8fafc; border: 1px solid #e7e9f3; transition: .2s ease; }
.module-list a:hover { transform: translateX(3px); border-color: rgba(0,160,230,.30); box-shadow: 0 12px 20px rgba(0,160,230,.10); }
.module-list b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: linear-gradient(135deg, var(--cyan), var(--lime)); color: white; }
.module-list span { display: grid; }
.module-list em { font-size: 13px; color: var(--muted); font-style: normal; margin-top: 3px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid #ecedf5; font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eef2ff; color: var(--navy); font-size: 11px; text-transform: uppercase; font-weight: 900; }
.status.connected, .status.approved, .status.completed, .status.read, .status.replied { background: rgba(150,190,20,.16); color: #557400; }
.status.pending, .status.submitted, .status.running, .status.sent { background: rgba(0,160,230,.13); color: #006b98; }
.status.failed, .status.rejected { background: rgba(240,60,110,.13); color: #b51645; }
.status.draft { background: rgba(250,120,0,.13); color: #a54c00; }
.form-grid { display: grid; gap: 14px; }
.form-grid p { margin: 0; display: grid; gap: 7px; }
.form-grid label { font-weight: 800; color: var(--navy); font-size: 13px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid #dfe3ee; border-radius: 14px; min-height: 44px; padding: 11px 13px; background: #fbfcff; color: #111827; outline: none; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0,160,230,.10); }
.helptext { color: var(--muted); font-size: 12px; }
.errorlist { color: var(--pink); margin: 0; padding-left: 18px; font-size: 13px; }
.choice-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 22px 0; }
.tab { padding: 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.10); color: white; font-weight: 900; cursor: pointer; }
.tab.active { background: linear-gradient(135deg, var(--cyan), var(--lime)); color: white; }
.onboarding-grid { align-items: start; }
.accent-card { background: linear-gradient(150deg, var(--navy), #0c0c75); color: white; min-height: 100%; }
.accent-card h3 { color: white; font-size: 31px; }
.signup-box, .tip-box { padding: 14px; border-radius: 18px; background: rgba(3,3,93,.04); border: 1px solid rgba(3,3,93,.08); color: var(--muted); font-size: 13px; }
.accent-card .signup-box { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.13); color: rgba(255,255,255,.80); }
.signup-box h4 { color: inherit; margin: 0 0 8px; }
.signup-box p { margin: 6px 0; }
code { color: var(--pink); background: rgba(240,60,110,.08); padding: 2px 5px; border-radius: 6px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.preview-sticky { position: sticky; top: 22px; align-self: start; }
.whatsapp-preview { overflow: hidden; border-radius: 26px; background: #e7f4ee; border: 1px solid #d7e7e0; }
.wa-top { display: flex; gap: 9px; align-items: center; padding: 14px; background: #075e54; color: white; }
.wa-top span { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--lime)); }
.wa-top b { flex: 1; }
.wa-top em { font-size: 12px; opacity: .7; font-style: normal; }
.wa-body { padding: 20px; min-height: 260px; background-image: radial-gradient(rgba(3,3,93,.08) 1px, transparent 1px); background-size: 18px 18px; }
.wa-template-card { max-width: 330px; background: white; border-radius: 18px 18px 18px 3px; padding: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.10); }
.wa-template-card strong, .wa-template-card p, .wa-template-card small { display: block; }
.wa-template-card p { color: #1f2937; line-height: 1.55; }
.wa-template-card small { color: var(--muted); border-top: 1px solid #eef2f7; padding-top: 9px; }
.wa-template-card button { width: 100%; border: 0; border-top: 1px solid #eef2f7; margin-top: 10px; padding: 11px; background: white; color: #0a88cc; font-weight: 800; }
.check-row { display: flex !important; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: #f8fafc; }
.check-row input { width: auto !important; min-height: auto !important; }
.template-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.template-card { padding: 17px; border-radius: 20px; border: 1px solid #e7e9f3; background: #fbfcff; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.template-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.template-card footer { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.template-card footer span { padding: 5px 8px; border-radius: 999px; background: #eef2ff; }
.campaign-stack { display: grid; gap: 12px; max-height: 560px; overflow: auto; padding-right: 6px; }
.campaign-card { padding: 16px; border-radius: 18px; border: 1px solid #e7e9f3; background: #fbfcff; }
.campaign-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.campaign-card p { margin: 3px 0 10px; color: var(--muted); }
.progress-row { height: 10px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-row span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--lime)); border-radius: inherit; }
.flow-canvas { width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
.flow-track { display: flex; gap: 48px; align-items: center; min-width: max-content; padding: 28px 40px; box-sizing: border-box; }
.flow-node { position: relative; flex: 0 0 320px; min-height: 150px; padding: 26px; border-radius: 22px; color: white; overflow: visible; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: 0 18px 45px rgba(3,3,93,.14); transition: transform .18s ease, box-shadow .18s ease; }
.flow-node::after { content: ""; position: absolute; width: 110px; height: 110px; right: -36px; top: -36px; border-radius: 50%; background: rgba(255,255,255,.10); pointer-events: none; }
.flow-node span { position: absolute; top: 14px; left: 14px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.18); font-weight: 900; }
.flow-node strong { font-size: 20px; margin-bottom: 10px; }
.flow-node em { font-style: normal; color: rgba(255,255,255,.86); line-height: 1.45; font-size: 13px; }
.flow-node.start { background: linear-gradient(135deg, var(--cyan), #0477d8); }
.flow-node.condition { background: linear-gradient(135deg, var(--pink), #b51686); }
.flow-node.wait { background: linear-gradient(135deg, var(--orange), #d95000); }
.flow-node.action { background: linear-gradient(135deg, var(--lime), #48a10c); }
.flow-node:hover { transform: translateY(-8px); box-shadow: 0 30px 80px rgba(3,3,93,.22); }
.connector { width: 64px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(3,3,93,.10), rgba(3,3,93,.40)); flex: 0 0 auto; position: relative; display: block; align-self: center; }
.connector::after { content: ""; position: absolute; right: -10px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 16px; height: 16px; border-top: 4px solid rgba(3,3,93,.45); border-right: 4px solid rgba(3,3,93,.45); border-radius: 2px; background: transparent; }
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .side-footer { margin-top: 20px; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .hero-panel, .two-col, .wide-left { grid-template-columns: 1fr; }
  .flow-canvas { overflow-x: hidden; }
  .flow-track { flex-direction: column; gap: 18px; padding: 18px; }
  .connector { width: 6px; height: 48px; margin: 0 auto; align-self: center; }
  .connector::after { top: auto; left: 50%; bottom: -6px; right: auto; transform: translateX(-50%) rotate(135deg); }
  .template-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
body.sidebar-collapsed .app-shell { grid-template-columns: 96px 1fr; }
body.sidebar-collapsed .sidebar { padding: 24px 16px; }
body.sidebar-collapsed .sidebar-head { justify-content: center; }
body.sidebar-collapsed .brand-card { padding: 12px; justify-content: center; }
body.sidebar-collapsed .brand-card div { display: none; }
body.sidebar-collapsed .sidebar-toggle { justify-content: center; }
body.sidebar-collapsed .toggle-text { display: none; }
body.sidebar-collapsed .nav { justify-items: center; }
body.sidebar-collapsed .nav a { justify-content: center; padding: 14px 10px; width: 100%; }
body.sidebar-collapsed .nav a:hover, body.sidebar-collapsed .nav a.active { transform: none; }
body.sidebar-collapsed .nav-label { display: none; }
body.sidebar-collapsed .nav-icon { width: 34px; height: 34px; border-radius: 12px; }
body.sidebar-collapsed .side-footer { justify-content: center; padding: 14px; }
body.sidebar-collapsed .side-footer div, body.sidebar-collapsed .side-footer strong, body.sidebar-collapsed .side-footer p { display: none; }
body.sidebar-collapsed .pulse { box-shadow: 0 0 0 6px rgba(150,190,20,.18); }
@media (max-width: 720px) {
  .main, .sidebar { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero-copy { padding: 28px; }
  .hero-copy h3 { font-size: 32px; }
  .metrics-grid, .template-list { grid-template-columns: 1fr; }
  .phone-mock { width: 220px; min-height: 350px; }
  body.sidebar-collapsed .app-shell { grid-template-columns: 1fr; }
}
