:root {
  --bg: #0a0e1a;
  --bg-card: rgba(17,24,39,0.85);
  --primary: #25D366;
  --primary-dark: #128C7E;
  --primary-glow: rgba(37,211,102,0.15);
  --secondary: #3B82F6;
  --purple: #8B5CF6;
  --danger: #EF4444;
  --warning: #F59E0B;
  --test-color: #F97316;
  --text: #F9FAFB;
  --muted: #9CA3AF;
  --border: rgba(255,255,255,0.08);
  --glass: rgba(255,255,255,0.03);
  --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg); color: var(--text); background-image: radial-gradient(circle at 15% 50%, rgba(37, 211, 102, 0.05), transparent 25%), radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.05), transparent 25%); min-height: 100vh; overflow: hidden; }

/* Test Banner */
.test-banner { position: fixed; top: 0; left: 0; width: 100%; background-color: var(--test-color); color: #fff; text-align: center; padding: 8px; font-weight: 600; font-size: 0.9rem; z-index: 1000; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.8; } 50% { opacity: 1; } 100% { opacity: 0.8; } }
.test-banner.hidden { display: none !important; }

/* Layout */
#app { display: flex; height: 100vh; width: 100vw; padding-top: 36px; }

/* ═══ SIDEBAR ═══ */
#sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(13,17,30,0.98) 0%, rgba(8,11,20,0.99) 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  z-index: 100;
  backdrop-filter: blur(20px);
  overflow-y: auto;
  overflow-x: hidden;
}
#sidebar::-webkit-scrollbar { width: 3px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 4px;
}
.logo-icon {
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37,211,102,0.08);
  border: 1px solid rgba(37,211,102,0.15);
  border-radius: 12px;
  flex-shrink: 0;
}
.logo-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #fff 30%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.logo-sub { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; margin-top: 1px; }

/* User Card */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.user-meta { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 3px;
}
.user-role.admin { background: rgba(37,211,102,0.15); color: var(--primary); }
.user-role.client { background: rgba(59,130,246,0.15); color: var(--secondary); }

/* Navigation */
nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; padding-top: 4px; }
nav::-webkit-scrollbar { width: 0; }

.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 8px 10px; }

.nav-group { margin-bottom: 2px; }
.nav-section-header {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 12px 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  transition: all 0.2s;
  user-select: none;
  border-left: 2px solid transparent;
  margin-top: 6px;
}
.nav-section-header:hover { color: rgba(255,255,255,0.8); }
.nav-chevron-svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}
.nav-group.active .nav-chevron-svg { transform: rotate(180deg); opacity: 1; color: var(--primary); }
.nav-group.active .nav-section-header { color: var(--primary); border-left-color: var(--primary); }
/* Keep old chevron rule for backwards compat */
.nav-chevron { font-size: 0.6rem; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.nav-group.active .nav-chevron { transform: rotate(180deg); color: var(--primary); }

.nav-section-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-left: 0;
}
.nav-group.active .nav-section-items { max-height: 400px; }

.nav-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.55);
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1px;
  position: relative;
}
.nav-btn svg { flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s; }
.nav-btn:hover { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.9); }
.nav-btn:hover svg { opacity: 0.9; }
.nav-btn.active {
  background: rgba(37,211,102,0.15);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(37,211,102,0.2);
}
.nav-btn.active svg { opacity: 1; stroke: var(--primary); }
.nav-btn .badge {
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

/* Sidebar Bottom */
.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-version {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.6;
  font-family: monospace;
}
.logout-btn {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.5);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.logout-btn svg { opacity: 0.7; transition: opacity 0.2s; }
.logout-btn:hover svg { opacity: 1; }


/* ═══ WHATSAPP CONNECTION STATUS ═══ */
.wa-connection {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}
.wa-connection.connected {
  background: linear-gradient(135deg, rgba(37,211,102,0.06), rgba(17,24,39,0.4));
  border-color: rgba(37,211,102,0.15);
}
.wa-connection.disconnected {
  background: rgba(255,255,255,0.02);
}
.wa-conn-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.wa-conn-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.wa-conn-dot.active {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  animation: dotPulse 2s ease-in-out infinite;
}
.wa-conn-dot.offline { background: rgba(255,255,255,0.25); }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px var(--primary); }
  50% { box-shadow: 0 0 10px var(--primary), 0 0 20px rgba(37,211,102,0.2); }
}
.wa-conn-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-conn-phone {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.wa-conn-actions { display: flex; gap: 6px; }
.btn-disconnect {
  flex: 1;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.2);
  color: rgba(239,68,68,0.7);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-disconnect:hover { background: rgba(239,68,68,0.08); color: var(--danger); border-color: rgba(239,68,68,0.4); }
.btn-connect-wa {
  width: 100%;
  background: linear-gradient(135deg, rgba(37,211,102,0.15), rgba(18,140,126,0.15));
  border: 1px solid rgba(37,211,102,0.2);
  color: var(--primary);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-connect-wa:hover {
  background: linear-gradient(135deg, rgba(37,211,102,0.2), rgba(18,140,126,0.2));
  border-color: rgba(37,211,102,0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,211,102,0.15);
}

#main-content { flex: 1; padding: 30px; overflow-y: auto; scroll-behavior: smooth; }
.view { display: none; animation: fadeIn 0.3s ease-in-out; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ═══ ONBOARDING WIZARD ═══ */
.onboarding-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  opacity: 1;
}
.onboarding-overlay.hidden { display: none; }
.onboarding-wizard {
  background: linear-gradient(180deg, rgba(17,24,39,0.98), rgba(10,14,26,0.99));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  width: 520px; max-width: 95vw; max-height: 90vh;
  padding: 32px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  overflow-y: auto;
  scrollbar-width: none;
}
.onboarding-wizard::-webkit-scrollbar { display: none; }
.onboarding-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--muted); font-size: 1.5rem;
  cursor: pointer; transition: color 0.2s; line-height: 1; padding: 4px;
}
.onboarding-close:hover { color: #fff; }

/* Stepper */
.onboarding-stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 28px; padding: 0 10px;
}
.ob-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; z-index: 1;
}
.ob-step span {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  background: rgba(255,255,255,0.06); color: var(--muted);
  border: 2px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
}
.ob-step small { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.ob-step.active span { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 12px rgba(37,211,102,0.3); }
.ob-step.active small { color: var(--primary); }
.ob-step.done span { background: rgba(37,211,102,0.2); color: var(--primary); border-color: var(--primary); }
.ob-step.done small { color: var(--primary); }
.ob-step-line { flex: 1; height: 2px; background: rgba(255,255,255,0.08); margin: 0 4px; margin-bottom: 18px; transition: background 0.3s; }
.ob-step-line.done { background: var(--primary); }

/* Content panels */
.ob-content { display: none; text-align: center; animation: fadeIn 0.3s ease; }
.ob-content.active { display: block; }
.ob-icon { font-size: 2.8rem; margin-bottom: 12px; }
.ob-content h2 { color: #fff; font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.ob-subtitle { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* Checklist */
.ob-checklist { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-bottom: 24px; }
.ob-check-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; transition: all 0.2s;
}
.ob-check-item:hover { background: rgba(255,255,255,0.05); }
.ob-check-item input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0;
  accent-color: var(--primary); cursor: pointer;
}
.ob-check-item strong { color: #fff; font-size: 0.88rem; display: block; margin-bottom: 2px; }
.ob-check-item small { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

/* Form fields */
.ob-form { margin-bottom: 24px; text-align: left; }
.ob-field { display: flex; flex-direction: column; gap: 6px; }
.ob-field label { color: rgba(255,255,255,0.7); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ob-field input {
  padding: 12px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; font-size: 1rem; font-family: inherit;
  transition: border-color 0.2s;
}
.ob-field input:focus { outline: none; border-color: var(--primary); }
.ob-hint { color: var(--muted); font-size: 0.75rem; }

/* Info box */
.ob-info-box {
  text-align: left; padding: 16px; border-radius: 10px;
  background: rgba(24,119,242,0.08); border: 1px solid rgba(24,119,242,0.15);
  margin-bottom: 24px;
}
.ob-info-box strong { color: #fff; font-size: 0.85rem; display: block; margin-bottom: 8px; }
.ob-info-box ol { padding-left: 18px; color: var(--muted); font-size: 0.82rem; line-height: 1.8; }

/* Actions */
.ob-actions { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.btn-ob-next {
  padding: 11px 32px; border-radius: 8px; border: none;
  background: var(--primary); color: #fff;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.btn-ob-next:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,211,102,0.3); }
.btn-ob-next:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ob-back {
  padding: 10px 24px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.btn-ob-back:hover { border-color: rgba(255,255,255,0.2); color: #fff; }
.btn-ob-facebook {
  width: 100%; padding: 12px 24px; border-radius: 8px; border: none;
  background: #1877F2; color: #fff;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ob-facebook:hover { background: #1565d8; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(24,119,242,0.3); }

/* Progress bar */
.ob-progress-bar {
  width: 100%; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,0.08); overflow: hidden;
  margin-top: 20px;
}
.ob-progress-fill {
  height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s ease;
}

/* Spinner */
.ob-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  animation: obSpin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes obSpin { to { transform: rotate(360deg); } }

/* Success details */
.ob-success-details {
  text-align: left; padding: 16px; border-radius: 10px;
  background: rgba(37,211,102,0.06); border: 1px solid rgba(37,211,102,0.15);
  margin-bottom: 20px;
}
.ob-success-details .ob-detail { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ob-success-details .ob-detail:last-child { border: none; }
.ob-success-details .ob-detail-label { color: var(--muted); font-size: 0.8rem; }
.ob-success-details .ob-detail-value { color: #fff; font-size: 0.85rem; font-weight: 600; }

/* Headers & Glass panels */
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.view-header h1 { font-size: 1.8rem; font-weight: 600; color: #fff; }
.view-header p { color: var(--muted); font-size: 0.95rem; margin-top: 5px; }
.section-title { font-size: 1.2rem; font-weight: 600; margin: 20px 0 15px; color: #fff; border-bottom: 1px solid var(--border); padding-bottom: 8px; }

.glass-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); backdrop-filter: blur(10px); margin-bottom: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Dashboard Cards */
.balance-card { background: linear-gradient(135deg, rgba(37,211,102,0.1), rgba(17,24,39,0.9)); border: 1px solid var(--primary); border-radius: 16px; padding: 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 0 20px var(--primary-glow); margin-bottom: 30px; }
.balance-label { font-size: 1rem; color: var(--muted); margin-bottom: 8px; }
.balance-value { font-size: 2.5rem; font-weight: 700; color: #fff; }
.balance-reserved { font-size: 0.9rem; color: var(--warning); margin-top: 8px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.stat-icon { font-size: 2rem; margin-bottom: 10px; }
.stat-val { font-size: 1.8rem; font-weight: 600; color: #fff; }
.stat-lbl { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 5px; }

/* Lists & Tables */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 320px)); gap: 20px; }
.empty-state { text-align: center; padding: 40px; color: var(--muted); background: var(--glass); border-radius: 12px; border: 1px dashed var(--border); }
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { background: rgba(0,0,0,0.3); font-weight: 500; color: var(--muted); text-transform: uppercase; font-size: 0.8rem; }
.data-table tr:hover { background: var(--glass); }

/* Forms & Buttons */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.text-input, .select-input, .textarea-input { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 15px; color: #fff; font-family: inherit; font-size: 1rem; transition: border 0.2s; }
.select-input option { color: #000; background: #fff; font-weight: 500; }
.text-input:focus, .select-input:focus, .textarea-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.textarea-input { resize: vertical; min-height: 100px; }
.radio-option { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: #fff; }

.btn-primary, .btn-ghost, .btn-danger { padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; border: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--primary); color: #000; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 0 15px var(--primary-glow); }
.btn-ghost { background: var(--glass); color: #fff; border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-primary:disabled, .btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Company Cards & Toggle */
.company-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 15px; position: relative; overflow: hidden; }
.company-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.company-name { font-size: 1.2rem; font-weight: 600; color: #fff; }
.company-display { font-size: 0.9rem; color: var(--muted); }
.company-phone { font-size: 0.85rem; color: var(--secondary); margin-top: 5px; font-family: monospace; }
.company-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; border-top: 1px solid var(--border); padding-top: 15px; }
.company-actions button { width: 100%; justify-content: center; }

.mode-toggle-row { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; margin: 10px 0; }
.mode-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); transition: 0.3s; }
.mode-label.active-test { color: var(--test-color); text-shadow: 0 0 5px rgba(249,115,22,0.5); }
.mode-label.active-prod { color: var(--primary); text-shadow: 0 0 5px var(--primary-glow); }
.toggle-switch { position: relative; width: 50px; height: 26px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--test-color); transition: .4s; border-radius: 34px; }
.toggle-slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.toggle-switch input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }
.test-mode-badge { background: rgba(249, 115, 22, 0.1); color: var(--test-color); padding: 8px; border-radius: 6px; text-align: center; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--test-color); animation: pulse 2s infinite; }

/* Status Badges */
.status-badge { padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-green { background: rgba(37,211,102,0.1); color: var(--primary); border: 1px solid var(--primary); }
.badge-yellow { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid var(--warning); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid var(--danger); }
.badge-orange { background: rgba(249,115,22,0.1); color: var(--test-color); border: 1px solid var(--test-color); }
.badge-darkred { background: #7f1d1d; color: #fca5a5; border: 1px solid #ef4444; }
.badge-gray { background: var(--glass); color: var(--muted); border: 1px solid var(--border); }

/* Campaign Wizard */
.wizard-steps { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; background: var(--bg-card); padding: 20px 40px; border-radius: 12px; border: 1px solid var(--border); }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); position: relative; z-index: 2; }
.step.active { color: var(--primary); }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--glass); display: flex; align-items: center; justify-content: center; font-weight: 600; border: 2px solid var(--muted); transition: 0.3s; }
.step.active .step-num { background: var(--primary); color: #000; border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
.step-lbl { font-size: 0.85rem; font-weight: 500; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 15px; position: relative; top: -10px; }

.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 40px; text-align: center; color: var(--muted); transition: 0.2s; background: rgba(0,0,0,0.2); }
.upload-zone:hover { border-color: var(--primary); background: rgba(37,211,102,0.05); }
.cost-badge { background: rgba(37,211,102,0.1); border: 1px solid var(--primary); color: var(--primary); padding: 12px; border-radius: 8px; font-weight: 600; margin: 15px 0; display: inline-block; }
.total-cost-card { background: linear-gradient(to right, rgba(0,0,0,0.5), rgba(37,211,102,0.1)); border-left: 4px solid var(--primary); padding: 20px; border-radius: 8px; margin: 20px 0; }
.total-cost-value { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 5px 0; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid var(--danger); color: #fca5a5; padding: 15px; border-radius: 8px; margin: 20px 0; display: flex; justify-content: space-between; align-items: center; }
.summary-card { background: var(--glass); border: 1px solid var(--border); padding: 20px; border-radius: 12px; margin-bottom: 20px; }
.confirmation-note { font-size: 0.9rem; color: var(--warning); background: rgba(245,158,11,0.1); padding: 12px; border-radius: 8px; margin: 15px 0; border: 1px solid rgba(245,158,11,0.3); }

/* Progress Bar */
.progress-bar-wrap { width: 100%; background: rgba(255,255,255,0.1); border-radius: 8px; height: 8px; overflow: hidden; margin-top: 10px; }
.progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.3s; position: relative; }
.progress-bar.animated::after { content: ""; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: progress-anim 1.5s infinite; }
@keyframes progress-anim { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* Filter Tabs */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 15px; }
.tab-btn { background: transparent; border: none; color: var(--muted); font-size: 0.95rem; font-weight: 500; cursor: pointer; padding: 8px 16px; border-radius: 20px; transition: 0.2s; }
.tab-btn:hover { color: #fff; background: var(--glass); }
.tab-btn.active { background: var(--primary); color: #000; }

/* Inbox */
.inbox-layout { display: flex; height: calc(100vh - 180px); background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.inbox-list { width: 320px; border-right: 1px solid var(--border); overflow-y: auto; background: rgba(0,0,0,0.2); }
.inbox-chat { flex: 1; display: flex; flex-direction: column; background: #0b141a; position: relative; }
.inbox-item { padding: 15px; border-bottom: 1px solid var(--border); cursor: pointer; transition: 0.2s; display: flex; justify-content: space-between; }
.inbox-item:hover { background: var(--glass); }
.inbox-item.active { background: rgba(37,211,102,0.1); border-left: 3px solid var(--primary); }
.chat-empty { margin: auto; color: var(--muted); font-size: 1.1rem; }

.chat-header { padding: 15px 20px; background: var(--bg-card); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH5gIeEw44wz8wQwAAACJJREFUaN7t0AEBAAAAwiD7p7bEDyEAAAAAAAAAAAAAAIA7BsYAAeN+m8cAAAAASUVORK5CYII='); background-color: #0b141a; background-blend-mode: overlay; }
.chat-bubble { max-width: 70%; padding: 10px 15px; border-radius: 12px; font-size: 0.95rem; line-height: 1.4; position: relative; word-wrap: break-word; }
.msg-sent { background: #005c4b; color: #e9edef; align-self: flex-end; border-top-right-radius: 4px; }
.msg-received { background: #202c33; color: #e9edef; align-self: flex-start; border-top-left-radius: 4px; }
.msg-time { font-size: 0.7rem; color: rgba(255,255,255,0.6); display: block; text-align: right; margin-top: 5px; }
.btn-reply-indicator { font-size: 0.8rem; background: rgba(0,0,0,0.3); padding: 4px 8px; border-radius: 4px; margin-bottom: 5px; display: inline-block; color: var(--primary); border-left: 3px solid var(--primary); }
.chat-input-area { padding: 15px 20px; background: var(--bg-card); display: flex; gap: 10px; border-top: 1px solid var(--border); }
.chat-input-area input { flex: 1; border-radius: 24px; padding: 12px 20px; }
.chat-input-area button { border-radius: 50%; width: 45px; height: 45px; padding: 0; }

/* WhatsApp Preview Bubble */
.wa-phone-frame { width: 320px; height: 500px; border: 12px solid #111; border-radius: 36px; background: #0b141a; overflow: hidden; position: relative; margin: 0 auto; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.wa-chat-header { background: #202c33; padding: 15px; color: #fff; font-weight: 500; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.wa-chat-body { padding: 20px; height: calc(100% - 55px); overflow-y: auto; background-image: url('data:image/png;base64,...'); }
.wa-bubble-wrap { display: flex; justify-content: flex-start; margin: 10px 0; }
.wa-bubble { background: #202c33; color: #e9edef; border-radius: 12px; border-top-left-radius: 4px; padding: 10px; max-width: 90%; font-size: 0.95rem; box-shadow: 0 1px 0.5px rgba(0,0,0,0.13); position: relative; }
.wa-header { font-weight: 700; font-size: 1rem; margin-bottom: 5px; }
.wa-footer { font-size: 0.8rem; color: #8696a0; margin-top: 5px; }
.wa-btns { display: flex; flex-direction: column; gap: 1px; background: #202c33; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); margin-left:-10px; margin-right:-10px; margin-bottom:-10px; border-bottom-left-radius:12px; border-bottom-right-radius:12px; overflow:hidden;}
.wa-btn { background: #202c33; color: #00a884; border: none; padding: 12px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); width: 100%; font-size: 0.95rem; }
.wa-time { font-size: 0.7rem; color: #8696a0; text-align: right; margin-top: 5px; }
.preview-title { text-align: center; font-weight: 600; margin-bottom: 15px; color: var(--muted); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(5px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.3s; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; width: 90%; max-width: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.4); max-height: 90vh; display: flex; flex-direction: column; }
.modal-wide { max-width: 1000px; }
.modal-header { padding: 20px 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.3rem; margin: 0; }
.modal-close { background: transparent; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; transition: 0.2s; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 25px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 20px 25px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: rgba(0,0,0,0.2); border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.modal-two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; }

/* Credits & PIX */
.balance-hero { background: linear-gradient(135deg, rgba(37,211,102,0.15), rgba(17,24,39,0.9)); border: 1px solid var(--primary); border-radius: 16px; padding: 40px; text-align: center; box-shadow: 0 0 30px var(--primary-glow); margin-bottom: 30px; }
.balance-hero-label { font-size: 1.2rem; color: var(--muted); margin-bottom: 10px; }
.balance-hero-value { font-size: 3.5rem; font-weight: 700; color: #fff; text-shadow: 0 0 20px var(--primary-glow); }
.balance-hero-sub { margin-top: 15px; color: var(--muted); font-size: 1rem; }
.credit-packages-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 10px; }
.credit-package-card { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 12px; padding: 25px 20px; text-align: center; transition: 0.3s; display: flex; flex-direction: column; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.credit-package-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--border); transition: 0.3s; }
.credit-package-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); background: rgba(37,211,102,0.05); }
.credit-package-card:hover::before { background: var(--primary); }
.package-name { font-size: 0.85rem; font-weight: 700; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; text-transform: uppercase; }
.package-price { font-size: 2.2rem; font-weight: 800; color: #fff; margin-bottom: 20px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.package-features { list-style: none; padding: 0; margin: 0 0 25px 0; text-align: left; font-size: 0.85rem; color: #bbb; width: 100%; }
.package-features li { margin-bottom: 8px; }
.package-btn { width: 100%; padding: 12px; font-weight: bold; border-radius: 8px; }

@media (max-width: 768px) {
  .credit-packages-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .credit-packages-grid { grid-template-columns: 1fr; }
}
.pix-qr { text-align: center; background: #fff; padding: 20px; border-radius: 12px; margin: 20px auto; width: fit-content; }
.pix-qr img { width: 200px; height: 200px; display: block; }
.copy-code-wrap { display: flex; gap: 10px; }
.pix-timer { text-align: center; font-size: 1.2rem; font-weight: 600; color: var(--warning); margin: 15px 0; }
.pix-waiting { text-align: center; color: var(--primary); animation: pulse 2s infinite; font-size: 0.95rem; }

/* Variables Map */
.var-btns { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.var-btn { background: rgba(59,130,246,0.1); border: 1px solid var(--secondary); color: var(--secondary); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; cursor: pointer; transition: 0.2s; }
.var-btn:hover { background: var(--secondary); color: #fff; }
.var-map-display { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }

/* Toasts */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 15px 20px; border-radius: 8px; color: #fff; font-weight: 500; font-size: 0.95rem; box-shadow: 0 5px 15px rgba(0,0,0,0.3); transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.26, 1.55); backdrop-filter: blur(10px); }
.toast.show { transform: translateX(0); }
.toast-success { background: rgba(37,211,102,0.9); border-left: 4px solid #128C7E; }
.toast-error { background: rgba(239,68,68,0.9); border-left: 4px solid #b91c1c; }
.toast-warning { background: rgba(245,158,11,0.9); border-left: 4px solid #b45309; }
.toast-info { background: rgba(59,130,246,0.9); border-left: 4px solid #1d4ed8; }

.hidden { display: none !important; }

@media (max-width: 768px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 20px; }
  .sidebar-logo { margin-bottom: 10px; }
  .user-info { display: none; }
  nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .nav-btn { white-space: nowrap; }
  .sidebar-bottom { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .modal-two-col { grid-template-columns: 1fr; }
  .inbox-layout { flex-direction: column; height: calc(100vh - 200px); }
  .inbox-list { width: 100%; height: 30%; border-right: none; border-bottom: 1px solid var(--border); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }


/* ── Admin Tabs ─────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.08);
}
.admin-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.admin-tab.active { background: rgba(37,211,102,0.15); color: #25D366; font-weight: 600; }

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* ── Login Screen ───────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: #070d1a;
}
.login-bg-glow {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
.glow-top-left {
  top: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
}
.glow-bottom-right {
  bottom: -20%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 70%);
}
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
  margin: 1rem;
  z-index: 1;
}
.login-header {
  text-align: center;
  margin-bottom: 36px;
}
.logo-box {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #25D366 0%, #3B82F6 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px rgba(59,130,246,0.4);
  font-size: 30px;
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #1ab554, #3B82F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--muted);
}
.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 6px;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrapper .icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
}
.input-wrapper input {
  padding-left: 40px;
  width: 100%;
}
.icon-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.icon-btn:hover { color: #fff; }
.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
}
.error-message {
  color: #ef4444;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
}
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   MODAL TABS (GERENCIAR EMPRESA)
   ========================================================= */
.admin-tabs {
  display: flex;
  gap: 8px;
  padding: 0 24px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  outline: none;
  border-radius: 6px 6px 0 0;
  margin-bottom: -1px;
}

.admin-tab-btn:hover {
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.03);
}

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  background: rgba(34, 197, 94, 0.05);
}

.co-tab-content {
  animation: tabFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 560px; /* Fixa a altura das duas abas para que o modal não pule */
  overflow-y: auto; /* Adiciona scroll se o conteúdo for maior que a tela */
  padding-right: 8px; /* Evita que o scrollbar grude no conteúdo */
  display: flex;
  flex-direction: column;
}

/* Scrollbar estilizado para as abas */
.co-tab-content::-webkit-scrollbar {
  width: 6px;
}
.co-tab-content::-webkit-scrollbar-track {
  background: var(--bg-body);
  border-radius: 4px;
}
.co-tab-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.co-tab-content::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════ */
/* NOVA CAMPANHA WIZARD — PREMIUM REDESIGN            */
/* ═══════════════════════════════════════════════════ */

/* --- Stepper --- */
.wz-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.wz-step:hover {
  border-color: rgba(255,255,255,0.12);
}
.wz-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,0.025) 0%, transparent 100%);
}
.wz-step-num {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,211,102,0.25);
}
.wz-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.2px;
}
.wz-step-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1px;
}
.wz-step-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wz-step-body {
  padding: 20px 24px 24px;
}

/* --- Template Grid (wizard) --- */
.wz-tpl-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}
.wz-tpl-card {
  background: rgba(255,255,255,0.025);
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.wz-tpl-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37,211,102,0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}
.wz-tpl-card:hover {
  border-color: rgba(37,211,102,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.08);
}
.wz-tpl-card:hover::before {
  opacity: 1;
}
.wz-tpl-card.selected {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px var(--primary), 0 8px 24px rgba(37,211,102,0.12);
}
.wz-tpl-card.selected::after {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px; height: 24px;
  background: var(--primary);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(37,211,102,0.35);
}
.wz-tpl-meta {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative;
  z-index: 1;
}
.wz-tpl-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  word-break: break-all;
  margin-bottom: 6px;
  line-height: 1.3;
}
.wz-tpl-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  color: var(--muted);
}
.wz-tpl-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.wz-tpl-badge.approved {
  background: rgba(37,211,102,0.12);
  color: var(--primary);
}
.wz-tpl-badge.pending {
  background: rgba(255,193,7,0.12);
  color: #ffc107;
}
.wz-tpl-badge.price {
  background: rgba(37,211,102,0.08);
  color: var(--primary);
  font-weight: 600;
  text-transform: none;
  font-size: 0.72rem;
}
.wz-tpl-badge.vars {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  font-size: 0.72rem;
}
.wz-tpl-preview {
  padding: 12px;
  background: #0b141a;
  flex: 1;
  position: relative;
  z-index: 1;
}
.wz-tpl-preview .wa-bubble {
  margin: 0;
  border-radius: 8px;
  max-width: 100%;
  width: 100%;
}
.wz-tpl-preview .wa-body {
  font-size: 0.82rem;
  line-height: 1.45;
}

/* --- Selected template compact card --- */
.wz-selected-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(37,211,102,0.06);
  border: 1px solid rgba(37,211,102,0.18);
  border-radius: 12px;
  padding: 14px 18px;
  animation: wz-fade-in 0.3s ease;
}
.wz-selected-card .wz-sel-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(37,211,102,0.25);
}
.wz-selected-card .wz-sel-info {
  flex: 1;
  min-width: 0;
}
.wz-selected-card .wz-sel-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}
.wz-selected-card .wz-sel-detail {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Contacts Upload Area --- */
.wz-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(255,255,255,0.015);
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  position: relative;
}
.wz-upload-area:hover {
  border-color: rgba(37,211,102,0.35);
  background: rgba(37,211,102,0.03);
}
.wz-upload-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: rgba(37,211,102,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
  transition: transform 0.25s;
}
.wz-upload-area:hover .wz-upload-icon {
  transform: scale(1.05);
}
.wz-upload-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 4px;
}
.wz-upload-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}
.wz-upload-btn {
  margin-top: 14px;
  padding: 8px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(37,211,102,0.25);
}
.wz-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
}

/* --- Contacts Loaded State --- */
.wz-contacts-loaded {
  animation: wz-fade-in 0.3s ease;
}
.wz-contacts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.wz-contacts-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,211,102,0.08);
  border: 1px solid rgba(37,211,102,0.15);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}
.wz-contacts-count .count-num {
  font-size: 1.1rem;
  font-weight: 800;
}

/* --- Contacts Table --- */
.wz-table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.wz-table-wrap thead {
  background: rgba(0,0,0,0.3);
}
.wz-table-wrap th {
  padding: 10px 14px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
}
.wz-table-wrap .wz-table-body {
  max-height: 220px;
  overflow-y: auto;
  background: rgba(0,0,0,0.15);
}
.wz-table-wrap .wz-table-body::-webkit-scrollbar { width: 4px; }
.wz-table-wrap .wz-table-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.wz-table-wrap td {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.wz-table-wrap tr:last-child td {
  border-bottom: none;
}
.wz-table-wrap .wz-phone-cell {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
}
.wz-remove-btn {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.wz-remove-btn:hover {
  background: rgba(239,68,68,0.2);
}

/* --- Dispatch Section --- */
.wz-dispatch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 768px) {
  .wz-dispatch-grid { grid-template-columns: 1fr; }
}
.wz-dispatch-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.wz-dispatch-card .wz-dc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.wz-dispatch-card .wz-dc-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.wz-dispatch-card .wz-dc-value {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.wz-schedule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.wz-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.wz-radio-label:hover {
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
.wz-radio-label input[type="radio"] {
  accent-color: var(--primary);
}
.wz-radio-label:has(input:checked) {
  border-color: rgba(37,211,102,0.4);
  background: rgba(37,211,102,0.06);
  color: #fff;
}

.wz-dispatch-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.wz-cost-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(37,211,102,0.06);
  border: 1px solid rgba(37,211,102,0.18);
  border-radius: 12px;
  padding: 12px 20px;
}
.wz-cost-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.wz-cost-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.wz-cost-detail {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}
.wz-launch-btn {
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}
.wz-launch-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.4);
}
.wz-launch-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.wz-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 10px 16px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: 10px;
  margin-top: 14px;
}

/* --- Animations --- */
@keyframes wz-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.wz-step { animation: wz-fade-in 0.4s ease; }
.wz-step:nth-child(2) { animation-delay: 0.05s; }
.wz-step:nth-child(3) { animation-delay: 0.1s; }

/* --- Split Layout (Template + Upload side by side) --- */
.wz-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.wz-split-row {
  display: flex;
  gap: 20px;
  align-items: stretch;
}
.wz-split-left {
  flex: 1;
  min-width: 0;
}
.wz-split-right {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.wz-split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.wz-split-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wz-split-right .wz-upload-area {
  flex: 1;
  min-height: 0;
  padding: 24px 16px;
}
.wz-split-right .wz-upload-icon {
  width: 44px; height: 44px;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.wz-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}
.wz-link-btn:hover { background: rgba(37,211,102,0.08); }
.wz-link-btn.danger { color: #EF4444; }
.wz-link-btn.danger:hover { background: rgba(239,68,68,0.08); }

/* Loaded state (contacts imported) */
.wz-loaded-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  border: 2px solid rgba(37,211,102,0.3);
  border-radius: 12px;
  background: rgba(37,211,102,0.04);
  flex: 1;
}
.wz-loaded-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 14px;
}
.wz-loaded-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -1px;
}
.wz-loaded-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.wz-loaded-actions {
  display: flex;
  gap: 4px;
}

/* --- Unified Action Bar --- */
.wz-action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-top: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.wz-action-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wz-action-center {
  flex: 1;
  text-align: center;
}
.wz-action-meta {
  font-size: 0.82rem;
  color: var(--muted);
}
.wz-action-separator {
  color: var(--border);
  margin: 0 4px;
  font-weight: 700;
}
.wz-action-cost {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
}
.wz-action-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wz-action-note {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
  opacity: 0.7;
}

/* Radio pills */
.wz-radio-pill {
  cursor: pointer;
}
.wz-radio-pill input { display: none; }
.wz-radio-pill span {
  display: inline-block;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
  transition: all 0.2s;
}
.wz-radio-pill input:checked + span {
  background: rgba(37,211,102,0.12);
  color: var(--primary);
  border-color: rgba(37,211,102,0.3);
}
.wz-radio-pill:hover span {
  border-color: rgba(37,211,102,0.2);
}

@media (max-width: 900px) {
  .wz-split-row {
    flex-direction: column;
  }
  .wz-split-right {
    width: 100%;
  }
  .wz-action-bar {
    flex-direction: column;
    gap: 12px;
  }
}


/* Unread Pulse */
@keyframes pulse-yellow {
  0% { background-color: rgba(0,0,0,0.2); }
  50% { background-color: rgba(255, 255, 0, 0.15); }
  100% { background-color: rgba(0,0,0,0.2); }
}
.unread-pulse {
  animation: pulse-yellow 2s infinite;
}
