/* ═══════════════════════════════════════════════════════════════
   SwisChat by Swismax Solutions — Premium Design System v3.0
   Complete Frontend Redesign — Dark Theme, Red Accent, Glassmorphism
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ─── CSS Variables (Design System) ─── */
:root {
  /* Primary Red System */
  --red:         #dc2626;
  --red2:        #b91c1c;
  --red3:        #ef4444;
  --red4:        #f87171;
  --red-light:   rgba(220, 38, 38, 0.08);
  --red-border:  rgba(220, 38, 38, 0.18);
  --red-glow:    rgba(220, 38, 38, 0.22);

  /* Neutral Dark System */
  --black:       #111111;
  --ink:         #1a1a1a;
  --dark:        #0f0f0f;
  --dark-card:   #141414;
  --dark-2:      #1c1c1c;
  --dark-3:      #222222;
  --mid:         #6b7280;
  --muted:       #9ca3af;

  /* Light System */
  --light:       #f3f4f6;
  --light2:      #e5e7eb;
  --paper:       #fafafa;
  --paper2:      #f8f8f8;
  --white:       #ffffff;

  /* Border System */
  --border:      rgba(0, 0, 0, 0.08);
  --border2:     rgba(0, 0, 0, 0.12);
  --border-dark: rgba(255, 255, 255, 0.08);
  --border-dark2: rgba(255, 255, 255, 0.12);

  /* Gradients */
  --grad:        linear-gradient(135deg, #b91c1c, #dc2626);
  --grad2:       linear-gradient(135deg, #dc2626, #ef4444);
  --grad3:       linear-gradient(135deg, #991b1b, #b91c1c, #dc2626);
  --grad-text:   linear-gradient(120deg, #b91c1c 0%, #dc2626 60%, #f97316 100%);
  --grad-glow:   linear-gradient(135deg, rgba(185, 28, 28, 0.4), rgba(220, 38, 38, 0.1));

  /* Glass */
  --glass:       rgba(255, 255, 255, 0.85);
  --glass-dark:  rgba(17, 17, 17, 0.85);

  /* Spacing */
  --pad:         clamp(16px, 5vw, 80px);
  --max-w:       1200px;
  --nav-h:       64px;

  /* Radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  24px;
  --radius-full: 100px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md:   0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl:   0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-red:  0 4px 24px rgba(220, 38, 38, 0.3);
  --shadow-red-lg: 0 8px 40px rgba(220, 38, 38, 0.35);

  /* Transitions */
  --ease:        0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    0.25s cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Layers */
  --z-dropdown:  100;
  --z-nav:       800;
  --z-modal:     9998;
  --z-toast:     9999;
  --z-widget:    999999;
}

/* ─── KEYFRAME ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  70%      { box-shadow: 0 0 0 10px transparent; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulseOnline {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}
@keyframes scaleIn {
  0%   { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  0%   { opacity: 0; transform: translateY(-10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-30px) scale(1.05); }
}

/* ─── RESET ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;          /* clip (not hidden) so overflow-y stays visible → position:sticky works */
  max-width: 100%;
}
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;          /* clip (not hidden) so sticky descendants aren't trapped in a scroll container */
  width: 100%;
  max-width: 100%;
}
body.dark-theme {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.8);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
}
h1 { font-size: clamp(36px, 5vw, 72px); font-weight: 900; letter-spacing: -2.5px; line-height: 1.0; }
h2 { font-size: clamp(27px, 3.5vw, 52px); letter-spacing: -1.4px; line-height: 1.06; }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200%;
  animation: gradShift 5s ease infinite;
}

/* ─── SECTION LABEL / EYEBROW ─── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-light);
  border: 1px solid var(--red-border);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  white-space: nowrap;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad);
  color: var(--color-text-primary) !important;
  box-shadow: 0 4px 16px var(--red-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--red-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border2);
}
.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: var(--color-text-primary);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: var(--color-text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--ink);
  color: var(--color-text-primary);
}
.btn-secondary:hover {
  background: var(--dark-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: #ef4444;
  color: var(--color-text-primary);
}
.btn-danger:hover { background: #dc2626; }

.btn-sm   { padding: 8px 18px; font-size: 12.5px; border-radius: 8px; }
.btn-lg   { padding: 15px 34px; font-size: 15px; border-radius: var(--radius-md); }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border2);
  background: var(--paper);
  color: var(--mid);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--ease-out);
  font-size: 14px;
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red-border);
}

/* Shimmer effect for buttons */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}
.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2.5s ease-in-out infinite;
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition: all var(--ease);
  height: var(--nav-h);
}
.navbar.dark-nav {
  background: rgba(17, 17, 17, 0.95);
  border-bottom-color: var(--border-dark);
}
.navbar.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}
.navbar.dark-nav.scrolled {
  box-shadow: var(--color-shadow-dropdown);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-red);
}
.nav-logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
}
.navbar.dark-nav .nav-logo-text { color: var(--color-text-primary); }
.nav-logo-text em {
  font-style: normal;
  color: var(--red);
}
.nav-logo-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red-border);
  padding: 2px 7px;
  border-radius: 20px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  color: var(--mid);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--ease-out);
}
.nav-link:hover {
  color: var(--red);
  background: var(--red-light);
}
.nav-link.active,
html[data-theme="light"] .nav-link.active,
html[data-theme="light"] .navbar.dark-nav .nav-link.active,
.navbar.dark-nav .nav-link.active {
  color: var(--red);
  font-weight: 600;
}
.navbar.dark-nav .nav-link {
  color: rgba(255, 255, 255, 0.55);
}
.navbar.dark-nav .nav-link:hover {
  color: var(--red);
  background: rgba(220, 38, 38, 0.1);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: var(--color-text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  transition: all var(--ease-out);
}
.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease-out);
}
.navbar.dark-nav .nav-toggle {
  border-color: var(--border-dark);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
}
.nav-toggle:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ─── MOBILE DRAWER ─── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 899;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 100vw);
  height: 100vh;
  z-index: 900;
  background: #fff;
  box-shadow: -4px 0 40px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}
.mobile-drawer.dark-drawer {
  background: #111;
}
.mobile-drawer.open {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer.dark-drawer .drawer-header {
  border-bottom-color: var(--border-dark);
}
.drawer-close {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--mid);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease-out);
}
.mobile-drawer.dark-drawer .drawer-close {
  border-color: var(--border-dark);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
}
.drawer-body {
  padding: 12px;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--mid);
  transition: all var(--ease-out);
}
.drawer-link:hover {
  background: var(--red-light);
  color: var(--red);
}
.mobile-drawer.dark-drawer .drawer-link {
  color: rgba(255,255,255,0.5);
}
.mobile-drawer.dark-drawer .drawer-link:hover {
  background: rgba(220,38,38,0.1);
  color: var(--red);
}
.drawer-link.active,
.mobile-drawer.dark-drawer .drawer-link.active,
html[data-theme="light"] .drawer-link.active,
html[data-theme="light"] .mobile-drawer .drawer-link.active,
html[data-theme="light"] .mobile-drawer.dark-drawer .drawer-link.active {
  color: var(--red);
  background: var(--red-light);
  font-weight: 600;
}
.drawer-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer.dark-drawer .drawer-footer {
  border-top-color: var(--border-dark);
}

/* ─── STICKY BOTTOM BAR ─── */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border-subtle);
  padding: 8px var(--pad);
  display: none;
  align-items: center;
  justify-content: space-around;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.sticky-bottom-bar.visible {
  transform: translateY(0);
}
.sticky-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9.5px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
  white-space: nowrap;
}
.sticky-bar-item:hover { color: var(--red); }
.sticky-bar-item.active,
html[data-theme="light"] .sticky-bar-item.active,
html[data-theme="dark"] .sticky-bar-item.active,
.navbar.dark-nav ~ .sticky-bottom-bar .sticky-bar-item.active {
  color: var(--red) !important;
  background: var(--red-light);
  fill: var(--red);
  stroke: var(--red);
}
.sticky-bar-item.active svg { stroke: var(--red) !important; }
.sticky-bar-item svg { width: 18px; height: 18px; }

/* ─── HERO SECTION (Landing) ─── */
.hero-slider {
  margin: 0 var(--pad);
  margin-top: calc(var(--nav-h) + 16px);
  border-radius: var(--radius-xl);
  height: 78vh;
  min-height: 460px;
  max-height: 820px;
  background: var(--dark);
  position: relative;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: flex-end;
  padding: 48px 56px;
}
.hero-slide.active {
  opacity: 1;
}
.hero-slide-bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.86) 0%, rgba(0,0,0,0.48) 38%, transparent 100%);
}
.hero-slide-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(220,38,38,0.15), transparent 60%);
  pointer-events: none;
}
.hero-slide-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
}
.hero-slide-content > * {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.55s ease forwards;
}
.hero-slide.active .hero-slide-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-slide.active .hero-slide-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-slide.active .hero-slide-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-slide.active .hero-slide-content > *:nth-child(4) { animation-delay: 0.55s; }

.hero-slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(220, 38, 38, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red3);
  margin-bottom: 18px;
}
.hero-slide-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: clamp(26px, 4vw, 58px);
  color: var(--color-text-primary);
  line-height: 1.05;
  margin-bottom: 16px;
}
.hero-slide-title .grad-text {
  display: inline;
}
.hero-slide-sub {
  font-size: clamp(14px, 1.2vw, 16px);
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 460px;
}
.hero-slide-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero Controls */
.hero-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-counter {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}
.hero-arrow:hover {
  background: rgba(220, 38, 38, 0.6);
  color: var(--color-text-primary);
  border-color: var(--red);
}

/* Hero Dots */
.hero-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}
.hero-dot.active {
  width: 28px;
  border-radius: 4px;
  background: var(--grad);
}

/* Hero Progress Bar */
.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.08);
}
.hero-progress-fill {
  height: 100%;
  background: var(--grad);
  width: 0%;
  transition: width 0.1s linear;
}

/* ─── STATS BAR ─── */
.stats-bar {
  margin: -28px var(--pad) 0;
  position: relative;
  z-index: 5;
}
.stats-inner {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(0, 0, 0, 0.07);
  padding: 24px 32px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.stat-item {
  text-align: center;
  padding: 8px 4px;
  position: relative;
  transition: all var(--ease);
  border-radius: var(--radius-sm);
}
.stat-item:hover {
  background: var(--paper);
}
.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--grad);
  border-radius: 0 0 4px 4px;
  transform: scaleX(0);
  transition: transform 0.3s;
}
.stat-item:hover::before {
  transform: scaleX(1);
}
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: clamp(18px, 1.6vw, 24px);
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
}
.stat-label {
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── CLIENT MARQUEE ─── */
.marquee-section {
  padding: 48px 0;
  overflow: hidden;
  position: relative;
}
.marquee-section::before,
.marquee-section::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.marquee-section::before {
  left: 0;
  background: linear-gradient(to right, var(--color-bg-page), transparent);
}
.marquee-section::after {
  right: 0;
  background: linear-gradient(to left, var(--color-bg-page), transparent);
}
.marquee-label {
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.marquee-row {
  display: flex;
  gap: 24px;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee-row:hover {
  animation-play-state: paused;
}
.marquee-row.right {
  animation-direction: reverse;
  animation-duration: 45s;
}
.marquee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #fff;
  border: 1.5px solid #ebebeb;
  border-radius: var(--radius-md);
  height: 80px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--mid);
  white-space: nowrap;
  filter: grayscale(1);
  opacity: 0.6;
  transition: all 0.3s;
}
.marquee-item:hover {
  filter: grayscale(0);
  opacity: 1;
  border-color: var(--red-border);
}
.marquee-item .icon { font-size: 26px; }

/* ─── SECTION COMMON ─── */
.swc-section {
  padding: 90px var(--pad);
}
.swc-section-sm {
  padding: 56px var(--pad);
}
.swc-container {
  max-width: var(--max-w);
  margin: 0 auto;
}
.swc-container-sm {
  max-width: 720px;
  margin: 0 auto;
}
.swc-dark {
  background: var(--dark);
}
.swc-dark h2 { color: var(--color-text-primary); }
.swc-dark .section-sub { color: rgba(255, 255, 255, 0.4); }
.swc-light {
  background: var(--paper);
}

.section-sub {
  font-size: 15px;
  color: var(--mid);
  max-width: 540px;
  line-height: 1.75;
}
.section-sub.center {
  margin: 0 auto;
  text-align: center;
}
.section-head {
  margin-bottom: 52px;
}
.section-head.center {
  text-align: center;
}
.section-head.center .section-sub {
  margin: 0 auto;
}

/* ─── CARDS ─── */
.swc-card {
  background: #fff;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--ease);
  position: relative;
  overflow: hidden;
}
.swc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.swc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
  border-color: var(--red-border);
}
.swc-card:hover::before {
  transform: scaleX(1);
}

.swc-card-dark {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark2);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--ease);
  position: relative;
  overflow: hidden;
}
.swc-card-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.swc-card-dark:hover {
  transform: translateY(-5px);
  border-color: var(--red-border);
  box-shadow: 0 14px 38px rgba(220, 38, 38, 0.12);
}
.swc-card-dark:hover::before {
  transform: scaleX(1);
}

.swc-card-glass {
  background: var(--color-bg-hover);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--border-dark2);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--ease);
}
.swc-card-glass:hover {
  transform: translateY(-6px);
  border-color: var(--red-border);
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.12);
}

/* ─── GRIDS ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* ─── FORM ELEMENTS ─── */
.field-group { margin-bottom: 20px; }
.field-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}
.dark-theme .field-label {
  color: rgba(255, 255, 255, 0.7);
}
.field-input,
.field-textarea,
.field-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: all var(--ease-out);
  font-family: inherit;
}
.dark-theme .field-input,
.dark-theme .field-textarea,
.dark-theme .field-select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.dark-theme .field-input:focus,
.dark-theme .field-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.field-input::placeholder {
  color: var(--muted);
}
.dark-theme .field-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}
.field-textarea { resize: vertical; min-height: 100px; }
.field-select { cursor: pointer; appearance: auto; }
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  line-height: 1.5;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--light2);
  border-radius: 24px;
  transition: 0.2s;
}
.dark-theme .toggle-slider {
  background: #374151;
}
.toggle-switch input:checked + .toggle-slider { background: var(--red); }
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Locked-ON toggles (renderToggleField $locked): permanently enabled,
   non-interactive — e.g. Domain Locking, Enable Rate Limiting. */
.field-locked .toggle-switch { opacity: 0.55; }
.field-locked .toggle-slider { cursor: not-allowed; }

/* Color picker */
.color-field { display: flex; align-items: center; gap: 8px; }
.color-swatch {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  padding: 2px;
  background: var(--white);
  flex-shrink: 0;
}
.color-text {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  font-family: monospace;
  background: #fff;
  outline: none;
  transition: all var(--ease-out);
}
.dark-theme .color-text {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: var(--color-text-primary);
}
.color-text:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}

/* ============================================================================
   Part E — Per-section live mini-previews
   A small, sticky, honest preview of only the section being edited. The .cmp-*
   inner elements consume the SAME --cb-* CSS custom properties the real widget
   (chatbot.js) uses — dashboard.js sets those vars inline on .cmp-stage — so
   the preview can never diverge from the live result.
   ========================================================================== */
.color-mini-preview {
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.color-mini-preview .cmp-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: 10px;
}
/* Crop host: the real live-test iframe is mounted inside and translated so only
   the edited section shows (see initColorMiniLivePreview in dashboard.js). The
   stage is sized in JS to the cropped section's on-screen box. */
.color-mini-preview .cmp-stage {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  min-height: 72px;
  border-radius: 12px;
  /* Neutral checker-free backdrop so the previewed colors read truthfully and
     any transparent widget padding shows a consistent surface. */
  background:
    linear-gradient(rgba(255,255,255,.02), rgba(255,255,255,.02)),
    repeating-conic-gradient(#141414 0% 25%, #1c1c1c 0% 50%) 0 / 20px 20px;
}
/* The cropped widget frame. Positioned/translated inline by JS; kept
   invisible until the crop math has run so the full window never flashes. */
.color-mini-preview .cmp-frame {
  position: absolute;
  top: 0; left: 0;
  border: 0;
  transform-origin: 0 0;
  visibility: hidden;
  background: transparent;
  pointer-events: none; /* View-only preview — koi click/type/scroll iframe tak na jaye */
}
/* Loading / graceful-fallback overlay shown while the frame boots or when a
   section can't be rendered (e.g. lead form off). */
.color-mini-preview .cmp-status {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  min-height: 72px; padding: 16px;
  font-size: 12px; color: rgba(255,255,255,.45); text-align: center;
}

/* Radio group */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  transition: all var(--ease-out);
  color: var(--mid);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
}
.dark-theme .radio-option {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-dark);
  color: rgba(255,255,255,0.5);
}
.radio-option:hover { border-color: var(--red); }
.radio-option input[type="radio"] { accent-color: var(--red); margin: 0; }
.radio-option:has(input:checked) {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
  font-weight: 600;
}

/* Checkbox group */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ease-out);
  background: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  color: var(--mid);
}
.dark-theme .checkbox-option {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-dark);
  color: rgba(255,255,255,0.5);
}
.checkbox-option:hover { border-color: var(--red); }
.checkbox-option input[type="checkbox"] { accent-color: var(--red); margin: 0; }
.checkbox-option:has(input:checked) {
  border-color: var(--red);
  background: var(--red-light);
}

/* List fields */
.list-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.list-item { display: flex; gap: 8px; align-items: center; }
.list-item input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.dark-theme .list-item input {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-dark);
  color: var(--color-text-primary);
}
.list-item input:focus { border-color: var(--red); }
.list-item-delete {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: none;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.list-item-delete:hover { background: rgba(239, 68, 68, 0.25); }

/* Quick Reply rows (Knowledge → Quick Answers) */
.quick-reply-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark, rgba(255,255,255,0.08));
    border-radius: var(--radius-sm, 6px);
    transition: border-color 0.2s, background 0.2s;
}
.quick-reply-item:hover {
    border-color: rgba(124,58,237,0.4);
    background: rgba(124,58,237,0.04);
}
.quick-reply-item .qr-fields {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.quick-reply-item .qr-fields input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--color-bg-input, rgba(255,255,255,0.05));
    border: 1px solid var(--border-dark, rgba(255,255,255,0.1));
    border-radius: var(--radius-sm, 6px);
    color: var(--color-text-primary);
    font-size: 13px;
    line-height: 1.4;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.quick-reply-item .qr-fields input[type="text"]::placeholder {
    color: var(--color-text-muted);
}
.quick-reply-item .qr-fields input[type="text"]:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.quick-reply-item .list-item-delete { flex-shrink: 0; }
.add-item-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all var(--ease-out);
}
.dark-theme .add-item-btn {
  border-color: var(--border-dark);
  color: rgba(255,255,255,0.4);
}
.add-item-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 13px;
  border-radius: 4px;
}
.badge-red {
  background: var(--red-light);
  color: var(--red2);
  border: 1px solid var(--red-border);
}
.badge-dark {
  background: var(--color-bg-hover);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
}
.badge-green {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ─── DIVIDER ─── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}
.dark-theme .divider { background: var(--border-dark); }

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--color-text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xl);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  max-width: 360px;
}
.toast.show { transform: translateX(0); }
.toast.toast-success { border-left: 3px solid #22c55e; }
.toast.toast-error { border-left: 3px solid #ef4444; }
.toast.toast-info { border-left: 3px solid #3b82f6; }
.toast.toast-warning { border-left: 3px solid #f59e0b; }
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: rgba(255,255,255,0.2);
  animation: toastProgress 4s linear forwards;
}
@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

.save-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: var(--color-text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all var(--ease-bounce);
  z-index: var(--z-toast);
  pointer-events: none;
  box-shadow: var(--shadow-xl);
}
.save-toast.show { opacity: 1; transform: translateY(0) scale(1); }
.save-toast .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 480px;
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  animation: scaleIn 0.25s ease-out;
}
.dark-theme .modal-box {
  background: var(--dark-2);
  border: 1px solid var(--border-dark);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.dark-theme .modal-title {
  color: var(--color-text-primary);
}
.modal-close {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--mid);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--ease-out);
}
.dark-theme .modal-close {
  border-color: var(--border-dark);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
}
.modal-close:hover {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red-border);
}
.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════
   EDIT FIELD MODAL — CARD VARIANT (Dark)
   ══════════════════════════════════════════════════ */
.modal-card {
  background: var(--color-bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease;
}

.modal-card .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-card .modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--color-text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.modal-card .modal-close {
  background: var(--color-bg-hover);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-card .modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.modal-card .modal-body {
  padding: 24px 28px;
}

.modal-card .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 28px 24px;
}

/* Form Group */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.form-help {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--color-text-muted);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

/* Form Inputs */
.form-input {
  width: 100%;
  background: var(--color-bg-page);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--color-text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
}

/* Ghost Cancel Button */
.btn-cancel {
  background: var(--color-bg-hover);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

/* Modal Slide In Animation */
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── FOOTER ─── */
/* ─── LANDING FOOTER ─── */
.landing-footer {
  background: var(--color-bg-page);
  border-top: 1px solid var(--color-border-subtle);
  padding: 80px 0 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 18px;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
}

.logo-red {
  color: #dc2626;
}

.footer-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.3s;
  font-size: 16px;
}

.social-link:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
  transform: translateY(-2px);
}

.footer-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #dc2626;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--color-border-subtle);
}

.footer-copyright {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-made {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
}

.footer-made::after {
  content: '❤';
  color: #dc2626;
  margin-left: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── AUTH PAGES ─── */
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  padding-top: var(--nav-h);
}
.auth-left-panel {
  background: var(--dark);
  padding: 80px var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-left-panel::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,38,38,0.15), transparent 70%);
  pointer-events: none;
}
.auth-left-panel::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,38,38,0.08), transparent 70%);
  pointer-events: none;
}
.auth-left-inner {
  position: relative;
  z-index: 1;
  max-width: 440px;
}
.auth-left-inner h2 {
  font-size: clamp(26px, 3vw, 38px);
  color: var(--color-text-primary);
  margin-bottom: 14px;
}
.auth-left-inner p {
  font-size: 15px;
  color: rgba(255,255,255,0.38);
  line-height: 1.7;
  margin-bottom: 36px;
}
.auth-perks {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-perk {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
}
.auth-perk-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--red-light);
  color: var(--red);
  border: 1px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.auth-right-panel {
  padding: 80px var(--pad);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.auth-form-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
}
.auth-form-card .top-accent {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--grad);
  margin-bottom: 20px;
}
.auth-form-card h3 {
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 6px;
}
.auth-form-card .sub {
  font-size: 14px;
  color: var(--mid);
  margin-bottom: 30px;
}
.auth-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }
.auth-footer-text {
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--mid);
}
.auth-footer-text a {
  color: var(--red);
  font-weight: 600;
}

/* ─── SETUP WIZARD ─── */
.setup-page {
  background: var(--dark);
  min-height: 100vh;
  padding: 100px var(--pad) 48px;
}
.setup-container {
  max-width: 720px;
  margin: 0 auto;
}
.setup-progress {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
}
.setup-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex: 1;
}
.setup-step.active { color: var(--red); }
.setup-step.completed { color: #22c55e; }
.setup-step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  transition: all 0.3s;
}
.setup-step.active .setup-step-num {
  border-color: var(--red);
  background: var(--grad);
  color: var(--color-text-primary);
  box-shadow: 0 2px 12px rgba(220,38,38,0.3);
}
.setup-step.completed .setup-step-num {
  border-color: #22c55e;
  background: #22c55e;
  color: var(--color-text-primary);
}
.setup-connector {
  flex: 1;
  height: 2px;
  background: var(--color-bg-hover);
  margin: 0 12px;
  border-radius: 2px;
  transition: background 0.4s;
}
.setup-connector.active {
  background: var(--grad);
}
.setup-card {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 32px;
}
.setup-card-title {
  font-size: 22px;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.setup-card-sub {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}

/* ─── SETUP LOADING SCREEN ─── */
.setup-loading {
  text-align: center;
  padding: 44px 24px 40px;
  max-width: 440px;
  margin: 0 auto;
}
.setup-loading-spinner {
  width: 46px; height: 46px;
  border: 3px solid var(--color-border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 22px;
}
.setup-loading-title {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.setup-loading-sub {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  margin: 0 0 24px;
  line-height: 1.5;
  min-height: 20px;
}

/* Progress bar */
.setup-progress-bar {
  height: 6px;
  background: var(--color-bg-hover);
  border-radius: 100px;
  overflow: hidden;
  margin: 0 auto 6px;
  max-width: 320px;
}
.setup-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 100px;
  background: var(--grad);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.setup-progress-pct {
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: 0 0 26px;
  letter-spacing: 0.02em;
}

/* Step checklist */
.setup-checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 300px;
  margin: 0 auto 8px;
  text-align: left;
}
.setup-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--color-text-muted);
  transition: color 0.3s ease;
}
.setup-check-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border-default);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
/* Active step */
.setup-check-item.active {
  color: var(--color-text-primary);
  font-weight: 500;
}
.setup-check-item.active .setup-check-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.setup-check-item.active .setup-check-dot::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: setup-dot-pulse 1s ease-in-out infinite;
}
@keyframes setup-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
/* Completed step */
.setup-check-item.done {
  color: var(--color-text-secondary);
}
.setup-check-item.done .setup-check-dot {
  border-color: #22c55e;
  background: #22c55e;
  color: #fff;
}

/* Queue position badge */
.setup-queue-badge {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: var(--accent);
  margin: 4px 0 2px;
}
.setup-queue-slots {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

/* In-screen error state */
.setup-loading-error {
  max-width: 380px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 24px;
}
.setup-loading-error .err-icon {
  font-size: 40px;
  margin-bottom: 14px;
}
.setup-loading-error h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  color: var(--color-text-primary);
  margin: 0 0 8px;
}
.setup-loading-error p {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin: 0 0 20px;
}

/* ─── DASHBOARD ─── */
.dashboard-wrap {
  display: flex;
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  margin-top: var(--nav-h);
  background: var(--dark);
  overflow: hidden;
  align-items: stretch;
}
/* ─── EXPANDABLE SIDEBAR TABS ─── */
.sidebar-tab {
  margin-bottom: 2px;
}

.tab-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--ease-out);
  color: rgba(255,255,255,0.5);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  position: relative;
  user-select: none;
}

.tab-header:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.8);
}

.tab-header.active {
  background: rgba(220,38,38,0.08);
  color: var(--red);
}

.tab-header .tab-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.tab-header .tab-label {
  flex: 1;
}

.tab-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: rgba(255,255,255,0.25);
}

.sidebar-tab.expanded .tab-arrow {
  transform: rotate(180deg);
}

.tab-subsections {
  display: none;
  padding-left: 8px;
  margin: 2px 0 4px;
}

.sidebar-tab.expanded .tab-subsections {
  display: flex;
  flex-direction: column;
  gap: 1px;
  animation: fadeIn 0.2s ease;
}

.sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 28px;
  border-radius: 8px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  transition: all var(--ease-out);
  position: relative;
}

.sub-link::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.2s;
}

.sub-link:hover {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.03);
}

.sub-link:hover::before {
  background: var(--red);
}

.sub-link.active {
  color: var(--red);
  background: rgba(220,38,38,0.08);
}

.sub-link.active::before {
  background: var(--red);
  width: 6px;
  height: 6px;
}

/* Active sidebar tab indicator */
.sidebar-tab.active .tab-header {
  background: rgba(220,38,38,0.08);
  color: var(--red);
}

/* Active tab left bar */
.sidebar-tab.active .tab-header::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
}

.dash-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--dark-2);
  border-right: 1px solid var(--border-dark);
  overflow: hidden;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
}
.dash-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-right: 2px;
}
.dash-sidebar-scroll::-webkit-scrollbar { width: 6px; }
.dash-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.dash-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
.dash-sidebar-top-fixed {
  flex: 0 0 auto;
}
.dash-sidebar-top {
  text-align: center;
  padding: 12px 8px 16px;
  border-bottom: 1px solid var(--border-dark);
  margin-bottom: 12px;
}
.dash-sidebar-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 8px;
  box-shadow: var(--shadow-red);
}
.dash-sidebar-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-primary);
}
.dash-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--ease-out);
  position: relative;
}
.dash-tab-btn:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.8);
}
.dash-tab-btn.active {
  color: var(--red);
  background: rgba(220,38,38,0.08);
}
.dash-tab-btn.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
}
.dash-tab-btn .tab-icon { font-size: 16px; width: 20px; text-align: center; }
.dash-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-dark);
}

.dash-main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  overflow-y: auto;
  height: 100%;
  scroll-behavior: smooth;
  /* Custom scrollbar that matches dark theme */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.dash-main::-webkit-scrollbar { width: 8px; }
.dash-main::-webkit-scrollbar-track { background: transparent; }
.dash-main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.dash-main::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }
.dash-panel { display: none; }
.dash-panel.active { display: block; animation: fadeIn 0.2s ease; }
.dash-section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.dash-section-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 28px;
}

/* Dashboard Cards */
.dash-card {
  background: var(--dark-2);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.dash-card-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 12px 0;
  border-top: 1px solid var(--border-dark);
  margin-top: 8px;
  margin-bottom: 16px;
}
.dash-card-section-title:first-child { border-top: none; margin-top: 0; }

/* ─── SUB-SECTION STYLING (for reorganized dashboard) ─── */
.sub-section {
  margin-bottom: 32px;
}

.sub-section:last-child {
  margin-bottom: 0;
}

.sub-section-divider {
  height: 1px;
  background: var(--color-bg-hover);
  margin: 24px 0 32px;
}

.sub-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sub-section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin: 0;
}

.sub-section-icon {
  font-size: 16px;
}

/* Dashboard Loading Overlay */
#panel-loading {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  min-height: 300px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease, visibility 0.35s ease, pointer-events 0.35s ease;
}
/* .hidden class is NOT used here — we manage via a custom class to avoid
   conflict with the global .hidden { display: none !important } utility */
#panel-loading.dash-loading-hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
#panel-loading .spinner-lg {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
#panel-loading .loading-text {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
}
#panel-loading .loading-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
}

/* Dashboard Error Display */
.dash-error-container {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  z-index: 51;
  background: rgba(15, 15, 15, 0.85);
  transition: opacity 0.3s ease;
}
.dash-error-container.hidden {
  display: none !important;
}
.dash-error-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.8;
}
.dash-error-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #ef4444;
  text-align: center;
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.dash-error-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  margin-bottom: 20px;
  max-width: 380px;
  line-height: 1.5;
}
.dash-error-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Dashboard panels are position:relative so the loading overlay is contained */
.dash-main {
  position: relative;
}

/* Dashboard Live Preview */
.dash-preview {
  width: 480px;         /* 380 → 480: Large window (440) + ~20px margin fits 1:1, no left crop */
  flex-shrink: 0;
  border-left: 1px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  background: var(--dark-2);
  /* auto (not hidden): when the host grows past the viewport on a big preset +
     short screen, the panel scrolls instead of clipping the widget's top. */
  overflow-y: auto;
  height: 100%;
}
.preview-top {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.preview-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-primary);
}
.preview-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #22c55e;
  font-weight: 600;
}
.preview-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 5px #22c55e;
  animation: pulseOnline 2s infinite;
}
.preview-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--color-bg-elevated);
}
.preview-trust {
  margin: 3px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.3;
}
.live-test-host {
  position: relative;
  padding: 0;
  overflow: hidden;
  /* Height is JS-driven (fitLiveTestFrame) to the widget's true 1:1 size so the
     whole window shows with no scaling. This is just the default before JS runs
     (Small preset: 520 window + offsets). */
  min-height: 520px;
}
/* Themed preview surface: follows the dashboard's dark/light mode via theme
   variables. The transparent live-test iframe sits on top, so this is what
   shows behind the widget — dark in dark mode, light in light mode.
   Anchored to the id so it beats the `html[data-theme="light"] .preview-chat`
   override (the host carries both classes) while still auto-theming via vars. */
#live-test-host.live-test-host {
  /* The host also carries .preview-chat (flex: 1), whose flex-shrink would
     collapse the JS-set height back down inside the .dash-preview flex column.
     Lock it to flex: 0 0 auto so fitLiveTestFrame's exact height is respected. */
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--color-bg-page) 0%, var(--color-bg-elevated) 100%);
}
/*
 * The iframe is deliberately wider than the 380px preview column and pinned to
 * the bottom-right corner. Its element width IS its internal CSS viewport width,
 * so a 1280px iframe makes the real widget evaluate its own desktop media query
 * (@media min-width:1025px → 56px launcher, 360x600 window) exactly as it would
 * on a standalone website — at true 1:1 scale, no transform/zoom. The widget is
 * fixed at right:20px/bottom:20px and only ~380px wide, so it lands entirely
 * inside the visible column; the empty left/top of the iframe is clipped by the
 * host's overflow:hidden.
 *
 * height is a FIXED desktop-like 900px (NOT 100%): the iframe's internal CSS
 * viewport height must not be tied to the (short) preview panel, or the widget's
 * `max-height: calc(100vh - 120px)` clamps every preset down to the panel height
 * and Small/Medium/Large all look identical. At 900px viewport the window cap is
 * 780px — larger than the biggest preset (Large 680) plus its 75px bottom offset
 * — so no preset is ever clamped and each renders at true 1:1 pixel size, exactly
 * like a real browser. Pinned to bottom:0 so the launcher stays at the panel's
 * bottom edge; if the panel is shorter than 900px the host's overflow:hidden just
 * crops the top (the widget size never shrinks).
 */
.live-test-frame {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1280px;
  height: 900px;
  border: 0;
  display: block;
}
.live-test-loading {
  margin: auto;
  color: var(--color-text-muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
}
.live-test-loading > span {
  text-align: center;
  max-width: 240px;
  line-height: 1.4;
}
.live-test-loading-error > span:first-child {
  font-size: 22px;
  color: #f87171;
}
.preview-footer {
  padding: 12px;
  border-top: 1px solid var(--border-dark);
}
.preview-input-row { display: flex; gap: 8px; align-items: center; }
.preview-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--color-border-default);
  border-radius: 24px;
  font-size: 13px;
  outline: none;
  background: var(--color-bg-input);
  color: var(--color-text-primary);
}
.preview-input:focus { border-color: var(--red); }
.preview-input::placeholder { color: var(--color-text-muted); }
.preview-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  color: var(--color-text-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── MY BOTS ─── */
.mybots-page {
  padding: calc(var(--nav-h) + 40px) var(--pad) 48px;
  background: var(--dark);
  min-height: 100vh;
}
.mybots-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 16px;
}
.mybots-header-left h1 {
  font-size: 30px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}
.mybots-header-left p {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.bot-card {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--ease);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.bot-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.bot-card:hover {
  border-color: var(--red-border);
  box-shadow: 0 8px 32px rgba(220,38,38,0.08);
  transform: translateY(-4px);
}
.bot-card:hover::before { transform: scaleX(1); }
.bot-card-top { display: flex; align-items: flex-start; gap: 14px; }
.bot-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--red-light);
  border: 1px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.bot-info { flex: 1; min-width: 0; }
.bot-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-domain {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.bot-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-bg-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bot-stat {
  background: rgba(0,0,0,0.2);
  padding: 10px 12px;
  text-align: center;
}
.bot-stat-n {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text-primary);
}
.bot-stat-l {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}
.bot-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.bot-actions .btn {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 8px 10px;
  justify-content: center;
}

/* ─── HISTORY ─── */
.history-page {
  padding: calc(var(--nav-h) + 40px) var(--pad) 48px;
  background: var(--dark);
  min-height: 100vh;
}
.history-header h1 {
  font-size: 28px;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.history-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}
.history-session {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--ease);
}
.history-session:hover {
  border-color: var(--red-border);
  box-shadow: 0 4px 20px rgba(220,38,38,0.05);
}
.history-session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.history-session-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.history-session-info span {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.history-session-expanded {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-dark);
  display: none;
}
.history-session-expanded.open { display: block; }

/* ─── ANALYTICS ─── */
.analytics-page {
  padding: calc(var(--nav-h) + 40px) var(--pad) 48px;
  background: var(--dark);
  min-height: 100vh;
}
.analytics-header h1 {
  font-size: 28px;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.analytics-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}
.stat-card {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all var(--ease);
}
.stat-card:hover {
  border-color: var(--red-border);
  box-shadow: 0 8px 32px rgba(220,38,38,0.06);
}
.stat-card-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 2.5vw, 36px);
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.stat-card-label {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* Analytics Chart Cards */
.charts-grid {
  grid-template-columns: 1fr 1fr;
}

.chart-card {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.chart-card h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 16px;
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.analytics-error {
  text-align: center;
  padding: 40px;
  background: rgba(239, 68, 68, 0.05);
  border: 1.5px dashed rgba(239, 68, 68, 0.2);
  border-radius: 16px;
  color: #ef4444;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  margin-bottom: 24px;
}

table .empty-cell {
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  padding: 24px 12px !important;
}

/* Scroll wrapper for tables on small screens */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   ANALYTICS TABLES — FIXED COLUMN ALIGNMENT
   ============================================ */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table thead th {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-dark);
  white-space: nowrap;
}

.analytics-table tbody td {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
  vertical-align: middle;
}

/* Numeric columns — right-aligned consistent with header alignment */
.analytics-table th.numeric,
.analytics-table td.numeric {
  text-align: right;
}

/* Last row no border */
.analytics-table tbody tr:last-child td {
  border-bottom: none;
}

/* Hover effect */
.analytics-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Empty cell */
.analytics-table .empty-cell {
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-style: italic;
  padding: 24px 16px !important;
}

/* ─── DOWNLOAD PAGE ─── */
.download-page {
  padding: calc(var(--nav-h) + 40px) var(--pad) 48px;
  background: var(--dark);
  min-height: 100vh;
}
.download-hero {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-xl);
  padding: 52px;
  text-align: center;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.download-check {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: var(--color-text-primary);
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.4);
}
.download-hero h1 {
  font-size: 36px;
  color: var(--color-text-primary);
  margin-bottom: 10px;
}
.download-hero p {
  color: rgba(255,255,255,0.4);
  font-size: 15px;
}
.script-block {
  background: var(--dark);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  font-family: 'DM Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.script-block code {
  color: inherit;
  background: transparent;
}
.script-block .copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}
.install-step {
  display: flex;
  gap: 16px;
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  align-items: flex-start;
  transition: all var(--ease-out);
}
.install-step:hover {
  border-color: var(--red-border);
  box-shadow: 0 4px 16px rgba(220,38,38,0.04);
}
.install-step-num {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--grad);
  color: #ffffff !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.install-step-text {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}
.install-step-text strong { color: rgba(255,255,255,0.8); }

/* Security warning container */
.security-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-md);
  margin: 24px auto;
  max-width: 800px;
  width: 100%;
  box-sizing: border-box;
}

.security-warning .icon {
  flex-shrink: 0;
  font-size: 20px;
}

.security-warning .message {
  text-align: center;
  flex: 1;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.security-warning strong {
  color: var(--red);
  font-weight: 600;
}

/* ─── EMPTY STATE (legacy fallback) ─── */
.empty-state-legacy {
  text-align: center;
  padding: 60px 24px;
}
.empty-state-legacy .icon {
  font-size: 48px;
  margin-bottom: 14px;
}
.empty-state-legacy h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}
.empty-state-legacy p {
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  max-width: 360px;
  margin: 0 auto;
}

/* ─── SPINNER ─── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}
.spinner-lg {
  width: 52px; height: 52px;
  border: 4px solid var(--color-border-subtle);
  border-top-color: var(--red);
}
/* cb-spinner — branded spinner used by Live Test, mini-preview, contact-card
   skeleton states. Lighter weight than .spinner so it doesn't dominate the
   layout when paired with text. */
.cb-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.cb-spinner-sm {
  width: 16px; height: 16px;
  border-width: 2px;
}

/* ─── PAGINATION ─── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-dark);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-out);
}
.page-btn:hover {
  border-color: var(--red-border);
  color: var(--red);
}
.page-btn.active {
  background: var(--grad);
  color: var(--color-text-primary);
  border-color: transparent;
}

/* ─── TRIAL BANNER ─── */
.trial-banner {
  background: var(--grad);
  color: var(--color-text-primary);
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 500;
}
.trial-banner .btn-outline-white {
  border: 1.5px solid rgba(255,255,255,0.5);
  color: var(--color-text-primary);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.trial-banner .btn-outline-white:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--color-text-primary);
}

/* ─── AI FILL MODAL ─────────────────────────────────────────────── */
.ai-fill-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 16px;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  animation: ai-fill-fade-in 0.18s ease-out;
}

/* Reduce motion: skip the entrance animation entirely. */
@media (prefers-reduced-motion: reduce) {
  .ai-fill-overlay { animation: none; }
  .ai-fill-box { animation: none !important; opacity: 1 !important; transform: none !important; }
}

.ai-fill-box {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  width: 520px;
  max-width: 100%;
  max-height: min(640px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--color-text-primary);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
}
.ai-fill-box.ai-fill-box-in {
  animation: ai-fill-rise 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ai-fill-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ai-fill-rise {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* ── Header ── */
.ai-fill-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--color-border-subtle);
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0)    100%);
}
.ai-fill-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.ai-fill-header-text { flex: 1; min-width: 0; }
.ai-fill-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.ai-fill-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}
.ai-fill-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ai-fill-close:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  border-color: var(--color-border-default);
}
.ai-fill-close:active { transform: scale(0.95); }

/* ── Body scroll region ── */
.ai-fill-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.ai-fill-body::-webkit-scrollbar { width: 8px; }
.ai-fill-body::-webkit-scrollbar-track { background: transparent; }
.ai-fill-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
.ai-fill-body::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ── Section ── */
.ai-fill-section { display: flex; flex-direction: column; gap: 10px; }
.ai-fill-section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ai-fill-label {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.005em;
}
.ai-fill-optional {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
}
.ai-fill-hint {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.55;
}

/* ── Pages list (cards) ── */
.ai-pages-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px;
  margin: -4px -2px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.ai-pages-list::-webkit-scrollbar { width: 6px; }
.ai-pages-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.ai-page-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ai-page-option:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-default);
}
.ai-page-option:active { transform: scale(0.997); }

/* Hide the native checkbox, render a custom one via the sibling span. */
.ai-page-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  pointer-events: none;
}
.ai-page-checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 4px;
  background: var(--color-bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.ai-page-checkbox::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
  transition: opacity 0.12s ease-out;
}
.ai-page-option input[type="checkbox"]:checked + .ai-page-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}
.ai-page-option input[type="checkbox"]:checked + .ai-page-checkbox::after { opacity: 1; }
.ai-page-option input[type="checkbox"]:focus-visible + .ai-page-checkbox {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ai-page-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-page-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-page-url {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'DM Mono', 'Fira Code', ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl; /* keep the path tail visible when long */
  text-align: left;
}

.ai-no-pages {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--color-bg-input);
  border: 1px dashed var(--color-border-default);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
}
.ai-no-pages-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-text-muted);
}

/* ── Instructions textarea ── */
.ai-fill-textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--color-text-primary);
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-fill-textarea::placeholder { color: var(--color-text-muted); }
.ai-fill-textarea:hover { border-color: var(--color-border-strong); }
.ai-fill-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Note row ── */
.ai-fill-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.ai-fill-note-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 1px;
}

/* ── Footer actions ── */
.ai-fill-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--color-border-subtle);
  background: linear-gradient(0deg,
    rgba(255, 255, 255, 0.015) 0%,
    rgba(255, 255, 255, 0)    100%);
}
.ai-fill-btn {
  position: relative;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.ai-fill-btn:active { transform: translateY(1px); }
.ai-fill-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ai-fill-btn-ghost {
  background: transparent;
  border-color: var(--color-border-default);
  color: var(--color-text-secondary);
}
.ai-fill-btn-ghost:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-strong);
  color: var(--color-text-primary);
}

.ai-fill-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--color-text-on-accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 14px rgba(220, 38, 38, 0.28);
}
.ai-fill-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.ai-fill-btn-primary:disabled {
  cursor: progress;
  opacity: 0.85;
}

.ai-fill-btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: ai-fill-spin 0.7s linear infinite;
  display: none;
}
.ai-fill-btn-primary.is-loading .ai-fill-btn-spinner { display: inline-block; }
.ai-fill-btn-primary.is-loading .ai-fill-btn-label   { opacity: 0.7; }

@keyframes ai-fill-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-fill-btn-spinner { animation-duration: 1.4s; }
}

/* ── Responsive: stack the icon+title row tighter on narrow widths ── */
@media (max-width: 480px) {
  .ai-fill-box { width: 100%; border-radius: 12px; }
  .ai-fill-header { padding: 18px 18px 14px; gap: 10px; }
  .ai-fill-body   { padding: 18px 18px 8px; gap: 18px; }
  .ai-fill-actions { padding: 14px 18px 16px; }
}

/* ─── CHAT MESSAGES ─── */
.msg {
  max-width: 85%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: fadeIn 0.3s ease;
}
.msg.user {
  background: var(--grad);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg.bot {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* ─── SCRIPT BOX ─── */
.script-box {
  background: var(--dark);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.script-box code {
  flex: 1;
  font-family: 'DM Mono', 'Fira Code', monospace;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--color-text-secondary);
}

/* ─── WORKING HOURS ─── */
.working-hours-grid { display: flex; flex-direction: column; gap: 8px; }
.wh-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wh-day { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); min-width: 110px; }
.wh-time { padding: 6px 10px; border: 1.5px solid var(--border-dark); border-radius: var(--radius-sm); font-size: 13px; background: var(--color-bg-input); color: var(--color-text-primary); width: 110px; }
.wh-sep { font-size: 12px; color: rgba(255,255,255,0.3); }
.wh-note { flex: 1; padding: 6px 10px; border: 1.5px solid var(--border-dark); border-radius: var(--radius-sm); font-size: 13px; background: var(--color-bg-input); color: var(--color-text-primary); min-width: 200px; }

/* ─── PAGE LIST (Setup) ─── */
.pages-list { max-height: 400px; overflow-y: auto; border: 1.5px solid var(--border-dark); border-radius: var(--radius-md); padding: 8px; }
.page-group { margin-bottom: 8px; }
.page-group-head { display: flex; justify-content: space-between; padding: 7px 10px; background: var(--color-bg-hover); border-radius: var(--radius-sm); margin-bottom: 4px; }
.page-group-label { font-size: 12px; font-weight: 700; color: var(--color-text-secondary); }
.page-group-count { font-size: 11px; color: var(--muted); }
.page-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.page-item:hover { background: var(--color-bg-hover); }
.page-item input { accent-color: var(--red); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; border: 1.5px solid var(--border-default); background: transparent; appearance: none; border-radius: 3px; position: relative; }
.page-item input:checked { background: var(--red); border-color: var(--red); }
.page-item input:checked::after { content: "✓"; position: absolute; color: white; font-size: 10px; top: -1px; left: 2px; }
.page-item-info { flex: 1; min-width: 0; }
.page-item-title { font-size: 13px; font-weight: 500; color: var(--color-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-item-url { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════════════════════════
   SCROLL REVEAL — FIXED
   ══════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* stagger container — children start hidden */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
/* ★★★ CRITICAL FIX: reveal-stagger children need a revealed state ★★★ */
.reveal-stagger.revealed > * {
  opacity: 1;
  transform: none;
}
.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }

/* ─── HOW IT WORKS STEPS ─── */
.step-card-hover {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}
.swc-card-dark:hover .step-card-hover,
.swc-card:hover .step-card-hover { transform: scaleX(1); }

/* ─── CHATBOT WIDGET OVERRIDES (embedded) ─── */
:root {
  --swc-widget-z: 999999;
}

/* ─── FLOATING PREVIEW BUTTON (Dashboard mobile) ─── */
.floating-preview-btn {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad);
  color: var(--color-text-primary);
  border: none;
  box-shadow: var(--shadow-red-lg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 110;
  cursor: pointer;
  font-size: 24px;
  transition: all var(--ease-out);
}
.floating-preview-btn:hover {
  transform: scale(1.1);
}

/* ══════════════════════════════════════════════════
   SECTION TITLES, SUBTITLES & DIVIDERS
   ══════════════════════════════════════════════════ */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.section-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.section-divider {
  height: 1px;
  background: var(--color-bg-hover);
  margin: 32px 0;
}

/* ══════════════════════════════════════════════════
   TAB CONTENT CONTAINER
   ══════════════════════════════════════════════════ */
.tab-content {
  padding: 28px 32px;
  background: var(--color-bg-page);
}

/* ══════════════════════════════════════════════════
   FAQ ITEM CARD — DARK THEME
   ══════════════════════════════════════════════════ */
.faq-list {
  display: flex;
  flex-direction: column;
}

.faq-item {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.faq-item:hover {
  border-color: rgba(220, 38, 38, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.08);
}

/* Top red accent line */
.faq-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  border-radius: 14px 14px 0 0;
}

.faq-item:hover::before {
  transform: scaleX(1);
}

.faq-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 14px;
}

.faq-item-question {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--color-text-primary);
  line-height: 1.4;
  flex: 1;
  letter-spacing: -0.3px;
}

.faq-item-answer {
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.faq-item-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.faq-item-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.btn-edit-faq {
  background: var(--color-bg-hover);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
}

.btn-edit-faq:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
  transform: translateY(-1px);
}

.btn-delete-faq {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-delete-faq:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════
   AI FIELD & CUSTOM FIELD CARDS — DARK THEME
   ══════════════════════════════════════════════════ */
.ai-field-item,
.custom-field-item {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  padding: 22px 28px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ai-field-item:hover,
.custom-field-item:hover {
  border-color: rgba(220, 38, 38, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.08);
}

.ai-field-item::before,
.custom-field-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  border-radius: 14px 14px 0 0;
}

.ai-field-item:hover::before,
.custom-field-item:hover::before {
  transform: scaleX(1);
}

.field-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}

.field-item-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field-item-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  padding-left: 2px;
}

/* "Added by AI" Badge */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: #dc2626;
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 4px 13px;
  border-radius: 4px;
  margin-left: 10px;
  vertical-align: middle;
}

.ai-badge::before {
  content: '🤖';
  font-size: 12px;
  margin-right: 4px;
}

.field-item-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.field-item-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.btn-edit-field {
  background: var(--color-bg-hover);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-secondary);
}

.btn-edit-field:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
  transform: translateY(-1px);
}

.btn-delete-field {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.btn-delete-field:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════
   CUSTOM FIELD CARDS — DARK THEME (Bug 3)
   ══════════════════════════════════════════════════ */
.custom-field-card {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.custom-field-card:hover {
  border-color: rgba(220, 38, 38, 0.25);
  transform: translateY(-3px);
}

.custom-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.custom-field-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
}

.custom-field-actions {
  display: flex;
  gap: 10px;
}

.custom-field-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  text-transform: capitalize;
}

.custom-field-input .field-input,
.custom-field-input .field-textarea {
  background: var(--color-bg-page);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

.btn-ai-fill {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-ai-fill:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════
   CUSTOM FIELD LIST — RENDERED LIST ITEMS
   ══════════════════════════════════════════════════ */
.custom-field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.list-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  transition: all 0.2s;
}

.list-item-row:hover {
  border-color: rgba(220, 38, 38, 0.2);
}

.list-item-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.btn-list-delete {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-list-delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

.custom-field-add-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.custom-field-add-row input {
  flex: 1;
}

.btn-add-item {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #dc2626;
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add-item:hover {
  background: rgba(220, 38, 38, 0.2);
  transform: translateY(-1px);
}

.list-empty {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-style: italic;
}

/* ══════════════════════════════════════════════════
   EMPTY STATES — DARK THEME
   ══════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin: 20px 0;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   ADD NEW BUTTON (Gradient Red)
   ══════════════════════════════════════════════════ */
.btn-add-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: var(--color-text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-add-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(220, 38, 38, 0.22);
}

/* "Generate with AI" button */
.btn-generate-faqs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1.5px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-generate-faqs:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(220, 38, 38, 0.12);
}

/* FAQ Form inputs in modal - dark themed */
.faq-form .field-input,
.faq-form .field-textarea {
  background: var(--color-bg-page);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--color-text-primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  width: 100%;
  transition: all 0.3s;
}
.faq-form .field-input:focus,
.faq-form .field-textarea:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.faq-form .field-label {
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  display: block;
}
.faq-form .field-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
  line-height: 1.5;
}

/* "Generate FAQs" button styling — already defined above */

/* Empty state for knowledge base — now using .empty-state above */

/* ══════════════════════════════════════════════════
   FAQ ACCORDION — CARD STYLE FOR LIGHT BACKGROUND
   ══════════════════════════════════════════════════ */
.faq-accordion .faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px !important;
  margin-bottom: 14px !important;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.faq-accordion .faq-item:hover {
  border-color: var(--red-border);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.08);
}
/* Red accent line on hover */
.faq-accordion .faq-item::before {
  content: '' !important;
  display: block !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b91c1c, #dc2626);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.faq-accordion .faq-item:hover::before {
  transform: scaleX(1);
}
.faq-accordion .faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.3s;
  gap: 16px;
  padding: 0;
}
.faq-accordion .faq-question:hover { color: var(--red); }
.faq-accordion .faq-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  transition: all 0.3s;
  color: var(--muted);
}
.faq-accordion .faq-item.active .faq-icon {
  background: var(--red-light);
  border-color: var(--red-border);
  color: var(--red);
  transform: rotate(45deg);
}
.faq-accordion .faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0;
}
.faq-accordion .faq-item.active .faq-answer {
  max-height: 300px;
  padding: 16px 0 4px;
}
.faq-accordion .faq-answer p {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.7;
  margin: 0;
}

/* ─── RESPONSIVE ─── */

/* ══════════════════════════════════════════════════
   DASHBOARD — MOBILE/TABLET TOGGLES
   ══════════════════════════════════════════════════ */

/* Hamburger button — hidden on desktop, shown ≤1024px */
.dash-menu-toggle {
  display: none;
  position: fixed;
  top: calc(var(--nav-h) + 10px);
  left: 14px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dark-2);
  border: 1px solid var(--border-dark);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  z-index: 200;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}
.dash-menu-toggle span {
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: all var(--ease-out);
}
body.dash-sidebar-open .dash-menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.dash-sidebar-open .dash-menu-toggle span:nth-child(2) { opacity: 0; }
body.dash-sidebar-open .dash-menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Backdrop — only visible when an overlay is open */
.dash-backdrop {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 90;
}
body.dash-sidebar-open .dash-backdrop,
body.dash-preview-open .dash-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* 1366px — narrow-laptop: shrink (not hide) the preview panel so main content isn't squeezed */
@media (max-width: 1366px) and (min-width: 1101px) {
  .dash-preview {
    width: 360px;
  }
}

/* 1100px */
@media (max-width: 1100px) {
  .dash-preview { display: none; }
  .floating-preview-btn { display: flex; }
  body.dash-preview-open .dash-preview {
    display: flex;
    position: fixed;
    top: var(--nav-h);
    right: 0;
    bottom: 0;
    width: min(380px, 92vw);
    z-index: 150;
    border-left: 1px solid var(--border-dark);
    animation: slideInRight 0.25s ease;
  }
  @keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }
}

/* 1024px */
@media (max-width: 1024px) {
  .dashboard-wrap {
    flex-direction: column;
  }
  .dash-menu-toggle { display: flex; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 8px 10px; font-size: 12.5px; }
  .nav-links a[href$="/guide"] { display: none; }
  .dash-sidebar {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 120;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    height: calc(100vh - var(--nav-h));
    height: calc(100dvh - var(--nav-h));
    border-right: 1px solid var(--border-dark);
    box-shadow: 4px 0 24px rgba(0,0,0,0.45);
  }
  body.dash-sidebar-open .dash-sidebar { transform: translateX(0); }
  .dash-main {
    padding: 70px 16px 16px; /* room for hamburger */
    width: 100%;
  }
  .stats-inner { grid-template-columns: repeat(3, 1fr); }
}

/* 900px */
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left-panel { display: none; }
  .hero-slide-content { padding-bottom: 20px; }
  .hero-slide { padding: 32px 24px; }
  .hero-slider { height: 60vh; min-height: 400px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
}

/* 768px — Mobile */
@media (max-width: 768px) {
  .nav-links .nav-link,
  .nav-links .btn-whatsapp,
  .nav-user { display: none !important; }
  .nav-toggle { display: flex; }
  .nav-links .btn-primary { display: none; }
  body { padding-bottom: 60px; }
  .sticky-bottom-bar { display: flex; }

  .hero-slider {
    margin: calc(var(--nav-h) + 8px) 12px 0;
    border-radius: var(--radius-lg);
    height: 50vh;
    min-height: 380px;
  }
  .hero-slide { padding: 24px 20px; }
  .hero-slide-actions .btn-ghost { display: none; }

  .stats-bar { margin: -16px 12px 0; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); padding: 16px; gap: 8px; }

  .swc-section { padding: 56px var(--pad); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr; }

  .auth-right-panel { padding: 40px 16px; }
  .auth-form-card { padding: 24px 20px; }

  .setup-page { padding: 80px 16px 32px; }
  .setup-card { padding: 24px; }
  .setup-step span { display: none; }

  .dash-main { padding: 70px 14px 16px; }
  .dash-section-title { font-size: 20px; }
  .dash-card { padding: 18px; }
  .bot-card { padding: 20px; }
  .bots-grid { grid-template-columns: 1fr; }

  .download-hero { padding: 32px 24px; }
  .download-hero h1 { font-size: 28px; }
  .install-step { flex-direction: column; }

  .hero-controls { top: 12px; right: 12px; }
  .hero-counter { font-size: 11px; padding: 4px 10px; }
  .hero-arrow { width: 32px; height: 32px; font-size: 14px; }

  .chart-card { padding: 16px; }
  .charts-grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  .analytics-page,
  .history-page,
  .leads-page,
  .mybots-page { padding: calc(var(--nav-h) + 20px) 16px 48px; }
}

/* 600px */
@media (max-width: 600px) {
  .hero-slider { height: 45vh; min-height: 340px; }
  .hero-slide-title { font-size: 22px; }
  .hero-slide-tag { font-size: 9px; padding: 4px 10px; }
  .hero-controls { gap: 6px; }
  .stats-inner { grid-template-columns: repeat(2, 1fr); padding: 12px; }
  .stat-value { font-size: 18px; }
}

/* 480px */
@media (max-width: 480px) {
  .hero-slider { margin: calc(var(--nav-h) + 4px) 8px 0; height: 40vh; min-height: 300px; }
  .hero-slide-actions .btn { font-size: 13px; padding: 10px 20px; }
  .sticky-bar-item { font-size: 8.5px; padding: 4px 4px; }
  .sticky-bar-item svg { width: 16px; height: 16px; }
  .bots-grid { grid-template-columns: 1fr; }
  .history-session-info { flex-direction: column; align-items: flex-start; gap: 6px; }
  .form-field-item { padding: 12px 14px; gap: 10px; }
  .form-field-info { min-width: 100%; order: 3; }
  .form-field-actions { margin-left: auto; }
  .setup-card .field-group > div { flex-wrap: wrap; }
  .setup-card .field-group > div > .btn-primary { width: 100%; }
  .emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .icon-grid { grid-template-columns: repeat(4, 1fr); }

  /* Mobile navbar compactness: logo text + "SwisChat" badge + theme toggle
     + hamburger all share one row. The default --pad (≥16px) and 24px gap
     overflow at 320-400px, so we tighten everything and let the brand text
     shrink / badge hide. Logo anchor must take min-width:0 so the inner
     text can truncate instead of forcing the row wider than the viewport. */
  .nav-inner { gap: 10px; padding: 0 12px; }
  .nav-logo { gap: 8px; min-width: 0; flex: 1 1 auto; }
  .nav-logo > div { min-width: 0; }
  .nav-logo-icon { width: 30px; height: 30px; font-size: 13px; flex-shrink: 0; }
  .nav-logo-text { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-logo-badge { display: none; }
  .nav-toggle { width: 34px; height: 34px; flex-shrink: 0; }
  /* Theme toggle: drop the inactive button's visible chrome and shrink to a
     single-icon pill so it doesn't push the hamburger off-screen. The
     hidden button still tracks state (its data-mode is read by JS), and
     clicking the active button switches the theme — same effect as the
     desktop two-pill switch, just in one icon's footprint.
     We hide INACTIVE rather than always-dark, because hiding the active
     one leaves no way to flip the theme. */
  .theme-toggle { gap: 0; padding: 2px; border-radius: 8px; min-width: 0; }
  .theme-btn { width: 28px; height: 28px; }
  .theme-btn:not(.active) { display: none; }
}

/* 360px — extra-tight phones */
@media (max-width: 360px) {
  .nav-inner { gap: 8px; padding: 0 10px; }
  .nav-logo-text { font-size: 13px; }
  .nav-toggle { width: 32px; height: 32px; }
}

/* ─── UTILITY ─── */
.hidden { display: none !important; }
.text-red { color: var(--red); }
.text-muted { color: var(--muted); }
.text-white { color: var(--color-text-primary); }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.font-bold { font-weight: 700; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================
   LEADS TAB — Section Cards, Toggle, Form, Fields, Table
   ============================================= */

/* Section Card Container */
.leads-section-card {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.leads-section-card:hover {
  border-color: rgba(220, 38, 38, 0.15);
}

/* Section Header */
.leads-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.leads-section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin: 0;
}

.leads-section-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-top: 8px;
  margin-bottom: 20px;
}

/* Toggle Row — Enable/Disable Lead Collection */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--color-border-subtle);
  margin-bottom: 24px;
}

.toggle-switch-leads {
  position: relative;
  width: 52px;
  height: 28px;
  background: #374151;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.toggle-switch-leads.active {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
}

.toggle-switch-leads::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20);
}

.toggle-switch-leads.active::after {
  left: 27px;
}

.toggle-label {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
}

.toggle-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* Form Inputs — Dark Theme */
.leads-form-group {
  margin-bottom: 24px;
}

.leads-form-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.leads-form-input {
  width: 100%;
  background: var(--color-bg-page);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--color-text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.leads-form-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.leads-form-input::placeholder {
  color: var(--color-text-muted);
}

.leads-form-help {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* Form Fields Builder — Drag & Drop List */
.form-fields-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.form-field-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-bg-page);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
  transition: all 0.3s ease;
}

.form-field-item:hover {
  border-color: rgba(220, 38, 38, 0.25);
  transform: translateX(4px);
}

.form-field-drag-handle {
  color: var(--color-text-muted);
  cursor: grab;
  font-size: 18px;
  user-select: none;
}

.form-field-info {
  flex: 1;
}

.form-field-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.form-field-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-muted);
}

.form-field-actions {
  display: flex;
  gap: 8px;
}

.form-field-actions button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.form-field-actions button:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

.form-field-item {
  flex-wrap: wrap;
}

/* Empty State */
.leads-empty-state {
  text-align: center;
  padding: 48px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin: 20px 0;
}

.leads-empty-state-icon {
  font-size: 44px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.leads-empty-state h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.leads-empty-state p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

/* Buttons — Add Field & Export CSV */
.btn-add-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: var(--color-text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-add-field:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(220, 38, 38, 0.22);
}

.btn-export-csv {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1.5px solid rgba(220, 38, 38, 0.25);
  color: #dc2626;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-export-csv:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #dc2626;
  transform: translateY(-1px);
}

/* Error Banner */
.leads-error-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  color: #ef4444;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  margin: 16px 0;
}

.leads-error-banner::before {
  content: '\26A0\FE0F';
  font-size: 18px;
}

.leads-error-banner button {
  margin-left: auto;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 12px;
}

.leads-error-banner button:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Leads Table */
.leads-table-container {
  overflow-x: auto;
  margin-top: 16px;
}

.leads-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.leads-table thead th {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leads-table tbody td {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leads-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.leads-table tbody tr:last-child td {
  border-bottom: none;
}

/* ------------------------------------------------------------------ */
/*  Leads Page (standalone /leads route)                                */
/* ------------------------------------------------------------------ */
.leads-page {
  padding: calc(var(--nav-h) + 40px) var(--pad) 48px;
  background: var(--dark);
  min-height: 100vh;
}

.leads-header h1 {
  font-size: 28px;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}
.leads-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.btn-back:hover {
  color: #dc2626;
}

.leads-page .page-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 3vw, 36px);
  color: var(--color-text-primary);
  letter-spacing: -1px;
  margin: 0;
}

/* Stats Grid */
.leads-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.leads-page .stat-card {
  background: var(--dark-2);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  transition: all var(--ease);
}

.leads-page .stat-card:hover {
  border-color: var(--red-border);
  box-shadow: 0 8px 32px rgba(220,38,38,0.06);
  transform: translateY(-3px);
}

.leads-page .stat-label {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.leads-page .stat-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 32px;
  color: var(--color-text-primary);
  letter-spacing: -1px;
}

/* Controls */
.leads-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.leads-controls .search-box {
  flex: 1;
  min-width: 250px;
}

.leads-controls .search-input {
  width: 100%;
  background: var(--color-bg-page);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 18px;
  color: var(--color-text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: all 0.3s;
  box-sizing: border-box;
}

.leads-controls .search-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.leads-controls .search-input::-webkit-input-placeholder {
  color: var(--color-text-muted);
}

.leads-controls .filter-select {
  background: var(--color-bg-page);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 18px;
  color: var(--color-text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  min-width: 150px;
}

.leads-controls .filter-select:focus {
  outline: none;
  border-color: #dc2626;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: var(--color-text-primary);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(220, 38, 38, 0.22);
}

/* Table */
.leads-table-container {
  background: var(--color-bg-input);
  border: 1px solid var(--color-border-subtle);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
}

.leads-table thead th {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.leads-table tbody td {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leads-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.leads-table tbody tr:last-child td {
  border-bottom: none;
}

.lead-date {
  color: var(--color-text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.lead-name {
  font-weight: 700;
  color: var(--color-text-primary);
}

.lead-email,
.lead-phone {
  color: var(--color-text-secondary);
}

.lead-actions {
  display: flex;
  gap: 8px;
}

.lead-actions button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

.lead-actions .btn-view:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

.lead-actions .btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

/* Loading & Empty States */
.leads-table .loading-cell,
.leads-table .error-cell,
.leads-table .empty-cell {
  text-align: center;
  padding: 60px 20px !important;
}

.leads-table .empty-cell .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.leads-table .empty-cell h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text-secondary);
  margin: 0 0 8px 0;
}

.leads-table .empty-cell p {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0;
}

.retry-btn {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.2s;
}

.retry-btn:hover {
  background: rgba(220, 38, 38, 0.25);
}

/* Pagination */
#leads-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.page-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
}

.page-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

.page-btn.active {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  border-color: transparent;
  color: var(--color-text-primary);
}

/* Lead Detail Modal */
.lead-detail-modal {
  max-width: 480px;
}

.detail-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-row {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--color-text-secondary);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-row strong {
  color: var(--color-text-secondary);
  display: inline-block;
  min-width: 120px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-row:last-child {
  border-bottom: none;
}

/* ------------------------------------------------------------------ */
/*  Page Header (shared by leads / analytics / history)                */
/* ------------------------------------------------------------------ */
.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: #dc2626;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 3.5vw, 48px);
  color: var(--color-text-primary);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin: 0 0 12px 0;
}

.page-title .gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: 40px;
  line-height: 1.6;
}

/* Selector Section */
.selector-section {
  margin-bottom: 40px;
  max-width: 480px;
}

.selector-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.selector-wrapper {
  position: relative;
}

.chatbot-select {
  width: 100%;
  background: var(--color-bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 48px 14px 18px;
  color: var(--color-text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  appearance: none;
  transition: all 0.3s;
}

.chatbot-select:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.chatbot-select option {
  background: var(--color-bg-input);
  color: var(--color-text-primary);
  padding: 10px;
}

/* Custom dropdown arrow */
.selector-wrapper::after {
  content: '▼';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  font-size: 10px;
  pointer-events: none;
}

/* Leads Content Fade In */
#leads-content {
  animation: contentFadeIn 0.4s ease;
}

@keyframes contentFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive for leads page */
@media (max-width: 768px) {
  .leads-controls {
    flex-direction: column;
  }

  .leads-controls .search-box {
    min-width: 100%;
  }

  .leads-controls .filter-select {
    width: 100%;
  }

  .btn-export {
    width: 100%;
    justify-content: center;
  }

  .leads-page .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .leads-page .stat-card {
    padding: 16px;
  }

  .leads-page .stat-value {
    font-size: 24px;
  }

  .leads-table thead th,
  .leads-table tbody td {
    padding: 12px 14px;
  }

  .lead-email,
  .lead-phone {
    display: none;
  }
}

@media (max-width: 480px) {
  .leads-page .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SwisChat Dashboard — UX Enhancement Additions
   ═══════════════════════════════════════════════════════════════ */

/* ─── Feature 1: Tab Status Indicators ─── */
.tab-status {
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #374151;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.tab-status.complete {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34,197,94,0.4);
}
.tab-status.partial {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245,158,11,0.4);
}

/* ─── Feature 2: Sidebar Progress Bar ─── */
.sidebar-progress {
    padding: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border-subtle);
}
.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.progress-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-family: 'Outfit', sans-serif;
}
.progress-percent {
    font-size: 13px;
    color: #dc2626;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}
.progress-bar-track {
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.progress-hint {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 8px;
    font-family: 'DM Sans', sans-serif;
}

/* ─── Sidebar Navigation Links (multi-page dashboard) ─── */
.tab-subsections .sidebar-tab {
    display: block;
    padding: 10px 16px 10px 32px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    border-radius: 0;
    margin-bottom: 1px;
}
.tab-subsections .sidebar-tab:hover {
    color: var(--color-text-primary);
    background: rgba(255,255,255,0.03);
}
.tab-subsections .sidebar-tab.active {
    color: var(--color-text-primary);
    background: rgba(220,38,38,0.1);
    border-left-color: #dc2626;
}
.nav-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--color-text-primary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
}
.nav-group-toggle:hover {
    background: rgba(255,255,255,0.05);
}
.toggle-icon {
    color: var(--color-text-secondary);
    font-size: 12px;
    transition: transform 0.2s;
}
.nav-group.open .toggle-icon {
    transform: rotate(180deg);
}
.nav-group-toggle span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── Feature 3: Tab Footer Navigation ─── */
.tab-footer {
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    margin-top: 24px;
    border-top: 1px solid var(--color-border-subtle);
}
.btn-prev, .btn-next {
    min-width: 120px;
}

/* ─── Feature 4: Field Search Bar ─── */
.dashboard-search {
    position: relative;
    margin-bottom: 24px;
}
#field-search {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: var(--color-bg-page);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'DM Sans', sans-serif;
}
#field-search:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}
#field-search::placeholder {
    color: var(--color-text-muted);
}
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-input);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}
.search-results.active {
    display: block;
}
.search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    transition: background 0.15s;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background: rgba(220,38,38,0.1);
}
.search-result-item strong {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* ─── Feature 5: Field Validation Indicators ─── */
.field-block.valid .field-input,
.field-block.valid .field-textarea,
.field-block.valid .field-select {
    border-color: #22c55e;
}
.field-block.invalid .field-input,
.field-block.invalid .field-textarea,
.field-block.invalid .field-select {
    border-color: #dc2626;
}
.field-validation {
    font-size: 11px;
    margin-top: 4px;
    display: none;
}
.field-block.valid .field-validation.valid-msg {
    display: block;
    color: #22c55e;
}
.field-block.invalid .field-validation.invalid-msg {
    display: block;
    color: #dc2626;
}

/* ─── Feature 6: Required / Optional Badges ─── */
.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Outfit', sans-serif;
    vertical-align: middle;
}
.badge-required {
    background: rgba(220,38,38,0.15);
    color: #ef4444;
}
.badge-optional {
    background: rgba(107,114,128,0.15);
    color: var(--color-text-secondary);
}

/* ─── Feature 7: Tab Actions (Bulk AI Fill) ─── */
.tab-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* ─── GLOBAL LIGHT MODE CHECKBOX FIX ─── */
[data-theme="light"] input[type="checkbox"],
[data-theme="light"] .page-checkbox,
[data-theme="light"] .checkbox {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    border: 2px solid #a1a1aa !important;
    border-radius: 5px !important;
    background: #ffffff !important;
    cursor: pointer !important;
    position: relative !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}

[data-theme="light"] input[type="checkbox"]:checked,
[data-theme="light"] .page-checkbox:checked,
[data-theme="light"] .checkbox:checked {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
}

[data-theme="light"] input[type="checkbox"]:checked::after,
[data-theme="light"] .page-checkbox:checked::after,
[data-theme="light"] .checkbox:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 6px !important;
    top: 2px !important;
    width: 5px !important;
    height: 10px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

[data-theme="light"] input[type="checkbox"]:hover,
[data-theme="light"] .page-checkbox:hover,
[data-theme="light"] .checkbox:hover {
    border-color: #dc2626 !important;
}
/* ═══════════════════════════════════════════════════════════════
   Avatar Type Selection Cards (AI Provider Style)
   ═══════════════════════════════════════════════════════════════ */

/* Selection Cards Container */
.selection-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Selection Card */
.selection-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--dark-card);
    text-align: center;
}

.selection-card:hover {
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.selection-card.active {
    border-color: var(--red);
    background: rgba(220, 38, 38, 0.05);
}

/* Hide default radio */
.selection-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Card Elements */
.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--white);
    margin-bottom: 4px;
}

.card-desc {
    font-size: 13px;
    color: var(--muted);
}

/* Checkmark */
.card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.selection-card:not(.active) .card-check {
    opacity: 0;
}

.selection-card.active .card-check {
    opacity: 1;
}

/* Avatar Sections */
.avatar-section {
    animation: fadeIn 0.3s ease;
}

/* Emoji Grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-btn {
    aspect-ratio: 1;
    font-size: 24px;
    padding: 8px;
    border: 2px solid var(--border-dark);
    border-radius: 10px;
    background: var(--dark-card);
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-btn:hover {
    border-color: var(--red);
    transform: scale(1.1);
}

.emoji-btn.active {
    border-color: var(--red);
    background: rgba(220, 38, 38, 0.1);
}

/* Color Picker Row */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-row input[type="color"] {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.color-value {
    font-family: monospace;
    font-size: 14px;
    color: var(--muted);
}

/* Image Upload Area */
.image-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px dashed var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark-card);
    transition: border-color 0.2s;
}

.image-preview:hover {
    border-color: var(--red-border);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-placeholder {
    text-align: center;
    color: var(--muted);
}

.upload-placeholder span {
    font-size: 40px;
    display: block;
    margin-bottom: 4px;
}

.upload-placeholder p {
    font-size: 12px;
    margin: 0;
}

/* Light Mode Adjustments */
[data-theme="light"] .selection-card {
    background: var(--white);
    border-color: var(--border2);
}

[data-theme="light"] .selection-card.active {
    background: rgba(220, 38, 38, 0.05);
}

[data-theme="light"] .card-title {
    color: var(--black);
}

[data-theme="light"] .emoji-btn {
    background: var(--white);
    border-color: var(--border2);
}

[data-theme="light"] .image-preview {
    background: var(--white);
    border-color: var(--border2);
}

/* Custom Emoji Input - Name & Avatar Section */
.custom-emoji-input:focus {
    border-color: var(--red) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.custom-emoji-input:hover {
    border-color: rgba(220, 38, 38, 0.3);
}

/* Emoji Grid Section */
.emoji-grid-section {
    margin-bottom: 20px;
}

.section-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 10px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-btn {
    aspect-ratio: 1;
    font-size: 24px;
    padding: 8px;
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    background: var(--dark-card);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    border-color: var(--red);
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.02);
}

.emoji-btn.active {
    border-color: var(--red);
    background: rgba(220, 38, 38, 0.1);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Custom Input Section */
.custom-input-section {
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
}

.custom-input-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.custom-emoji-input {
    width: 100%;
    height: 56px;
    font-size: 24px;
    text-align: center;
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    background: var(--dark-card);
    color: rgba(255, 255, 255, 0.9);
    padding: 0 16px;
    transition: all 0.2s ease;
}

.custom-emoji-input:focus {
    border-color: var(--red);
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.custom-emoji-input::placeholder {
    font-size: 16px;
    color: var(--muted);
    opacity: 0.6;
}

/* Examples Text */
.examples-text {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    font-style: italic;
}

/* Light mode adjustments */
[data-theme="light"] .emoji-btn {
    background: var(--white);
    border-color: var(--border2);
}

[data-theme="light"] .emoji-btn:hover {
    background: var(--red-light);
}

[data-theme="light"] .custom-emoji-input {
    background: var(--white);
    border-color: var(--border2);
    color: var(--black);
}

[data-theme="light"] .custom-emoji-input::placeholder {
    color: var(--mid);
}

[data-theme="light"] .section-label {
    color: var(--mid);
}

[data-theme="light"] .examples-text {
    color: var(--mid);
}

[data-theme="light"] .custom-input-section {
    border-top-color: var(--border2);
}

/* ============================================================
   Color Themes page (Part A) — theme cards grid + swatch preview
   Rendered by public/js/color-themes.js into #themes-grid.
   ============================================================ */
#themes-grid { display:block; }

.theme-section-label {
    font-size:15px;
    font-weight:700;
    color:var(--color-text-primary);
    margin-bottom:12px;
}
.theme-section-sub {
    font-size:12px;
    font-weight:500;
    color:var(--color-text-muted);
    margin-left:6px;
}

.theme-grid-row {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
    gap:14px;
}

.theme-card {
    display:flex;
    flex-direction:column;
    gap:0;
    padding:0;
    background:var(--color-bg-input);
    border:1.5px solid var(--color-border-default);
    border-radius:12px;
    overflow:hidden;
    cursor:pointer;
    text-align:left;
    transition:border-color .18s, transform .18s, box-shadow .18s;
}
.theme-card:hover {
    border-color:var(--color-border-strong);
    transform:translateY(-2px);
    box-shadow:0 8px 22px rgba(0,0,0,.28);
}
.theme-card.is-active {
    border-color:#22c55e;
    box-shadow:0 0 0 1px #22c55e;
}

/* Swatch: header strip + body with two bubble dots over the chat bg */
.theme-swatch {
    height:76px;
    display:flex;
    flex-direction:column;
    border-bottom:1px solid rgba(255,255,255,.06);
}
.theme-swatch-header {
    height:26px;
    flex-shrink:0;
}
.theme-swatch-body {
    flex:1;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 12px;
}
.theme-swatch-dot {
    width:20px;
    height:20px;
    border-radius:50%;
    box-shadow:0 1px 4px rgba(0,0,0,.35);
}

.theme-card-meta {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:6px;
    padding:10px 12px 12px;
}
.theme-card-name {
    font-size:13px;
    font-weight:600;
    color:var(--color-text-primary);
}

.theme-badge {
    font-size:10px;
    font-weight:700;
    padding:2px 7px;
    border-radius:999px;
    line-height:1.5;
    white-space:nowrap;
}
.theme-badge-best {
    background:rgba(250,204,21,.14);
    color:#fbbf24;
    border:1px solid rgba(250,204,21,.3);
}
.theme-badge-ai {
    background:rgba(124,58,237,.14);
    color:#a78bfa;
    border:1px solid rgba(124,58,237,.3);
}
.theme-badge-active {
    background:rgba(34,197,94,.14);
    color:#4ade80;
    border:1px solid rgba(34,197,94,.3);
}

/* AI empty-state card (no AI themes generated yet) */
.theme-empty-state {
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    gap:6px;
    padding:28px 20px;
    background:rgba(124,58,237,.05);
    border:1.5px dashed rgba(124,58,237,.25);
    border-radius:12px;
}
.theme-empty-icon { font-size:26px; }
.theme-empty-text { font-size:14px; font-weight:700; color:var(--color-text-primary); }
.theme-empty-sub { font-size:12px; color:var(--color-text-muted); }

.theme-regen-btn {
    font-size:12px;
    font-weight:600;
    padding:8px 14px;
    background:rgba(124,58,237,.12);
    border:1px solid rgba(124,58,237,.25);
    color:#a78bfa;
    border-radius:8px;
    cursor:pointer;
    margin-top:6px;
}
.theme-regen-btn:hover { background:rgba(124,58,237,.2); }
.theme-regen-btn:disabled,
.theme-regen-btn.is-loading { opacity:.6; cursor:default; }
.theme-regen-btn.is-loading::after {
    content:"";
    display:inline-block;
    width:10px;height:10px;
    margin-left:6px;
    border:2px solid currentColor;
    border-right-color:transparent;
    border-radius:50%;
    animation:theme-regen-spin .8s linear infinite;
    vertical-align:-1px;
}
@keyframes theme-regen-spin { to { transform: rotate(360deg); } }

/* ─── Theme generation options modal ───
   Reuses the .ai-fill-overlay / .ai-fill-box shell (fixed, blurred, z-modal). */
.theme-gen-box { width: 460px; }
.theme-gen-field { margin-bottom: 18px; }
.theme-gen-label {
    display:block;
    font-size:13px;
    font-weight:600;
    color: var(--color-text-primary);
    margin-bottom:8px;
}
.theme-gen-optional {
    font-size:11px;
    font-weight:500;
    color: var(--muted);
    margin-left:4px;
}
.theme-gen-textarea {
    width:100%;
    box-sizing:border-box;
    padding:10px 12px;
    background: var(--color-bg-input);
    border:1.5px solid var(--border-dark);
    border-radius: var(--radius-md, 10px);
    color: var(--color-text-primary);
    font-size:13px;
    font-family:inherit;
    line-height:1.5;
    resize:vertical;
    min-height:64px;
}
.theme-gen-textarea:focus {
    outline:none;
    border-color:rgba(124,58,237,.5);
}
.theme-gen-textarea::placeholder { color: var(--muted); }

/* Toggle row */
.theme-gen-toggle-row {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    padding:12px 14px;
    background:rgba(124,58,237,.05);
    border:1px solid rgba(124,58,237,.18);
    border-radius: var(--radius-md, 10px);
    cursor:pointer;
}
.theme-gen-toggle-text { display:flex; flex-direction:column; gap:3px; }
.theme-gen-toggle-title { font-size:13px; font-weight:600; color: var(--color-text-primary); }
.theme-gen-toggle-hint { font-size:11px; color: var(--muted); line-height:1.4; }

/* iOS-style switch */
.theme-gen-switch { position:relative; flex-shrink:0; width:40px; height:22px; margin-top:2px; }
.theme-gen-switch input { position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; }
.theme-gen-slider {
    position:absolute; inset:0;
    background:rgba(255,255,255,.15);
    border-radius:999px;
    transition:background .2s;
    pointer-events:none;
}
.theme-gen-slider::before {
    content:""; position:absolute; top:2px; left:2px;
    width:18px; height:18px; border-radius:50%;
    background:#fff; transition:transform .2s;
}
.theme-gen-switch input:checked + .theme-gen-slider { background:#7c3aed; }
.theme-gen-switch input:checked + .theme-gen-slider::before { transform:translateX(18px); }

.theme-gen-warn {
    font-size:12px;
    color:#fca5a5;
    margin:12px 0 0;
}
.theme-gen-actions {
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:20px;
}

@media (max-width: 520px) {
    .theme-gen-box { width:100%; padding:20px; }
    .theme-gen-toggle-row { flex-direction:column; }
    .theme-gen-switch { align-self:flex-start; }
}
