/* Pipeline Kanban — shares theme.css design tokens */

.pipeline-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

/* Page header */
.pipeline-header {
  padding: 2rem 3rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* Board */
.pipeline-board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  overflow-x: auto;
  padding: 0;
}

.board-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 220px;
}

.board-col:last-child { border-right: none; }

.col-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.col-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 0.25rem;
}

.col-count {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.col-cards {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Lead card */
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.lead-card:hover {
  border-color: var(--amber);
  background: var(--surface-2);
}

.lead-business {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.lead-owner {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.lead-niche {
  font-size: 0.7rem;
  color: var(--amber);
  background: rgba(232, 160, 32, 0.1);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.lead-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.lead-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.card-btn {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.25rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
  text-align: center;
}

.card-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  background: rgba(232, 160, 32, 0.05);
}

/* Add button at bottom of each column */
.add-lead-btn {
  margin: 0.6rem 0.75rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.5rem;
  cursor: pointer;
  width: calc(100% - 1.5rem);
  transition: all 0.15s;
  font-family: var(--font-body);
}

.add-lead-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
  border-style: solid;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 440px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-body);
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--amber);
}

.form-select { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-primary {
  flex: 1;
  background: var(--amber);
  color: #0A0A0A;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}

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

.btn-ghost {
  flex: 1;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}

.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-delete {
  background: #8B2020;
  color: var(--text);
  border: none;
}

.btn-delete:hover { background: #A52A2A; }

.modal-error {
  color: #F87171;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: none;
}

.modal-error.visible { display: block; }

/* Stage badge pills on modal */
.status-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.status-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
  transition: all 0.15s;
  font-family: var(--font-body);
}

.status-pill:hover { border-color: var(--amber); color: var(--amber); }
.status-pill.active {
  background: rgba(232, 160, 32, 0.15);
  border-color: var(--amber);
  color: var(--amber);
}

/* Empty column state */
.col-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 2rem 1rem;
  line-height: 1.5;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text);
  z-index: 300;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .pipeline-board {
    grid-template-columns: repeat(5, minmax(180px, 1fr));
  }
}