/* =============================================================
   SPOTREALTY — BUYER PIPELINE / KANBAN STYLES (Exact screen.png)
   ============================================================= */

.buyer-pipeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.buyer-pipeline-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 16px 4px;
  align-items: flex-start;
  min-height: calc(100vh - 250px);
  background: #f8f9fa;
  border-radius: 8px;
}

/* Custom Slim Scrollbar */
.buyer-pipeline-board::-webkit-scrollbar,
.buyer-pipeline-col-body::-webkit-scrollbar {
  height: 6px;
  width: 5px;
}
.buyer-pipeline-board::-webkit-scrollbar-track,
.buyer-pipeline-col-body::-webkit-scrollbar-track {
  background: transparent;
}
.buyer-pipeline-board::-webkit-scrollbar-thumb,
.buyer-pipeline-col-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
.buyer-pipeline-board::-webkit-scrollbar-thumb:hover,
.buyer-pipeline-col-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Pipeline Column (Exact 320px Reference Geometry) */
.buyer-pipeline-col {
  flex: 0 0 320px;
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  background: #ffffff;
  border: 1px solid rgba(199, 196, 216, 0.3);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 240px);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.buyer-pipeline-col.drag-over {
  border-color: #3525cd !important;
  background: #f5f3ff !important;
}

.buyer-pipeline-col-header {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(199, 196, 216, 0.3);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.buyer-pipeline-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.buyer-pipeline-col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.buyer-pipeline-col-title {
  font-weight: 500;
  font-size: 14px;
  color: #191c1d;
  letter-spacing: -0.01em;
}

.buyer-pipeline-col-count {
  font-size: 12px;
  font-weight: 400;
  padding: 2px 6px;
  border-radius: 9999px;
  background: #edeeef;
  color: #464555;
}

.buyer-col-more-btn {
  background: transparent;
  border: none;
  color: #464555;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.buyer-col-more-btn:hover {
  color: #191c1d;
  background: #edeeef;
}
.buyer-col-more-btn .material-symbols-outlined {
  font-size: 18px;
}

.buyer-pipeline-col-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}

/* Empty Stage State (Exact 48px Dashed Circle) */
.buyer-pipeline-empty-stage {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0.6;
  flex: 1;
  min-height: 160px;
}
.buyer-pipeline-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px dashed #777587;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  color: #777587;
  font-size: 24px;
}
.buyer-pipeline-empty-text {
  font-size: 14px;
  font-weight: 500;
  color: #464555;
  margin: 0;
}
.buyer-pipeline-empty-subtext {
  font-size: 12px;
  color: #777587;
  margin-top: 4px;
}

/* Small Buyer Card (Exact screen.png Ultra-Dense 10px Padding — 5-Row Architecture) */
.buyer-small-card {
  background: #ffffff;
  border: 1px solid rgba(199, 196, 216, 0.4);
  border-radius: 8px;
  padding: 8px 10px 8px 12px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 5px;
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.buyer-small-card:hover {
  border-color: rgba(199, 196, 216, 0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

.buyer-small-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
  transform: scale(0.98);
}

/* 4px Left Urgency Accent Bar (Decoupled from Commercial Priority) */
.buyer-card-urgency-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.buyer-card-urgency-bar.bar-error {
  background: #ba1a1a;
}
.buyer-card-urgency-bar.bar-warning {
  background: #f59e0b;
}
.buyer-card-urgency-bar.bar-neutral {
  background: #c7c4d8;
}

/* Follow-Up Overdue Soft Background Tint */
.buyer-small-card.urgency-overdue,
.buyer-small-card.urgency-long-overdue {
  background: rgba(255, 218, 214, 0.2);
  border-color: rgba(186, 26, 26, 0.3);
}

/* Row 1: Context & Triage (Labels | Priority + Primary Assignee) */
.buyer-small-card-row-1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 20px;
  gap: 6px;
}

.buyer-small-card-labels {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  overflow: hidden;
  max-width: 175px;
}

.buyer-small-card-label-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 600;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.08);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.2);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.buyer-small-card-label-overflow {
  font-size: 9px;
  font-weight: 700;
  color: #4338ca;
  background: #e0e7ff;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.3;
  flex-shrink: 0;
}

.buyer-small-card-label-empty-add {
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
  line-height: 1;
  padding: 1px 2px;
}
.buyer-small-card-label-empty-add:hover {
  color: #4f46e5;
}

.buyer-small-card-triage-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.buyer-card-priority {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.priority-hot {
  color: #ba1a1a;
}
.priority-warm {
  color: #d97706;
}
.priority-cold {
  color: #777587;
}

.buyer-small-card-assignee-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 0 0 1.5px #4f46e5;
  border: 1px solid #ffffff;
  flex-shrink: 0;
  line-height: 1;
  cursor: default;
}

.buyer-assignee-unassigned {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  flex-shrink: 0;
  line-height: 1;
  cursor: default;
}

/* Row 2: Identity & Contact (Buyer Name + #LeadID | Contact Icon + Menu) */
.buyer-small-card-row-2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  min-height: 20px;
  gap: 6px;
}

.buyer-small-card-identity-left {
  display: flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  max-width: 200px;
}

.buyer-small-card-name {
  font-weight: 600;
  font-size: 13.5px;
  color: #191c1d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  margin: 0;
}

.buyer-small-card-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 400;
  color: #64748b;
  flex-shrink: 0;
}

.buyer-small-card-actions-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.buyer-small-card-contact-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  border: 1px solid rgba(79, 70, 229, 0.2);
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}
.buyer-small-card-contact-btn:hover {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(79, 70, 229, 0.4);
}

.buyer-card-menu-btn {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.buyer-card-menu-btn:hover {
  background: #edeeef;
  color: #191c1d;
}

/* Row 3: Requirement */
.buyer-small-card-row-3 {
  font-size: 12px;
  color: #334155;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  min-height: 16px;
}

.buyer-small-card-req-empty {
  color: #94a3b8;
  font-style: italic;
  font-weight: 400;
}

/* Divider Between Row 3 and Row 4 */
.buyer-small-card-divider {
  border-top: 1px solid rgba(199, 196, 216, 0.35);
  margin: 1px 0;
  height: 0;
}

/* Row 4: Last Communication + Card Collaboration */
.buyer-small-card-row-4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  gap: 6px;
}

.buyer-small-card-comm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 175px;
}

.buyer-comm-actor-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  line-height: 1;
}

.buyer-comm-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-small-card-comm-empty {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 400;
}

/* Row 5: Follow-Up + Workflow Stage Selector */
.buyer-small-card-row-5 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  gap: 6px;
}

.buyer-followup-overdue {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #ba1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-followup-today {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #b45309;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-followup-future {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-followup-none {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 400;
}

.buyer-small-card-stage-btn,
.buyer-small-card-custom-stage-select {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 18px 2px 6px;
  border-radius: 4px;
  background: #edeeef;
  color: #191c1d;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buyer-small-card-stage-btn:hover,
.buyer-small-card-custom-stage-select:hover {
  background: #e1e3e4;
  border-color: #cbd5e1;
}

.buyer-popover-menu {
  position: absolute;
  background: #ffffff;
  border: 1px solid rgba(199, 196, 216, 0.5);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 100;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.buyer-popover-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.buyer-popover-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.buyer-popover-item.danger {
  color: #dc2626;
}
.buyer-popover-item.danger:hover {
  background: #fef2f2;
}

/* ============================================================
   Phase 13.2B: Header, View Switcher, Filter Pills & Search
   ============================================================ */

/* D1: Back to Buyer Home Link */
.buyer-header-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.buyer-header-back-link:hover {
  color: #4f46e5;
  background: #f1f5f9;
}
.buyer-header-divider {
  height: 16px;
  width: 1px;
  background: #cbd5e1;
  margin: 0 4px;
}

/* D2: View Switcher (4 Icon Buttons) */
.buyer-board-view-switcher {
  display: inline-flex;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.buyer-view-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.buyer-view-icon-btn .material-symbols-outlined {
  font-size: 18px;
}
.buyer-view-icon-btn:hover {
  background: #edeeef;
  color: #1e293b;
}
.buyer-view-icon-btn.active {
  background: #ffffff;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.buyer-view-divider {
  height: 16px;
  width: 1px;
  background: #e2e8f0;
}

/* D3: Filter Bar Pill Controls */
.buyer-board-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
  margin-top: 10px;
}
.buyer-filter-pill-main {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: #e7e8e9;
  color: #191c1d;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: default;
}
.buyer-filter-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid #c7c4d8;
  background: #f8f9fa;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.buyer-filter-pill-wrap:hover {
  border-color: #4f46e5;
  background: #ffffff;
}
.buyer-filter-pill-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 5px 26px 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #464555;
  cursor: pointer;
  outline: none;
  border-radius: 9999px;
}
.buyer-filter-pill-input {
  background: transparent;
  border: none;
  padding: 5px 6px;
  font-size: 12px;
  font-weight: 500;
  color: #464555;
  width: 58px;
  outline: none;
  border-radius: 9999px;
}
.buyer-filter-pill-input:focus {
  background: #ffffff;
}
.buyer-filter-pill-chevron {
  position: absolute;
  right: 6px;
  pointer-events: none;
  font-size: 16px;
  color: #777587;
}
.buyer-filter-divider {
  height: 16px;
  width: 1px;
  background: #c7c4d8;
  margin: 0 2px;
}
.buyer-filter-clear-btn {
  background: transparent;
  border: 1px solid #c7c4d8;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.buyer-filter-clear-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* D4: Right Aligned Search Buyers */
.buyer-filter-search-wrap {
  margin-left: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
}
.buyer-filter-search-icon {
  position: absolute;
  left: 10px;
  font-size: 16px;
  color: #777587;
  pointer-events: none;
}
.buyer-filter-search-input {
  padding: 5px 28px 5px 32px;
  border-radius: 9999px;
  border: 1px solid #c7c4d8;
  background: #f8f9fa;
  font-size: 12px;
  width: 180px;
  outline: none;
  transition: all 0.15s ease;
}
.buyer-filter-search-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
  width: 210px;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}
.buyer-filter-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
}

/* D5: Empty Stage Subtitle */
.buyer-pipeline-empty-subtext {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
  text-align: center;
  margin-top: 4px;
}

/* ============================================================
   Phase 16: Complete UI/UX Rebuild Styles (screen.png Fidelity)
   ============================================================ */

.buyer-btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.buyer-btn-header-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
.buyer-btn-header-action .material-symbols-outlined {
  font-size: 18px;
  color: #64748b;
}

.buyer-btn-primary-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 6px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}
.buyer-btn-primary-cta:hover {
  background: #4338ca;
}
.buyer-btn-primary-cta .material-symbols-outlined {
  font-size: 18px;
}

/* Column Header More Button */
.buyer-col-more-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-left: auto;
}
.buyer-col-more-btn:hover {
  color: #334155;
  background: #f1f5f9;
}
.buyer-col-more-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Board Settings Modal / Drawer */
.buyer-settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.buyer-settings-modal-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.buyer-settings-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}
.buyer-settings-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.buyer-settings-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}
.buyer-settings-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #1e293b;
}
