/* ==============================
   Ardenvale — Deal Pipeline Page
   ============================== */

/* ── Header ─────────────────── */
.pipe-header {
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 3rem 0;
}
.pipe-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  padding-bottom: 2rem;
}
.pipe-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}

/* ── KPI strip ──────────────── */
.kpi-strip {
  background: var(--accent);
  padding: 1.5rem 3rem;
}
.kpi-strip-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  align-items: center;
}
.kpi-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 2.5rem;
  border-right: 1px solid rgba(245,241,235,0.15);
  flex: 1;
}
.kpi-item:first-child { padding-left: 0; }
.kpi-item:last-child  { border-right: none; }
.kpi-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245,241,235,0.5);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-warm);
  line-height: 1;
}
.kpi-value--dim {
  color: rgba(245,241,235,0.6);
}

/* ── Filters ────────────────── */
.pipe-filters {
  padding: 1.5rem 3rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.pipe-filters-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-right: 0.25rem;
}
.filter-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: 3px;
  cursor: pointer;
  min-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6359'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}
.filter-reset {
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s;
}
.filter-reset:hover {
  border-color: var(--border);
  color: var(--fg);
}
.filter-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ── Table body ─────────────── */
.pipe-body {
  padding: 2rem 3rem 4rem;
}
.pipe-body-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* Segment group */
.seg-group {
  margin-bottom: 2.5rem;
}
.seg-group-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.5rem 0 0.75rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0;
}
.seg-group-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.seg-group-count {
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

/* Pipeline table */
.pipe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}
.pipe-table th {
  text-align: left;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  white-space: nowrap;
}
.pipe-table th:first-child { padding-left: 1.25rem; border-radius: 0; }
.pipe-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.pipe-table td:first-child { padding-left: 1.25rem; }
.pipe-table tbody tr:hover { background: var(--bg-alt); }
.pipe-table tbody tr:last-child td { border-bottom: none; }

/* Col widths */
.col-name  { min-width: 200px; max-width: 260px; }
.col-type  { width: 100px; }
.col-status{ width: 130px; }
.col-touch { width: 110px; white-space: nowrap; }
.col-next  { min-width: 200px; }
.col-owner { width: 90px; }
.col-notes { width: 36px; text-align: center; }
.col-edit  { width: 36px; text-align: center; }

.contact-name {
  font-weight: 500;
  color: var(--fg);
  line-height: 1.35;
}

/* Type badge */
.type-badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--bg-alt);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.type-badge--operator { background: rgba(26,58,42,0.07); color: var(--accent); border-color: rgba(26,58,42,0.2); }
.type-badge--GP       { background: rgba(201,168,76,0.1); color: #7a6020; border-color: rgba(201,168,76,0.3); }

/* Status badge (inline select styling) */
.status-select {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.25rem 1.5rem 0.25rem 0.6rem;
  border-radius: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%236b6359'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  transition: background-color 0.15s;
}
.status-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.status-Cold         { background-color: rgba(107,99,89,0.1);  color: var(--fg-muted); }
.status-Reached-out  { background-color: rgba(201,168,76,0.12); color: #7a6020; }
.status-In-dialogue  { background-color: rgba(26,58,42,0.1);   color: var(--accent); }
.status-Diligence    { background-color: rgba(74,124,89,0.15); color: #2e5e3a; }
.status-Active       { background-color: rgba(26,58,42,0.18);  color: var(--accent); font-weight: 600; }
.status-Passed       { background-color: rgba(180,60,60,0.08); color: #8a3030; }
.status-Dormant      { background-color: rgba(107,99,89,0.07); color: #9a9080; }

/* Next action cell */
.next-action-text {
  color: var(--fg-muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

/* Inline editable fields */
.inline-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  font-family: var(--font-body);
  font-size: 0.83rem;
  color: var(--fg-muted);
  padding: 0.1rem 0;
  cursor: text;
  transition: border-color 0.15s;
  resize: none;
  line-height: 1.45;
}
.inline-input:hover  { border-bottom-color: var(--border); }
.inline-input:focus  { outline: none; border-bottom-color: var(--accent); color: var(--fg); }

.inline-date {
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-bottom: 1px dashed transparent;
  font-family: var(--font-body);
  padding: 0.1rem 0;
  cursor: pointer;
  transition: border-color 0.15s;
}
.inline-date:hover  { border-bottom-color: var(--border); }
.inline-date:focus  { outline: none; border-bottom-color: var(--accent); }

/* Notes toggle */
.btn-notes {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background 0.15s, color 0.15s;
}
.btn-notes:hover { background: var(--bg-alt); color: var(--fg); }
.btn-notes--active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Save indicator */
.save-indicator {
  font-size: 0.7rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}
.save-indicator--visible { opacity: 1; }

/* Notes expanded row */
.notes-row td {
  padding: 0.5rem 1.25rem 1.25rem;
  background: rgba(245,241,235,0.5);
}
.notes-expanded {
  font-size: 0.83rem;
  color: var(--fg-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  border-left: 3px solid var(--border);
  padding-left: 1rem;
}
.notes-textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.83rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 72px;
}
.notes-textarea:focus { outline: none; border-color: var(--accent); }

/* Empty state */
.pipe-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--fg-muted);
}
.pipe-empty-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--accent); margin-bottom: 0.5rem; }

/* Nav link active state */
.nav-link {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: var(--fg); }
.nav-link--active { color: var(--accent); border-bottom-color: var(--accent); }

/* Responsive */
@media (max-width: 900px) {
  .pipe-header { padding: 2rem 1.5rem 0; }
  .kpi-strip   { padding: 1.25rem 1.5rem; }
  .kpi-strip-inner { flex-wrap: wrap; gap: 1rem; }
  .kpi-item    { border-right: none; padding: 0; flex: 0 0 auto; }
  .pipe-filters { padding: 1rem 1.5rem; }
  .pipe-body   { padding: 1.5rem 1.5rem 3rem; }
  .col-next, .col-notes { display: none; }
}
