/* Activity Feed & Deal Timeline */

.activity-feed,
.activity-timeline {
  max-width: 760px;
  margin-top: 1.5rem;
}

.activity-date-group {
  margin-bottom: 2rem;
}

.activity-date-divider {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
}

.activity-entry {
  padding: 0.55rem 0.9rem;
  background: #f0faf4;
  border: 1px solid #49c96b;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: calc(0.5rem + 8px + 2px);
}

.activity-entry__deal-link {
  font-weight: 600;
  color: #2d6a4f;
  text-decoration: none;
  font-size: 0.9rem;
}

.activity-entry__deal-link:hover {
  text-decoration: underline;
}

.activity-entry__body {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.activity-entry__time {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.activity-entry__description {
  font-size: 0.95rem;
  color: #333;
}

.activity-empty {
  color: #888;
  font-style: italic;
}
/* =====================================================
   Dashboard
   ===================================================== */

.dashboard-welcome {
  font-size: 1.2rem;
  color: #757575;
  margin-bottom: 45px;
  font-weight: normal;
}

.dash-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin-top: 1.5rem;
}

.dash-card-number {
  width: 180px;
  height: 200px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.40);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dash-card-number__header {
  background-color: #4470a6;
  color: #ffffff;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.dash-card-number__value {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-weight: 700;
  color: #ababab;
  line-height: 1;
}

.dash-deal-card {
  width: 180px;
  min-height: 200px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.40);
  display: flex;
  flex-direction: column;
}

a.dash-deal-card,
a.dash-deal-card:hover,
a.dash-deal-card:visited {
  text-decoration: none;
}

.dash-deal-card__header {
  background-color: #479256;
  color: #ffffff;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  min-height: 40px;
}

.dash-deal-card__header--pending {
  background-color: #6d706e;
}

.dash-deal-card--pending {
  position: relative;
}

.dash-deal-card--pending::after {
  content: "New";
  position: absolute;
  top: -9px;
  right: -11px;
  background: #e6a817;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 10;
}

.dash-deal-card__body {
  flex: 1;
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
}

.dash-deal-card__value {
  font-size: 1.4rem;
  font-weight: 600;
  color: #3a3a3a;
  margin: 4px 0px;
  margin-top: auto;
}

.dash-deal-card__type {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 4px;
  background: #e8e8e8;
  color: #444;
  display: inline-block;
  margin: 4px 0px;
}

.dash-deal-card__progress {
  margin-top: 0.6rem;
}

.dash-deal-progress__days {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 4px 0px;
}

.dash-deal-progress__tasks {
  font-size: 0.78rem;
  color: #666;
  margin: 4px 0px;
}

.dash-deal-card__needs-attention {
  font-size: 0.78rem;
  font-weight: 600;
  color: #c53030;
  margin-top: 0.35rem;
}

/* Lead status badges */

.lead-status-badge {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 106px;
  text-align: center;
  box-sizing: border-box;
}

.lead-status-badge--new_lead  { background: #3b97d5; color: #ffffff; }
.lead-status-badge--rejected  { background: #dc2626; color: #ffffff; }
.lead-status-badge--converted { background: #16a34a; color: #ffffff; }

.lead-purpose-card {
  color: #000000;
  border: 1px solid #e4e4e4;
  border-left: 3px solid #696969;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  background: #ffffff;
  padding: 14px 20px;
  display: block;
  width: 45%;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.leads-admin-notes {
  width: 100%;
  height: 200px;
  font-family: inherit;
  padding: 4px 6px;
  border: 1px solid #bfe1ff;
  border-radius: 2px;
  background: linear-gradient(163deg, rgb(195 226 255 / 50%), 66%, rgb(108 182 255 / 50%));
  resize: none;
  box-shadow: 2px 4px 6px 0px rgb(195 195 195);
  box-sizing: border-box;
}

.lead-raw-value {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.lead-purpose-card .lead-raw-value {
  color: #c0c0c0;
}

.lead-parse-warning {
  color: #b45309;
  font-size: 13px;
}

/* Leads index table */

.leads-amount-cell {
  font-variant-numeric: tabular-nums;
}

.leads-parse-issues-cell {
  font-size: 13px;
  color: #b45309;
  line-height: 1.5;
}

.leads-derived-metrics-cell {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  font-size: 13px;
  line-height: 1.4;
}

/* Leads filter bar */

.leads-filter-bar {
  margin: 16px 0 0;
}

.leads-filter-bar form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.leads-filter-select {
  min-width: 160px;
  margin-top: 0;
  margin-bottom: 0;
}

/* Lead derived metrics card */

.lead-metrics-card {
  border-left: 3px solid #6b9fd4;
  background: #f0f5fb;
  border-radius: 3px;
  padding: 14px 20px;
  width: 45%;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.lead-metrics-card h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a6a8a;
}

/* AI triage score pill */

.lead-ai-score-label {
  display: block;
  font-size: 1rem;
  color: #555;
  margin-bottom: 2px;
}

.lead-score-pill {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.lead-score-pill--convert { color: #16a34a; }
.lead-score-pill--reject  { color: #d10000; }

/* AI triage detail card */

.lead-ai-triage-card {
  background: #f5fdf8;
  border: 1px solid #e0e0e0;
  border-left: solid 3px #18a34a;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.lead-ai-triage-card--reject {
  background: #fff6f6;
  border-left: solid 3px #d10001;
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.lead-ai-triage-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2a2a2a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-ai-intent {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #555;
  line-height: 1.55;
}

.lead-ai-score-explanation {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #555;
  line-height: 1.55;
}

.lead-ai-tags-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.lead-ai-tag-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lead-ai-tag-group--horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.lead-ai-tag-group--horizontal strong {
  flex-basis: 100%;
}

.lead-ai-tag-group strong {
  font-size: 1rem;
  color: #555;
  margin-bottom: 2px;
}

.lead-ai-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 1rem;
  line-height: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  margin-right: 6px;
}

.lead-ai-tag--strength { background: #379f5b; color: #d6e8dd; }
.lead-ai-tag--concern  { background: #cb3b3b; color: #ffe8e8; }

.lead-ai-meta {
  font-size: 1rem;
  color: #555;
  line-height: 1.55;
  margin: 0;
}

/* =====================================================
   Client Portal Dashboard Sections
   ===================================================== */

.client-dash-section {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 24px 28px;
  margin-bottom: 20px;
  max-width: 680px;
}

.client-dash-section__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  margin: 0 0 14px;
}

.client-dash-onboarding-text {
  font-size: 1rem;
  color: #444;
  line-height: 1.6;
  margin: 0;
}

/* Status section */

.client-dash-status-card {
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  padding: 16px 20px;
}

.client-dash-status-card__headline {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: #1a1a1a;
}

.client-dash-status-card__description {
  font-style: italic;
  color: #555;
  margin: 0;
  font-size: 0.95rem;
}

.client-dash-status-card__sub {
  color: #555;
  margin: 0;
  font-size: 0.9rem;
}

/* Checklist section */

.client-dash-checklist {
  display: flex;
  flex-direction: column;
}

.client-dash-checklist__item {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.client-dash-checklist__circle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.client-dash-checklist__circle {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.client-dash-checklist__line {
  width: 2px;
  flex: 1;
  min-height: 14px;
  background: #d0d0d0;
  margin: 2px 0;
}

.client-dash-checklist__label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
  padding-bottom: 14px;
  font-size: 1rem;
  color: #1a1a1a;
}

.client-dash-checklist__description {
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
  margin: 4px 0 0;
  line-height: 1.5;
}

.client-dash-checklist__tasks {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-dash-checklist__task {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-dash-checklist__description--task {
  width: 100%;
  padding-left: 22px;
  margin-top: 2px;
}

.client-dash-checklist__task-dot {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.client-dash-checklist__task-label {
  font-size: 0.875rem;
  color: #444;
}

.client-dash-checklist__item--awaiting .client-dash-checklist__label {
  color: #888;
}

.client-dash-checklist__sub-link {
  font-size: 0.9rem;
  color: #3b82c4;
  text-decoration: none;
}

.client-dash-checklist__sub-link:hover {
  text-decoration: underline;
}

.client-dash-stay-tuned {
  border: 2px dashed #e6a817;
  border-radius: 4px;
  padding: 14px 18px;
  margin: 4px 0 16px;
  text-align: center;
}

.client-dash-stay-tuned__heading {
  color: #e6a817;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
}

.client-dash-stay-tuned__body {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

.client-dash-checklist__subheading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin: 4px 0 8px;
}

/* =====================================================
   Client Portal — Application Detail
   ===================================================== */

.client-app-submitted-date {
  color: #888;
  font-size: 0.9rem;
  margin: 4px 0 28px;
}

.client-app-detail {
  max-width: 720px;
}

.client-app-detail__section {
  margin-bottom: 32px;
}

.client-app-detail__section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e0e0e0;
}

.client-app-detail__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
}

.client-app-detail__label {
  min-width: 220px;
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #666;
}

.client-app-detail__value {
  font-size: 0.95rem;
  color: #1a1a1a;
}

.client-app-detail__notes {
  font-size: 0.95rem;
  color: #1a1a1a;
  line-height: 1.6;
  white-space: pre-wrap;
  margin: 0;
}

/* =====================================================
   Client Portal — Page Subtitle & Intro Card
   ===================================================== */

.client-page-subtitle {
  font-size: 0.95rem;
  color: #888;
  margin: 2px 0 22px;
  line-height: 1.5;
  max-width: 620px;
}

.client-intro-card {
  background: #eef6ff;
  border: 1px solid #c3ddf7;
  border-left: 3px solid #3b82c4;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
  max-width: 680px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.client-intro-card__icon {
  flex-shrink: 0;
  color: #3b82c4;
  font-size: 1.2rem;
  line-height: 1.4;
}

.client-intro-card__body {
  flex: 1;
}

.client-intro-card__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin: 0 0 5px;
}

.client-intro-card__text {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
  margin: 0;
}

.client-intro-card__dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.client-intro-card__dismiss:hover {
  color: #555;
}

/* =====================================================
   Per-deal block (wraps Status + Checklist when multiple deals)
   ===================================================== */

.client-deal-block {
  margin-bottom: 2.5rem;
}

.client-deal-block__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.client-dash-checklist__empty {
  color: #9ca3af;
  font-size: 0.9rem;
  font-style: italic;
}
/* =====================================================
   Deals Builder
   ===================================================== */

body.deal-builder-page .main-content__body {
  background-color: #ebebeb;
  cursor: grab;
  padding-bottom: 32px;
}

body.deal-builder-page .main-content__body a,
body.deal-builder-page .main-content__body button,
body.deal-builder-page .main-content__body input,
body.deal-builder-page .main-content__body select,
body.deal-builder-page .main-content__body textarea {
  cursor: pointer;
}

/* Shared background for the deal/project sub-screens reached from the
   roadmap page's header nav — Team, Updates, Overview, Calendar, Activity
   Log — so they all match the roadmap page's own background. */
body.deal-subscreen-page .main-content__body {
  background-color: #ebebeb;
}

/* My Tasks screen */
body.my-tasks-page .main-content__body {
  background-color: #ebebeb;
}

/* Admin Updates screen (/admin/updates) */
body.admin-updates-page .main-content__body {
  background-color: #ebebeb;
}

/* Deal Header */

.deal-header {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.15);
  position: sticky;
  left: 0;
}

.deal-header__main {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.deal-header__main h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.deal-header__main h1 svg {
  flex-shrink: 0;
  height: 1em;
  width: auto;
}

.deal-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 0.8rem;
  margin-left: 5px;
}

.deal-header__assignees {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 0.8rem;
  margin-left: 5px;
}

.deal-header__inline-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.deal-header__inline-field form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.deal-header__inline-field .inline-select {
  width: auto;
  line-height: 1.2;
}

.deal-header__summary {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  margin-left: 5px;
}

/* Team short header — condensed single-row team strip on the roadmap page */

.team-short-header {
  background: #dbdbdb;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 1.75rem 1.25rem 1rem;
  margin-bottom: 2rem;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.35);
  position: sticky;
  left: 0;
}

.team-short-header__label {
  position: absolute;
  top: 11px;
  left: 13px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b6969;
}

.team-short-header__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-short-header__viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.team-short-header__viewport::-webkit-scrollbar {
  display: none;
}

.team-short-header__track {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px 3px;
  width: max-content;
}

.team-short-header__track .team-grid__member {
  flex-shrink: 0;
}

.team-short-header__chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #ccc;
  border-radius: 50%;
  background: #fff;
  color: #444;
  cursor: pointer;
}

.team-short-header__chevron:hover {
  background: #f2f2f2;
  color: #1a1a1a;
}

.team-short-header__chevron[hidden] {
  display: none;
}

/* Deal header — "Updating…" overlay shown while Client/Lender assignment saves */
.deal-updating-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.deal-updating-overlay.hidden {
  display: none;
}

.deal-updating-overlay__box {
  background: #fff;
  border-radius: 8px;
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.deal-updating-overlay__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #4875bd;
  border-radius: 50%;
  animation: deal-updating-spin 0.8s linear infinite;
}

@keyframes deal-updating-spin {
  to { transform: rotate(360deg); }
}

.deal-updating-overlay__message {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.deal-header__actions {
  display: flex;
  gap: 0.5rem;
}

/* Deal header two-column layout */

.deal-header__top {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 0.75rem;
}

.deal-header__left {
  flex: 1;
}

/* Deal Progress Panel */

.deal-header__progress {
  min-width: 200px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.85rem;
  background: #f7f9fb;
  border: 1px solid #dce3ea;
  border-radius: 6px;
}

.deal-progress__date {
  font-size: 0.85rem;
  color: #555;
}

.deal-progress__days {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 0.4rem;
}

.deal-progress__tasks {
  font-size: 1.2rem;
  color: #555;
}

.deal-progress__bar-wrap {
  background: #e0e0e0;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 4px 0px;
}

.deal-progress__bar-fill {
  height: 100%;
  background: #2faa59;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Status Badge */

.deal-status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  text-transform: capitalize;
}

.deal-status-badge--pending    { background: #fef3c7; color: #92400e; }
.deal-status-badge--active     { background: #dcfce7; color: #15803d; }
.deal-status-badge--closed     { background: #e0e7ff; color: #3730a3; }
.deal-status-badge--cancelled  { background: #fee2e2; color: #991b1b; }

/* Zoom Toolbar */

.zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: sticky;
  top: -32px;
  left: 0;
  z-index: 500;
  background-color: #ebebeb;
  box-shadow: -32px 0 0 0 #ebebeb, 32px 0 0 0 #ebebeb;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.zoom-label {
  font-size: 0.82rem;
  color: #666;
  margin-right: 0.2rem;
}

.zoom-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #444;
}

.zoom-btn:hover {
  background: #f0f0f0;
}

.zoom-btn--active:hover {
  background: #6cbfdf;
  color: #ffffff;
}

.zoom-btn--active {
  background: #6cbfdf;
  color: #ffffff;
  font-weight: 600;
}

.zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0 0.25rem;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1aa5da;
  cursor: pointer;
}

.zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1aa5da;
  cursor: pointer;
  border: none;
}

.zoom-toolbar__separator {
  width: 1px;
  height: 20px;
  background: #ccc;
  margin: 0 0.4rem;
}

/* Roadmap Display Modes */

[data-display-mode="brief"] .deal-task-card__field-row--needs-attention-toggle,
[data-display-mode="brief"] .deal-task-card__field-row--needs-attention-reason,
[data-display-mode="brief"] .deal-task-card__field-row--notes,
[data-display-mode="brief"] .deal-task-card__field-row--doc-required,
[data-display-mode="brief"] .deal-task-card__field-row--estimated-completion-date,
[data-display-mode="brief"] .deal-task-card__field-row--assigned-user,
[data-display-mode="brief"] .deal-task-card__field-row--assigned-client,
[data-display-mode="brief"] .deal-task-card__field-row--assigned-lender,
[data-display-mode="brief"] .deal-task-card__vendor-section,
[data-display-mode="brief"] .deal-task-card__documents,
[data-display-mode="brief"] .deal-task-card__signing,
[data-display-mode="brief"] .deal-task-card__send-for-signing,
[data-display-mode="brief"] .deal-task-card__expand-toggle,
[data-display-mode="brief"] .deal-task-card__expandable {
  display: none !important;
}

[data-display-mode="brief"] .deal-task-card__field-label {
  display: none;
}

[data-display-mode="brief"] .deal-task-card__fields {
  gap: 4px;
}

/* Deal Builder */

.deal-builder {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 42px;
  gap: 0;
  min-width: min-content;
}

.deal-builder--loading {
  visibility: hidden;
}

.deal-builder__phases {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.deal-builder__phases-list {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Deal Phase */

.deal-phase-block {
  width: max-content;
  min-width: 240px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #e4e4e4;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.40);
}

.deal-phase-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #5d5d5d;
  border-bottom: 1px solid #ddd;
  border-radius: 6px 6px 0 0;
  color: white;
}
.deal-phase-header--construction {
  background: #fdbd41;
  color: #513a0d;
}

.deal-phase-header__actions {
  position: relative;
}

.deal-phase-header__actions .dropdown-menu {
  top: 22px;
}

.deal-phase-header__name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 1.4rem;
}

.deal-phase-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.deal-phase-add-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.deal-phase-add-row .dropdown {
  position: relative;
}

.deal-phase-add-row .dropdown-menu {
  top: 100%;
  left: 0;
  max-width: 320px;
  max-height: 40vh;
  overflow-y: auto;
  white-space: normal;
  word-break: break-word;
}

.deal-phase-connector {
  text-align: center;
  font-size: 2.4rem;
  color: #888;
  padding: 1.2rem 0;
  width: 100%;
}

/* Deal Sequence Row */

.deal-sequence-row {
  display: flex;
  flex-direction: column;
}

.deal-sequence-row__items {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.deal-sequence-row__add {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-top: 5px;
}

.deal-sequence-row__add .dropdown-menu {
  top: calc(2.5rem + 3px);
  left: 0;
}

.deal-sequence-row-connector {
  text-align: center;
  font-size: 1.2rem;
  color: #888;
  padding: 0.1rem 0;
}

/* Deal Task Card */

.deal-task-card {
  position: relative;
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  width: 190px;
  min-width: 190px;
  max-height: max-content;
  flex: 0 0 190px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin: 2px 14px 14px 5px;
}

.deal-task-card__actions {
  position: relative;
}

.deal-task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0px 0px 8px 0px;
}

.deal-task-card__name {
  font-weight: 600;
  font-size: 0.85rem;
  flex: 1;
}

.deal-task-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.deal-task-card__assignee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  font-size: 0.8rem;
  padding: 0 14px;
  border-radius: 4px;
  background: #e8e8e8;
  color: #444;
  white-space: nowrap;
  box-sizing: border-box;
  min-width: 10rem;
}

.deal-task-card__assignee--admin    { background: #00afa6; color: #ffffff; }
.deal-task-card__assignee--client   { background: #48a8ec; color: #ffffff; }
.deal-task-card__assignee--vendor   { background: #ffcf0d; color: #000000; }
.deal-task-card__assignee--lender   { background: #8462b9; color: #ffffff; }
.deal-task-card__assignee--construction_manager { background: #e38c0b; color: #ffffff; }

.deal-task-card__assigned-vendor-type {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
}

.deal-task-card__deal-client,
.deal-group-task__deal-client {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 4px;
  background: #919191;
  color: #ffffff;
  margin: 8px 0px 8px 0px;
}

.deal-task-card__assigned-vendor,
.deal-group-task__assigned-vendor {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 4px;
  background: #919191;
  color: #ffffff;
  margin: 8px 0px 8px 0px;
}

.deal-task-card__assigned-user,
.deal-group-task__assigned-user {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 4px;
  background: #f2f2f2;
  color: #4a4a4a;
  margin: 8px 0px 8px 0px;
}

.deal-task-card__doc-required {
  font-size: 0.9rem;
}

.deal-task-card__locked {
  font-size: 0.9rem;
}

.deal-task-card__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.deal-task-card__due-date,
.deal-group-task__due-date {
  font-size: 0.85rem;
  color: #666;
  margin: 0px 0px 6px 3px;
}

.deal-task-card__notes {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.4rem;
  font-style: italic;
  white-space: pre-wrap;
}

/* Inline editing — name input in header */

textarea.deal-task-card__name-input {
  flex: 1;
  border: none;
  background-color: transparent;
  background-image: none;
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  padding: 0;
  margin: 0;
  outline: none;
  min-width: 0;
  color: inherit;
  width: 100%;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  box-sizing: border-box;
}

textarea.deal-task-card__name-input:hover,
textarea.deal-task-card__name-input:focus {
  background-color: transparent;
  background-image: none;
  border: none;
  outline: none;
}

/* Always-visible fields container */

.deal-task-card__fields {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.4rem;
  width: 100%;
}

.deal-task-card__field-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.deal-task-card__field-row--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.deal-task-card__field-label {
  display: block;
  font-size: 0.62rem;
  color: #484848;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 2px 0px 0px 0px;
}

.deal-task-card__needs-attention-label {
  display: block;
  margin: 9px 0px 8px 0px;
  font-size: 0.85rem;
}

/* Selects inside the card */

.deal-task-card__select,
.deal-task-card__input {
  width: 100%;
  min-width: 0;
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f3f3f3;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.deal-task-card__select:hover,
.deal-task-card__input:hover {
  border-color: #bbb;
  background: rgba(255, 255, 255, 0.6);
}

.deal-task-card__select:focus,
.deal-task-card__input:focus {
  border-color: #888;
  background: #fff;
  outline: none;
}

.deal-task-card__readonly-value {
  width: 100%;
  min-width: 0;
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f3f3f3;
  color: inherit;
  box-sizing: border-box;
  margin-bottom: 1rem;
}



/* Portal assign-to inline form */

.inline-assign-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}

.inline-select {
  width: 100%;
  min-width: 0;
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #f3f3f3;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
  margin: 0;
}

.inline-select:hover {
  border-color: #bbb;
  background: rgba(255, 255, 255, 0.6);
}

.inline-select:focus {
  border-color: #888;
  background: #fff;
  outline: none;
}

/* Date input — override Chrome's internal spin-box sizing */

input[type="date"].deal-task-card__input {
  width: 100%;
  margin: 0px 0px 14px 0px;
  font-size: 0.72rem;
  padding: 3px 4px;
}

/* Date input calendar picker icon */

input[type="date"].deal-task-card__input::-webkit-calendar-picker-indicator {
  opacity: 1;
  cursor: pointer;
  filter: invert(40%);
  font-size: 1rem;
  padding: 0;
}

/* Vendor type select */

.deal-task-card__select--vendor-type,
.deal-task-card__select--vendor-type:focus {
  background: #fceba8;
  color: #000;
  border: none;
}

.deal-task-card__select--vendor-type:hover {
  background: #f5df7e;
  border-color: transparent;
}

/* Guided task select — subtle differentiation */

.deal-task-card__select--guided {
  font-size: 0.75rem;
  color: #666;
}

/* Textarea */

.deal-task-card__textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 4px 6px;
  border: 1px solid #bfe1ff;
  border-radius: 2px;
  background: linear-gradient(163deg, rgb(195 226 255 / 50%), 66%, rgb(108 182 255 / 50%));
  resize: none;
  box-shadow: 2px 4px 6px 0px rgb(195 195 195);
  box-sizing: border-box;
  height: 88px;
}

.deal-task-card__textarea:focus {
  border-color: #bfe1ff;
  background: linear-gradient(163deg, rgb(195 226 255 / 50%), 66%, rgb(108 182 255 / 50%));
  outline: none;
}

.deal-task-card__textarea--needs-attention:focus {
  border-color: #ffb2b2;
  background: linear-gradient(163deg, rgb(255 178 178 / 50%), 66%, rgb(255 110 100 / 50%));
}

.deal-task-card__textarea--needs-attention {
  border-color: #ffb2b2;
  background: linear-gradient(163deg, rgb(255 178 178 / 50%), 66%, rgb(255 110 100 / 50%));
}

/* Expand toggle */

.deal-task-card__expand-toggle {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 3px 0;
  background: none;
  border: none;
  border-top: 1px solid #ddd;
  font-size: 0.75rem;
  color: #888;
  cursor: pointer;
  text-align: center;
}

.deal-task-card__expand-toggle:hover {
  color: #444;
}

/* Expandable section */

.deal-task-card__expandable {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.4rem;
}

.deal-task-card__expandable--open {
  display: flex;
}

.deal-task-card__expandable .phase-client-settings {
  margin-left: 0;
  margin-right: 0;
}

.deal-task-card__textarea--client-description {
  height: auto;
  min-height: 48px;
  box-shadow: none;
  background: #f3f3f3;
  border-color: transparent;
}

/* Documents button */

.deal-task-card__documents-btn {
  display: inline-flex;
  align-items: center;
  background-color: #ececec;
  color: #027dc5;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 8px 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

.deal-task-card__documents-btn:hover {
  background-color: #dcdcdc;
}

/* My Tasks screen — card wrapper around each deal's badge + task table,
   same border/dropshadow/background treatment as .update-entry. */
.my-tasks__deal-group {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.22);
  background-color: #ffffff;
  margin-bottom: 1.5rem;
}

/* Road Map button (My Tasks screen) — same size/shape as the Documents
   button next to it, but green/white per the brand accent color used
   elsewhere (phase headers, dashboard deal cards). */
.my-tasks__road-map-btn {
  display: inline-flex;
  align-items: center;
  background-color: #479256;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 8px 4px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.my-tasks__road-map-btn:hover {
  background-color: #3d7d49;
}

.my-tasks__add-update-btn {
  display: inline-flex;
  align-items: center;
  background-color: #3a7bd5;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  margin: 8px 4px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.my-tasks__add-update-btn:hover {
  background-color: #2f67b8;
}

/* Vendor type browser (reused inside card) */

.deal-task-card__vendor-type-wrap {
  position: relative;
  margin-bottom: 2px;
}

.deal-task-card__vendor-type-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.deal-task-card__vendor-browse-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  color: #666;
  padding: 0px 1px 12px 0px;
  line-height: 1;
}

.deal-task-card__vendor-browse-panel {
  margin-bottom: 4px;
}

.deal-task-card__vendor-search {
  width: 100%;
  margin-bottom: 4px;
  font-size: 0.8rem;
  padding: 3px 5px;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-sizing: border-box;
}

.deal-task-card__vendor-browser {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85em;
  background: #fff;
}

/* Task Status Badge */

.deal-task-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  margin: 8px 0px 10px 0px;
}

.deal-task-status--not_started { background: #f3f4f6; color: #6b7280; }
.deal-task-status--in_progress { background: #dcfce7; color: #093f1d; }
.deal-task-status--complete    { background: #2faa59; color: #ffffff; }
.deal-task-status--locked      { background: #fef3c7; color: #92400e; }

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.65rem;
  border-radius: 4px;
  min-width: 6.9rem;
  box-sizing: border-box;
  white-space: nowrap;
}

.status-badge--not_started { background: #f3f4f6; color: #6b7280; border: solid 1px #0cc048; }
.status-badge--pending     { background: #ffda43; color: #7c6106; }
.status-badge--in_progress { background: #dcfce7; color: #093f1d; }
.status-badge--complete    { background: #2faa59; color: #ffffff; }
.status-badge--locked      { background: #fef3c7; color: #92400e; }
.status-badge--blocked     { background: #fee2e2; color: #991b1b; }
.status-badge--fulfilled   { background: #dcfce7; color: #093f1d; }
.status-badge--proactive   { background: #e0ecfb; color: #1e3a5f; }

.invite-sent-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  margin: 8px 4px;
  font-size: 1.1rem;
  font-weight: normal;
  border-radius: 4px;
}
.status-badge--required    { background: #fee2e2; color: #991b1b; }

/* Deal Group Box */

.deal-group-box {
  border-radius: 6px;
  min-width: 180px;
  flex: 0 0 auto;
  background: #d7d7d7;
  margin: 0px 14px 14px 5px;
  border: solid 2px #c7c7c7;
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}

/* Alternating background colors for nested group levels */
.deal-group-box--depth-1,
.deal-group-box--depth-3,
.deal-group-box--depth-5,
.deal-group-box--depth-7,
.deal-group-box--depth-9 {
  background: #e7e7e7;
}

.deal-group-box--depth-2,
.deal-group-box--depth-4,
.deal-group-box--depth-6,
.deal-group-box--depth-8,
.deal-group-box--depth-10 {
  background: #d7d7d7;
}

.deal-group-box__actions {
  position: relative;
}

.deal-group-box__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: #efefef;
  border-bottom: 1px solid #ddd;
  border-radius: 4px 4px 0 0;
  font-weight: 600;
  font-size: 0.85rem;
}

.deal-group-box__name {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

textarea.deal-group-box__name-input {
  flex: 1;
  border: none;
  background-color: transparent;
  background-image: none;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0;
  margin: 0;
  outline: none;
  min-width: 0;
  color: inherit;
  width: 100%;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  box-sizing: border-box;
}

textarea.deal-group-box__name-input:hover,
textarea.deal-group-box__name-input:focus {
  background-color: transparent;
  background-image: none;
  border: none;
  outline: none;
}

.deal-group-box > turbo-frame {
  display: block;
  padding: 0.2rem;
}

.deal-group-box__tasks {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  flex-wrap: wrap;
  min-height: 52px;
  justify-content: center;
}

.deal-group-box--sequential > .deal-group-box__tasks {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}

/* CSS connector arrows between sequential group children */
.deal-group-box--sequential > .deal-group-box__tasks > * + * {
  position: relative;
  margin-top: 1.6rem;
}

.deal-group-box--sequential > .deal-group-box__tasks > * + *::before {
  content: "↓";
  position: absolute;
  top: -1.9rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.2rem;
  color: #888;
  height: 1.4rem;
  line-height: 1.4rem;
}

.deal-group-box--parallel > .deal-group-box__tasks {
  flex-direction: row;
}

/* Deal Group Task */

.deal-group-task {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.4rem 0.5rem 0.8rem 0.5rem;
  font-size: 0.85rem;
  width: 190px;
  min-width: 190px;
  height: max-content;
  box-sizing: border-box;
  margin: 3px 0px 0px 0px;
}

.deal-group-task__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.3rem;
  margin: 0px 0px 8px 0px;
}

.deal-group-task__actions {
  position: relative;
}

.deal-group-task__name {
  font-weight: 500;
  flex: 1;
}

.deal-group-task__meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.deal-group-task__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}


/* =====================================================
   Deal Calendar
   ===================================================== */

.deal-calendar-page {
  padding: 1.5rem 2rem;
}

/* Toolbar: toggle + month nav */

.deal-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.deal-calendar-toggle {
  display: flex;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.deal-calendar-toggle__btn {
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  text-decoration: none;
  color: #444;
  background: #fff;
}

.deal-calendar-toggle__btn + .deal-calendar-toggle__btn {
  border-left: 1px solid #ccc;
}

.deal-calendar-toggle__btn--active {
  background: #1aa5da;
  color: #fff;
  font-weight: 600;
}

.deal-calendar-toggle__btn:hover:not(.deal-calendar-toggle__btn--active) {
  background: #f0f0f0;
}

.deal-calendar-month-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.deal-calendar-month-nav__btn {
  padding: 0.3rem 0.7rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-decoration: none;
  color: #444;
  font-size: 1rem;
  line-height: 1;
}

.deal-calendar-month-nav__btn:hover {
  background: #f0f0f0;
}

.deal-calendar-month-nav__title {
  font-weight: 600;
  font-size: 1rem;
  min-width: 130px;
  text-align: center;
}

/* Share panel */

.cal-share-panel {
  background: #f7f9fb;
  border: 1px solid #dce3ea;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 2.5rem;
}

.cal-share-panel__header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cal-share-panel__note {
  font-size: 0.85rem;
  color: #666;
}

.cal-share-panel__url-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cal-share-panel__url-input {
  flex: 1;
  font-size: 0.82rem;
  font-family: monospace;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #333;
  cursor: text;
}

.cal-share-panel__google-note {
  font-size: 0.85rem;
  color: #555;
}

.cal-share-panel__regenerate {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid #e0e6ec;
  margin-top: 0.1rem;
}

.cal-share-panel__regenerate-note {
  font-size: 0.82rem;
  color: #888;
}

/* Legend */

.deal-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.cal-legend-item {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 10px;
}

.cal-legend-item--deal_date   { background: #1aa5da; color: #fff; }
.cal-legend-item--admin_task  { background: #00afa6; color: #fff; }
.cal-legend-item--client_task { background: #48a8ec; color: #fff; }
.cal-legend-item--vendor_task { background: #ffcf0d; color: #000; }
.cal-legend-item--lender_task { background: #8462b9; color: #fff; }
.cal-legend-item--construction_manager_task { background: #e38c0b; color: #fff; }

/* Overview: multi-month grid */

.deal-calendar-overview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.deal-calendar-month-wrap {
  min-width: 0;
}

/* In overview mode hide the simple-calendar prev/today/next nav */
.deal-calendar-overview .calendar-heading nav {
  display: none;
}

/* Single month */

.deal-calendar-single {
  max-width: 800px;
}

/* simple-calendar base styles */

.simple-calendar .calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f5f7fa;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.simple-calendar .calendar-heading nav {
  display: flex;
  gap: 0.4rem;
}

.simple-calendar .calendar-heading nav a {
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-decoration: none;
  color: #444;
  background: #fff;
}

.simple-calendar .calendar-heading nav a:hover {
  background: #f0f0f0;
}

.simple-calendar table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.simple-calendar thead th {
  background: #f0f2f5;
  border: 1px solid #ddd;
  padding: 0.35rem 0.25rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
}

.simple-calendar td.day {
  border: 1px solid #ddd;
  padding: 0.35rem 0.3rem;
  vertical-align: top;
  height: 76px;
  background: #fff;
  overflow: hidden;
}

.simple-calendar td.prev-month,
.simple-calendar td.next-month {
  background: #f8f8f8;
}

.simple-calendar td.prev-month .cal-day-number,
.simple-calendar td.next-month .cal-day-number {
  color: #bbb;
}

.simple-calendar td.today {
  background: #eff8ff;
}

.simple-calendar td.today .cal-day-number {
  color: #1aa5da;
  font-weight: 700;
}

.cal-day-number {
  font-size: 0.78rem;
  color: #999;
  margin-bottom: 0.15rem;
  line-height: 1;
}

/* Calendar event chips */

.cal-event {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  margin-bottom: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  display: block;
  text-decoration: none;
  opacity: 1;
}

.cal-event:hover {
  opacity: 0.82;
}

.cal-event--deal_date   { background: #1aa5da; color: #fff; }
.cal-event--admin_task  { background: #00afa6; color: #fff; }
.cal-event--client_task { background: #48a8ec; color: #fff; }
.cal-event--vendor_task { background: #ffcf0d; color: #000; }
.cal-event--lender_task { background: #8462b9; color: #fff; }
.cal-event--construction_manager_task { background: #e38c0b; color: #fff; }

/* Hover tooltip */

.cal-event[data-tooltip] {
  cursor: pointer;
}

.cal-event[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 400;
  white-space: normal;
  width: 220px;
  z-index: 300;
  pointer-events: none;
  line-height: 1.4;
}

/* =====================================================
   Deal Overview
   ===================================================== */

.deal-overview-page {
  padding: 0 0 2rem;
}

.deal-overview-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.deal-overview-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.deal-overview-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.deal-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.deal-overview-section {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.1rem 1.25rem;
}

.deal-overview-section__header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  margin-bottom: 0.9rem;
}

/* Progress section */

.deal-overview-progress__pct {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.deal-overview-progress__bar {
  margin-bottom: 0.5rem;
}

.deal-overview-progress__tasks {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 0.25rem;
}

.deal-overview-progress__days {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0.5rem;
}

.deal-overview-progress__date {
  font-size: 0.85rem;
  color: #555;
}

/* Current Stage section */

.deal-overview-phase__name {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.35rem;
}

.deal-overview-phase__sub {
  font-size: 0.875rem;
  color: #666;
}

.deal-overview-phase__complete {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2faa59;
}

/* Key Metrics */

.deal-overview-metrics {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.deal-overview-metric {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 100px;
}

.deal-overview-metric__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
}

.deal-overview-metric__value--overdue {
  color: #dc2626;
}

.deal-overview-metric__label {
  font-size: 0.78rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Phase context label */

.deal-overview-phase-context {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
}

/* Waiting On / task tree */

.deal-overview-tree {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.deal-overview-task-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  background: #f9f9f9;
  border: 1px solid #eee;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.deal-overview-task-row:hover {
  background: #eef4ff;
  border-color: #c0d8ff;
}

.deal-overview-task-row--needs-attention:hover {
  background: #ffc7c7;
  border-color: #ffb5c6;
}

.deal-overview-task-row--overdue {
  border-left: 3px solid #dc2626;
}

@keyframes deal-task-card-highlight-pulse {
  0%, 100% { outline-color: transparent; }
  50% { outline-color: #3a7bd5; }
}

.deal-task-card--anchor-highlight {
  outline: 3px solid transparent;
  outline-offset: -2px;
  animation: deal-task-card-highlight-pulse 1.75s ease-in-out 4;
}

.deal-overview-task-row__name {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a1a1a;
}

.deal-overview-task-row__due {
  font-size: 0.8rem;
  color: #666;
}

.deal-overview-task-row__due--overdue {
  color: #dc2626;
  font-weight: 600;
}

.deal-overview-task-row__phase {
  font-size: 0.75rem;
  color: #888;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 2px 7px;
}

/* Group nesting */

.deal-overview-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.deal-overview-group__name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0;
}

.deal-overview-group__children {
  padding-left: 1rem;
  border-left: 2px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Empty state */

.deal-overview-empty {
  font-size: 0.9rem;
  color: #999;
  margin: 0;
}

/* Document sidebar */

.deal-overview-doc-phase {
  margin-bottom: 1.1rem;
}

.deal-overview-doc-phase:last-child {
  margin-bottom: 0;
}

.deal-overview-doc-phase__name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
}

.deal-overview-doc-group {
  margin: 0.4rem 0;
}

.deal-overview-doc-group__name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
  margin-bottom: 0.25rem;
}

.deal-overview-doc-group__children {
  padding-left: 0.65rem;
  border-left: 2px solid #eee;
}

.deal-overview-doc-task {
  margin-bottom: 0.5rem;
}

.deal-overview-doc-task__name {
  font-size: 0.82rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 0.2rem;
}

.deal-overview-doc-file {
  padding: 0.1rem 0 0.1rem 0.6rem;
}

.deal-overview-doc-link {
  font-size: 0.78rem;
  color: #1aa5da;
  text-decoration: none;
  word-break: break-all;
}

.deal-overview-doc-link:hover {
  text-decoration: underline;
}

.deal-overview-doc-link--signed {
  color: #2faa59;
}

/* Recent Developments timeline (reuses .activity-timeline classes) */

.deal-overview-timeline {
  margin-top: 0;
  margin-bottom: 0.75rem;
  max-width: none;
}

.deal-overview-timeline-footer {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.deal-overview-timeline-footer a {
  color: #1aa5da;
  text-decoration: none;
}

.deal-overview-timeline-footer a:hover {
  text-decoration: underline;
}

/* =====================================================
   Signing — Status Badges
   ===================================================== */

.signing-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: capitalize;
}

.signing-status-badge--pending     { background: #e8e8e8; color: #555; }
.signing-status-badge--in_progress { background: #fff3cd; color: #856404; }
.signing-status-badge--complete    { background: #d4edda; color: #155724; }
.signing-status-badge--declined    { background: #f8d7da; color: #721c24; }
.signing-status-badge--expired     { background: #f0f0f0; color: #888; }

.signing-signer-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.signing-signer-status-badge--awaiting { background: #fff3cd; color: #856404; }
.signing-signer-status-badge--signed   { background: #d4edda; color: #155724; }
.signing-signer-status-badge--declined { background: #f8d7da; color: #721c24; }

/* =====================================================
   Signing — Deal Task Card
   ===================================================== */

.deal-task-card__signing {
  border-top: 1px solid #eee;
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deal-task-card__signer-line {
  font-size: 0.78rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
}

.deal-task-card__signing-link {
  font-size: 0.78rem;
  color: #3a7bd5;
  text-decoration: none;
}

.deal-task-card__signing-link:hover {
  text-decoration: underline;
}

.deal-task-card__send-for-signing {
  display: inline-block;
  font-size: 0.78rem;
  color: #36ac76;
  text-decoration: none;
  font-weight: 600;
  margin: 2px 0px 0px 5px;
}

.deal-task-card__send-for-signing:hover {
  text-decoration: underline;
}

/* =====================================================
   Signing — New Form Page
   ===================================================== */

.signing-form-page {
  max-width: 700px;
  padding: 24px 0;
}

.signing-form-task-info {
  font-size: 1rem;
  color: #555;
  margin-bottom: 24px;
}

.signing-form-section {
  margin-bottom: 20px;
}

.signing-inline-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.signing-inline-note {
  display: block;
  font-size: 0.85rem;
  color: #777;
  margin-top: 4px;
}

.signing-signers-section h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.signer-row {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: #fafafa;
}

.signer-row__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.signer-row__remove {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
}

.signer-row__remove:hover {
  text-decoration: underline;
}

.signer-row__signing-as {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.signer-row__signing-as-label {
  font-size: 0.95rem;
  color: #444;
}

.signer-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.95rem;
  cursor: pointer;
  margin: 0;
}

.signing-add-signer-btn {
  display: inline-block;
  background: none;
  border: 1px dashed #3a7bd5;
  color: #3a7bd5;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: 20px;
}

.signing-add-signer-btn:hover {
  background: #f0f6ff;
}

.signing-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
}

/* =====================================================
   Signing — Show Page
   ===================================================== */

.signing-show-page {
  max-width: 700px;
  padding: 24px 0;
}

.signing-show-meta {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px 24px;
  background: #fafafa;
  margin-bottom: 28px;
}

.signing-show-meta__row {
  padding: 6px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.signing-show-meta__row:last-child {
  border-bottom: none;
}

.signing-show-signers h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.signing-signer-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 10px;
  background: #fff;
}

.signing-signer-row__order {
  font-size: 0.85rem;
  font-weight: 700;
  color: #888;
  min-width: 24px;
  padding-top: 2px;
}

.signing-signer-row__info {
  flex: 1;
}

.signing-signer-row__name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.signing-signer-row__email {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 2px;
}

.signing-signer-row__business {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 2px;
}

.signing-signer-row__signing-as {
  font-size: 0.8rem;
  color: #999;
}

.signing-signer-row__status {
  text-align: right;
  min-width: 90px;
}

.signing-signer-row__signed-at {
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}

/* ── Needs Attention ── */

.deal-task-card--needs-attention {
  position: relative;
}

.deal-task-card--needs-attention::after {
  content: "!";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  background: #e53e3e;
  color: #fff;
  border-radius: 50%;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  z-index: 50;
  pointer-events: none;
}

.deal-overview-section--needs-attention {
  border: 2px solid #e53e3e;
  background: #fff5f5;
}

.deal-overview-task-row__reason {
  font-size: 0.78rem;
  font-weight: 600;
  color: #c53030;
  background: #fed7d7;
  border-radius: 3px;
  padding: 2px 6px;
}

.deal-overview-task-row__note {
  font-size: 0.78rem;
  color: #555;
  font-style: italic;
}

/* ── Contact popover ─────────────────────────────────── */
.contact-display { margin-top: 4px; margin-bottom: 10px; }
.contact-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #aaa;
  margin-bottom: 5px;
}
.contact-popover-wrap {
  position: relative;
  display: inline-block;
}
.contact-trigger {
  font-size: 0.82rem;
  color: #555;
  cursor: default;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.contact-popover {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  z-index: 2000;
  padding: 14px 12px 10px;
  min-width: 200px;
  white-space: nowrap;
}
.contact-popover--visible { display: block; }
.contact-popover__name {
  font-weight: 600;
  font-size: 0.8rem;
  color: #222;
  margin-bottom: 2px;
}
.contact-popover__phone {
  font-size: 0.72rem;
  color: #666;
  margin-bottom: 2px;
}
.contact-popover__email {
  font-size: 0.72rem;
  color: #666;
  margin-bottom: 8px;
}
.contact-popover__divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 8px 0;
}
.contact-popover__section-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #aaa;
  margin-bottom: 4px;
}
.contact-popover__actions { display: flex; gap: 6px; }
.contact-popover__btn {
  font-size: 0.7rem;
  padding: 3px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f8f8f8;
  color: #333;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  display: inline-block;
}
.contact-popover__btn:hover { background: #eee; border-color: #bbb; }

/* Team member profile popup — email value truncates with an ellipsis
   instead of overflowing/wrapping the card when it's too long to fit.
   Truncation (overflow: hidden) and the tooltip's positioning anchor are
   deliberately on two different elements — overflow: hidden clips any
   absolutely-positioned child/pseudo-element too, including one meant to
   pop out beyond the element's own box, so the :hover::after tooltip below
   lives on the non-clipping wrapper instead. */
.profile-modal-email-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.profile-modal-email {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Custom hover tooltip showing the untruncated address — built with plain
   CSS (attr()) rather than the native title="" tooltip, which this replaces,
   so it appears instantly and matches the app's own tooltip styling. */
.profile-modal-email-wrap:hover::after {
  content: attr(data-full-email);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  background: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
}

/* Small green checkmark that appears next to "Copy Email" on click, then
   fades out after 3s (timing/removal handled in email_copy_controller.js). */
.email-copy-check {
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.email-copy-check--visible {
  opacity: 1;
}

/* Toast */
.contact-popover-toast {
  position: fixed;
  transform: translateX(-50%) translateY(4px);
  background: #333;
  color: #fff;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 0.82rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.contact-popover-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   Estimator Button & Modals
   ===================================================== */

a.button-link-estimator,
button.button-link-estimator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ff972e;
  color: #fff;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0;
  font-size: 1.1rem;
  cursor: pointer;
}

a.button-link-estimator:hover,
button.button-link-estimator:hover {
  background-color: #e8851f;
  color: #fff;
}

.estimator-unlink-btn {
  background: #dc8328;
  border: none;
  border-radius: 0px 4px 4px 0px;
  padding: 8px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0px 8px -10px;
}

.estimator-unlink-btn:hover {
  background: #c4721f;
}

.estimator-unlink-btn svg {
  display: block;
}

dialog.estimator-connect-modal,
dialog.estimator-unlink-modal {
  border: none;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.22);
  max-width: 95vw;
}

dialog.estimator-connect-modal {
  width: 420px;
}

dialog.estimator-unlink-modal {
  width: 380px;
}

dialog.estimator-connect-modal::backdrop,
dialog.estimator-unlink-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.estimator-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.estimator-modal-divider {
  text-align: center;
  color: #aaa;
  font-size: 0.85rem;
  padding: 8px 0;
  border-top: 1px solid #eee;
  margin-top: 8px;
}

.estimator-modal-name-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
}

.estimator-modal-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

.estimator-modal-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}

.estimator-modal-create-btn {
  width: 100%;
  margin-top: 2px;
  justify-content: center;
}

.estimator-modal-link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.estimator-modal-unavailable {
  font-size: 0.82rem;
  color: #b45309;
  font-style: italic;
}

dialog.estimator-connect-modal .modal-header,
dialog.estimator-unlink-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

dialog.estimator-connect-modal .modal-header h3,
dialog.estimator-unlink-modal .modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

dialog.estimator-connect-modal .modal-close-btn,
dialog.estimator-unlink-modal .modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 2px;
}

dialog.estimator-connect-modal .modal-close-btn:hover,
dialog.estimator-unlink-modal .modal-close-btn:hover {
  color: #111;
}

dialog.estimator-connect-modal .modal-body,
dialog.estimator-unlink-modal .modal-body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

dialog.estimator-unlink-modal .modal-body p {
  margin: 0;
  color: #374151;
}

dialog.estimator-unlink-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* Deal/project Team grid */

.team-btn-icon {
  margin-right: 6px;
  vertical-align: -2px;
  flex-shrink: 0;
}

.team-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 3px;
}

.team-grid__member {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 160px;
  min-height: 120px;
  padding: 8px;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
}

.team-grid__member-name {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-grid__member:hover {
  color: #1a1a1a;
  background-color: #ccc;
  border-radius: 5px;
}

.team-grid__member:hover .team-grid__member-name {
  text-decoration: underline;
}

.team-grid__member-role {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: #e8e8e8;
  color: #444;
}

.team-grid__member-role--admin    { background: #00afa6; color: #ffffff; padding: 4px 8px; }
.team-grid__member-role--client   { background: #48a8ec; color: #ffffff; padding: 4px 8px; }
.team-grid__member-role--vendor   { background: #ffcf0d; color: #000000; padding: 4px 8px; }
.team-grid__member-role--lender   { background: #8462b9; color: #ffffff; padding: 4px 8px; }
.team-grid__member-role--construction_manager { background: #e38c0b; color: #ffffff; padding: 4px 8px; }

.team-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #eee;
}

.team-member-row:last-child {
  border-bottom: none;
}

.team-member-row__profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.team-member-row__name {
  flex: 1;
}

.team-member-row__remove-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  color: inherit;
}

button.team-member-row__remove {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 6px;
  background: #f2f2f2;
  color: #c0392b;
  cursor: pointer;
  flex-shrink: 0;
}

.team-member-row__remove svg {
  display: block;
  pointer-events: none;
}

button.team-member-row__remove:hover {
  background: #fbeaea;
  color: #a93226;
}

dialog.document-modal.remove-team-member-modal {
  width: 420px;
  min-height: 0;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

dialog.document-modal.remove-team-member-modal .document-modal__header {
  padding: 10px 16px 8px;
}

.remove-team-member-modal__actions {
  padding: 8px 16px 16px;
  display: flex;
  gap: 10px;
}
/* Form element styles */

label {
  display: block;
  margin: 16px 0px 8px 0px;
}

label + input,
label + textarea,
label + select {
  display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
  border: none;
  border-radius: 4px;
  background-color: #f2f2f2;
  background-image: radial-gradient(ellipse at center, #f2f2f2 40%, #e6e6e6 100%);
  color: #444444;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.5;
  box-sizing: border-box;
  outline: none;
  margin: 4px 4px 18px 0px;
  width: 360px;
}

/* Password field with a show/hide "eye" toggle pinned to the right end.
   Spacing normally carried by the input's own margin moves to the wrapper
   instead, so the toggle button can be absolutely positioned against an
   input box with no margin of its own. */
.password-field {
  position: relative;
  display: inline-block;
  margin: 4px 4px 18px 0px;
}

.password-field input[type="password"],
.password-field input[type="text"] {
  margin: 0;
  padding-right: 44px;
  width: 360px;
}

.password-field__toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.password-field__icon {
  width: 20px;
  height: 20px;
  opacity: 0.55;
}

.password-field__toggle:hover .password-field__icon {
  opacity: 0.9;
}

button.btn-cancel {
  background-color: #d0d0d0;
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.btn-cancel:hover {
  background-color: #b8b8b8;
}

input[type="submit"],
button[type="submit"] {
  background-color: #3a7bd5;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  background-color: #2f67b8;
}

a.button-link-manage,
button.button-link-manage {
  display: inline-flex;
  align-items: center;
  background-color: #3a7bd5;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

a.button-link-manage:hover,
button.button-link-manage:hover {
  background-color: #2f67b8;
}

button.button-link-submit {
  display: inline-flex;
  align-items: center;
  background-color: #3a7bd5;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.button-link-submit:hover {
  background-color: #2f67b8;
}

a.button-link-cancel,
button.button-link-cancel {
  display: inline-flex;
  align-items: center;
  background-color: #e1e1e1;
  color: #1a1a1a;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

a.button-link-cancel:hover,
button.button-link-cancel:hover {
  background-color: #858585;
  color: white;
}

a.button-link-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #36ac76;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 4px;
  font-size: 1.1rem;
  cursor: pointer;
  min-width: 50px;
}

a.button-link-edit--wide {
  min-width: 86px;
}

a.button-link-edit:hover,
button.button-link-edit:hover {
  background-color: #2d9464;
}

button.button-link-edit {
  display: inline-flex;
  align-items: center;
  background-color: #36ac76;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.button-send-invite {
  display: inline-flex;
  align-items: center;
  background-color: #696969;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.button-send-invite:hover {
  background-color: #595959;
}

button.button-link-add-new-type-2 {
  display: inline-flex;
  align-items: center;
  background-color: #36ac76;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 16px;
  margin: 8px 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.button-link-add-new-type-2:hover {
  background-color: #2d9464;
}

a.button-link-view {
  display: inline-flex;
  align-items: center;
  background-color: #5e5e5e;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

a.button-link-view:hover {
  background-color: #444444;
}

button.button-delete {
  display: inline-flex;
  align-items: center;
  background-color: #c0392b;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.button-delete:hover {
  background-color: #a93226;
}

a.button-link-danger {
  display: inline-flex;
  align-items: center;
  background-color: #c0392b;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

a.button-link-danger:hover {
  background-color: #a93226;
}

a.button-link-add-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #3a7bd5;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

a.button-link-add-new:hover {
  background-color: #2f67b8;
}

a.button-link-add-new img {
  width: 18px;
  height: 18px;
}

/* Delivery item blocks */

.delivery-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 20px;
  background-color: #fafafa;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.32);
}

.delivery-item__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #555555;
  color: white;
  font-size: 0.9rem;
  font-weight: bold;
  margin: 0px 6px 0px 0px;
}

.delivery-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-weight: bold;
  font-size: 1.05rem;
}

.delivery-item__remove {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
}

.delivery-item__remove:hover {
  text-decoration: underline;
}

.delivery-item__divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 16px 0 4px;
}

.delivery-item__items {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.delivery-item__items input[type="number"] {
  width: 120px;
}

.delivery-item__cost {
}

.order-total__divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 20px 0 0;
}

.order-total {
  margin: 16px 0 8px;
}

.order-total__label {
  display: block;
  font-size: 1.1rem;
  color: #444444;
}

.order-total__value {
  display: inline-block;
  font-size: 2rem;
  font-weight: bold;
  color: #1a1a1a;
  margin-top: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  padding: 10px 20px;
  min-width: 240px;
  text-align: left;
}

.delivery-item__cost-value {
  display: block;
  font-size: 1.8rem;
  font-weight: bold;
  color: #1a1a1a;
  margin-top: 4px;
}

/* Pickup + Dropoff side-by-side layout */

.delivery-locations {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.delivery-location-col {
  flex: 1;
  min-width: 0;
}

.delivery-location-col .location-preview {
  width: 100%;
  box-sizing: border-box;
}

.delivery-location-col input[type="text"],
.delivery-location-col input[type="datetime-local"],
.delivery-location-col textarea,
.delivery-location-col select {
  width: 100%;
  box-sizing: border-box;
}

/* Location blocks */

.location-block {
  margin-bottom: 8px;
}

.location-preview {
  margin-top: 8px;
}

.location-manual {
  margin-top: 4px;
}

.location-back-link {
  display: inline-flex;
  align-items: center;
  background-color: #3a7bd5;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 0px 0px 24px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

.location-back-link:hover {
  background-color: #2f67b8;
}

.location-new-link {
  display: inline-block;
  background: none;
  border: none;
  color: #3a7bd5;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
  margin: 0px 0px 12px 9px;
  text-decoration: none;
}

.location-new-link:hover {
  text-decoration: underline;
}

.location-save-option {
  margin-top: 4px;
  font-size: 0.9rem;
}

.save-location-name {
  margin: 18px 0px 0px 0px;
}

.save-location-name input[type="text"] {
  width: 280px;
}

.basic-info-card-1.basic-info-card-1--white {
  background-color: #ffffff;
}

/* button element variant */

button.button-link-add-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #3a7bd5;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  margin: 8px 0px;
  font-size: 1.1rem;
  cursor: pointer;
}

button.button-link-add-new:hover {
  background-color: #2f67b8;
}

button.button-link-add-new img {
  width: 18px;
  height: 18px;
}

/* Blocked reason dialog */

dialog.blocked-reason-dialog {
  border: none;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  width: 380px;
  max-width: 95vw;
}

dialog.blocked-reason-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.blocked-reason-dialog h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.blocked-reason-dialog textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  resize: vertical;
}

.blocked-reason-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Doc required warning dialog */

dialog.doc-required-warning-dialog {
  border: none;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  width: 340px;
  max-width: 95vw;
}

dialog.doc-required-warning-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.doc-required-warning-dialog p {
  margin: 0 0 16px;
  font-size: 0.95rem;
}

.doc-required-warning-dialog__actions {
  display: flex;
  justify-content: center;
}

/* Overdue date-change dialog */

dialog.overdue-date-change-dialog {
  border: none;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  width: 380px;
  max-width: 95vw;
}

dialog.overdue-date-change-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.overdue-date-change-dialog h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}

.overdue-date-change-dialog__subtitle {
  margin: 0 0 16px;
  font-size: 0.875rem;
  color: #6b7280;
}

.overdue-date-change-dialog__field {
  margin-bottom: 12px;
}

.overdue-date-change-dialog__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}

.overdue-date-change-dialog__date-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
}

.overdue-date-change-dialog__notes {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  resize: vertical;
}

.overdue-date-change-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Document modal */

dialog.document-modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  width: 720px;
  max-width: 95vw;
  min-height: 500px;
  max-height: 85vh;
}

/* Add Team Member modal — fixed height (not just min/max) so filtering the
   grid down to fewer results never shrinks/grows the dialog. */
dialog.document-modal.add-team-member-modal {
  height: 840px;
  max-height: 90vh;
}

.add-team-member-search {
  margin-bottom: 14px;
}

.add-team-member-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
}

.add-team-member-search input:focus {
  outline: none;
  border-color: #3a7bd5;
}

.add-team-member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 18px 12px;
  height: 670px;
  overflow-y: auto;
  padding: 4px;
}

.add-team-member-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

button.add-team-member-tile__submit {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: none;
  background: none;
  padding: 8px;
  box-sizing: border-box;
  cursor: pointer;
  font: inherit;
  border-radius: 5px;
}

button.add-team-member-tile__submit:hover {
  background-color: #ccc;
  border-radius: 5px;
}

button.add-team-member-tile__submit:hover .add-team-member-tile__name {
  text-decoration: underline;
}

.add-team-member-tile__avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.add-team-member-tile__name {
  font-size: 0.8rem;
  color: #333;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "+" indicator — 1/3 the width of the .user-avatar--md (72px) it sits on;
   purely decorative now that the whole tile is the clickable submit button. */
.add-team-member-tile__add-btn {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #3a7bd5;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.add-team-member-tile__add-btn svg {
  display: block;
  pointer-events: none;
}

dialog.document-modal[open] {
  display: flex;
  flex-direction: column;
  /* Counteract any ancestor's roadmap zoom level so the modal always renders at 100%. */
  zoom: calc(1 / var(--roadmap-zoom, 1));
}

dialog.document-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.document-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #e0e0e0;
}

.document-modal__header h3 {
  margin: 0;
  font-size: 1.1rem;
}

button.document-modal__close-btn[type="submit"] {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: #f2f2f2;
  color: #4b5563;
  cursor: pointer;
  flex-shrink: 0;
}

.document-modal__close-btn svg {
  display: block;
  pointer-events: none;
}

button.document-modal__close-btn[type="submit"]:hover {
  background: #e2e2e2;
}

.document-modal__section {
  padding: 16px 20px;
}

.document-modal__section--files {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.document-modal__section h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.document-modal__section + .document-modal__section {
  border-top: 1px solid #e0e0e0;
}

.document-modal__file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.document-modal__file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.document-modal__choose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
  border-radius: 6px;
  background: #5e5e5e;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
}

.document-modal__choose-btn:hover {
  background: #474747;
}

.document-modal__file-display {
  width: 400px;
  max-width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 6px;
  background: #f2f2f2;
  color: #4b5563;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-modal__file-list {
  max-height: 245px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #b0b0b0 #f0f0f0;
}

.document-modal__file-list::-webkit-scrollbar {
  width: 8px;
}

.document-modal__file-list::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.document-modal__file-list::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 4px;
}

.document-modal__file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f6f6f6;
  border-radius: 8px;
  font-size: 0.95rem;
}

.document-modal__file-name {
  flex: 0 0 50%;
  min-width: 0;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-modal__file-download {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.document-modal__download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #8c8c8c;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.document-modal__download-btn:hover {
  background: #474747;
}

.document-modal__file-date {
  flex: 1 1 0;
  min-width: 0;
  color: #888;
  font-size: 0.85em;
  white-space: nowrap;
  text-align: center;
}

.document-modal__file-actions {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

/* Photo grid */

.document-modal__section--photos {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.document-modal__photo-grid {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: #b0b0b0 #f0f0f0;
}

.document-modal__photo-grid::-webkit-scrollbar {
  width: 8px;
}

.document-modal__photo-grid::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.document-modal__photo-grid::-webkit-scrollbar-thumb {
  background: #b0b0b0;
  border-radius: 4px;
}

.document-modal__photo-thumb {
  width: 120px;
  height: 120px;
  padding: 0;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  background: #f0f0f0;
}

.document-modal__photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.document-modal__photo-thumb:hover {
  opacity: 0.85;
}

/* Photo viewer lightbox */

dialog.photo-viewer-modal {
  border: none;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  max-width: 95vw;
  max-height: 92vh;
}

dialog.photo-viewer-modal[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  margin: auto;
}

dialog.photo-viewer-modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.photo-viewer-modal__image {
  width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.photo-viewer-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
}

.photo-viewer-modal__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.photo-viewer-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.photo-viewer-modal__nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.photo-viewer-modal__nav--prev {
  left: 16px;
}

.photo-viewer-modal__nav--next {
  right: 16px;
}

.photo-viewer-modal__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 12px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
  background-color: #e8e8e8;
}

/* Deal navigation button */

.deal-link-btn {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.75rem;
  background: #4a4a4a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  text-decoration: none;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 10px;
  margin-bottom: 0.6rem;
}

.deal-link-btn::after {
  content: "→";
  color: #cccccc;
  font-weight: 400;
}

.deal-link-btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  /* Force white regardless of the icon's own stroke/fill color, so it reads
     clearly against the badge's dark background. */
  filter: brightness(0) invert(1);
}

.deal-link-btn:hover {
  background: #333333;
  text-decoration: none;
}

/* Construction Project variant — same shape as .deal-link-btn, applied
   alongside it (class="deal-link-btn deal-link-btn--construction") so
   Finance Deal links keep the default dark styling above. */
.deal-link-btn--construction {
  background: #e38c0d;
  border: 1px solid #e38c0d;
}

.deal-link-btn--construction:hover {
  background: #ca7300;
}

/* Segmented toggle group */

.toggle-group {
  display: inline-flex;
}

.toggle-group__btn {
  padding: 9px 18px;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid #bbb;
  cursor: pointer;
  white-space: nowrap;
  margin-right: 8px;
}

.toggle-group__btn:first-child,
.toggle-group__btn:last-child {
  border-radius: 4px;
}

.toggle-group__btn--active {
  background-color: #3a7bd5;
  color: #ffffff;
  border-color: #2f67b8;
}

.toggle-group__btn--inactive {
  background-color: #d0d0d0;
  color: #1a1a1a;
  border-color: #bbb;
}

.toggle-group__btn--green {
  background-color: #479256;
  color: #ffffff;
  border-color: #3d7d49;
}

.toggle-group__btn--green:hover {
  background-color: #3d7d49;
}

.toggle-group__btn--inactive:hover {
  background-color: #b8b8b8;
}

/* Required field styling */
.required-fields-note {
  font-size: 0.85rem;
  color: #666;
  margin: 12px 0 16px;
}

.field-hint {
  font-size: 0.85rem;
  color: #666;
  margin: 2px 0 8px;
}

.required-invalid {
  border: 2px solid #dc2626 !important;
  background-color: #fff5f5 !important;
}

.required-field-tooltip {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 9999;
  animation: required-tooltip-fade 1.5s forwards;
}

@keyframes required-tooltip-fade {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Deal Task Full-Detail Modal ─────────────────────────────────── */

dialog.deal-task-detail-modal {
  width: 800px;
  max-width: 95vw;
  max-height: 88vh;
  padding: 0;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog.deal-task-detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

dialog.deal-task-detail-modal form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

dialog.deal-task-detail-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

dialog.deal-task-detail-modal .modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

dialog.deal-task-detail-modal .modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 2px;
}

dialog.deal-task-detail-modal .modal-close-btn:hover {
  color: #111;
}

dialog.deal-task-detail-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

dialog.deal-task-detail-modal .modal-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
}

dialog.deal-task-detail-modal .modal-full-width {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

dialog.deal-task-detail-modal .modal-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

dialog.deal-task-detail-modal .modal-col > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

dialog.deal-task-detail-modal .modal-subfield {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

dialog.deal-task-detail-modal label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
}

dialog.deal-task-detail-modal input[type="text"],
dialog.deal-task-detail-modal input[type="date"],
dialog.deal-task-detail-modal select,
dialog.deal-task-detail-modal textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 1rem;
  color: #111;
}

dialog.deal-task-detail-modal textarea {
  resize: vertical;
}

dialog.deal-task-detail-modal .modal-readonly-value {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  font-size: 1rem;
  color: #374151;
  background: #f9fafb;
}

dialog.deal-task-detail-modal small {
  font-size: 0.75rem;
  color: #9ca3af;
}

dialog.deal-task-detail-modal .modal-name-input {
  font-size: 1rem;
  font-weight: 500;
}

dialog.deal-task-detail-modal .modal-notes-input {
  border: 1px solid #bfe1ff;
  border-radius: 2px;
  background: linear-gradient(163deg, rgb(195 226 255 / 50%), 66%, rgb(108 182 255 / 50%));
  box-shadow: 2px 4px 6px 0px rgb(195 195 195);
  min-height: 132px;
}

dialog.deal-task-detail-modal .modal-notes-input:focus {
  border-color: #bfe1ff;
  background: linear-gradient(163deg, rgb(195 226 255 / 50%), 66%, rgb(108 182 255 / 50%));
  outline: none;
}

dialog.deal-task-detail-modal .modal-col > div.modal-checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

dialog.deal-task-detail-modal .modal-checkbox-field input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  flex-shrink: 0;
  align-self: center;
  cursor: pointer;
}

dialog.deal-task-detail-modal .modal-checkbox-field label {
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  align-self: center;
  line-height: 1;
  transform: translateY(-3px);
}

dialog.deal-task-detail-modal .modal-document-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  margin: 2px 0;
}

dialog.deal-task-detail-modal .modal-document-date {
  color: #9ca3af;
  font-size: 0.8rem;
}

dialog.deal-task-detail-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

/* Team member profile popup — triggered from .team-short-header on the
   roadmap page. Read-only, so it reuses the same modal-header/modal-body/
   modal-footer structure as the task detail modal without a <form>. */
dialog.team-member-detail-modal {
  width: 620px;
  max-width: 95vw;
  max-height: 88vh;
  padding: 0;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog.team-member-detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

dialog.team-member-detail-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}

dialog.team-member-detail-modal .modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

dialog.team-member-detail-modal .modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 2px;
}

dialog.team-member-detail-modal .modal-close-btn:hover {
  color: #111;
}

dialog.team-member-detail-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 18px 22px;
}

dialog.team-member-detail-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}
/* Page layout */

.page-header-icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin-right: 0.4em;
  position: relative;
  top: -0.05em;
}
.page-header-icon--deals {
  filter: invert(44%) sepia(30%) saturate(600%) hue-rotate(90deg) brightness(88%);
}
.page-header-icon--construction {
  filter: brightness(0) saturate(100%) invert(43%) sepia(100%) saturate(700%) brightness(98%);
}
.page-header-icon--lenders {
  filter: brightness(0) saturate(100%) invert(37%) sepia(74%) saturate(1224%) hue-rotate(232deg) brightness(62%) contrast(93%);
}
.page-header-icon--clients {
  filter: brightness(0) saturate(100%) invert(46%) sepia(78%) saturate(1000%) hue-rotate(175deg) brightness(93%) contrast(93%);
  top: -0.19em;
}
.page-header--lenders {
  color: #2d0766;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

.page-layout {
  display: flex;
  height: 100vh;
}

/* Sidebar nav */

.sidebar {
  width: 300px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #eaeaea;
  color: #4b4b4b;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  box-sizing: border-box;
  transition: width 0.25s ease;
  overflow: hidden;
}

/* Admin sidebar overrides (dark theme) */

.sidebar--admin {
  background-color: #f4f4f4ad;
  color: #5b5b5b;
  border-right: solid 2px #4792564d;
}

.sidebar--admin .sidebar__icons {
  border-bottom-color: #cacaca;
}

.sidebar--admin .sidebar__nav a,
.sidebar--admin .sidebar__nav form button {
  color: #7c7c7c;
}

.sidebar--admin .sidebar__nav a:hover,
.sidebar--admin .sidebar__nav form button:hover,
.sidebar--admin .sidebar__nav a.sidebar-nav-active {
  background-color: #eaeaea;
  color: #7c7c7c;
}

.sidebar--admin .sidebar__nav .sidebar__logout {
  border-top-color: #cacaca;
}

.sidebar--admin .sidebar__icons > img:last-child:hover {
  filter: brightness(0) invert(1);
}

/* Compact sidebar state */

.sidebar--compact {
  width: 80px;
}

.sidebar--compact .sidebar__icons {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.sidebar--compact .sidebar__icons > img:last-child {
  height: 16px;
}

/* No room for the dropdown to render sensibly in the narrow compact sidebar. */
.sidebar--compact .notification-bell {
  display: none;
}

.sidebar--compact .sidebar__title,
.sidebar--compact .sidebar__portal-badge {
  display: none;
}

.sidebar--compact .sidebar__nav {
  display: none;
}

.sidebar--compact .sidebar__nav-compact {
  display: flex;
}

/* Compact nav icons */

.sidebar__nav-compact {
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 16px;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollable nav regions never show a visible scrollbar, even though they
   still scroll (wheel/trackpad/touch) when content overflows the sidebar's
   height. */
.sidebar__nav-links,
.sidebar__nav-compact {
  scrollbar-width: none;    /* Firefox */
  -ms-overflow-style: none; /* legacy Edge/IE */
}

.sidebar__nav-links::-webkit-scrollbar,
.sidebar__nav-compact::-webkit-scrollbar {
  display: none;            /* Chrome/Safari/new Edge */
}

.sidebar__nav-compact img {
  height: 28px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.sidebar__nav-compact img:hover {
  opacity: 1;
}

.sidebar--admin .sidebar__nav-compact img:hover {
  filter: brightness(0) invert(1);
}

.sidebar--admin .sidebar__nav-compact .sidebar-nav-compact-link img:hover {
  filter: invert(44%) sepia(30%) saturate(600%) hue-rotate(90deg) brightness(88%);
}

.sidebar-nav-compact-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  width: 100%;
  margin-left: 8px;
}

.sidebar-nav-compact-link .sidebar-nav-icon {
  width: 24px;
  height: 24px;
  opacity: 0.7;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.sidebar-nav-compact-link:hover .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-active .sidebar-nav-icon:not(svg) {
  opacity: 1;
  filter: invert(44%) sepia(30%) saturate(600%) hue-rotate(90deg) brightness(88%);
}

.sidebar-nav-compact-link:hover .sidebar-nav-icon:is(svg),
.sidebar-nav-compact-link.sidebar-nav-active .sidebar-nav-icon:is(svg) {
  opacity: 1;
}

/* Abbreviation badge (replaces placeholder icon in portal sidebars) */

.sidebar__abbrev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 46px;
  padding: 0 8px;
  border-radius: 7px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  letter-spacing: -0.5px;
  box-sizing: border-box;
}

.sidebar__abbrev--green {
  background-color: #3a9e6e;
}

.sidebar__abbrev--tangerine {
  background-color: #e07b39;
}

.sidebar__icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 16px 16px;
  border-bottom: 1px solid #cccccc;
  margin-bottom: 0;
  flex-shrink: 0;
}

.sidebar__icons-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__icons img {
  height: 40px;
  opacity: 0.6;
}

.sidebar__logo-link img {
  opacity: 1;
}

.sidebar__logo-link,
.sidebar__logo-link:hover {
  display: flex;
  background: none;
  cursor: pointer;
}

.sidebar__icons > img:last-child {
  height: 20px;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.sidebar__icons > img:last-child:hover {
  opacity: 1;
}

.sidebar__toggle-icon {
  position: relative;
  top: 2px;
}

.sidebar__toggle-icon img {
  height: 18px;
  opacity: 0.8;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.sidebar--compact .sidebar__toggle-icon {
  margin-top: 6px;
}

.sidebar__toggle-icon:hover img {
  opacity: 1;
  filter: brightness(0.4);
}

.sidebar__title {
  font-weight: bold;
  font-size: 1.1rem;
  padding: 16px 20px;
  flex-shrink: 0;
}

/* Portal badge — wraps .sidebar__title in the client/vendor/lender portals,
   using the same color scheme as the Assignee badges on deal task cards
   (.deal-task-card__assignee--*) so the portal is instantly recognizable. */
.sidebar__portal-badge {
  margin: 8px 20px 16px 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

.sidebar__portal-badge .sidebar__title {
  padding: 8px 12px;
  font-size: 0.95rem;
  text-align: center;
}

.sidebar__portal-badge--client { background: #48a8ec; }
.sidebar__portal-badge--client .sidebar__title { color: #ffffff; }

.sidebar__portal-badge--vendor { background: #ffcf0d; }
.sidebar__portal-badge--vendor .sidebar__title { color: #000000; }

.sidebar__portal-badge--lender { background: #8462b9; }
.sidebar__portal-badge--lender .sidebar__title { color: #ffffff; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* The scrollable region of links, as opposed to .sidebar__logout below it,
   which stays pinned to the bottom outside this scrolling area. */
.sidebar__nav-links {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar__nav a,
.sidebar__nav form button {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: #4b4b4b;
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}

.sidebar__nav a:hover,
.sidebar__nav form button:hover,
.sidebar__nav a.sidebar-nav-active {
  background-color: #d4d4d4;
  color: #1a1a1a;
}

.sidebar__nav a:hover .sidebar-nav-icon:not(svg),
.sidebar__nav a.sidebar-nav-active .sidebar-nav-icon:not(svg) {
  filter: invert(44%) sepia(30%) saturate(600%) hue-rotate(90deg) brightness(88%);
}

/* Construction Projects nav item — amber highlight (#e69500) instead of green */
.sidebar__nav a.sidebar-nav-construction-link:hover .sidebar-nav-icon:not(svg),
.sidebar__nav a.sidebar-nav-construction-link.sidebar-nav-active .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-construction-link:hover .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-construction-link.sidebar-nav-active .sidebar-nav-icon:not(svg) {
  filter: brightness(0) saturate(100%) invert(43%) sepia(100%) saturate(700%) brightness(98%);
}

/* Lenders nav item — purple highlight (#8462b9) instead of green */
.sidebar__nav a.sidebar-nav-lenders-link:hover .sidebar-nav-icon:not(svg),
.sidebar__nav a.sidebar-nav-lenders-link.sidebar-nav-active .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-lenders-link:hover .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-lenders-link.sidebar-nav-active .sidebar-nav-icon:not(svg) {
  filter: brightness(0) saturate(100%) invert(37%) sepia(74%) saturate(1224%) hue-rotate(232deg) brightness(62%) contrast(93%);
}

/* Clients nav item — blue highlight (#3c95d4) instead of green */
.sidebar__nav a.sidebar-nav-clients-link:hover .sidebar-nav-icon:not(svg),
.sidebar__nav a.sidebar-nav-clients-link.sidebar-nav-active .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-clients-link:hover .sidebar-nav-icon:not(svg),
.sidebar-nav-compact-link.sidebar-nav-clients-link.sidebar-nav-active .sidebar-nav-icon:not(svg) {
  filter: brightness(0) saturate(100%) invert(46%) sepia(78%) saturate(1000%) hue-rotate(175deg) brightness(93%) contrast(93%);
}

/* Users inline SVG active state */
.sidebar-nav-users-link.sidebar-nav-active .users-icon-fill { fill: url(#users-icon-gradient); }
.sidebar-nav-users-link.sidebar-nav-active .users-icon-head { fill: url(#users-icon-gradient-inv); }
.sidebar-nav-users-link.sidebar-nav-active .users-icon-stroke { stroke: #4a9a80; }
.sidebar-nav-users-link.sidebar-nav-active .users-icon-cutout { fill: #eaeaea; }

/* Inline SVG users icon */
.users-icon-fill { fill: #666666; }
.users-icon-cutout { fill: #f4f4f4; }
.users-icon-stroke { stroke: #666666; fill: none; }

.sidebar-nav-users-link:hover .users-icon-fill { fill: url(#users-icon-gradient); }
.sidebar-nav-users-link:hover .users-icon-head { fill: url(#users-icon-gradient-inv); }
.sidebar-nav-users-link:hover .users-icon-stroke { stroke: #4a9a80; }
.sidebar-nav-users-link:hover .users-icon-cutout { fill: #eaeaea; }

.sidebar-nav-icon {
  width: 26px;
  height: 26px;
  margin: 0px 9px 1px 0px;
  vertical-align: middle;
  flex-shrink: 0;
}

.sidebar-nav-icon--sm {
  width: 20px;
  height: 20px;
}

.basic-info-card-1--vendor-types p {
  font-weight: 600;
  margin: 20px 4px;
}

.basic-info-card-1__heading {
  font-weight: 600;
  margin: 0 4px 12px;
}

.sidebar__section-label {
  padding: 28px 20px 4px 20px;
  font-size: 0.78rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
}

.sidebar__nav .sidebar__logout {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #cccccc;
  flex-shrink: 0;
}

.sidebar__user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0px 20px 0px 20px;
  text-decoration: none;
  color: inherit;
}

/* Generic user avatar (photo or initials fallback) — shared by the sidebar
   badge and the profile page header, sized via --sm/--md/--lg modifiers. */
.user-avatar {
  border-radius: 50%;
  background-color: #858585;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  object-fit: cover;
}

.user-avatar--sm {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.user-avatar--md {
  width: 72px;
  height: 72px;
  font-size: 1.3rem;
}

.user-avatar--lg {
  width: 96px;
  height: 96px;
  font-size: 2rem;
}

.sidebar__user-name {
  font-size: 0.92rem;
  color: #4b4b4b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Advanced accordion (full sidebar) */

.sidebar__accordion {
  width: 100%;
}

.sidebar__accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: #4b4b4b;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  user-select: none;
}

.sidebar__accordion > summary::-webkit-details-marker {
  display: none;
}

.sidebar__accordion > summary:hover {
  background-color: #d4d4d4;
  color: #1a1a1a;
}

.sidebar--admin .sidebar__accordion > summary {
  color: #7c7c7c;
}

.sidebar--admin .sidebar__accordion > summary:hover {
  background-color: #eaeaea;
  color: #7c7c7c;
}

.sidebar__nav .sidebar__accordion-body a {
  padding-left: 44px;
}

/* Advanced accordion (compact sidebar) */

.sidebar__accordion-compact {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar__accordion-compact > summary {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  margin-left: 8px;
  width: 100%;
  cursor: pointer;
}

.sidebar__accordion-compact > summary::-webkit-details-marker {
  display: none;
}

.sidebar__accordion-compact > summary .sidebar-nav-icon {
  opacity: 0.7;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.sidebar__accordion-compact > summary:hover .sidebar-nav-icon {
  opacity: 1;
}

.sidebar--admin .sidebar__accordion-compact > summary:hover .sidebar-nav-icon {
  filter: invert(44%) sepia(30%) saturate(600%) hue-rotate(90deg) brightness(88%);
}

/* Main content area */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.main-content__body {
  flex: 1;
  padding: 32px 32px 200px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: auto;
  overflow-anchor: none;
}

/* Login page */

.login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20vh;
  box-sizing: border-box;
}

/* Used only on /update_requests/:token — same as .login-body but with less
   top padding, since this page's content is taller than the login form. */
.login-body--update-request {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10vh;
  box-sizing: border-box;
}

.update-request-meta p {
  margin: 0 0 8px;
}

.update-request-meta p:last-child {
  margin-bottom: 0;
}

/* Info card */

.basic-info-card-1 {
  background-color: #fafafa;
  border: 1px solid #e4e4e4;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  padding: 16px 20px;
  display: block;
  width: 45%;
  box-sizing: border-box;
  margin-bottom: 16px;
}

.login-box {
  width: 360px;
  margin-left: 1%;
}

.login-box__forgot-password-row {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  text-align: left;
}

.forgot-password-link {
  text-decoration: none;
  color: #479256;
}

.forgot-password-link:hover {
  color: #3d7d49;
}

/* Copy URL field */

.copy-url {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  max-width: 500px;
}

.copy-url__text {
  flex: 1;
  background-color: #fafafa;
  background-image: radial-gradient(ellipse at center, #fafafa 40%, #f2f2f2 100%);
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  padding: 8px 14px;
  color: #444444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  box-sizing: border-box;
}

.copy-url__btn {
  background-color: #f2f2f2;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.copy-url__btn img {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.copy-url__btn:hover img {
  opacity: 1;
}

.basic-info-card-1 {
  background-color: #fafafa;
  border: 1px solid #e4e4e4;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
  padding: 16px 20px;
  display: block;
  width: 45%;
  box-sizing: border-box;
  margin-bottom: 16px;
}

/* Dismissible flash messages (notice/alert) */

.flash-message {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.flash-message--notice {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #099c2b;
}

.flash-message--alert {
  background-color: #f8d7da;
  border: 1px solid #f1aeb5;
  color: #721c24;
}

.flash-message__dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.flash-message__dismiss:hover {
  opacity: 1;
}

.flash-message__text {
  flex: 1;
}

/* Notification bell (in-app notifications) */

.notification-bell {
  position: relative;
  display: inline-flex;
}

.notification-bell__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.notification-badge__count {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}

.dropdown-menu--notifications {
  min-width: 320px;
  max-width: 360px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 0;
}

.dropdown-menu.notification-dropdown-menu {
  position: fixed;
  top: 56px;
  left: 10px;
  right: auto;
  min-width: 278px;
}

.notification-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
}

.notification-list__header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-list__mark-all-read {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: normal;
  cursor: pointer;
  padding: 0;
}

.notification-list__empty {
  padding: 1rem 0.9rem;
  color: #666;
  font-size: 0.875rem;
}

.notification-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
}

.notification-item:hover {
  background: #f7f7f7;
}

.notification-item--unread {
  background: #f2fef5;
}

.notification-item--unread:hover {
  background: #e1f4e6;
}

.notification-item__title {
  font-size: 0.875rem;
}

.notification-item__time {
  font-size: 0.75rem;
  color: #888;
}

.notification-list__view-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #e1e1e1;
  color: #1a1a1a;
  text-decoration: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 0.8rem;
}

.notification-list__view-all:hover {
  background-color: #d4d4d4;
}

.notification-list--page .notification-list__view-all {
  display: none;
}
/*
 * Styles for the public, logged-out pages (currently /get-funded).
 *
 * EVERY selector in this file is nested under .public-site. The app compiles all
 * of app/assets/stylesheets into one global application.css (see the require_tree
 * directive in application.css), and every layout links that same bundle — so a
 * new file alone does NOT isolate anything. The .public-site wrapper on the
 * layout's <body> is what guarantees these rules cannot reach the admin portal.
 *
 * The header and footer reproduce rapidfund.me exactly, so a visitor arriving
 * from the marketing site sees nothing change but the URL. Every value below was
 * MEASURED in a browser against the live site on 2026-11-09 — computed styles and
 * bounding boxes, not read off a stylesheet. Notably the site's cached CSS claims
 * #logo{min-height:260px}, which is NOT in effect; the logo really renders 123x82.
 *
 * WHY NOT JUST USE THE WEBSITE'S CSS: it cannot be done. 122KB of it is inlined
 * in <style> blocks, the only external sheets are page-ID scoped and cache-busted
 * so there is no stable URL, the rules are written against Divi's DOM, and it
 * carries a global reset that would strip margins, borders and list styles across
 * the admin portal through the shared bundle above. This was investigated and
 * ruled out on 2026-11-09 — do not re-litigate it without reading:
 *
 *   rapid_fund_research/2026-11-09-site-chrome-mirroring.md
 *
 * That file holds every measured value, the deliberate differences from the site,
 * and the procedure for re-matching when the website changes.
 */

.public-site {
  --rf-red: #e02b20;
  --rf-red-dark: #b32219;
  --rf-cyan: #0da0c5;
  --rf-cyan-dark: #0b86a4;
  --rf-blue: #316596;

  /* Measured from the live site */
  --rf-header-h: 117px;
  --rf-header-grad-from: #d6d6d6;
  --rf-nav-ink: #474747;
  --rf-footer-bg: #f2f2f2;
  --rf-footer-ink: rgba(0, 0, 0, 0.8);

  --rf-heading: #333333;
  --rf-body: #666666;
  --rf-ink: #212121;
  --rf-border: #e2e2e2;
  --rf-rule: #ececec;
  --rf-bg-soft: #f7f7f7;
  --rf-white: #ffffff;

  --rf-font-body: "Inter", Helvetica, Arial, Lucida, sans-serif;
  --rf-font-display: "Rubik", Helvetica, Arial, Lucida, sans-serif;

  --rf-gutter: 48px;
  --rf-radius: 5px;
  --rf-measure: 760px;

  margin: 0;
  background: var(--rf-white);
  color: var(--rf-body);
  font-family: var(--rf-font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* application.css sets a global `body { font-family: Arial }` and sizes every
   checkbox; both are element-level, so these class-scoped rules win. */
.public-site h1,
.public-site h2,
.public-site h3 {
  margin: 0 0 0.5em;
  color: var(--rf-heading);
  font-family: var(--rf-font-body);
  font-weight: 600;
  line-height: 1.3;
}

.public-site h1 { font-size: 2.25rem; }
.public-site h2 { font-size: 1.5rem; }
.public-site h3 { font-size: 1.15rem; }

.public-site p { margin: 0 0 1em; }

.public-site a { color: var(--rf-blue); text-decoration: none; }
.public-site a:hover { text-decoration: underline; }

/* The HTML hidden attribute is a user-agent rule, so ANY author rule setting an
   explicit display beats it — and several below do (.intake-button,
   .public-site__button). Without this, hidden="" silently does nothing and the
   stepper shows Next and "Send my deal" on every step at once. */
.public-site [hidden] { display: none !important; }

/* ---------- Header (measured: 117px tall, full bleed, L-to-R grey gradient) ---------- */

.public-site .public-site__header {
  background: linear-gradient(90deg, var(--rf-header-grad-from) 0%, var(--rf-white) 100%);
  /* The site has always had this; it is invisible on the homepage because the
     dark red hero sits directly beneath it, and only shows on pages with light
     content below — such as the Transaction Summary page this form replaces.
     The site measures 117px INCLUDING the border, so the inner row is 115. */
  border-bottom: 2px solid #000000;
}

.public-site .public-site__header-inner {
  display: flex;
  align-items: center;
  height: calc(var(--rf-header-h) - 2px);
  padding: 0 var(--rf-gutter);
}

.public-site .public-site__logo {
  flex: 0 0 auto;
  line-height: 0;
}

/* Measured 123 x 82 on the live site. */
.public-site .public-site__logo img {
  display: block;
  height: 82px;
  width: auto;
}

.public-site .public-site__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.public-site .public-site__nav-link {
  color: var(--rf-nav-ink);
  font-family: var(--rf-font-display);
  font-size: 18px;
  font-weight: 600;
}

.public-site .public-site__nav-link:hover {
  color: var(--rf-red);
  text-decoration: none;
}

.public-site .public-site__nav-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 10px;
}

.public-site .public-site__button {
  display: inline-block;
  padding: 7px 28px;
  border: 2px solid transparent;
  border-radius: var(--rf-radius);
  font-family: var(--rf-font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.64px;
  text-transform: uppercase;
  white-space: nowrap;
}

.public-site .public-site__button--outline {
  border-color: var(--rf-red);
  background: var(--rf-white);
  color: var(--rf-red);
}

.public-site .public-site__button--outline:hover {
  background: var(--rf-red);
  color: var(--rf-white);
  text-decoration: none;
}

.public-site .public-site__button--solid {
  /* The live site gives its two header buttons DIFFERENT padding and border:
     SIGN UP is 7px/28px with a 2px border, LOGIN is 8px/35px with 1px. Matching
     both exactly keeps the nav sitting where the website puts it. */
  padding: 8px 35px;
  border-width: 1px;
  background: var(--rf-cyan);
  color: var(--rf-white);
}

.public-site .public-site__button--solid:hover {
  background: var(--rf-cyan-dark);
  color: var(--rf-white);
  text-decoration: none;
}

.public-site .public-site__nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  padding: 10px;
  border: 0;
  background: none;
  cursor: pointer;
}

.public-site .public-site__nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--rf-nav-ink);
}

/* ---------- Main ---------- */

.public-site .public-site__main {
  max-width: var(--rf-measure);
  margin: 0 auto;
  padding: 48px var(--rf-gutter) 72px;
}

/* ---------- Footer ----------
   Measured off rapidfund.me on 2026-11-09, structure as well as colour:
   section padding 64px 0 on #f2f2f2; rows are 1152px wide at a 1440 viewport
   (80%, max 1280) and centred, each padded 28.8px 0; two columns of 544.31px
   with a 63.36px gap; links sit on a 49px rhythm (28.8px line box + 20px gap);
   the legal row is separated by 1px solid rgba(0,0,0,0.1) and puts the
   copyright left and the policy links right on one baseline, with the
   not-a-lender line beneath at 13px. */

.public-site .public-site__footer {
  padding: 64px 0;
  background: var(--rf-footer-bg);
  color: var(--rf-footer-ink);
  font-family: var(--rf-font-body);
  font-size: 16px;
}

.public-site .public-site__footer-row {
  display: flex;
  gap: 63.36px;
  width: 80%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28.8px 0;
}

.public-site .public-site__footer-row--legal {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.public-site .public-site__footer-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.public-site .public-site__footer-col--right {
  text-align: right;
}

.public-site .public-site__footer-heading {
  /* Site heading block measures 40px tall (30px line box + 10px padding) with
     32.6px to the first link; 12.6px here plus the column gap of 20px. */
  margin: 0 0 16.6px;
  padding-bottom: 10px;
  color: #000000;
  font-family: var(--rf-font-body);
  font-size: 19px;
  font-weight: 600;
  line-height: 30px;
}

.public-site .public-site__footer-col a {
  color: var(--rf-footer-ink);
  line-height: 28.8px;
}

.public-site .public-site__footer-col a:hover { color: var(--rf-red); text-decoration: none; }

.public-site .public-site__footer-col p {
  margin: 0;
  line-height: 28.8px;
}

.public-site .public-site__footer-fineprint {
  font-size: 13px;
}

/* The site leaves 23px between the two policy links; the bare glyph plus its
   spaces only gives 14px. */
.public-site .public-site__footer-col--right span {
  margin: 0 4.5px;
}

/* ---------- Phone ----------
   Measured on rapidfund.me at 606px on 2026-11-09. The site does NOT shrink its
   chrome below the 981px breakpoint: it keeps the 48px gutter and the full-size
   123x82 logo, collapses only the three text links behind a 32px hamburger, and
   drops SIGN UP / LOGIN onto a second row. Header totals 170px — 16 top, 82 logo,
   8 gap, 45 buttons, 19 bottom. Footer rows stay 80% wide and centred; only the
   section padding (50px) , row padding (30px) and column stacking change. */

@media (max-width: 980px) {
  .public-site .public-site__header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 16px var(--rf-gutter) 19px;
  }

  .public-site .public-site__nav-toggle {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-left: auto;
    /* The site's hamburger stops 86px short of the viewport edge, not at the
       gutter: 48px gutter + 32px Divi column gutter + 6px inset. All three are
       fixed pixel values, so this offset holds at other widths. */
    margin-right: 38px;
  }

  .public-site .public-site__nav-toggle span {
    width: 32px;
    height: 3px;
  }

  /* Source order is logo, nav, buttons; on mobile the buttons row comes first
     and the collapsed links open beneath it. */
  .public-site .public-site__nav-buttons {
    order: 1;
    width: 100%;
    margin: 8px 0 0;
  }

  .public-site .public-site__nav {
    display: none;
    order: 2;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    margin-left: 0;
    padding: 18px 0 0;
  }

  .public-site .public-site__nav.is-open { display: flex; }

  /* The chrome keeps its 48px gutter, but the form itself would be unusable at
     that inset on a phone, so main gets its own. */
  .public-site .public-site__main { padding: 32px 24px 56px; }

  .public-site .public-site__footer { padding: 50px 0; }

  .public-site .public-site__footer-row {
    flex-direction: column;
    gap: 30px;
    padding: 30px 0;
  }

  .public-site .public-site__footer-col--right { text-align: left; }

  .public-site h1 { font-size: 1.75rem; }
}

/* ======================================================================
   /get-funded intake form. Still scoped under .public-site throughout.
   ====================================================================== */

/* ---------- Step 1: deal type cards ---------- */

.public-site .intake-intro__lede {
  max-width: 60ch;
  font-size: 1.05rem;
}

.public-site .intake-intro__question {
  margin-top: 2rem;
}

.public-site .intake-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 1rem;
}

.public-site .intake-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 2px solid var(--rf-border);
  border-radius: var(--rf-radius);
  background: var(--rf-white);
  color: var(--rf-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.public-site .intake-card:hover {
  border-color: var(--rf-red);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.public-site .intake-card__label {
  color: var(--rf-ink);
  font-family: var(--rf-font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.public-site .intake-card__blurb {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ---------- Header + progress ---------- */

.public-site .intake__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  justify-content: flex-start;
  margin-bottom: 0.5em;
}

.public-site .intake__header h1 { margin: 0; }

.public-site .intake-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--rf-rule);
  padding-bottom: 14px;
}

.public-site .intake-progress__item {
  color: #9a9a9a;
  font-family: var(--rf-font-display);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.public-site .intake-progress__item.is-done { color: var(--rf-body); }

.public-site .intake-progress__item.is-current {
  color: var(--rf-red);
  font-weight: 600;
}

/* ---------- Fields ---------- */

.public-site .required-fields-note {
  margin: 0 0 1.5rem;
  color: var(--rf-body);
  font-size: 0.9rem;
}

.public-site .intake-step__title {
  margin-bottom: 1.25rem;
}

.public-site .intake-field {
  margin-bottom: 1.25rem;
}

.public-site .intake-field__label {
  display: block;
  margin-bottom: 6px;
  color: var(--rf-ink);
  font-weight: 500;
}

.public-site .intake-field input[type="text"],
.public-site .intake-field input[type="email"],
.public-site .intake-field input[type="tel"],
.public-site .intake-field input[type="date"],
.public-site .intake-field input[type="month"],
.public-site .intake-field select,
.public-site .intake-field textarea {
  width: 100%;
  max-width: 460px;
  padding: 11px 12px;
  border: 1px solid #cfcfcf;
  border-radius: var(--rf-radius);
  background: var(--rf-white);
  color: var(--rf-ink);
  font-family: var(--rf-font-body);
  font-size: 1rem;
  /* forms.css styles bare inputs globally for the admin portal and applies here
     too — the .public-site wrapper keeps OUR css out of admin, not admin's out of
     ours. Its `margin: 4px 4px 18px 0` was adding 22px below every control, which
     is what pushed the $ out of line with its input. */
  margin: 0;
}

.public-site .intake-field textarea { max-width: 620px; resize: vertical; }

.public-site .intake-field input:focus,
.public-site .intake-field select:focus,
.public-site .intake-field textarea:focus {
  border-color: var(--rf-cyan);
  outline: 2px solid rgba(13, 160, 197, 0.25);
  outline-offset: 0;
}

.public-site .intake-field__hint {
  margin: 6px 0 0;
  color: var(--rf-body);
  font-size: 0.875rem;
}

.public-site .intake-field__radios {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.public-site .intake-field__radio,
.public-site .intake-field__check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.public-site .intake-field__check { max-width: 620px; }

/* application.css sizes every checkbox globally; override within the form. */
.public-site .intake-field input[type="checkbox"],
.public-site .intake-field input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.25rem;
  flex: 0 0 auto;
}

/* The prefix span inherits line-height 1.7 from .public-site while the input
   uses the browser default, so centring the two boxes against each other left
   the $ sitting low. Stretch the prefix to the input's height instead and centre
   the glyph inside it. */
.public-site .intake-field__money {
  display: flex;
  align-items: stretch;
  max-width: 460px;
}

.public-site .intake-field__money-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  line-height: 1;
  border: 1px solid #cfcfcf;
  border-right: 0;
  border-radius: var(--rf-radius) 0 0 var(--rf-radius);
  background: var(--rf-bg-soft);
  color: var(--rf-body);
}

.public-site .intake-field__money input[type="text"] {
  border-radius: 0 var(--rf-radius) var(--rf-radius) 0;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.public-site .intake-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Buttons ---------- */

.public-site .intake-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rf-rule);
}

.public-site .intake-button {
  display: inline-block;
  padding: 12px 28px;
  border: 2px solid var(--rf-red);
  border-radius: var(--rf-radius);
  background: var(--rf-red);
  color: var(--rf-white);
  font-family: var(--rf-font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.public-site .intake-button:hover {
  border-color: var(--rf-red-dark);
  background: var(--rf-red-dark);
  color: var(--rf-white);
  text-decoration: none;
}

.public-site .intake-button--ghost {
  background: var(--rf-white);
  color: var(--rf-red);
}

.public-site .intake-button--ghost:hover {
  background: var(--rf-white);
  color: var(--rf-red-dark);
}

/* Smaller variant for the header's Start over link. Must come after
   .intake-button or its padding wins. */
.public-site .intake-button--small {
  padding: 6px 16px;
  font-size: 0.9rem;
}

/* ---------- /join network page (reuses the intake classes above) ---------- */

.public-site .network__aside {
  margin-top: 2rem;
}

.public-site .network__error {
  padding: 10px 14px;
  border-left: 4px solid #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

/* ---------- Stop + thanks ---------- */

.public-site .intake-stop,
.public-site .intake-thanks {
  max-width: 60ch;
}

@media (max-width: 980px) {
  .public-site .intake-cards { grid-template-columns: 1fr; }
  .public-site .intake-actions .intake-button { flex: 1 1 auto; text-align: center; }
}
/* Data table — CSS grid-based table layout */

.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }

.data-table {
  display: block;
  margin-top: 16px;
  border-top: 1px solid #e0e0e0;
}

/* Each --Ncol modifier is the grid container */
.data-table--3col { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.data-table--4col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; }
.data-table--5col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
.data-table--6col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
.data-table--7col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; }
.data-table--8col { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; }

/* Leads index — custom column widths */
.data-table--leads { display: grid; grid-template-columns: 2fr 0.8fr 1fr 1fr 1fr 0.7fr 1fr 1fr 1.5fr; }
.data-table--network-signups { display: grid; grid-template-columns: 1.5fr 1fr 1.5fr 2fr 1fr 1fr; }

/* Header and rows span the full grid and inherit its column tracks via subgrid */
.data-table__header,
.data-table__row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
}

.data-table__header .data-table__cell {
  font-weight: bold;
  background-color: #f2f2f2;
  border-bottom: 2px solid #d0d0d0;
}

.data-table__row:hover .data-table__cell {
  background-color: #fafafa;
}

a.row-nav-link {
  color: inherit;
  text-decoration: none;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.sort-link:hover {
  text-decoration: underline;
}

.sort-link--active {
  color: #222;
}

.sort-arrow {
  font-size: 0.75em;
  opacity: 0.6;
}

.data-table__cell {
  padding: 10px 14px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-buttons-row {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Rows with a subrow: the divider moves to the bottom of the subrow
   instead of sitting between the cells and the subrow. */
.data-table__row:has(.data-table__subrow) > .data-table__cell {
  border-bottom: none;
}

.data-table__subrow {
  grid-column: 1 / -1;
  padding: 10px 14px 14px;
  border-bottom: 1px solid #e0e0e0;
}
/* =====================================================
   Template Builder
   ===================================================== */

body.template-builder-page .main-content__body {
  background-color: #ebebeb;
  cursor: grab;
  padding-bottom: 32px;
}

body.template-builder-page .main-content__body a,
body.template-builder-page .main-content__body button,
body.template-builder-page .main-content__body input,
body.template-builder-page .main-content__body select,
body.template-builder-page .main-content__body textarea {
  cursor: pointer;
}

.builder-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  position: sticky;
  left: 0;
}

.builder-header h1 {
  margin: 0;
}

.builder-header__deal-type {
  font-size: 1.3rem;
  opacity: 0.6;
  margin: 8px 0px 0px 2px;
}

/* Zoom Toolbar */

.zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: sticky;
  top: -32px;
  left: 0;
  z-index: 500;
  background-color: #ebebeb;
  box-shadow: -32px 0 0 0 #ebebeb, 32px 0 0 0 #ebebeb;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.zoom-label {
  font-size: 0.82rem;
  color: #666;
  margin-right: 0.2rem;
}

.zoom-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #444;
}

.zoom-btn:hover {
  background: #f0f0f0;
}

.zoom-btn--active:hover {
  background: #6cbfdf;
  color: #ffffff;
}

.zoom-btn--active {
  background: #6cbfdf;
  color: #ffffff;
  font-weight: 600;
}

.zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0 0.25rem;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1aa5da;
  cursor: pointer;
}

.zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1aa5da;
  cursor: pointer;
  border: none;
}

.builder {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 42px;
  gap: 0;
  min-width: min-content;
}

.builder__phases {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.builder__phases-list {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Phase */

.phase-block {
  width: max-content;
  min-width: 240px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.40);
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  border-radius: 6px 6px 0 0;
}

.phase-header__drag-handle {
  cursor: grab;
  color: #333333;
  font-size: 1rem;
  user-select: none;
}

.drag-handle {
  cursor: grab;
  color: #333333;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  padding: 3px 3px 3px 3px;
  border-radius: 4px;
}

.group-box__header .drag-handle,
.deal-group-box__header .drag-handle {
  font-size: 0.8rem;
}

.task-card__header .drag-handle,
.deal-task-card__header .drag-handle {
  font-size: 0.9rem;
}

.group-task__header .drag-handle,
.deal-group-task__header .drag-handle {
  font-size: 0.75rem;
}

.phase-header__name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 1.4rem;
}

.phase-header__name input[type="text"] {
  font-weight: 600;
  font-size: 1.4rem;
  padding: 0.2rem 0.4rem;
  border: none;
  border-radius: 4px;
}

.phase-header__actions {
  position: relative;
}

.phase-header__actions .dropdown-menu {
  top: 22px;
}

.phase-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.phase-add-row {
  display: flex;
  justify-content: center;
}

.phase-add-item {
  margin-top: 0.75rem;
  position: relative;
  display: inline-block;
  align-self: flex-start;
}

.btn-add-phase {
  padding: 13px 25px;
  background: #fff;
  border: 1px dashed #888;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
}

.btn-add-phase:hover {
  background: #f0f0f0;
}

.btn-add-item {
  padding: 0.3rem 0.75rem;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-add-item:hover {
  background: #f5f5f5;
}

/* Phase connector */

.phase-connector {
  text-align: center;
  font-size: 2.4rem;
  color: #888;
  padding: 1.2rem 0;
  width: 100%;
}

/* SequenceRow */

.sequence-row {
  display: flex;
  flex-direction: column;
}

.sequence-row__items {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.sequence-row-connector {
  text-align: center;
  font-size: 1.2rem;
  color: #888;
  padding: 0.1rem 0;
}

.sequence-row__add {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-add-parallel {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
  border: 1.5px solid #13c660;
  background: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: #13c660;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-add-parallel:hover {
  background-color: #f1fff7;
}

/* Task Card */

.task-card {
  background: #eeecec;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  min-width: 160px;
  min-height: 100px;
  max-height: max-content;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin: 2px 14px 14px 5px;
}

.task-card__actions {
  position: relative;
}

.task-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}

.task-card__name {
  font-weight: 500;
  font-size: 0.9rem;
  flex: 1;
}

.task-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.task-card__assignee {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 4px;
  background: #e8e8e8;
  color: #444;
}

.task-card__assignee--admin    { background: #00afa6; color: #ffffff; }
.task-card__assignee--client   { background: #48a8ec; color: #ffffff; }
.task-card__assignee--vendor   { background: #ffcf0d; color: #000000; }
.task-card__assignee--lender   { background: #8462b9; color: #ffffff; }
.task-card__assignee--construction_manager { background: #e38c0b; color: #ffffff; }

.task-card__doc-required {
  font-size: 0.9rem;
}

.document-required-wrapper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0px 0px 12px 0px;
}

.task-card turbo-frame input:not([type="submit"]),
.task-card turbo-frame select {
  background-image: radial-gradient(ellipse at center, #ffffff 40%, #f6f6f6 100%);
}

.edge-btn {
  position: absolute;
  background-color: #dbdbdb;
  color: #555;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}

.edge-btn--right {
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
}

.edge-btn--bottom {
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
}

.edge-btn:not(.edge-btn--group):hover {
  background-color: #0cb4f5;
  color: white;
  border-radius: 50%;
}

.edge-btn--group {
  background-color: #0db4f5;
  color: white;
}

.edge-btn--group:hover {
  background-color: #0b97ce;
}

.edge-btn > button {
  background: none;
  border-radius: 50%;
  color: inherit;
  font-size: inherit;
  cursor: inherit;
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edge-btn > button:hover {
  background: none;
  border-color: transparent;
}

/* Group Box */

.group-box {
  border-radius: 6px;
  min-width: 180px;
  flex: 0 0 auto;
  background: #d7d7d7;
  margin: 0px 14px 14px 5px;
  border: solid 2px #c7c7c7;
  box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}

/* Alternating background colors for nested group levels */
.group-box--depth-1,
.group-box--depth-3,
.group-box--depth-5,
.group-box--depth-7,
.group-box--depth-9 {
  background: #e7e7e7;
}

.group-box--depth-2,
.group-box--depth-4,
.group-box--depth-6,
.group-box--depth-8,
.group-box--depth-10 {
  background: #d7d7d7;
}

.group-box__actions,
.group-task__actions {
  position: relative;
}

.group-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: #efefef;
  border-bottom: 1px solid #ddd;
  border-radius: 4px 4px 0 0;
  font-weight: 600;
  font-size: 0.85rem;
}

.group-box__name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.group-type-icon {
  display: block;
  flex-shrink: 0;
  width: auto;
}

.group-box--parallel .group-type-icon,
.deal-group-box--parallel .group-type-icon {
  height: 12px;
}

.group-box--sequential .group-type-icon,
.deal-group-box--sequential .group-type-icon {
  height: 14px;
}

.group-box > turbo-frame {
  display: block;
  padding: 0.2rem;
}

.group-box > turbo-frame input:not([type="submit"]),
.group-box > turbo-frame select {
  background-image: radial-gradient(ellipse at center, #ffffff 40%, #f6f6f6 100%);
}

.group-box__tasks {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem;
  flex-wrap: wrap;
  min-height: 52px;
  justify-content: center;
}

.group-box--sequential > .group-box__tasks {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
}

/* CSS connector arrows between sequential group children */
.group-box--sequential > .group-box__tasks > * + * {
  position: relative;
  margin-top: 1.6rem;
}

.group-box--sequential > .group-box__tasks > * + *::before {
  content: "↓";
  position: absolute;
  top: -1.9rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 1.2rem;
  color: #888;
  height: 1.4rem;
  line-height: 1.4rem;
}

.group-box--parallel > .group-box__tasks {
  flex-direction: row;
}

.group-task {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.4rem 0.5rem 0.8rem 0.5rem;
  font-size: 0.85rem;
  width: max-content;
  min-width: 152px;
  height: max-content;
  margin: 3px 0px 0px 0px;
}

.group-task__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.group-task__name {
  font-weight: 500;
  flex: 1;
}

.group-task__meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}


/* Dropdown */

.dropdown-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 60%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 1000;
  min-width: 212px;
  padding: 0.25rem 0;
}

.dropdown-menu--open {
  display: block;
}

.dropdown-item {
  display: block;
  box-sizing: border-box;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: normal;
  color: #333;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.dropdown-divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 0.25rem 0;
}

.dropdown-menu form {
  margin: 0;
  padding: 0;
}

.dropdown-menu button[type="submit"] {
  background-color: transparent;
  color: #333;
  border-radius: 0;
  padding: 0.4rem 0.75rem;
  margin: 0;
  font-size: 0.875rem;
  width: 100%;
  text-align: left;
}

.dropdown-menu button[type="submit"]:hover {
  background-color: #f5f5f5;
  color: #333;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item--danger {
  color: #c0392b;
}

.dropdown-item--danger:hover {
  background: #fef2f2;
}

.dropdown-item--disabled {
  color: #aaa;
  cursor: default;
  pointer-events: none;
}

/* Library Modal */

.library-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.library-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.library-modal {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.58);
  width: 40rem;
  min-height: 46vh;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.library-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}

.library-modal__header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.library-modal__filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #eee;
}

.library-index__filters {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

input.library-index__search {
  width: 50%;
}

.library-index__filters-row {
  display: flex;
  gap: 0.5rem;
}

.library-index__filters-row select {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  height: 40px;
}

.library-modal__filters-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.library-modal__filters-row select {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  flex: 1;
  min-width: 0;
}

.library-modal__filters-row input {
  font-size: 0.975rem;
  padding: 0.375rem 0.525rem;
  height: 42.6px;
  flex: 1;
  min-width: 0;
}

.library-modal__body {
  overflow-y: auto;
  padding: 0.75rem 1rem;
}

.library-modal__group-heading {
  margin: 1rem 0 0.25rem;
  font-weight: 700;
  border-bottom: 2px solid #eee;
  background-color: #4f5b60;
  padding: 9px 10px;
  border-radius: 4px;
  color: white;
}

.library-modal__group-heading:first-child {
  margin-top: 0;
}

.library-modal__body h4 {
  margin: 0.5rem 0 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}

.library-modal__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #7cbc83;
  gap: 0.75rem;
}

.library-modal__item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.library-modal__item-name {
  font-size: 1rem;
  flex: 1;
}

.library-modal__item-description {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.3;
}

.library-modal__item-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.library-modal__item-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.library-modal__item-tag {
  font-size: 0.7rem;
  background: #777777;
  color: #ffffff;
  border-radius: 3px;
  padding: 0.5rem 0.6rem;
}

.library-modal__item-tag--client { background: rgb(72, 168, 236); color: rgb(255, 255, 255); }
.library-modal__item-tag--admin  { background: rgb(0, 175, 166); color: rgb(255, 255, 255); }
.library-modal__item-tag--lender { background: rgb(132, 98, 185); color: rgb(255, 255, 255); }
.library-modal__item-tag--vendor { background: rgb(255, 207, 13); color: rgb(0, 0, 0); }

/* Icon buttons */

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: 3px;
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1;
}

.btn-icon:hover {
  background: rgb(120 205 240);
  color: #ffffff;
}

.btn-menu {
  font-size: 1.1rem;
}

/* Task card's own "..." menu button only — deals.css's task card partials
   (_deal_task_card / _deal_group_child) add this alongside .btn-icon so it
   doesn't affect the phase/group ellipsis buttons, which share .btn-icon
   too but must keep their current color. */
.btn-icon.btn-menu--task-card {
  color: #000000;
}

/* =====================================================
   Shared inline form inputs (used in phase/deal phase partials)
   ===================================================== */

.inline-input,
.inline-textarea {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  background: #ffffff;
  color: #333333;
  box-sizing: border-box;
}

.inline-input:focus,
.inline-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.inline-textarea {
  resize: vertical;
}

.button-save-sm {
  padding: 0.3rem 0.75rem;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.25rem;
}

.button-save-sm:hover {
  background: #2563eb;
}

/* =====================================================
   Phase client portal settings (collapsible block)
   ===================================================== */

.phase-client-settings {
  margin: 0 0.75rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #f9fafb;
  font-size: 0.82rem;
}

.phase-client-settings[open] {
  padding-bottom: 0.5rem;
}

.phase-client-settings__toggle {
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  color: #6b7280;
  font-size: 0.8rem;
  user-select: none;
  list-style: none;
}

.phase-client-settings__toggle::-webkit-details-marker {
  display: none;
}

.phase-client-settings__toggle::before {
  content: "▶ ";
  font-size: 0.65rem;
  vertical-align: middle;
}

.phase-client-settings[open] > .phase-client-settings__toggle::before {
  content: "▼ ";
}

.phase-client-settings__body {
  padding: 0.5rem 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phase-client-settings__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.phase-client-settings__field--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.phase-client-settings__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #374151;
}

.phase-client-settings__hint {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.75rem;
}
/* Task Updates — History page & cross-project admin feed */

/* Task-name suffix in the Respond page's <h1> — deliberately its own class,
   not a reuse of the generic .field-hint (small form-field helper text used
   in several unrelated places), so this only affects this one header. */
.update-page-subtitle {
  font-size: 1.5rem;
  color: #666;
  margin: 2px 0 8px;
}

.update-form {
  margin-bottom: 105px;
}

.update-entry-list {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.update-entry {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.22);
  background-color: #ffffff;
}

.update-entry__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.update-entry__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.update-entry__date {
  margin-left: auto;
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
}

.update-entry__people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
}

.update-entry__subject {
  font-size: 0.85rem;
  color: #555;
}

.update-entry__deal-link {
  font-weight: 600;
  color: #2d6a4f;
  text-decoration: none;
}

.update-entry__deal-link:hover {
  text-decoration: underline;
}

.update-entry__ask {
  background: #f3f3f3;
  border-radius: 3px;
  padding: 0.55rem 0.75rem;
  border-left: solid 3px #d93939;
}

/* Response (Update) — very light grey; initial color, expected to be
   refined further as the layout is designed. */
.update-entry__response {
  background: #f3f3f3;
  border-radius: 3px;
  padding: 0.55rem 0.75rem;
}

.update-entry__ask-label,
.update-entry__response-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.update-entry__state-icon {
  flex-shrink: 0;
}


.update-entry__requested-fields {
  font-size: 0.9rem;
  color: #650505;
  font-style: italic;
}

.update-entry__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.update-entry__eta {
  font-size: 0.85rem;
  color: #555;
}

.update-entry__no-status-change {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.update-entry__footer {
  display: flex;
  justify-content: flex-end;
}

.update-entry__respond-btn {
  display: inline-flex;
  align-items: center;
  background-color: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.update-entry__respond-btn:hover {
  background-color: #b91c1c;
}

.update-deal-group {
  margin-bottom: 2rem;
}

.update-deal-group__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

html {
  overflow-anchor: none;
}

body {
  font-family: Arial, Helvetica, sans-serif;
}

.main-content__body.is-panning {
  cursor: grabbing !important;
  user-select: none;
}

.main-content__body.is-panning * {
  cursor: grabbing !important;
}

input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
}

.drag-ghost {
  opacity: 0.25;
  pointer-events: none;
}
