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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3250;
  --text: #e8eaf0;
  --muted: #7b82a0;
  --primary: #4f6ef7;
  --primary-hover: #3a58e8;
  --danger: #e05252;
  --danger-hover: #c94040;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);

  --c1: #4f6ef7; /* Novo Lead */
  --c2: #f7a84f; /* Contato    */
  --c3: #a84ff7; /* Qualificado*/
  --c4: #4fc8f7; /* Proposta   */
  --c5: #4ff78e; /* Fechado    */
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 1.35rem; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.subtitle { color: var(--muted); font-size: .85rem; }

.header-right { display: flex; gap: 12px; align-items: center; }

#search {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 14px;
  font-size: .875rem;
  width: 220px;
  outline: none;
  transition: border-color .2s;
}
#search:focus { border-color: var(--primary); }
#search::placeholder { color: var(--muted); }

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, transform .1s;
}
.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:hover  { background: var(--primary-hover); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:hover   { background: var(--danger-hover); }
button:active { transform: scale(.97); }

/* ── Board ── */
#board {
  display: flex;
  gap: 16px;
  padding: 24px 28px;
  overflow-x: auto;
  flex: 1;
  align-items: flex-start;
}

/* ── Column ── */
.column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 270px;
  width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .9rem;
}

.col-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.col-count {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── Cards list ── */
.cards-list {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

.cards-list.drag-over {
  background: rgba(79,110,247,.07);
  border-radius: 6px;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 24px 0;
  pointer-events: none;
}

/* ── Card ── */
.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: grab;
  transition: box-shadow .18s, transform .15s;
  position: relative;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card.dragging { opacity: .45; cursor: grabbing; }

.card-name {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
}

.card-info span {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .icon { margin-right: 5px; }

.card-notes {
  font-size: .77rem;
  color: var(--muted);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 4px 10px;
  font-size: .75rem;
  cursor: pointer;
  transition: all .15s;
}
.card-btn:hover { border-color: var(--primary); color: var(--primary); }
.card-btn.del:hover { border-color: var(--danger); color: var(--danger); }

/* ── Modal ── */
#modal-overlay, #confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.hidden { display: none !important; }

#modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 32px;
  width: 440px;
  max-width: 95vw;
  box-shadow: var(--shadow);
}

#modal h2 {
  font-size: 1.15rem;
  margin-bottom: 22px;
  color: var(--text);
}

#lead-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 14px;
}

#lead-form input,
#lead-form select,
#lead-form textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  resize: vertical;
}
#lead-form input:focus,
#lead-form select:focus,
#lead-form textarea:focus { border-color: var(--primary); }

#lead-form select option { background: var(--surface); }
.req { color: var(--danger); }

.form-error {
  background: rgba(224,82,82,.12);
  border: 1px solid var(--danger);
  border-radius: 7px;
  color: var(--danger);
  font-size: .8rem;
  padding: 8px 12px;
  margin-bottom: 12px;
}

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

/* ── Confirm box ── */
#confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
  text-align: center;
  box-shadow: var(--shadow);
}
#confirm-box p { margin-bottom: 20px; color: var(--muted); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
