/* RESET BÁSICO E VARIÁVEIS DE COR MODERNAS */
:root {
  --bg-main: #f0f4f9;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --success: #10b981;
  --success-light: #ecfdf5;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);

  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* BARRA SUPERIOR ELEGANTE */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 360px;
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  color: var(--text-main);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}

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

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.avatar:hover {
  transform: scale(1.05);
}

/* ÁREA PRINCIPAL */
.main-container {
  padding: 24px 32px;
}

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

.board-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.board-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.board-metrics {
  display: flex;
  gap: 16px;
}

.metric {
  background: white;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.metric .label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.metric .value {
  font-size: 1.2rem;
  font-weight: 700;
}

.metric .value.positive {
  color: var(--success);
}

.metric .value.negative {
  color: var(--danger);
}

/* QUADRO KANBAN REFINADO */
.kanban-board {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.column {
  background-color: #f8fafc;
  min-width: 290px;
  width: 290px;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 190px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.column-negative {
  background-color: #fff5f5;
  border: 1px dashed #fca5a5;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

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

.column-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
}

.badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: white;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.badge.blue { background: var(--primary); }
.badge.red { background: var(--danger); }
.badge.green { background: var(--success); }
.badge.purple { background: #8b5cf6; }
.badge.orange { background: #f97316; }
.badge.emerald { background: #059669; }

.count {
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
}

/* CARDS DE CLIENTES */
.cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 200px;
  height: 100%;
  padding-right: 2px;
}

.card {
  background: var(--bg-card);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.card-disabled {
  opacity: 0.75;
  background: #fafafa;
}

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

.tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.tag-red {
  background: var(--danger-light);
  color: var(--danger);
}

.time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.card h3 {
  font-size: 0.92rem;
  font-weight: 600;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-info {
  font-size: 0.8rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

/* EFEITOS DE ARRASTAR (DRAG & DROP) */
.card.dragging {
  opacity: 0.4;
  border: 2px dashed #2563eb;
}

.cards-container.drag-over {
  background-color: #e2e8f0;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

/* MODAIS */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

.modal-header h2 { font-size: 1.1rem; }

.close-btn {
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.form-group input, .form-group select {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  font-size: 0.9rem;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-cancel {
  background: #f1f5f9;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-main);
}

.btn-cancel:hover {
  background: #e2e8f0;
}

/* BOTÕES DINÂMICOS DO CARTÃO */
.card-dynamic-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.card-dynamic-actions .btn-action {
  flex: none;
}

.btn-action {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-action:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}