/* ── Foreclosure Decoded — Case Pipeline ────────────────────────────────────
   Companion to styles.css. Vars, resets, and global typography live there.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Action / filter bar ──────────────────────────────────────────────────── */
.pipeline-action-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}
.pipeline-action-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 1rem;
}
@media (max-width: 1024px) { .pipeline-action-inner { padding: 0 24px; } }
@media (max-width: 640px)  { .pipeline-action-inner { padding: 0 16px; } }
@media (max-width: 480px)  {
  .pipeline-action-inner {
    flex-wrap: wrap;
    padding: 0.5rem 16px;
    min-height: auto;
    gap: 0.5rem;
  }
  .pipeline-filter-select { flex: 1; min-width: 0; }
  .pipeline-find-btn      { white-space: nowrap; }
}

.pipeline-filter-select {
  padding: 0.35rem 1.4rem 0.35rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.pipeline-filter-select:focus { border-color: var(--navy); }

.pipeline-find-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  color: var(--teal);
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.pipeline-find-btn:hover { border-color: var(--teal); background: rgba(31,122,114,.04); }

/* ── Page layout ──────────────────────────────────────────────────────────── */
.pipeline-page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 1.5rem 32px 4rem;
}
@media (max-width: 1024px) { .pipeline-page { padding: 1.25rem 24px 3rem; } }
@media (max-width: 640px)  { .pipeline-page { padding: 1rem 16px 2.5rem; } }

.pipeline-columns {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 960px) { .pipeline-columns { grid-template-columns: 1fr; } }

/* ── Vertical timeline rail ───────────────────────────────────────────────── */
.timeline-stream {
  position: relative;
  padding-left: 38px;
}
.timeline-stream::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border);
  z-index: 1;
}

/* Phase dividers */
.timeline-phase-divider {
  position: relative;
  margin: 22px 0 14px -38px;
  padding-left: 38px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.timeline-phase-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.timeline-phase-divider:first-child { margin-top: 0; }
.timeline-phase-tally {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-light);
  white-space: nowrap;
}

/* Step rows */
.timeline-step-row {
  position: relative;
  margin-bottom: 10px;
  z-index: 2;
}

/* Axis dot */
.timeline-axis-dot {
  position: absolute;
  left: -38px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: 0 0 0 3px #fff;
  transition: background .2s, border-color .2s, transform .2s;
  z-index: 3;
}
.timeline-step-row.status-complete .timeline-axis-dot {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.timeline-step-row.status-in_progress .timeline-axis-dot {
  background: #fff;
  border-color: var(--amber);
  color: var(--amber);
  font-weight: 800;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(184,134,11,.18);
}

/* Card pane */
.timeline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow .15s, transform .15s;
  overflow: hidden;
}
.timeline-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.timeline-step-row.status-in_progress .timeline-card {
  border-left: 3px solid var(--amber);
  border-radius: 0 8px 8px 0;
}
.timeline-step-row.status-skipped .timeline-card { opacity: .55; }

/* Card main row */
.timeline-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 18px;
  cursor: pointer;
}
.timeline-card-body { flex: 1; min-width: 0; }
.timeline-card-body h4 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 2px;
  font-family: 'Poppins', system-ui, sans-serif;
  line-height: 1.3;
}
.timeline-card-body p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-card-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Status badges */
.step-status-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.step-status-badge.badge-done    { background: rgba(31,122,114,.12); color: var(--teal); }
.step-status-badge.badge-current { background: rgba(184,134,11,.12); color: #7a6008; }
.step-status-badge.badge-locked  { background: var(--surface-alt); color: var(--text-light); border: 1px solid var(--border); }
.step-status-badge.badge-skipped { background: var(--surface-alt); color: var(--text-light); border: 1px solid var(--border); }

.timeline-chevron {
  color: var(--text-light);
  font-size: 11px;
  transition: transform .2s;
  flex-shrink: 0;
}
.timeline-step-row.expanded .timeline-chevron { transform: rotate(180deg); }

/* Expand panel */
.timeline-card-expand {
  display: none;
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
}
.timeline-step-row.expanded .timeline-card-expand { display: block; }

.step-tip-box {
  background: rgba(30,43,74,.04);
  border: 1px solid rgba(30,43,74,.1);
  border-radius: 6px;
  padding: 9px 13px;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.6;
  margin: 12px 0 10px;
}
.step-tip-box strong { color: var(--navy); }

.step-action-link {
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
  margin-bottom: 10px;
}
.step-action-link:hover { text-decoration: underline; }

.step-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.step-status-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.step-status-select {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.step-status-select:focus { border-color: var(--navy); }

.step-notes-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.step-notes {
  width: 100%;
  min-height: 64px;
  font-size: 0.8rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.step-notes:focus { border-color: var(--navy); }

/* Empty / loading */
.pipeline-empty {
  text-align: center;
  padding: 3rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.pipeline-sidebar { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 68px; }
@media (max-width: 960px) { .pipeline-sidebar { position: static; } }

.ls-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ls-card-head {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.metric-cell {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid var(--surface-alt);
}
.metric-cell:nth-child(odd)  { border-right: 1px solid var(--surface-alt); }
.metric-cell:nth-child(n+3)  { border-bottom: none; }
.metric-val   { display: block; font-size: 1.25rem; font-weight: 800; color: var(--navy); font-family: 'Poppins', system-ui, sans-serif; line-height: 1; }
.metric-val.teal  { color: var(--teal); }
.metric-val.amber { color: var(--amber); }
.metric-label { display: block; font-size: 0.55rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); margin-top: 3px; }

/* Progress bar inside sidebar */
.sidebar-progress { padding: 14px 16px; }
.sidebar-progress-rail { background: var(--border); height: 5px; border-radius: 3px; margin-bottom: 5px; overflow: hidden; }
.sidebar-progress-fill { background: var(--teal); height: 100%; border-radius: 3px; transition: width .4s; }
.sidebar-progress-lbl  { display: flex; justify-content: space-between; font-size: 0.72rem; font-weight: 700; color: var(--navy); }

/* Case details rows */
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--surface-alt);
}
.spec-row:last-child { border-bottom: none; }
.spec-row label { color: var(--text-muted); font-weight: 500; }
.spec-row span  { font-weight: 700; color: var(--navy); font-family: monospace; font-size: 0.76rem; }
.spec-row span.normal { font-family: inherit; font-size: 0.78rem; }

/* ── Find My Case modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.42);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 0.95rem; margin: 0; color: var(--navy); }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--text-muted); padding: 2px 4px; }
.modal-body  { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-footer { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); }
.modal-result { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 0.8rem; }
.modal-result-row { display: flex; justify-content: space-between; padding: 3px 0; }
.modal-result-label { color: var(--text-muted); }
.modal-result-val   { font-weight: 600; color: var(--text); }

.modal-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.modal-input,
.modal-select {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
  background: #fff;
}
.modal-input:focus,
.modal-select:focus { border-color: var(--navy); }
