/* ══════════════════════════════════════════
   IM PROSPECTOR — STYLES
   ══════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #002F6C;
  --navy-light: #0a3d7a;
  --navy-dark: #0a1628;
  --sky: #27C1F4;
  --sky-light: #4fd1ff;
  --sky-muted: #e6f7fe;
  --charcoal: #333740;
  --cool-grey: #DCDDEB;
  --slate: #64748b;
  --warm-gray: #94a3b8;
  --light: #f1f5f9;
  --lighter: #f8fafc;
  --white: #ffffff;
  --green: #22c55e;
  --green-muted: #dcfce7;
  --amber: #f59e0b;
  --amber-muted: #fef3c7;
  --red: #ef4444;
  --red-muted: #fee2e2;
  --display: 'Julius Sans One', 'Trebuchet MS', sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--lighter);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; }

/* ══════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-dark);
  padding: 20px;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo svg { height: 32px; width: auto; }

.login-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--slate);
  text-align: center;
  margin-bottom: 32px;
}

.login-error {
  display: none;
  background: var(--red-muted);
  color: var(--red);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  text-align: center;
}

.login-error.visible { display: block; }

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-group:last-of-type {
  margin-bottom: 24px;
}

.login-form .btn-primary {
  width: 100%;
  justify-content: center;
}

/* ══════════════════════════════════════════
   TOP BAR / NAVIGATION
   ══════════════════════════════════════════ */
.top-bar {
  background: var(--navy-dark);
  color: var(--white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(39, 193, 244, 0.15);
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-bar-logo svg { height: 20px; width: auto; opacity: 0.9; }

.top-bar-title {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--sky);
}

.top-bar-nav {
  display: flex;
  gap: 0;
  height: 56px;
  align-items: stretch;
}

.top-bar-nav a {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--warm-gray);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.top-bar-nav a:hover {
  color: var(--white);
  border-bottom-color: rgba(39, 193, 244, 0.3);
}

.top-bar-nav a.active {
  color: var(--white);
  border-bottom-color: var(--sky);
}

.top-bar-nav a svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-name {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
}

.btn-logout {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--warm-gray);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
}

/* ══════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.page-section {
  display: none;
  padding: 32px 0 60px;
  animation: fadeIn 0.3s ease;
}

.page-section.active { display: block; }

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

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--cool-grey);
}

.section-header-left {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.section-title {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  color: var(--navy);
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 13px;
  color: var(--slate);
}

/* ══════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }

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

.form-group label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy);
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="search"],
.form-group textarea {
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 16px;
  border: 1px solid var(--cool-grey);
  border-radius: 8px;
  background: var(--white);
  color: var(--charcoal);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(39, 193, 244, 0.15);
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-inline .form-group { flex: 1; }

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--sky);
  color: var(--white);
  padding: 14px 32px;
}

.btn-primary:hover {
  background: var(--sky-light);
  box-shadow: 0 4px 16px rgba(39, 193, 244, 0.3);
}

.btn-primary:disabled {
  background: var(--cool-grey);
  color: var(--warm-gray);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--light);
  color: var(--slate);
  padding: 12px 24px;
  border: 1px solid var(--cool-grey);
}

.btn-secondary:hover {
  background: var(--cool-grey);
  color: var(--navy);
}

.btn-sm {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 8px 16px;
  gap: 6px;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: 1px solid var(--cool-grey);
  color: var(--slate);
  border-radius: 6px;
}

.btn-icon:hover {
  border-color: var(--sky);
  color: var(--navy);
  background: var(--sky-muted);
}

.btn-danger {
  background: var(--red-muted);
  color: var(--red);
  padding: 12px 24px;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn-navy {
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
}

.btn-navy:hover {
  background: var(--navy-light);
}

.btn-navy:disabled {
  background: var(--cool-grey);
  color: var(--warm-gray);
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 20px;
  transition: box-shadow 0.25s;
}

.card:hover { box-shadow: 0 4px 24px rgba(0, 47, 108, 0.06); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card h3 .icon {
  width: 28px;
  height: 28px;
  background: var(--navy);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card h3 .icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--white);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.card p, .card li {
  color: #475569;
  font-size: 14.5px;
  line-height: 1.75;
}

/* ══════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  padding: 24px;
  transition: box-shadow 0.25s;
  cursor: default;
}

.stat-card:hover { box-shadow: 0 4px 24px rgba(0, 47, 108, 0.06); }

.stat-card .stat-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-family: var(--display);
  font-size: 36px;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card .stat-detail {
  font-size: 12px;
  color: var(--warm-gray);
}

.stat-card.stat-highlight {
  border-color: var(--sky);
  background: linear-gradient(135deg, rgba(39, 193, 244, 0.03), var(--white));
}

.stat-card.stat-highlight .stat-value { color: var(--sky); }

.stat-card.stat-warning { border-color: var(--amber); }
.stat-card.stat-warning .stat-value { color: var(--amber); }

.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { box-shadow: 0 4px 24px rgba(0, 47, 108, 0.1); }

/* Mobile prospect cards (hidden by default, shown at <=768px) */
.prospect-cards {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.prospect-card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.prospect-card:hover { box-shadow: 0 4px 16px rgba(0, 47, 108, 0.08); }
.prospect-card.overdue { border-left: 3px solid var(--red); }

.prospect-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.prospect-card-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
}

.prospect-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--slate);
  flex-wrap: wrap;
}

.prospect-card-meta .next-action { font-weight: 600; }
.prospect-card-meta .next-action.overdue { color: var(--red); }

.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.follow-up-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--light);
  cursor: pointer;
  transition: background 0.15s;
}

.follow-up-item:last-child { border-bottom: none; }

.follow-up-item:hover { background: var(--lighter); margin: 0 -16px; padding: 12px 16px; border-radius: 6px; }

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

.follow-up-dot.overdue { background: var(--red); }
.follow-up-dot.today { background: var(--amber); }
.follow-up-dot.upcoming { background: var(--green); }

.follow-up-info { flex: 1; min-width: 0; }

.follow-up-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.follow-up-note {
  font-size: 12px;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.follow-up-date {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
  flex-shrink: 0;
}

.activity-feed-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--light);
  font-size: 13px;
}

.activity-feed-item:last-child { border-bottom: none; }

.activity-feed-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--light);
}

.activity-feed-icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--slate);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.activity-feed-text { flex: 1; color: var(--charcoal); line-height: 1.5; }
.activity-feed-text strong { color: var(--navy); }

.activity-feed-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--warm-gray);
  flex-shrink: 0;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--slate);
}

.empty-state svg {
  margin-bottom: 16px;
  stroke: var(--cool-grey);
}

.empty-state p {
  font-size: 14px;
  color: var(--warm-gray);
  max-width: 360px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════
   RESEARCH SECTION
   ══════════════════════════════════════════ */
.research-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--cool-grey);
}

.research-tab {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--slate);
  padding: 12px 24px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.research-tab:hover { color: var(--navy); }
.research-tab.active { color: var(--navy); border-bottom-color: var(--sky); }

.research-panel { display: none; }
.research-panel.active { display: block; }

/* Count slider */
.count-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.count-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--cool-grey);
  outline: none;
}

.count-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sky);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(39, 193, 244, 0.3);
}

.count-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sky);
  cursor: pointer;
  border: none;
}

.count-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  min-width: 32px;
  text-align: center;
}

/* Loading animation */
.loading-overlay {
  display: none;
  margin-top: 28px;
}

.loading-overlay.visible { display: block; }

.loading-card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  border-top: 3px solid var(--sky);
  padding: 48px 32px;
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--cool-grey);
  border-top-color: var(--sky);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-card h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}

.loading-card p {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.6;
}

.loading-steps {
  margin-top: 24px;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--slate);
  font-family: var(--mono);
  letter-spacing: 0.5px;
}

.loading-step .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cool-grey);
  flex-shrink: 0;
  transition: background 0.3s;
}

.loading-step.active .dot {
  background: var(--sky);
  box-shadow: 0 0 8px rgba(39, 193, 244, 0.4);
  animation: pulse 1s ease infinite;
}

.loading-step.done .dot { background: var(--green); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Result cards */
.result-card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
  border-left: 3px solid var(--sky);
  transition: box-shadow 0.2s;
}

.result-card:hover { box-shadow: 0 4px 20px rgba(0, 47, 108, 0.08); }

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.result-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.result-card-fit {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.result-card-body {
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
}

.result-card-body .field {
  display: flex;
  gap: 8px;
  padding: 3px 0;
}

.result-card-body .field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--slate);
  min-width: 100px;
  flex-shrink: 0;
  padding-top: 2px;
}

.result-card-body .field-value {
  flex: 1;
}

.result-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--light);
}

.result-card-actions .btn-sm.saved {
  background: var(--green-muted);
  color: #166534;
  border-color: #bbf7d0;
}

.result-meta-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.meta-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--light);
  color: var(--slate);
}

.meta-pill.tier { background: var(--green-muted); color: #166534; }
.meta-pill.t2 { background: var(--amber-muted); color: #92400e; }
.meta-pill.pill-success { background: var(--green-muted); color: #166534; }
.meta-pill.pill-failed { background: var(--red-muted); color: #b91c1c; }

/* Research history */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--light);
  gap: 16px;
}

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

.history-info { flex: 1; }

.history-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

.history-meta {
  font-size: 12px;
  color: var(--slate);
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   PROSPECTS TABLE
   ══════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-bar .form-group {
  flex: 0 1 auto;
  min-width: 0;
}

.filter-bar .form-group.search-group {
  flex: 1;
  min-width: 200px;
}

.filter-bar .form-group select,
.filter-bar .form-group input {
  padding: 10px 14px;
  font-size: 13px;
}

.filter-bar .form-group select {
  padding-right: 36px;
}

.prospects-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  overflow: hidden;
}

.prospects-table thead th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 16px;
  background: var(--light);
  color: var(--slate);
  border-bottom: 1px solid var(--cool-grey);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s;
}

.prospects-table thead th:hover { color: var(--navy); }

.prospects-table thead th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.3;
  font-size: 10px;
}

.prospects-table thead th.sorted .sort-icon { opacity: 1; color: var(--sky); }

.prospects-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.prospects-table tbody tr:hover { background: var(--lighter); }

.prospects-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--light);
  font-size: 13px;
  color: #475569;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prospects-table tbody tr:last-child td { border-bottom: none; }

.prospects-table tbody tr.overdue { background: #fff5f5; }
.prospects-table tbody tr.overdue:hover { background: #fee2e2; }

.prospect-company {
  font-weight: 600;
  color: var(--navy);
}

.prospect-contact {
  font-size: 12px;
  color: var(--slate);
  margin-top: 2px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  font-family: var(--mono);
  font-size: 11px;
  padding: 8px 14px;
  border: 1px solid var(--cool-grey);
  border-radius: 6px;
  background: var(--white);
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
}

.pagination button:hover { border-color: var(--sky); color: var(--navy); }
.pagination button.active { background: var(--sky); color: var(--white); border-color: var(--sky); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination .page-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--warm-gray);
  padding: 0 8px;
}

/* ══════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════ */
.status-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.status-badge.status-not-contacted,
.status-badge.status-not_contacted { background: #e2e8f0; color: #475569; }

.status-badge.status-called-interested,
.status-badge.status-called_interested { background: rgba(39, 193, 244, 0.15); color: #0369a1; }

.status-badge.status-in-pipeline,
.status-badge.status-in_pipeline { background: var(--amber-muted); color: #92400e; }

.status-badge.status-won { background: var(--green-muted); color: #166534; }

.status-badge.status-lost { background: var(--red-muted); color: #b91c1c; }

.status-badge.status-called-not-fit,
.status-badge.status-called_not_fit { background: var(--red-muted); color: #b91c1c; }

.status-badge.status-research_result { background: #e0e7ff; color: #3730a3; }

/* Social URL pills */
.social-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.social-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  background: var(--light);
  color: var(--navy);
  border: 1px solid var(--cool-grey);
  transition: all 0.15s ease;
}

.social-pill:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Enrichment badges */
.enrichment-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
}

.enrichment-badge.enrichment-none { background: var(--light); color: var(--warm-gray); }
.enrichment-badge.enrichment-pending { background: #fef3c7; color: #92400e; }
.enrichment-badge.enrichment-partial { background: #dbeafe; color: #1e40af; }
.enrichment-badge.enrichment-complete { background: var(--green-muted); color: #166534; }
.enrichment-badge.enrichment-failed { background: var(--red-muted); color: #b91c1c; }

/* Fit score indicators */
.fit-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cool-grey);
}

.fit-dot.active { background: var(--sky); }
.fit-score.fit-1 .fit-dot:nth-child(1) { background: var(--warm-gray); }
.fit-score.fit-2 .fit-dot:nth-child(-n+2) { background: var(--amber); }
.fit-score.fit-3 .fit-dot:nth-child(-n+3) { background: var(--green); }

/* ══════════════════════════════════════════
   PROSPECT DETAIL
   ══════════════════════════════════════════ */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--slate);
  text-decoration: none;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  transition: color 0.15s;
  background: none;
  border: none;
}

.detail-back:hover { color: var(--navy); }

.detail-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.detail-header-left { flex: 1; }

.detail-company {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 400;
  color: var(--navy);
  text-transform: uppercase;
  line-height: 1.2;
  margin-bottom: 4px;
}

.detail-industry {
  font-size: 14px;
  color: var(--slate);
}

.detail-assignee {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
  margin-top: 2px;
}

.detail-header-phone {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  color: var(--sky);
  text-decoration: none;
  margin-top: 4px;
}

.detail-header-phone:hover { text-decoration: underline; }

.detail-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.detail-info-card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 47, 108, 0.06);
}

.detail-info-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--light);
}

.detail-info-section:last-child { border-bottom: none; }

.detail-info-section h4 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 12px;
}

.detail-field {
  display: flex;
  padding: 6px 0;
  gap: 12px;
  font-size: 13px;
}

.detail-field-label {
  font-weight: 600;
  color: var(--navy);
  min-width: 140px;
  flex-shrink: 0;
}

.detail-field-value {
  color: #475569;
  flex: 1;
  word-break: break-word;
}

.detail-field-value a {
  color: var(--sky);
  text-decoration: none;
}

.detail-field-value a:hover { text-decoration: underline; }

/* CRM sync indicator */
.crm-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 6px;
}

.crm-indicator.synced { background: var(--green-muted); color: #166534; }
.crm-indicator.pending { background: var(--amber-muted); color: #92400e; }
.crm-indicator.failed { background: var(--red-muted); color: #b91c1c; }
.crm-indicator.none { background: var(--light); color: var(--slate); }

/* ══════════════════════════════════════════
   DISCOVERY SECTION
   ══════════════════════════════════════════ */
.discovery-section {
  border-left: 3px solid #6366f1;
}

.discovery-summary {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
  line-height: 1.5;
}

.discovery-meta {
  font-weight: 400;
  color: var(--slate);
  font-size: 13px;
}

.discovery-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.discovery-fit-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.discovery-fit-label {
  font-weight: 600;
  color: var(--navy);
}

.discovery-fit-text {
  color: var(--slate);
  font-size: 12px;
}

.discovery-batch {
  color: var(--slate);
  font-size: 12px;
}

.discovery-toggle {
  background: var(--light);
  border: 1px solid var(--cool-grey);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--sky);
  cursor: pointer;
  padding: 6px 12px;
  margin-top: 4px;
  transition: all 0.15s;
}

.discovery-toggle:hover {
  color: var(--navy);
}

.discovery-detail {
  margin-top: 8px;
  padding-left: 4px;
}

.discovery-detail-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--charcoal);
  padding: 3px 0;
  padding-left: 12px;
  border-left: 2px solid var(--cool-grey);
}

.discovery-status-icon {
  font-size: 12px;
  flex-shrink: 0;
}

.discovery-status-icon.success { color: var(--green); }
.discovery-status-icon.failed { color: var(--red); }
.discovery-status-icon.pending { color: var(--amber); }

/* ══════════════════════════════════════════
   ACTIVITY TIMELINE
   ══════════════════════════════════════════ */
.timeline-card {
  background: var(--white);
  border: 1px solid var(--cool-grey);
  border-radius: 10px;
  padding: 24px;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

.sidebar-sync-bar {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  text-align: center;
}

.sidebar-sync-bar a {
  color: inherit;
  text-decoration: none;
}

.sidebar-sync-bar a:hover { text-decoration: underline; }

.sidebar-sync-bar.sync-synced { background: var(--green-muted); color: #166534; }
.sidebar-sync-bar.sync-pending { background: var(--amber-muted); color: #92400e; }
.sidebar-sync-bar.sync-failed { background: var(--red-muted); color: #b91c1c; }

.timeline-card h4 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 20px;
}

.activity-form {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--light);
}

.activity-form textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 13px;
  padding: 12px 14px;
  border: 1px solid var(--cool-grey);
  border-radius: 8px;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 10px;
}

.activity-form textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(39, 193, 244, 0.15);
}

.activity-form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.activity-form-row .form-group { flex: 1; min-width: 120px; }

.activity-form-row .form-group input,
.activity-form-row .form-group select {
  padding: 8px 12px;
  font-size: 12px;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--cool-grey);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--cool-grey);
}

.timeline-item.type-call .timeline-dot { border-color: var(--sky); background: rgba(39, 193, 244, 0.1); }
.timeline-item.type-status .timeline-dot { border-color: var(--amber); background: rgba(245, 158, 11, 0.1); }
.timeline-item.type-note .timeline-dot { border-color: var(--slate); }
.timeline-item.type-email .timeline-dot { border-color: var(--green); background: rgba(34, 197, 94, 0.1); }
.timeline-item.type-research .timeline-dot { border-color: var(--navy); background: rgba(0, 47, 108, 0.1); }
.timeline-item.type-crm .timeline-dot { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }

.timeline-time {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--warm-gray);
  margin-bottom: 4px;
}

.timeline-user {
  font-size: 11px;
  color: var(--slate);
  font-weight: 500;
}

.timeline-content {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
  margin-top: 4px;
}

.timeline-type-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.type-call .timeline-type-label { background: rgba(39, 193, 244, 0.1); color: #0284c7; }
.type-status .timeline-type-label { background: var(--amber-muted); color: #92400e; }
.type-note .timeline-type-label { background: var(--light); color: var(--slate); }
.type-email .timeline-type-label { background: var(--green-muted); color: #166534; }
.type-research .timeline-type-label { background: rgba(0, 47, 108, 0.08); color: var(--navy); }
.type-crm .timeline-type-label { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }

/* ══════════════════════════════════════════
   DEEP DIVE MODAL
   ══════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 22, 40, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 47, 108, 0.3);
}

.modal-header {
  background: var(--navy);
  color: var(--white);
  padding: 20px 28px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.25); }

.modal-body {
  padding: 28px;
}

.modal-body .results-body { margin: 0; }

/* Results body (markdown-rendered content) */
.results-body h1, .results-body h2, .results-body h3 {
  font-family: var(--sans);
  color: var(--navy);
  margin-top: 20px;
  margin-bottom: 8px;
}

.results-body h1 { font-size: 20px; font-weight: 700; }
.results-body h2 { font-size: 17px; font-weight: 600; border-bottom: 1px solid var(--cool-grey); padding-bottom: 8px; }
.results-body h3 { font-size: 15px; font-weight: 600; }

.results-body strong { color: var(--navy); }

.results-body hr {
  border: none;
  border-top: 1px solid var(--cool-grey);
  margin: 16px 0;
}

.results-body ul { list-style: none; padding: 0; }
.results-body ul li {
  padding: 2px 0 2px 18px;
  position: relative;
  font-size: 13px;
  color: #475569;
  line-height: 1.7;
}
.results-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sky);
  opacity: 0.6;
}

.results-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 16px 0;
}

.results-body table th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  background: var(--light);
  color: var(--slate);
  border-bottom: 1px solid var(--cool-grey);
}

.results-body table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--light);
  color: #475569;
}

.results-body a {
  color: var(--sky);
  text-decoration: none;
}

.results-body a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(0, 47, 108, 0.15);
  border: 1px solid var(--cool-grey);
  animation: toastIn 0.3s ease;
  transition: opacity 0.3s, transform 0.3s;
  font-size: 13px;
  color: var(--charcoal);
}

.toast.hiding {
  opacity: 0;
  transform: translateX(100%);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.toast.toast-success .toast-icon { background: var(--green-muted); }
.toast.toast-success .toast-icon svg { stroke: var(--green); }

.toast.toast-error .toast-icon { background: var(--red-muted); }
.toast.toast-error .toast-icon svg { stroke: var(--red); }

.toast.toast-warning .toast-icon { background: var(--amber-muted); }
.toast.toast-warning .toast-icon svg { stroke: var(--amber); }

.toast.toast-info .toast-icon { background: var(--sky-muted); }
.toast.toast-info .toast-icon svg { stroke: var(--sky); }

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--warm-gray);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.toast-close:hover { color: var(--charcoal); }

/* ══════════════════════════════════════════
   IMPORT BANNER
   ══════════════════════════════════════════ */
.import-banner {
  background: var(--sky-muted);
  border: 1px solid rgba(39, 193, 244, 0.3);
  border-radius: 10px;
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.import-banner-text {
  font-size: 14px;
  color: var(--navy);
}

.import-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   UTILITY
   ══════════════════════════════════════════ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }

.skeleton {
  background: linear-gradient(90deg, var(--light) 25%, #e2e8f0 50%, var(--light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-100 { width: 100%; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }

  .top-bar-inner { padding: 0 16px; }
  .top-bar-title { display: none; }
  .top-bar-nav a { padding: 0 12px; font-size: 10px; letter-spacing: 1px; }
  .top-bar-nav a span.nav-label { display: none; }
  .user-name { display: none; }

  .section-title { font-size: 22px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }

  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }

  .dashboard-grid { grid-template-columns: 1fr 1fr; }

  .filter-bar { flex-direction: column; }
  .filter-bar .form-group { width: 100%; }

  /* Hide table on mobile, show card view */
  .prospects-table { display: none; }
  .prospect-cards { display: flex !important; }

  .btn-sm { padding: 12px 20px; min-height: 44px; }
  .top-bar-nav a { min-height: 48px; }

  .detail-header { flex-direction: column; }
  .detail-company { font-size: 24px; }

  .modal-overlay { padding: 20px 10px; }
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 20px; }

  .btn-row { flex-direction: column; }
  .btn-row .btn { width: 100%; justify-content: center; }

  .login-card { padding: 32px 24px; }

  .toast-container { left: 16px; right: 16px; max-width: none; }

  .import-banner { flex-direction: column; text-align: center; }

  .card { padding: 20px; }

  .activity-form-row { flex-direction: column; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 28px; }
  .detail-company { font-size: 20px; }
  .detail-header-actions { width: 100%; }
  .detail-header-actions .btn { flex: 1; justify-content: center; }
}
