*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:        #4f46e5;
  --brand-50:     #eef2ff;
  --brand-100:    #e0e7ff;
  --brand-light:  #eef2ff;
  --brand-mid:    #6366f1;
  --brand-dark:   #3730a3;
  --success:      #059669;
  --success-bg:   #d1fae5;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --warn:         #d97706;
  --warn-bg:      #fef3c7;
  --gray-50:      #f8fafc;
  --gray-100:     #f1f5f9;
  --gray-200:     #e2e8f0;
  --gray-300:     #cbd5e1;
  --gray-400:     #94a3b8;
  --gray-500:     #64748b;
  --gray-600:     #475569;
  --gray-700:     #334155;
  --gray-800:     #1e293b;
  --gray-900:     #0f172a;
  --white:        #ffffff;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    16px;
  --shadow-xs:    0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.05);
  --shadow-xl:    0 20px 60px rgba(0,0,0,.12), 0 8px 20px rgba(0,0,0,.07);
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ══════════════════════════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════════════════════════ */

#auth-screen { min-height: 100vh; background: #fff; }

/* Navbar */
.lp-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.lp-nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 28px;
  height: 68px; display: flex; align-items: center; justify-content: space-between;
}
.lp-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.lp-logo-icon { width: 36px !important; height: 36px !important; font-size: 13px !important; flex-shrink: 0; border-radius: 10px !important; }
.lp-logo-text { font-size: 18px; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; }
.lp-nav-links { display: flex; align-items: center; gap: 2px; }
.lp-nav-link {
  font-size: 14px; font-weight: 500; color: var(--gray-500);
  text-decoration: none; padding: 7px 14px; border-radius: 8px;
  transition: color .15s, background .15s;
}
.lp-nav-link:hover { color: var(--gray-900); background: var(--gray-50); }
.lp-nav-btn { padding: 8px 18px; font-size: 13.5px; }
.lp-hamburger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; padding: 6px; color: var(--gray-700); }
.lp-mobile-nav { padding: 12px 20px 20px; border-top: 1px solid var(--gray-100); display: flex; flex-direction: column; gap: 4px; background: #fff; }
.lp-mobile-link { display: block; padding: 11px 6px; font-size: 15px; font-weight: 500; color: var(--gray-700); text-decoration: none; border-bottom: 1px solid var(--gray-100); }

/* Hero */
.lp-hero {
  max-width: 1180px; margin: 0 auto; padding: 96px 28px 72px;
  display: flex; align-items: center; gap: 72px;
}
.lp-hero-text { flex: 1; min-width: 0; }
.lp-hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--brand-50); color: var(--brand);
  font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 20px;
  margin-bottom: 24px; letter-spacing: .02em;
  border: 1px solid var(--brand-100);
}
.lp-headline {
  font-size: clamp(30px, 4.2vw, 52px); font-weight: 900;
  line-height: 1.1; letter-spacing: -.03em;
  color: var(--gray-900); margin-bottom: 20px;
}
.lp-headline-accent {
  color: var(--brand);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lp-subtext { font-size: 17px; color: var(--gray-500); line-height: 1.75; margin-bottom: 32px; max-width: 520px; }
.lp-hero-ctas { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lp-cta-btn { padding: 14px 28px; font-size: 15px; font-weight: 700; border-radius: 10px; }
.lp-cta-ghost { background: none; border: none; color: var(--gray-500); font-size: 13px; cursor: pointer; font-family: inherit; text-decoration: none; padding: 0; display: inline-flex; align-items: center; gap: 5px; }
.lp-cta-ghost:hover { color: var(--brand); }
.lp-hero-note { font-size: 12px; color: var(--gray-400); margin-top: 10px; }

/* Hero visual */
.lp-hero-visual { flex-shrink: 0; width: 430px; position: relative; }
.lp-hero-glow {
  position: absolute; inset: -40px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(79,70,229,.14) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.lp-demo-card {
  background: white; border-radius: 18px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100); overflow: hidden; position: relative; z-index: 1;
}
.lp-demo-header {
  background: var(--gray-50); padding: 12px 16px;
  display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--gray-100);
}
.lp-demo-dot { width: 11px; height: 11px; border-radius: 50%; }
.lp-demo-dot-red    { background: #ff5f57; }
.lp-demo-dot-yellow { background: #febc2e; }
.lp-demo-dot-green  { background: #28c840; }
.lp-demo-title { font-size: 12px; font-weight: 600; color: var(--gray-400); margin-left: 6px; letter-spacing: .01em; }
.lp-demo-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.lp-demo-node {
  display: flex; align-items: center; gap: 12px;
  background: var(--gray-50); border-radius: 10px; padding: 12px 14px;
  border: 1px solid var(--gray-200); position: relative;
}
.lp-demo-crm   { border-left: 3px solid #f97316; }
.lp-demo-books { border-left: 3px solid var(--success); }
.lp-demo-node-icon { font-size: 22px; flex-shrink: 0; }
.lp-demo-node-app   { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.lp-demo-node-event { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.lp-demo-trigger-badge, .lp-demo-action-badge {
  position: absolute; right: 10px; top: 8px;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.lp-demo-trigger-badge { background: #fff7ed; color: #f97316; }
.lp-demo-action-badge  { background: #f0fdf4; color: var(--success); }
.lp-demo-connector { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 14px; position: relative; }
.lp-demo-connector-line { width: 2px; height: 28px; background: linear-gradient(to bottom, #f97316, var(--brand), var(--success)); border-radius: 2px; }
.lp-demo-connector-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  position: absolute; top: 0;
  animation: pulse-down 1.8s ease-in-out infinite;
}
@keyframes pulse-down { 0% { top: 0; opacity: 1; } 100% { top: 28px; opacity: 0; } }
.lp-demo-sync-label { font-size: 11px; color: var(--brand); font-weight: 600; }
.lp-demo-log {
  display: flex; align-items: center; gap: 8px;
  background: #f0fdf4; border-radius: 8px; padding: 9px 12px;
  border: 1px solid #bbf7d0;
}
.lp-demo-log-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.lp-demo-log-text { font-size: 11px; color: var(--gray-700); font-family: 'SF Mono', 'Fira Code', monospace; }

/* Stats bar */
.lp-stats-bar {
  background: var(--gray-900); padding: 28px 24px;
  display: flex; justify-content: center; align-items: center;
  gap: 0; flex-wrap: wrap;
}
.lp-stat { text-align: center; padding: 8px 48px; }
.lp-stat-num { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.lp-stat-lbl { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 500; }
.lp-stat-sep { width: 1px; height: 44px; background: #1e293b; }

/* Sections */
.lp-section { padding: 96px 28px; }
.lp-section-alt { background: var(--gray-50); }
.lp-section-inner { max-width: 1180px; margin: 0 auto; }
.lp-section-badge {
  display: inline-block; background: var(--brand-50); color: var(--brand);
  font-size: 11px; font-weight: 700; padding: 5px 14px; border-radius: 20px;
  letter-spacing: .08em; margin-bottom: 16px; border: 1px solid var(--brand-100);
}
.lp-section-title { font-size: clamp(24px, 3vw, 36px); font-weight: 800; color: var(--gray-900); margin-bottom: 12px; letter-spacing: -.02em; }
.lp-section-sub { font-size: 16px; color: var(--gray-500); margin-bottom: 52px; max-width: 520px; line-height: 1.7; }

/* Features */
.lp-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-feat-card {
  background: white; border-radius: var(--radius-lg); padding: 28px;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.lp-feat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--gray-200); }
.lp-feat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 16px; }
.lp-feat-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; letter-spacing: -.01em; }
.lp-feat-desc { font-size: 13.5px; color: var(--gray-500); line-height: 1.7; }
.lp-feat-desc code { background: var(--gray-100); padding: 2px 6px; border-radius: 4px; font-size: 11px; font-family: 'SF Mono', monospace; }

/* How it works */
.lp-steps-row { display: flex; align-items: flex-start; gap: 0; }
.lp-step { flex: 1; text-align: center; padding: 0 24px; }
.lp-step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand);
  color: #fff; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}
.lp-step-icon-wrap { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.lp-step-title { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; letter-spacing: -.01em; }
.lp-step-desc { font-size: 13.5px; color: var(--gray-500); line-height: 1.7; }
.lp-step-arrow { display: flex; align-items: center; justify-content: center; padding-top: 32px; flex-shrink: 0; }

/* Pricing / Contact section */
.lp-pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 900px; }
.lp-price-card {
  background: white; border-radius: var(--radius-lg); padding: 30px 26px;
  border: 1px solid var(--gray-100); position: relative;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .2s;
}
.lp-price-card:hover { box-shadow: var(--shadow-md); }
.lp-price-card-featured {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 4px var(--brand-50), var(--shadow-md);
}
.lp-price-popular {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 16px; border-radius: 20px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,70,229,.35);
}
.lp-price-name { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; letter-spacing: -.01em; }
.lp-price-amount { font-size: 30px; font-weight: 900; color: var(--gray-900); margin-bottom: 4px; letter-spacing: -.02em; }
.lp-price-period { font-size: 14px; font-weight: 400; color: var(--gray-400); }
.lp-price-desc { font-size: 12.5px; color: var(--gray-400); margin-bottom: 22px; }
.lp-price-features { list-style: none; margin-bottom: 26px; display: flex; flex-direction: column; gap: 9px; }
.lp-price-features li { font-size: 13.5px; color: var(--gray-600); }

/* Bottom CTA */
.lp-cta-section {
  background: linear-gradient(135deg, #312e81 0%, var(--brand) 50%, var(--brand-mid) 100%);
  padding: 96px 28px; text-align: center; position: relative; overflow: hidden;
}
.lp-cta-section::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.08) 0%, transparent 60%);
  pointer-events: none;
}
.lp-cta-title { font-size: clamp(24px, 3.2vw, 38px); font-weight: 800; color: #fff; margin-bottom: 14px; letter-spacing: -.02em; position: relative; }
.lp-cta-sub { font-size: 17px; color: rgba(255,255,255,.75); margin-bottom: 36px; position: relative; }
.lp-cta-btn-white {
  background: #fff; color: var(--brand); font-weight: 700;
  padding: 14px 28px; border-radius: 10px; border: none; font-size: 15px;
  cursor: pointer; font-family: inherit; position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transition: background .15s, transform .15s;
}
.lp-cta-btn-white:hover { background: var(--brand-50); transform: translateY(-1px); }
.lp-cta-btn-outline {
  background: transparent; border: 2px solid rgba(255,255,255,.4); color: #fff;
  font-weight: 600; padding: 12px 24px; border-radius: 10px; font-size: 15px;
  cursor: pointer; font-family: inherit; position: relative;
  transition: border-color .15s;
}
.lp-cta-btn-outline:hover { border-color: rgba(255,255,255,.8); }

/* Footer */
.lp-footer { background: #0a0f1a; padding: 56px 28px 24px; }
.lp-footer-inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 64px; align-items: flex-start; padding-bottom: 40px; }
.lp-footer-brand { flex: 1; }
.lp-footer-links { display: flex; gap: 64px; }
.lp-footer-col { display: flex; flex-direction: column; gap: 12px; }
.lp-footer-col-title { font-size: 11px; font-weight: 700; color: #475569; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.lp-footer-link { font-size: 13.5px; color: #64748b; text-decoration: none; transition: color .15s; }
.lp-footer-link:hover { color: #e2e8f0; }
.lp-footer-bottom { max-width: 1180px; margin: 0 auto; border-top: 1px solid #1e293b; padding-top: 20px; display: flex; justify-content: space-between; font-size: 12px; color: #334155; }

/* Auth modal */
.auth-modal-inner { max-width: 420px; padding: 36px; position: relative; }
.auth-modal-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; justify-content: center; }

/* Responsive Landing */
@media (max-width: 960px) {
  .lp-hero { flex-direction: column; padding-top: 56px; gap: 48px; }
  .lp-hero-visual { width: 100%; max-width: 440px; }
  .lp-features-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-pricing-grid { grid-template-columns: 1fr; max-width: 380px; }
  .lp-steps-row { flex-direction: column; align-items: center; }
  .lp-step-arrow { transform: rotate(90deg); padding-top: 0; padding-bottom: 8px; }
  .lp-footer-inner { flex-direction: column; gap: 36px; }
  .lp-stat-sep { display: none; }
  .lp-stat { padding: 8px 28px; }
}
@media (max-width: 640px) {
  .lp-nav-links { display: none; }
  .lp-hamburger { display: block; }
  .lp-features-grid { grid-template-columns: 1fr; }
  .lp-section { padding: 64px 20px; }
  .lp-hero { padding: 48px 20px 40px; }
}

/* ══════════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════════ */

#app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 228px; min-width: 228px; background: var(--white);
  border-right: 1px solid var(--gray-100);
  display: flex; flex-direction: column;
  box-shadow: 1px 0 0 var(--gray-100);
}
.sidebar-logo {
  height: 64px; display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--gray-100);
}
.logo-icon {
  width: 32px; height: 32px; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 12px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.logo-text { font-size: 15px; font-weight: 800; color: var(--gray-900); letter-spacing: -.02em; }

.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 9px; cursor: pointer; color: var(--gray-500);
  font-weight: 500; font-size: 13.5px;
  transition: all .15s; text-decoration: none; margin-bottom: 2px;
}
.nav-item:hover { background: var(--gray-50); color: var(--gray-800); }
.nav-item.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-300); padding: 6px 12px 4px; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--gray-100); }
.plan-card {
  background: linear-gradient(135deg, var(--brand-50) 0%, #e0e7ff 100%);
  border: 1px solid var(--brand-100);
  border-radius: 10px; padding: 14px;
}
.plan-name { font-size: 12px; font-weight: 700; color: var(--brand); }
.plan-desc { font-size: 11px; color: var(--brand-mid); margin-top: 2px; line-height: 1.5; }
.plan-btn {
  margin-top: 10px; width: 100%; padding: 7px;
  background: var(--brand); color: white; border: none; border-radius: 7px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s;
  box-shadow: 0 1px 4px rgba(79,70,229,.25);
}
.plan-btn:hover { background: var(--brand-dark); }

/* Main area */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar {
  height: 64px; background: var(--white); border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  box-shadow: 0 1px 0 var(--gray-100);
}
.page-title { font-size: 17px; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%);
  color: var(--brand); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--brand-100);
}
.page-content { flex: 1; overflow-y: auto; padding: 28px; }

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 16px 22px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--gray-900); letter-spacing: -.01em; }
.card-body { padding: 22px; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  padding: 22px; display: flex; align-items: center; gap: 16px;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--radius); box-shadow: var(--shadow-xs);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover { border-color: var(--gray-200); transform: translateY(-1px); }
.stat-card-clickable:active { transform: translateY(0); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-val { font-size: 28px; font-weight: 800; color: var(--gray-900); letter-spacing: -.03em; line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--gray-400); margin-top: 4px; font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; border: none;
  transition: all .15s; font-family: inherit; letter-spacing: -.01em;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: white; box-shadow: 0 1px 4px rgba(79,70,229,.25);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%); box-shadow: 0 4px 12px rgba(79,70,229,.3); transform: translateY(-1px); }
.btn-secondary {
  background: var(--white); color: var(--gray-700);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); box-shadow: var(--shadow); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,.25); }
.btn-ghost { background: transparent; color: var(--gray-500); border: 1px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); color: var(--gray-700); }
.btn-sm   { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.w-full { width: 100%; justify-content: center; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--gray-900);
  background: var(--white); transition: border-color .15s, box-shadow .15s;
  outline: none; font-family: inherit;
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--gray-300); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-textarea { resize: vertical; min-height: 84px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
}
.badge-green  { background: var(--success-bg); color: var(--success); }
.badge-red    { background: var(--danger-bg);  color: var(--danger); }
.badge-yellow { background: var(--warn-bg);    color: var(--warn); }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: var(--gray-100);   color: var(--gray-500); }
.badge-indigo { background: var(--brand-50);   color: var(--brand); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gray-400); background: var(--gray-50); border-bottom: 1px solid var(--gray-100);
}
td { padding: 14px 16px; font-size: 13.5px; border-bottom: 1px solid var(--gray-50); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal-lg  { max-width: 800px; }
.modal-xl  { max-width: 1100px; }
.modal-header {
  padding: 22px 26px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--gray-900); letter-spacing: -.02em; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  font-size: 22px; line-height: 1; padding: 4px; border-radius: 6px;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 26px; }
.modal-footer {
  padding: 18px 26px; border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: 10px;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Workflow Cards ── */
.workflow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.workflow-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; transition: box-shadow .2s, transform .15s; }
.workflow-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.wf-apps { display: flex; align-items: center; gap: 10px; }
.app-pill { display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.app-pill.crm   { background: #fff7ed; color: #c2410c; }
.app-pill.books { background: #f0fdf4; color: var(--success); }
.arrow-icon { color: var(--gray-300); font-size: 18px; }
.wf-name  { font-size: 15px; font-weight: 700; color: var(--gray-900); letter-spacing: -.01em; }
.wf-desc  { font-size: 12.5px; color: var(--gray-400); line-height: 1.5; }
.wf-footer { display: flex; align-items: center; justify-content: space-between; }
.wf-meta  { font-size: 11px; color: var(--gray-400); }
.wf-actions { display: flex; gap: 4px; }

/* ── Toggle ── */
.toggle { position: relative; width: 40px; height: 22px; display: inline-block; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--gray-200); border-radius: 22px; cursor: pointer; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Connection Cards ── */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.conn-card { padding: 22px; }
.conn-app-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.conn-app-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.conn-app-name { font-size: 15px; font-weight: 700; color: var(--gray-900); letter-spacing: -.01em; }
.conn-app-desc { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.conn-status-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px; margin-bottom: 10px; }
.conn-org-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.conn-date { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Field Mapper ── */
.fmap-header { display: grid; grid-template-columns: 1fr 32px 1fr 28px; gap: 8px; align-items: center; padding: 0 2px 8px; }
.fmap-header-sm { padding: 8px 2px 4px; }
.fmap-col-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); }
.fmap-row { display: grid; grid-template-columns: 1fr 32px 1fr 28px; gap: 8px; align-items: center; margin-bottom: 8px; }
.fmap-row-empty { grid-template-columns: 1fr; font-size: 12.5px; color: var(--gray-400); padding: 10px 4px; }
.fmap-row-fixed { margin-bottom: 6px; }
.fmap-select-wrap { position: relative; display: flex; align-items: center; }
.fmap-select {
  width: 100%; padding: 8px 30px 8px 12px; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: 13px; color: var(--gray-800);
  background: #fff; appearance: none; -webkit-appearance: none;
  cursor: pointer; transition: border-color .15s, box-shadow .15s; outline: none;
}
.fmap-select:hover { border-color: var(--brand); }
.fmap-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.fmap-chevron { position: absolute; right: 9px; pointer-events: none; color: var(--gray-400); }
.fmap-arrow { display: flex; align-items: center; justify-content: center; color: var(--gray-300); flex-shrink: 0; }
.fmap-del { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; background: none; cursor: pointer; color: var(--gray-300); border-radius: 6px; transition: background .1s, color .1s; flex-shrink: 0; }
.fmap-del:hover { background: var(--danger-bg); color: var(--danger); }
.fmap-fixed-val { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1.5px solid var(--gray-100); border-radius: 8px; font-size: 12.5px; color: var(--gray-500); background: var(--gray-50); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fmap-fixed-dst { color: #059669; background: #f0fdf4; border-color: #d1fae5; }
.fmap-rec-badge { position: absolute; top: -8px; right: 4px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; background: var(--brand); color: #fff; border-radius: 4px; padding: 1px 5px; white-space: nowrap; pointer-events: none; }
.fmap-row-rec .fmap-select { border-color: #c7d2fe; }
.fmap-auto-note { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; color: #065f46; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; }
.fmap-li-toggle { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.fmap-li-toggle input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
.fmap-subform-box { border: 1.5px solid #e0e7ff; border-radius: 10px; padding: 14px 16px; background: #fafafe; }
.fmap-subform-title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.fmap-subform-desc { font-size: 12px; color: var(--gray-400); margin: 0 0 10px; }

/* ── Template editor ── */
.tpl-editor-wrap { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; height: 480px; }
.tpl-pane { display: flex; flex-direction: column; }
.tpl-pane-hdr { padding: 9px 14px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); display: flex; align-items: center; justify-content: space-between; }
.tpl-textarea { flex: 1; border: none; outline: none; padding: 14px; font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace; font-size: 12px; resize: none; line-height: 1.6; background: #1e1e2e; color: #cdd6f4; }
.tpl-preview { border-left: 1px solid var(--gray-200); overflow: auto; flex: 1; padding: 16px; background: white; font-size: 12px; }

/* ── Logs ── */
.log-ok   { color: var(--success); font-weight: 600; }
.log-fail { color: var(--danger);  font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot-green { background: #22c55e; }
.dot-red   { background: var(--danger); }

/* ── Wizard stepper ── */
.steps { display: flex; align-items: center; margin-bottom: 30px; }
.step-item { display: flex; align-items: center; gap: 8px; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; border: 2px solid var(--gray-200);
  color: var(--gray-400); background: white; transition: all .2s;
}
.step-item.active .step-circle  { border-color: var(--brand); color: white; background: var(--brand); box-shadow: 0 2px 8px rgba(79,70,229,.3); }
.step-item.done   .step-circle  { border-color: var(--success); color: white; background: var(--success); }
.step-label { font-size: 12px; font-weight: 600; color: var(--gray-400); transition: color .2s; }
.step-item.active .step-label { color: var(--brand); }
.step-item.done   .step-label { color: var(--success); }
.step-line { flex: 1; height: 2px; background: var(--gray-100); margin: 0 8px; border-radius: 2px; transition: background .3s; }
.step-item.done + .step-line { background: var(--success); }

/* ── Misc utilities ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 72px 20px; color: var(--gray-400); text-align: center; }
.empty-icon  { font-size: 52px; opacity: .5; }
.empty-title { font-size: 17px; font-weight: 700; color: var(--gray-600); }
.empty-desc  { font-size: 13.5px; max-width: 320px; line-height: 1.65; }

.spinner { width: 24px; height: 24px; border: 2.5px solid var(--gray-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 72px; }

.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 280px; max-width: 400px; padding: 13px 18px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg); animation: slideUp .2s ease; pointer-events: auto;
  backdrop-filter: blur(8px);
}
.toast-ok   { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.toast-err  { background: #fff1f2; color: var(--danger);  border: 1px solid #fecdd3; }
.toast-info { background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-100); }

.section-hdr  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--gray-900); letter-spacing: -.01em; }
.text-muted   { color: var(--gray-400); font-size: 12px; }
.divider      { border: none; border-top: 1px solid var(--gray-100); margin: 20px 0; }
.hidden       { display: none !important; }
.flex         { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:12px} .mt-4{margin-top:16px}
.mb-1{margin-bottom:4px} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px}
.font-bold{font-weight:700} .font-medium{font-weight:500}
.text-center{text-align:center}

/* ── DC Selector Modal ── */
.dc-options { display: flex; flex-direction: column; gap: 8px; }
.dc-option {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-radius: 10px; border: 1.5px solid var(--gray-200); cursor: pointer;
  transition: border-color .15s, background .15s; position: relative;
  background: white;
}
.dc-option:hover { border-color: var(--brand); background: var(--brand-50); }
.dc-option.selected { border-color: var(--brand); background: var(--brand-50); }
.dc-flag { font-size: 24px; line-height: 1; }
.dc-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.dc-host { font-size: 11px; color: var(--gray-400); font-family: 'SF Mono', monospace; margin-top: 2px; }
.dc-check { margin-left: auto; color: var(--brand); font-weight: 700; opacity: 0; transition: opacity .15s; font-size: 16px; }
.dc-option.selected .dc-check { opacity: 1; }

/* ── How-to steps (Connections page) ── */
.dc-how-steps { display: flex; flex-direction: column; gap: 12px; }
.dc-step { display: flex; align-items: flex-start; gap: 12px; font-size: 13.5px; color: var(--gray-600); }
.dc-step-num {
  min-width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: white; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
  box-shadow: 0 1px 4px rgba(79,70,229,.25);
}

/* ── Onboarding Banner ── */
.onboarding-banner {
  display: flex; align-items: center; gap: 18px;
  background: linear-gradient(135deg, var(--brand-50) 0%, #f0fdf4 100%);
  border: 1px solid var(--brand-100); border-radius: var(--radius-lg);
  padding: 20px 26px; margin-bottom: 22px;
}
.onboarding-icon { font-size: 34px; flex-shrink: 0; }
.onboarding-body { flex: 1; }
.onboarding-title { font-size: 15px; font-weight: 700; color: var(--gray-900); letter-spacing: -.01em; }
.onboarding-desc  { font-size: 13px; color: var(--gray-500); margin-top: 3px; line-height: 1.5; }

/* ── Platform Info (Settings) ── */
.platform-info-row  { display: flex; gap: 14px; align-items: flex-start; }
.platform-info-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.platform-info-title { font-size: 13px; font-weight: 600; color: var(--gray-900); margin-bottom: 3px; }

/* ── Auth screen ── */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-50) 0%, #f0fdf4 100%);
  padding: 24px;
}
.auth-card {
  background: white; border-radius: 20px; padding: 40px 44px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-100);
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.auth-logo-icon { width: 44px !important; height: 44px !important; font-size: 16px !important; border-radius: 12px !important; }
.auth-brand { font-size: 22px; font-weight: 800; color: var(--gray-900); letter-spacing: -.03em; }
.auth-tagline { font-size: 13px; color: var(--gray-400); margin-bottom: 26px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--gray-100); margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 9px 0; font-size: 14px; font-weight: 600; color: var(--gray-400);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s; font-family: inherit;
}
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-zoho-btn { padding: 12px; font-size: 14px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--gray-300); font-size: 12px; margin: 16px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-100); }
/* Text link under the Sign In button — a secondary path, so deliberately not a
   filled button competing with the primary action above it. */
.auth-link {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: none; padding: 0; font-family: inherit;
  font-size: 13px; font-weight: 600; color: var(--brand); cursor: pointer;
  text-align: center; transition: color .15s;
}
.auth-link:hover { color: var(--brand-dark); text-decoration: underline; }
/* Second link in the stack — grey so the two don't read as equal-weight
   actions. OTP is a way in; forgot-password is a fallback. */
.auth-link-muted { margin-top: 10px; font-weight: 500; color: var(--gray-400); }
.auth-link-muted:hover { color: var(--gray-700); }
.auth-success { text-align: center; padding: 8px 0; }
.auth-success-title { font-size: 18px; font-weight: 700; color: var(--gray-900); }

/* ── User dropdown ── */
.user-menu { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: white; border: 1px solid var(--gray-100);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 210px; z-index: 500; padding: 6px;
}
.user-dropdown-email { font-size: 11px; color: var(--gray-400); padding: 7px 10px 9px; word-break: break-all; }
.user-dropdown-divider { border-top: 1px solid var(--gray-100); margin: 4px 0; }
.user-dropdown-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px;
  border: none; background: none; font-size: 13px; color: var(--gray-700);
  cursor: pointer; font-family: inherit; transition: background .1s;
}
.user-dropdown-item:hover { background: var(--gray-50); }
.user-dropdown-signout { color: var(--danger); }
.user-dropdown-signout:hover { background: var(--danger-bg); }

/* ── Billing / Contact ── */
.billing-wrap { max-width: 980px; margin: 0 auto; padding: 8px 0 40px; }
.billing-hdr { text-align: center; margin-bottom: 44px; }
.billing-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.billing-subtitle { color: var(--gray-400); margin-bottom: 24px; font-size: 15px; }
.billing-interval-toggle { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 14px; }
.bl-switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.bl-switch input { opacity: 0; width: 0; height: 0; }
.bl-slider { position: absolute; inset: 0; background: var(--gray-200); border-radius: 26px; cursor: pointer; transition: background .2s; }
.bl-slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.bl-switch input:checked + .bl-slider { background: var(--brand); }
.bl-switch input:checked + .bl-slider::before { transform: translateX(20px); }
.billing-active-bar { display: flex; align-items: center; justify-content: space-between; background: #eff6ff; border: 1.5px solid #bfdbfe; border-radius: 12px; padding: 14px 20px; margin-bottom: 32px; font-size: 14px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 780px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card { position: relative; background: #fff; border: 1.5px solid var(--gray-100); border-radius: 18px; padding: 30px 24px 24px; display: flex; flex-direction: column; transition: box-shadow .2s, transform .15s; box-shadow: var(--shadow-xs); }
.pricing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pricing-pop { border-color: var(--brand); box-shadow: 0 4px 20px rgba(79,70,229,.18); }
.pricing-current { border-color: var(--success); }
.pricing-pop-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 16px; border-radius: 20px; white-space: nowrap; box-shadow: 0 2px 8px rgba(79,70,229,.3); }
.pricing-plan-name { font-size: 17px; font-weight: 700; margin-bottom: 18px; letter-spacing: -.01em; }
.pricing-price-row { display: flex; align-items: baseline; gap: 2px; }
.pricing-currency { font-size: 22px; font-weight: 700; color: var(--brand); }
.pricing-amount { font-size: 52px; font-weight: 800; line-height: 1; color: var(--brand); letter-spacing: -.03em; }
.pricing-per { font-size: 14px; color: var(--gray-400); margin-left: 4px; }
.pricing-saving { font-size: 12px; color: var(--success); font-weight: 600; margin-top: 4px; height: 18px; }
.pricing-feat-list { list-style: none; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pricing-feat-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-600); }
.pricing-check { color: var(--brand); font-weight: 700; }
