/* ==========================================================================
   PROSPECT INTEL — Sales intelligence overlay + dossier panel
   ========================================================================== */

.prospect-intel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.prospect-intel-wrap {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.prospect-intel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.prospect-intel-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.prospect-intel-title-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}

.prospect-intel-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.prospect-intel-sub,
.prospect-intel-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.prospect-intel-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.prospect-intel-close:hover { background: rgba(255, 255, 255, 0.15); }

.prospect-intel-search {
  position: relative;
  margin-bottom: 18px;
}
.prospect-intel-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 15px;
  padding: 14px 16px 14px 44px;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prospect-intel-search input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(255, 255, 255, 0.09);
}
.prospect-intel-search::before {
  content: '⌕';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.45);
  font-size: 18px;
  pointer-events: none;
}

.pi-org-list,
.prospect-intel-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 2px 2px 32px;
  flex: 1;
  min-height: 0;
}

.pi-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
}

.pi-org-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pi-org-card:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.4);
  transform: translateY(-2px);
}

.pi-org-card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.pi-org-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  flex-wrap: wrap;
}

.pi-org-card-type {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.pi-org-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.pi-org-card-stats strong {
  color: #fff;
  font-weight: 600;
}

/* --- Dossier slide-out --- */
.pi-dossier-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.pi-dossier-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.pi-dossier-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(720px, 100%);
  background: #0f1220;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  z-index: 10001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.pi-dossier-panel.active { transform: translateX(0); }

.pi-dossier-panel-header,
.pi-dossier-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.pi-dossier-header-text { flex: 1; min-width: 0; }
.pi-dossier-panel-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}
.pi-dossier-panel-header h2,
.pi-dossier-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.pi-dossier-panel-meta,
.pi-dossier-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}
.pi-dossier-close-btn,
.pi-dossier-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}
.pi-dossier-close:hover,
.pi-dossier-close-btn:hover { background: rgba(255, 255, 255, 0.12); }

.pi-dossier-panel-body,
.pi-dossier-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px 40px;
}

.pi-dossier-opener {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
}
.pi-dossier-opener-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}
.pi-dossier-opener-text {
  font-size: 15px;
  font-style: italic;
  color: #fff;
  line-height: 1.5;
}

.pi-dossier-section {
  margin-bottom: 24px;
}
.pi-dossier-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pi-dossier-section-tag {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.pi-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.pi-snapshot-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
}
.pi-snapshot-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pi-snapshot-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}
.pi-dossier-note {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.pi-dossier-note strong { color: #fff; }

.pi-dossier-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pi-dossier-list li {
  position: relative;
  padding: 10px 12px 10px 30px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
}
.pi-dossier-list li::before {
  content: '▸';
  position: absolute;
  left: 12px;
  top: 10px;
  color: #8b5cf6;
  font-size: 12px;
}

.pi-leadership {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.pi-leader {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
}
.pi-leader-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.pi-leader-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}
.pi-leader-note {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
  line-height: 1.4;
}

.pi-dossier-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
  line-height: 1.5;
}
.pi-dossier-sub strong { color: #fff; }

.pi-fit-section .pi-dossier-list li::before { content: '✓'; color: #34d399; }
.pi-talking-section .pi-dossier-list li::before { content: '◆'; color: #f59e0b; }
.pi-talking-section .pi-dossier-list li {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

/* ==========================================================================
   EXECUTIVE BRIEF — Generate One-Pager from Dossier
   ========================================================================== */

.pi-brief-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(236, 72, 153, 0.10));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.pi-brief-cta-card-text { flex: 1; min-width: 0; }
.pi-brief-cta-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.005em;
}
.pi-brief-cta-card-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
  line-height: 1.4;
}
.pi-brief-cta-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}
.pi-brief-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45); }
.pi-brief-cta-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* --- Brief modal --- */
.pi-brief-modal {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
}
.pi-brief-modal.active { display: flex; }
.pi-brief-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}
.pi-brief-sheet {
  position: relative;
  width: 100%;
  max-width: 880px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.pi-brief-loading {
  padding: 60px 40px;
  text-align: center;
  background: #fff;
  color: #1f2937;
}
.pi-brief-loading-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.pi-brief-loading-sub { font-size: 13px; color: #6b7280; line-height: 1.5; }
.pi-brief-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 18px;
  border: 3px solid #e5e7eb;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: piBriefSpin 0.8s linear infinite;
}
@keyframes piBriefSpin { to { transform: rotate(360deg); } }

.pi-brief-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}
.pi-brief-toolbar-left { display: flex; align-items: center; gap: 12px; }
.pi-brief-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #6366f1;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
}
.pi-brief-toolbar-org { font-size: 13px; font-weight: 600; color: #1f2937; }
.pi-brief-toolbar-right { display: flex; gap: 8px; }
.pi-brief-action {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #1f2937;
  color: #fff;
}
.pi-brief-action-secondary {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}
.pi-brief-action:hover { opacity: 0.9; }

/* --- Brief page (print-ready) --- */
.pi-brief-page {
  padding: 40px 48px 36px;
  background: #fff;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
}

.pi-brief-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 2px solid #1f2937;
  margin-bottom: 22px;
}
.pi-brief-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #1f2937;
}
.pi-brief-header-meta {
  text-align: right;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.6;
}

.pi-brief-headline {
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}
.pi-brief-subhead {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 24px;
  line-height: 1.5;
}

.pi-brief-section { margin-bottom: 22px; }
.pi-brief-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6366f1;
  margin: 0 0 10px;
}
.pi-brief-prose {
  font-size: 13px;
  color: #1f2937;
  margin: 0 0 8px;
  line-height: 1.6;
}
.pi-brief-leader {
  font-style: italic;
  color: #4b5563;
  border-left: 3px solid #6366f1;
  padding-left: 12px;
  margin-top: 10px;
}

.pi-brief-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pi-brief-list li {
  position: relative;
  padding-left: 20px;
  font-size: 12.5px;
  color: #1f2937;
  line-height: 1.55;
}
.pi-brief-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 0;
  color: #6366f1;
}

.pi-brief-opp {
  background: linear-gradient(135deg, #f5f3ff, #fdf4ff);
  border: 1px solid #ddd6fe;
  border-radius: 12px;
  padding: 18px 20px;
}
.pi-brief-opp-headline {
  font-size: 24px;
  font-weight: 800;
  color: #4f46e5;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}
.pi-brief-opp-calc {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 16px;
  font-style: italic;
}
.pi-brief-opp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.pi-brief-opp-item {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
}
.pi-brief-opp-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}
.pi-brief-opp-value {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 2px 0 3px;
}
.pi-brief-opp-note { font-size: 10.5px; color: #6b7280; line-height: 1.4; }

.pi-brief-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 22px;
}
.pi-brief-two-col .pi-brief-section { margin-bottom: 0; }

.pi-brief-timeline {
  display: flex;
  gap: 16px;
}
.pi-brief-milestone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.pi-brief-milestone-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pi-brief-milestone-week { font-size: 10px; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: 0.06em; }
.pi-brief-milestone-label { font-size: 12px; color: #1f2937; line-height: 1.4; }

.pi-brief-cta {
  background: #1f2937;
  color: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 20px;
}
.pi-brief-cta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a5b4fc;
  margin-bottom: 4px;
}
.pi-brief-cta-text { font-size: 14px; font-weight: 600; line-height: 1.5; }

.pi-brief-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  font-size: 10px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.6;
}

/* --- Print styles --- */
@media print {
  body * { visibility: hidden !important; }
  .pi-brief-modal, .pi-brief-modal * { visibility: visible !important; }
  .pi-brief-modal {
    position: absolute !important;
    inset: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .pi-brief-backdrop { display: none !important; }
  .pi-brief-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }
  .no-print { display: none !important; }
  .pi-brief-page { padding: 24px 32px !important; }
  @page { size: letter; margin: 0.5in; }
}
