:root {
  --bg-primary: #05070a;
  --bg-secondary: #0a0d14;
  --bg-tertiary: #111520;
  --card-bg: linear-gradient(135deg, rgba(17, 22, 34, 0.55) 0%, rgba(10, 13, 20, 0.75) 100%);
  --border-color: rgba(255, 255, 255, 0.05);
  --border-color-hover: rgba(99, 102, 241, 0.2);
  
  /* Accent Colors */
  --color-emerald: #0d9488; /* Sophisticated Mint/Teal */
  --color-emerald-hover: #0f766e;
  --color-purple: #6366f1; /* Premium Amethyst Indigo */
  --color-purple-hover: #4f46e5;
  --color-blue: #0ea5e9;
  --color-amber: #d97706;
  --color-error: #f43f5e; /* Elegant Rose */
  --color-error-hover: #e11d48;
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.75);
  --glow-emerald: 0 0 20px rgba(13, 148, 136, 0.2);
  --glow-purple: 0 0 20px rgba(99, 102, 241, 0.2);
  
  /* Layout */
  --sidebar-width: 280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Custom Scrollbar for Webkit */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, .brand-name h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
}

/* Background Ambient Glows */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 {
  background: radial-gradient(circle, rgba(20, 184, 166, 0.04) 0%, rgba(20, 184, 166, 0) 70%);
  top: -100px;
  left: -50px;
}
.bg-glow-2 {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0) 70%);
  bottom: -50px;
  right: -50px;
}

/* App Wrapper Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* SIDEBAR STYLES */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-emerald) 0%, var(--color-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.2);
}
.logo-icon {
  width: 22px;
  height: 22px;
  color: white;
}
.brand-name h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}
.brand-name span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}
.nav-item i {
  width: 18px;
  height: 18px;
}
.nav-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}
.nav-item.active {
  color: var(--text-primary);
  background: rgba(13, 148, 136, 0.08);
  border-left: 3px solid var(--color-emerald);
}

.session-profile-card {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  margin-top: auto;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-indicator-dot.connected {
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
  animation: pulse 2s infinite;
}
.status-indicator-dot.waiting {
  background-color: var(--color-amber);
  box-shadow: 0 0 8px var(--color-amber);
  animation: pulse 2s infinite;
}
.status-indicator-dot.disconnected {
  background-color: var(--text-muted);
}
.status-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.profile-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}
.profile-avatar i {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}
.profile-info h4 {
  font-size: 0.85rem;
  color: var(--text-primary);
}
.profile-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* MAIN CONTENT STYLES */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
  max-width: 100%;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.page-title h1 {
  font-size: 1.85rem;
  margin-bottom: 6px;
  background: linear-gradient(to right, var(--text-primary) 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* CARD SYSTEM (GLASSMORPHISM) */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  transition: border-color 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(99, 102, 241, 0.05);
}
.glass-card.flex-col {
  display: flex;
  flex-direction: column;
  height: calc(100% - 24px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}
.card-header h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-emerald) 0%, var(--color-emerald-hover) 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm), var(--glow-emerald);
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35);
  filter: brightness(1.08);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-color-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}
.btn-secondary:active {
  transform: translateY(0);
}
.btn-error {
  background: linear-gradient(135deg, var(--color-error) 0%, var(--color-error-hover) 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-sm), 0 0 20px rgba(244, 63, 94, 0.15);
}
.btn-error:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.3);
  filter: brightness(1.08);
}
.btn-error:active {
  transform: translateY(0);
}
.btn-toggle {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 16px;
}
.btn-toggle.active {
  background-color: var(--color-emerald);
  color: white;
  border-color: var(--color-emerald);
  box-shadow: var(--glow-emerald);
}
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  padding: 0;
}
.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-success { background: rgba(13, 148, 136, 0.15); color: var(--color-emerald); border: 1px solid rgba(13, 148, 136, 0.2); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--color-error); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-neutral { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* GRID SYSTEM */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-3-2 { grid-template-columns: 3fr 2fr; }


/* STATS CARDS */
.stats-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
}
.stats-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-icon i {
  width: 26px;
  height: 26px;
}
.stats-icon.text-emerald { color: var(--color-emerald); border-color: rgba(13, 148, 136, 0.2); }
.stats-icon.text-purple { color: var(--color-purple); border-color: rgba(99, 102, 241, 0.2); }
.stats-icon.text-amber { color: var(--color-amber); border-color: rgba(217, 119, 6, 0.2); }
.stats-info h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.stats-info h2 {
  font-size: 1.85rem;
  margin: 2px 0;
}
.stats-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* CONNECTION DASHBOARD STATE */
.connection-panel-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  text-align: center;
}
.connection-status-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  max-width: 340px;
}
.connection-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border: 2px dashed rgba(239, 68, 68, 0.3);
}
.connection-icon-wrapper i {
  width: 36px;
  height: 36px;
}
.connection-icon-wrapper.connected {
  background-color: rgba(13, 148, 136, 0.1);
  color: var(--color-emerald);
  border: 2px solid rgba(13, 148, 136, 0.3);
  box-shadow: 0 0 20px rgba(13, 148, 136, 0.15);
}
.connection-icon-wrapper.waiting {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-amber);
  border: 2px dashed rgba(245, 158, 11, 0.3);
}
.connection-status-large h3 {
  font-size: 1.25rem;
}
.connection-status-large p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* QUICK ACTIONS LIST */
.quick-actions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
}
.action-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
  transform: translateX(4px);
}
.action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-icon.text-emerald { color: var(--color-emerald); }
.action-icon.text-purple { color: var(--color-purple); }
.action-icon.text-blue { color: var(--color-blue); }
.action-details h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.action-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.chevron {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-input, .form-select, textarea {
  width: 100%;
  background-color: rgba(8, 11, 17, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, textarea:focus {
  border-color: var(--color-emerald);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}
textarea {
  resize: vertical;
}
.help-text {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}
.inline-icon {
  width: 13px;
  height: 13px;
}
.toggle-group {
  display: flex;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.toggle-group button {
  flex-grow: 1;
}

/* RANGE SLIDER STYLING */
.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.slider-label-row span {
  font-weight: 600;
  color: var(--color-emerald);
}
.form-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-primary);
  outline: none;
  margin: 10px 0;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-emerald);
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 0 8px var(--color-emerald);
}
.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* FILE UPLOAD DRAG-DROP ZONE */
.file-upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.01);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, background-color 0.2s;
}
.file-upload-zone:hover, .file-drop-zone.dragover {
  border-color: var(--color-emerald);
  background-color: rgba(13, 148, 136, 0.03);
}
.file-upload-zone i {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
}
.font-semibold { font-weight: 600; }
.text-primary { color: var(--color-emerald); }
.text-xs { font-size: 0.75rem; color: var(--text-muted); }

.csv-preview-container {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  margin-top: 10px;
}
.csv-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  margin-bottom: 4px;
}

/* BUTTON GROUP LAYOUTS */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.button-row.end {
  justify-content: flex-end;
}

/* LIVE PROGRESS PANEL & LOGS DISPLAY */
.live-progress-panel {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.progress-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.progress-stat-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.progress-stat-box .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.progress-stat-box .value {
  font-size: 1.15rem;
  font-weight: 700;
}

.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.progress-bar-container {
  flex-grow: 1;
  height: 8px;
  border-radius: 4px;
  background-color: var(--bg-primary);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-emerald) 0%, var(--color-purple) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-percent {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 40px;
  text-align: right;
}

.logs-container-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}
.logs-display {
  flex-grow: 1;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  font-family: monospace;
  font-size: 0.8rem;
  overflow-y: auto;
  max-height: 280px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 3px solid var(--border-color);
}
.log-placeholder {
  color: var(--text-muted);
  text-align: center;
  margin: auto;
  font-style: italic;
}
.log-line {
  line-height: 1.4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 4px;
}
.log-time { color: var(--text-muted); }
.log-tag {
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  margin: 0 4px;
  font-size: 0.7rem;
}
.log-tag-system { background-color: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.log-tag-sent { background-color: rgba(13, 148, 136, 0.15); color: var(--color-emerald); }
.log-tag-failed { background-color: rgba(244, 63, 94, 0.15); color: var(--color-error); }
.log-tag-campaign { background-color: rgba(99, 102, 241, 0.15); color: var(--color-purple); }

.log-type-success { color: var(--color-emerald); }
.log-type-error { color: var(--color-error); }
.log-type-warning { color: var(--color-amber); }
.log-type-debug { color: var(--text-muted); }

/* TAB PANEL ROUTING VISIBILITY */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* OUTREACH CAMPAIGN SPECIFIC STYLES */
.tag-helpers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tag-helper {
  font-size: 0.75rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.tag-helper:hover {
  background-color: rgba(13, 148, 136, 0.08);
  border-color: var(--color-emerald);
  color: var(--color-emerald);
}

.campaign-monitor-panel {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.queue-gauge-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.queue-gauge-box {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}
.queue-gauge-box .label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.queue-gauge-box .value {
  font-size: 1.15rem;
  font-weight: 700;
}
.queue-gauge-box.text-purple { color: var(--color-purple); }

/* WHATSAPP BUBBLE PREVIEW CARD */
.message-preview-bubble {
  background-color: #0d141a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px;
  max-width: 100%;
  margin-top: 14px;
  position: relative;
  box-shadow: var(--shadow-sm);
  background-image: radial-gradient(rgba(13, 148, 136, 0.05) 1px, transparent 0);
  background-size: 10px 10px;
}
.bubble-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.bubble-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.bubble-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.bubble-header span {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.bubble-content {
  background-color: #005c4b; /* WhatsApp Sent green */
  color: #e9edef;
  border-radius: 10px 0 10px 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: pre-wrap;
  width: fit-content;
  max-width: 85%;
  margin-left: auto;
  position: relative;
}
.bubble-content::after {
  content: '';
  position: absolute;
  top: 0;
  right: -8px;
  width: 0;
  height: 0;
  border-left: 10px solid #005c4b;
  border-bottom: 10px solid transparent;
}
.bubble-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
}
.check-icon {
  width: 12px;
  height: 12px;
  color: #53bdeb; /* WhatsApp blue ticks */
}

/* VERIFIED CONTACTS TABLE STYLES */
.table-actions-header {
  border-bottom: none;
  padding-bottom: 0;
}
.search-box-container {
  position: relative;
  width: 340px;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.search-box-container input {
  padding-left: 36px;
  font-size: 0.85rem;
  height: 38px;
}
.table-scrollable {
  overflow-x: auto;
  border-radius: 14px;
}
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}
.contacts-table th {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  padding: 16px 20px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}
.contacts-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.contacts-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}
.contacts-table tr:last-child td {
  border-bottom: none;
}
.table-placeholder {
  text-align: center;
  padding: 60px 0 !important;
  color: var(--text-muted);
}
.table-placeholder p {
  font-size: 0.85rem;
}

.table-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background-color: var(--bg-tertiary);
}
.table-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}
.table-avatar-fallback i {
  width: 14px;
  height: 14px;
}
.table-contact-name {
  font-weight: 500;
}

/* MODAL STYLING */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px 10px;
}
.qr-modal-card {
  max-width: 480px;
  width: 100%;
  margin: 20px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  text-align: center;
}
.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  font-size: 1.35rem;
}
.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-close:hover {
  color: var(--text-primary);
}
.modal-body p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}
.qr-code-wrapper {
  background-color: white;
  border-radius: 16px;
  padding: 16px;
  display: inline-block;
  box-shadow: var(--shadow-lg);
  margin: 0 auto 20px auto;
  width: 100%;
  max-width: 250px;
  height: auto;
  aspect-ratio: 1 / 1;
  position: relative;
}
.qr-code-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.qr-loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--bg-primary);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(13, 148, 136, 0.2);
  border-top-color: var(--color-emerald);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.qr-loading-spinner span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.qr-modal-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: 20px;
}
.modal-small {
  max-width: 440px;
  width: 100%;
  margin: 20px;
  box-shadow: var(--shadow-lg);
}
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-amber); }

/* TOAST NOTIFICATIONS (GLASSMORPHIC) */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: 100%;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: rgba(15, 20, 30, 0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, margin 0.3s ease;
  opacity: 0;
  position: relative;
  overflow: hidden;
}
.toast::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.toast.toast-success::after {
  background-color: var(--color-emerald);
}
.toast.toast-error::after {
  background-color: var(--color-error);
}
.toast.toast-info::after {
  background-color: var(--color-blue);
}
.toast.toast-warning::after {
  background-color: var(--color-amber);
}
.toast.show {
  transform: translateX(0);
  opacity: 1;
}
.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}
.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast-success .toast-icon {
  color: var(--color-emerald);
}
.toast-error .toast-icon {
  color: var(--color-error);
}
.toast-info .toast-icon {
  color: var(--color-blue);
}
.toast-warning .toast-icon {
  color: var(--color-amber);
}
.toast-content {
  flex-grow: 1;
}
.toast-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
  align-self: flex-start;
}
.toast-close:hover {
  color: var(--text-primary);
}

/* LIMIT METRICS AND SAFETY WIDGET */
.limit-metric-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.limit-metric-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.limit-metric-header span:last-child {
  font-weight: 700;
  color: var(--text-primary);
}
.limit-progress-bar-container {
  height: 8px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}
.limit-progress-bar {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.1, 0.8, 0.2, 1), background-color 0.3s ease;
}
.limit-progress-bar.progress-verify {
  background: linear-gradient(90deg, var(--color-emerald) 0%, #06b6d4 100%);
}
.limit-progress-bar.progress-message {
  background: linear-gradient(90deg, var(--color-blue) 0%, var(--color-purple) 100%);
}
.limit-progress-bar.warning {
  background: linear-gradient(90deg, var(--color-amber) 0%, #f97316 100%) !important;
}
.limit-progress-bar.danger {
  background: linear-gradient(90deg, var(--color-error) 0%, #b91c1c 100%) !important;
}
.safety-guidelines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
}
.guideline-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}
.guideline-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.guideline-details p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* SESSIONS LIST GRID */
.sessions-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.session-item-card {
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.session-item-card:hover {
  transform: translateY(-2px);
}

.session-qr-container img {
  image-rendering: pixelated;
}

/* =====================================================
   MOBILE BOTTOM NAVIGATION BAR
   Base: always hidden â€” turned on inside @media blocks
   ===================================================== */
/* Mobile nav hidden by default */
.mobile-nav {
  display: none;
}

/* ─── "More" Popup Card ──────────────────────────────────
   Floats above the bottom nav, anchored to the right.
   Hidden by default, toggled via JS.
   ────────────────────────────────────────────────────── */
.more-menu-popup {
  display: none;
  position: fixed;
  bottom: 70px; /* sits above the nav bar */
  right: 8px;
  z-index: 600;
  background: rgba(10, 13, 20, 0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.08);
  padding: 8px 0;
  min-width: 210px;
  animation: morePopupIn 0.18s cubic-bezier(0.16,1,0.3,1);
  transform-origin: bottom right;
}
.more-menu-popup.active {
  display: block;
}
@keyframes morePopupIn {
  from { opacity: 0; transform: scale(0.88) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.more-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}
.more-menu-item:first-child {
  border-radius: 12px 12px 0 0;
}
.more-menu-item:last-child {
  border-radius: 0 0 12px 12px;
}
.more-menu-item:only-child {
  border-radius: 12px;
}
.more-menu-item:hover,
.more-menu-item.active {
  background: rgba(13,148,136,0.1);
  color: var(--color-emerald);
}
.more-menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.more-menu-item:hover .more-menu-icon {
  background: rgba(13,148,136,0.12);
  border-color: rgba(13,148,136,0.25);
}
.more-menu-icon i {
  width: 16px;
  height: 16px;
}
.more-menu-item span {
  font-size: 0.9rem;
  line-height: 1;
}

/* Divider between items */
.more-menu-item + .more-menu-item {
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ─── More button in nav bar ────────────────────────── */
.nav-more-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.nav-more-btn.more-open i,
.nav-more-btn.active i {
  color: var(--color-emerald);
}
.nav-more-btn.more-open span,
.nav-more-btn.active span {
  color: var(--color-emerald);
}


/* Hamburger + Drawer: hidden everywhere by default */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 2001;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(10, 13, 20, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: all 0.25s ease;
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
  transform-origin: center;
}
.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Drawer overlay */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1999;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.mobile-drawer-overlay.active {
  display: block;
}

/* Slide drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  width: 270px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid rgba(255,255,255,0.06);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 70px 16px 40px;
  gap: 6px;
  transition: right 0.3s cubic-bezier(0.16,1,0.3,1);
  box-shadow: -20px 0 60px rgba(0,0,0,0.7);
  overflow-y: auto;
}
.mobile-drawer.active {
  right: 0;
}
.mobile-drawer .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: none;
}
.mobile-drawer .nav-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.mobile-drawer .nav-item span {
  display: inline;
  font-size: 0.92rem;
  white-space: nowrap;
}
.mobile-drawer .nav-item.active {
  color: var(--text-primary);
  background: rgba(13,148,136,0.1);
  border-left: 3px solid var(--color-emerald);
}
.mobile-drawer .nav-item:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}
.drawer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 8px;
}
.drawer-brand h2 {
  font-size: 1.1rem;
  line-height: 1.2;
}
.drawer-brand span {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
}

/* =====================================================
   TABLET & MOBILE: <= 1024px
   Sidebar hidden, bottom nav shown, layout full-width
   Hamburger NOT shown here â€” only at <=480px
   ===================================================== */
@media (max-width: 1024px) {
  /* Hide desktop sidebar */
  .sidebar {
    display: none;
  }

  /* Main content: full width, leave space for bottom nav */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 18px 90px !important;
    overflow-x: hidden;
  }

  /* Show mobile bottom nav with abbreviated labels */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(5, 7, 10, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 500;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.6);
  }

  .mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 500;
    flex: 1;
    padding: 8px 4px;
    border-radius: 0;
    background: none;
    border-left: none !important;
    transition: color 0.2s ease, background 0.2s ease;
    min-width: 0;
    overflow: hidden;
  }

  .mobile-nav .nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 54px;
    display: block;
    line-height: 1;
  }

  .mobile-nav .nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .mobile-nav .nav-item:hover,
  .mobile-nav .nav-item.active {
    color: var(--color-emerald);
    background: rgba(13,148,136,0.06);
  }

  /* Stack top header */
  .top-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 20px;
  }

  .top-header .actions {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  /* Collapse 3-column grids to single */
  .grid-3-2 {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   PHONE: <= 768px
   Tighter layout, icons-only bottom nav
   ===================================================== */
@media (max-width: 768px) {
  .main-content {
    padding: 18px 14px 82px !important;
  }

  /* Bottom nav: icons only, no labels */
  .mobile-nav {
    height: 56px;
  }

  /* More popup rises just above the 56px nav */
  .more-menu-popup {
    bottom: 62px;
  }

  .mobile-nav .nav-item {
    gap: 0;
    padding: 8px 2px;
    font-size: 0;
  }

  .mobile-nav .nav-item span {
    display: none;
  }

  .mobile-nav .nav-item i {
    width: 22px;
    height: 22px;
  }

  /* Grids collapse */
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  .queue-gauge-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Table header stacks */
  .table-actions-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-box-container {
    width: 100%;
  }
  .table-actions-header .button-row {
    flex-wrap: wrap;
  }
  .table-actions-header .btn {
    flex-grow: 1;
  }

  /* Center top header */
  .top-header {
    align-items: center;
    text-align: center;
  }
  .top-header .actions {
    justify-content: center;
  }
  .top-header .actions .btn {
    flex: 1;
    min-width: 110px;
  }
  .page-title h1 {
    font-size: 1.45rem;
  }
  .page-title p {
    font-size: 0.85rem;
  }

  /* Cards tighter */
  .glass-card {
    padding: 18px;
    border-radius: 16px;
  }
  .card-header h3 {
    font-size: 1rem;
  }

  /* QR Modal full mobile */
  .modal-overlay {
    align-items: flex-start;
    padding: 20px 12px 90px;
  }
  .qr-modal-card {
    padding: 20px 16px !important;
    margin: 0 auto;
    width: 100%;
    max-width: 420px;
  }
  .qr-modal-card h2 {
    font-size: 1.2rem;
  }
  .qr-modal-card p {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  /* Buttons stack */
  .button-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }
  .button-row .btn {
    width: 100%;
  }
}

/* =====================================================
   EXTRA SMALL: <= 480px
   Show hamburger, hide bottom nav labels (already icons-only)
   Bottom nav still shows for quick icon switching
   ===================================================== */
@media (max-width: 480px) {
  .main-content {
    padding: 14px 10px 80px !important;
  }

  /* Show hamburger button for full menu access */
  .hamburger-btn {
    display: flex;
  }

  /* Bottom nav stays but even more compact */
  .mobile-nav {
    height: 52px;
  }

  /* More popup sits above 52px nav */
  .more-menu-popup {
    bottom: 58px;
    right: 6px;
    min-width: 195px;
  }

  .mobile-nav .nav-item {
    padding: 8px 1px;
  }

  .mobile-nav .nav-item i {
    width: 20px;
    height: 20px;
  }

  .glass-card {
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 14px;
  }

  .modal-small, .qr-modal-card {
    margin: 0 auto;
    width: 100%;
  }

  .qr-code-wrapper {
    max-width: 200px;
    padding: 10px;
  }

  .stats-card {
    padding: 14px;
    gap: 12px;
    border-radius: 14px;
  }
  .stats-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  .stats-icon i {
    width: 18px;
    height: 18px;
  }
  .stats-info h2 {
    font-size: 1.35rem;
  }

  .queue-gauge-grid {
    grid-template-columns: 1fr;
  }

  .page-title h1 {
    font-size: 1.25rem;
  }

  .btn {
    padding: 9px 14px;
    font-size: 0.84rem;
  }
}

/* =====================================================
   TABLE WRAPPER - horizontally scrollable on all screens
   ===================================================== */
.contacts-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

