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

:root {
  --primary: #128C7E;
  --secondary: #25D366;
  --danger: #DC3545;
  --bg-dark: #0A1628;
  --bg-light: #F0F2F5;
  --text-dark: #1F2937;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 40px 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 5px;
}

header p {
  font-size: 1rem;
  opacity: 0.9;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  padding: 12px 24px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--text-dark);
}

h3 {
  font-size: 1.2rem;
  margin: 20px 0 15px;
  color: var(--text-dark);
}

.form-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

form {
  display: grid;
  gap: 12px;
}

input, textarea, select {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.1);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

button {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

button:hover {
  background: #0d6f68;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

button:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover {
  background: #1fa851;
}

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

.btn-danger:hover {
  background: #c82333;
}

.list-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.list {
  display: grid;
  gap: 15px;
}

.item {
  background: var(--bg-light);
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.item:hover {
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.item-desc {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 4px;
}

.item-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  background: rgba(18, 140, 126, 0.1);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.85rem;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.btn-edit {
  background: #3B82F6;
}

.btn-edit:hover {
  background: #2563EB;
}

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

.btn-delete:hover {
  background: #c82333;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 16px 24px;
  background: #333;
  color: white;
  border-radius: 6px;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.toast.show {
  display: block;
}

.toast.success {
  background: #10B981;
}

.toast.error {
  background: #EF4444;
}

.toast.info {
  background: #3B82F6;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Pastas de Grupos */
.group-folder-card {
  background: white;
  border-radius: 8px;
  border-left: 5px solid var(--primary);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.group-folder-header {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.group-folder-header:hover {
  background: var(--bg-light);
}

.group-folder-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-dark);
}

.group-folder-count {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-left: 8px;
}

.group-folder-groups {
  padding: 0 15px 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.group-chip:hover {
  border-color: var(--danger);
}

.group-chip .chip-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
  width: auto;
  transition: color 0.2s ease;
}

.group-chip .chip-remove:hover {
  color: var(--danger);
  background: none;
  transform: none;
  box-shadow: none;
}

.group-folder-empty {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  padding: 0 15px 15px;
}

.group-folder-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.group-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.group-add-row select {
  padding: 6px 10px;
  font-size: 0.85rem;
  flex: 1;
  max-width: 220px;
}

.group-add-row button {
  padding: 6px 14px;
  font-size: 0.85rem;
  width: auto;
}

.list-section + .list-section {
  margin-top: 20px;
}

.list-section + .form-section {
  margin-top: 20px;
}

.form-section + .list-section {
  margin-top: 20px;
}

/* Connection Status */
.connection-status {
  margin-top: 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9CA3AF;
}

.status-dot.connected {
  background: #10B981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.status-dot.disconnected {
  background: #EF4444;
}

/* Campaign Status Tags */
.status-draft { background: #E5E7EB; color: #6B7280; }
.status-queued { background: #FEF3C7; color: #D97706; }
.status-running { background: #FDE68A; color: #B45309; animation: pulse 1.5s infinite; }
.status-completed { background: #D1FAE5; color: #059669; }
.status-failed { background: #FEE2E2; color: #DC2626; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Dispatch Button */
.btn-dispatch {
  background: #F59E0B;
  font-weight: 700;
}

.btn-dispatch:hover {
  background: #D97706;
}

/* Progress Bar */
.progress-bar {
  margin-top: 8px;
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #128C7E, #25D366);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Schedule Picker / Calendar */
.schedule-picker { margin-top: 4px; }

.cal-widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 252px;
  user-select: none;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--primary);
  color: #fff;
}

.cal-nav button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  width: auto;
  padding: 0 6px;
  line-height: 1;
}

.cal-nav button:hover { opacity: 0.75; }

#calMonthLabel { font-weight: 600; font-size: 0.92rem; }

.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f3f4f6;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
  padding: 5px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px;
  gap: 2px;
}

.cal-day {
  text-align: center;
  padding: 7px 2px;
  font-size: 0.82rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.12s;
}

.cal-day:hover { background: #e8f5e9; }
.cal-day.today { font-weight: 700; color: var(--primary); }
.cal-day.selected { background: var(--primary) !important; color: #fff !important; font-weight: 700; }
.cal-day.other-month { color: #d1d5db; cursor: default; pointer-events: none; }
.cal-day.past { color: #d1d5db; cursor: default; pointer-events: none; }

/* Group Add Row padding fix */
.group-folder-card .group-add-row {
  padding: 0 15px 15px;
}

/* ===== SCHEDULE CARD ===== */
.schedule-card {
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.schedule-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.schedule-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-dark);
}

.schedule-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-active { background: #D1FAE5; color: #065F46; }
.badge-paused { background: #F3F4F6; color: #6B7280; }

.schedule-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-light);
}

.meta-value {
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 500;
}

.schedule-msg-box {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 4px;
}

.schedule-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.schedule-msg-preview {
  font-size: 0.83rem;
  color: var(--text-light);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ===== PHONE PANEL (CSV + manual) ===== */
.phone-panel {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.phone-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.phone-tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  width: auto;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.phone-tab-btn:hover { color: var(--primary); background: none; box-shadow: none; transform: none; }
.phone-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.phone-tab-content {
  padding: 14px;
}

.phone-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.phone-method-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-light);
}

.phone-textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  resize: vertical;
  font-family: 'Menlo', 'Consolas', monospace;
  min-height: 110px;
}

.phone-csv-col {
  display: flex;
  flex-direction: column;
}

.csv-drop {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 16px 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-light);
  transition: border-color 0.2s, background 0.2s;
  min-height: 110px;
}

.csv-drop:hover { border-color: var(--primary); background: rgba(18,140,126,0.05); color: var(--primary); }

.csv-drop small { font-size: 0.72rem; opacity: 0.75; }

.csv-drop-icon { font-size: 1.6rem; line-height: 1; }

/* Responsivo */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .item {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-actions {
    width: 100%;
    margin-top: 12px;
  }

  button {
    width: 100%;
  }
}

/* ===== FILTROS DE AGENDAMENTOS ===== */
.schedule-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.15s;
  width: auto;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== STATUS DE EXECUCAO ===== */
.run-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
}
.run-status::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.run-success { background: #D1FAE5; color: #065F46; }
.run-success::before { background: #10B981; }
.run-failed { background: #FEE2E2; color: #991B1B; cursor: help; }
.run-failed::before { background: #EF4444; }

/* ===== CHECKBOX ROW ===== */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 4px 0;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== Agendamento em lote ===== */
.batch-hint { font-size: 0.82rem; color: #6b7280; margin: -4px 0 12px; }
.batch-selects { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.batch-selects select { flex: 1; min-width: 220px; }
.batch-msg-card {
  border: 1.5px solid var(--border);
  border-left: 4px solid #128C7E;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  background: #fff;
}
.batch-msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.batch-msg-preview { font-size: 0.82rem; color: #6b7280; margin-bottom: 8px; white-space: pre-wrap; }
.batch-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.batch-controls input { width: 120px; }
.bm-groups-box {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  max-height: 140px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; background: #f9fafb;
}
.bm-group-check { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; cursor: pointer; }
.bm-group-check.bm-all { width: 100%; padding-bottom: 4px; border-bottom: 1px dashed var(--border); }

/* ===== Controle de disparo e progresso ===== */
.btn-pause { background: #6366F1; color: #fff; }
.btn-pause:hover { background: #4F46E5; }
.status-paused { background: #E0E7FF; color: #3730A3; }
.status-canceled { background: #F3F4F6; color: #4B5563; }
.progress-fill.paused { background: #6366F1; }

.progress-panel {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.progress-empty { font-size: 0.84rem; color: #6b7280; padding: 8px 0; }

.prog-metrics { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.prog-metric { font-size: 0.8rem; color: #4B5563; }
.prog-metric b { font-size: 0.95rem; }
.prog-metric.prog-ok { color: #065F46; }
.prog-metric.prog-err { color: #991B1B; }
.prog-metric.prog-wait { color: #92400E; }
.prog-metric.prog-cancel { color: #4B5563; }

.prog-table-wrap { max-height: 260px; overflow-y: auto; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
.prog-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.prog-table thead th {
  position: sticky; top: 0; background: #f9fafb; text-align: left;
  padding: 7px 10px; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.prog-table td { padding: 6px 10px; border-bottom: 1px solid #f3f4f6; }
.prog-table tr:last-child td { border-bottom: none; }
.prog-when { color: #6b7280; white-space: nowrap; font-variant-numeric: tabular-nums; }

.prog-badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.prog-badge.prog-ok { background: #D1FAE5; color: #065F46; }
.prog-badge.prog-err { background: #FEE2E2; color: #991B1B; cursor: help; }
.prog-badge.prog-wait { background: #FEF3C7; color: #92400E; }
.prog-badge.prog-cancel { background: #F3F4F6; color: #4B5563; }

.prog-errors { margin-top: 10px; padding: 8px 10px; background: #FEF2F2; border-radius: 6px; font-size: 0.78rem; color: #991B1B; }
.prog-error-line { margin-top: 4px; }
.prog-error-line span { font-weight: 600; }

/* ===== Seletor de emoji ===== */
.textarea-wrap { position: relative; display: block; }
.textarea-wrap textarea { width: 100%; padding-right: 40px !important; }
.emoji-btn {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.emoji-btn:hover { background: #f3f4f6; border-color: #9CA3AF; }

.emoji-panel {
  position: absolute; z-index: 1000; display: none;
  width: 312px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  overflow: hidden;
}
.emoji-tabs { display: flex; border-bottom: 1px solid var(--border); background: #f9fafb; }
.emoji-tab {
  flex: 1; padding: 8px 0; border: none; background: none;
  cursor: pointer; font-size: 17px; line-height: 1;
  border-bottom: 2px solid transparent;
}
.emoji-tab:hover { background: #f3f4f6; }
.emoji-tab.active { border-bottom-color: var(--primary); background: #fff; }
.emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 2px; padding: 8px; max-height: 210px; overflow-y: auto;
}
.emoji-cell {
  border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 5px 0; border-radius: 6px;
}
.emoji-cell:hover { background: #f3f4f6; }

/* ===== Enquete ===== */
.poll-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; }
.poll-option-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.poll-option-input { flex: 1; margin: 0 !important; }
.poll-option-remove {
  width: 30px; height: 30px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: #EF4444; cursor: pointer; font-size: 17px; line-height: 1;
}
.poll-option-remove:hover { background: #FEE2E2; border-color: #EF4444; }
.poll-preview { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.poll-chip { font-size: 0.72rem; background: #EEF2FF; color: #3730A3; padding: 2px 8px; border-radius: 10px; }
.tag-poll { background: #EEF2FF; color: #3730A3; }

/* ===== Construtor de blocos ===== */
.blocks-header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 8px; }
.blocks-title { font-size: 0.85rem; font-weight: 600; }
.blocks-hint { font-size: 0.76rem; color: #6b7280; }

.msg-block {
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff;
}
.msg-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.msg-block-label { font-size: 0.78rem; font-weight: 600; color: #374151; }
.msg-block-actions { display: flex; gap: 4px; }
.blk-btn {
  width: 24px; height: 24px; padding: 0; line-height: 1; font-size: 12px;
  border: 1px solid var(--border); border-radius: 5px; background: #fff; cursor: pointer; color: #6b7280;
}
.blk-btn:hover { background: #f3f4f6; }
.blk-del { color: #EF4444; }
.blk-del:hover { background: #FEE2E2; border-color: #EF4444; }

.block-add-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.block-add {
  padding: 6px 12px; font-size: 0.78rem; font-weight: 600;
  border: 1.5px dashed var(--border); border-radius: 18px;
  background: #fff; color: #374151; cursor: pointer; width: auto;
}
.block-add:hover { border-color: var(--primary); color: var(--primary); border-style: solid; background: #fff; }

.block-file { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-pick {
  padding: 7px 14px; font-size: 0.8rem; width: auto;
  border: 1px solid var(--border); border-radius: 6px; background: #f9fafb; color: #374151; cursor: pointer;
}
.file-pick:hover { background: #f3f4f6; }
.file-status { font-size: 0.78rem; color: #6b7280; word-break: break-all; }
.file-status.file-ok { color: #065F46; font-weight: 600; }

.msg-block .poll-opts { margin: 8px 0 6px; }
.msg-block textarea { margin-bottom: 0; }

.blk-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.blk-chip { font-size: 0.7rem; background: #F3F4F6; color: #374151; padding: 2px 8px; border-radius: 10px; }

/* ===== Identificacao de grupos ===== */
.groups-hint { font-size: 0.78rem; color: #6b7280; margin: -6px 0 12px; }
.group-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.group-tools button { width: auto; }
.group-id {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  background: #E5E7EB; color: #374151; padding: 1px 7px; border-radius: 5px;
  margin-right: 6px; font-variant-numeric: tabular-nums;
}
.group-jid { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.76rem; color: #4B5563; }

#verifyResult { margin-top: 10px; }
.vf-block {
  font-size: 0.8rem; padding: 9px 12px; border-radius: 6px;
  background: #F3F4F6; color: #374151; margin-bottom: 6px;
}
.vf-block.vf-ok { background: #D1FAE5; color: #065F46; }
.vf-block.vf-warn { background: #FEF3C7; color: #92400E; }
.vf-block.vf-err { background: #FEE2E2; color: #991B1B; }
.vf-line { margin-top: 3px; font-size: 0.76rem; }

/* ===== Tela de login ===== */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(17, 24, 39, 0.75);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-box {
  background: #fff; border-radius: 12px; padding: 26px 24px;
  width: 100%; max-width: 340px; box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.login-box h3 { margin: 0 0 6px; font-size: 1.05rem; }
.login-box p { margin: 0 0 14px; font-size: 0.82rem; color: #6b7280; }
.login-box input { margin-bottom: 10px; }
.login-box button { width: 100%; }
.login-erro { font-size: 0.8rem; color: #991B1B; min-height: 18px; margin-bottom: 6px; }

/* ===== Bolinhas de status dos chips ===== */
.chip-status-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.chip-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 13px 5px 10px; font-size: 0.82rem; font-weight: 600; color: #374151;
}
.chip-pill small { font-weight: 400; color: #6b7280; font-size: 0.72rem; }
.chip-pill.chip-active { border-color: #10B981; box-shadow: 0 0 0 2px rgba(16,185,129,0.15); }
.chip-pill.chip-down, .chip-pill.chip-banned { border-color: #EF4444; background: #FEF2F2; }
.chip-pill.chip-off { opacity: 0.6; }
.chip-alert {
  font-size: 0.8rem; font-weight: 600; color: #991B1B;
  background: #FEE2E2; padding: 5px 12px; border-radius: 20px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: #10B981; animation: pulseVerde 1.6s ease-in-out infinite; }
.dot-red { background: #EF4444; animation: pulseVermelho 1s ease-in-out infinite; }
.dot-gray { background: #9CA3AF; }

@keyframes pulseVerde {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.6); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
@keyframes pulseVermelho {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  50% { opacity: 0.55; box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
@media (prefers-reduced-motion: reduce) {
  .dot-green, .dot-red { animation: none; }
}

/* ===== Aba chips ===== */
.chips-hint { font-size: 0.82rem; color: #6b7280; margin: -6px 0 14px; }
.qr-box { text-align: center; padding: 16px; border: 1px solid var(--border); border-radius: 8px; margin-top: 12px; }
.qr-box img { max-width: 260px; width: 100%; margin: 10px auto; display: block; }
.qr-box p { font-size: 0.82rem; color: #6b7280; margin: 6px 0; }
.qr-hint { font-size: 0.76rem !important; }
.pairing { font-size: 1.1rem; font-weight: 700; letter-spacing: 2px; background: #F3F4F6; padding: 4px 10px; border-radius: 6px; }

/* ===== Faixa de cobertura do disparo ===== */
.cov-bar { font-size: 0.84rem; padding: 10px 12px; border-radius: 6px; margin-bottom: 10px; }
.cov-bar.cov-ok { background: #D1FAE5; color: #065F46; }
.cov-bar.cov-run { background: #DBEAFE; color: #1E40AF; }
.cov-bar.cov-wait { background: #FEF3C7; color: #92400E; }
.cov-bar.cov-err { background: #FEE2E2; color: #991B1B; }

/* ===== Fila de grupos e link publico ===== */
.folder-link {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 6px;
  padding: 8px 10px; margin: 8px 0;
}
.folder-link-label { font-size: 0.72rem; font-weight: 700; color: #065F46; text-transform: uppercase; letter-spacing: .4px; }
.folder-link code { font-size: 0.82rem; color: #065F46; word-break: break-all; }
.folder-queue-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.group-chip.chip-recebendo { background: #D1FAE5; color: #065F46; font-weight: 600; }
.group-chip.chip-cheio { background: #F3F4F6; color: #6B7280; text-decoration: line-through; }
.chip-act {
  border: none; background: none; cursor: pointer; font-size: 0.85rem;
  color: inherit; opacity: .6; padding: 0 2px;
}
.chip-act:hover { opacity: 1; }

.queue-config {
  margin-top: 10px; padding: 14px; background: #F9FAFB;
  border: 1px solid var(--border); border-radius: 8px;
}
.qc-titulo { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.qc-hint { font-size: 0.78rem; color: #6b7280; margin: 0 0 12px; }
.qc-label { display: block; font-size: 0.78rem; font-weight: 600; margin: 10px 0 4px; }
.queue-config input, .queue-config textarea { margin-bottom: 0; }
.qc-slug { display: flex; align-items: center; gap: 4px; }
.qc-slug span { font-size: 0.82rem; color: #6b7280; white-space: nowrap; }
.qc-slug input { flex: 1; }
.qc-linha { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; margin-top: 6px; }
.qc-linha input[type=number] { width: 120px; }
.qc-checks { display: flex; flex-direction: column; gap: 4px; padding-top: 22px; }

/* ===== Rotina semanal ===== */
.rot-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; margin-bottom: 14px; background: #fff;
}
.rot-card-off { opacity: .6; }
.rot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.rot-nome { font-size: 1rem; font-weight: 700; }
.rot-pasta { font-size: 0.78rem; color: #6b7280; margin-left: 8px; }
.rot-head-acoes { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rot-head-acoes button { width: auto; }

.rot-grade {
  display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 6px; overflow-x: auto; padding-bottom: 4px;
}
.rot-dia {
  background: #F9FAFB; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 6px; min-height: 90px;
  display: flex; flex-direction: column; gap: 5px;
}
.rot-dia-nome {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: #6b7280; text-align: center; margin-bottom: 2px;
}
.rot-vazio { flex: 1; min-height: 10px; }
.rot-item {
  background: #fff; border: 1px solid var(--border);
  border-left: 3px solid var(--primary); border-radius: 6px; padding: 6px 7px;
}
.rot-item.rot-off { opacity: .5; border-left-color: #9CA3AF; }
.rot-hora { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rot-acao { font-size: 0.72rem; font-weight: 600; margin-top: 2px; }
.rot-detalhe { font-size: 0.7rem; color: #6b7280; word-break: break-word; margin: 2px 0; }
.rot-acoes { display: flex; gap: 3px; margin-top: 4px; }
.rot-acoes .blk-btn { width: 20px; height: 20px; font-size: 10px; }
.rot-add {
  border: 1px dashed var(--border); background: none; border-radius: 6px;
  color: #9CA3AF; cursor: pointer; padding: 3px; font-size: 0.9rem; width: 100%;
}
.rot-add:hover { border-color: var(--primary); color: var(--primary); }

.rot-form {
  margin-top: 12px; padding: 14px; background: #F9FAFB;
  border: 1px solid var(--border); border-radius: 8px;
}
.rot-form-linha { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.rot-form-linha input, .rot-form-linha select { margin-bottom: 0; }
.rot-form-linha input[type=text] { width: 100px; }

/* ===== Papel de cada chip na fila ===== */
.chip-papel {
  display: inline-block; font-size: 0.68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; margin-right: 7px;
  text-transform: uppercase; letter-spacing: .3px; vertical-align: middle;
}
.papel-principal { background: #D1FAE5; color: #065F46; }
.papel-reserva { background: #DBEAFE; color: #1E40AF; }
.papel-fora { background: #F3F4F6; color: #6B7280; }
.item-actions .btn-small[disabled] { opacity: .3; cursor: default; }
.rot-foto-linha { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rot-foto-linha input[type=url] { flex: 1; min-width: 220px; margin-bottom: 0; }
