/* ═══════════════════════════════════════════════════
   OppEngine — Premium Design System
   ═══════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────── */
:root {
  --bg-deep: #030308;
  --bg-base: #07070F;
  --bg-surface: rgba(255, 255, 255, 0.025);
  --bg-surface-hover: rgba(255, 255, 255, 0.05);
  --bg-elevated: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(59, 130, 246, 0.4);

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --text-inverse: #0F172A;

  --accent: #3B82F6;
  --accent-hover: #2563EB;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --accent-subtle: rgba(59, 130, 246, 0.08);
  --purple: #8B5CF6;
  --purple-glow: rgba(139, 92, 246, 0.3);
  --green: #10B981;
  --green-subtle: rgba(16, 185, 129, 0.1);
  --amber: #F59E0B;
  --amber-subtle: rgba(245, 158, 11, 0.1);
  --red: #EF4444;
  --red-subtle: rgba(239, 68, 68, 0.1);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', var(--font-sans);

  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: all 0.25s var(--ease);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --sidebar-w: 272px;
  --topbar-h: 64px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ─── Layout ─────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ═══════ SIDEBAR ═══════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s var(--ease);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  padding: 0 8px;
}
.logo-icon {
  font-size: 22px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.logo-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: auto;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}
.nav-item.active {
  color: var(--text-primary);
  background: var(--accent-subtle);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* Sidebar CTA */
.sidebar-cta {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.08));
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.cta-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.user-profile:hover { border-color: var(--border-hover); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-tier { font-size: 11px; color: var(--accent); font-weight: 500; }
.user-menu-icon { margin-left: auto; color: var(--text-tertiary); font-size: 16px; cursor: pointer; }

/* ═══════ MAIN CONTENT ═══════ */
.main-content {
  margin-left: var(--sidebar-w);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ═══════ TOPBAR ═══════ */
.topbar {
  height: var(--topbar-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(3, 3, 8, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-divider { width: 1px; height: 24px; background: var(--border); }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 22px; }

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute; left: 14px;
  font-size: 16px; color: var(--text-tertiary);
}
.search-container input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 9px 50px 9px 38px;
  border-radius: var(--radius-full);
  width: 380px;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.search-container input::placeholder { color: var(--text-tertiary); }
.search-container input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  width: 440px;
}
.search-kbd {
  position: absolute; right: 12px;
  font-size: 11px; font-family: var(--font-sans);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.notification-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: var(--transition);
  font-size: 15px;
}
.notification-btn:hover { border-color: var(--border-hover); }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px;
  background: var(--red);
  border-radius: 50%;
  font-size: 9px; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-deep);
}

/* ═══════ BUTTONS ═══════ */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 13px;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--border-hover); background: var(--bg-surface); }
.btn-ghost {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--bg-surface-hover); border-color: var(--border-hover); }
.btn-glow {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  padding: 10px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 15px var(--accent-glow);
  transition: var(--transition);
}
.btn-glow:hover { transform: translateY(-1px); box-shadow: 0 4px 25px var(--accent-glow); }

/* ═══════ VIEWS ═══════ */
.view {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  animation: viewIn 0.4s var(--ease) forwards;
}
.view.active { display: block; }
@keyframes viewIn {
  to { opacity: 1; transform: translateY(0); }
}
.view-inner { padding: 32px; max-width: 1400px; }
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.view-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}
.view-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}
.view-subtitle strong { color: var(--accent); font-weight: 600; }

/* ═══════ KPI CARDS ═══════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: var(--transition);
}
.kpi-card:hover { border-color: var(--border-hover); }
.kpi-card:hover::after { opacity: 1; }
.kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--kpi-color, var(--accent));
}
.kpi-body { display: flex; flex-direction: column; gap: 4px; }
.kpi-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.kpi-value-text {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--green), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-trend {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-self: flex-start;
}
.kpi-trend.up { background: var(--green-subtle); color: var(--green); }
.kpi-trend.neutral { background: rgba(100,116,139,0.1); color: var(--text-tertiary); }

/* ═══════ DASHBOARD GRID ═══════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}
.dash-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ─── Spotlight Cards ──────────────────────────── */
.spotlight-cards { display: flex; flex-direction: column; gap: 12px; }
.spotlight-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.spotlight-card:hover {
  border-color: var(--border-active);
  background: var(--bg-surface-hover);
  transform: translateX(4px);
}
.spotlight-rank {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-tertiary);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.spotlight-card:first-child .spotlight-rank { color: var(--amber); }
.spotlight-info { flex-grow: 1; min-width: 0; }
.spotlight-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 2px;
}
.spotlight-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ─── Score Ring ──────────────────────────────── */
.score-ring {
  position: relative;
  width: 52px; height: 52px;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 4; }
.score-ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: 138.23;
  transition: stroke-dashoffset 1s var(--ease);
}
.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Bar Chart ──────────────────────────────── */
.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding-top: 10px;
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.8s var(--ease-bounce);
  position: relative;
}
.chart-bar::after {
  content: attr(data-value);
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-display);
}
.chart-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ─── Activity Feed ──────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.activity-item:hover { background: var(--bg-elevated); }
.activity-icon {
  font-size: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  flex-grow: 1;
  line-height: 1.4;
}
.activity-time {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════ OPPORTUNITIES VIEW ═══════ */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.filter-tab {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  transition: var(--transition);
}
.filter-tab:hover { color: var(--text-primary); }
.filter-tab.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}
.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.sort-control select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.sort-control select option { background: var(--bg-base); }

/* ─── Opportunity Cards ──────────────────────── */
.opportunities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.opp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.opp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 80% 0%, rgba(59,130,246,0.06) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
}
.opp-card:hover {
  border-color: var(--border-active);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(59,130,246,0.06);
}
.opp-card:hover::before { opacity: 1; }

.opp-top { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.opp-cat {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 6px;
}
.opp-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.opp-model {
  font-size: 13px;
  color: var(--text-tertiary);
  position: relative; z-index: 1;
}
.opp-model strong { color: var(--text-secondary); }

.opp-pains {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex-grow: 1;
  position: relative; z-index: 1;
}
.pain-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--text-tertiary);
}

.opp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  position: relative; z-index: 1;
}
.opp-stat { display: flex; flex-direction: column; gap: 2px; }
.opp-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}
.opp-stat-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.opp-stat-value.warning { color: var(--amber); }

/* ═══════ REPORTS VIEW ═══════ */
.reports-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.reports-table {
  width: 100%;
  border-collapse: collapse;
}
.reports-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.reports-table td {
  padding: 16px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.reports-table tr:last-child td { border-bottom: none; }
.reports-table tr { transition: var(--transition); }
.reports-table tbody tr:hover { background: var(--bg-elevated); }

.report-title-cell {
  font-weight: 600;
  color: var(--text-primary);
}
.status-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.status-badge.completed { background: var(--green-subtle); color: var(--green); }
.status-badge.in-progress { background: var(--amber-subtle); color: var(--amber); }
.report-score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

/* ═══════ COMPETITORS VIEW ═══════ */
.competitors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.comp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comp-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.comp-header { display: flex; justify-content: space-between; align-items: flex-start; }
.comp-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.comp-category {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.threat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.threat-badge.high, .threat-badge.very-high { background: var(--red-subtle); color: var(--red); }
.threat-badge.medium { background: var(--amber-subtle); color: var(--amber); }
.threat-badge.low { background: var(--green-subtle); color: var(--green); }

.comp-details { display: flex; flex-direction: column; gap: 8px; }
.comp-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.comp-detail-label { color: var(--text-tertiary); }
.comp-detail-value { color: var(--text-secondary); font-weight: 500; }
.comp-weakness {
  font-size: 13px;
  color: var(--text-tertiary);
  padding: 10px 14px;
  background: var(--red-subtle);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red);
  line-height: 1.5;
}

/* ═══════ MODAL ═══════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal-content {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 960px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,0,0,0.4);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.35s var(--ease-bounce);
}
.modal-overlay.open .modal-content {
  transform: scale(1) translateY(0);
}
.modal-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 36px; height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}
.modal-close:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  transform: rotate(90deg);
}

/* Modal Header */
.modal-hero {
  padding: 40px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 70% 0%, rgba(59,130,246,0.08), transparent 60%),
              radial-gradient(ellipse at 30% 100%, rgba(139,92,246,0.06), transparent 60%);
}
.modal-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}
.modal-hero-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.modal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.modal-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.modal-tag.highlight {
  background: var(--accent-subtle);
  border-color: rgba(59,130,246,0.2);
  color: var(--accent);
}

/* Modal Body */
.modal-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
}
.modal-main { padding: 32px 40px; border-right: 1px solid var(--border); }
.modal-aside { padding: 32px; }

.modal-block { margin-bottom: 28px; }
.modal-block:last-child { margin-bottom: 0; }
.modal-block-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-block p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.modal-pain-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-pain-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-pain-list li::before {
  content: '→';
  color: var(--text-tertiary);
  font-size: 12px;
}

/* SWOT */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.swot-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.swot-item.s { background: var(--green-subtle); color: var(--green); }
.swot-item.w { background: var(--red-subtle); color: var(--red); }
.swot-item.o { background: var(--accent-subtle); color: var(--accent); }
.swot-item.t { background: var(--amber-subtle); color: var(--amber); }
.swot-label {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: block;
  margin-bottom: 4px;
}

/* Score Bars */
.score-section { display: flex; flex-direction: column; gap: 14px; }
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.score-row-label { color: var(--text-secondary); }
.score-row-right { display: flex; align-items: center; gap: 10px; }
.score-bar-track {
  width: 80px; height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s var(--ease);
}
.score-bar-fill.high { background: var(--green); }
.score-bar-fill.med { background: var(--amber); }
.score-bar-fill.low { background: var(--red); }
.score-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  width: 20px;
  text-align: right;
}

/* Large Score Ring */
.modal-score-ring {
  width: 100px; height: 100px;
  margin: 0 auto 8px;
  position: relative;
}
.modal-hero-top .modal-score-ring {
  width: 80px; height: 80px;
  margin: 0;
  flex-shrink: 0;
}
.modal-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.modal-score-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 6; }
.modal-score-ring .ring-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 263.89;
  stroke-dashoffset: 263.89;
  transition: stroke-dashoffset 1.2s var(--ease);
}
.modal-score-label {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ═══════ ANIMATIONS ═══════ */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeSlideIn 0.5s var(--ease) both;
}
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-main { border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: block; }
  .topbar { padding: 0 16px; }
  .search-container input { width: 200px; }
  .search-container input:focus { width: 240px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .view-inner { padding: 20px; }
  .view-title { font-size: 24px; }
  .view-header { flex-direction: column; gap: 12px; }
  .opportunities-grid { grid-template-columns: 1fr; }
  .competitors-grid { grid-template-columns: 1fr; }
  .modal-hero { padding: 24px; }
  .modal-hero-title { font-size: 22px; }
  .modal-main, .modal-aside { padding: 20px; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════
   PERSPECTIVE TABS
═══════════════════════════════════════════════════ */

/* Why Now Banner */
.why-now-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.06));
    border: 1px solid rgba(59,130,246,0.18);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0 24px 8px;
}
.why-now-left { flex: 1; }
.why-now-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--blue);
    display: block;
    margin-bottom: 4px;
}
.why-now-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}
.why-now-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 120px;
}
.urgency-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.why-now-urgency {
    font-size: 12px;
    font-weight: 700;
}
.why-now-window {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Tab Bar */
.persp-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
.persp-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: color .18s, border-color .18s;
    margin-bottom: -1px;
    font-family: var(--font-body);
}
.persp-tab:hover { color: var(--text-secondary); }
.persp-tab.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}

/* Panels */
.persp-panels { padding: 0; }
.persp-panel { display: none; padding: 20px 24px; }
.persp-panel.active { display: block; }

/* Perspective stat cards */
.persp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.persp-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}
.persp-card-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}
.persp-card-value {
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.2;
}

/* Badges */
.persp-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.persp-badge.green {
    background: rgba(16,185,129,.12);
    color: var(--green);
    border: 1px solid rgba(16,185,129,.25);
}
.persp-badge.amber {
    background: rgba(245,158,11,.12);
    color: var(--amber);
    border: 1px solid rgba(245,158,11,.25);
}

/* Operator steps */
.op-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.op-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 14px;
    background: var(--surface-2);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.op-step-num {
    width: 22px;
    height: 22px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

@media (max-width: 768px) {
    .persp-tabs { padding: 0 16px; overflow-x: auto; }
    .persp-tab { white-space: nowrap; padding: 10px 12px; font-size: 12px; }
    .persp-panel { padding: 16px; }
    .why-now-banner { flex-direction: column; margin: 0 16px 8px; }
    .why-now-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
    .persp-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   LIVE SIGNAL COMPONENTS
═══════════════════════════════════════════════════ */

/* Live dot indicator */
.live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse-dot 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* Signal bar on opportunity cards */
.live-signal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0 2px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.live-sig-pill {
    font-size: 10px;
    font-family: var(--mono);
    color: var(--green);
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.18);
    border-radius: 20px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* Validated TAM tag */
.validated-tag {
    font-size: 9px;
    font-weight: 700;
    color: var(--green);
    background: rgba(16,185,129,.10);
    border: 1px solid rgba(16,185,129,.2);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Live section in modal */
.live-modal-block {
    border: 1px solid rgba(16,185,129,.2) !important;
    background: rgba(16,185,129,.04) !important;
}
.live-modal-block .modal-block-title {
    color: var(--green) !important;
}

.live-sub-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 12px 0 6px;
}
.live-signal-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 4px;
    text-decoration: none;
    transition: background .15s, border-color .15s;
    cursor: pointer;
}
.live-signal-item:hover {
    background: var(--surface-3);
    border-color: rgba(16,185,129,.3);
}
.live-signal-title {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
}
.live-signal-item:hover .live-signal-title {
    color: var(--text-primary);
}
.live-signal-eng {
    font-size: 10px;
    font-family: var(--mono);
    color: var(--text-faint);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .live-signal-bar { gap: 4px; }
    .live-sig-pill { font-size: 9px; }
}

/* ─── Locked opportunity card ─── */
.opp-card-locked {
    position: relative;
    min-height: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
    overflow: hidden;
}
.opp-card-locked::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(99,102,241,.03) 8px,
        rgba(99,102,241,.03) 16px
    );
}
.opp-card-locked:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.opp-locked-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    z-index: 1;
}
.opp-locked-icon { font-size: 22px; }
.opp-locked-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 200px;
    line-height: 1.4;
    filter: blur(3px);
    user-select: none;
}
.opp-locked-sub {
    font-size: 11px;
    color: var(--text-faint);
    margin-bottom: 4px;
}
