@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --ink: #1d1533;
  --muted: #746b8a;
  --bg: #f7f5fb;
  --card: #ffffff;
  --line: #e9e4f2;
  --brand: #7c3aed;
  --brand-dark: #5b21b6;
  --brand-soft: #f3ecff;
  --pink: #ec4899;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --sidebar: #1d1533;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(29, 21, 51, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; letter-spacing: -0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 14px; }
small, .muted { color: var(--muted); }
code { background: var(--brand-soft); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; color: var(--brand-dark); }

.container { width: min(1180px, 92%); margin: 0 auto; }
.section { padding: 76px 0; }
.section.alt { background: #fff; }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; font-size: 0.76rem; color: var(--brand); margin-bottom: 12px; }
.gradient-text { background: linear-gradient(100deg, var(--brand), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Marketing */
.topnav { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topnav .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: 'Plus Jakarta Sans'; font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--pink)); display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.logo-stack { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.powered-by { font-family: 'DM Sans', system-ui, sans-serif; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-left: 46px; line-height: 1.2; }
.auth-art .powered-by, .sidebar .powered-by { color: rgba(255,255,255,.7); }
.vendor-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 32px; }
.vendor-chip { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 52px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-weight: 600; font-size: .9rem; color: var(--ink); box-shadow: var(--shadow); }
.reset-dev-link { margin-top: 18px; padding: 14px; border: 1px dashed var(--amber); border-radius: 12px; background: #fffbeb; font-size: .85rem; }
.reset-dev-link p { margin: 6px 0; }
.reset-dev-link a { word-break: break-all; }
.password-wrap { display: flex; align-items: center; gap: 8px; }
.password-wrap input { flex: 1; min-width: 0; }
.password-toggle { flex: 0 0 auto; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); cursor: pointer; }
.password-toggle svg { width: 19px; height: 19px; }
.password-toggle:hover { background: #f6f3ff; border-color: #ddd0ff; color: var(--brand); }
.password-toggle:focus-visible { outline: 2px solid #ddd0ff; border-color: var(--brand); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--ink); font-weight: 600; font-size: 0.92rem; }

.hero { padding: 96px 0 70px; background: radial-gradient(900px 420px at 85% 10%, #f3e8ff 0%, transparent 70%), radial-gradient(600px 400px at 5% 40%, #fce7f3 0%, transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-proof { display: flex; gap: 28px; margin-top: 38px; flex-wrap: wrap; }
.hero-proof div strong { display: block; font-family: 'Plus Jakarta Sans'; font-size: 1.35rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; padding: 13px 22px; font-weight: 700; font-size: 0.95rem; cursor: pointer; font-family: inherit; transition: transform .15s ease, box-shadow .15s ease; text-decoration: none; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; box-shadow: 0 8px 20px rgba(124,58,237,.25); }
.btn-pink { background: linear-gradient(135deg, var(--pink), #be185d); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-sm { padding: 8px 14px; font-size: 0.84rem; border-radius: 9px; }
.btn-danger { background: #fee2e2; color: var(--red); }

.phone { background: #1f2937; border-radius: 38px; padding: 12px; box-shadow: 0 30px 70px rgba(29,21,51,.25); max-width: 360px; margin: 0 auto; }
.phone-screen { background: #e5ddd5; border-radius: 28px; min-height: 470px; padding: 22px 16px; position: relative; overflow: hidden; }
.phone-bar { color: #fff; font-size: 0.78rem; display: flex; justify-content: space-between; margin-bottom: 16px; opacity: .9; }
.bubble { background: #fff; border-radius: 12px 12px 12px 3px; padding: 12px 14px; margin-bottom: 10px; font-size: 0.86rem; box-shadow: 0 2px 6px rgba(0,0,0,.08); max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.bubble.bot { background: #fff; }
.bubble.user { background: #d9fdd3; margin-left: auto; border-radius: 12px 12px 3px 12px; }
.bubble a { color: var(--brand-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bubble .quick { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #d8c7ff; border-radius: 20px; padding: 5px 10px; margin: 6px 5px 0 0; font-size: 0.76rem; cursor: pointer; font-weight: 600; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.feature-card, .price-card, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 16px; }
.price-card.popular { border: 2px solid var(--brand); position: relative; }
.price-badge { position: absolute; top: -13px; right: 20px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; }
.price { font-family: 'Plus Jakarta Sans'; font-size: 2rem; font-weight: 800; }
.price span { font-size: .85rem; color: var(--muted); font-family: 'DM Sans'; font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 22px; }
.price-card li { padding: 6px 0 6px 24px; position: relative; font-size: .92rem; }
.price-card li:before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 58px; margin-bottom: 28px; }
.step:before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.cta-band { background: linear-gradient(120deg, var(--brand-dark), var(--brand) 55%, var(--pink)); color: #fff; border-radius: 24px; padding: 46px; text-align: center; }
.cta-band p { color: rgba(255,255,255,.85); }
footer { background: var(--sidebar); color: #cbc3dd; padding: 40px 0; font-size: .9rem; }
footer a { color: #e9d5ff; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: linear-gradient(150deg, #2e1065, #7c3aed 60%, #db2777); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; }
.auth-art h2 { font-size: 2.6rem; }
.auth-form-side { display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: min(440px, 100%); }

/* App shell */
.app-shell { display: grid; grid-template-columns: 242px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: #d8d0e8; padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { color: #fff; padding: 4px 8px 0; }
.sidebar .powered-by { padding-left: 8px; margin-bottom: 20px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; color: #d8d0e8; font-weight: 600; font-size: .9rem; margin-bottom: 3px; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar .store-pill { background: rgba(255,255,255,.08); border-radius: 12px; padding: 12px; margin-top: 22px; font-size: .82rem; }
.sidebar .store-pill strong { display: block; color: #fff; font-size: .95rem; }
.main { padding: 30px 34px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar h1 { font-size: 1.7rem; margin: 0; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: .74rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-dark); text-transform: capitalize; }
.badge.paid, .badge.active, .badge.delivered { background: #d1fae5; color: var(--green); }
.badge.pending { background: #fef3c7; color: var(--amber); }
.badge.cancelled, .badge.suspended, .badge.past_due { background: #fee2e2; color: var(--red); }
.badge.trial { background: #e0e7ff; color: #4338ca; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.stat .value { font-family: 'Plus Jakarta Sans'; font-size: 1.75rem; font-weight: 800; margin-top: 6px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; background: #faf8fe; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; padding: 13px 16px; }
td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fcfbff; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }

form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: .92rem; font-family: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #ddd0ff; border-color: var(--brand); }
textarea { min-height: 88px; resize: vertical; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }

.variant-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.import-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.import-panel { display: grid; gap: 12px; }
.import-panel[hidden] { display: none; }
.import-panel textarea { width: 100%; font-family: ui-monospace, monospace; font-size: .85rem; }
.product-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; vertical-align: middle; }
.connect-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.connect-status { padding: 10px 0; border-top: 1px solid var(--line); }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--pink); }

.chat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; height: 560px; overflow: hidden; box-shadow: var(--shadow); }
.chat-head { background: var(--brand); color: #fff; padding: 14px 18px; font-weight: 700; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; background: #faf8fe; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; }
.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.quick-replies button { border: 1px solid #d8c7ff; background: var(--brand-soft); color: var(--brand-dark); border-radius: 20px; padding: 6px 12px; font-size: .78rem; cursor: pointer; font-weight: 600; }

.toast { position: fixed; right: 22px; bottom: 22px; background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 12px; z-index: 100; box-shadow: 0 12px 30px rgba(0,0,0,.25); max-width: 380px; }
.toast.error { background: var(--red); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .hero-grid, .grid-3, .grid-2, .auth-wrap { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .main { padding: 22px 16px 50px; }
  .nav-links a:not(.btn) { display: none; }
  .auth-art { display: none; }
  .variant-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .vendor-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .vendor-chip { min-height: 50px; padding: 10px 8px; font-size: .82rem; border-radius: 12px; }
}
