/* ---- SCOUT DASHBOARD ---- */

.scout-page {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 65px);
}

/* ---- SIDEBAR ---- */
.scout-sidebar {
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
}

.btn-accent {
  background: rgba(212,168,83,0.12);
  border: 1px solid rgba(212,168,83,0.25);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.btn-accent:hover {
  background: rgba(212,168,83,0.2);
}

/* ---- CREATE FORM ---- */
.create-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.create-form h3 {
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-group label {
  font-size: 0.72rem;
  color: var(--fg-2);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.55rem 0.75rem;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent-dim);
}

.form-group select[multiple] {
  height: 80px;
}

.form-hint {
  font-size: 0.68rem;
  color: var(--fg-3);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn-primary {
  background: var(--accent);
  border: none;
  color: #111;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-2);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.btn-ghost:hover { border-color: var(--fg-3); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.78rem; }

/* ---- PROFILE LIST ---- */
.profile-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.profile-item:hover { border-color: var(--accent-dim); background: var(--surface2); }
.profile-item.active { border-color: var(--accent); background: rgba(212,168,83,0.06); }

.profile-info { display: flex; flex-direction: column; gap: 0.2rem; }
.profile-name { font-size: 0.88rem; font-weight: 500; color: var(--fg); }
.profile-meta { font-size: 0.72rem; color: var(--fg-3); }
.profile-type { font-size: 0.72rem; color: var(--accent); margin-top: 0.2rem; }

.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--fg-3);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ---- MAIN CONTENT ---- */
.scout-main {
  padding: 2rem 2.5rem;
  overflow-y: auto;
}

.main-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 60vh;
}

.empty-hero {
  text-align: center;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--fg);
}

.empty-hero p { font-size: 0.95rem; color: var(--fg-2); line-height: 1.6; }

/* ---- PROFILE HEADER ---- */
.profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.profile-header-left h1 {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.profile-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-tag {
  font-size: 0.78rem;
  color: var(--fg-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.meta-sep { color: var(--border); font-size: 0.8rem; }

/* ---- STATS BAR ---- */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-item .stat-num {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
}

.stat-top { color: var(--accent) !important; }

.stat-item .stat-label {
  font-size: 0.72rem;
  color: var(--fg-3);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---- OPPORTUNITIES FEED ---- */
.opportunities-feed { display: flex; flex-direction: column; gap: 0; }

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.feed-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
}

.feed-count {
  font-size: 0.78rem;
  color: var(--fg-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.feed-empty {
  padding: 3rem;
  text-align: center;
  color: var(--fg-3);
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ---- OPP CARD ---- */
.opp-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.opp-card:hover { border-color: rgba(212,168,83,0.3); }

.opp-hot {
  border-color: rgba(91,191,138,0.15);
  background: rgba(91,191,138,0.03);
}

.opp-rank {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 300;
  color: var(--fg-3);
  min-width: 2rem;
  padding-top: 0.1rem;
}

.opp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }

.opp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.opp-address { display: flex; flex-direction: column; gap: 0.2rem; }

.opp-street { font-size: 0.95rem; font-weight: 500; color: var(--fg); }

.opp-city { font-size: 0.78rem; color: var(--fg-3); }

.opp-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.opp-score-num {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
}

.opp-hot .opp-score-num { color: var(--green); }

.opp-score-label {
  font-size: 0.6rem;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.opp-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.opp-tag {
  font-size: 0.72rem;
  color: var(--fg-2);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
}

.opp-value {
  color: var(--accent);
  border-color: rgba(212,168,83,0.2);
}

.opp-outlook {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.outlook-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

.outlook-high-priority { background: rgba(91,191,138,0.15); color: var(--green); border: 1px solid rgba(91,191,138,0.2); }
.outlook-worth-investigating { background: rgba(212,168,83,0.12); color: var(--accent); border: 1px solid rgba(212,168,83,0.2); }
.outlook-monitor { background: var(--surface2); color: var(--fg-2); border: 1px solid var(--border); }
.outlook-speculative { background: var(--surface2); color: var(--fg-3); border: 1px solid var(--border); }

.opp-owner { font-size: 0.75rem; color: var(--fg-3); }

.opp-summary {
  font-size: 0.82rem;
  color: var(--fg-2);
  line-height: 1.55;
  border-left: 2px solid var(--accent-dim);
  padding-left: 0.85rem;
}

.opp-signals {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.signal-chip {
  font-size: 0.68rem;
  color: var(--fg-3);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: capitalize;
}

/* ---- NAV ACTIVE ---- */
.nav-active { color: var(--fg) !important; font-weight: 500; }

/* ---- SOURCE STATUS PANEL ---- */
.source-status-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.source-status-panel h3 {
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}

.source-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
}

.source-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-dot.healthy { background: var(--green); }
.source-dot.down { background: #e74c3c; }
.source-dot.unknown { background: var(--fg-3); }

.source-name { color: var(--fg); font-weight: 500; flex: 1; }
.source-type { color: var(--fg-3); font-size: 0.7rem; }
.source-count { color: var(--fg-2); font-size: 0.72rem; }

.source-refresh {
  font-size: 0.7rem;
  color: var(--fg-3);
}

/* ---- SCAN HISTORY ---- */
.scan-history {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.scan-history h3 {
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}

.scan-log-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.scan-log-item:last-child { border-bottom: none; }

.scan-log-status {
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.65rem;
}

.scan-log-status.completed { background: rgba(91,191,138,0.12); color: var(--green); }
.scan-log-status.failed { background: rgba(231,76,60,0.12); color: #e74c3c; }
.scan-log-status.running { background: rgba(212,168,83,0.12); color: var(--accent); }

.scan-log-detail { color: var(--fg-2); flex: 1; }
.scan-log-time { color: var(--fg-3); font-size: 0.7rem; }
.scan-log-source { font-size: 0.65rem; color: var(--fg-3); }

/* ---- HEADER ACTIONS ---- */
.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-rescan {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-2);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-rescan:hover { border-color: var(--accent); color: var(--accent); }

.btn-rescan svg { opacity: 0.6; }

/* ---- MOTIVATION BADGE ---- */
.opp-header-right {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-shrink: 0;
}

.motiv-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
}

.motiv-num {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
}

.motiv-label {
  font-size: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.75;
  line-height: 1;
  margin-top: 2px;
}

/* Score 5 = red/hot */
.motiv-5 { background: rgba(220, 53, 69, 0.12); border: 1.5px solid rgba(220, 53, 69, 0.35); color: #dc3545; }
/* Score 4 = orange */
.motiv-4 { background: rgba(253, 126, 20, 0.12); border: 1.5px solid rgba(253, 126, 20, 0.35); color: #fd7e14; }
/* Score 3 = yellow/amber */
.motiv-3 { background: rgba(212, 168, 83, 0.15); border: 1.5px solid rgba(212, 168, 83, 0.35); color: var(--accent); }
/* Score 2 = gray */
.motiv-2 { background: var(--surface2); border: 1.5px solid var(--border); color: var(--fg-2); }
/* Score 1 = light gray */
.motiv-1 { background: var(--surface); border: 1.5px solid var(--border); color: var(--fg-3); }

/* Tooltip */
.motiv-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.72rem;
  color: var(--fg-2);
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  max-width: 280px;
  white-space: normal;
  line-height: 1.4;
  text-align: left;
}

.motiv-badge:hover .motiv-tooltip { display: block; }

/* ---- FILTER CHIPS ---- */
.feed-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
}

.filter-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-chip:hover {
  border-color: var(--accent-dim);
  color: var(--fg);
}

.filter-chip.active {
  background: rgba(212,168,83,0.14);
  border-color: rgba(212,168,83,0.4);
  color: var(--accent);
}

/* ---- SKIP-TRACE BUTTON ---- */
.btn-skip-trace {
  background: rgba(91,191,138,0.08);
  border: 1px solid rgba(91,191,138,0.25);
  color: var(--green);
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.btn-skip-trace:hover {
  background: rgba(91,191,138,0.15);
  border-color: rgba(91,191,138,0.45);
}

/* ---- SKIP-TRACE SLIDE-OVER ---- */
.st-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
}
.st-overlay.open { display: block; }

.st-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.st-panel.open { right: 0; }

.st-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.st-panel-title {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.st-panel-address {
  font-size: 0.78rem;
  color: var(--fg-3);
}

.st-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-3);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}
.st-close:hover { border-color: var(--fg-3); color: var(--fg); }

.st-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.st-loading {
  color: var(--fg-3);
  font-size: 0.88rem;
  padding: 2rem 0;
  text-align: center;
}

.st-error {
  color: #e74c3c;
  font-size: 0.85rem;
  padding: 1.5rem 0;
  text-align: center;
}

.st-section {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.st-section:last-child { border-bottom: none; }

.st-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 0.6rem;
}

.st-owner-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.2rem;
}

.st-owner-type {
  font-size: 0.75rem;
  color: var(--fg-3);
  text-transform: capitalize;
}

.st-mailing {
  font-size: 0.88rem;
  color: var(--fg);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.st-flag {
  display: inline-block;
  font-size: 0.72rem;
  background: rgba(220,53,69,0.08);
  border: 1px solid rgba(220,53,69,0.2);
  color: #dc3545;
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
}
.st-flag.st-flag-ok {
  background: rgba(91,191,138,0.08);
  border-color: rgba(91,191,138,0.2);
  color: var(--green);
}

.st-contact-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}
.st-contact-label {
  color: var(--fg-3);
  font-size: 0.72rem;
  width: 1.2rem;
  flex-shrink: 0;
}
.st-contact-val {
  color: var(--fg);
  font-weight: 500;
  word-break: break-all;
}

.st-empty { font-size: 0.8rem; color: var(--fg-3); }

.st-source-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.st-source-chip {
  font-size: 0.65rem;
  color: var(--fg-3);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.st-mock-badge {
  font-size: 0.65rem;
  color: var(--fg-3);
  background: rgba(212,168,83,0.07);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.st-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem 0 0.5rem;
  flex-wrap: wrap;
}
.st-actions .btn-primary,
.st-actions .btn-accent {
  flex: 1;
  text-align: center;
  min-width: 120px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .scout-page { grid-template-columns: 1fr; }
  .scout-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .scout-main { padding: 1.5rem; }

  /* Slide-over full-width on mobile */
  .st-panel { width: 100vw; right: -100vw; }
  .opp-header-right { flex-wrap: wrap; gap: 0.5rem; }
  .btn-skip-trace { order: -1; }
}