/* ============================================================
   SocialAI Manager — Core Design System
   Plan • Create • Schedule • Analyze • Grow
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Brand */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-300: #a5b4fc;
  --brand-500: #6366f1;
  --brand-600: #5b5bd6;
  --brand-700: #4f46e5;

  --accent-pink:    #ec4899;
  --accent-violet:  #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber:   #f59e0b;
  --accent-sky:     #0ea5e9;
  --accent-rose:    #f43f5e;

  /* Neutrals (light) */
  --bg:            #f6f7fb;
  --bg-soft:       #eef1f8;
  --surface:       #ffffff;
  --surface-2:     #f8f9fc;
  --surface-glass: rgba(255, 255, 255, 0.65);
  --border:        #e6e8f0;
  --border-strong: #d3d7e6;

  --text:          #1a1c2c;
  --text-soft:     #4a4e69;
  --text-muted:    #6b7280;

  --shadow-sm: 0 1px 2px rgba(20, 23, 50, 0.06), 0 1px 3px rgba(20, 23, 50, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 23, 50, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 23, 50, 0.12);

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
  --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);

  --header-h: 72px;
  --sidebar-w: 264px;
  --container-x: 1.5rem;

  --transition: 200ms cubic-bezier(.4, .14, .3, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg:            #0c0e1a;
  --bg-soft:       #111426;
  --surface:       #151829;
  --surface-2:     #1b1f33;
  --surface-glass: rgba(24, 28, 48, 0.55);
  --border:        #262a40;
  --border-strong: #33384f;

  --text:          #eef1ff;
  --text-soft:     #c3c8e0;
  --text-muted:    #8b91ad;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);

  --gradient-soft: linear-gradient(135deg, #151829 0%, #1b1233 100%);
  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5 {
  font-family: 'Sora', 'Inter', sans-serif;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--brand-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-700); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: rgba(99, 102, 241, 0.25); }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-500); }

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--brand-600);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 10px;
  z-index: 2000;
  transition: top var(--transition);
}
.skip-link:focus { top: 1rem; color: #fff; }

:focus-visible { outline: 3px solid rgba(99, 102, 241, .55); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout helpers ---------- */
.container-xl { padding-inline: var(--container-x); }
.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.muted { color: var(--text-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand-600);
  background: var(--brand-50);
  padding: .4rem .8rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
[data-theme="dark"] .eyebrow { background: rgba(99, 102, 241, .12); color: var(--brand-300); }
.eyebrow i { color: var(--accent-pink); }

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-head { max-width: 720px; }
.section-title { font-size: clamp(1.9rem, 4vw, 3rem); margin: 0 0 .75rem; }
.section-sub { color: var(--text-muted); font-size: 1.05rem; }

.muted-label {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Glass surface ---------- */
.glass {
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; transition: all var(--transition); }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }

.btn-primary-gradient {
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  box-shadow: 0 8px 22px rgba(99, 102, 241, .35);
}
.btn-primary-gradient:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(139, 92, 246, .45); }

.btn-outline-soft {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-outline-soft:hover { background: var(--surface-2); color: var(--text); border-color: var(--brand-500); }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: none;
  font-weight: 600;
}
.btn-ghost:hover { color: var(--brand-600); background: var(--brand-50); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(99, 102, 241, .12); }

.btn-icon {
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--brand-600); border-color: var(--brand-500); transform: translateY(-1px); }

/* ---------- Header / Navbar ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.site-header.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.navbar { padding-block: .65rem; }
.navbar-brand { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--text); }
.navbar-brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .4);
}
.brand-accent { color: var(--accent-pink); }

.navbar-nav .nav-link {
  color: var(--text-soft);
  font-weight: 500;
  padding: .5rem .9rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: var(--brand-600); background: var(--brand-50); }
[data-theme="dark"] .navbar-nav .nav-link:hover,
[data-theme="dark"] .navbar-nav .nav-link.active { background: rgba(99, 102, 241, .14); color: var(--brand-300); }

.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .5rem;
  min-width: 220px;
}
.dropdown-item { border-radius: var(--radius-sm); color: var(--text-soft); padding: .55rem .75rem; }
.dropdown-item:hover { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .dropdown-item:hover { background: rgba(99,102,241,.14); color: var(--brand-300); }

.navbar-toggler {
  border: 1px solid var(--border-strong);
  padding: .45rem .55rem;
  border-radius: var(--radius-sm);
  display: inline-flex; flex-direction: column; gap: 4px;
  background: transparent;
}
.navbar-toggler:focus { box-shadow: none; }
.toggler-bar { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .5;
  animation: floatBlob 14s ease-in-out infinite;
}
.blob-1 { width: 420px; height: 420px; background: #6366f1; top: -120px; right: -80px; }
.blob-2 { width: 380px; height: 380px; background: #ec4899; bottom: -140px; left: -100px; animation-delay: -4s; }
.blob-3 { width: 300px; height: 300px; background: #8b5cf6; top: 40%; left: 45%; animation-delay: -8s; }
[data-theme="dark"] .blob { opacity: .32; }

.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%);
  opacity: .35;
}

.hero-title { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; letter-spacing: -.02em; margin: 1rem 0; }
.hero-sub { font-size: 1.15rem; color: var(--text-soft); max-width: 560px; }

.hero-trust { font-size: .9rem; }
.trust-avatars span {
  display: inline-block;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: var(--gradient-brand);
  margin-left: -12px;
}
.trust-avatars span:nth-child(2) { background: linear-gradient(135deg,#34d399,#22d3ee); }
.trust-avatars span:nth-child(3) { background: linear-gradient(135deg,#fbbf24,#fb7185); }
.trust-avatars span:nth-child(4) { background: linear-gradient(135deg,#0ea5e9,#6366f1); }
.trust-stars { color: #f59e0b; font-size: .8rem; letter-spacing: 2px; }

/* Hero preview mock */
.hero-preview { position: relative; padding: 1rem; }
.preview-window { border-radius: var(--radius-lg); overflow: hidden; padding: 0; }
.preview-bar {
  display: flex; align-items: center; gap: .4rem;
  padding: .7rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.preview-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.preview-url {
  margin-left: .8rem; font-size: .78rem; color: var(--text-muted);
  background: var(--bg-soft); padding: .25rem .7rem; border-radius: var(--radius-pill);
}
.preview-body { display: grid; grid-template-columns: 90px 1fr; min-height: 320px; }
.pv-side { background: var(--surface-2); padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.pv-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--gradient-brand); margin-bottom: .5rem; }
.pv-line { height: 9px; border-radius: 6px; background: var(--border-strong); }
.w-50 { width: 50%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-90 { width: 90%; }
.pv-main { padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.pv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.pv-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem; display: flex; flex-direction: column; gap: .5rem;
}
.pv-icon { width: 28px; height: 28px; border-radius: 8px; }
.pv-icon.ig { background: linear-gradient(135deg,#f58529,#dd2a7b,#8134af); }
.pv-icon.fb { background: #1877f2; }
.pv-icon.li { background: #0a66c2; }
.pv-card b { font-family: 'Sora'; font-size: 1.1rem; }
.pv-chart { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; flex: 1; }
.pv-bars { display: flex; align-items: flex-end; gap: .6rem; height: 120px; }
.pv-bars span {
  flex: 1; height: var(--h); border-radius: 8px 8px 0 0;
  background: var(--gradient-brand); opacity: .85;
  animation: barGrow 1.4s var(--ease-out) both;
}
.pv-list { display: flex; flex-direction: column; gap: .6rem; }

.preview-badge {
  position: absolute;
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .85rem;
  border-radius: var(--radius-pill);
  font-size: .8rem; font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: floatY 5s ease-in-out infinite;
}
.preview-badge i { color: var(--brand-600); }
.badge-1 { top: 8%; right: -4px; }
.badge-2 { bottom: 22%; left: -18px; animation-delay: -1.5s; }
.badge-3 { bottom: 4%; right: 6%; animation-delay: -3s; }

/* ---------- Networks strip ---------- */
.networks { padding-block: 2.5rem; }
.networks-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 2rem;
}
.networks-row .net {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--text-muted); font-weight: 600; font-size: 1.05rem;
  opacity: .8; transition: all var(--transition);
}
.networks-row .net:hover { color: var(--brand-600); opacity: 1; transform: translateY(-2px); }
.networks-row .net i { font-size: 1.4rem; }

/* ---------- Stats ---------- */
.stats { padding-block: 2rem 3.5rem; }
.stat-card { border-radius: var(--radius-lg); padding: 1.8rem 1rem; text-align: center; }
.stat-num { font-family: 'Sora'; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.stat-label { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }

/* ---------- Feature cards ---------- */
.feature-card {
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  height: 100%;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.ic-indigo { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.ic-pink    { background: linear-gradient(135deg,#ec4899,#f472b6); }
.ic-emerald { background: linear-gradient(135deg,#10b981,#34d399); }
.ic-amber   { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.ic-sky     { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }
.ic-violet  { background: linear-gradient(135deg,#8b5cf6,#a78bfa); }
.feature-card h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.feature-card p { color: var(--text-muted); }
.feature-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .4rem; }
.feature-list li { font-size: .9rem; color: var(--text-soft); display: flex; align-items: center; gap: .5rem; }
.feature-list i { color: var(--accent-emerald); }

/* ---------- Showcase ---------- */
.showcase-mock { border-radius: var(--radius-lg); padding: 1.2rem; }
.sc-head { display: flex; gap: .5rem; margin-bottom: 1rem; }
.sc-tab {
  padding: .4rem .9rem; border-radius: var(--radius-pill);
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border);
}
.sc-tab.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.sc-row { display: flex; gap: .5rem; margin-bottom: 1rem; }
.sc-chip {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); font-size: 1.1rem;
}
.sc-editor { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: grid; gap: .6rem; }
.sc-line { height: 11px; border-radius: 6px; background: var(--border-strong); }
.sc-foot { display: flex; gap: .6rem; margin-top: 1rem; }
.sc-btn { padding: .5rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .85rem; }
.sc-btn.primary { background: var(--gradient-brand); color: #fff; }
.sc-btn.ghost { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }

.steps { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.1rem; }
.steps li { display: flex; gap: 1rem; align-items: flex-start; }
.step-num {
  flex: none; width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-50); color: var(--brand-700);
  font-family: 'Sora'; font-weight: 700;
}
[data-theme="dark"] .step-num { background: rgba(99,102,241,.16); color: var(--brand-300); }
.steps h4 { margin: 0 0 .15rem; font-size: 1.05rem; }
.steps p { margin: 0; font-size: .92rem; }

/* ---------- Pricing ---------- */
.billing-toggle {
  position: relative;
  display: inline-flex;
  margin-top: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: .3rem;
}
.billing-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.billing-toggle label {
  position: relative; z-index: 2;
  padding: .5rem 1.3rem; border-radius: var(--radius-pill);
  font-weight: 600; color: var(--text-muted); cursor: pointer;
  transition: color var(--transition);
}
.billing-toggle input:checked + label { color: #fff; }
.billing-toggle::before {
  content: ""; position: absolute; z-index: 1;
  top: .3rem; bottom: .3rem; left: .3rem; width: calc(50% - .3rem);
  background: var(--gradient-brand); border-radius: var(--radius-pill);
  transition: transform var(--transition);
}
#billYearly:checked ~ label[for="billMonthly"] { color: var(--text-muted); }
.billing-toggle:has(#billYearly:checked)::before { transform: translateX(100%); }
.save-tag {
  position: absolute; top: -10px; right: -64px;
  background: var(--accent-emerald); color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: var(--radius-pill);
}

.price-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex; flex-direction: column;
}
.price-card.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--gradient-brand) border-box;
  transform: translateY(-6px);
}
.ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--gradient-brand); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em;
  padding: .35rem .9rem; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
}
.price-card h3 { font-size: 1.3rem; }
.price { display: flex; align-items: baseline; gap: .25rem; margin-top: .5rem; }
.price .amount { font-family: 'Sora'; font-size: 2.6rem; font-weight: 800; }
.price .per { color: var(--text-muted); }
.price-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.price-list li { display: flex; align-items: center; gap: .6rem; color: var(--text-soft); font-size: .94rem; }
.price-list i { color: var(--accent-emerald); }

/* ---------- Testimonials ---------- */
.testimonial { border-radius: var(--radius-lg); padding: 1.6rem; height: 100%; }
.testimonial .stars { color: #f59e0b; margin-bottom: .8rem; }
.testimonial blockquote { margin: 0 0 1rem; font-size: 1.02rem; color: var(--text); line-height: 1.6; }
.t-author { display: flex; align-items: center; gap: .75rem; }
.t-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.t-author strong { display: block; font-size: .95rem; }
.t-author small { color: var(--text-muted); }

/* ---------- Stories ---------- */
.story { border-radius: var(--radius-lg); padding: 2rem; text-align: center; height: 100%; }
.story-num { font-family: 'Sora'; font-size: 2.6rem; font-weight: 800; }

/* ---------- FAQ ---------- */
.faq .accordion { border-radius: var(--radius-lg); padding: .5rem 1rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q { margin: 0; }
.faq-btn {
  width: 100%; text-align: left; background: none; border: none;
  padding: 1.2rem .25rem; font-size: 1.05rem; font-weight: 600; color: var(--text);
  display: flex; align-items: center;
}
.faq-btn i { transition: transform var(--transition); color: var(--text-muted); }
.faq-btn:not(.collapsed) i { transform: rotate(180deg); }
.faq-a { padding-bottom: 1.2rem; color: var(--text-muted); }

/* ---------- Newsletter / CTA ---------- */
.cta-banner {
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  background:
    radial-gradient(ellipse at top left, rgba(99,102,241,.15), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(236,72,153,.15), transparent 60%),
    var(--surface-glass);
}
.cta-banner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta-banner p { color: var(--text-soft); margin: .5rem auto 1.5rem; max-width: 520px; }
.newsletter-form { display: flex; gap: .5rem; max-width: 460px; margin: 0 auto; flex-wrap: wrap; }
.newsletter-form .form-control {
  flex: 1; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
}
.newsletter-form .form-control:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(99,102,241,.15); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-block: 3.5rem 1.5rem; margin-top: 2rem; }
.foot-title { font-size: .95rem; margin-bottom: 1rem; }
.foot-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.foot-links a { color: var(--text-muted); font-size: .92rem; }
.foot-links a:hover { color: var(--brand-600); }
.social-links { display: flex; gap: .6rem; margin-top: 1.2rem; }
.social-links a {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-soft);
  border: 1px solid var(--border); transition: all var(--transition);
}
.social-links a:hover { color: #fff; background: var(--gradient-brand); border-color: transparent; transform: translateY(-2px); }
.foot-divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0 1.5rem; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1100;
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---------- Theme toggle icon swap ---------- */
[data-theme="dark"] .theme-toggle i::before { content: "\f185"; } /* sun */

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1200;
  display: flex; flex-direction: column; gap: .6rem; max-width: 360px;
}
.toast-item {
  display: flex; align-items: center; gap: .7rem;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--brand-500);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn .35s var(--ease-out) both;
}
.toast-item.success { border-left-color: var(--accent-emerald); }
.toast-item.error   { border-left-color: var(--accent-rose); }
.toast-item i { font-size: 1.1rem; }
.toast-item.success i { color: var(--accent-emerald); }
.toast-item.error i { color: var(--accent-rose); }
.toast-item.info i { color: var(--brand-500); }
.toast-item.hide { animation: toastOut .3s ease forwards; }
.toast-text { flex: 1; font-size: .9rem; color: var(--text); }
.toast-close { margin-left: auto; }
.toast-item .toast-close i { color: var(--text-muted); font-size: .9rem; }

/* ============================================================
   DASHBOARD APP SHELL (sidebar + topbar + content)
   Shared by all authenticated pages
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform var(--transition);
  overflow-y: auto;
}
.app-brand {
  display: flex; align-items: center; gap: .6rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-family: 'Sora'; font-weight: 800; font-size: 1.15rem;
  color: var(--text);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.app-nav { padding: .75rem .6rem; flex: 1; }
.app-nav .nav-group-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); padding: 1rem .75rem .4rem; font-weight: 700;
}
.app-nav a {
  display: flex; align-items: center; gap: .8rem;
  padding: .65rem .8rem; margin-bottom: .15rem;
  border-radius: var(--radius-sm);
  color: var(--text-soft); font-weight: 500; font-size: .94rem;
  transition: all var(--transition);
}
.app-nav a i { width: 20px; text-align: center; font-size: 1rem; color: var(--text-muted); }
.app-nav a:hover { background: var(--surface-2); color: var(--text); }
.app-nav a:hover i { color: var(--brand-500); }
.app-nav a.active {
  background: var(--brand-50); color: var(--brand-700); font-weight: 600;
}
[data-theme="dark"] .app-nav a.active { background: rgba(99,102,241,.16); color: var(--brand-300); }
.app-nav a.active i { color: var(--brand-600); }
.app-nav a .badge-nav {
  margin-left: auto; font-size: .7rem; font-weight: 700;
  background: var(--gradient-brand); color: #fff; padding: .1rem .45rem; border-radius: var(--radius-pill);
}

.app-side-footer { padding: 1rem; border-top: 1px solid var(--border); }
.upgrade-card {
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem; text-align: center;
}
.upgrade-card i { font-size: 1.4rem; color: var(--accent-pink); }
.upgrade-card h4 { font-size: 1rem; margin: .5rem 0 .25rem; }
.upgrade-card p { font-size: .82rem; color: var(--text-muted); margin: 0 0 .75rem; }

/* Main column */
.app-main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-width: 0;
}
.app-topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--header-h);
  display: flex; align-items: center; gap: 1rem;
  padding-inline: 1.5rem;
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.app-topbar .sidebar-toggle { display: none; }
.topbar-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: .5rem .9rem;
}
.topbar-search input { background: none; border: none; outline: none; color: var(--text); width: 100%; font-size: .92rem; }
.topbar-search i { color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.topbar-actions .btn-icon { width: 40px; height: 40px; }
.topbar-user {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .6rem .3rem .35rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer;
}
.topbar-user .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.topbar-user .u-meta { line-height: 1.1; }
.topbar-user .u-meta strong { font-size: .85rem; display: block; }
.topbar-user .u-meta small { color: var(--text-muted); font-size: .72rem; }

.app-content { padding: 1.5rem; flex: 1; }

/* Breadcrumb */
.crumb { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--brand-600); }
.crumb .sep { opacity: .5; }
.crumb .current { color: var(--text); font-weight: 600; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: .92rem; margin: .15rem 0 0; }
.page-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Cards */
.card-soft {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-body-soft { padding: 1.25rem; }

/* KPI cards */
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .4rem;
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }
.kpi-label { color: var(--text-muted); font-size: .85rem; font-weight: 500; }
.kpi-value { font-family: 'Sora'; font-size: 1.8rem; font-weight: 800; line-height: 1; }
.kpi-delta { font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; }
.kpi-delta.up { color: var(--accent-emerald); }
.kpi-delta.down { color: var(--accent-rose); }

/* Sidebar overlay (mobile) */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(8, 10, 25, .5);
  backdrop-filter: blur(2px); z-index: 1035; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* Generic utilities reused across app pages */
.list-row {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 0; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }

.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 600; padding: .25rem .55rem;
  border-radius: var(--radius-pill);
}
.tag-soft { background: var(--surface-2); color: var(--text-soft); border: 1px solid var(--border); }
.tag-success { background: rgba(16,185,129,.14); color: var(--accent-emerald); }
.tag-warn    { background: rgba(245,158,11,.14); color: var(--accent-amber); }
.tag-info    { background: rgba(14,165,233,.14); color: var(--accent-sky); }
.tag-danger  { background: rgba(244,63,94,.14); color: var(--accent-rose); }

.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.section-card .card-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.section-card .card-head h3 { font-size: 1.05rem; margin: 0; }
.section-card .card-body-pad { padding: 1.25rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 2.4rem; margin-bottom: .8rem; color: var(--border-strong); }

/* Form controls (dark-aware) */
.form-control, .form-select {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
  background: var(--surface); color: var(--text);
  border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-muted); }
.form-label { font-weight: 600; font-size: .88rem; color: var(--text-soft); margin-bottom: .35rem; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
