/* Pipelines stylesheet — used by sales-pipeline.html and marketing-pipeline.html */

/* ── Sales: forecast bars ── */
.pipeline-controls { display: flex; gap: 10px; }
.pipeline-select {
  background: var(--surface-2, #1a1d29);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text, #fff);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.pipeline-select:focus { outline: 2px solid #6c5ce7; }

.forecast-bars { padding: 8px 20px 4px; }
.fc-row {
  display: grid;
  grid-template-columns: 180px 1fr 160px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.fc-row:last-child { border-bottom: none; }
.fc-label { font-size: 13px; font-weight: 600; color: var(--text, #fff); }
.fc-count { color: var(--text-dim, #8a8fa3); font-weight: 400; font-size: 12px; }
.fc-bar-wrap {
  position: relative;
  height: 24px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  overflow: hidden;
}
.fc-bar-total {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, rgba(108,92,231,0.35), rgba(108,92,231,0.6));
  border-radius: 6px;
  transition: width 0.4s ease;
}
.fc-bar-weighted {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #00b894);
  border-radius: 6px;
  transition: width 0.4s ease;
}
.fc-values {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 12px;
}
.fc-total { color: var(--text-dim, #8a8fa3); font-weight: 500; }
.fc-weighted { color: #00b894; font-weight: 600; font-size: 13px; }

.fc-legend {
  display: flex; gap: 16px; align-items: center;
  padding: 12px 20px 16px;
  font-size: 12px; color: var(--text-dim, #8a8fa3);
}
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.sw-total { background: rgba(108,92,231,0.5); }
.sw-weighted { background: linear-gradient(90deg, #6c5ce7, #00b894); margin-left: 12px; }

/* ── Deal card extras ── */
.deal-card-meta {
  display: flex; gap: 8px; align-items: center;
  font-size: 11px; color: var(--text-dim, #8a8fa3);
  margin-top: 4px;
}
.deal-owner {
  background: #6c5ce7;
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
}
.deal-weighted { color: #00b894; font-weight: 500; }
.deal-close {
  margin-left: auto;
  background: rgba(255,255,255,0.05);
  padding: 2px 6px; border-radius: 4px;
  font-size: 10px;
}

/* ── Summary cards: sub text ── */
.summary-card .card-sub {
  font-size: 11px;
  color: var(--text-dim, #8a8fa3);
  margin-top: 4px;
}

/* ── Marketing funnel layout ── */
.mkt-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 1100px) { .mkt-grid { grid-template-columns: 1fr; } }

.mkt-funnel { padding: 16px 20px 22px; }
.funnel-step {
  display: grid;
  grid-template-columns: 1fr 200px 140px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.funnel-step:last-child { border-bottom: none; }
.funnel-bar {
  height: 34px;
  background: linear-gradient(90deg, #6c5ce7 0%, #00b894 100%);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(108,92,231,0.35);
  min-width: 18%;
  transition: width 0.4s ease;
}
.funnel-step:nth-child(1) .funnel-bar { background: linear-gradient(90deg, #74b9ff, #6c5ce7); }
.funnel-step:nth-child(2) .funnel-bar { background: linear-gradient(90deg, #6c5ce7, #a29bfe); }
.funnel-step:nth-child(3) .funnel-bar { background: linear-gradient(90deg, #a29bfe, #fd79a8); }
.funnel-step:nth-child(4) .funnel-bar { background: linear-gradient(90deg, #fd79a8, #fdcb6e); }
.funnel-step:nth-child(5) .funnel-bar { background: linear-gradient(90deg, #fdcb6e, #ffeaa7); }
.funnel-step:nth-child(6) .funnel-bar { background: linear-gradient(90deg, #55efc4, #00b894); }
.funnel-step:nth-child(7) .funnel-bar { background: linear-gradient(90deg, #00b894, #009874); }

.funnel-meta { text-align: right; }
.funnel-stage {
  font-size: 13px; font-weight: 700; color: var(--text, #fff);
  letter-spacing: 0.02em;
}
.funnel-label { font-size: 11px; color: var(--text-dim, #8a8fa3); margin-top: 2px; }
.funnel-numbers { text-align: right; }
.funnel-count {
  font-size: 18px; font-weight: 700; color: var(--text, #fff);
  font-variant-numeric: tabular-nums;
}
.funnel-conv { font-size: 11px; color: #00b894; margin-top: 2px; }

/* ── Marketing: sources ── */
.mkt-sources { padding: 6px 20px 16px; }
.src-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.src-row:last-child { border-bottom: none; }
.src-name { font-size: 12px; font-weight: 600; color: var(--text, #fff); margin-bottom: 4px; }
.src-bar-wrap {
  height: 6px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; margin-bottom: 5px;
}
.src-bar { height: 100%; background: linear-gradient(90deg, #6c5ce7, #a29bfe); border-radius: 3px; }
.src-stats {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 11px; color: var(--text-dim, #8a8fa3);
}
.src-leads { font-weight: 500; }
.src-mql { color: #fdcb6e; }
.src-customers { color: #00b894; font-weight: 500; }
.src-cac { margin-left: auto; font-weight: 500; }

/* ── Marketing: stage-to-stage conversion grid ── */
.conv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px 20px 18px;
}
.conv-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
}
.conv-pair {
  font-size: 11px; color: var(--text-dim, #8a8fa3);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.conv-rate {
  font-size: 24px; font-weight: 700; color: var(--text, #fff);
  font-variant-numeric: tabular-nums;
}
.conv-bench {
  font-size: 11px; color: var(--text-dim, #8a8fa3);
  margin-top: 4px;
}
.conv-delta { margin-left: 6px; font-weight: 600; }
.conv-delta.up { color: #00b894; }
.conv-delta.down { color: #e17055; }

/* ── Mobile polish ── */
@media (max-width: 700px) {
  .fc-row { grid-template-columns: 1fr; gap: 6px; }
  .fc-values { flex-direction: row; justify-content: space-between; }
  .funnel-step { grid-template-columns: 1fr; }
  .funnel-meta, .funnel-numbers { text-align: left; }
}
