/* ==========================================================================
   KancilBlaster — Production Design System & Dark Theme
   ========================================================================== */

:root {
  --bg-main: #080c14;
  --bg-surface: #0e1526;
  --bg-surface-elevated: #141f38;
  --bg-surface-hover: #1a2847;
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-focus: #6366f1;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

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

  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

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

/* ==========================================================================
   1. AUTH OVERLAY & LOCK GATE
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 30%, #151d38 0%, #080c14 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(14, 21, 38, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.auth-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
  margin-bottom: 16px;
}

.auth-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  letter-spacing: 1.5px;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 42px;
}

.eye-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye-btn:hover {
  color: var(--text-main);
}

.auth-error {
  display: none;
  font-size: 13px;
  color: var(--accent-rose);
  margin-top: 8px;
}

.auth-card.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   2. APP CONTAINER & TOP NAVIGATION
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-nav {
  height: 64px;
  background: rgba(14, 21, 38, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left, .nav-center, .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.brand-icon {
  font-size: 20px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: var(--radius-sm);
}

.fleet-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-glow 2s infinite;
}

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

.nav-center {
  background: rgba(8, 12, 20, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.nav-badge {
  background: var(--accent-rose);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* ==========================================================================
   3. MAIN CONTENT & TABS
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 32px 28px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* ==========================================================================
   4. METRICS CARDS & ACTION BAR
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-primary);
}

.metric-card.accent-green::before { background: var(--accent-green); }
.metric-card.accent-cyan::before { background: var(--accent-cyan); }
.metric-card.accent-indigo::before { background: #818cf8; }

.metric-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 4px;
}

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

.section-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-heading p {
  font-size: 13px;
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   5. FLEET GRID & NODE CARDS
   ========================================================================== */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.node-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

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

.node-title-group h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 2px;
}

.node-endpoint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.status-badge.ONLINE {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.OFFLINE {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-badge.BANNED {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-badge.COOLDOWN {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.node-quota-bar-wrapper {
  margin-bottom: 16px;
}

.quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.quota-progress {
  height: 6px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

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

.node-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* ==========================================================================
   6. CAMPAIGN STUDIO LAYOUT
   ========================================================================== */
.campaign-studio-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

.studio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.card-header {
  margin-bottom: 20px;
}

.card-header h3, .card-header h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 4px;
}

.card-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  margin-bottom: 16px;
}

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

.sub-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea {
  resize: vertical;
}

.recipient-counter {
  font-size: 11px;
  color: var(--accent-cyan);
  margin-top: 4px;
  font-family: var(--font-mono);
}

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

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-text-link:hover {
  color: #67e8f9;
}

.media-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.03);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.media-dropzone:hover, .media-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.005);
}

.dropzone-icon {
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.dropzone-title {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-subtitle {
  font-size: 11px;
  color: var(--text-dim);
}

.media-preview-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 8px;
}

.preview-media-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-media-box img, .preview-media-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.preview-meta {
  display: flex;
  gap: 6px;
}

.preview-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.preview-tag.accent {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.media-inputs-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}

.anti-ban-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.anti-ban-title {
  font-size: 13px;
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 12px;
}

.anti-ban-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: flex-end;
}

.checkbox-wrapper {
  grid-column: span 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-surface-elevated);
  border-radius: 34px;
  transition: .3s;
  border: 1px solid var(--border-medium);
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

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

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

/* Spintax Previews Box */
.spintax-previews {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spintax-sample {
  background: var(--bg-surface-elevated);
  border-left: 3px solid var(--accent-cyan);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
}

/* Campaign History List */
.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.campaign-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

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

.campaign-item-title {
  font-weight: 600;
  font-size: 14px;
}

.campaign-item-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   7. INBOUND CRM & CHAT
   ========================================================================== */
.inbound-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - 160px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.conversations-sidebar {
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.inbound-filter-bar {
  display: flex;
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

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

.filter-pill.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

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

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

.conversation-card:hover {
  background: var(--bg-surface-hover);
}

.conversation-card.active {
  background: var(--bg-surface-elevated);
  border-left: 3px solid var(--accent-primary);
}

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

.conv-phone {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.intent-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: var(--font-mono);
}

.intent-badge.HOT_LEAD { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.intent-badge.QUESTION { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.intent-badge.OBJECTION { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.intent-badge.OPT_OUT { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

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

/* Chat Viewport */
.chat-viewport {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  gap: 12px;
}

.chat-active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
}

.chat-header-info h4 {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.chat-header-sub {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.takeover-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-family: var(--font-mono);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.4;
}

.chat-bubble.user {
  align-self: flex-start;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.chat-bubble.agent {
  align-self: flex-end;
  background: var(--accent-primary);
  color: white;
}

.chat-reply-bar {
  padding: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  background: var(--bg-surface);
}

.chat-reply-bar textarea {
  flex: 1;
}

/* ==========================================================================
   8. SETTINGS & PRAGMAS
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.pragma-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

.pragma-name {
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pragma-val {
  font-weight: 600;
  font-family: var(--font-mono);
}

.pragma-val.accent {
  color: var(--accent-cyan);
}

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

.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   9. BUTTONS & UTILITIES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--accent-primary-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.1);
}

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

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px;
  font-size: 15px;
}

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

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

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

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-surface-elevated);
}

.qr-frame {
  width: 260px;
  height: 260px;
  margin: 20px auto;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-loader {
  color: #333;
  font-size: 13px;
  font-weight: 500;
}

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

.qr-timer {
  font-size: 11px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.text-center { text-align: center; }

/* =============================================================================
   UPGRADED SUITE: MULTI-MEDIA, HEALTH CHECK & SEQUENCE MESSAGING STYLES
   ============================================================================= */

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

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

/* Status Badges */
.status-badge.repair {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.repair .pulse {
  background: #f59e0b;
}

/* Variation Tabs */
.variation-tab-bar {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.variation-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.variation-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.variation-tab-btn.active {
  background: var(--accent-primary);
  color: white;
  font-weight: 600;
}

.variation-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}

.variation-indicator.has-media {
  background: #10b981;
}

/* Multi-Message Sequence Box */
.sequence-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
}

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

.sequence-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Live ETA Chip */
.eta-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.campaign-priority-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.priority-critical { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.priority-high { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-normal { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.priority-low { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

/* Humanizer Option Badges */
.humanizer-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

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

