/* ==========================================================================
   SCIPROSPECT - MODERN EXECUTIVE LIGHT DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Color Palette - Premium Slate & Clean Light */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-input: #ffffff;
  
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #4f46e5;

  /* Saturated Brand Accents */
  --accent-indigo: #4f46e5;
  --accent-indigo-hover: #4338ca;
  --accent-indigo-light: #eef2ff;

  --accent-emerald: #059669;
  --accent-emerald-hover: #047857;
  --accent-emerald-light: #ecfdf5;

  --accent-amber: #d97706;
  --accent-amber-hover: #b45309;
  --accent-amber-light: #fffbeb;

  --accent-cyan: #0284c7;
  --accent-cyan-light: #f0f9ff;

  --accent-rose: #e11d48;
  --accent-rose-light: #fff1f2;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --text-light: #ffffff;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Soft Ambient Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 6px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: #080c16;
  color: var(--text-main);
  line-height: 1.5;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   DESKTOP APP SHELL & LAYOUT
   ========================================================================== */

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #080c16;
}

/* 1. Real Native Desktop Top Menu Bar across 100% Window Width */
.app-desktop-titlebar {
  height: 38px;
  min-height: 38px;
  background: #080c16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0 0.85rem;
  z-index: 100;
  user-select: none;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.titlebar-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #f8fafc;
}

.titlebar-brand-icon {
  display: block;
}

.titlebar-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 0.2rem;
}

.titlebar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* 2. Middle Body Container (Sidebar + Workspace) */
.app-body-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  height: calc(100vh - 38px - 28px);
}

/* Left Sidebar Rail */
.app-sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 100%;
  background: #080c16;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 50;
  user-select: none;
}

.sidebar-brand {
  padding: 1.25rem 1.15rem 1.15rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
}

.sidebar-logo {
  width: 100%;
  max-width: 215px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(14, 165, 233, 0.25));
  transition: transform 0.2s ease;
}

.sidebar-logo:hover {
  transform: scale(1.02);
}

.sidebar-section {
  padding: 1.25rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0 0.5rem 0.65rem 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-nav .nav-tab {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.sidebar-nav .nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-nav .nav-tab.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.sidebar-nav .nav-tab .nav-icon {
  flex-shrink: 0;
}

.sidebar-bottom {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-eval-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.eval-card-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.eval-card-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fbbf24;
}

.eval-card-quota {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fef3c7;
  margin-bottom: 0.45rem;
}

.eval-card-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.eval-card-bar-fill {
  height: 100%;
  width: 100%;
  background: #f59e0b;
}

.trial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.15); opacity: 1; }
}

/* Right Workspace Container */
.app-workspace {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fafc;
}

/* Top Desktop Control Bar */
.app-topbar {
  height: 44px;
  min-height: 44px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.breadcrumb-app {
  color: #64748b;
  font-weight: 500;
}

.breadcrumb-separator {
  color: #cbd5e1;
}

.breadcrumb-active {
  color: #0f172a;
  font-weight: 600;
}

.badge-subtle {
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 999px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 12px;
}

.pulse-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-dot 1.8s infinite;
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  color: #334155;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-refresh:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Scrollable Main Viewport */
.workspace-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem 1.75rem 2rem 1.75rem;
  scroll-behavior: smooth;
  background: #f8fafc;
}

/* Desktop Footer Status Bar (Full Width Native Footer) */
.app-status-bar {
  height: 28px;
  min-height: 28px;
  background: #080c16;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #94a3b8;
  user-select: none;
  z-index: 50;
}

.status-bar-left,
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

.status-sep {
  color: #475569;
}

.status-bar-copyright {
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.stat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-indigo { background: var(--accent-indigo-light); color: var(--accent-indigo); }
.icon-emerald { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.icon-cyan { background: var(--accent-cyan-light); color: var(--accent-cyan); }
.icon-amber { background: var(--accent-amber-light); color: var(--accent-amber); }

.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.pill-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
}

.pill-indigo { background: var(--accent-indigo-light); color: var(--accent-indigo); }
.pill-emerald { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.pill-cyan { background: var(--accent-cyan-light); color: var(--accent-cyan); }
.pill-amber { background: var(--accent-amber-light); color: #92400e; }

.stat-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ==========================================================================
   TAB VIEWS SYSTEM
   ========================================================================== */

.tab-view {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TAB 1: SCHOLARLY PIPELINE (STEPPED 2-STAGE FLOW)
   ========================================================================== */

.pipeline-flow-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stepped-cards-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 1rem;
}

@media (max-width: 1024px) {
  .stepped-cards-grid {
    grid-template-columns: 1fr;
  }
  .workflow-arrow-divider {
    transform: rotate(90deg);
    margin: 0 auto;
  }
}

.workflow-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-step-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-muted);
  color: var(--accent-indigo);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 6px;
}

.card-header-clean {
  margin-bottom: 1.2rem;
  padding-right: 4rem;
}

.card-header-clean h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.card-subtitle {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.workflow-arrow-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

/* Forms & Inputs */
.form-grid {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.mt-sm { margin-top: 0.4rem; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="month"],
input[type="date"],
select {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

input:disabled,
select:disabled {
  background: #f8fafc;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.date-range-inputs {
  display: flex;
  gap: 6px;
}

/* Pool State Alerts */
.pool-state-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 1.1rem;
}

.alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* Action Bars & Buttons */
.card-action-bar {
  margin-top: 1.25rem;
  display: flex;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-indigo-hover) 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-hover) 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.btn-emerald:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-amber {
  background: linear-gradient(135deg, var(--accent-amber) 0%, var(--accent-amber-hover) 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn-amber:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transform: translateY(-1px);
}

.btn:disabled {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ==========================================================================
   CLEAN ACTIVITY MONITOR (NOT A RAW BLACK TERMINAL)
   ========================================================================== */

.activity-monitor-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.monitor-header {
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.monitor-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-indigo);
}

.monitor-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.monitor-status-tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: #e2e8f0;
  color: var(--text-muted);
}

.monitor-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 0.5rem;
}

.btn-tool {
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

.btn-stop {
  color: #ffffff;
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-stop:hover:not(:disabled) {
  background: #be123c;
}

.btn-stop:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.progress-bar-track {
  height: 3px;
  background: #e2e8f0;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-indigo);
  transition: width 0.3s ease;
}

.progress-bar-fill.active {
  width: 100%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4, #4f46e5);
  background-size: 200% 100%;
  animation: progressShine 1.5s infinite linear;
}

@keyframes progressShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.log-stream-body {
  height: 240px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: #0f172a; /* Clean dark slate background for clear readable logs */
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.log-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
  text-align: center;
  gap: 0.4rem;
}

.log-empty-state svg {
  color: #475569;
}

.log-line {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.log-time {
  color: #64748b;
  flex-shrink: 0;
}

.log-success .log-text { color: #34d399; font-weight: 500; }
.log-warning .log-text { color: #fbbf24; }
.log-error .log-text { color: #f87171; font-weight: 500; }
.log-info .log-text { color: #38bdf8; }

.monitor-footer {
  padding: 0.5rem 1.25rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==========================================================================
   TAB 2: NIH MODULE STYLES
   ========================================================================== */

.module-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.module-hero-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: var(--shadow-md);
}

.hero-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.15);
  color: #c7d2fe;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.hero-left h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.hero-left p {
  font-size: 0.88rem;
  color: #c7d2fe;
  max-width: 650px;
  line-height: 1.5;
}

.hero-stats {
  display: flex;
  gap: 1.2rem;
}

.hero-stat-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
}

.hero-stat-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fde68a;
}

.hero-stat-lbl {
  font-size: 0.72rem;
  color: #c7d2fe;
}

/* ==========================================================================
   TAB 3: LEADS EXPLORER & TABLE
   ========================================================================== */

.explorer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.explorer-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.form-group-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.select-dataset {
  min-width: 240px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  color: #94a3b8;
}

.search-box input {
  padding-left: 2.25rem;
  min-width: 280px;
}

.filter-pills-wrap {
  display: flex;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.filter-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-pill.active {
  background: #ffffff;
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-export {
  background: #ffffff;
  color: var(--accent-indigo);
  border: 1px solid var(--border-medium);
  padding: 0.55rem 1rem;
}

.btn-export:hover {
  background: var(--accent-indigo-light);
  border-color: var(--accent-indigo);
}

/* Data Table & Horizontal Scroll Engine */
.table-container,
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: auto;
  max-height: 560px;
  -webkit-overflow-scrolling: touch;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

/* Custom styled horizontal and vertical scrollbars */
.table-container::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
  height: 9px;
  width: 9px;
}

.table-container::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
  border: 2px solid #f1f5f9;
}

.table-container::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.leads-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.leads-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  z-index: 10;
}

.leads-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  white-space: nowrap;
}

.leads-table tr:hover td {
  background: #f8fafc;
}

/* Allow project title column to have comfortable width with text wrap */
.leads-table td:nth-child(7),
.leads-table th:nth-child(7) {
  min-width: 280px;
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}


.email-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.2rem 0.45rem 0.2rem 0.55rem;
  white-space: nowrap;
  max-width: 100%;
  transition: all 0.15s ease;
}

.email-pill-wrap:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.email-text {
  font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
  font-size: 0.8rem;
  font-weight: 500;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: #ffffff;
  color: #0284c7;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-copy.copied {
  color: #16a34a !important;
  background: #dcfce7 !important;
  border-color: #86efac !important;
}

.btn-view-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-view-profile:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.table-empty {
  text-align: center;
  padding: 3rem 1rem !important;
  color: var(--text-dim);
}

.badge-email-found {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.74rem;
}

.badge-needs-review {
  background: var(--accent-amber-light);
  color: #b45309;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.74rem;
}

.table-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.table-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.page-size-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.page-size-wrap select {
  width: auto;
  padding: 0.2rem 0.5rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-page {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-medium);
  background: #ffffff;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-page:hover:not(:disabled) {
  background: var(--bg-muted);
}

.btn-page:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

/* ==========================================================================
   TAB 4: DATASETS ARCHIVE
   ========================================================================== */

.archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.archive-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.btn-view-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-view-profile:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Lead Data Storage Folder Banner */
.data-storage-info-bar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.storage-info-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-icon {
  color: #3b82f6;
  flex-shrink: 0;
}

.storage-label {
  font-weight: 600;
  color: #475569;
}

.storage-path {
  font-family: monospace;
  font-size: 0.82rem;
  color: #0f172a;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-change-storage {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn-change-storage:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Date and Topic Search Toolbar */
.archive-search-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.archive-search-input-wrap {
  flex: 2;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.archive-search-input-wrap svg {
  position: absolute;
  left: 12px;
  color: #94a3b8;
  pointer-events: none;
}

.archive-search-input-wrap input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.35rem;
  font-size: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.archive-search-input-wrap input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.archive-date-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.archive-date-filter-wrap select {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #0f172a;
  outline: none;
  cursor: pointer;
}

.archive-date-filter-wrap select:focus {
  border-color: #2563eb;
}

.badge-topic {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}

.chip-date {
  display: inline-block;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
}

.datasets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.dataset-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dataset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.dataset-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.dataset-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dataset-details {
  flex: 1;
  min-width: 0;
}

.dataset-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  word-break: break-all;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.dataset-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: #64748b;
  flex-wrap: wrap;
}

.meta-tag.meta-size {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
  color: #475569;
}

.meta-sep {
  color: #cbd5e1;
}

.meta-date {
  color: #64748b;
}

.dataset-actions-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-open-leads {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  flex: 1;
}

.btn-open-leads:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-download-leads {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.85rem;
}

.btn-download-leads:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.1rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease forwards;
}

.toast.toast-error { background: #e11d48; }
.toast.toast-warning { background: #d97706; }

@keyframes slideIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   APP STARTUP SPLASH SCREEN & PROGRESS BAR
   ========================================================================== */

.app-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #080c16;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1), transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.app-splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  width: 90%;
  padding: 2.5rem 2rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
}

.splash-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.splash-logo {
  max-width: 290px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(14, 165, 233, 0.35));
  animation: splashPulse 3s infinite ease-in-out;
  position: relative;
  z-index: 2;
}

.splash-glow {
  position: absolute;
  width: 220px;
  height: 90px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(37, 99, 235, 0.1) 60%, transparent 80%);
  filter: blur(24px);
  z-index: 1;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 16px rgba(14, 165, 233, 0.35)); }
  50% { transform: scale(1.02); filter: drop-shadow(0 6px 22px rgba(14, 165, 233, 0.55)); }
}

.splash-progress-container {
  width: 100%;
  margin-top: 1rem;
}

.splash-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.splash-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);
  border-radius: 999px;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.7);
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.76rem;
  font-family: var(--font-mono);
}

.splash-status-text {
  color: #94a3b8;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.splash-percent-text {
  color: #38bdf8;
  font-weight: 600;
}

.splash-footer-meta {
  margin-top: 2rem;
  font-size: 0.72rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.splash-meta-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  color: #64748b;
}

.splash-meta-sep {
  color: #334155;
}

/* ==========================================================================
   DESKTOP MENUBAR SYSTEM
   ========================================================================== */

.desktop-menubar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.menubar-item {
  position: relative;
}

.menubar-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.26rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.menubar-btn:hover,
.menubar-item.open .menubar-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
}

.menu-arrow {
  font-size: 0.65rem;
  opacity: 0.7;
}

.menubar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  padding: 0.4rem;
  z-index: 1000;
}

.menubar-item.open .menubar-dropdown {
  display: block;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #334155;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: #0284c7;
}

.dropdown-item.highlight-item {
  color: #0284c7;
  font-weight: 600;
}

.dropdown-item.highlight-item:hover {
  background: #f0f9ff;
}

.dropdown-item.text-danger {
  color: #e11d48;
}

.dropdown-item.text-danger:hover {
  background: #fff1f2;
}

.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.35rem 0;
}

.step-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0284c7;
  border-radius: 4px;
}

.storage-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-storage-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-storage-tool:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-storage-tool.btn-merge-highlight {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
  font-weight: 600;
}

.btn-storage-tool.btn-merge-highlight:hover {
  background: #dcfce7;
  border-color: #86efac;
}

/* ==========================================================================
   MODAL SYSTEM
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  display: flex !important;
}

.modal-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(16px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  font-size: 0.88rem;
  color: #334155;
}

.detail-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f8fafc;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.detail-value {
  font-size: 0.88rem;
  color: #0f172a;
  word-break: break-all;
}

/* ==========================================================================
   Scientific Data Source Selector & Provenance Badges
   ========================================================================== */
.source-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 0.65rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.source-pills-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.source-pill:hover:not(.disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.source-pill.active {
  background: #ede9fe;
  color: #4f46e5;
  border-color: #c4b5fd;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.source-pill.active[data-source="biorxiv"] {
  background: #ecfeff;
  color: #0891b2;
  border-color: #a5f3fc;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.15);
}

.source-pill.disabled {
  opacity: 0.65;
  cursor: pointer;
  background: #fafafa;
  border-style: dashed;
}

.pill-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pill-status-dot.green {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.pill-status-dot.blue {
  background: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.25);
}

.pill-status-dot.purple {
  background: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.badge-source {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-openalex {
  background: rgba(99, 102, 241, 0.1);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-biorxiv {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-nih {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}




/* ==========================================================================
   ENHANCED LIVE PROGRESS BANNER & ETA METRICS
   ========================================================================== */
.pipeline-progress-container {
  padding: 0.85rem 1.25rem;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.progress-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.progress-left-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-badge {
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.progress-leads-count {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.progress-right-metrics {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.metric-pill {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.07);
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-weight: 500;
}

.metric-pill.eta-pill {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-weight: 600;
}

.progress-bar-track {
  height: 9px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border-radius: 9999px !important;
  width: 100% !important;
  overflow: hidden !important;
}

.progress-bar-fill {
  height: 100% !important;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981) !important;
  border-radius: 9999px !important;
  transition: width 0.35s ease !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5) !important;
}

.progress-bar-fill.completed {
  background: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.8) !important;
}


/* ==========================================================================
   UNIFIED SCIENTIFIC AUTHENTICATION GATE & USER PROFILE STYLES
   ========================================================================== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(7, 11, 22, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.5rem;
  animation: fadeInGate 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInGate {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.auth-gate-card {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(99, 102, 241, 0.15);
  padding: 2.25rem 2.25rem 1.85rem;
  color: #fff;
}

.auth-gate-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-badge {
  display: inline-flex;
  padding: 0.8rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  margin-bottom: 0.85rem;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.35rem;
}

.auth-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #fff;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  vertical-align: middle;
  margin-left: 0.35rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: #94a3b8;
  margin: 0;
}

.auth-tab-bar {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.5rem;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05);
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.auth-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.auth-input-wrap:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.auth-input-icon {
  position: absolute;
  left: 0.85rem;
  color: #64748b;
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

.auth-help-text {
  font-size: 0.76rem;
  color: #64748b;
}

.auth-error-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.7rem 0.95rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 500;
  margin-bottom: 1.15rem;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.btn-auth-primary {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4);
  transition: all 0.25s ease;
  margin-top: 0.5rem;
}

.btn-auth-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.55);
}

.btn-auth-admin {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.4);
}

.btn-auth-admin:hover {
  box-shadow: 0 6px 24px rgba(139, 92, 246, 0.55);
}

.auth-gate-footer-info {
  margin-top: 1.5rem;
  text-align: center;
}

.cloud-secured-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.cloud-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* User Profile Chip in Titlebar */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.user-chip-name {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-tier {
  font-size: 0.68rem;
  font-weight: 700;
  background: #10b981;
  color: #fff;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.btn-signout {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.6rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-signout:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}
