/* Reset e base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f8f5f2;
  color: #333;
  font-size: 15px;
  line-height: 1.5;
}

/* Header */
.header {
  background: linear-gradient(135deg, #6b2d6b, #8b4a8b);
  color: #fff;
  padding: 20px 32px;
  text-align: center;
}
.logo { font-size: 22px; font-weight: 700; }
.subtitulo { font-size: 14px; opacity: 0.85; margin-top: 4px; }

/* Navegação */
.nav-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #e8e0e8;
  padding: 0 16px;
  overflow-x: auto;
}
.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: #777;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}
.tab:hover { color: #6b2d6b; }
.tab.active { color: #6b2d6b; border-bottom-color: #6b2d6b; font-weight: 600; }

.badge {
  background: #e74c3c;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: top;
}

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Cards */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #6b2d6b;
  margin-bottom: 16px;
}

/* Status */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.verde { background: #27ae60; }
.status-dot.vermelho { background: #e74c3c; }
.status-dot.amarelo { background: #f39c12; }

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.status-badge.novo { background: #eef2ff; color: #4a5ebd; }
.status-badge.contactado { background: #fef3e2; color: #c97a1a; }
.status-badge.respondeu { background: #e8f8ef; color: #1d8348; }

/* Botões */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #6b2d6b; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #8b4a8b; }
.btn-secondary { background: #e8e0e8; color: #6b2d6b; }
.btn-secondary:hover:not(:disabled) { background: #d5c8d5; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #c0392b; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover:not(:disabled) { background: #1e8449; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }

input[type="text"], input[type="number"], input[type="time"],
textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #6b2d6b;
}
textarea { resize: vertical; min-height: 100px; }

/* Tabela */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: #6b2d6b;
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid #eee; }
tr:hover { background: #faf5fa; }

th input[type="checkbox"], td input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Filtros inline */
.filtros {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filtros select, .filtros input { width: auto; min-width: 150px; }

/* QR Code */
.qr-container {
  text-align: center;
  padding: 20px;
}
.qr-container img { max-width: 280px; border-radius: 8px; }

/* Preview mensagem */
.preview-box {
  background: #e5ddd5;
  border-radius: 12px;
  padding: 16px;
  max-width: 380px;
}
.preview-bubble {
  background: #dcf8c6;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Barra de progresso */
.progress-bar {
  width: 100%;
  height: 24px;
  background: #eee;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6b2d6b, #8b4a8b);
  border-radius: 12px;
  transition: width 0.3s;
}
.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

/* Respostas / Inbox */
.conversa-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}
.conversa-item:hover { background: #faf5fa; }
.conversa-item.nao-lida { background: #f5edf5; font-weight: 500; }
.conversa-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6b2d6b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}
.conversa-info { flex: 1; min-width: 0; }
.conversa-nome { font-weight: 600; font-size: 14px; }
.conversa-preview {
  font-size: 13px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversa-hora { font-size: 12px; color: #999; white-space: nowrap; }

/* Log de campanha */
.log-item { padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
.log-item .hora { color: #999; margin-right: 8px; }

/* Checkbox dias */
.dias-semana { display: flex; gap: 6px; flex-wrap: wrap; }
.dia-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 16px; }
  .container { padding: 16px 8px; }
  .card { padding: 16px; }
  .form-row { flex-direction: column; }
  .nav-tabs { padding: 0 8px; }
  .tab { padding: 10px 14px; font-size: 13px; }
}
