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

:root {
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --border: #e2e4e9;
  --text: #1f2330;
  --text-muted: #6b7280;
  --danger: #dc2626;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }
.degree { color: var(--purple); }

/* ===== LOGIN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2330 0%, #3a2466 100%);
}
.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}
.login-logo { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--purple); }
.login-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }

/* ===== BOTÕES ===== */
.btn-primary, .btn-ghost, .btn-danger {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-primary { background: var(--purple); color: white; width: 100%; }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f0f0f2; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid #fecaca; }
.btn-danger:hover { background: #fef2f2; }

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}
.topbar-logo { font-size: 20px; font-weight: 800; }
.topbar-funil select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
}
.topbar-actions { margin-left: auto; display: flex; gap: 10px; }

/* ===== KANBAN ===== */
.kanban-board {
  display: flex;
  gap: 14px;
  padding: 20px 24px;
  overflow-x: auto;
  height: calc(100vh - 65px);
  align-items: flex-start;
}
.kanban-col {
  border-radius: 14px;
  width: 270px;
  min-width: 270px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  padding: 4px;
}
.kanban-col-header {
  padding: 10px 12px 12px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-col-name { flex: 1; color: #2c2f3a; }
.kanban-col-count {
  font-size: 11px;
  background: rgba(255,255,255,0.7);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 700;
  color: #4b4f5c;
}
.kanban-col-cards {
  padding: 4px 6px 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.kanban-col-cards.drag-over { background: rgba(255,255,255,0.5); border-radius: 10px; }

.card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(20,20,43,0.10);
  cursor: grab;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card:hover { box-shadow: 0 3px 10px rgba(20,20,43,0.14); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.4; }

.card-row { display: flex; align-items: center; gap: 8px; }
.card-avatar {
  width: 26px; height: 26px; min-width: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px; font-weight: 700;
}
.card-title { font-weight: 700; font-size: 13.5px; color: #1f2330; line-height: 1.25; }
.card-sub { font-size: 11.5px; color: var(--text-muted); }
.card-valor { font-size: 13px; font-weight: 700; color: #1f2330; background: #eef6ed; color: #1d7a3c; padding: 2px 8px; border-radius: 6px; display: inline-block; }
.card-meta-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.card-data { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.card-resp { font-size: 11px; color: #b0883a; background: #fdf3e2; padding: 2px 8px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
.card-badges { display: flex; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.badge { font-size: 10.5px; padding: 2px 7px; border-radius: 10px; font-weight: 700; }
.badge-positivo { background: #dcfce7; color: #166534; }
.badge-neutro { background: #f1f5f9; color: #475569; }
.badge-negativo { background: #fee2e2; color: #991b1b; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 28px;
  width: 640px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted);
}
.modal h2 { margin-bottom: 18px; font-size: 19px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.modal-col label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 12px 0 4px; }
.modal-col label:first-child { margin-top: 0; }
.modal-col input, .modal-col select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px;
}
.ia-info { background: #f8f5ff; border: 1px solid #e9d8fd; border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.ia-info h3 { font-size: 13px; margin-bottom: 8px; color: var(--purple-dark); }
.ia-info p { font-size: 13px; margin-bottom: 4px; }
.ia-resumo { color: var(--text-muted); white-space: pre-wrap; }
.modal-meta { font-size: 12px; color: var(--text-muted); }
.modal-footer { display: flex; justify-content: space-between; margin-top: 22px; }
.modal-footer-right { display: flex; gap: 10px; }
