/* ===========================================================
   Portal Design System — pulled from helmpointadvisory.com
   Prefix `pf-` (portal frame) to avoid colliding with
   design-canvas styles.
   =========================================================== */

.pf {
  --navy: #0f1b2d;
  --navy-light: #162337;
  --navy-mid: #1a2a42;
  --teal: #00c2a8;
  --teal-dark: #00a892;
  --teal-tint: rgba(0, 194, 168, 0.12);
  --gold: #f4c542;
  --gold-tint: rgba(244, 197, 66, 0.18);
  --red: #b00020;
  --red-tint: rgba(220, 53, 69, 0.10);
  --white: #ffffff;
  --gray-50: #fbfbfc;
  --gray-100: #f7f8fa;
  --gray-150: #f0f2f5;
  --gray-200: #e8eaed;
  --gray-300: #c4c8cf;
  --gray-600: #6b7280;
  --gray-800: #2d3748;
  --text: #1a202c;
  --text-light: #a0aec0;
  --text-muted: #718096;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  font-family: var(--font-body);
  color: var(--text);
  background: var(--gray-100);
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.pf *, .pf *::before, .pf *::after { box-sizing: border-box; }
.pf h1, .pf h2, .pf h3, .pf h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}
.pf p { margin: 0; line-height: 1.55; }
.pf button { font-family: inherit; cursor: pointer; }
.pf a { text-decoration: none; color: inherit; }
.pf a.pf-logo { color: var(--white); }
.pf ul { list-style: none; padding: 0; margin: 0; }

/* ---------- Top site header (mirror marketing chrome) ---------- */
.pf-header {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 32px;
}
.pf-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 0.01em;
}
.pf-logo-mark {
  width: 28px; height: 28px;
  background: var(--teal);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy);
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
}
.pf-nav {
  display: flex; gap: 24px;
  margin-left: 16px;
  flex: 1;
}
.pf-nav a {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.pf-nav a.active { color: var(--white); border-bottom-color: var(--teal); }
.pf-user {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
}
.pf-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal-tint);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(0,194,168,0.35);
}

/* ---------- Page shell ---------- */
.pf-main {
  height: calc(100% - 72px);
  overflow-y: auto;
  background: var(--gray-100);
}
.pf-container { max-width: 1200px; margin: 0 auto; padding: 32px 40px 48px; }

/* ---------- Page header strip ---------- */
.pf-page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 28px;
}
.pf-page-head .eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  margin-bottom: 6px;
}
.pf-page-head h1 { font-size: 38px; color: var(--navy); margin-bottom: 12px; }
.pf-page-head .sub { color: var(--text-muted); font-size: 15px; }

/* ---------- Buttons ---------- */
.pf-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent;
  transition: 120ms ease;
  white-space: nowrap;
}
.pf-btn--primary { background: var(--teal); color: var(--white); }
.pf-btn--primary:hover { background: var(--teal-dark); }
.pf-btn--ghost {
  background: var(--white); color: var(--navy);
  border-color: var(--gray-200);
}
.pf-btn--ghost:hover { border-color: var(--navy); }
.pf-btn--dark { background: var(--navy); color: var(--white); }
.pf-btn--small { padding: 7px 12px; font-size: 12.5px; }
.pf-btn--icon-only { padding: 8px; width: 34px; height: 34px; justify-content: center; }

/* ---------- Card ---------- */
.pf-card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 24px;
}
.pf-card--tight { padding: 18px 20px; }
.pf-card--dark { background: var(--navy); color: var(--white); border-color: transparent; }
.pf-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.pf-card-head h2, .pf-card-head h3 { color: var(--navy); }
.pf-card-head h2 { font-size: 22px; }
.pf-card-head h3 { font-size: 16px; font-family: var(--font-body); font-weight: 600; }

/* ---------- Status pipeline (cleaner version) ---------- */
.pf-pipeline {
  display: flex; gap: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 6px;
}
.pf-pipeline-step {
  flex: 1;
  position: relative;
  padding: 14px 18px 14px 32px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
  margin-right: -10px;
}
.pf-pipeline-step:first-child { padding-left: 18px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.pf-pipeline-step:last-child  { margin-right: 0; padding-right: 18px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); }
.pf-pipeline-step .num {
  display: block;
  font-size: 10px; color: var(--gray-300);
  margin-bottom: 2px; letter-spacing: 0.08em;
}
.pf-pipeline-step.done   { background: var(--teal-tint); color: var(--teal-dark); }
.pf-pipeline-step.done .num { color: var(--teal-dark); opacity: 0.7; }
.pf-pipeline-step.current { background: var(--navy); color: var(--white); }
.pf-pipeline-step.current .num { color: rgba(255,255,255,0.55); }

/* ---------- Stage summary (next-step card) ---------- */
.pf-stage {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1fr 1fr;
  gap: 0;
  margin-top: 18px;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.pf-stage-col { padding: 22px 24px; }
.pf-stage-col + .pf-stage-col { border-left: 1px solid var(--gray-200); }
.pf-stage-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.pf-stage-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.pf-stage-eyebrow.you .dot { background: var(--red); }
.pf-stage-eyebrow.advisor .dot { background: var(--gold); }
.pf-stage-eyebrow.ready .dot { background: var(--teal); }
.pf-stage-col h3 {
  font-size: 18px; color: var(--navy);
  margin-bottom: 6px;
}
.pf-stage-col p { font-size: 13.5px; color: var(--text-muted); }
.pf-stage-list { margin-top: 12px; }
.pf-stage-list li {
  font-size: 13px; padding: 6px 0;
  display: flex; align-items: center; gap: 10px;
  color: var(--gray-800);
}
.pf-stage-list li .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); flex: 0 0 auto; }

/* ---------- Two-column body grid ---------- */
.pf-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  margin-top: 28px;
}

/* ---------- Doc list ---------- */
.pf-section-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 12px;
}
.pf-section-head h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pf-section-head .count {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 99px;
  padding: 1px 9px;
  font-size: 11px; font-weight: 600;
  color: var(--gray-800);
}
.pf-section-head .help {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-muted);
}

.pf-doc {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: 120ms ease;
}
.pf-doc:hover { border-color: var(--gray-300); box-shadow: 0 2px 10px rgba(15, 27, 45, 0.04); }
.pf-doc.todo { border-left-color: var(--red); }
.pf-doc.review { border-left-color: var(--gold); }
.pf-doc.done { border-left-color: var(--teal); }
.pf-doc.rejected { border-left-color: var(--red); background: var(--red-tint); }

.pf-doc-icon {
  width: 36px; height: 44px;
  border-radius: 4px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex: 0 0 auto;
  position: relative;
}
.pf-doc-icon::before {
  content: ''; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 8px 8px 0;
  border-color: transparent var(--white) transparent transparent;
}
.pf-doc-body { flex: 1; min-width: 0; }
.pf-doc-name { font-weight: 600; font-size: 14px; color: var(--navy); }
.pf-doc-meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
  display: flex; gap: 10px; align-items: center;
}
.pf-doc-meta .sep { color: var(--gray-300); }
.pf-doc-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }

/* ---------- Status badge ---------- */
.pf-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.pf-badge--requested { background: var(--red-tint); color: var(--red); }
.pf-badge--rejected { background: var(--red-tint); color: var(--red); }
.pf-badge--review { background: var(--gold-tint); color: #6b4f08; }
.pf-badge--approved { background: var(--teal-tint); color: var(--teal-dark); }
.pf-badge--waived { background: var(--gray-100); color: var(--gray-800); }
.pf-badge--due { background: var(--red-tint); color: var(--red); }

/* ---------- Right-rail cards ---------- */
.pf-rail { display: flex; flex-direction: column; gap: 18px; }
.pf-advisor {
  display: flex; gap: 14px;
  align-items: flex-start;
}
.pf-advisor-img {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-light), var(--navy));
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 18px;
  flex: 0 0 auto;
}
.pf-advisor-name { font-weight: 600; font-size: 14px; color: var(--navy); }
.pf-advisor-title { font-size: 12px; color: var(--text-muted); }
.pf-quote {
  font-size: 14px; color: var(--gray-800);
  margin-top: 12px; line-height: 1.55;
  padding: 12px 14px;
  background: var(--gray-100);
  border-radius: 8px;
  border-left: 3px solid var(--teal);
}

.pf-activity li {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-150);
  font-size: 13px;
}
.pf-activity li:last-child { border-bottom: 0; }
.pf-activity .icon {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-muted);
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.pf-activity .icon.teal { background: var(--teal-tint); color: var(--teal-dark); }
.pf-activity .icon.gold { background: var(--gold-tint); color: #8a6d11; }
.pf-activity .icon.red { background: var(--red-tint); color: var(--red); }
.pf-activity .when { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }

/* ---------- Broker pipeline rows (deal cards / list rows) ---------- */
.pf-deal-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 110px 130px;
  gap: 20px;
  align-items: center;
  padding: 18px 22px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--white);
  margin-bottom: 10px;
  transition: 120ms ease;
}
.pf-deal-row:hover { border-color: var(--gray-300); box-shadow: 0 4px 18px rgba(15, 27, 45, 0.05); transform: translateY(-1px); }
.pf-deal-row.funded { background: linear-gradient(0deg, rgba(0,194,168,0.04), transparent); }
.pf-deal-name { font-weight: 600; color: var(--navy); font-size: 15px; }
.pf-deal-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ----- mini chevron pipeline (for broker deal row) ----- */
.pf-mini {
  display: flex; align-items: center; gap: 0;
  background: var(--gray-100);
  border-radius: 6px;
  padding: 3px;
}
.pf-mini-step {
  flex: 1; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gray-300);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%, 6px 50%);
  margin-right: -4px;
  text-transform: uppercase;
}
.pf-mini-step:first-child { clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 0 100%); }
.pf-mini-step:last-child { margin-right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 6px 50%); }
.pf-mini-step.done { background: var(--teal); color: var(--white); }
.pf-mini-step.current { background: var(--navy); color: var(--white); }

.pf-deal-update {
  font-size: 12.5px; color: var(--text-muted);
}
.pf-deal-update strong { color: var(--gray-800); font-weight: 600; }

/* ---------- Broker upload card ---------- */
.pf-drop {
  border: 1.5px dashed var(--gray-300);
  border-radius: 12px;
  padding: 36px 24px;
  text-align: center;
  background: var(--gray-50);
  transition: 150ms ease;
}
.pf-drop.active { border-color: var(--teal); background: var(--teal-tint); }
.pf-drop h4 { font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.pf-drop p { font-size: 13px; color: var(--text-muted); }
.pf-drop-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
}

.pf-field { margin-bottom: 16px; }
.pf-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--gray-800); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pf-field input, .pf-field select, .pf-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: 120ms;
}
.pf-field input:focus, .pf-field select:focus, .pf-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}
.pf-field textarea { min-height: 80px; resize: vertical; }
.pf-field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ---------- Inline message / alert ---------- */
.pf-alert {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--gold-tint);
  border: 1px solid rgba(244, 197, 66, 0.4);
  font-size: 13px;
  color: #6b4f08;
  align-items: flex-start;
}
.pf-alert--teal { background: var(--teal-tint); border-color: rgba(0,194,168,0.3); color: var(--teal-dark); }

/* ---------- Comments thread (borrower doc detail) ---------- */
.pf-thread {
  margin-top: 12px;
  padding: 14px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-150);
}
.pf-msg { display: flex; gap: 10px; margin-bottom: 12px; }
.pf-msg:last-child { margin-bottom: 0; }
.pf-msg-av {
  width: 28px; height: 28px; border-radius: 50%;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.pf-msg.advisor .pf-msg-av { background: var(--navy); color: var(--white); }
.pf-msg.you .pf-msg-av { background: var(--teal-tint); color: var(--teal-dark); border: 1px solid rgba(0,194,168,0.3); }
.pf-msg-body { flex: 1; }
.pf-msg-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; }
.pf-msg-meta strong { color: var(--gray-800); font-weight: 600; }
.pf-msg-text {
  font-size: 13px; color: var(--gray-800);
  background: var(--white);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--gray-150);
  line-height: 1.5;
}

/* ---------- Refer modal / inline form (broker) ---------- */
.pf-table {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}
.pf-table-head {
  display: grid;
  grid-template-columns: 1fr 1.5fr 110px 130px;
  gap: 20px;
  padding: 12px 22px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
