/* Pipeline Dashboard — InciTent Sales CRM */

.pipeline {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

.pipeline__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.pipeline__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

/* Stats bar */
.pipeline__stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  text-align: center;
}

.stat-card__value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card__label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

/* Segment-colored stat cards */
.stat-card--pending .stat-card__value { color: #7c6a3e; }
.stat-card--contacted .stat-card__value { color: #5a7c3e; }
.stat-card--replied .stat-card__value { color: #3e6a7c; }
.stat-card--meeting .stat-card__value { color: var(--primary); }

/* Filter bar */
.pipeline__filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.filter-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: white;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

/* Table */
.pipeline__table-wrap {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leads-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.leads-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(26,58,42,0.07);
  color: var(--fg);
  vertical-align: middle;
}

.leads-table tr:last-child td { border-bottom: none; }
.leads-table tr:hover td { background: var(--bg); }

.leads-table__notes {
  color: var(--fg-muted);
  font-size: 0.825rem;
  max-width: 200px;
}

.leads-table__empty td {
  text-align: center;
  color: var(--fg-muted);
  padding: 2.5rem;
}

.leads-table__actions {
  display: flex;
  gap: 0.25rem;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge--pending  { background: #f5ecd8; color: #7c6a3e; border: 1px solid #d4a847; }
.badge--contacted{ background: #e8f0e5; color: #4a6a30; border: 1px solid #7a9a5a; }
.badge--replied  { background: #e5f0f5; color: #3a6a7a; border: 1px solid #5a8a9a; }
.badge--meeting  { background: #1a3a2a; color: white; border: none; }

/* Action buttons */
.action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--fg-muted);
  transition: all 0.15s;
  line-height: 1;
}
.action-btn:hover { background: var(--bg-alt); color: var(--fg); }
.action-btn--danger:hover { background: #fde8e8; color: #c0392b; border-color: #e74c3c; }

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal[aria-hidden="false"] { display: flex; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,58,42,0.45);
}

.modal__panel {
  position: relative;
  background: white;
  border-radius: 6px;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(26,58,42,0.2);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--fg-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.modal__close:hover { color: var(--fg); }

.modal__form { display: flex; flex-direction: column; gap: 1rem; }
.modal__actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, select, textarea {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--fg);
  background: white;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 80px; }

/* Responsive */
@media (max-width: 768px) {
  .pipeline { padding: 1.25rem; }
  .pipeline__stats { grid-template-columns: repeat(3, 1fr); }
  .pipeline__header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .leads-table { font-size: 0.8rem; }
  .leads-table th, .leads-table td { padding: 0.6rem 0.75rem; }
  .form-row { grid-template-columns: 1fr; }
  .nav__actions { display: none; }
}