/* ============================================
   CRM — style.css
   V2 Mídia Hub — Módulo CRM
============================================ */

:root {
  --bg:            #0e0f14;
  --surface:       #14161e;
  --card:          #1a1d28;
  --card-hover:    #1f2333;
  --border:        rgba(255,255,255,0.07);
  --border-md:     rgba(255,255,255,0.11);
  --text:          #f0f1f6;
  --text-dim:      #8b8fa8;
  --muted:         #555870;
  --accent:        #f97316;
  --accent-light:  #fb923c;
  --accent-dim:    rgba(249,115,22,0.14);
  --green:         #22c55e;
  --green-dim:     rgba(34,197,94,0.12);
  --blue:          #38bdf8;
  --blue-dim:      rgba(56,189,248,0.12);
  --yellow:        #facc15;
  --yellow-dim:    rgba(250,204,21,0.12);
  --red:           #f87171;
  --red-dim:       rgba(248,113,113,0.12);
  --purple:        #a78bfa;
  --radius:        12px;
  --radius-sm:     8px;
  --font:          'IBM Plex Sans', sans-serif;
  --mono:          'IBM Plex Mono', monospace;
}

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;
}

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2d3e; border-radius: 99px; }

/* ── HEADER ─────────────────────────────────── */
.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.crm-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crm-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crm-icon svg { width: 20px; height: 20px; }

.crm-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.crm-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.crm-stats-mini {
  display: flex;
  gap: 24px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mini-stat span {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--mono);
  line-height: 1;
}

.mini-stat small {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mini-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border-md);
  align-self: center;
  margin: 0 4px;
}

/* Pipeline em destaque */
.mini-stat:last-child span {
  color: var(--green);
  font-size: 18px;
}

/* ── TOOLBAR ─────────────────────────────────── */
.crm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 12px;
  flex-shrink: 0;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-toggle {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.view-btn svg { width: 14px; height: 14px; }

.view-btn.active {
  background: var(--accent-dim);
  color: var(--accent-light);
}

.search-crm {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 7px 14px;
  transition: border-color .15s;
}

.search-crm:focus-within { border-color: var(--accent); }

.search-crm svg { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }

.search-crm input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  width: 180px;
  caret-color: var(--accent);
}

.search-crm input::placeholder { color: var(--muted); }

.filter-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}

.filter-select:focus { border-color: var(--accent); color: var(--text); }

.btn-add-lead {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.btn-add-lead:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-add-lead svg { width: 14px; height: 14px; }

.btn-config {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s, transform .3s;
}

.btn-config svg { width: 15px; height: 15px; }
.btn-config:hover { background: var(--card); color: var(--text); border-color: var(--border-md); }
.btn-config:hover svg { transform: rotate(45deg); transition: transform .3s; }

/* ── MODAL CONFIGURAÇÕES ─────────────────────── */
.config-section {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.config-section-title svg { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }

.config-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.config-desc strong { color: var(--red); }

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.config-label {
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}

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

.config-input {
  width: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color .15s;
  caret-color: var(--accent);
}

.config-input:focus { border-color: var(--accent); }

.config-input-unit {
  font-size: 12px;
  color: var(--muted);
}

/* Toggle switch */
.config-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.config-toggle input { display: none; }

.toggle-track {
  width: 38px;
  height: 22px;
  background: var(--border-md);
  border-radius: 99px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.config-toggle input:checked + .toggle-track { background: var(--accent); }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}

.config-toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(16px); }

.toggle-label {
  font-size: 13px;
  color: var(--text-dim);
  min-width: 60px;
}

/* Info dinâmica */
.config-info {
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  min-height: 38px;
}

.config-info--ok   { background: var(--green-dim);  color: var(--green); border: 1px solid rgba(34,197,94,.2); }
.config-info--warn { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(250,204,21,.2); }

/* ── KANBAN ──────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  align-items: flex-start;
}

.kanban-col {
  flex: 0 0 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.col-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.col-count {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  min-width: 24px;
  text-align: center;
}

.col-cards {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── KANBAN CARD ─────────────────────────────── */
.k-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px 12px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow: hidden;
  transition: border-color .18s, transform .18s, background .18s;
  animation: fadeUp .22s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.k-card:hover {
  border-color: var(--border-md);
  background: var(--card-hover);
  transform: translateY(-1px);
}

/* Linha 1: controles (drag + lixeira) */
.k-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 16px;
  flex-shrink: 0;
}

/* Handle de arrasto */
.k-drag-handle {
  font-size: 13px;
  color: var(--muted);
  cursor: grab;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s;
  user-select: none;
  letter-spacing: 1px;
}

.k-card:hover .k-drag-handle { opacity: 1; }
.k-card:active .k-drag-handle { cursor: grabbing; }

/* ── BOTÃO APAGAR NO CARD ────────────────────── */
.k-delete-btn {
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color .14s;
  flex-shrink: 0;
  padding: 0;
}

.k-delete-btn svg { width: 13px; height: 13px; }
.k-delete-btn:hover { color: var(--red); }
.k-card:hover .k-delete-btn { display: flex; }

/* Linha 2: nome + segmento + score */
.k-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.k-card-info {
  flex: 1;
  min-width: 0;
}

.k-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.k-card-segment {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score */
.k-score {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
  line-height: 1.6;
}

.k-score.high  { background: var(--green-dim);  color: var(--green);  }
.k-score.med   { background: var(--yellow-dim); color: var(--yellow); }
.k-score.low   { background: var(--red-dim);    color: var(--red);    }
.k-score.empty { background: transparent; color: var(--muted); border: 1px solid var(--border); }

/* Linha 3: badges */
.k-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.k-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.k-badge.wa     { background: var(--green-dim); color: var(--green); border-color: transparent; }
.k-badge--empty { color: var(--muted); border-color: transparent; background: transparent; opacity: .4; }

/* Linha 4: follow-up */
.k-followup {
  font-size: 10px;
  color: var(--yellow);
  display: flex;
  align-items: center;
  gap: 4px;
}

.k-followup--empty { color: var(--muted); opacity: .35; }

/* Valor do negócio no card */
.k-valor {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: background .12s;
  padding: 1px 3px;
  margin: 0 -3px;
}

.k-valor:hover { background: rgba(34,197,94,.08); }
.k-valor--empty { color: var(--muted); font-weight: 400; }
.k-valor--empty:hover { background: rgba(255,255,255,.04); }

.k-valor-display { display: flex; align-items: center; gap: 4px; }

.k-valor-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
}

.k-valor-prefix {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

.k-valor-input {
  background: none;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  width: 80px;
  caret-color: var(--accent);
}

.k-valor-input::placeholder { color: var(--muted); font-weight: 400; }

/* Soma de valor na coluna */
.col-valor {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--green);
  padding: 4px 14px 6px;
  border-bottom: 1px solid var(--border);
  display: none;
}

/* Campo valor no modal */
.info-item--valor { align-items: center; }

.valor-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  transition: border-color .15s;
}

.valor-input-wrap:focus-within { border-color: var(--accent); }

.valor-prefix {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  font-family: var(--mono);
}

.valor-input {
  background: none;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  width: 110px;
  text-align: right;
  caret-color: var(--accent);
}

.valor-input::placeholder { color: var(--muted); font-weight: 400; }

/* Card sendo arrastado — fica translúcido no lugar original */
.k-card.drag-ghost {
  opacity: 0.35;
  border-style: dashed;
}

/* Coluna receptora em destaque */
.col-cards.drag-over {
  background: rgba(249, 115, 22, 0.06);
  border-radius: var(--radius-sm);
  outline: 2px dashed rgba(249, 115, 22, 0.35);
  outline-offset: -4px;
}

/* Placeholder de coluna vazia fica mais visível durante drag */
.col-cards.drag-over .col-empty {
  color: var(--accent);
}

.col-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--muted);
  font-size: 12px;
  transition: color .15s;
}

/* ── LISTA VIEW ──────────────────────────────── */
.lista-view {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
}

.crm-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.crm-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.crm-table tr:hover td { background: var(--card); cursor: pointer; }

.crm-table .td-name {
  font-weight: 600;
  color: var(--text);
}

.estagio-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}

.ep-novo       { background: var(--blue-dim);   color: var(--blue);   }
.ep-contato    { background: var(--yellow-dim);  color: var(--yellow); }
.ep-negociacao { background: var(--accent-dim);  color: var(--accent); }
.ep-fechado    { background: var(--green-dim);   color: var(--green);  }
.ep-perdido    { background: var(--red-dim);     color: var(--red);    }

.action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: all .14s;
}

.action-btn:hover { background: var(--card-hover); color: var(--text); border-color: var(--border-md); }

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 14px;
}

.empty-icon { font-size: 52px; line-height: 1; }

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 360px;
  line-height: 1.7;
}

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeOverlay .18s ease;
}

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

.modal {
  background: var(--card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideModal .2s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.modal--sm { max-width: 480px; }

@keyframes slideModal {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-lead-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.modal-lead-segment {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: block;
}

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

.score-badge {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(249,115,22,.2);
  border-radius: 99px;
  padding: 4px 14px;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .14s;
  flex-shrink: 0;
}

.modal-close svg { width: 14px; height: 14px; }
.modal-close:hover { background: var(--red-dim); color: var(--red); border-color: transparent; }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  flex: 1;
}

.modal-body--single {
  display: block;
  overflow-y: auto;
  padding: 0;
}

.modal-col {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-col:first-child {
  border-right: 1px solid var(--border);
}

.modal-section { display: flex; flex-direction: column; gap: 8px; }

.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

.info-grid { display: flex; flex-direction: column; gap: 8px; }

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}

.info-key { color: var(--muted); flex-shrink: 0; }
.info-val { color: var(--text); text-align: right; word-break: break-all; }
.info-val a { color: var(--accent-light); text-decoration: none; }
.info-val a:hover { text-decoration: underline; }

.estagio-select,
.tipo-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}

.estagio-select:focus,
.tipo-select:focus { border-color: var(--accent); }

.datetime-input,
.notes-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  caret-color: var(--accent);
}

.datetime-input:focus,
.notes-input:focus { border-color: var(--accent); }
.notes-input::placeholder { color: var(--muted); }

.textarea-notes {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  transition: border-color .15s;
  caret-color: var(--accent);
}

.textarea-notes:focus { border-color: var(--accent); }
.textarea-notes::placeholder { color: var(--muted); }

.btn-save-lead {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}

.btn-save-lead:hover { background: var(--accent-light); transform: translateY(-1px); }

/* ── BOTÃO APAGAR NO MODAL ───────────────────── */
.btn-delete-lead {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid rgba(248,113,113,.25);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .14s, border-color .14s;
}

.btn-delete-lead svg { width: 14px; height: 14px; }
.btn-delete-lead:hover { background: var(--red-dim); border-color: rgba(248,113,113,.4); }

/* ── MODAL DE CONFIRMAÇÃO DE DELETE ──────────── */
.modal-overlay--danger {
  z-index: 400; /* acima do modal de lead (300) */
}

.modal--confirm {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: var(--radius);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  animation: fadeUp .2s ease;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red-dim);
  border: 1px solid rgba(248,113,113,.25);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-icon svg { width: 22px; height: 22px; }

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.confirm-desc {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 340px;
}

.confirm-desc strong { color: var(--text); }

.confirm-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

.btn-confirm-cancel,
.btn-confirm-delete {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s, transform .1s;
  border: 1px solid transparent;
}

.btn-confirm-cancel {
  background: none;
  border-color: var(--border-md);
  color: var(--text-dim);
}

.btn-confirm-cancel:hover { background: rgba(255,255,255,.05); color: var(--text); }

.btn-confirm-delete {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.btn-confirm-delete:hover { background: #ef4444; transform: translateY(-1px); }

/* Histórico */
.historico-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.historico-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  animation: fadeUp .18s ease;
}

.hist-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hist-tipo {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
}

.hist-data {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

.hist-desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.hist-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}

.btn-add-contato {
  width: 100%;
  padding: 9px;
  background: none;
  border: 1px dashed var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s;
}

.btn-add-contato:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* Tarefas */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  animation: fadeUp .18s ease;
}

.task-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.task-texto {
  flex: 1;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.task-texto.done {
  text-decoration: line-through;
  color: var(--muted);
}

.task-data {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  flex-shrink: 0;
}

.task-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color .14s;
}

.task-del:hover { color: var(--red); }

.task-add-row {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.task-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
  caret-color: var(--accent);
}

.task-input:focus { border-color: var(--accent); }
.task-input::placeholder { color: var(--muted); }

.task-date {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  width: 130px;
  transition: border-color .15s;
}

.task-date:focus { border-color: var(--accent); }

.btn-add-task {
  width: 34px;
  height: 34px;
  background: var(--accent-dim);
  border: 1px solid rgba(249,115,22,.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .14s;
  flex-shrink: 0;
}

.btn-add-task:hover { background: var(--accent); color: #fff; }

/* ── TOAST ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border-md);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 500;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green);  color: var(--green); }
.toast.error   { border-color: var(--red);    color: var(--red); }

/* ── LAYOUT BODY ─────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.kanban-board, .lista-view {
  flex: 1;
  min-height: 0;
}