:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #635bff;
  --primary-dark: #4f46e5;
  --accent: #8b5cf6;
  --danger: #ef4444;
  --success: #16a34a;
  --border: #e2e8f0;
  --shadow: 0 22px 70px rgba(15, 23, 42, .08);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(99,91,255,.16), transparent 34%),
    radial-gradient(circle at bottom left, rgba(139,92,246,.12), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 286px; padding: 22px; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 13px; padding: 16px; border-radius: var(--radius); background: rgba(255,255,255,.78); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.brand.mini { padding: 10px 12px; box-shadow: none; background: rgba(255,255,255,.7); }
.brand-mark, .auth-logo { width: 48px; height: 48px; border-radius: 17px; display: grid; place-items: center; color: white; font-weight: 900; font-size: 22px; background: linear-gradient(135deg, #111827, #635bff, #8b5cf6); }
.auth-logo { margin: 0 auto 18px; }
.brand strong { display: block; font-size: 18px; }
.brand span { display: block; color: var(--muted); font-size: 12px; }
.side-nav { margin-top: 20px; padding: 12px; border-radius: var(--radius); background: rgba(255,255,255,.72); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.side-nav a { display: flex; align-items: center; padding: 13px 14px; border-radius: 15px; color: #334155; font-weight: 700; margin-bottom: 5px; }
.side-nav a:hover, .side-nav a.active { background: #eef2ff; color: var(--primary-dark); }
.nav-label { color: #94a3b8; font-size: 12px; font-weight: 900; padding: 14px 14px 6px; }
.main { flex: 1; padding: 28px 28px 60px; max-width: 1320px; }
.main.full { max-width: none; width: 100%; padding: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.topbar h1 { margin: 0 0 5px; font-size: 30px; letter-spacing: -1px; }
.topbar p { margin: 0; color: var(--muted); }
.user-chip { background: rgba(255,255,255,.76); padding: 12px 16px; border-radius: 18px; box-shadow: var(--shadow); text-align: left; }
.user-chip span { display: block; font-weight: 800; }
.user-chip small { color: var(--muted); }
.grid { display: grid; gap: 20px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0,1fr)); margin-bottom: 20px; }
.cards-4 { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 20px; }
.two-col { grid-template-columns: 430px 1fr; align-items: start; }
.metric-card, .panel, .connect-hero, .account-card, .empty-card { background: rgba(255,255,255,.84); backdrop-filter: blur(20px); border: 1px solid rgba(226,232,240,.82); box-shadow: var(--shadow); border-radius: var(--radius); }
.metric-card { padding: 24px; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; left: -38px; top: -38px; width: 110px; height: 110px; background: linear-gradient(135deg, rgba(99,91,255,.22), rgba(139,92,246,.20)); border-radius: 40px; transform: rotate(18deg); }
.metric-card span { color: var(--muted); font-weight: 700; }
.metric-card strong { display: block; font-size: 38px; margin-top: 8px; letter-spacing: -1px; }
.metric-card small { color: var(--muted); }
.panel { padding: 24px; margin-bottom: 20px; }
.panel.narrow { max-width: 760px; }
.gradient-panel { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(245,243,255,.9)); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.panel-head h2, .section-head h2 { margin: 0 0 5px; font-size: 22px; }
.panel-head p, .section-head p { margin: 0; color: var(--muted); }
.section-head.center { text-align: center; max-width: 780px; margin: 0 auto 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 15px; padding: 12px 18px; font-family: inherit; font-weight: 900; cursor: pointer; transition: transform .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: white; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 14px 34px rgba(99,91,255,.28); }
.btn.instagram { color: white; background: linear-gradient(135deg, #f97316, #e11d48, #7c3aed); box-shadow: 0 14px 34px rgba(225,29,72,.22); font-size: 16px; padding: 15px 24px; }
.btn.ghost { background: #f8fafc; border: 1px solid var(--border); color: #334155; }
.btn.full { width: 100%; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.step { padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.step.done { background: #ecfdf5; border-color: #bbf7d0; }
.step b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: white; color: var(--primary); margin-bottom: 10px; }
.step span { font-weight: 800; color: #334155; }
.form label { display: block; margin: 14px 0 7px; color: #334155; font-weight: 900; }
.form input, .form textarea, .form select, .filters input, .filters select, .mini-form input, .mini-form select { width: 100%; border: 1px solid var(--border); background: white; border-radius: 15px; padding: 13px 14px; font-family: inherit; color: var(--text); outline: none; }
.form input:focus, .form textarea:focus, .form select:focus, .filters input:focus, .filters select:focus, .mini-form input:focus, .mini-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,91,255,.12); }
.switch-row { display: flex !important; align-items: center; gap: 10px; }
.switch-row input { width: auto; }
.filters { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin-bottom: 16px; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 14px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
th { color: #475569; background: #f8fafc; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.wide-text { min-width: 260px; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; background: #eef2ff; color: #4338ca; }
.status.out { background: #ecfdf5; color: #166534; }
.auth-body { display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(430px, 100%); padding: 34px; border-radius: 30px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); border: 1px solid rgba(226,232,240,.86); backdrop-filter: blur(24px); }
.auth-card h1 { text-align: center; margin: 0; font-size: 26px; }
.auth-card p { text-align: center; margin: 8px 0 24px; color: var(--muted); }
.auth-hint { margin-top: 16px; background: #f8fafc; color: var(--muted); padding: 12px; border-radius: 15px; text-align: center; font-size: 13px; line-height: 1.8; }
.auth-hint a { color: var(--primary-dark); font-weight: 900; }
.toast { padding: 13px 15px; border-radius: 16px; margin-bottom: 16px; border: 1px solid transparent; font-weight: 800; }
.toast.success { background: #dcfce7; border-color: #bbf7d0; color: #166534; }
.toast.danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.connect-hero { padding: 30px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: linear-gradient(135deg, rgba(255,255,255,.86), rgba(255,255,255,.70)), radial-gradient(circle at 10% 20%, rgba(249,115,22,.20), transparent 25%), radial-gradient(circle at 90% 30%, rgba(124,58,237,.20), transparent 26%); }
.connect-hero h2 { margin: 10px 0 8px; font-size: 28px; }
.connect-hero p { color: var(--muted); max-width: 720px; line-height: 1.9; margin: 0; }
.badge { display: inline-flex; padding: 6px 11px; border-radius: 999px; background: #eef2ff; color: var(--primary-dark); font-weight: 900; font-size: 12px; }
.badge.gray { background: #f1f5f9; color: #64748b; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.account-card { padding: 16px; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; }
.account-card.muted { opacity: .58; }
.avatar { width: 58px; height: 58px; border-radius: 20px; background: linear-gradient(135deg, #111827, #635bff, #8b5cf6); display: grid; place-items: center; overflow: hidden; color: white; font-weight: 900; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-card h3 { margin: 0 0 4px; }
.account-card p { margin: 0 0 2px; color: var(--muted); }
.account-card small { color: #94a3b8; }
.empty-card { padding: 22px; color: var(--muted); text-align: center; }
.list { display: grid; gap: 12px; }
.list-item { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 15px; display: flex; justify-content: space-between; gap: 14px; }
.list-item b { font-size: 17px; }
.list-item p { margin: 6px 0; color: #475569; line-height: 1.8; }
.list-item small { color: var(--muted); }
.actions { display: flex; gap: 12px; align-items: center; font-weight: 900; }
.actions a { color: var(--primary-dark); }
.danger-text { color: var(--danger) !important; }
.lead-grid, .template-grid, .plan-grid, .feature-grid { display: grid; gap: 16px; }
.lead-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.template-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.plan-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.feature-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.lead-card, .template-card, .plan-card, .feature-grid article { background: white; border: 1px solid var(--border); border-radius: 22px; padding: 20px; box-shadow: 0 14px 40px rgba(15,23,42,.05); }
.lead-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.lead-head b, .lead-head span { display: block; }
.lead-head span, .lead-meta, .lead-card p, .template-card p, .plan-card p, .feature-grid p { color: var(--muted); line-height: 1.8; }
.lead-head em { background: #eef2ff; color: #4338ca; border-radius: 999px; padding: 5px 10px; font-style: normal; font-size: 12px; font-weight: 900; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lead-meta span { background: #f8fafc; border-radius: 999px; padding: 5px 9px; font-size: 12px; }
.mini-form { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; }
.template-card h3, .plan-card h3 { margin: 10px 0; }
.template-card b { display: block; margin-bottom: 8px; }
.plan-card strong { display: block; font-size: 26px; margin: 8px 0 14px; }
.plan-card.featured { border-color: #c4b5fd; background: linear-gradient(180deg, #fff, #f5f3ff); }
.plan-card ul { padding: 0 18px 0 0; color: #475569; line-height: 2; }
.copy-list { display: grid; gap: 12px; }
.copy-list > div { background: white; border: 1px solid var(--border); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; }
.copy-list code { direction: ltr; text-align: left; background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 12px; overflow: auto; }
.note-box { margin-top: 16px; padding: 16px; border-radius: 18px; background: #fff7ed; color: #9a3412; line-height: 1.9; }
.public-body { background: linear-gradient(135deg, #0f172a 0%, #111827 45%, #312e81 100%); color: white; }
.public-nav { width: min(1160px, calc(100% - 40px)); margin: 18px auto 0; display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 3; }
.public-nav nav { display: flex; align-items: center; gap: 18px; color: #e2e8f0; font-weight: 800; }
.public-nav .brand { color: #0f172a; }
.hero { width: min(1160px, calc(100% - 40px)); margin: 48px auto; display: grid; grid-template-columns: 1fr 430px; gap: 36px; align-items: center; }
.hero h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.15; margin: 18px 0; letter-spacing: -2px; }
.hero p { color: #cbd5e1; line-height: 2.1; font-size: 18px; }
.hero-actions { display: flex; gap: 12px; margin: 28px 0; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-points span { background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); padding: 9px 12px; border-radius: 999px; color: #e2e8f0; font-weight: 800; }
.hero-card { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.14); border-radius: 32px; padding: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.25); backdrop-filter: blur(16px); }
.fake-window { background: #fff; color: #0f172a; border-radius: 24px; padding: 20px; }
.fake-dots { display: flex; gap: 6px; }
.fake-dots i { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.chat-row { padding: 14px; border-radius: 18px; margin: 12px 0; line-height: 1.8; }
.chat-row.in { background: #f1f5f9; margin-left: 45px; }
.chat-row.out { background: #eef2ff; color: #3730a3; margin-right: 45px; }
.lead-box { background: #ecfdf5; color: #166534; padding: 12px; border-radius: 16px; font-weight: 900; }
.public-section { width: min(1160px, calc(100% - 40px)); margin: 40px auto; color: #0f172a; background: rgba(255,255,255,.96); border-radius: 34px; padding: 34px; }
.public-section .feature-grid article { box-shadow: none; }
@media (max-width: 1100px) {
  .sidebar { width: 240px; }
  .cards-4, .cards-3, .feature-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col, .hero { grid-template-columns: 1fr; }
  .template-grid, .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: auto; height: auto; position: static; padding: 14px; }
  .side-nav { display: grid; grid-template-columns: repeat(2, 1fr); }
  .main { padding: 16px; }
  .topbar, .panel-head, .connect-hero, .public-nav { flex-direction: column; align-items: stretch; }
  .cards-4, .cards-3, .steps, .account-grid, .lead-grid, .template-grid, .plan-grid, .feature-grid { grid-template-columns: 1fr; }
  .filters, .mini-form, .copy-list > div { grid-template-columns: 1fr; }
  .account-card { grid-template-columns: 58px 1fr; }
  .hero { margin-top: 28px; }
  .public-nav nav { flex-wrap: wrap; }
}
