/* ═══════════════════════════════════════════════════════════════════════
   CHATIQ — THE LUXURY REDESIGN
   ═══════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  /* Layout Constants */
  --sidebar-w: 260px;
  --header-h: 90px;
  --glass-blur: 32px;
  --radius-2xl: 40px;
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 10px;
  
  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* THEME: LUMIS TEAL (Premium Pro) */
  --bg-base: #020205; /* Deep Obsidian */
  --bg-surface: #06060a;
  --bg-card: rgba(10, 10, 15, 0.45);
  --bg-input: rgba(0, 0, 0, 0.6);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);
  
  --accent: #14b8a6; /* Lumis Teal */
  --accent-glow: rgba(20, 184, 166, 0.35);
  --accent-secondary: #2dd4bf;
  --accent-emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.25);
  
  --secondary: #14b8a6; /* Lumis Teal (Restored) */
  --muted: #64748b;
  --border: rgba(255, 255, 255, 0.05);
  --border-bright: rgba(255, 255, 255, 0.1);
  --glass-border: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
}

/* ═══════════════════════════════════════════════════════════════════════
   THEME: STUDIO LIGHT
   ═══════════════════════════════════════════════════════════════════════ */
.light-mode {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --accent: #4f46e5;
  --accent-secondary: #4338ca;
  --accent-emerald: #059669;
  --accent-rose: #be123c;
  --accent-amber: #b45309;
  
  --secondary: #0f172a; /* Dark text for light mode */
  --muted: #475569;
  --border: rgba(0, 0, 0, 0.12);
  --border-bright: rgba(0, 0, 0, 0.2);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);

  --blob-1: rgba(79, 70, 229, 0.1);
  --blob-2: rgba(225, 29, 72, 0.06);
  --blob-3: rgba(5, 150, 105, 0.06);
}

.light-mode body { color: var(--text-primary); }
.light-mode .page-title { color: var(--text-primary); }
.light-mode .sidebar { background: #ffffff; border-right: 2px solid var(--border); }

/* Force Overrides for Inline Styles and Hardcoded Colors in Light Mode */
.light-mode .sidebar-header { border-bottom: 2px solid var(--border) !important; }
.light-mode .logo-name { 
  background: none !important; 
  -webkit-text-fill-color: #0f172a !important; 
  color: #0f172a !important; 
}
.light-mode .logo-sub { color: #64748b !important; }

.light-mode .login-btn,
.light-mode .luxury-btn:not(.secondary-btn) {
  background: var(--accent) !important;
  color: #ffffff !important;
  border: none !important;
}

.light-mode .luxury-btn.secondary-btn {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid var(--border) !important;
}

/* Light Mode Contrast Fixes */
.light-mode .faq-q-text { color: #0f172a !important; font-weight: 700; }
.light-mode .faq-a-text { color: #334155 !important; }
.light-mode .luxury-table tr td { color: #0f172a !important; border-bottom: 1px solid #f1f5f9; }
.light-mode .luxury-table thead th { color: #64748b !important; background: #f8fafc !important; font-weight: 700; border-bottom: 2px solid #e2e8f0; }
.light-mode .faq-priority-stat { background: #f8fafc !important; color: #0f172a !important; border: 1px dashed #cbd5e1 !important; }
.light-mode .stat-value { color: #0f172a !important; }

.light-mode .bento-card {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-md) !important;
}

.light-mode .faq-luxury-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

.light-mode .faq-luxury-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 20px 50px -20px rgba(79, 70, 229, 0.15) !important;
}

.light-mode .login-input, 
.light-mode .select-input {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

.light-mode .nav-item { color: #64748b; }
.light-mode .nav-item.active { color: var(--accent); background: #f1f5f9; }

/* ─── NUCLEAR OVERRIDES (Light Mode Contrast) ─── */
/* These force dark colors on elements that have hardcoded white inline styles in HTML */
.light-mode [style*="color: #fff"], 
.light-mode [style*="color: #ffffff"],
.light-mode [style*="color:rgba(255,255,255"],
.light-mode [style*="color: rgba(255, 255, 255"],
.light-mode [style*="color: #888"],
.light-mode [style*="color:#888"] {
  color: #334155 !important;
}

/* Force dark icons */
.light-mode i[style*="color: rgba(255, 255, 255"],
.light-mode i[style*="color: #fff"],
.light-mode i[style*="color: var(--muted)"] {
  color: #475569 !important;
}

/* Specific component overrides */
.light-mode .stat-value { color: #0f172a !important; }
.light-mode .stat-label { color: #64748b !important; }
.light-mode #kb-total { color: #0f172a !important; }
.light-mode .login-btn[style*="background: transparent"] { color: #0f172a !important; border-color: #cbd5e1 !important; }
.light-mode input::placeholder { color: #475569 !important; font-weight: 500 !important; }
.light-mode .bento-card p[style*="color: var(--muted)"],
.light-mode .bento-card p[style*="color: #888"],
.light-mode .bento-card div[style*="color: var(--muted)"],
.light-mode .bento-card span[style*="color: var(--muted)"] {
  color: #475569 !important;
}

.light-mode .shimmer-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

.light-mode .shimmer-btn i,
.light-mode .shimmer-btn span {
  color: #0f172a !important;
}

.light-mode .shimmer-btn:hover {
  background: #e2e8f0 !important;
  border-color: var(--accent) !important;
}

.light-mode #demo-chat-container div[style*="color: var(--muted)"] {
  color: #64748b !important;
}

.light-mode button[style*="background: transparent"][style*="border: 1px solid rgba(255,255,255,0.1)"] {
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Global Scrollbar for Light Mode */
.light-mode ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1) !important; }
.light-mode ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2) !important; }

/* ─── Specific Element Level Light Mode Fixes ─── */
.light-mode .sidebar-header { border-bottom: 1px solid rgba(0,0,0,0.05) !important; }
.light-mode .sidebar-footer { border-top: 1px solid rgba(0,0,0,0.05) !important; }
.light-mode #sidebar-business-name { color: var(--text-primary) !important; }
.light-mode #plan-badge { color: var(--text-secondary) !important; }
.light-mode .sidebar-footer button { border: 1px solid rgba(0,0,0,0.1) !important; color: var(--text-muted) !important; }
.light-mode .sidebar-footer button:hover { background: rgba(0,0,0,0.05) !important; }

.light-mode .topbar .status-dot { box-shadow: 0 0 10px rgba(0,0,0,0.1) !important; }
.light-mode .select-input { background: #fff !important; border: 1px solid #e2e8f0 !important; color: #0f172a !important; }

.light-mode .bento-card.accent-rose .stat-label,
.light-mode .bento-card.accent-rose .stat-value { color: var(--accent-rose) !important; }
.light-mode .bento-card.accent-rose { border-color: rgba(244, 63, 94, 0.2) !important; }

.light-mode .chat-bubble.bot {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

.light-mode .chat-bubble.bot b {
    color: var(--accent) !important;
}

.light-mode .chat-bubble.user {
    background: var(--accent) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2) !important;
}

.light-mode .status-dot-pulsing {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

.light-mode .luxury-table tr:hover { background: rgba(0,0,0,0.02) !important; }
.light-mode .badge-attention { box-shadow: 0 0 12px rgba(239, 68, 68, 0.2) !important; border: 1px solid rgba(0,0,0,0.05) !important; }

/* ─── End Specific Fixes ─── */

/* Global semantic classes for compatibility */
.faq-q-text { color: #fff; }
.faq-a-text { color: rgba(255,255,255,0.6); }


/* ─── Background Design Blobs ─── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 500px;
  height: 500px;
  background: var(--accent);
  filter: blur(140px);
  opacity: 0.08;
  border-radius: 50%;
  animation: blobFloat 20s infinite alternate;
}

.blob-1 { top: -10%; left: -10%; width: 600px; height: 600px; background: var(--blob-1); filter: blur(120px); border-radius: 50%; opacity: 0.8; }
.blob-2 { bottom: -10%; right: -10%; width: 500px; height: 500px; background: var(--blob-2); filter: blur(100px); border-radius: 50%; opacity: 0.6; }
.blob-3 { top: 40%; left: 30%; width: 400px; height: 400px; background: var(--blob-3); filter: blur(80px); border-radius: 50%; opacity: 0.4; }

@keyframes blobFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 60px) scale(1.1); }
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--secondary);
  height: 100vh;
  display: flex;
  overflow-y: hidden; 
  -webkit-font-smoothing: antialiased;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* ─── Custom Scrollbar ─── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   FLOATING NAVIGATION
   ═══════════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 40px 24px;
  position: relative;
  z-index: 100;
  box-shadow: 10px 0 30px rgba(0,0,0,0.2);
}

.sidebar-logo {
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo-name {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to bottom right, #fff, #888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.nav-item:hover {
  color: var(--secondary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--bg-base);
  background: var(--secondary);
  box-shadow: 0 8px 20px rgba(255,255,255,0.1);
}

.nav-icon { font-size: 1.2rem; }

/* ═══════════════════════════════════════════════════════════════════════
   MAIN CANVAS
   ═══════════════════════════════════════════════════════════════════════ */
.main-canvas {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 40px 60px;
  position: relative;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.right-panel {
  width: 380px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 40px;
  background: rgba(255, 255, 255, 0.03) !important; /* Slight tint for differentiation */
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  background: linear-gradient(to bottom, #fff, #888);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ─── Sophisticated Inputs ─── */
.select-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--secondary);
  padding: 12px 20px;
  border-radius: 99px;
  font-family: var(--font-body);
  font-weight: 500;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.3s;
}

.select-input:hover { border-color: var(--border-bright); }

/* ─── Premium Scrollbar ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── Button Micro-interactions ─── */
button:active { transform: scale(0.96) !important; }
.nav-item:active { transform: scale(0.98); }

.login-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.login-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 20px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════════════
   BENTO DASHBOARD
   ═══════════════════════════════════════════════════════════════════════ */
.dashboard-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  gap: 24px;
}


.dashboard-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Status Selects for Outreach CRM */
.status-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}
.status-select:hover { border-color: var(--accent); }
.status-new { color: var(--muted); }
.status-contacted { color: #3b82f6; } /* Blue */
.status-replied { color: #f59e0b; } /* Amber */
.status-demo_sent { color: #a855f7; } /* Purple */
.status-signed { color: var(--accent-emerald); font-weight: 900; }
.status-rejected { color: var(--accent-rose); opacity: 0.6; }

.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s;
}

.bento-card:hover { 
  border-color: var(--border-bright); 
  transform: translateY(-6px) scale(1.005); 
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 20px -5px var(--accent-glow);
}

.bento-card:hover::before { opacity: 1; }

@keyframes glassShimmer {
  0% { transform: translateX(-100%) skewX(-15deg); }
  50% { transform: translateX(100%) skewX(-15deg); }
  100% { transform: translateX(100%) skewX(-15deg); }
}

.shimmer-btn {
  position: relative;
  overflow: hidden;
}

.shimmer-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 30%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
  animation: glassShimmer 3s infinite ease-in-out;
}

.bento-card.accent-glow:hover { box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 30px -5px var(--accent-glow); }
.bento-card.accent-emerald:hover { box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 30px -5px var(--emerald-glow); border-color: var(--accent-emerald); }
.bento-card.accent-rose:hover { box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.5), 0 0 30px -5px var(--rose-glow); border-color: var(--accent-rose); }

.faq-luxury-card {
  background: rgba(10, 10, 15, 0.7) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-luxury-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.3) !important;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6), 0 0 20px -5px rgba(99, 102, 241, 0.1);
}

/* Sizes */
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.row-2 { grid-row: span 2; }

/* ─── CHAT INTERFACE & BUBBLES ─── */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 10px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

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

.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.chat-bubble.system {
  align-self: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.75rem;
  padding: 8px 16px;
  border-radius: 100px;
  text-align: center;
  max-width: 90%;
}

/* ─── Stat Widgets ─── */
.stat-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.stat-trend {
  font-size: 0.85rem;
  margin-top: 8px;
  font-weight: 600;
}

.trend-up { color: var(--accent); }

/* ─── Interactive Components ─── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: 100%;
}

.luxury-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--secondary);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.luxury-btn:hover { background: var(--secondary); color: var(--bg-base); }
.luxury-btn i { font-size: 1.5rem; }
.luxury-btn span { font-weight: 600; font-size: 0.9rem; }

/* ═══════════════════════════════════════════════════════════════════════
   PAGES — REFINED
   ═══════════════════════════════════════════════════════════════════════ */
.page { display: none; width: 100%; animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.page.active { display: block; }

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

/* ─── Leads Table ─── */
.luxury-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.luxury-table th {
  padding: 24px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.luxury-table td {
  padding: 20px 24px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.luxury-table tr:last-child td { border-bottom: none; }
.luxury-table tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ─── Bot Test Modal — Refined ─── */
.modal-overlay {
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}

.modal-overlay.open { display: flex; }

.luxury-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  width: 640px;
  max-width: 90vw;
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

/* ═══════════════════════════════════════════════════════════════════════
   LOGIN OVERLAY — THE ART PIECE
   ═══════════════════════════════════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-glass {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(40px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px;
  text-align: center;
}

.login-logo {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 40px;
}

.login-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--secondary);
  padding: 16px 24px;
  font-size: 1.1rem;
  margin-bottom: 24px;
  text-align: center;
  transition: all 0.3s;
}

.login-input:focus { border-color: var(--secondary); }

/* ─── Mobile Responsiveness (Auth Modal) ─── */
@media (max-width: 580px) {
  .login-overlay {
    padding: 16px;
  }
  .login-glass {
    padding: 32px 20px;
    border-radius: var(--radius-lg);
  }
  .login-logo, .login-glass .logo-name {
    font-size: 1.8rem !important;
    margin-bottom: 24px !important;
  }
  .login-input {
    padding: 14px 20px;
    font-size: 1rem;
    margin-bottom: 16px;
  }
  .auth-divider {
    margin: 16px 0;
  }
  .social-login-grid {
    gap: 10px;
  }
  .social-btn {
    padding: 0 16px;
    font-size: 0.85rem;
  }
}

/* ─── Social Login Buttons (Moved from landing.css) ─── */
.social-login-grid {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 24px;
}

.social-btn {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    width: 100%;
    font-family: inherit;
}

.apple-btn {
    background: #000;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
}

.apple-btn:hover {
    background: #111;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.instagram-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
}

.instagram-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
}

.auth-divider {
    margin: 24px 0;
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    font-weight: 700;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.auth-divider span {
    padding: 0 12px;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: 99px; /* Capsular shape restored */
  background: var(--secondary);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

/* Specific styling for login/signup modal to match social buttons */
.login-overlay .login-btn {
  width: 100%;
  height: 40px;
  padding: 0;
  border-radius: 6px;
  margin-top: 10px;
}

.modal-overlay .login-btn {
  width: 100%;
}

.login-btn:active { transform: scale(0.98); }

/* ─── FAQ Cards Refined ─── */
.faq-luxury-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-q { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; }
.faq-a { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }

/* ─── Utilities ─── */
.hidden { display: none !important; }
.emerald { color: var(--accent); }
.status-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }

/* ─── Onboarding & Pricing ─── */
.pulse-loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7);
  animation: pulse 1.2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.pulse-loader.small {
  width: 14px;
  height: 14px;
}

@keyframes pulse {
  to { box-shadow: 0 0 0 30px rgba(20, 184, 166, 0); }
}

.price-card {
  padding: 40px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all 0.3s ease;
  position: relative;
}

.price-card.popular {
  border-color: var(--accent);
  background: rgba(20, 184, 166, 0.04);
}

.price-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-glow);
}

/* ─── Pulse Animation for Needs Attention ─── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-pill.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-pill.inactive {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-attention {
    display: inline-flex;
    align-items: center;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: pulse-red 2s infinite ease-in-out;
    margin-right: 8px;
}

@keyframes pulse-red {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.03); filter: brightness(1.2); box-shadow: 0 0 18px rgba(239, 68, 68, 0.5); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* ─── SaaS Micro-Animations ─── */
@keyframes msgPop {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-red-border {
  0% { border-color: rgba(244, 63, 94, 0.2); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.1); }
  50% { border-color: rgba(244, 63, 94, 0.6); box-shadow: 0 0 20px 0 rgba(244, 63, 94, 0.2); }
  100% { border-color: rgba(244, 63, 94, 0.2); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.1); }
}

.pulse-red-border {
  animation: pulse-red-border 3s infinite ease-in-out;
}

@keyframes status-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-dot-pulsing {
  width: 8px; height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  animation: status-pulse 2s infinite;
}

/* ─── Bento Card Enhancements ─── */
.bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-md);
}

.bento-card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-lg);
}

/* ─── Action Buttons Redesign ─── */
.luxury-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--secondary);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
  font-size: 0.9rem;
}

.luxury-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.luxury-btn:active { transform: translateY(0) scale(0.98); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVENESS (MOBILE & TABLET)
   ═══════════════════════════════════════════════════════════════════════ */

/* --- Tablet & Smaller Desktop --- */
@media (max-width: 1200px) {
  .app-container { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 12px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1001;
  }
  .sidebar .logo-section { margin-bottom: 0; }
  .sidebar .nav-list { display: flex; flex-direction: row; gap: 4px; }
  .sidebar .sidebar-footer { display: none; }
  .main-canvas { padding: 24px; margin: 0; }
  .right-panel { display: none; }
}

/* --- Mobile (768px and below) --- */
@media (max-width: 768px) {
  /* Bottom Navigation Style */
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    width: 100%;
    height: 72px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    flex-direction: row;
    padding: 0 16px;
    border-bottom: none;
    border-top: 1px solid var(--border);
    justify-content: center;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  }

  .sidebar .sidebar-logo { display: none !important; }
  .sidebar .sidebar-nav { width: 100%; display: flex; flex-direction: row; justify-content: space-around; padding: 0 10px; }
  .nav-item { flex: 1; flex-direction: column; height: 100%; gap: 6px; padding: 8px 0; justify-content: center; }
  .nav-item i { width: 20px; height: 20px; }
  .nav-item span { display: block; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin: 0; }

  .main-canvas {
    padding: 24px 16px; /* Restored mobile padding */
    padding-bottom: 90px;
  }
  
  .right-panel {
    width: 100%;
    height: auto;
    position: static;
    border-left: none;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 24px 0;
  }
  .dashboard-bento {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .col-2 { grid-column: span 1; }
  .bento-card { padding: 20px; }

  /* Fix for inner grids in cards */
  .bento-card [style*="grid-template-columns: 1fr 1fr"],
  .action-grid {
     grid-template-columns: 1fr !important;
     gap: 12px !important;
  }
  .action-grid .luxury-btn { padding: 16px; flex-direction: row; }

  /* Typography */
  .stat-value { font-size: 2.2rem !important; }
  .stat-label { font-size: 0.7rem; }
  .topbar { margin-bottom: 24px; }
  .page-title { font-size: 1.5rem; }
  
  /* Modal */
  .luxury-modal { width: 95vw; padding: 24px; }
}

@media (max-width: 480px) {
  .stat-value { font-size: 2rem !important; }
  .sidebar .nav-item span { display: none; }
}

/* ─── Responsive Grid Helpers ─── */
.grid-split-50 {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.grid-split-66-33 {
  display: grid;
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 768px) {
  .grid-split-50, .grid-split-66-33 {
    grid-template-columns: 1fr !important;
  }
}

/* ─── Typing Indicator ─── */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
}
.typing-indicator .dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  opacity: 0.5;
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out both;
}
.typing-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ─── Dashboard Locking (Onboarding Gate) ─── */
.dashboard-locked #sidebar,
.dashboard-locked main,
.dashboard-locked .top-nav {
  display: none !important;
}

.dashboard-locked .app-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100vh !important;
  width: 100vw !important;
  overflow: hidden !important;
  background: transparent !important; /* Let bg-blobs show through */
}

.dashboard-locked #onboarding-overlay {
  display: none; /* Default to none, let JS or .open class handle it */
}

#onboarding-overlay {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow-y: auto;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
}

#onboarding-overlay.open,
#onboarding-overlay:not(.hidden) {
  display: flex !important;
}

.onboarding-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(40px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 40px !important;
  width: 650px;
  max-width: 95%;
  min-height: 480px;
  padding: 56px 48px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 50px var(--accent-glow) !important;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  max-height: 90vh;
}

/* Wide Mode for Pricing/Plans */
.onboarding-card.pricing-view, 
.onboarding-card.wide {
  width: 1250px !important;
  max-width: 98% !important;
}

/* ─── HYBRID ONBOARDING: POPUP TO SCROLL ─── */

#setup-cta-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(15, 15, 20, 0.9), var(--bg-main));
  backdrop-filter: blur(20px);
}

.setup-cta-glass {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 40px;
  padding: 80px 60px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

#pricing-section {
  width: 100%;
  background: var(--bg-main);
  position: relative;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Override locked state to show CTA and Pricing */
.dashboard-locked #setup-cta-container,
.dashboard-locked #pricing-section {
  display: block !important;
}

.dashboard-locked #setup-cta-container {
  display: flex !important;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Pricing Grid Refinements */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1250px;
  margin: 0 auto;
}

.price-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  padding: 56px 40px;
  display: flex;
  flex-direction: column;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.price-card.popular {
  border-color: var(--accent) !important;
  background: rgba(20, 184, 166, 0.04) !important;
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow) !important;
}

.plan-name {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: -0.02em;
}

.plan-subtitle {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-price {
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 40px;
  letter-spacing: -0.03em;
}

.plan-price .period {
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 500;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 48px;
  flex: 1;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--secondary);
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.feature-list i {
  color: var(--accent-emerald);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.plan-btn {
  width: 100%;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.plan-btn.featured {
  background: var(--accent);
  color: #000;
  border: none;
  box-shadow: 0 10px 25px var(--accent-glow);
}

.plan-btn:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.plan-btn.featured:hover {
  background: #14f1d9;
  box-shadow: 0 15px 35px var(--accent-glow);
}

.popular-badge {
  position: absolute;
  top: 24px;
  right: -35px;
  background: var(--accent);
  color: #000;
  padding: 8px 40px;
  font-size: 0.7rem;
  font-weight: 900;
  transform: rotate(45deg);
  letter-spacing: 0.05em;
  box-shadow: 0 5px 15px var(--accent-glow);
}

/* ─── Initial Loading Overlay ─── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease-out, visibility 0.5s;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: #fff;
  opacity: 0.8;
  animation: pulse-text 2s infinite ease-in-out;
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

/* ─── Body Ready State ─── */
.body-ready .app-container {
  opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD RESPONSIVENESS (Any Device)
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root { --sidebar-w: 240px; }
  .main-canvas { padding: 32px 40px; }
  .dashboard-bento { grid-template-columns: repeat(2, 1fr); }
  .col-4, .col-3, .col-2 { grid-column: span 2; }
}

@media (max-width: 968px) {
  body.luxury-dark { overflow-y: auto; }
  .app-container { flex-direction: column; height: auto; }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 60px rgba(0,0,0,0.8);
    padding: 24px;
    z-index: 10000;
  }
  
  .sidebar.active { left: 0; }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s ease;
  }
  
  .sidebar-overlay.active { display: block; opacity: 1; }

  .main-canvas {
    padding: 100px 20px 40px;
    width: 100%;
    height: auto;
    overflow-y: visible;
  }

  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: rgba(2, 2, 5, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 9000;
    margin-bottom: 0;
  }

  .page-title { font-size: 1.8rem; }
  
  .dashboard-bento { 
    grid-template-columns: 1fr !important;
    gap: 16px; 
  }
  
  .col-4, .col-3, .col-2 { grid-column: span 1 !important; }
  
  .grid-split-50, .grid-split-66-33 {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  /* Stat scaling */
  .stat-value { font-size: 2.2rem; }
  .stat-widget { padding: 24px; }
  
  /* Table Responsiveness */
  .luxury-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .luxury-table {
    min-width: 600px; /* Force scrollable on small screens */
  }

  /* Modal Scaling */
  .luxury-modal {
    width: 95% !important;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 20px;
  }
}

@media (max-width: 480px) {
  .page-title { font-size: 1.5rem; }
  .topbar-right .select-input { display: none; } /* Hide business switcher icons on tiny screens */
  .setup-cta-glass h1 { font-size: 2rem; }
}

/* Hamburger Menu for Dashboard */
.db-mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 968px) {
  .db-mobile-toggle { display: block; }
}
