/* ── Pipeline Section ── */
#pipeline-section {
  display: none;
  margin-bottom: 16px;
}

/* Stats bar */
.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.pipeline-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pipeline-header h2::before {
  content: "";
  display: block;
  width: 3px;
  height: 18px;
  background: var(--brand);
  border-radius: 2px;
}

#pipeline-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.stat-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}
.stat-value.accent { color: var(--brand); }
.stat-value.green { color: var(--green); }
.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Kanban board */
#kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  min-height: 200px;
}
.kanban-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 420px;
}
.kanban-column.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.column-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.column-count {
  font-size: 10px;
  background: var(--surface-2);
  color: var(--text-dim);
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.column-rev {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
  font-weight: 600;
}
.column-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.empty-col {
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  padding: 20px 8px;
  font-style: italic;
}

/* Deal cards */
.deal-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.deal-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.deal-card.dragging {
  opacity: 0.5;
  border-color: var(--accent);
}
.deal-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.deal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.deal-contact {
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-revenue {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  flex-shrink: 0;
}
.deal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.deal-prob {
  font-size: 10px;
  color: var(--green);
  font-weight: 600;
}
.deal-deadline {
  font-size: 10px;
  color: var(--text-dim);
}

/* Add deal button */
.btn-add-deal {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-add-deal:hover { opacity: 0.9; }

/* Pipeline toggle */
.btn-toggle-pipeline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}
.btn-toggle-pipeline:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* Deal detail modal */
.deal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: auth-fade-in 0.2s ease;
}
.deal-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 420px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.deal-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.deal-modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.deal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.deal-close:hover { color: var(--text); }
.deal-modal-body {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.deal-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.field-label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.deal-stage-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--sc) 20%, transparent);
  color: var(--sc);
}
.deal-modal-actions {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
}

/* Responsive pipeline */
@media (max-width: 768px) {
  #pipeline-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  #kanban-board {
    grid-template-columns: 1fr;
  }
  .kanban-column {
    max-height: 300px;
  }
}
