/* 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
   ===================================================== */

.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;
}
/* =====================================================
   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;
}

/* 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: 0.5rem;
}

.deal-header__main h1 {
  margin: 0;
}

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

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

.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--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: #7b7b7b;
  border-bottom: 1px solid #ddd;
  border-radius: 6px 6px 0 0;
  color: white;
}

.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 {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 4px;
  background: #e8e8e8;
  color: #444;
}

.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__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;
}



/* 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;
}

.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;
}

/* 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;
}

/* 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-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.status-badge--not_started { background: #f3f4f6; color: #6b7280; }
.status-badge--in_progress { background: #dcfce7; color: #093f1d; }
.status-badge--complete    { background: #2faa59; color: #ffffff; }
.status-badge--locked      { background: #fef3c7; color: #92400e; }
.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; }

/* 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; }

/* 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;
}

.deal-task-card--anchor-highlight {
  box-shadow: 0 0 0 3px #3a7bd5;
  transition: box-shadow 1.5s ease-out;
}

.deal-task-card--anchor-highlight-off {
  box-shadow: 0 0 0 0px #3a7bd5;
  transition: box-shadow 1.5s ease-out;
}

.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-alert {
  background: #f8d7da;
  color: #721c24;
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.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;
}

body.deal-overview-page .main-content__body {
  flex: 1;
  padding: 32px 32px 200px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: auto;
  overflow-anchor: none;
  background-color: #ebebeb;
}

/* ── 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; }

/* 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-btn {
  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;
}
/* 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;
}

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 {
  display: inline-flex;
  align-items: center;
  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-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-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: 480px;
  max-width: 95vw;
}

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;
}

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

.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-input {
  display: block;
  margin-bottom: 10px;
}

.document-modal__version {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.document-modal__version:last-child {
  border-bottom: none;
}

.document-modal__version-date {
  color: #888;
  font-size: 0.85em;
}

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:hover {
  background: #333333;
  text-decoration: none;
}

/* 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--inactive:hover {
  background-color: #b8b8b8;
}

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

.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-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;
}
/* Page layout */

.page-header-icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: middle;
  margin-right: 0.4em;
  position: relative;
  top: -0.05em;
}

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;
  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 {
  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;
}

.sidebar--compact .sidebar__title {
  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;
}

.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;
}

.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 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;
}

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

.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 {
  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%);
}

.sidebar__nav a.sidebar-nav-active {
}

/* 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;
}

.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;
}

/* 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;
}

/* 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%;
}

/* Copy URL field */

.copy-url {
  display: inline-flex;
  align-items: center;
  background-color: #f2f2f2;
  background-image: radial-gradient(ellipse at center, #f2f2f2 40%, #e6e6e6 100%);
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  padding: 8px 10px 8px 14px;
  font-size: 1rem;
  color: #444444;
  max-width: 500px;
  box-sizing: border-box;
}

.copy-url__text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: #444444;
}

.copy-url__btn {
  background: none;
  border: none;
  padding: 0 0 0 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;
}
/* 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; }

/* 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;
}
/* =====================================================
   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__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: 0.9rem;
  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.2rem 0.5rem;
}

.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: #666;
  font-size: 0.9rem;
  line-height: 1;
}

.btn-icon:hover {
  background: rgb(120 205 240);
  color: #ffffff;
}

.btn-menu {
  font-size: 1.1rem;
}
/*
 * 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;
}
