/* ============================================
   LeadFlow CRM — Design System & Interactive Demo
   Aesthetics: Deep Dark #070A0F, Glowing Emerald & Cyan
   ============================================ */

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

:root {
  --bg-dark: #070A0F;
  --bg-card: #0F172A;
  --bg-card-hover: #1E293B;
  --bg-sidebar: #0B1120;
  --bg-topbar: #0F172A;

  --color-primary: #10B981;
  --color-primary-hover: #059669;
  --color-primary-glow: rgba(16, 185, 129, 0.25);
  
  --color-cyan: #06B6D4;
  --color-cyan-glow: rgba(6, 182, 212, 0.25);
  
  --color-purple: #8B5CF6;
  --color-purple-glow: rgba(139, 92, 246, 0.25);

  --color-yellow: #F59E0B;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(16, 185, 129, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* View Containers */
.view-container {
  display: none;
  width: 100%;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.view-container.active {
  display: block;
  opacity: 1;
}

#demo-view.active {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #34D399 0%, #059669 100%);
}

.btn-emerald {
  background: #10B981;
  color: #000000;
  font-weight: 700;
}

.btn-emerald:hover {
  background: #34D399;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-purple {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  color: #FFF;
}

.btn-purple:hover {
  background: linear-gradient(135deg, #A78BFA 0%, #6D28D9 100%);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.pulse-effect {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==================== LANDING PAGE HERO ==================== */
.landing-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(7, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.landing-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.brand-name span {
  color: var(--color-primary);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.landing-hero-section {
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.landing-hero-section::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Hero Elements */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  position: relative;
  z-index: 1;
}

.highlight-text {
  background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  position: relative;
  z-index: 1;
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4rem;
  position: relative;
  z-index: 1;
}

.live-status-pill:hover {
  border-color: var(--color-primary);
  color: var(--text-main);
  background: rgba(15, 23, 42, 1);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-primary);
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.pill-action {
  color: var(--color-primary);
  font-weight: 600;
}

/* Feature Cards Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  text-align: left;
  position: relative;
  z-index: 1;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-highlight);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.feature-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-cyan { background: rgba(6, 182, 212, 0.15); color: var(--color-cyan); }
.bg-emerald { background: rgba(16, 185, 129, 0.15); color: var(--color-primary); }
.bg-purple { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }

.feature-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
}

.feature-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.feature-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
}

.feature-card:hover .arrow {
  transform: translateX(4px);
}

.arrow {
  transition: transform 0.2s ease;
}

.landing-footer {
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ==================== LIVE DEMO SYSTEM APP ==================== */
.app {
  display: flex;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
}

/* Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-logo h1 {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
  line-height: 1.1;
}

.sidebar-logo h1 span {
  color: var(--color-primary);
}

.sidebar-tagline {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 500;
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.sidebar-nav a.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-primary);
  font-weight: 700;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 4px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

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

.nav-badge {
  margin-left: auto;
  background: var(--color-primary);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.demo-badge-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-primary);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-dark);
}

/* Topbar */
.topbar {
  padding: 1rem 2rem;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
}

.topbar-clinic {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-icon {
  font-size: 1.5rem;
}

.clinic-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: block;
}

.clinic-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #06B6D4);
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pages Section */
.page {
  display: none;
  padding: 2rem;
  flex: 1;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-header h2 {
  font-size: 1.6rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.live-pill {
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-primary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

/* Highlight Banner */
.highlight-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 182, 212, 0.05) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.highlight-icon {
  font-size: 2rem;
}

.highlight-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.highlight-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.highlight-value {
  margin-left: auto;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-icon {
  font-size: 1.5rem;
}

.metric-trend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
}

.metric-trend.positive {
  color: var(--color-primary);
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Dashboard Details Grid */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.dash-card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--color-primary); }
.badge-info { background: rgba(6, 182, 212, 0.2); color: var(--color-cyan); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: var(--color-purple); }

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feed-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.feed-info {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.4;
}

.feed-info strong {
  color: var(--text-main);
}

.feed-time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.feed-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Bot Status Widget */
.bot-status-widget {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bot-status-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator.online {
  width: 10px;
  height: 10px;
  background: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--color-primary);
}

.bot-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  text-align: center;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
  color: var(--color-primary);
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== KANBAN BOARD ==================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 1rem;
}

@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 550px;
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.col-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-blue { background: var(--color-cyan); }
.dot-purple { background: var(--color-purple); }
.dot-yellow { background: var(--color-yellow); }
.dot-green { background: var(--color-primary); }

.col-count {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
}

.kanban-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.kanban-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: grab;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
}

.card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.tag-blue { background: rgba(6, 182, 212, 0.15); color: var(--color-cyan); }
.tag-purple { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.tag-yellow { background: rgba(245, 158, 11, 0.15); color: var(--color-yellow); }
.tag-green { background: rgba(16, 185, 129, 0.15); color: var(--color-primary); }

.card-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.card-price {
  font-weight: 800;
  color: var(--color-primary);
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-card-action:hover {
  background: var(--color-primary);
  color: #000;
  font-weight: 700;
}

/* ==================== MULTIATENDIMENTO WHATSAPP CHAT ==================== */
.chat-toggle-ai {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.chat-app-container {
  display: flex;
  height: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.chat-list-sidebar {
  width: 300px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.chat-search {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.chat-search input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
}

.chat-threads {
  flex: 1;
  overflow-y: auto;
}

.chat-thread-item {
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.chat-thread-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chat-thread-item.active {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--color-primary);
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1E293B;
  color: var(--color-primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.thread-info {
  flex: 1;
  overflow: hidden;
}

.thread-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.thread-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
}

.thread-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Main Window */
.chat-window-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0B1120;
}

.chat-header-bar {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-user-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-user-details h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.active-status {
  font-size: 0.75rem;
  color: var(--color-primary);
}

.chat-messages-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin: 0.5rem 0;
}

.chat-bubble {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  position: relative;
}

.chat-bubble.received {
  align-self: flex-start;
  background: #1E293B;
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: #054F3E;
  color: #FFF;
  border-bottom-right-radius: 2px;
}

.ai-bubble {
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.ai-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.bubble-time {
  font-size: 0.68rem;
  opacity: 0.7;
  text-align: right;
  margin-top: 0.3rem;
}

.chat-input-area {
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-input-area input {
  flex: 1;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
}

/* ==================== AI AGENTS PAGE ==================== */
.ai-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.agent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.agent-icon {
  width: 44px;
  height: 44px;
  background: rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.agent-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.agent-card-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.agent-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
  margin-bottom: 1.25rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ai-tester-box {
  background: var(--bg-card);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.tester-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tester-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tester-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.tester-input-group input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
}

.tester-output {
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.88rem;
  color: #C084FC;
  min-height: 80px;
}

/* ==================== REACTIVATION & RESULT ==================== */
.reactivation-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.reactivation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reactivation-info { flex: 1; }
.reactivation-name { font-weight: 700; font-size: 1rem; }
.reactivation-detail { font-size: 0.85rem; color: var(--text-muted); }
.reactivation-value { text-align: right; }
.reactivation-amount { font-size: 1.2rem; font-weight: 800; color: var(--color-primary); }
.reactivation-label { font-size: 0.75rem; color: var(--text-dim); }

.info-text {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.result-hero {
  text-align: center;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  margin-bottom: 2rem;
}

.result-emoji { font-size: 3rem; margin-bottom: 1rem; }
.result-hero h2 { font-size: 1.8rem; font-family: 'Syne', sans-serif; margin-bottom: 0.5rem; }
.result-hero p { color: var(--text-muted); margin-bottom: 1.5rem; }
.result-total { font-size: 3.5rem; font-weight: 800; font-family: 'Syne', sans-serif; color: var(--color-primary); }
.result-total-label { font-size: 0.9rem; color: var(--text-dim); }

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.result-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.result-item-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.result-item-value { font-size: 1.6rem; font-weight: 800; color: var(--color-primary); }
.result-item-label { font-size: 0.85rem; color: var(--text-muted); }

.result-cta {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
}

.result-cta h3 { font-size: 1.4rem; font-family: 'Syne', sans-serif; margin-bottom: 0.75rem; }
.result-cta p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ==================== MODAL OVERLAY ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.75rem;
  box-shadow: var(--shadow-glow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 { font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.form-group input, .form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.9rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

/* Responsive Media Queries */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0; bottom: 0;
  }
  .sidebar.open { left: 0; }
  .menu-toggle-btn { display: block; }
  .topbar { padding: 1rem; }
  .page { padding: 1rem; }
  .chat-app-container { flex-direction: column; height: auto; }
  .chat-list-sidebar { width: 100%; height: 200px; }
}
