/* ==========================================================================
   QuickSell AI - UI/UX Pro Max Design System
   SaaS Dashboard & WhatsApp Conversational Sales Agent
   ========================================================================== */

:root {
  /* Semantic Brand Colors (UI/UX Pro Max Standard) */
  --color-primary: #10B981;
  --color-primary-hover: #059669;
  --color-primary-dark: #064E3B;
  --color-on-primary: #FFFFFF;
  
  --color-secondary: #0F172A;
  --color-secondary-hover: #1E293B;
  --color-on-secondary: #FFFFFF;

  --color-accent: #FF6243;
  --color-accent-hover: #EA4E2F;
  --color-on-accent: #FFFFFF;

  --color-background: #F8FAFC;
  --color-foreground: #0F172A;

  --color-card: #FFFFFF;
  --color-card-foreground: #0F172A;

  --color-muted: #F1F5F9;
  --color-muted-foreground: #64748B;

  --color-border: #E2E8F0;
  --color-border-focus: #10B981;

  --color-destructive: #EF4444;
  --color-destructive-hover: #DC2626;
  --color-on-destructive: #FFFFFF;

  --color-ring: #10B981;

  /* WhatsApp Native Surface Tokens */
  --color-wa-teal: #075E54;
  --color-wa-teal-light: #128C7E;
  --color-wa-bright: #25D366;
  --color-wa-chat-bg: #EFEAE2;
  --color-wa-bubble-ai: #FFFFFF;
  --color-wa-bubble-user: #D9FDD3;
  --color-wa-check-blue: #53BDEB;

  /* Backwards-compatibility aliases */
  --wa-primary: var(--color-primary);
  --wa-primary-hover: var(--color-primary-hover);
  --wa-dark: var(--color-primary-dark);
  --wa-teal: var(--color-wa-teal);
  --wa-teal-light: var(--color-wa-teal-light);
  --wa-bright: var(--color-wa-bright);
  --wa-chat-bg: var(--color-wa-chat-bg);
  --wa-bubble-ai: var(--color-wa-bubble-ai);
  --wa-bubble-user: var(--color-wa-bubble-user);
  --wa-check-blue: var(--color-wa-check-blue);
  --whop-orange: var(--color-accent);
  --whop-purple: #6366F1;
  --whop-dark: #11141A;
  --whop-border: var(--color-border);
  --bg-page: var(--color-background);
  --bg-surface: var(--color-card);
  --bg-surface-soft: var(--color-muted);
  --bg-surface-tint: #F0FDF4;
  --text-main: var(--color-foreground);
  --text-secondary: #475569;
  --text-muted: var(--color-muted-foreground);
  --text-on-dark: #FFFFFF;
  --border-light: var(--color-border);
  --border-emerald: #A7F3D0;
  --border-focus: var(--color-border-focus);

  /* 4/8px Spacing Rhythm */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Typography Stacks */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 16px -2px rgba(16, 185, 129, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-pop: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 16px rgba(37, 211, 102, 0.35);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-background);
  color: var(--color-foreground);
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Accessibility Focus Ring */
:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

/* ==========================================================================
   TOP BAR: Whop SaaS & Store Status
   ========================================================================== */
.whop-top-bar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-light);
  height: 62px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.whop-brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.whop-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF1EE;
  color: var(--whop-orange);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #FFD9D2;
}

.whop-logo-mark {
  width: 18px;
  height: 18px;
  background: var(--whop-orange);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
}

.store-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.store-dot {
  width: 8px;
  height: 8px;
  background: var(--wa-bright);
  border-radius: 50%;
}

.store-name {
  font-weight: 700;
  color: var(--text-main);
}

.store-id {
  color: var(--text-muted);
  font-size: 12px;
}

.whop-center-status {
  display: flex;
  align-items: center;
}

.quota-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface-tint);
  border: 1px solid var(--border-emerald);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  color: var(--wa-dark);
}

.quota-mini-bar {
  width: 70px;
  height: 6px;
  background: #D1FAE5;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wa-bright), var(--wa-primary));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.whop-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--wa-teal);
  background: #ECFDF5;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid #A7F3D0;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: var(--wa-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(37, 211, 102, 0.4);
  animation: pulseGreen 1.8s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  font-family: inherit;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--color-muted);
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: #E2E8F0;
}

.btn-whop-outline {
  background: #FFFFFF;
  color: var(--color-muted-foreground);
  border: 1px solid var(--color-border);
  font-size: 12.5px;
  padding: 6px 12px;
}

.btn-whop-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-customer-view {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-customer-view:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  color: #FFFFFF;
}

.btn-whop-upgrade {
  background: linear-gradient(135deg, #FF6243 0%, #EA580C 100%);
  color: #FFFFFF;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(255, 98, 67, 0.3);
}

.btn-whop-upgrade:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-download-zip {
  background: #0F172A;
  color: #FFFFFF;
  font-size: 12.5px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
}

.btn-download-zip:hover {
  background: #1E293B;
  transform: translateY(-1px);
}

.btn-outline-sm {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline-sm:hover {
  background: #F8FAFC;
  border-color: var(--wa-primary);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   APP LAYOUT & SIDEBARS
   ========================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Simulated Whop Sidebar (for Previewing Embedded State) */
.whop-simulation-sidebar {
  width: 200px;
  background: #11141A;
  color: #94A3B8;
  display: none;
  flex-direction: column;
  border-right: 1px solid #1E293B;
  padding: 16px 12px;
  user-select: none;
  animation: fadeIn 0.2s ease;
}

.app-layout.whop-frame-active .whop-simulation-sidebar {
  display: flex;
}

.whop-hub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px 8px;
  border-bottom: 1px solid #1E293B;
  margin-bottom: 16px;
}

.whop-circle-logo {
  width: 32px;
  height: 32px;
  background: var(--whop-orange);
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.whop-hub-text strong {
  display: block;
  font-size: 13px;
  color: #FFFFFF;
}

.whop-hub-text small {
  font-size: 11px;
  color: #64748B;
}

.whop-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.whop-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #94A3B8;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.whop-nav-item:hover, .whop-nav-item.active {
  background: #1E293B;
  color: #FFFFFF;
}

.whop-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #181E29;
  border-radius: var(--radius-md);
  margin-top: auto;
}

.whop-avatar {
  width: 28px;
  height: 28px;
  background: var(--whop-purple);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whop-user-info .user-handle {
  display: block;
  font-size: 12px;
  color: #FFFFFF;
  font-weight: 600;
}

.whop-user-info .whop-plan-tag {
  font-size: 10px;
  color: #38BDF8;
}

/* MAIN APP SIDEBAR */
.main-sidebar {
  width: 260px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  flex-shrink: 0;
}

.app-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--wa-teal);
  font-weight: 600;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  min-height: 44px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--color-muted-foreground);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  font-family: inherit;
  position: relative;
  width: 100%;
}

.nav-tab:hover {
  background: var(--bg-surface-tint);
  color: var(--color-primary-dark);
}

.nav-tab.active {
  background: #ECFDF5;
  color: var(--color-primary-dark);
  font-weight: 700;
  border-left: 3px solid var(--color-primary);
}

.nav-tab:active {
  transform: translateY(1px);
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--color-muted-foreground);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.nav-tab:hover .tab-icon,
.nav-tab.active .tab-icon {
  color: var(--color-primary);
}

.tab-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  background: var(--wa-bright);
  color: #064E3B;
}

.tab-count {
  margin-left: auto;
  font-size: 11px;
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

.tab-count.orders-count {
  background: #DCFCE7;
  color: var(--wa-dark);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
}

.agent-live-card {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1px solid var(--border-emerald);
  padding: 14px;
  border-radius: var(--radius-md);
}

.live-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--wa-dark);
  margin-bottom: 4px;
}

.green-dot {
  width: 6px;
  height: 6px;
  background: var(--wa-bright);
  border-radius: 50%;
}

.live-card-desc {
  font-size: 11.5px;
  color: #166534;
  line-height: 1.4;
  margin-bottom: 10px;
}

.sound-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px dashed #BBF7D0;
  padding-top: 8px;
}

.sound-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--wa-dark);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--wa-primary); }
input:checked + .slider:before { transform: translateX(14px); }

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex: 1;
  background: #F8FAFC;
  overflow-y: auto;
  padding: 24px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

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

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.pane-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.pane-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   TAB 1: WHATSAPP SIMULATOR & AGENT SANDBOX
   ========================================================================== */
.simulator-wrapper {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
  align-items: start;
}

/* Phone Mockup Frame */
.whatsapp-mockup-container {
  display: flex;
  justify-content: center;
}

.whatsapp-phone-frame {
  width: 100%;
  max-width: 440px;
  height: 740px;
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 44px -8px rgba(0, 0, 0, 0.14), 0 4px 16px -2px rgba(16, 185, 129, 0.1);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Realistic Smartphone Top Status Bar */
.wa-device-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 4px 18px;
  background: var(--color-wa-teal);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
  user-select: none;
}

.device-time {
  font-family: var(--font-sans);
  font-weight: 700;
}

.device-dynamic-notch {
  width: 88px;
  height: 14px;
  background: #042F24;
  border-radius: var(--radius-pill);
}

.device-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #FFFFFF;
}

/* WhatsApp Header */
.wa-chat-header {
  background: var(--wa-teal);
  color: #FFFFFF;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wa-header-back {
  cursor: pointer;
  opacity: 0.85;
}

.wa-avatar-wrapper {
  position: relative;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: #FFFFFF;
  border: 2px solid #FFFFFF;
}

.wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-avatar-wrapper .online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: var(--wa-bright);
  border: 2px solid var(--wa-teal);
  border-radius: 50%;
}

.wa-header-info {
  flex: 1;
  min-width: 0;
}

.wa-contact-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-contact-status {
  font-size: 11.5px;
  color: #D1FAE5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.handoff-pill {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: var(--transition-fast);
}

.handoff-pill:hover {
  background: rgba(255, 255, 255, 0.3);
}

.handoff-pill.human-active {
  background: #EF4444;
  border-color: #F87171;
}

.wa-icon-btn {
  background: none;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.wa-icon-btn:hover {
  opacity: 1;
}

/* Chat Body */
.wa-chat-body {
  flex: 1;
  background-color: var(--wa-chat-bg);
  background-image: radial-gradient(#CBD5E1 0.75px, transparent 0.75px);
  background-size: 14px 14px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-date-divider {
  text-align: center;
  margin: 4px 0;
}

.wa-date-divider span {
  background: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wa-encryption-notice {
  background: #FFFBEB;
  color: #92400E;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #FDE68A;
}

/* Chat Rows & Bubbles */
.wa-message-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.wa-message-row.incoming-ai {
  align-self: flex-start;
}

.wa-message-row.outgoing-user {
  align-self: flex-end;
}

.wa-bubble {
  padding: 9px 12px 6px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  font-size: 13px;
  line-height: 1.45;
}

.incoming-ai .wa-bubble {
  background: var(--wa-bubble-ai);
  color: var(--text-main);
  border-top-left-radius: 2px;
}

.outgoing-user .wa-bubble {
  background: var(--wa-bubble-user);
  color: var(--text-main);
  border-top-right-radius: 2px;
}

.wa-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10px;
  color: #64748B;
  margin-top: 4px;
}

.wa-checks.read {
  color: var(--wa-check-blue);
  font-weight: 700;
}

/* In-Chat Rich Cards (Product / Checkout Card) */
.wa-product-card, .wa-checkout-card {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wa-checkout-card {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
}

.card-product-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.card-product-img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.card-product-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.card-product-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--wa-primary-hover);
}

.card-invoice-line {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.card-invoice-total {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: var(--wa-dark);
  border-top: 1px dashed #BBF7D0;
  padding-top: 6px;
  margin-top: 4px;
}

.btn-pay-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
  transition: var(--transition-fast);
}

.btn-pay-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

/* Quick Chips */
.wa-quick-chips {
  background: #FFFFFF;
  border-top: 1px solid var(--border-light);
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  align-items: center;
  scrollbar-width: none;
}

.wa-quick-chips::-webkit-scrollbar { display: none; }

.chip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.chip-btn {
  background: #F1F5F9;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.chip-btn:hover {
  background: #ECFDF5;
  border-color: var(--wa-primary);
  color: var(--wa-dark);
}

.chip-btn.chip-danger:hover {
  background: #FEF2F2;
  border-color: #F87171;
  color: #B91C1C;
}

/* Chat Input Footer */
.wa-chat-footer {
  background: #F0F2F5;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #E2E8F0;
}

.wa-input-container {
  flex: 1;
  background: #FFFFFF;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 4px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wa-input-container input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 6px 8px;
  font-family: inherit;
}

.wa-attach-btn {
  background: none;
  border: none;
  color: #64748B;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.wa-attach-btn:hover {
  color: var(--wa-teal);
}

.wa-send-btn {
  width: 38px;
  height: 38px;
  background: var(--wa-teal);
  color: #FFFFFF;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 2px 6px rgba(7, 94, 84, 0.3);
}

.wa-send-btn:hover {
  background: var(--wa-teal-light);
  transform: scale(1.05);
}

/* Right: Inspector Card */
.simulator-inspector {
  display: flex;
  flex-direction: column;
}

.inspector-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inspector-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspector-icon {
  font-size: 18px;
}

.inspector-title-group h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.latency-badge {
  background: #ECFDF5;
  color: var(--wa-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid #A7F3D0;
}

.inspector-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.45;
}

.inspector-section {
  margin-bottom: 16px;
}

.section-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.intent-pill-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.intent-tag {
  background: #EEF2FF;
  color: #4F46E5;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #C7D2FE;
}

.confidence-tag {
  font-size: 11.5px;
  color: #059669;
  font-weight: 600;
}

.entities-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: #F8FAFC;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.entity-item {
  font-size: 12px;
}

.entity-item .ekey {
  color: var(--text-muted);
  font-weight: 600;
}

.entity-item .eval {
  color: var(--text-main);
  font-weight: 700;
}

.tool-calls-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-call-item {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: 'Courier New', Courier, monospace;
}

.tool-call-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11.5px;
}

.tool-badge {
  color: #38BDF8;
  font-weight: 700;
}

.tool-status {
  color: #4ADE80;
  font-size: 10.5px;
}

.tool-json {
  font-size: 11px;
  color: #CBD5E1;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.rules-applied-card {
  background: #F0FDF4;
  border: 1px solid var(--border-emerald);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #166534;
}

.whop-dispatch-box {
  background: #FFF1EE;
  border: 1px solid #FFD9D2;
  border-radius: var(--radius-md);
  padding: 12px;
}

.dispatch-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.whop-mini-tag {
  color: var(--whop-orange);
  font-weight: 800;
  font-size: 11.5px;
}

.currency-tag {
  color: #9A3412;
  font-size: 11px;
  font-weight: 700;
}

.dispatch-details p {
  font-size: 12px;
  color: #7C2D12;
  line-height: 1.4;
}

/* ==========================================================================
   TAB 2: DASHBOARD STATS & FUNNEL
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-emerald);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stat-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

.stat-trend.positive {
  background: #DCFCE7;
  color: #166534;
}

.stat-trend.neutral {
  background: #F1F5F9;
  color: #475569;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.stat-footer {
  font-size: 11.5px;
  color: var(--text-muted);
}

.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

/* Sales Funnel */
.funnel-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.funnel-step .step-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.step-title {
  font-weight: 600;
  color: var(--text-main);
}

.step-count {
  color: var(--text-secondary);
  font-size: 12px;
}

.step-bar-bg {
  width: 100%;
  height: 8px;
  background: #F1F5F9;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.step-bar-fill {
  height: 100%;
  background: #94A3B8;
  border-radius: var(--radius-pill);
}

.step-bar-fill.emerald {
  background: linear-gradient(90deg, #10B981, #059669);
}

.funnel-step.highlight .step-title {
  color: var(--wa-primary-hover);
  font-weight: 700;
}

/* Plan Usage Card */
.quota-large-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quota-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.big-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
}

.quota-of {
  font-size: 14px;
  color: var(--text-muted);
}

.quota-meter {
  height: 10px;
  background: #F1F5F9;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.meter-bar {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #059669);
  border-radius: var(--radius-pill);
}

.quota-detail {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #F8FAFC;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #FBFDFB;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.badge-emerald { background: #DCFCE7; color: #166534; }
.badge-whop { background: #FFF1EE; color: #EA580C; }
.badge-neutral { background: #F1F5F9; color: #475569; }

/* ==========================================================================
   TAB 3: PRODUCT CATALOG
   ========================================================================== */
.catalog-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  width: 320px;
}

.search-box input {
  border: none;
  outline: none;
  font-size: 13px;
  width: 100%;
  font-family: inherit;
}

.category-pills {
  display: flex;
  gap: 6px;
}

.cat-pill {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-fast);
}

.cat-pill.active, .cat-pill:hover {
  background: #ECFDF5;
  color: var(--wa-dark);
  border-color: var(--wa-primary);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15);
  border-color: var(--border-emerald);
}

.product-thumb-container {
  height: 220px;
  position: relative;
  background: #F1F5F9;
  overflow: hidden;
}

.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-thumb-img {
  transform: scale(1.04);
}

.product-stock-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.product-stock-tag.in-stock { color: #166534; }
.product-stock-tag.low-stock { color: #EA580C; background: #FFF7ED; }

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.product-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.product-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.current-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--wa-primary-hover);
}

.compare-price {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

/* ==========================================================================
   TAB 5: SHIPPING
   ========================================================================== */
.shipping-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.rates-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rate-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.rate-carrier-info strong {
  display: block;
  font-size: 14px;
  color: var(--text-main);
}

.rate-carrier-info small {
  color: var(--text-secondary);
  font-size: 12px;
}

.rate-price-tag {
  font-size: 16px;
  font-weight: 800;
  color: var(--wa-dark);
}

.shipping-calculator-tester {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.shipping-calculator-tester h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.calc-row {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.calc-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.calc-result-box {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

.calc-carrier { font-weight: 700; color: var(--wa-dark); }
.calc-price { font-weight: 700; color: #047857; margin: 2px 0; }
.calc-note { color: #065F46; font-size: 11.5px; }

/* ==========================================================================
   TAB 6: AI RULES & PERSONA
   ========================================================================== */
.ai-rules-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.form-group input, .form-group select, .form-group textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
  background: #FFFFFF;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--wa-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.input-with-prefix input {
  padding-left: 24px;
  width: 100%;
}

.helper-text {
  font-size: 11.5px;
  color: var(--text-muted);
}

.card-divider {
  height: 1px;
  background: var(--border-light);
  margin: 20px 0;
}

.system-prompt-code {
  background: #0F172A;
  color: #E2E8F0;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  font-family: 'Courier New', Courier, monospace;
}

/* ==========================================================================
   TAB 7: WHATSAPP GATEWAY
   ========================================================================== */
.wa-gateway-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.qr-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-light);
  margin: 16px 0;
}

.qr-code-art {
  padding: 12px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.qr-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.refresh-indicator {
  width: 6px;
  height: 6px;
  background: var(--wa-bright);
  border-radius: 50%;
  animation: pulseGreen 1.5s infinite;
}

.input-with-copy {
  display: flex;
  gap: 8px;
}

.input-with-copy input {
  flex: 1;
}

/* ==========================================================================
   TAB 8: WHOP PLANS
   ========================================================================== */
.whop-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.whop-plan-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-normal);
}

.whop-plan-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-emerald);
}

.whop-plan-card.active-tier {
  border: 2px solid var(--wa-primary);
  background: #FCFDFD;
}

.plan-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.plan-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.plan-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  min-height: 32px;
}

.plan-price-box {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 16px;
}

.plan-price {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-main);
}

.plan-period {
  font-size: 13px;
  color: var(--text-muted);
}

.plan-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  flex: 1;
}

.plan-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.whop-integration-info {
  background: #F8FAFC;
}

.info-specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.spec-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.spec-label {
  font-weight: 700;
  color: var(--text-main);
  width: 140px;
}

.spec-row code {
  background: #E2E8F0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  color: #0F172A;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-dialog.modal-lg {
  max-width: 840px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #F8FAFC;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.zip-contents-card {
  background: #F0FDF4;
  border: 1px solid var(--border-emerald);
  padding: 14px;
  border-radius: var(--radius-md);
  margin: 10px 0;
}

.zip-contents-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--wa-dark);
  margin-bottom: 8px;
}

.zip-contents-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: #166534;
}

.whop-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.whop-circle-logo-sm {
  width: 24px;
  height: 24px;
  background: var(--whop-orange);
  color: #FFFFFF;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-plans-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 10px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideToast 0.25s ease;
}

.toast.success { border-left: 4px solid var(--wa-bright); }
.toast.info { border-left: 4px solid #38BDF8; }

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

/* ==========================================================================
   TAB 9: EMAIL ZIP DELIVERY & FULFILLMENT STYLES
   ========================================================================== */
.fulfillment-pipeline-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.pipeline-step-card {
  padding: 16px 20px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: #FFFFFF;
  position: relative;
}

.pipeline-step-card.highlight-step {
  border: 1.5px solid var(--wa-primary);
  background: #F0FDF4;
}

.step-num-badge {
  width: 26px;
  height: 26px;
  background: var(--wa-teal);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.pipeline-step-card.highlight-step .step-num-badge {
  background: var(--wa-primary);
}

.pipeline-step-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.email-fulfillment-split-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 20px;
}

.zip-attached-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  color: #166534;
}

.pill-size {
  background: #DCFCE7;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
}

.email-mockup-frame {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.email-inbox-header {
  background: #F8FAFC;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-inbox-body {
  padding: 16px;
  max-height: 480px;
  overflow-y: auto;
  background: #F8FAFC;
}


/* ==========================================================================
   DEVELOPER CODE & MONOSPACE TYPOGRAPHY (UI/UX Pro Max)
   ========================================================================== */
.tool-json,
.system-prompt-code,
code,
pre {
  font-family: var(--font-mono) !important;
  font-size: 12px;
  line-height: 1.5;
}

.zip-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: 0;
}

.zip-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.zip-feature-list li svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================================================
   MOBILE NAVIGATION DRAWER & BACKDROP
   ========================================================================== */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #FFFFFF;
  color: var(--color-foreground);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
  padding: 0;
}

.mobile-nav-toggle:hover {
  background: var(--color-muted);
  border-color: var(--color-primary);
}

.btn-close-sidebar-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-muted-foreground);
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition-fast);
  padding: 0;
}

.btn-close-sidebar-mobile:hover {
  background: var(--color-muted);
  color: var(--color-foreground);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 899;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN (UI/UX Pro Max)
   Fluid layouts across 1200px, 1024px, 900px, 768px, 640px, 480px, 360px
   ========================================================================== */

/* --- 1200px: Large Tablets & Laptops --- */
@media (max-width: 1200px) {
  .simulator-wrapper {
    grid-template-columns: 420px 1fr;
    gap: 18px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .whop-plans-grid {
    gap: 14px;
  }
}

/* --- 1024px: Tablets Landscape & Small Laptops --- */
@media (max-width: 1024px) {
  .simulator-wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .whatsapp-mockup-container {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
  }

  .dash-split-grid {
    grid-template-columns: 1fr;
  }

  .prompt-editor-split {
    grid-template-columns: 1fr;
  }

  .shipping-grid {
    grid-template-columns: 1fr;
  }

  .fulfillment-pipeline-cards {
    grid-template-columns: 1fr;
  }

  .email-fulfillment-split-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- 900px: Tablet Portrait & Off-Canvas Mobile Drawer --- */
@media (max-width: 900px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .btn-close-sidebar-mobile {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: block;
  }

  .main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 950;
    background: #FFFFFF;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.22);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-sidebar.mobile-open {
    transform: translateX(0);
  }

  .whop-simulation-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    max-width: 85vw;
    z-index: 951;
  }

  .app-layout {
    height: auto;
    min-height: calc(100vh - 62px);
    overflow: visible;
  }

  .main-content {
    width: 100%;
    padding: 20px 16px;
    overflow-y: visible;
  }

  .whop-plans-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 768px: Mobile Landscape & Phablets --- */
@media (max-width: 768px) {
  .whop-top-bar {
    padding: 8px 14px;
    gap: 10px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
  }

  .store-id {
    display: none;
  }

  .whop-center-status {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
  }

  .whop-actions-group {
    gap: 8px;
    margin-left: auto;
  }

  .connection-status {
    padding: 4px 8px;
    font-size: 11px;
  }

  .connection-status .status-label {
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-whop-outline span {
    display: none;
  }

  .btn-download-zip span {
    display: none;
  }

  .btn-whop-upgrade {
    padding: 6px 12px;
    font-size: 11.5px;
  }

  .pane-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .pane-header .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-box {
    width: 100%;
  }

  .category-pills {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-pills::-webkit-scrollbar {
    display: none;
  }

  .whop-billing-summary {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    width: calc(100% - 24px);
    margin: 12px auto;
    max-height: calc(100vh - 24px);
  }

  .modal-dialog.modal-lg {
    max-width: calc(100% - 24px);
  }

  .modal-plans-row {
    grid-template-columns: 1fr;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 580px;
  }
}

/* --- 640px: Phablets & Large Phones --- */
@media (max-width: 640px) {
  .prompt-tools-grid {
    grid-template-columns: 1fr;
  }

  .prompt-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .prompt-footer .btn {
    width: 100%;
  }

  .inspector-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
  }
}

/* --- 480px: Standard Mobile Phones (iOS & Android) --- */
@media (max-width: 480px) {
  .whop-top-bar {
    padding: 6px 10px;
  }

  .whop-badge-text {
    display: none;
  }

  .whop-badge {
    padding: 4px 6px;
  }

  .store-name {
    font-size: 12px;
  }

  .main-content {
    padding: 12px 10px;
  }

  .pane-title {
    font-size: 19px;
  }

  .pane-subtitle {
    font-size: 12.5px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .whatsapp-phone-frame {
    height: clamp(480px, 80vh, 600px);
    border-radius: var(--radius-lg);
  }

  .wa-chat-header {
    padding: 8px 12px;
    gap: 8px;
  }

  .wa-avatar {
    width: 34px;
    height: 34px;
  }

  .wa-contact-name {
    font-size: 13.5px;
  }

  .wa-contact-status {
    font-size: 10.5px;
  }

  .handoff-pill {
    padding: 3px 6px;
    font-size: 10px;
  }

  .wa-chat-body {
    padding: 10px;
  }

  .wa-bubble {
    max-width: 90%;
    font-size: 13px;
  }

  .wa-chat-footer {
    padding: 6px 8px;
    gap: 6px;
  }

  .wa-action-icon {
    width: 32px;
    height: 32px;
  }

  .wa-action-icon svg {
    width: 18px;
    height: 18px;
  }

  .wa-send-btn {
    width: 36px;
    height: 36px;
  }

  .wa-send-btn svg {
    width: 16px;
    height: 16px;
  }

  .quick-reply-pill {
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  .quick-replies-scroll {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: none;
  }

  .toast {
    width: 100%;
    font-size: 12.5px;
    padding: 10px 14px;
  }
}

/* --- 360px: Compact Screens --- */
@media (max-width: 360px) {
  .connection-status {
    display: none;
  }

  .btn {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS REDUCED MOTION (WCAG Criterion 2.3.3)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pulse-indicator {
    animation: none !important;
  }
}


