/* SuiteCRM 8 Enterprise - Chatbot & WhatsApp Manager Theme */
:root {
  --bg-system: #f4f6f9;
  --bg-card: #ffffff;
  --bg-sidebar: #1e293b;
  --border-light: #e2e8f0;
  --border-focus: #0d6efd;
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  
  --accent-blue: #0d6efd;
  --accent-blue-hover: #0b5ed7;
  --accent-blue-light: #eff6ff;
  --accent-blue-border: #bfdbfe;
  
  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-green-light: #ecfdf5;
  --accent-green-border: #a7f3d0;
  
  --accent-orange: #f59e0b;
  --accent-orange-light: #fffbeb;
  --accent-orange-border: #fde68a;
  
  --accent-red: #ef4444;
  --accent-red-hover: #dc2626;
  --accent-red-light: #fef2f2;
  --accent-red-border: #fecaca;
  
  --radius-card: 10px;
  --radius-input: 6px;
  --radius-pill: 50px;

  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-system);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid #0f172a;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--accent-blue);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.active {
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.35);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.version-tag {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

/* Main Content */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.topbar h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.content-body {
  padding: 24px 28px;
  max-width: 1280px;
  width: 100%;
}

/* Sections */
.page-section {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.page-section.active {
  display: block;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 18px;
}

.card-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

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

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

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.blue { background: var(--accent-blue-light); color: var(--accent-blue); }
.stat-icon.green { background: var(--accent-green-light); color: var(--accent-green); }
.stat-icon.purple { background: #f3e8ff; color: #9333ea; }

.stat-number {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

/* QR Code Section - Perfect Scanning Display */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 24px;
}

.qr-container {
  width: 320px;
  min-height: 320px;
  margin: 18px 0;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.qr-image-wrapper {
  background: #ffffff;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-image-sharp {
  width: 270px;
  height: 270px;
  max-width: 100%;
  border-radius: 0 !important;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.qr-status-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 480px;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.qr-placeholder.connected {
  background: var(--accent-green-light);
  border-radius: 8px;
  width: 100%;
  padding: 36px 20px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

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

.badge-connected {
  background: var(--accent-green-light);
  color: #065f46;
  border: 1px solid var(--accent-green-border);
}
.badge-connected .badge-dot { background: var(--accent-green); }

.badge-waiting {
  background: var(--accent-blue-light);
  color: #1e40af;
  border: 1px solid var(--accent-blue-border);
}
.badge-waiting .badge-dot { background: var(--accent-blue); }

.badge-error {
  background: var(--accent-red-light);
  color: #991b1b;
  border: 1px solid var(--accent-red-border);
}
.badge-error .badge-dot { background: var(--accent-red); }

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-input);
  color: var(--text-primary);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.18);
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 12.5px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.grid-2col {
  grid-template-columns: 1fr 1fr;
}

.grid-3col {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
  .grid-2col, .grid-3col {
    grid-template-columns: 1fr;
  }
}

.help-text {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-input);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(13, 110, 253, 0.25);
}
.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  background: #64748b;
  color: #ffffff;
}
.btn-secondary:hover {
  background: #475569;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: #cbd5e1;
}
.btn-ghost:hover {
  background: #f1f5f9;
  color: var(--text-primary);
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
}
.btn-danger:hover {
  background: var(--accent-red-hover);
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.btn-icon:hover {
  color: var(--accent-red);
  background: var(--accent-red-light);
}

/* Settings Tabs */
.settings-tabs-container {
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.settings-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.settings-tab-btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  margin-bottom: -2px;
  white-space: nowrap;
}

.settings-tab-btn:hover {
  color: var(--text-primary);
}

.settings-tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
}

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

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

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

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

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

/* Step Cards in Workflow Builder */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.step-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 26px;
  height: 26px;
  background: var(--accent-blue);
  color: #ffffff;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.step-title-preview {
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 8px;
  border-radius: 4px;
}

.validation-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}

.conditions-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.condition-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease;
}

.toast.error {
  background: var(--accent-red);
}

/* Utilities */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.font-bold { font-weight: 700; }
.text-danger { color: var(--accent-red); }

/* Activity Logs Timeline Feed */
.timeline-logs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-log-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--accent-blue);
  border-radius: 6px;
  padding: 10px 14px;
  transition: background 0.15s ease;
}
.timeline-log-item:hover {
  background: #f8fafc;
}

.timeline-log-item.log-error {
  border-left-color: var(--accent-red);
  background: #fffafa;
}
.timeline-log-item.log-connected {
  border-left-color: var(--accent-green);
}
.timeline-log-item.log-sent {
  border-left-color: #0ea5e9;
}
.timeline-log-item.log-flow {
  border-left-color: #8b5cf6;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-time {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: inherit;
}

.timeline-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.timeline-pill.pill-connected { background: var(--accent-green-light); color: var(--accent-green-hover); }
.timeline-pill.pill-sent { background: var(--accent-blue-light); color: var(--accent-blue-hover); }
.timeline-pill.pill-flow { background: #f3e8ff; color: #7e22ce; }
.timeline-pill.pill-error { background: var(--accent-red-light); color: var(--accent-red-hover); }
.timeline-pill.pill-info { background: #f1f5f9; color: var(--text-secondary); }

.timeline-msg {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.timeline-details-toggle {
  font-size: 11px;
  color: var(--accent-blue);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-top: 4px;
  text-align: left;
  display: inline-block;
}
.timeline-details-toggle:hover {
  text-decoration: underline;
}

.timeline-tech-details {
  background: #0f172a;
  color: #94a3b8;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 6px;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Log Filters */
.log-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.log-filter-btn {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.log-filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.log-filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #ffffff;
}

/* Campaign Step Box */
.campaign-step-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
}

.step-box-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* Variable Chips */
.btn-var-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-var-chip:hover {
  background: #dbeafe;
  color: #1e3a8a;
}

/* Lead & Contact Badges */
.avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.badge-crm-synced {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-crm-synced:hover {
  background: #d1fae5;
}

.stat-icon.orange {
  background: var(--accent-orange-light);
  color: var(--accent-orange);
}

/* ==========================================================================
   Base de Conocimiento (Knowledge Base) Grid & Cards
   ========================================================================== */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.kb-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.kb-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kb-card-header {
  margin-bottom: 12px;
}

.kb-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kb-category-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
}
.kb-category-badge.general_rules { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.kb-category-badge.insurance_ramo { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.kb-category-badge.security { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.kb-category-badge.faqs { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.kb-category-badge.custom { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

.kb-card-content {
  font-size: 13px;
  line-height: 1.55;
  color: #475569;
  white-space: pre-line;
  max-height: 160px;
  overflow-y: auto;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.kb-tag-pill {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 4px;
}

.kb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-top: auto;
}

/* AI Simulator and KB Ask Box */
.ai-simulator-card, .kb-ask-box {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #e9d5ff;
}

.test-result-box {
  background: #ffffff;
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #3b0764;
  box-shadow: var(--shadow-sm);
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-card);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  padding: 24px;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* -----------------------------------------------------------------------------
 * WhatsApp Mobile Mockup & Interactive Simulator Styles
 * ----------------------------------------------------------------------------- */
.simulator-layout {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1060px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

.wa-phone-container {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  background: #111b21;
  border-radius: 36px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), 0 0 0 10px #1e293b;
  overflow: hidden;
  border: 3px solid #334155;
  display: flex;
  flex-direction: column;
  height: 640px;
}

.wa-phone-notch {
  height: 24px;
  background: #111b21;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  user-select: none;
}

.wa-phone-header {
  background: #202c33;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(134, 150, 160, 0.15);
  color: #e9edef;
  z-index: 10;
}

.wa-contact-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a884 0%, #005c4b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wa-contact-name {
  font-size: 14px;
  font-weight: 600;
  color: #e9edef;
  line-height: 1.2;
}

.wa-contact-status {
  font-size: 11.5px;
  color: #8696a0;
  transition: all 0.2s ease;
}

.wa-contact-status.typing {
  color: #00a884;
  font-weight: 600;
}

.wa-chat-area {
  flex: 1;
  background-color: #0b141a;
  background-image: radial-gradient(#1f2c34 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.wa-date-divider {
  align-self: center;
  background: #182229;
  color: #8696a0;
  font-size: 10.5px;
  padding: 4px 12px;
  border-radius: 8px;
  margin: 2px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wa-msg {
  max-width: 84%;
  padding: 8px 12px 6px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  animation: waMsgAppear 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes waMsgAppear {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wa-msg-bot {
  align-self: flex-start;
  background: #202c33;
  color: #e9edef;
  border-top-left-radius: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.wa-msg-user {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

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

.wa-ticks {
  font-size: 11px;
  letter-spacing: -2px;
  color: #8696a0;
}

.wa-ticks.blue {
  color: #53bdeb;
}

/* Typing Bubble Indicator */
.wa-typing-bubble {
  align-self: flex-start;
  background: #202c33;
  padding: 10px 14px;
  border-radius: 16px;
  border-top-left-radius: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
}

.wa-dot {
  width: 6px;
  height: 6px;
  background: #00a884;
  border-radius: 50%;
  animation: waDotBlink 1.4s infinite ease-in-out both;
}

.wa-dot:nth-child(1) { animation-delay: -0.32s; }
.wa-dot:nth-child(2) { animation-delay: -0.16s; }

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

.wa-input-bar {
  background: #202c33;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(134, 150, 160, 0.15);
}

.wa-input-box {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  color: #e9edef;
  font-size: 13.5px;
  outline: none;
}

.wa-input-box::placeholder {
  color: #8696a0;
}

.wa-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00a884;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-send-btn:hover {
  background: #06cf9c;
  transform: scale(1.05);
}

.wa-send-btn:active {
  transform: scale(0.95);
}

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

.sim-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 3px 2px;
}

.sim-quick-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.sim-quick-btn:active {
  transform: translateY(0);
}