/* === PIPELINE DASHBOARD === */
.pipeline-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.pipeline-header {
  background: var(--navy);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.pipeline-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}

.pipeline-logo span {
  color: var(--gold);
}

.pipeline-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pipeline-nav a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}

.pipeline-nav a:hover,
.pipeline-nav a.active {
  color: var(--gold);
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 10px 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
}

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

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

.stage-column {
  background: var(--cream-dark);
  border-right: 1px solid rgba(26, 39, 68, 0.08);
  display: flex;
  flex-direction: column;
  min-width: 220px;
}

.stage-column:last-child {
  border-right: none;
}

.stage-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(26, 39, 68, 0.08);
  position: sticky;
  top: 0;
  background: var(--cream-dark);
  z-index: 1;
}

.stage-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.stage-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.stage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.stage-dot-new_lead { background: #6b7280; }
.stage-dot-call_booked { background: #3b82f6; }
.stage-dot-under_review { background: #f59e0b; }
.stage-dot-signed { background: #8b5cf6; }
.stage-dot-active_investment { background: var(--gold); }

.stage-cards {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Client Card */
.client-card {
  background: var(--white);
  border: 1px solid rgba(26, 39, 68, 0.08);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.client-card:hover {
  border-color: rgba(201, 168, 76, 0.4);
  box-shadow: 0 2px 12px rgba(26, 39, 68, 0.08);
}

.client-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.2;
}

.client-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.client-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.client-meta-icon {
  width: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.client-budget {
  font-weight: 500;
  color: var(--navy);
  font-size: 13px;
}

.client-city {
  color: var(--text-muted);
}

.client-notes-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 8px;
  font-style: italic;
}

.client-last-contact {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 10px;
  border-top: 1px solid rgba(26, 39, 68, 0.06);
  padding-top: 8px;
}

.client-card-actions {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
}

.client-card:hover .client-card-actions {
  display: flex;
  gap: 4px;
}

.card-action-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(26, 39, 68, 0.12);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  transition: border-color 0.2s, color 0.2s;
}

.card-action-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Empty state */
.empty-stage {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

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

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

.modal {
  background: var(--white);
  border: 1px solid rgba(201, 168, 76, 0.3);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  background: var(--navy);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  color: var(--gold-light);
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1px solid rgba(26, 39, 68, 0.15);
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--cream);
  border-radius: 2px;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(26, 39, 68, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-secondary {
  background: none;
  border: 1px solid rgba(26, 39, 68, 0.15);
  color: var(--text-muted);
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

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

.btn-submit {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 10px 28px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: var(--gold-light);
}

.btn-delete {
  background: none;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
  padding: 9px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
}

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

/* Total footer */
.pipeline-footer-bar {
  background: var(--navy);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(201, 168, 76, 0.15);
}

.pipeline-stats {
  display: flex;
  gap: 32px;
}

.pipeline-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-stat-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.pipeline-stat-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}

.pipeline-stat-value.gold {
  color: var(--gold);
}

/* Loading state */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1100px) {
  .pipeline-board {
    grid-template-columns: repeat(5, 200px);
  }
}

@media (max-width: 700px) {
  .pipeline-header {
    padding: 16px 20px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .pipeline-board {
    grid-template-columns: repeat(5, 180px);
  }

  .pipeline-footer-bar {
    padding: 12px 20px;
    flex-direction: column;
    gap: 12px;
  }
}