/* =========================================================
   Spectacle Pro - Deal Finder & Synchronized Table View
   ========================================================= */

/* Main Container */
#deal-finder-workspace {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0b0f19;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  color: #f1f5f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

/* Hidden by default */
#deal-finder-workspace.hidden {
  display: none !important;
}

/* Top Command Ribbon */
.df-ribbon {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10005;
  position: relative;
  min-height: 56px;
  box-sizing: border-box;
}

.df-ribbon-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.df-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.df-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.df-county-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  background: #1e293b;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #334155;
}

/* View Switcher Controls (Table / Split / Map) */
.df-view-switcher {
  display: inline-flex;
  background: #1e293b;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #334155;
  gap: 2px;
}

.df-view-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.df-view-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.df-view-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

/* Close / Return to Map */
.df-exit-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.df-exit-btn:hover {
  background: #334155;
  color: #ffffff;
}

/* Secondary Filter & Workspace Bar */
.df-filter-bar {
  background: #0d1322;
  border-bottom: 1px solid #1e293b;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 15;
  flex-shrink: 0;
}

.df-workspaces {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.df-workspace-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-right: 2px;
}

.df-preset-chip {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.df-preset-chip:hover {
  background: #283548;
  color: #ffffff;
  border-color: #475569;
}

.df-preset-chip.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Granular Filter Controls */
.df-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.df-search-input-wrap {
  position: relative;
  min-width: 220px;
}

.df-search-input-wrap i.fa-magnifying-glass {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.8rem;
  pointer-events: none;
}

.df-search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  font-size: 0.8rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.df-search-clear-btn:hover {
  color: #f8fafc;
}

.df-input {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 0.8rem;
  padding: 6px 28px 6px 30px;
  border-radius: 6px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.df-input:focus {
  border-color: #3b82f6;
}

.df-select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.df-select:focus {
  border-color: #3b82f6;
}

.df-sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  background: #1e293b;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #334155;
}

.df-sync-toggle input {
  cursor: pointer;
  accent-color: #10b981;
}

/* Split view sync is automatic by default; hide manual toggle button */
#df-sync-label {
  display: none !important;
}

/* Main Body Workspace (Split View Flex Container - Stacked Column) */
.df-body-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-height: 0;
  height: calc(100% - 56px);
}

/* Table Section */
.df-table-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0b0f19;
  overflow: hidden;
  width: 100%;
  min-height: 0;
}

/* View Mode Layouts */
#deal-finder-workspace.mode-table .df-table-container {
  flex: 1 1 100%;
  height: 100%;
}
#deal-finder-workspace.mode-table .df-map-container {
  display: none !important;
}

#deal-finder-workspace.mode-split .df-map-container {
  flex: 0 0 46%;
  height: 46%;
  min-height: 240px;
  border-bottom: 2px solid #1e293b;
  display: block !important;
  position: relative;
  width: 100%;
}

#deal-finder-workspace.mode-split .df-table-container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: none;
  width: 100%;
}

#deal-finder-workspace.mode-map .df-table-container {
  display: none !important;
}
#deal-finder-workspace.mode-map .df-map-container {
  flex: 1 1 100%;
  height: 100%;
  display: block !important;
}

/* Map Section in Split View */
.df-map-container {
  position: relative;
  background: #0f172a;
  width: 100%;
}

.df-map-slot {
  width: 100%;
  height: 100%;
}

/* Hide directory brand pill when Deal Finder is active (ribbon handles county branding) */
body.df-workspace-active #map-to-directory-link {
  display: none !important;
}

/* In mode-map, hide the table filter ribbon so the map gets maximum real estate below the top bar */
#deal-finder-workspace.mode-map .df-filter-bar {
  display: none !important;
}

/* Ensure map search container is comfortably styled and scrollable in split mode */
body.df-mode-split #search-container {
  max-height: calc(100% - 20px);
  overflow-y: auto;
}

/* Optimize inspection card inside the split map view */
body.df-workspace-active #map-info-box {
  max-height: calc(100% - 20px) !important;
  top: 10px;
  right: 10px;
  z-index: 20;
}

/* Table Scroll Wrapper */
.df-table-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}

.df-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
  white-space: nowrap;
}

.df-data-table thead {
  position: sticky;
  top: 0;
  background: #111827;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.df-data-table th {
  padding: 10px 14px;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1e293b;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.df-data-table th.df-th-sortable {
  cursor: pointer;
}

.df-data-table th.df-th-sortable:hover {
  color: #f1f5f9;
  background: #1e293b;
}

.df-sort-icon {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.68rem;
  color: #64748b;
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.df-data-table th.df-th-sortable:hover .df-sort-icon {
  opacity: 0.85;
  color: #cbd5e1;
}

.df-data-table th.active-sort {
  color: #10b981 !important;
  background: rgba(16, 185, 129, 0.08);
}

.df-data-table th.active-sort .df-sort-icon {
  opacity: 1 !important;
  color: #10b981 !important;
}

.df-data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #1e293b;
  color: #cbd5e1;
  vertical-align: middle;
}

.df-data-table tbody tr {
  transition: background 0.12s ease;
  cursor: pointer;
}

.df-data-table tbody tr:hover {
  background: #1e293b;
}

.df-data-table tbody tr.active-selected {
  background: rgba(37, 99, 235, 0.22) !important;
  outline: 1px solid #3b82f6;
}

@keyframes dfRowPulse {
  0% {
    background-color: rgba(59, 130, 246, 0.45);
    box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.4);
  }
  50% {
    background-color: rgba(59, 130, 246, 0.25);
    box-shadow: inset 0 0 6px rgba(59, 130, 246, 0.2);
  }
  100% {
    background-color: rgba(37, 99, 235, 0.22);
    box-shadow: none;
  }
}

.df-data-table tbody tr.df-row-located {
  animation: dfRowPulse 1.6s ease-out;
}

.df-data-table tbody tr.hover-highlighted {
  background: rgba(245, 158, 11, 0.14);
}

/* Table Cell Formatting */
.df-cell-owner {
  font-weight: 600;
  color: #f8fafc;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-cell-situs {
  color: #94a3b8;
  font-size: 0.78rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-cell-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  text-align: right;
}

.df-cell-val-main {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #f8fafc;
  text-align: right;
}

.df-cell-val-sub {
  font-size: 0.69rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-align: right;
  margin-top: 2px;
}

.df-cell-ag-use {
  color: #fbbf24;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.df-cell-price {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #34d399;
  text-align: right;
}

.df-cell-sale-ppa {
  font-size: 0.72rem;
  color: #a7f3d0;
  font-weight: 600;
  margin-left: 4px;
}

.df-cell-date {
  font-size: 0.72rem;
  color: #64748b;
  text-align: right;
}

.df-cell-sale {
  text-align: right;
}

.df-cell-tenure-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
}

.df-cell-anomaly-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
}

.df-badge-anomaly {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Absentee Badges */
.df-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.df-badge-out-of-state {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.df-badge-non-resident {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.df-badge-local {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Tenure Badges */
.df-badge-tenure {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.df-badge-flip {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.df-badge-new-owner {
  background: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.df-badge-tenure-subtle {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.67rem;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

/* Owner Multi-Parcel Portfolio Pill */
.df-portfolio-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.df-portfolio-pill:hover {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
  transform: translateY(-1px);
}

/* Due Diligence Risk & Infrastructure Badges */
.df-dd-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.df-dd-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.df-dd-flood-a {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.df-dd-dry {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.df-dd-well {
  background: rgba(14, 165, 233, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.df-dd-fiber {
  background: rgba(168, 85, 247, 0.14);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Portfolio Isolation Banner */
.df-portfolio-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(79, 70, 229, 0.2) 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.4);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #e0e7ff;
  font-weight: 600;
  animation: dfFadeIn 0.2s ease-out;
}

.df-portfolio-clear-btn {
  background: #312e81;
  color: #e0e7ff;
  border: 1px solid rgba(99, 102, 241, 0.5);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.df-portfolio-clear-btn:hover {
  background: #4338ca;
  color: #ffffff;
}

/* Row Action Buttons */
.df-action-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.12s ease;
}

.df-action-btn:hover {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

/* Footer / Status Bar */
.df-footer {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.8rem;
  color: #94a3b8;
  flex-wrap: wrap;
  z-index: 10;
}

.df-footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.df-export-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

.df-export-btn:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.df-export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.df-pagination-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-page-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.df-page-btn:hover:not(:disabled) {
  background: #334155;
  color: #ffffff;
}

.df-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Pro Launcher Floating Pill */
.pro-deal-finder-launcher {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1.5px solid #10b981;
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-deal-finder-launcher:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Drawer Action Button */
.df-drawer-launch-btn {
  width: 100%;
  margin-top: 6px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #10b981;
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.df-drawer-launch-btn:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

body.df-workspace-active #btn-drawer-deal-finder {
  display: none !important;
}

/* Empty state and loader */
.df-loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: #94a3b8;
}

.df-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
  gap: 10px;
}

.df-empty-state i {
  font-size: 2.2rem;
  color: #475569;
}

/* Portfolio Banner & Cluster Framing */
.df-portfolio-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.18) 0%, rgba(30, 41, 59, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  padding: 8px 16px;
  margin: 8px 14px;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15);
  animation: dfBannerFadeIn 0.2s ease-out;
}

@keyframes dfBannerFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.df-portfolio-banner-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.df-portfolio-banner-title {
  color: #f1f5f9;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.df-portfolio-banner-title strong {
  color: #a5b4fc;
  font-weight: 700;
  margin-left: 4px;
}

.df-portfolio-banner-stats {
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.6);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.df-portfolio-banner-stats strong {
  color: #818cf8;
}

.df-portfolio-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-portfolio-action-btn {
  background: #312e81;
  color: #c7d2fe;
  border: 1px solid #4f46e5;
  border-radius: 6px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.df-portfolio-action-btn:hover {
  background: #4338ca;
  color: #ffffff;
  border-color: #6366f1;
  transform: translateY(-1px);
}

.df-portfolio-clear-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.df-portfolio-clear-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

/* Thematic Map Shading Switcher in Deal Finder Header */
.df-shading-switcher {
  display: inline-flex;
  align-items: center;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.df-shading-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 6px 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.df-shading-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.df-shading-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.df-shading-btn.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.df-shading-btn[data-shading="tenure"].active {
  background: #10b981;
}

.df-shading-btn[data-shading="absentee"].active {
  background: #8b5cf6;
}

/* ==============================================================================
   SPECTACLE PRO: CAMPAIGNS & CRM LITE STYLING (SPRINT 2.4 & 2.5)
   ============================================================================== */

/* Secondary Selection Action Buttons in Footer */
.df-campaign-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.df-campaign-btn:hover {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.df-campaign-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.df-labels-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

.df-labels-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.df-labels-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Campaign Workspace Banner */
.df-campaign-banner {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeIn 0.15s ease;
}

.df-campaign-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.df-campaign-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-campaign-dropdown {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  min-width: 200px;
}

.df-campaign-dropdown:focus {
  border-color: #6366f1;
}

.df-campaign-action-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.df-campaign-action-btn:hover {
  background: #334155;
  color: #ffffff;
}

.df-campaign-action-btn.df-btn-delete:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

.df-campaign-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.df-campaign-metric-chip {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.74rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.df-campaign-metric-val {
  color: #f8fafc;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

/* Status Breakdown Pills */
.df-status-pills-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.df-status-pill-filter {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  color: #94a3b8;
}

.df-status-pill-filter:hover {
  border-color: #64748b;
  color: #f1f5f9;
}

.df-status-pill-filter.active {
  background: #334155;
  color: #ffffff;
  border-color: #475569;
}

.df-status-pill-filter[data-status="uncontacted"].active {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border-color: #94a3b8;
}

.df-status-pill-filter[data-status="mail_sent"].active {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: #3b82f6;
}

.df-status-pill-filter[data-status="follow_up"].active {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: #f59e0b;
}

.df-status-pill-filter[data-status="under_contract"].active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: #10b981;
}

.df-status-pill-filter[data-status="dead"].active {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

/* In-Table Status Selectors & Badges */
.df-status-select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.df-status-select[data-status="uncontacted"] {
  border-left: 3px solid #94a3b8;
}

.df-status-select[data-status="mail_sent"] {
  border-left: 3px solid #3b82f6;
  color: #93c5fd;
}

.df-status-select[data-status="follow_up"] {
  border-left: 3px solid #f59e0b;
  color: #fcd34d;
}

.df-status-select[data-status="under_contract"] {
  border-left: 3px solid #10b981;
  color: #6ee7b7;
}

.df-status-select[data-status="dead"] {
  border-left: 3px solid #ef4444;
  color: #fca5a5;
}

/* Note Action Icon */
.df-note-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.df-note-btn:hover {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.df-note-btn.has-note {
  color: #f59e0b;
}

.df-row-remove-btn {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.df-row-remove-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Modals (Save to Campaign & Note Editor) */
.df-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

.df-modal-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
}

.df-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.df-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.df-modal-close:hover {
  color: #ffffff;
}

.df-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.df-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.df-form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
}

.df-form-input, .df-form-select, .df-form-textarea {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 0.82rem;
  outline: none;
}

.df-form-input:focus, .df-form-select:focus, .df-form-textarea:focus {
  border-color: #6366f1;
}

.df-form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.df-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #1e293b;
  background: #090d16;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.df-modal-btn-cancel {
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.df-modal-btn-cancel:hover {
  background: #1e293b;
}

.df-modal-btn-submit {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  border: none;
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.df-modal-btn-submit:hover {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.df-modal-btn-danger {
  background: #dc2626;
  border: none;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.df-modal-btn-danger:hover {
  background: #ef4444;
}

/* ==============================================================================
   PHASE 3: SPATIAL COMPS RADIUS DRAWER & MAO TARGET PRICING ENGINE
   ============================================================================== */

/* Slide-over Comps Drawer */
.df-comps-drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 500px;
  max-width: 100vw;
  height: 100vh;
  background: #0b0f19;
  border-left: 1px solid #1e293b;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  z-index: 10020;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f1f5f9;
  box-sizing: border-box;
}

.df-comps-drawer.open {
  right: 0;
}

.df-comps-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  pointer-events: none;
  z-index: 10015;
  display: none;
}

.df-comps-backdrop.open {
  display: block;
}

@media (max-width: 900px) {
  .df-comps-backdrop {
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }
}

/* Header */
.df-comps-header {
  padding: 14px 18px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.df-comps-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.df-comps-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.df-comps-subject-badge {
  font-size: 0.74rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.df-comps-close-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.df-comps-close-btn:hover {
  background: #1e293b;
  color: #f8fafc;
}

/* Scrollable Body */
.df-comps-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Filter Ribbon */
.df-comps-controls {
  background: #131b2e;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.df-comps-control-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.df-comps-control-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.df-comps-pill-group {
  display: inline-flex;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.df-comps-chip {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.df-comps-chip.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

.df-comps-toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.75rem;
  color: #cbd5e1;
  padding-top: 4px;
  border-top: 1px solid #1e293b;
}

.df-comps-toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* Benchmark Analytics HUD */
.df-comps-benchmarks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.df-benchmark-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.df-benchmark-card.primary {
  border-color: #3b82f6;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.1) 0%, rgba(17, 24, 39, 1) 100%);
}

.df-benchmark-card.emerald {
  border-color: #10b981;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1) 0%, rgba(17, 24, 39, 1) 100%);
}

.df-benchmark-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.df-benchmark-card.primary .df-benchmark-val {
  color: #60a5fa;
}

.df-benchmark-card.emerald .df-benchmark-val {
  color: #34d399;
}

.df-benchmark-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

/* MAO Underwriting Box */
.df-mao-box {
  background: linear-gradient(180deg, #131b2e 0%, #0d1322 100%);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.df-mao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-mao-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 7px;
}

.df-mao-formula-badge {
  font-size: 0.65rem;
  color: #94a3b8;
  background: #090d16;
  border: 1px solid #1e293b;
  padding: 2px 7px;
  border-radius: 4px;
}

.df-mao-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.df-mao-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
}

.df-mao-slider-input {
  width: 100%;
  accent-color: #10b981;
  cursor: pointer;
}

.df-mao-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.df-mao-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.df-mao-input-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
}

.df-mao-input {
  background: #090d16;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  outline: none;
}

.df-mao-input:focus {
  border-color: #10b981;
}

/* Dynamic Tiers Readout */
.df-mao-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px;
}

.df-mao-tier {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 6px;
}

.df-mao-tier.target {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid #059669;
}

.df-mao-tier-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
}

.df-mao-tier.target .df-mao-tier-label {
  color: #34d399;
}

.df-mao-tier-amount {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.df-mao-tier.target .df-mao-tier-amount {
  color: #10b981;
  font-size: 1.15rem;
}

.df-mao-tier-sub {
  font-size: 0.66rem;
  color: #64748b;
}

/* MAO CTA Button Group */
.df-mao-cta-group {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
}

.df-mao-cta-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.15s;
}

.df-mao-cta-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.df-mao-pitch-btn {
  background: #1e293b;
  border: 1px solid #3b82f6;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.df-mao-pitch-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #ffffff;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

/* Comps List */
.df-comps-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-comps-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.df-comp-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.15s;
}

.df-comp-card:hover {
  border-color: #3b82f6;
  background: #131b2e;
}

.df-comp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-comp-card-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.df-comp-card-ppa {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid #6366f1;
  color: #a5b4fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.df-comp-card-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.df-comp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid #1e293b;
  font-size: 0.7rem;
  color: #94a3b8;
}

.df-comp-nav-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #93c5fd;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.df-comp-nav-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* ==============================================================================
   PHASE 3: 1-CLICK CASH OFFER LETTER & PSA CONTRACT PDF GENERATOR MODAL
   ============================================================================== */

/* Modal Backdrop Overlay for Cash Offer Generator */
.df-modal-overlay,
#df-offer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 100050; /* Super high: above Comps Drawer (10020) and Deal Workspace (10000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeIn 0.15s ease;
}

.df-offer-modal-card {
  width: 640px;
  max-width: 95vw;
  max-height: 90vh;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75);
  color: #f1f5f9;
  overflow: hidden;
}

.df-offer-header {
  padding: 16px 20px;
  background: #090d16;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-offer-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.df-offer-body {
  padding: 18px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* Doc Type Switcher */
.df-offer-doc-switcher {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
  min-width: 0;
}

.df-offer-type-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}

.df-offer-type-btn.active {
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.df-offer-type-btn.pitch-active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.df-offer-fieldset {
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 23, 42, 0.5);
  min-width: 0;
  box-sizing: border-box;
}

.df-offer-legend {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.5px;
  padding: 0 6px;
}

.df-offer-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.df-offer-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.df-offer-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.df-offer-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.df-offer-input {
  background: #090d16;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f8fafc;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

.df-offer-input:focus {
  border-color: #10b981;
}

.df-offer-footer {
  padding: 14px 20px;
  background: #090d16;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-offer-preview-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #93c5fd;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.df-offer-preview-btn:hover {
  background: #1e293b;
  color: #ffffff;
}

.df-offer-download-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.df-offer-download-btn:hover {
  filter: brightness(1.1);
}

.df-offer-batch-btn {
  background: #1e293b;
  border: 1px solid #059669;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

.df-offer-batch-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #334155;
}

.df-offer-batch-btn:not(:disabled):hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

/* =================================================== */
/* SPRINT 3.4: CORPORATE ENTITY PIERCING & SOS LOOKUP  */
/* =================================================== */

.df-entity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.df-entity-badge:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.df-entity-badge.has-dossier {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.df-entity-badge.has-dossier:hover {
  background: rgba(16, 185, 129, 0.35);
  border-color: #10b981;
}

.df-action-btn.df-btn-pierce {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.df-action-btn.df-btn-pierce:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #ffffff;
}

.df-action-btn.df-btn-pierce.has-dossier {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Modal Overlay & Card */
.df-entity-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100060;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
}

.df-entity-modal-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(245, 158, 11, 0.15);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Modal Header */
.df-entity-modal-header {
  padding: 16px 20px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.df-entity-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.df-entity-modal-title i {
  color: #f59e0b;
}

.df-entity-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}

.df-entity-modal-close:hover {
  color: #ffffff;
}

/* Entity Hero Banner */
.df-entity-hero {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  border-bottom: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.df-entity-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.df-entity-raw-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

.df-entity-type-badge {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.df-entity-clean-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #94a3b8;
}

.df-entity-clean-name {
  font-family: monospace;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.df-entity-holdings-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.df-entity-holdings-bar strong {
  color: #f1f5f9;
}

/* Action Grid */
.df-pierce-section {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.df-pierce-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.df-pierce-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.df-pierce-tile {
  background: #131d31;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.df-pierce-tile:hover {
  background: #1e293b;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.df-pierce-tile.primary-sos {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(19, 29, 49, 0.9) 100%);
}

.df-pierce-tile.primary-sos:hover {
  border-color: #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.df-pierce-tile-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.df-pierce-tile-icon {
  font-size: 1.3rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.df-pierce-tile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.df-pierce-tile-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #f1f5f9;
}

.df-pierce-tile-desc {
  font-size: 0.72rem;
  color: #94a3b8;
}

.df-pierce-tile-action-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* CRM Card */
.df-pierce-crm-card {
  background: #111a2e;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.df-pierce-crm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .df-pierce-crm-row {
    grid-template-columns: 1fr;
  }
}

.df-pierce-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.df-pierce-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.df-pierce-input {
  background: #0b1120;
  border: 1px solid #334155;
  color: #f1f5f9;
  font-size: 0.84rem;
  padding: 7px 10px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}

.df-pierce-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Footer / Save Row */
.df-pierce-footer {
  padding: 14px 20px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.df-pierce-save-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid #059669;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: filter 0.15s;
}

.df-pierce-save-btn:hover {
  filter: brightness(1.1);
}

.df-pierce-saved-hint {
  font-size: 0.75rem;
  color: #34d399;
  display: none;
  align-items: center;
  gap: 5px;
}

/* Floating Toast Notification */
.df-copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100080;
  background: #0f172a;
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 12px rgba(16, 185, 129, 0.3);
  animation: dfToastFadeIn 0.25s ease-out forwards;
}

@keyframes dfToastFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}



