/* pipeline.css — /pipeline outreach tracker
   Matches theme.css design tokens (--bg, --navy, --cream, --accent, --border,
   --text-secondary, --section-spacing). No new design tokens. */

.pipeline-page { padding-top: 60px; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.pipeline-hero {
  padding: 100px 40px 80px;
  background: var(--navy);
  color: var(--cream);
}
.pipeline-hero-inner {
  max-width: 820px;
  margin: 0 auto;
}
.pipeline-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--cream);
  margin: 16px 0 28px;
  letter-spacing: -0.01em;
}
.pipeline-sub {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(247, 244, 239, 0.7);
  max-width: 680px;
}

/* ── Table section ─────────────────────────────────────────────────── */
.pipeline-table-section {
  padding: 64px 40px 96px;
  background: var(--bg);
}
.pipeline-table-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* Toolbar */
.pipeline-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pipeline-toolbar input[type="search"] {
  flex: 1 1 280px;
  min-width: 220px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pipeline-toolbar input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 150, 90, 0.15);
}
.pipeline-toolbar select {
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--fg);
  cursor: pointer;
  outline: none;
}
.pipeline-toolbar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 150, 90, 0.15);
}

/* ── Table ──────────────────────────────────────────────────────────── */
.pipeline-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cream);
  border: 1px solid var(--border);
  table-layout: fixed;
}
.pipeline-table thead th {
  text-align: left;
  padding: 14px 16px;
  background: #f0ece4;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}
.pipeline-table thead th:hover { color: var(--accent-dark); }
.pipeline-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.pipeline-table tbody tr:nth-child(even) {
  background: rgba(26, 18, 9, 0.04);
}
.pipeline-table tbody td {
  padding: 12px 16px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--fg);
  vertical-align: middle;
  word-break: break-word;
}

/* Column widths — 9 columns now: company, sector, contact, status, touch,
   next-send, last-touch, notes (last two date columns collapsed to single date
   rule via nth-child since they don't carry their own class names). */
.pipeline-table th:nth-child(1), .pipeline-table td.cell-company { width: 14%; font-weight: 500; }
.pipeline-table th:nth-child(2), .pipeline-table td.cell-sector { width: 14%; }
.pipeline-table th:nth-child(3), .pipeline-table td.cell-contact { width: 16%; color: var(--text-secondary); }
.pipeline-table th:nth-child(4), .pipeline-table td.cell-status { width: 11%; }
.pipeline-table th:nth-child(5), .pipeline-table td.cell-cadence-next,
.pipeline-table th:nth-child(6), .pipeline-table td.cell-cadence-next,
.pipeline-table th:nth-child(7), .pipeline-table td.cell-date { width: 9%; color: var(--text-secondary); font-family: 'DM Mono', monospace; font-size: 0.78rem; }
.pipeline-table th:nth-child(8), .pipeline-table td.cell-notes { width: 14%; }

/* Status cell with left border per enum */
.cell-status {
  border-left: 3px solid var(--border);
  padding-left: 13px;
}
tr[data-status="cold"]     td.cell-status { border-left-color: rgba(154, 138, 118, 0.6); }
tr[data-status="emailed"]  td.cell-status { border-left-color: #6b8e9a; }
tr[data-status="replied"]  td.cell-status { border-left-color: var(--navy); }
tr[data-status="meeting"]  td.cell-status { border-left-color: var(--navy); }
tr[data-status="won"]      td.cell-status { border-left-color: var(--accent); }
tr[data-status="lost"]     td.cell-status { border-left-color: rgba(154, 138, 118, 0.25); }

/* Cadence — overdue flag. Marks a row whose next scheduled send is before
   today so it visually pops in the queue. The accent border lives only on the
   next-send cell so the row reads "this one is overdue" without being garish. */
tr.row-overdue td.cell-cadence-next {
  border-left: 3px solid var(--accent);
  background: rgba(184, 150, 90, 0.08);
}
tr.row-overdue td.cell-cadence-next .cadence-date {
  color: var(--accent-dark);
  font-weight: 500;
}

.cadence-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-select {
  width: 100%;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  cursor: pointer;
  outline: none;
}
.status-select:focus {
  border-color: var(--border);
  background: var(--cream);
}

/* Notes editor */
.notes-cell {
  display: inline-block;
  min-width: 120px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  outline: none;
}
.notes-cell:focus {
  border-color: var(--border);
  background: var(--cream);
}

/* Empty state */
.pipeline-empty {
  text-align: center;
  padding: 48px 24px;
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pipeline-toolbar { flex-direction: column; }
}

/* Tier 2 — collapse to name + status only */
@media (max-width: 800px) {
  .pipeline-table,
  .pipeline-table thead,
  .pipeline-table tbody,
  .pipeline-table tr,
  .pipeline-table td,
  .pipeline-table th { display: block; }

  .pipeline-table thead { display: none; }

  .pipeline-table tr {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    align-items: center;
  }
  .pipeline-table tr[data-status] td.cell-status {
    border-left: none;
    padding-left: 0;
  }
  .pipeline-table td.cell-company,
  .pipeline-table td.cell-status,
  .pipeline-table td.cell-sector,
  .pipeline-table td.cell-contact {
    width: auto;
  }
  .pipeline-table td.cell-company {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    padding-bottom: 4px;
  }
  .pipeline-table td.cell-sector,
  .pipeline-table td.cell-contact { display: none; }
  .pipeline-table td:nth-child(5),
  .pipeline-table td:nth-child(6),
  .pipeline-table td:nth-child(7),
  .pipeline-table td.cell-notes { display: none; }
}

@media (max-width: 600px) {
  .pipeline-hero,
  .pipeline-table-section { padding-left: 24px; padding-right: 24px; }
  .pipeline-hero { padding-top: 80px; padding-bottom: 56px; }
  .pipeline-table-section { padding-top: 40px; padding-bottom: 56px; }
}
