:root {
  --bg-main: #0a1014;
  --bg-surface: #111b21;
  --bg-card: rgba(17, 27, 33, 0.85);
  --bg-card-hover: rgba(26, 39, 48, 0.85);
  --bg-input: #1a2730;
  --bg-tertiary: #202c33;
  
  --border-subtle: #222d34;
  --border-focus: #00a884;
  --border-highlight: rgba(37, 211, 102, 0.35);

  --text-primary: #e9edef;
  --text-secondary: #8696a0;
  --text-muted: #667781;
  --text-inverse: #0a1014;

  --wa-green: #25d366;
  --wa-teal: #00a884;
  --wa-teal-hover: #029071;
  --wa-glow: rgba(37, 211, 102, 0.25);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(37, 211, 102, 0.2);
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(0, 168, 132, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(37, 211, 102, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: rgba(17, 27, 33, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
}

.header-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--wa-green), var(--wa-teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-pro {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-green);
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

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

.shield-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 168, 132, 0.12);
  border: 1px solid rgba(0, 168, 132, 0.3);
  color: #00e5b5;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--wa-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--wa-green);
  animation: pulseAnimation 2s infinite;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(37, 211, 102, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Layout */
.main-layout {
  max-width: 1380px;
  margin: 28px auto;
  padding: 0 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(0, 168, 132, 0.25);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.step-num {
  width: 26px;
  height: 26px;
  background: var(--bg-tertiary);
  color: var(--wa-green);
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.section-tag {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* Device Section */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.device-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--wa-green), transparent);
  opacity: 0.5;
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-avatar {
  font-size: 24px;
  background: var(--bg-input);
  padding: 8px;
  border-radius: var(--radius-md);
}

.device-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-block;
  margin-top: 2px;
}

.badge-disconnected {
  background: rgba(134, 150, 160, 0.15);
  color: var(--text-secondary);
  border: 1px solid rgba(134, 150, 160, 0.3);
}

.badge-scanning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  animation: pulseAnimation 1.5s infinite;
}

.badge-connected {
  background: var(--success-bg);
  color: var(--wa-green);
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.device-user-info {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  font-family: var(--font-mono);
}

.qr-container {
  height: 240px;
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  position: relative;
}

.qr-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 220px;
}

.qr-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.device-controls {
  display: flex;
  gap: 10px;
}

.direct-send-card {
  margin-bottom: 24px;
}

.direct-send-grid {
  display: grid;
  grid-template-columns: 180px 1fr 220px;
  gap: 16px;
}

.direct-send-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

@media (max-width: 800px) {
  .direct-send-grid {
    grid-template-columns: 1fr;
  }
}

/* Campaign Grid (Step 2 & 3) */
.campaign-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

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

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-subtle);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.upload-dropzone:hover {
  border-color: var(--wa-teal);
  background: rgba(0, 168, 132, 0.05);
}

.file-input-hidden {
  display: none;
}

.upload-icon-circle {
  width: 52px;
  height: 52px;
  background: var(--bg-tertiary);
  color: var(--wa-teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  transition: transform 0.2s ease;
}

.upload-dropzone:hover .upload-icon-circle {
  transform: translateY(-2px);
  color: var(--wa-green);
}

.upload-prompt {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

.dropzone-preview {
  position: relative;
  max-height: 260px;
  display: flex;
  justify-content: center;
}

.dropzone-preview img {
  max-height: 250px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.preview-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(11, 20, 26, 0.85);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-filename {
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

/* Caption Editor & Spintax */
.form-group {
  margin-bottom: 20px;
}

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

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spintax-helper-banner {
  background: rgba(0, 168, 132, 0.08);
  border-left: 3px solid var(--wa-teal);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.spintax-helper-banner code {
  background: var(--bg-tertiary);
  color: var(--wa-green);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.6;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.25);
}

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

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

.spintax-samples {
  margin-top: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.samples-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--wa-teal);
  margin-bottom: 8px;
}

.sample-item {
  background: var(--bg-surface);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
  border-left: 2px solid var(--wa-green);
}

/* Settings Sliders & Form */
.slider-row {
  margin-bottom: 20px;
}

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

.value-badge {
  background: var(--bg-tertiary);
  color: var(--wa-green);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  border: 1px solid rgba(37, 211, 102, 0.2);
}

.form-range {
  width: 100%;
  accent-color: var(--wa-green);
  cursor: pointer;
}

.range-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

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

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.unit-label {
  position: absolute;
  right: 12px;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.feature-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  background: var(--bg-surface);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.check-item.active {
  color: var(--text-primary);
}

.check-icon {
  width: 20px;
  height: 20px;
  background: var(--success-bg);
  color: var(--wa-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.time-estimate-box {
  background: linear-gradient(135deg, rgba(0, 168, 132, 0.15), rgba(37, 211, 102, 0.08));
  border: 1px solid rgba(0, 168, 132, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.estimate-icon {
  font-size: 28px;
}

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

.estimate-value {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.estimate-saving {
  font-size: 11px;
  color: var(--wa-green);
  font-weight: 600;
}

/* Groups Selection Table */
.groups-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.groups-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  padding-left: 38px;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.groups-count-pill {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.groups-count-pill strong {
  color: var(--wa-green);
}

.groups-table-container {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

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

.groups-table th {
  background: var(--bg-input);
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sortable-th:hover {
  background-color: var(--bg-tertiary) !important;
  color: #fff;
}

.sortable-th.active-sort {
  color: var(--wa-green);
}

.sort-icon {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sortable-th:hover .sort-icon {
  opacity: 0.9;
}

.sortable-th.active-sort .sort-icon {
  opacity: 1;
  color: var(--wa-green);
  font-weight: 800;
}

.groups-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

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

.empty-row td {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.tag-admin {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-green);
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

.tag-member {
  background: rgba(134, 150, 160, 0.15);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
}

.badge-device-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.badge-dev-phone1 {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-dev-phone2 {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Live Execution & KPIs */
.monitor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.monitor-controls {
  display: flex;
  gap: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.kpi-number {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.kpi-success .kpi-number { color: var(--wa-green); }
.kpi-warning .kpi-number { color: var(--warning); }
.kpi-danger .kpi-number { color: var(--danger); }

/* Progress Bar */
.progress-section {
  margin-bottom: 24px;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-percent {
  font-family: var(--font-mono);
  color: var(--wa-green);
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wa-teal), var(--wa-green));
  border-radius: 99px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.4);
}

/* Dual Monitor Cards */
.dual-monitor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .dual-monitor-grid {
    grid-template-columns: 1fr;
  }
}

.phone-monitor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

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

.monitor-phone-title {
  font-weight: 700;
  color: #fff;
}

.action-tag {
  font-size: 11px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 99px;
}

.monitor-detail {
  font-size: 13px;
  margin-bottom: 10px;
}

.monitor-label {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
}

.monitor-value {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.monitor-countdown {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

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

.countdown-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--wa-green);
  font-size: 14px;
}

/* Terminal / Logs */
.terminal-container {
  background: #080d10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
}

.terminal-header {
  background: #0e171c;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

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

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-name {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.terminal-body {
  padding: 14px 16px;
  height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.log-entry {
  display: flex;
  gap: 10px;
  line-height: 1.5;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-msg {
  color: var(--text-primary);
  word-break: break-word;
}

.log-entry.success .log-msg { color: #34d399; }
.log-entry.warning .log-msg { color: #fbbf24; }
.log-entry.error .log-msg { color: #f87171; }
.log-entry.pause .log-msg { color: #60a5fa; font-weight: 600; }

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

.btn-primary {
  background: linear-gradient(135deg, var(--wa-green), var(--wa-teal));
  color: #0b141a;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: #2a3942;
  border-color: var(--text-secondary);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

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

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

.btn-text {
  background: none;
  border: none;
  color: var(--wa-teal);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
  color: var(--wa-green);
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-danger-icon {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
}

.btn-danger-icon:hover {
  background: var(--danger);
}

/* Navigation Tabs */
.navigation-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  overflow-x: auto;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  background: var(--bg-tertiary);
  color: #fff;
  border-color: rgba(0, 168, 132, 0.4);
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(0, 168, 132, 0.15), rgba(37, 211, 102, 0.12));
  color: #fff;
  border-color: var(--wa-green);
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.2);
}

.tab-icon {
  font-size: 16px;
}

.tab-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--wa-green);
  color: #0b141a;
  padding: 2px 6px;
  border-radius: 99px;
  letter-spacing: 0.5px;
}

.tab-counter {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: fadeIn 0.25s ease-in-out;
}

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

/* Schedule Toggle & Picker */
.schedule-toggle-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.schedule-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schedule-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-icon {
  font-size: 22px;
}

.schedule-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

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

.schedule-picker-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
}

.schedule-datetime {
  font-family: var(--font-sans);
  font-size: 14px;
  color: #fff;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  width: 100%;
}

.schedule-datetime::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: 0.3s;
}

input:checked + .slider {
  background-color: var(--wa-green);
  border-color: var(--wa-green);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #0b141a;
}

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

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

/* Group Management Grid & Cards */
.mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.mgmt-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s ease;
}

.mgmt-card:hover {
  border-color: rgba(0, 168, 132, 0.4);
}

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

.mgmt-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-label.sm {
  font-size: 13px;
  color: var(--text-secondary);
}

.mgmt-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--wa-green);
  cursor: pointer;
}

.mgmt-autonumber-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.input-unit-sm {
  display: flex;
  align-items: center;
  gap: 6px;
}

.unit-label-sm {
  font-size: 12px;
  color: var(--text-muted);
}

.input-sm {
  width: 65px;
  padding: 6px 8px;
  font-size: 13px;
  text-align: center;
}

/* Upload dropzone for group avatar */
.upload-dropzone-sm {
  border: 2px dashed var(--border-subtle);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-dropzone-sm:hover {
  border-color: var(--wa-green);
}

.photo-empty {
  font-size: 13px;
  color: var(--text-secondary);
}

.photo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
}

.photo-preview img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--wa-green);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* Radio Cards for Message Permissions */
.radio-options-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-card:hover {
  border-color: rgba(37, 211, 102, 0.4);
}

.radio-card input[type="radio"] {
  accent-color: var(--wa-green);
  margin-top: 3px;
  cursor: pointer;
}

.radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-content strong {
  font-size: 13px;
  color: #fff;
}

.radio-content span {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Batch Action Footer */
.mgmt-actions-footer {
  margin-top: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.mgmt-status-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.mgmt-progress-wrap {
  margin-top: 20px;
}

/* Schedules Grid & Cards */
.schedules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.schedule-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.schedule-item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, var(--wa-green));
}

.schedule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schedule-date {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
}

.badge-sched-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-sched-running {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-green);
  border: 1px solid rgba(37, 211, 102, 0.3);
  animation: pulseAnimation 1.5s infinite;
}

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

.badge-sched-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.schedule-body-content {
  display: flex;
  gap: 14px;
}

.schedule-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: #000;
  flex-shrink: 0;
}

.schedule-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.schedule-groups-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--wa-teal);
}

.schedule-caption-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.schedule-countdown {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--wa-green);
  font-weight: 600;
}

.empty-schedule-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-schedule-card .empty-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 14px;
}

.empty-schedule-card h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}

.empty-schedule-card p {
  font-size: 13px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Leads Database Section */
.leads-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.leads-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-filter-btn {
  background: var(--bg-tertiary) !important;
  border-color: var(--wa-green) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(37, 211, 102, 0.2);
}

.btn-filter-left {
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

.btn-filter-left:hover, .btn-filter-left.active-filter-btn {
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}

.tag-status-active {
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa-green);
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-status-left {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseAnimation 2s infinite;
}

.group-badge-pill {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin: 2px;
  display: inline-block;
}

.group-badge-pill.active-grp {
  color: var(--text-primary);
  border: 1px solid rgba(0, 168, 132, 0.3);
}

.group-badge-pill.left-grp {
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  text-decoration: line-through;
}

.btn-recover {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: var(--wa-green);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-recover:hover {
  background: var(--wa-green);
  color: #0b141a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.hidden {
  display: none !important;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}

