/* Misty-Land - Leads feature styles extracted from style.css */
/* ── View tabs ──────────────────────────────────────────────────── */
.leads-view-tabs {
  display: flex; gap: 0; align-items: center; flex-shrink: 0;
}
.leads-view-tab {
  font-family: var(--font-primary);
  font-size: 11.5px; font-weight: 600;
  padding: 0 12px;
  height: 32px;
  border: 1px solid var(--border-light);
  border-right: none;
  border-radius: 0;
  background: #ede6da;
  color: var(--text-brown);
  cursor: pointer;
  position: relative;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.leads-view-tab:first-child { border-radius: 8px 0 0 8px; }
.leads-view-tab:last-child  { border-radius: 0 8px 8px 0; border-right: 1px solid var(--border-light); }
.leads-view-tab:hover { background: #f0e8d8; color: var(--text-dark); }
.leads-view-tab.active {
  background: var(--bg-card);
  color: var(--text-dark);
  border-color: #e0c98a;
  z-index: 1;
}
.leads-view-tab.active:last-child { border-right: 1px solid #e0c98a; }

/* ── Filter row ────────────────────────────────────────────────── */
.leads-filter-row {
  display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; align-items: center;
}
.leads-page-title {
  margin: 0; display: flex; align-items: center; gap: 7px;
  font-family: var(--font-primary); font-size: 18px; font-weight: 700;
  color: var(--text-dark); white-space: nowrap; flex-shrink: 0;
  padding-right: 4px;
}
.leads-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(160, 120, 64, 0.44);
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.35);
  color: var(--text-brown);
  cursor: pointer;
  transition: border-color var(--motion-fast), background var(--motion-fast), color var(--motion-fast), opacity var(--motion-fast);
  opacity: 0.78;
  flex-shrink: 0;
}
.leads-refresh-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.leads-refresh-btn:hover:not(:disabled) {
  opacity: 1;
  background: rgba(160, 120, 64, 0.22);
  border-color: rgba(160, 120, 64, 0.7);
  color: #6f5534;
}
.leads-refresh-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}
.leads-refresh-btn.is-loading svg {
  animation: leads-refresh-spin 0.9s linear infinite;
}
@keyframes leads-refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .leads-refresh-btn.is-loading svg {
    animation: none;
  }
}
.leads-search {
  flex: 1; min-width: 140px;
  font-family: var(--font-primary);
  font-size: 13px;
  padding: 6px 12px;
  border: 1.5px solid var(--border-light);
  border-radius: 9px;
  background: #fff;
  color: var(--text-dark);
  outline: none;
  transition: border-color var(--motion-fast);
}
.leads-search:focus { border-color: var(--primary-gold); }
.leads-filter-select {
  font-family: var(--font-primary);
  font-size: 12px;
  padding: 6px 10px;
  border: 1.5px solid var(--border-light);
  border-radius: 9px;
  background: #fff;
  color: var(--text-brown);
  cursor: pointer;
}

/* ── Stage badge ───────────────────────────────────────────────── */
.leads-stage-badge {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1.5px solid;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.leads-stage-badge--fresh       { background: #cfe8cf; border-color: #8fbc8f; color: #3a6b3a; }
.leads-stage-badge--interaction { background: #f2e5cb; border-color: #d9c19a; color: #7a5c28; }
.leads-stage-badge--closing     { background: #f4a261; border-color: #c07030; color: #5a2e10; }
.leads-stage-badge--customer    { background: #d5b885; border-color: #b09060; color: #4a3518; }
.leads-stage-badge--lost        { background: #e7bcbc; border-color: #c08080; color: #6b2a2a; }

/* ── Priority badge ────────────────────────────────────────────── */
.leads-priority-badge {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.leads-priority-badge--hot  { background: #e74c3c; color: #fff; }
.leads-priority-badge--warm { background: #f39c12; color: #fff; }
.leads-priority-badge--cold { background: #3498db; color: #fff; }

/* ── Source chip ───────────────────────────────────────────────── */
.leads-source-chip {
  font-family: var(--font-primary);
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f0e9d8;
  border: 1px solid var(--border-light);
  color: var(--text-brown);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Follow-up ─────────────────────────────────────────────────── */
.leads-followup--overdue  { color: #c0392b; font-weight: 600; }
.leads-followup--upcoming { color: #e67e22; font-weight: 600; }

/* ── Table view ────────────────────────────────────────────────── */
.leads-table-wrap {
  overflow: visible;
  border-radius: 7px;
  min-width: max-content;
}

.leads-table {
  width: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-primary);
  font-size: 13px;
}
.leads-table th {
  text-align: left;
  padding: 6px 12px;
  background: #f0e8d8;
  color: var(--text-dark);
  font-weight: 700;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 2px solid var(--primary-gold);
  position: sticky;
  top: 0;
  z-index: 10;
}
.leads-table thead tr th:first-child { border-radius: 7px 0 0 0; }
.leads-table thead tr th:last-child  { border-radius: 0 7px 0 0; }
.leads-table th:hover { background: #e8dcc6; }
.leads-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-brown);
  vertical-align: middle;
}
.leads-table tr { cursor: pointer; transition: background var(--motion-fast); }
.leads-table tbody tr:hover { background: #f8f2e8; }
.leads-table-name { font-weight: 600; color: var(--text-dark); }
.leads-table-empty {
  text-align: center; padding: 48px 20px;
  color: var(--text-brown); opacity: 0.6;
  font-family: var(--font-primary); font-size: 15px;
}

/* ── Airtable/spreadsheet table ─────────────────────────────────── */
.leads-table--sheet td.leads-table-td,
.leads-table--sheet td { padding: 0; height: 30px; vertical-align: middle; }

.leads-table--sheet td[data-col="phone"],
.leads-table--sheet td[data-col="email"] { padding-right: 4px; }

.leads-cell-input,
.leads-cell-select {
  width: 100%; height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 7px;
  font-family: inherit; font-size: 13px;
  color: #3a2a10;
  outline: none; box-sizing: border-box; display: block;
  transition: border-color .1s, background .1s, box-shadow .1s;
}
.leads-cell-select {
  border-color: #d9c19a;
}
.leads-cell-input:hover,
.leads-cell-select:hover  { border-color: #b09060; background: rgba(255,255,255,.55); }
.leads-cell-input:focus,
.leads-cell-select:focus  {
  border-color: #b09060; background: #fff;
  box-shadow: 0 0 0 2px rgba(176,144,96,.18);
  position: relative; z-index: 1;
}

.leads-cell-select {
  cursor: pointer; border-radius: 6px; font-weight: 500;
  height: 22px; padding: 0 6px;
  margin: 0 4px;
  width: calc(100% - 8px);
}

/* name cell layout */
.leads-td-name            { white-space: nowrap; }
.leads-td-name > div      { display: flex; align-items: center; gap: 4px; }
.leads-td-name .leads-cell-input { flex: 1; }
.leads-incomplete-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: default;
}
.leads-incomplete-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e7817d;
}
.leads-incomplete-dot[data-tooltip]::after {
  content: none;
}
.leads-row--incomplete:hover {
  background: #fcf4f2 !important;
}
.leads-floating-tooltip {
  position: fixed;
  background: rgba(42,31,18,0.92);
  color: #f5edde;
  font-family: var(--font-primary);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  border-radius: 9px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2147483647;
  box-shadow: 0 8px 18px rgba(42,31,18,0.18);
}

/* phone expand button */
.leads-phones-expand {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 0;
  padding: 0 2px; cursor: pointer;
  color: #7a5228; line-height: 1;
  transition: color .15s, opacity .15s;
}
.leads-phones-expand:hover { color: #5f3c18; opacity: 0.9; }
.leads-phones-expand--open { color: #5f3c18; }

.leads-detail-btn {
  flex-shrink: 0; background: none; border: none;
  padding: 4px 6px; cursor: pointer;
  color: #9b8060; border-radius: 4px;
  opacity: 1; line-height: 0;
  transition: background .1s;
  position: relative;
}
.leads-detail-btn:hover { background: #ede5d5; color: #5a3a10; }
.leads-detail-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(42,31,18,0.88);
  color: #f5edde;
  font-family: var(--font-primary);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 9px 12px;
  border-radius: 9px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0s linear;
  z-index: 9999;
  box-shadow: 0 8px 18px rgba(42,31,18,0.18);
}
.leads-detail-btn[data-tooltip]:hover::after {
  opacity: 1;
}
.leads-remarks-eye-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1.5px solid var(--border-light);
  background: none;
  color: #8f6f2d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), transform var(--motion-fast);
}
.leads-remarks-eye-btn:hover {
  background: #f5ede0;
  border-color: var(--primary-gold);
  color: #6b8f5d;
  transform: translateY(-1px);
}
td[data-col="remarks"] .leads-remarks-eye-btn {
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #8f6f2d;
}
td[data-col="remarks"] .leads-remarks-eye-btn:hover {
  background: none;
  border: none;
  color: #7d6033;
  transform: none;
}
td[data-col="remarks"] .leads-remarks-eye-btn svg {
  width: 16px;
  height: 16px;
}
td[data-col="remarks"] .leads-remarks-eye-btn svg path,
td[data-col="remarks"] .leads-remarks-eye-btn svg circle {
  fill: none;
  transition: fill var(--motion-fast), stroke var(--motion-fast), opacity var(--motion-fast);
}
td[data-col="remarks"] .leads-remarks-eye-btn svg circle {
  opacity: 0;
}
td[data-col="remarks"] .leads-remarks-eye-btn:hover .leads-remarks-bubble-outline {
  fill: currentColor;
  stroke: currentColor;
  opacity: 0.78;
}

/* Read-only rows — inputs/selects disabled, subtle visual cue */
.leads-row--readonly .leads-cell-input:disabled,
.leads-row--readonly .leads-cell-select:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.leads-row--readonly { opacity: 0.82; }
.leads-row--readonly:hover { opacity: 1; }

/* ── Add lead row ────────────────────────────────────────────────── */
.leads-table-row--new td {
  background: #fdf8f0;
  animation: leads-inline-row-enter 180ms ease-out;
}
.leads-new-input {
  width: 100%; height: 28px; background: transparent;
  border: 1px solid transparent; border-radius: 4px;
  padding: 2px 7px; font-family: inherit; font-size: 13px;
  color: #3a2a10; outline: none; box-sizing: border-box; display: block;
}
.leads-new-input:focus { border-color: #b09060; background: #fff; box-shadow: 0 0 0 2px rgba(176,144,96,.18); }
.leads-table-row--add-row { cursor: default !important; }
.leads-table-row--add-row td { border-right: none; padding: 0; text-align: left; cursor: default; }
.leads-table-add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  width: auto; padding: 7px 14px;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-primary); font-size: 12px;
  color: #999; text-align: left;
  transition: color 0.1s, background 0.1s;
}
.leads-table-add-btn:hover { color: var(--text-dark); background: rgba(245,240,230,0.6); }
@keyframes leads-inline-row-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .leads-table-row--new td {
    animation: none;
  }
}

.leads-resp-wrap {
  position: relative;
  padding: 0 4px;
}

.leads-resp-btn {
  position: relative;
  display: block;
  border: 1px solid #d9c19a;
  border-radius: 6px;
  background: #fffdf9;
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.leads-resp-btn:hover {
  border-color: #b99662;
  background: #fff9f1;
}

.leads-resp-btn__text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td[data-col="quote_units"] .leads-resp-btn__text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.25;
  word-break: break-word;
}

td[data-col="quote_units"] .leads-resp-btn {
  min-height: 24px;
}

.leads-resp-btn__plus {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  color: #8c6c46;
}

.leads-resp-btn--disabled {
  pointer-events: none;
  opacity: 0.72;
}

.leads-resp-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 4px;
  z-index: 1200;
  width: 188px;
  padding: 8px;
  background: #fffdf9;
  border: 1px solid #dfd3bf;
  border-radius: 8px;
  box-shadow: 0 10px 18px rgba(58, 37, 18, 0.12);
}

.leads-resp-dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: #fffdf9;
  border-top: 1px solid #dfd3bf;
  border-left: 1px solid #dfd3bf;
  transform: rotate(45deg);
  z-index: -1;
}

.leads-resp-dropdown__title {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #3a2512;
}

.leads-resp-dropdown__label {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #8f7759;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.leads-resp-primary-select {
  width: 100%;
  height: 28px;
  margin-bottom: 8px;
  padding: 0 7px;
  border: 1px solid #d9c19a;
  border-radius: 6px;
  background: #fff;
  color: #3a2512;
  font-family: var(--font-primary);
  font-size: 11px;
}

.leads-resp-primary-select:focus {
  outline: none;
  border-color: #b09060;
  box-shadow: 0 0 0 2px rgba(176, 144, 96, 0.16);
}

.leads-resp-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 116px;
  overflow: auto;
  padding-right: 2px;
}

.leads-resp-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid #ede4d6;
  border-radius: 6px;
  background: #fff;
  color: #4d3720;
  font-size: 10px;
  cursor: pointer;
}

.leads-resp-check:hover {
  border-color: #d9c19a;
  background: #fffaf1;
}

.leads-resp-check--primary-hidden {
  display: none;
}

.leads-resp-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid #c4a06a;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex: 0 0 14px;
}

.leads-resp-check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -58%) rotate(45deg);
  opacity: 0;
}

.leads-resp-check input[type="checkbox"]:checked {
  background: linear-gradient(180deg, #d8b786 0%, #c29a64 100%);
  border-color: #c29a64;
}

.leads-resp-check input[type="checkbox"]:checked::after {
  opacity: 1;
}

.leads-resp-check input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(196, 160, 106, 0.16);
}

.leads-resp-dropdown--saving {
  opacity: 0.72;
  pointer-events: none;
}

.leads-proj-wrap {
  position: relative;
}

.leads-proj-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 999;
  min-width: 180px;
  background: #fffdf9;
  border: 1px solid #d9c19a;
  border-radius: 8px;
  box-shadow: 0 10px 18px rgba(42,31,14,0.12);
  padding: 4px 0;
}

.leads-proj-dropdown::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: #fffdf9;
  border-top: 1px solid #d9c19a;
  border-left: 1px solid #d9c19a;
  transform: rotate(45deg);
  z-index: -1;
}

.leads-proj-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid #c4a06a;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex: 0 0 14px;
}

.leads-proj-check-input::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -58%) rotate(45deg);
  opacity: 0;
}

.leads-proj-check-input:checked {
  background: linear-gradient(180deg, #d8b786 0%, #c29a64 100%);
  border-color: #c29a64;
}

.leads-proj-check-input:checked::after {
  opacity: 1;
}

.leads-proj-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(196, 160, 106, 0.16);
}

/* ── Vertical column lines ──────────────────────────────────────── */
.leads-table td, .leads-table th {
  border-right: 1px solid var(--border-light);
}
.leads-table td:last-child, .leads-table th:last-child {
  border-right: none;
}

/* ── Drag handle column ──────────────────────────────────────────── */
.leads-drag-handle-th, .leads-drag-handle-cell {
  width: 28px; min-width: 28px; max-width: 28px;
  padding: 0 !important; text-align: center;
  cursor: default; border-right: none !important;
}
.leads-edit-menu {
  position: relative;
  display: inline-flex;
}
.leads-edit-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 88px;
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
}
.leads-edit-menu__caret {
  font-size: 0.78rem;
  opacity: 0.7;
  transition: transform 0.18s ease;
}
.leads-edit-menu.is-open .leads-edit-menu__caret {
  transform: rotate(180deg);
}
.leads-edit-menu__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 220px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid rgba(212, 188, 138, 0.9);
  background: linear-gradient(180deg, #fffdf9 0%, #f8f0e5 100%);
  box-shadow: 0 18px 36px rgba(86, 64, 31, 0.18);
}
.leads-edit-menu__dropdown[hidden] {
  display: none !important;
}
.leads-edit-menu__item {
  width: 100%;
  border: 1px solid rgba(224, 201, 138, 0.55);
  background: rgba(255, 255, 255, 0.82);
  color: #5d4220;
  border-radius: 10px;
  padding: 9px 11px;
  text-align: left;
  font: 600 0.84rem/1.2 "Source Sans 3", sans-serif;
  cursor: pointer;
}
.leads-edit-menu__item:hover:not(:disabled) {
  background: rgba(247, 237, 219, 0.96);
  border-color: #d0b27f;
}
.leads-edit-menu__item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.leads-drag-handle {
  display: flex; align-items: center; justify-content: center;
  height: 100%; cursor: grab; padding: 0 8px;
}
.leads-drag-handle:active { cursor: grabbing; }

/* ── Row drag states ─────────────────────────────────────────────── */
.leads-row--dragging { opacity: 0.35; }
.leads-row--draggable .leads-drag-handle { cursor: grab; }

/* Full-row ghost that follows cursor vertically */
.leads-row-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(58, 37, 18, 0.18);
  opacity: 0.97;
}
.leads-row-ghost__table {
  background: #fffdf9;
  border: 1.5px solid #e0c98a;
  border-radius: 8px;
  overflow: hidden;
}
.leads-row-ghost__table td {
  background: #fffdf9;
}
.leads-row-ghost__table .leads-cell-input,
.leads-row-ghost__table .leads-cell-select {
  pointer-events: none;
  background: transparent !important;
  box-shadow: none !important;
}
.leads-row-ghost__table .leads-detail-btn,
.leads-row-ghost__table .leads-remarks-eye-btn,
.leads-row-ghost__table .leads-phones-expand,
.leads-row-ghost__table .leads-drag-handle {
  pointer-events: none;
}

/* Gap indicator — rows shift apart to show insertion point */
.leads-row--drop-above td {
  border-top: 2.5px solid #c4a96a !important;
  padding-top: 14px !important;
  transition: padding-top 0.08s ease, border-top 0.08s ease;
}
.leads-row--drop-below td {
  border-bottom: 2.5px solid #c4a96a !important;
  padding-bottom: 14px !important;
  transition: padding-bottom 0.08s ease, border-bottom 0.08s ease;
}

/* ── Column drag states ──────────────────────────────────────────── */
.leads-col--dragging { opacity: 0.5; }
.leads-col--drag-over { background: #f0e8d8 !important; outline: 2px dashed #c4a96a; outline-offset: -2px; }

/* ── Column resize handle ────────────────────────────────────────── */
.leads-col-resize-handle {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 6px; cursor: col-resize;
  background: transparent;
  z-index: 3;
}
.leads-col-resize-handle:hover, .leads-col-resize-handle:active {
  background: rgba(196, 169, 106, 0.5);
}
.leads-table th { position: sticky; } /* needed for resize handle child + sticky header */

/* Read-only kanban cards — no grab cursor */
.leads-kanban-card--readonly { cursor: default !important; }
.leads-kanban-card--readonly:active { transform: none; }

/* ── Kanban board ──────────────────────────────────────────────── */
.leads-kanban {
  --leads-kanban-surface: #f8f4ec;
  --leads-kanban-border: var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  min-height: 100%;
  height: 100%;
  align-items: stretch;
  align-content: flex-start;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--leads-kanban-border) var(--leads-kanban-surface);
}
.leads-kanban::-webkit-scrollbar {
  width: 7px;
}
.leads-kanban::-webkit-scrollbar-track {
  background: var(--leads-kanban-surface);
  border-radius: 99px;
}
.leads-kanban::-webkit-scrollbar-thumb {
  background: var(--leads-kanban-border);
  border-radius: 99px;
}
.leads-kanban::-webkit-scrollbar-thumb:hover {
  background: var(--leads-kanban-border);
}
.leads-kanban-col {
  flex: 1 1 252px;
  border-radius: 14px;
  background:
    linear-gradient(rgba(253,248,240,0.82), rgba(253,248,240,0.82)),
    url("../assets/background2.jpg") center/220px auto repeat;
  border: 1.5px solid var(--leads-kanban-border);
  display: flex;
  flex-direction: column;
  min-width: 252px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(58, 37, 18, 0.05);
}
.leads-kanban-col[data-stage="lost"] {
  margin-left: 0;
}
.leads-kanban-stack-col {
  flex: 1 1 252px;
  min-width: 252px;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}
.leads-kanban-stack-panel {
  border-radius: 14px;
  background:
    linear-gradient(rgba(253,248,240,0.82), rgba(253,248,240,0.82)),
    url("../assets/background2.jpg") center/220px auto repeat;
  border: 1.5px solid var(--leads-kanban-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(50% - 5px);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(58, 37, 18, 0.05);
}
.leads-kanban-col-header {
  padding: 9px 12px;
  font-family: var(--font-primary);
  font-size: 13px; font-weight: 700;
  color: var(--text-dark);
  text-transform: none;
  letter-spacing: 0.01em;
  border-bottom: 1.5px solid var(--leads-kanban-border);
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 14px 14px 0 0;
}
.leads-kanban-header-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.leads-kanban-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.leads-kanban-header-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2b2116;
  opacity: 0.95;
}
.leads-kanban-header-arrow svg {
  width: 18px;
  height: 18px;
  display: block;
}
.leads-kanban-count {
  font-size: 11px;
  font-weight: 400;
  background: var(--primary-gold);
  color: var(--text-dark);
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.leads-kanban-col-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--leads-kanban-border) transparent;
}
.leads-kanban-col-body::-webkit-scrollbar {
  width: 5px;
}
.leads-kanban-col-body::-webkit-scrollbar-track {
  background: transparent;
}
.leads-kanban-col-body::-webkit-scrollbar-thumb {
  background: rgba(157,129,97,0.35);
  border-radius: 99px;
}
.leads-kanban-col-body::-webkit-scrollbar-thumb:hover {
  background: rgba(157,129,97,0.55);
}
.leads-kanban-col-body--stacked {
  padding: 7px;
}
.leads-kanban-col--drop .leads-kanban-col-body {
  background: rgba(217,193,154,0.15);
  border-radius: 0 0 14px 14px;
}
.leads-kanban-card {
  position: relative;
  z-index: 0;
  overflow: visible;
  background: linear-gradient(180deg, #fbf4e9 0%, #fdf8ef 100%);
  border: 1.5px solid #e7d7b8;
  border-radius: 10px;
  padding: 9px 84px 9px 14px;
  min-height: 58px;
  cursor: grab;
  transition: box-shadow var(--motion-fast), transform var(--motion-fast);
  font-family: 'Source Sans 3', sans-serif;
}
.leads-kanban-card--selected {
  border-color: #b99659;
  box-shadow: 0 0 0 2px rgba(185, 150, 89, 0.22), 0 10px 24px rgba(111,85,52,0.12);
  background: linear-gradient(180deg, #fffaf2 0%, #fff 100%);
}
.leads-kanban-card--selected::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #b99659 0%, #9d7a3e 100%);
  box-shadow: 0 4px 10px rgba(111, 85, 52, 0.18);
  transform: translateY(-50%);
  z-index: 5;
}
.leads-kanban-card--selected::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fffaf2;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  z-index: 6;
}
.leads-kanban--selection-mode .leads-kanban-card__actions,
.leads-kanban--selection-mode .leads-kanban-card__remarks-trigger {
  display: none;
}
.leads-kanban--selection-mode .leads-kanban-card {
  padding-right: 34px;
}
.leads-kanban:not(.leads-kanban--selection-mode) .leads-kanban-card--selected::before,
.leads-kanban:not(.leads-kanban--selection-mode) .leads-kanban-card--selected::after {
  content: none;
}
.leads-kanban-card__remarks-trigger {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.leads-kanban-card__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 0;
  min-width: 0;
}
.leads-kanban-card .leads-incomplete-dot {
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  flex: none;
  z-index: 4;
}
.leads-kanban-card__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Source Sans 3', sans-serif;
  line-height: 1;
}
.leads-kanban-card__phone {
  font-size: .76rem;
  color: #6f5534;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 400;
  line-height: 1.1;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leads-kanban-card:hover {
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.leads-kanban-card--remarks-open {
  z-index: 60;
  border-color: #b99659;
  box-shadow: 0 8px 24px rgba(111,85,52,0.16);
}
.leads-kanban-card.dragging { opacity: 0.5; }
.leads-kanban-card--drag-over-above {
  box-shadow: inset 0 3px 0 #6b8fcb;
}
.leads-kanban-card--drag-over-below {
  box-shadow: inset 0 -3px 0 #6b8fcb;
}
.leads-kanban-card-name {
  font-size: 13px; font-weight: 600; color: var(--text-dark);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.leads-kanban-card-meta {
  font-size: 11px; color: var(--text-brown);
  display: flex; flex-direction: column; gap: 2px;
}
.leads-kanban-card__actions {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  z-index: 3;
}
.leads-kanban-card__actions .leads-detail-btn--interest {
  margin-right: -3px;
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn,
.leads-kanban-card__actions .leads-detail-btn,
.leads-kanban-card__actions .leads-edit-btn,
.leads-kanban-card__actions .leads-remarks-eye-btn {
  position: relative;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #8f6f2d;
}
.leads-kanban-card__actions .leads-detail-btn,
.leads-kanban-card__actions .leads-edit-btn {
  color: #8b7659;
}
.leads-kanban-card__actions .leads-detail-btn:hover,
.leads-kanban-card__actions .leads-edit-btn:hover,
.leads-kanban-card__actions .leads-remarks-eye-btn:hover {
  background: none;
  border: none;
  color: #7d6033;
  transform: none;
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn:hover {
  background: none;
  border: none;
  color: #7d6033;
  transform: translateY(0);
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn svg path,
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn svg circle,
.leads-kanban-card__actions .leads-detail-btn svg path,
.leads-kanban-card__actions .leads-edit-btn svg path {
  fill: none;
  transition: fill var(--motion-fast), stroke var(--motion-fast), opacity var(--motion-fast);
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn svg circle {
  opacity: 0;
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn:hover .leads-remarks-bubble-outline {
  fill: currentColor;
  stroke: currentColor;
  opacity: 1;
}
.leads-kanban-card__actions .leads-detail-btn:not(.leads-detail-btn--interest):hover svg path,
.leads-kanban-card__actions .leads-edit-btn:hover svg path:last-child {
  fill: currentColor;
  stroke: currentColor;
  opacity: 1;
}
.leads-kanban-card__actions .leads-detail-btn--interest:hover {
  color: #6f5225;
}
.leads-kanban-card__actions .leads-detail-btn--interest:hover .leads-interest-home-body {
  fill: currentColor !important;
  stroke: currentColor !important;
  opacity: 1;
}
.leads-kanban-card__actions .leads-detail-btn--interest:hover .leads-interest-home-door {
  fill: none !important;
  stroke: #8b7659 !important;
  opacity: 1;
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn svg,
.leads-kanban-card__actions .leads-detail-btn svg,
.leads-kanban-card__actions .leads-edit-btn svg,
.leads-kanban-card__actions .leads-remarks-eye-btn svg {
  width: 13px;
  height: 13px;
  display: block;
}
.leads-kanban-card__remarks-trigger .leads-remarks-eye-btn svg {
  width: 18px;
  height: 18px;
}

.leads-kanban-card .leads-detail-btn[data-tooltip]::after,
.leads-kanban-card .leads-edit-btn[data-tooltip]::after,
.leads-kanban-card .leads-remarks-eye-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: fixed;
  background: rgba(42,31,18,0.88);
  color: #f5edde;
  font-family: var(--font-primary);
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 8px 11px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.01s linear;
  z-index: 99999;
  box-shadow: 0 8px 18px rgba(42,31,18,0.18);
}
.leads-kanban-card .leads-detail-btn[data-tooltip]::after,
.leads-kanban-card .leads-edit-btn[data-tooltip]::after {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.leads-kanban-card .leads-remarks-eye-btn[data-tooltip]::after {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.leads-kanban-card .leads-detail-btn[data-tooltip]:hover::after,
.leads-kanban-card .leads-edit-btn[data-tooltip]:hover::after,
.leads-kanban-card .leads-remarks-eye-btn[data-tooltip]:hover::after {
  opacity: 1;
}
.leads-kanban-remarks-bubble {
  position: fixed;
  z-index: 1400;
  max-height: min(70vh, 520px);
  min-width: 260px;
  border-radius: 18px;
  border: 1px solid rgba(196,169,106,0.55);
  background:
    linear-gradient(rgba(255,250,243,0.97), rgba(255,250,243,0.97)),
    url("../assets/background2.jpg") center/220px auto repeat;
  box-shadow: 0 24px 60px rgba(42,31,14,0.18);
  overflow: hidden;
}
.leads-kanban-remarks-bubble--wide {
  max-height: min(76vh, 620px);
}
.leads-kanban-remarks-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 28px;
  width: 18px;
  height: 18px;
  background: #fff9f0;
  border-left: 1px solid rgba(196,169,106,0.55);
  border-bottom: 1px solid rgba(196,169,106,0.55);
  transform: rotate(45deg);
}
.leads-kanban-remarks-bubble--left::before {
  left: auto;
  right: -10px;
  border-left: none;
  border-bottom: none;
  border-right: 1px solid rgba(196,169,106,0.55);
  border-top: 1px solid rgba(196,169,106,0.55);
}
.leads-kanban-remarks-bubble__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 10px 12px 0;
}
.leads-kanban-remarks-bubble__title {
  font-family: var(--font-primary);
  font-size: .96rem;
  font-weight: 600;
  color: #3a2512;
  line-height: 1.1;
}
.leads-kanban-remarks-bubble__title-name {
  font-size: .84rem;
  font-weight: 400;
  color: #7f6546;
}
.leads-kanban-remarks-bubble__add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(111,85,52,0.2);
  background: rgba(255,255,255,0.82);
  color: #7a5228;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.leads-kanban-remarks-bubble__body {
  max-height: min(60vh, 440px);
  overflow-y: auto;
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
}
.leads-kanban-remarks-bubble--wide .leads-kanban-remarks-bubble__body {
  max-height: min(66vh, 540px);
}
.leads-kanban-remarks-bubble__loading,
.leads-kanban-remarks-bubble__empty {
  padding: 10px 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: .88rem;
  color: #8b7659;
}
.leads-kanban-remarks-note-wrap {
  display: block;
}
.leads-kanban-remarks-note {
  border: 1px solid rgba(196,169,106,0.32);
  border-radius: 14px;
  background: rgba(255,253,248,0.96);
  padding: 10px 11px 11px;
  box-shadow: 0 4px 14px rgba(58,37,18,0.05);
}
.leads-kanban-remarks-note__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.leads-kanban-remarks-note__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.leads-kanban-remarks-note__label {
  font-family: var(--font-primary);
  font-size: .78rem;
  font-weight: 700;
  color: #6f5534;
  line-height: 1.15;
}
.leads-kanban-remarks-note__time,
.leads-kanban-remarks-note__edit {
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: .72rem;
  color: #8f6c47;
}
.leads-kanban-remarks-note--lost {
  background: linear-gradient(180deg, rgba(255,248,244,0.96), rgba(255,252,249,0.96));
  border-color: rgba(192,128,128,0.32);
}
.leads-kanban-remarks-note__actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.leads-kanban-remarks-note__delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: none;
  color: #9a7b55;
  cursor: pointer;
}
.leads-kanban-remarks-note__delete svg {
  width: 14px;
  height: 14px;
  display: block;
}
.leads-kanban-remarks-note__delete:hover {
  color: #7f5f3b;
}
.leads-kanban-remarks-note__edit {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}
.leads-kanban-remarks-note__edit:hover {
  color: #6f5534;
  text-decoration: underline;
}
.leads-kanban-remarks-note__body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: .88rem;
  line-height: 1.45;
  color: #3a2512;
  white-space: pre-wrap;
  word-break: break-word;
}
.leads-kanban-remarks-note__editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leads-kanban-remarks-note__editor-field {
  position: relative;
}
.leads-kanban-remarks-note__editor-input {
  width: 100%;
  min-height: 128px;
  max-height: min(34vh, 280px);
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(196,169,106,0.38);
  background: #fffdf9;
  padding: 9px 42px 9px 10px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: .88rem;
  line-height: 1.45;
  color: #3a2512;
  outline: none;
  overflow-y: auto;
}
.leads-kanban-remarks-note__editor-mic {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--primary-gold);
  background: var(--gold-light);
  color: var(--text-brown);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), var(--shadow-button);
  transition: transform var(--motion-fast), background var(--motion-fast), box-shadow var(--motion-fast), color var(--motion-fast);
}
.leads-kanban-remarks-note__editor-mic svg {
  width: 14px;
  height: 14px;
}
.leads-kanban-remarks-note__editor-mic:hover:not(:disabled) {
  background: var(--gold-hover);
  transform: translateY(-1px);
}
.leads-kanban-remarks-note__editor-mic.is-listening {
  background: #c97a5b;
  border-color: #b55f42;
  color: #fff8f2;
  animation: leads-kanban-mic-pulse 1.1s ease-in-out infinite;
}
.leads-kanban-remarks-note__editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.leads-kanban-remarks-note__editor-btn {
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-primary);
  font-size: .76rem;
  cursor: pointer;
  border: 1px solid rgba(196,169,106,0.45);
}
.leads-kanban-remarks-note__editor-btn--ghost {
  background: #fff8ee;
  color: #7a5228;
}
.leads-kanban-remarks-note__editor-btn--save {
  background: var(--gold-light);
  color: #3a2512;
}
.leads-kanban-remarks-composer {
  border: 1px solid rgba(196,169,106,0.4);
  border-radius: 14px;
  background: rgba(255,253,248,0.98);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.leads-kanban-remarks-composer__field {
  position: relative;
}
.leads-kanban-remarks-composer__input {
  width: 100%;
  min-height: 110px;
  max-height: min(32vh, 260px);
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(196,169,106,0.38);
  background: #fffdf9;
  padding: 9px 42px 9px 10px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: .88rem;
  line-height: 1.45;
  color: #3a2512;
  outline: none;
  overflow-y: auto;
}
.leads-kanban-remarks-composer__mic {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--primary-gold);
  background: var(--gold-light);
  color: var(--text-brown);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), var(--shadow-button);
  transition: transform var(--motion-fast), background var(--motion-fast), box-shadow var(--motion-fast), color var(--motion-fast);
}
.leads-kanban-remarks-composer__mic svg {
  width: 14px;
  height: 14px;
}
.leads-kanban-remarks-composer__mic:hover:not(:disabled) {
  background: var(--gold-hover);
  transform: translateY(-1px);
}
.leads-kanban-remarks-composer__mic.is-listening {
  background: #c97a5b;
  border-color: #b55f42;
  color: #fff8f2;
  animation: leads-kanban-mic-pulse 1.1s ease-in-out infinite;
}
.leads-kanban-remarks-composer__mic:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
@keyframes leads-kanban-mic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(201,122,91,0.35), inset 0 1px 0 rgba(255,255,255,0.2); }
  70% { box-shadow: 0 0 0 8px rgba(201,122,91,0), inset 0 1px 0 rgba(255,255,255,0.2); }
  100% { box-shadow: 0 0 0 0 rgba(201,122,91,0), inset 0 1px 0 rgba(255,255,255,0.2); }
}
.leads-kanban-remarks-composer__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.leads-kanban-remarks-composer__btn {
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-primary);
  font-size: .76rem;
  cursor: pointer;
  border: 1px solid rgba(196,169,106,0.45);
}
.leads-kanban-remarks-composer__btn--ghost {
  background: #fff8ee;
  color: #7a5228;
}
.leads-kanban-remarks-composer__btn--save {
  background: var(--gold-light);
  color: #3a2512;
}

/* ── Funnel view ───────────────────────────────────────────────── */
.leads-funnel { padding: 20px 0; }
.leads-funnel-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px;
}
.leads-funnel-label {
  font-family: var(--font-primary);
  font-size: 13px; font-weight: 600;
  color: var(--text-dark);
  width: 100px; text-align: right;
  flex-shrink: 0;
}
.leads-funnel-bar {
  height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-primary);
  font-size: 13px; font-weight: 700;
  color: var(--text-dark);
  min-width: 40px;
  transition: width 0.4s ease;
}
.leads-funnel-lost {
  text-align: center;
  font-family: var(--font-primary);
  font-size: 12px;
  color: var(--text-brown);
  opacity: 0.7;
  margin-top: 8px;
}

/* ── Card grid ─────────────────────────────────────────────────── */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.leads-grid-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow var(--motion-fast), transform var(--motion-fast);
  font-family: var(--font-primary);
}
.leads-grid-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.leads-grid-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.leads-grid-card-name {
  font-size: 15px; font-weight: 700; color: var(--text-dark);
}
.leads-grid-card-body {
  font-size: 12px; color: var(--text-brown);
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 10px;
}
.leads-grid-card-footer {
  display: flex; justify-content: space-between; align-items: center;
}

/* ── Lead detail page ──────────────────────────────────────────── */
.lead-detail-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 32px 36px;
  background: var(--bg-card);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-elevated);
}
.lead-overdue-banner {
  background: #fdeaea;
  border: 1.5px solid #e74c3c;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: var(--font-primary);
  font-size: 13px;
  color: #c0392b;
  font-weight: 600;
  margin-bottom: 16px;
}
.lead-detail-header { margin-bottom: 20px; }
.lead-detail-name-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.lead-detail-name-row h2 {
  font-family: var(--font-primary);
  font-size: 22px; color: var(--text-dark); margin: 0;
}
.lead-detail-meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--font-primary);
  font-size: 13px; color: var(--text-brown);
}
.lead-detail-meta strong { color: var(--text-dark); }

/* ── Stage stepper ─────────────────────────────────────────────── */
.lead-stage-stepper {
  display: flex; align-items: flex-start; gap: 0;
  margin-bottom: 14px; padding: 12px 0;
}
.lead-stepper-step {
  display: flex; flex-direction: column; align-items: center;
  position: relative; flex: 1; min-width: 0;
}
.lead-stepper-dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2.5px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-brown);
  background: #fff; flex-shrink: 0; z-index: 1;
  transition: all .15s ease;
}
.lead-stepper-dot--done {
  background: var(--dot-color, #cfe8cf);
  border-color: var(--dot-border, #8fbc8f);
  color: #fff;
}
.lead-stepper-dot--active {
  background: var(--dot-color, #d5b885);
  border-color: var(--dot-border, #b09060);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(217,193,154,0.35);
  transform: scale(1.1);
}
.lead-stepper-dot--dim {
  background: #f5f0e8; border-color: #e0d6c4; color: #bbb;
}
.lead-stepper-check { font-size: 13px; line-height: 1; }
.lead-stepper-label {
  font-family: var(--font-primary);
  font-size: 10px; font-weight: 600;
  color: var(--text-brown);
  text-align: center; margin-top: 5px;
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.lead-stepper-connector {
  position: absolute; top: 15px; left: calc(50% + 17px);
  width: calc(100% - 34px); height: 2.5px;
  background: #e0d6c4; z-index: 0;
}
.lead-stepper-connector--done { background: #8fbc8f; }

.lead-stage-actions {
  display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap;
}
.lead-stage-actions .admin-action-btn { font-size: 13px; }
.lead-btn-lost {
  font-family: var(--font-primary);
  font-size: 13px; font-weight: 600;
  padding: 8px 18px;
  border: 1.5px solid #c08080;
  border-radius: 20px;
  background: #fdeaea;
  color: #6b2a2a;
  cursor: pointer;
  transition: background var(--motion-fast);
}
.lead-btn-lost:hover { background: #f5d0d0; }
.lead-btn-reopen {
  font-family: var(--font-primary);
  font-size: 13px; font-weight: 600;
  padding: 8px 18px;
  border: 1.5px solid #8fbc8f;
  border-radius: 20px;
  background: #eaf5ea;
  color: #3a6b3a;
  cursor: pointer;
}

/* ── Sections ──────────────────────────────────────────────────── */
.lead-section {
  margin-bottom: 24px;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}
.lead-section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.lead-section-header h3 {
  font-family: var(--font-primary);
  font-size: 16px; color: var(--text-dark); margin: 0;
}

/* ── Contact list ──────────────────────────────────────────────── */
.lead-contacts-list {
  display: flex; flex-direction: column; gap: 6px;
}
.lead-contact-item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-primary);
  font-size: 13px; color: var(--text-brown);
  padding: 6px 0;
}
.lead-contact-icon { font-size: 16px; flex-shrink: 0; }
.lead-contact-value { font-weight: 600; color: var(--text-dark); }
.lead-contact-link {
  font-weight: 600; color: var(--text-dark); text-decoration: none;
}
.lead-contact-link:hover { text-decoration: underline; color: #6f5534; }
.lead-contact-wa {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #25d366; color: #fff; flex-shrink: 0;
  transition: opacity var(--motion-fast), transform .1s;
  text-decoration: none;
}
.lead-contact-wa svg { width: 14px; height: 14px; }
.lead-contact-wa:hover { opacity: 0.85; transform: scale(1.08); }
/* Copy number button */
.lead-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  background: #f5efe6; border: 1px solid #d9c19a; color: #6f5534;
  cursor: pointer; transition: background .15s, transform .1s;
  font-size: .75rem; font-weight: 600;
}
.lead-copy-btn:hover { background: #ede4d6; transform: scale(1.08); }
.lead-copy-btn:active { transform: scale(1); }
.lead-contact-label {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 6px;
  background: #f0e9d8; color: var(--text-brown);
  text-transform: uppercase;
}
.lead-contact-primary {
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 6px;
  background: var(--primary-gold); color: var(--text-dark);
  text-transform: uppercase;
}

/* ── Project interests ─────────────────────────────────────────── */
.lead-projects-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.lead-project-chip {
  font-family: var(--font-primary);
  font-size: 12px; font-weight: 600;
  padding: 6px 14px;
  border-radius: 10px;
  background: #f8f2e8;
  border: 1.5px solid var(--border-light);
  color: var(--text-dark);
}
.lead-project-chip-type {
  font-size: 10px; color: var(--text-brown); font-weight: 400;
}

/* ── Activity timeline ─────────────────────────────────────────── */
.leads-timeline {
  position: relative;
  padding-left: 28px;
}
.leads-timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-light);
}
.leads-timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.leads-timeline-dot {
  position: absolute;
  left: -24px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--border-light);
}
.leads-timeline-dot--call        { background: #3498db; }
.leads-timeline-dot--whatsapp    { background: #25d366; }
.leads-timeline-dot--site_visit  { background: #e67e22; }
.leads-timeline-dot--meeting     { background: #9b59b6; }
.leads-timeline-dot--email       { background: #e74c3c; }
.leads-timeline-dot--note        { background: #95a5a6; }
.leads-timeline-dot--stage_change      { background: var(--primary-gold); }
.leads-timeline-dot--assignment_change { background: #2ecc71; }
.leads-timeline-content {
  font-family: var(--font-primary);
}
.leads-timeline-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.leads-timeline-type {
  font-size: 12px; font-weight: 700;
  color: var(--text-dark);
}
.leads-timeline-by {
  font-size: 11px; color: var(--text-brown);
}
.leads-timeline-date {
  font-size: 11px; color: var(--text-brown); opacity: 0.7;
}
.leads-timeline-remark {
  font-size: 13px; color: var(--text-brown);
  margin: 0 0 4px; line-height: 1.5;
}
.leads-timeline-followup {
  font-size: 12px; color: var(--text-brown);
}
.leads-timeline-stage-change {
  font-size: 12px; font-weight: 600;
  color: var(--text-dark);
  display: flex; align-items: center; gap: 6px;
}

/* ── Form modal ────────────────────────────────────────────────── */
.leads-form-modal {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px 32px 28px;
  max-width: 560px;
  width: 560px;
  box-shadow: 0 10px 60px rgba(0,0,0,0.2);
  max-height: 88vh;
  overflow-y: auto;
}
.leads-form-modal h3 {
  font-family: var(--font-primary);
  font-size: 20px;
  color: var(--text-dark);
  margin: 0 0 22px;
  padding-right: 28px;
}
.leads-form-group {
  margin-bottom: 18px;
}
.leads-form-group > label,
.leads-form-label {
  display: block;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #2a1f0e;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
}
.leads-form-input {
  width: 100%;
  font-family: var(--font-primary);
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  background: #fff;
  color: var(--text-dark);
  outline: none;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
  box-sizing: border-box;
}
.leads-form-input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(217,193,154,.2);
}
textarea.leads-form-input { resize: vertical; min-height: 80px; }

.lead-source-input-wrap {
  position: relative;
}
.lead-source-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  z-index: 40;
  background: #fdfaf5;
  border: 1px solid rgba(217,193,154,0.75);
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(42,31,14,0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 170px;
  max-width: min(170px, calc(100vw - 32px));
  max-height: 150px;
  overflow: visible;
}
.lead-source-suggestions::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 16px;
  width: 12px;
  height: 12px;
  background: #fdfaf5;
  border-top: 1px solid rgba(217,193,154,0.75);
  border-left: 1px solid rgba(217,193,154,0.75);
  transform: rotate(45deg);
  z-index: -1;
}
.lead-source-suggestion-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,0.95);
  background: #fff;
  border-radius: 7px;
  padding: 6px 8px;
  font-family: var(--font-primary);
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-dark);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.lead-source-suggestion-item:hover {
  background: #f7efe2;
  border-color: rgba(255,255,255,1);
  transform: translateY(-1px);
}

.leads-contact-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.leads-contact-row .leads-form-input {
  flex: 1;
  min-width: 0;
}
.leads-contact-row .leads-label {
  width: 110px !important;
  flex: 0 0 110px;
}
.leads-form-add-btn {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-brown);
  background: none;
  border: 1.5px dashed var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 14px;
  margin-top: 4px;
  transition: border-color var(--motion-fast), color var(--motion-fast);
}
.leads-form-add-btn:hover { border-color: var(--primary-gold); color: var(--text-dark); }

.leads-form-remove-btn {
  flex-shrink: 0;
  background: none;
  border: 1.5px solid #e0c8c8;
  color: #c08080;
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background var(--motion-fast), color var(--motion-fast);
  padding: 0;
}
.leads-form-remove-btn:hover { background: #fde8e8; color: #a04040; }

/* ── Priority / activity pills ─────────────────────────────────── */
.leads-priority-pills,
.leads-activity-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.leads-pill {
  font-family: var(--font-primary);
  font-size: 13px;
  padding: 7px 18px;
  border: 1.5px solid var(--border-light);
  border-radius: 20px;
  background: #fff;
  color: var(--text-brown);
  cursor: pointer;
  transition: all var(--motion-fast);
  white-space: nowrap;
}
/* Priority-coloured pills */
.leads-pill[data-val="hot"]         { border-color: #d09070; color: #5a2010; background: #f2c4b0; }
.leads-pill[data-val="hot"].active  { background: #c07858; border-color: #c07858; color: #fff; }
.leads-pill[data-val="warm"]        { border-color: #c8a040; color: #604010; background: #f5e0a0; }
.leads-pill[data-val="warm"].active { background: #c89030; border-color: #c89030; color: #fff; }
.leads-pill[data-val="cold"]        { border-color: #7898b8; color: #1a3a5a; background: #b8d4ea; }
.leads-pill[data-val="cold"].active { background: #5878a8; border-color: #5878a8; color: #fff; }

.leads-pill.active,
.leads-pill.leads-pill--active {
  background: #6b1e2a;
  border-color: #6b1e2a;
  color: #fff;
}
.leads-pill:hover:not(.active):not(.leads-pill--active) {
  border-color: var(--primary-gold);
  background: #fdf6ec;
}

/* ── Project checkboxes ────────────────────────────────────────── */
.leads-project-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.leads-project-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
}
.leads-project-check input[type=checkbox] { accent-color: #6b1e2a; cursor: pointer; }

/* ── Edit button (pencil icon in views) ────────────────────────── */
.leads-edit-btn {
  background: none;
  border: 1.5px solid var(--border-light);
  border-radius: 7px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-brown);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
  line-height: 0;
}
.leads-edit-btn:hover { background: #f5ede0; border-color: var(--primary-gold); color: #7d6033; }
.leads-project-check {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-primary);
  font-size: 13px; color: var(--text-brown);
}
.leads-project-check input[type="checkbox"] {
  accent-color: var(--primary-gold);
}

/* ── Leads empty state ─────────────────────────────────────────── */
.leads-empty {
  text-align: center; padding: 48px 20px;
  font-family: var(--font-primary);
  font-size: 15px; color: var(--text-brown); opacity: 0.6;
}
.leads-empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 20px;
  font-family: var(--font-primary);
}
.leads-clear-filters-btn {
  font-family: var(--font-primary); font-size: 13px; font-weight: 600;
  color: var(--text-brown); background: var(--gold-light);
  border: 1px solid var(--primary-gold); border-radius: 20px;
  padding: 6px 18px; cursor: pointer;
  transition: background var(--motion-fast);
}
.leads-clear-filters-btn:hover { background: var(--gold-hover); }

/* ── Phone mode overrides ──────────────────────────────────────── */
@media (max-width: 660px) {
  .leads-card { padding: 14px 14px 12px; }
  .leads-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .leads-filter-row { flex-direction: column; }
  .leads-search { min-width: 0; }
  .leads-kanban { flex-direction: column; }
  .leads-kanban-col { flex: 0 0 auto; min-height: 200px; max-height: none; height: auto; }
  .leads-kanban-col[data-stage="lost"] { margin-left: 0; }
  .leads-kanban-stack-col { flex: 0 0 auto; margin-left: 0; height: auto; }
  .leads-kanban-stack-panel { height: auto; min-height: 180px; }
  .leads-funnel-label { width: 70px; font-size: 11px; }
  .lead-detail-card { padding: 16px 14px 24px; margin: 0 12px; }
  .lead-detail-name-row h2 { font-size: 18px; }
  .lead-detail-meta { flex-direction: column; gap: 4px; }
  .lead-stage-stepper { flex-wrap: wrap; gap: 4px; }
  .leads-form-modal { width: calc(100% - 32px); padding: 24px 18px 20px; }
  .leads-contact-row .leads-label { width: 80px !important; flex: 0 0 80px; }
  .leads-form-modal { padding: 24px 20px 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════ */
/* ── Leads count bar ──────────────────────────────────────────── */
.leads-count-bar {
  font-family: var(--font-primary);
  font-size: 12px;
  color: #999;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 0;
}
.leads-count-bar__inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.leads-count-bar:empty {
  display: none;
}
.leads-count-bar__selected {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2e7d5;
  border: 1px solid #ddcaad;
  color: #6f5534;
  font-weight: 600;
}
.leads-count-bar__actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.leads-count-bar__btn {
  height: 32px;
  padding: 0 12px;
}

/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; border-radius: 12px;
  font-family: var(--font-primary); font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
.toast--visible { opacity: 1; transform: translateY(0); }
.toast--success { background: #e6f4e6; color: #1a5c1a; border: 1px solid #8fbc8f; }
.toast--error   { background: #fde8e8; color: #8b1a1a; border: 1px solid #d09090; }
.toast--info    { background: #e8f0fa; color: #1a3a5a; border: 1px solid #7898b8; }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg  { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 2: QUICK-ACTION BUTTONS (lead detail page)
   ═══════════════════════════════════════════════════════════════════════ */
.lead-quick-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid #e8dfc8; margin-bottom: 4px;
}
.lead-quick-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fbf7ef; border: 1.5px solid #d9c19a; color: #4a3520;
  border-radius: 8px; padding: 6px 14px; font-size: .84rem;
  font-family: var(--font-primary); cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.lead-quick-btn:hover { background: #f0e8d6; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.lead-quick-btn:active { transform: translateY(0); box-shadow: none; }
@media (max-width: 600px) { .lead-quick-btn { font-size: .78rem; padding: 5px 10px; } }

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 2: DAYS-SINCE BADGE (table + kanban)
   ═══════════════════════════════════════════════════════════════════════ */
.leads-days-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: .75rem; font-weight: 600; white-space: nowrap; letter-spacing: .02em;
}
.leads-days-badge--fresh { background: #e6f4e6; color: #1a5c1a; border: 1px solid #b2d8b2; }
.leads-days-badge--warm  { background: #fff3cd; color: #7a5a00; border: 1px solid #f0d060; }
.leads-days-badge--stale { background: #fde8e8; color: #8b1a1a; border: 1px solid #d09090; }
.leads-days-badge--none  { background: #f5ede0; color: #aaa;    border: 1px solid #e0d0b8; }



/* ═══════════════════════════════════════════════════════════════════════
   PHASE 2: TIMELINE FILTER PILLS (lead detail)
   ═══════════════════════════════════════════════════════════════════════ */
.leads-timeline-filters {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.leads-tl-filter {
  background: #f5efe6; border: 1px solid #d9c19a; color: #6f5534;
  border-radius: 16px; padding: 3px 12px; font-size: .8rem;
  font-family: var(--font-primary); cursor: pointer; transition: background .15s;
}
.leads-tl-filter:hover { background: #ede4d6; }
.leads-tl-filter--active { background: #4a3520; color: #fbf7ef; border-color: #4a3520; }

/* ── Last-activity column sizing ──────────────────────────── */
.leads-th--last-act { white-space: nowrap; min-width: 90px; }
.leads-td--last-act { white-space: nowrap; padding: 0 8px; font-size: .78rem; color: #888; }
.leads-td--days     { white-space: nowrap; padding: 0 6px; text-align: center; }

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 4: INLINE EDITING
   ═══════════════════════════════════════════════════════════════════════ */
.lead-inline-editable {
  cursor: pointer; border-bottom: 1px dashed transparent;
  border-radius: 3px; transition: border-color .15s, background .15s;
}
.lead-inline-editable:hover {
  border-bottom-color: #d9c19a; background: rgba(217,193,154,.12);
}
.lead-inline-input {
  background: #fff; border: 1.5px solid #b09060; border-radius: 6px;
  padding: 2px 8px; font-family: var(--font-primary);
  font-size: inherit; font-weight: inherit; color: #2a1f0e;
  width: 100%; max-width: 340px; outline: none;
}
.lead-inline-input:focus { border-color: #7a5a00; box-shadow: 0 0 0 2px rgba(176,144,96,.18); }
.lead-inline-select {
  background: #fff; border: 1.5px solid #b09060; border-radius: 6px;
  padding: 2px 8px; font-family: var(--font-primary);
  font-size: inherit; color: #2a1f0e; outline: none;
}
/* Priority picker buttons (shown inline when clicking badge) */
.lead-prio-pick-btn {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: .78rem; cursor: pointer; font-family: var(--font-primary);
  margin: 0 2px; transition: transform .1s, box-shadow .1s;
}
.lead-prio-pick-btn:hover { transform: scale(1.06); box-shadow: 0 2px 6px rgba(0,0,0,.1); }
.lead-prio-pick-btn--active { font-weight: 700; outline: 2px solid rgba(0,0,0,.18); }

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 4: LAST-CONTACTED INDICATOR
   ═══════════════════════════════════════════════════════════════════════ */
.lead-last-contacted {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 10px; font-size: .82rem;
}
.lead-last-contacted--fresh { background: #e6f4e6; color: #1a5c1a; border: 1px solid #b2d8b2; }
.lead-last-contacted--warm  { background: #fff3cd; color: #7a5a00; border: 1px solid #f0d060; }
.lead-last-contacted--stale { background: #fde8e8; color: #8b1a1a; border: 1px solid #d09090; }

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 4: NOTES FIELD
   ═══════════════════════════════════════════════════════════════════════ */
.lead-notes-textarea {
  width: 100%; min-height: 72px; resize: vertical;
  border: 1.5px solid #e0d0b8; border-radius: 8px;
  padding: 10px 12px; font-family: var(--font-primary); font-size: .9rem;
  color: #2a1f0e; background: #fdfaf5; box-sizing: border-box;
  transition: border-color .15s;
}
.lead-notes-textarea:focus { outline: none; border-color: #b09060; box-shadow: 0 0 0 2px rgba(176,144,96,.14); }
.lead-notes-hint { font-size: .73rem; color: #bbb; margin-left: auto; }

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 4: RELATED LEADS
   ═══════════════════════════════════════════════════════════════════════ */
.lead-related-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-related-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f5ede0; border: 1px solid #d9c19a; border-radius: 8px;
  padding: 5px 12px; font-size: .84rem; cursor: pointer; color: #4a3520;
  font-family: var(--font-primary); transition: background .15s, transform .1s;
}
.lead-related-chip:hover { background: #ede4d6; transform: translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════════════
   SPLIT-PANEL DETAIL VIEW (Dynamics 365 inspired)
   ═══════════════════════════════════════════════════════════════════════ */
.detail-split {
  display: flex; height: 100%; min-height: 0; overflow: hidden;
}

/* ── Left Sidebar ── */
.detail-sidebar {
  width: 270px; min-width: 270px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-right: 1.5px solid #e0d6c4; background: #faf6ee;
}
.detail-sidebar-search {
  padding: 10px 10px; border-bottom: 1px solid #e8dfc8;
}
.detail-sidebar-search input {
  width: 100%; padding: 7px 10px; border: 1.5px solid #d9c19a; border-radius: 8px;
  font-family: var(--font-primary); font-size: 12.5px; background: #fff;
  box-sizing: border-box; outline: none; transition: border-color .15s;
}
.detail-sidebar-search input:focus { border-color: #b89a60; box-shadow: 0 0 0 2px rgba(184,154,96,.15); }
.detail-sidebar-list {
  flex: 1; overflow-y: auto; padding: 0;
}

/* ── Sidebar mini-cards ── */
.detail-sidebar-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; border-left: 3px solid transparent;
  border-bottom: 1px solid #f0e8d6; transition: background .12s;
  font-family: var(--font-primary);
}
.detail-sidebar-card:hover { background: #f5efe6; }
.detail-sidebar-card--active {
  background: #ede4d6; border-left-color: #6f5534;
}
.detail-sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; color: #fff; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .03em;
}
.detail-sidebar-info { flex: 1; min-width: 0; overflow: hidden; }
.detail-sidebar-name {
  font-size: 13px; font-weight: 600; color: #2a1f0e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
}
.detail-sidebar-sub {
  font-size: 11px; color: #999; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-sidebar-stage {
  padding: 2px 7px; border-radius: 8px; font-size: .66rem;
  font-weight: 600; flex-shrink: 0; white-space: nowrap;
}

/* ── Right Panel ── */
.detail-right-panel {
  flex: 1; display: flex; overflow: hidden; min-width: 0;
}
.detail-right-placeholder {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 8px;
  color: #b0a080; font-style: italic; font-family: var(--font-primary); font-size: .95rem;
}
.detail-right-placeholder::before {
  content: ""; display: block; width: 48px; height: 48px;
  border-radius: 50%; background: #ede4d6; opacity: .5;
}

/* ── Summary column (left of right panel) ── */
.detail-summary-col {
  width: 290px; min-width: 250px; flex-shrink: 0;
  padding: 22px 18px; overflow-y: auto;
  border-right: 1px solid #e8dfc8; background: #fbf7ef;
}
.detail-avatar-lg {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.4rem; color: #fff;
  margin: 0 auto 10px; text-transform: uppercase; letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.detail-name-lg {
  font-family: var(--font-primary); font-size: 1.15rem; font-weight: 700;
  color: #2a1f0e; text-align: center; margin-bottom: 6px; word-break: break-word;
  line-height: 1.3;
}
.detail-badges-row {
  display: flex; justify-content: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap;
}
.detail-meta-table {
  width: 100%; font-size: .82rem; color: #6f5534; margin-bottom: 12px;
  border-collapse: collapse;
}
.detail-meta-table td { padding: 4px 0; vertical-align: top; }
.detail-meta-table td:first-child {
  font-weight: 600; color: #4a3520; white-space: nowrap; padding-right: 10px; width: 72px;
}
.detail-section-title {
  font-family: var(--font-primary); font-size: .88rem; font-weight: 700;
  color: #4a3520; margin: 14px 0 6px; border-bottom: 1px solid #e8dfc8; padding-bottom: 4px;
}

/* Tighter spacing for contacts and projects inside summary col */
.detail-summary-col .lead-contacts-list { font-size: .84rem; }
.detail-summary-col .lead-contact-row { padding: 5px 0; gap: 6px; }
.detail-summary-col .lead-contact-icon { font-size: .9rem; }
.detail-summary-col .lead-contact-link { font-size: .82rem; }
.detail-summary-col .lead-contact-wa { width: 18px; height: 18px; }
.detail-summary-col .lead-contact-wa svg { width: 14px; height: 14px; }
.detail-summary-col .lead-projects-list { font-size: .84rem; }
.detail-summary-col .lead-related-chips { gap: 4px; }
.detail-summary-col .lead-related-chip { font-size: .78rem; padding: 3px 8px; }

/* ── Activity column (right of right panel) ── */
.detail-activity-col {
  flex: 1; padding: 18px 20px; overflow-y: auto; min-width: 0;
}
/* Tighter spacing for activity column sections */
.detail-activity-col .lead-section { margin-bottom: 16px; }
.detail-activity-col .lead-section-header { margin-bottom: 6px; }
.detail-activity-col .lead-stage-stepper { padding: 8px 0; margin-bottom: 8px; }
.detail-activity-col .lead-stage-actions { margin-bottom: 12px; gap: 8px; }
.detail-activity-col .lead-quick-actions {
  padding: 8px 0; margin-bottom: 2px; gap: 6px;
}
.detail-activity-col .lead-quick-btn {
  padding: 5px 10px; font-size: .8rem;
}
.detail-activity-col .lead-notes-textarea {
  min-height: 60px; font-size: .84rem;
}
.detail-activity-col .leads-timeline-filters { gap: 4px; }
.detail-activity-col .leads-tl-filter { padding: 3px 10px; font-size: .78rem; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .detail-summary-col { width: 240px; min-width: 220px; padding: 16px 14px; }
}
@media (max-width: 900px) {
  .detail-right-panel { flex-direction: column; }
  .detail-summary-col {
    width: 100%; min-width: 0; border-right: none;
    border-bottom: 1px solid #e8dfc8; max-height: 280px;
  }
}
@media (max-width: 660px) {
  .detail-split { flex-direction: column; }
  .detail-sidebar {
    width: 100%; min-width: 0; max-height: 180px;
    border-right: none; border-bottom: 1.5px solid #e8dfc8;
  }
}
