/* ── Journey View — funnel visualization ────────────────────────────────── */

.journey-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.journey-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.journey-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.journey-period-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--white);
  color: var(--text);
}

/* Funnel math banner */
.journey-math {
  display: flex;
  gap: 24px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.journey-math-item {
  text-align: center;
}
.journey-math-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
}
.journey-math-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Funnel stages */
.journey-funnel {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.journey-stage {
  display: flex;
  align-items: stretch;
  min-height: 72px;
  cursor: pointer;
  transition: background var(--duration-fast, 0.15s);
}
.journey-stage:hover { background: var(--bg); }

/* The funnel bar — width proportional to count */
.journey-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 12px 0;
}
.journey-bar {
  height: 40px;
  border-radius: 6px;
  background: var(--gold);
  display: flex;
  align-items: center;
  padding: 0 14px;
  min-width: 80px;
  transition: width 0.4s ease;
  position: relative;
}
.journey-bar-label {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
}

/* Stage info (left side) */
.journey-stage-info {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 16px 8px 0;
}
.journey-stage-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
}
.journey-stage-desc {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Metrics (right side) */
.journey-metrics {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 8px 16px;
}
.journey-metric {
  text-align: center;
}
.journey-metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}
.journey-metric-label {
  font-size: 9px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Conversion arrow between stages */
.journey-conversion {
  display: flex;
  align-items: center;
  padding: 2px 0 2px 140px;
}
.journey-conversion-arrow {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 8px;
}
.journey-conversion-rate {
  font-size: 10px;
  font-weight: 600;
  color: var(--dusk);
  background: rgba(74,111,165,0.08);
  padding: 1px 8px;
  border-radius: 8px;
}

/* Drop-off branches */
.journey-dropoff {
  display: flex;
  align-items: center;
  padding: 4px 0 4px 156px;
  font-size: 11px;
  color: var(--text-light);
}
.journey-dropoff-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 8px;
  flex-shrink: 0;
}
.journey-dropoff-count {
  font-weight: 700;
  color: var(--text);
  margin-right: 4px;
}
.journey-dropoff-action {
  margin-left: auto;
  font-size: 10px;
  color: var(--dusk);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--dusk);
  background: none;
}
.journey-dropoff-action:hover {
  background: rgba(74,111,165,0.08);
}

/* Stage drill-down panel */
.journey-detail {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 8px 0 16px;
  overflow: hidden;
}
.journey-detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
}
.journey-detail-tab {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.journey-detail-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.journey-detail-content {
  padding: 14px 16px;
  max-height: 400px;
  overflow-y: auto;
}

/* Contact list in drill-down */
.journey-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}
.journey-contact:last-child { border-bottom: none; }
.journey-contact-name {
  font-weight: 600;
  color: var(--dark);
  min-width: 120px;
}
.journey-contact-meta {
  color: var(--text-light);
  flex: 1;
}
.journey-contact-action {
  font-size: 10px;
  color: var(--dusk);
  cursor: pointer;
  font-weight: 600;
}

/* Process layer in drill-down */
.journey-skill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.journey-skill-name {
  font-weight: 600;
  color: var(--dark);
  font-size: 12px;
}
.journey-skill-stat {
  font-size: 11px;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
  .journey-stage-info { width: 100px; }
  .journey-metrics { width: auto; gap: 8px; }
  .journey-math { flex-wrap: wrap; gap: 12px; }
}
