:root {
  --bg-main: #090d16;
  --bg-sidebar: #0f172a;
  --bg-card: #131c2e;
  --bg-card-hover: #19253d;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.3);
  
  --primary: #10b981; /* WhatsApp Emerald */
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.2);
  
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

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

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: block;
}

.brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Navigation */
.sidebar-nav {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  position: relative;
  width: 100%;
}

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

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

.pill-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 1.5s infinite;
}

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

/* Sidebar Footer */
.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.store-badge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.store-avatar {
  font-size: 20px;
}

.store-name {
  font-size: 13px;
  font-weight: 700;
  display: block;
  color: #fff;
}

.store-plan {
  font-size: 11px;
  color: var(--primary);
  display: block;
}

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

.topbar {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

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

.header-stat-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
}

.pill-label {
  color: var(--text-muted);
  margin-right: 4px;
}

.pill-value {
  color: #fff;
  font-weight: 600;
}

/* Tabs */
.tab-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

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

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

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.icon-blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.icon-green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-gold { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.icon-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.stat-trend {
  font-size: 11px;
  font-weight: 600;
}

.stat-trend.positive { color: var(--primary); }
.stat-subtext { font-size: 11px; color: var(--text-dim); }

/* Agent Metrics Card */
.agent-metrics-card {
  background: linear-gradient(180deg, rgba(19, 28, 46, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

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

.card-heading {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.card-subheading {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.metrics-row-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.box-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.box-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 4px 0 2px 0;
  display: block;
}

.box-sub {
  font-size: 10px;
  color: var(--text-muted);
}

/* Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.table-container {
  overflow-x: auto;
}

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

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

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

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

.badge-success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

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

/* TAB 2: CONVERSATIONS LAYOUT */
.conversations-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 128px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.chat-list-panel {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.4);
}

.panel-search-bar {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
}

.panel-search-bar input, .search-and-filters input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  outline: none;
}

.panel-search-bar input:focus, .search-and-filters input:focus {
  border-color: var(--primary);
}

.filter-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.chat-item-card {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.chat-item-card.active {
  border-left: 3px solid var(--primary);
}

.chat-item-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.chat-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-dim);
}

.chat-item-snippet {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg-card);
}

.detail-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
}

.detail-user-info h3 {
  font-size: 16px;
  font-weight: 700;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-actions select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.detail-messages-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.msg-bubble-wrap.customer {
  align-self: flex-start;
}

.msg-bubble-wrap.agent {
  align-self: flex-end;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg-bubble-wrap.customer .msg-bubble {
  background: #1e293b;
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.msg-bubble-wrap.agent .msg-bubble {
  background: #064e3b;
  color: #ecfdf5;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.msg-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.msg-bubble-wrap.agent .msg-meta-row {
  justify-content: flex-end;
}

.reasoning-inspector {
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  padding: 14px 20px;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.inspector-body {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.empty-state {
  margin: auto;
  text-align: center;
  max-width: 380px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

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

.search-and-filters {
  display: flex;
  gap: 12px;
  flex: 1;
  max-width: 500px;
}

.search-and-filters select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 0 14px;
}

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

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
}

.prod-img-wrap {
  height: 140px;
  background: #1e293b;
  position: relative;
  overflow: hidden;
}

.prod-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prod-stock-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.prod-stock-pill.in-stock { background: rgba(16, 185, 129, 0.9); color: #fff; }
.prod-stock-pill.low-stock { background: rgba(245, 158, 11, 0.9); color: #fff; }

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

.prod-sku {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-bottom: 4px;
}

.prod-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

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

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

.prod-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}

.prod-rating {
  font-size: 12px;
  color: #f59e0b;
}

/* TAB 4: WHATSAPP WEB SIMULATOR */
.simulator-wrapper {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 28px;
  height: calc(100vh - 128px);
}

.phone-frame {
  background: #0b141a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.wa-header {
  background: #202c33;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #00a884;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.wa-store-title {
  font-size: 15px;
  font-weight: 700;
  color: #e9edef;
  display: block;
}

.wa-online-status {
  font-size: 11px;
  color: #8696a0;
  display: block;
}

.wa-header-actions {
  margin-left: auto;
}

.sim-btn-clear {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #8696a0;
}

.wa-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
}

.wa-msg-row {
  display: flex;
}

.wa-msg-row.customer { justify-content: flex-end; }
.wa-msg-row.agent { justify-content: flex-start; }

.wa-msg-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  position: relative;
}

.wa-msg-bubble.customer {
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 2px;
}

.wa-msg-bubble.agent {
  background: #202c33;
  color: #d1d7db;
  border-top-left-radius: 2px;
}

.wa-msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  margin-top: 4px;
}

.wa-typing-bar {
  padding: 6px 16px;
  font-size: 11px;
  color: #00a884;
  background: #111b21;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-input-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #111b21;
  overflow-x: auto;
}

.sim-quick-btn {
  background: #202c33;
  color: #aebac1;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sim-quick-btn:hover {
  background: #2a3942;
  color: #fff;
}

.wa-input-form {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: #202c33;
  gap: 10px;
}

.wa-input-form input {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.wa-send-btn {
  background: #00a884;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}

/* Simulator Telemetry */
.sim-telemetry-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.telemetry-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.telemetry-stat-card .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  display: block;
}

.telemetry-stat-card .value {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
  display: block;
}

.telemetry-stat-card .value.highlight {
  color: var(--primary);
}

.chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.telemetry-payment-preview {
  margin-top: auto;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.telemetry-payment-preview h4 {
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--primary);
}

.telemetry-payment-preview img {
  width: 150px;
  height: 150px;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 10px;
}

.upi-link-btn {
  display: block;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

/* TAB 5: PAIRING */
.pairing-card, .settings-card {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.pairing-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  margin-top: 24px;
}

.qr-display-box {
  width: 280px;
  height: 280px;
  background: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.qr-display-box img {
  width: 100%;
  height: 100%;
}

.pairing-instructions ol {
  margin: 14px 0 24px 20px;
  line-height: 1.8;
  font-size: 14px;
  color: var(--text-muted);
}

/* TAB 6: SETTINGS FORM */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .col {
  flex: 1;
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.checkbox-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-actions {
  margin-top: 24px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 13px;
  display: none;
  z-index: 2000;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-row-grid { grid-template-columns: repeat(2, 1fr); }
  .simulator-wrapper { grid-template-columns: 1fr; }
}
