/* ============================================================================
   Autonomous Job Agent Ecosystem — Visual Mission Control Theme
   Design System: Deep Cyberpunk / Aerospace Glassmorphic Dark Mode
   ============================================================================ */

:root {
  --bg-dark: #070a12;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-card-border: rgba(148, 163, 184, 0.12);
  --bg-card-border-glow: rgba(56, 189, 248, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #c084fc;

  --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-glow-cyan: 0 0 25px rgba(56, 189, 248, 0.2);
  --shadow-glow-emerald: 0 0 25px rgba(16, 185, 129, 0.2);
  --shadow-glow-amber: 0 0 25px rgba(245, 158, 11, 0.2);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glow */
.space-ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 550px;
  background: radial-gradient(circle at 50% -10%, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.08) 35%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top Navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 1.8vw, 16px) clamp(16px, 2.5vw, 36px);
  background: rgba(7, 10, 18, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-card-border);
  width: 100%;
  box-sizing: border-box;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 18px);
  flex-wrap: wrap;
  min-width: 0;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 16px);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.btn-text-full { display: inline; }
.btn-text-short { display: none; }

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hex-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.system-health-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-emerald);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.candidate-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
}

.user-avatar {
  font-size: 16px;
}

.candidate-info {
  display: flex;
  flex-direction: column;
}

.candidate-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.candidate-tag {
  font-size: 11px;
  color: var(--accent-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.28);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Layout Container */
.dashboard-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 36px 60px;
  position: relative;
  z-index: 1;
}

/* Diagnostic Banner */
.diagnostic-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-glow-cyan);
  position: relative;
  overflow: hidden;
}

.diagnostic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-brand);
}

.diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diag-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.diag-icon {
  font-size: 24px;
}

.diag-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.diag-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.diag-body {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.diag-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-muted);
}

.diag-bullet {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.diag-item strong {
  display: block;
  color: var(--text-main);
  margin-bottom: 3px;
}

.diag-item code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-indigo);
  font-size: 11px;
}

/* KPI Stats Row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(10px, 1.8vw, 18px);
  margin-bottom: 30px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.kpi-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 22px;
  flex-shrink: 0;
}

.ic-cyan { background: rgba(56, 189, 248, 0.12); color: var(--accent-cyan); }
.ic-indigo { background: rgba(129, 140, 248, 0.12); color: var(--accent-indigo); }
.ic-emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.ic-amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); }
.ic-purple { background: rgba(192, 132, 252, 0.12); color: var(--accent-purple); }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Section Blocks */
.section-block {
  margin-bottom: 36px;
}

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

.section-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.auto-refresh-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.spin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* The Multi-Agent Visual Deck & Company Hierarchy Layout */
.agent-hierarchy-section {
  position: relative;
  z-index: 80 !important;
  overflow: visible !important;
}

.agent-hierarchy-deck,
.agent-space-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 34px 28px 40px 28px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: visible !important;
  z-index: 80;
}

/* Tier 1: Executive Supervisor */
.hierarchy-tier-supervisor {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 60 !important;
  width: 100%;
}

.hierarchy-tier-supervisor:hover,
.hierarchy-tier-supervisor.has-active,
.hierarchy-tier-supervisor:focus-within {
  z-index: 10000 !important;
}

.supervisor-pod {
  position: relative;
  z-index: 100;
  background: rgba(30, 41, 59, 0.5) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 28px rgba(245, 158, 11, 0.18) !important;
  padding: 16px 26px 20px 26px !important;
  border-radius: 24px !important;
}

.supervisor-pod:hover,
.supervisor-pod.is-active {
  border-color: rgba(245, 158, 11, 0.85) !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), 0 0 40px rgba(245, 158, 11, 0.35) !important;
  z-index: 10001 !important;
}

.supervisor-pod .bot-hover-dossier {
  z-index: 10002 !important;
}

/* Department Rank & Division Badges */
.hierarchy-rank-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
  white-space: nowrap;
}

.rank-tag-executive {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.38));
  border: 1px solid rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.rank-tag-specialist {
  font-size: 10px;
  padding: 3px 10px;
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.border-cyan { border-color: rgba(56, 189, 248, 0.45) !important; color: #38bdf8 !important; }
.border-indigo { border-color: rgba(129, 140, 248, 0.45) !important; color: #818cf8 !important; }
.border-emerald { border-color: rgba(52, 211, 153, 0.45) !important; color: #34d399 !important; }
.border-slate { border-color: rgba(148, 163, 184, 0.45) !important; color: #94a3b8 !important; }

/* Visual Org Tree Connectors (Circuit Trunk & Bus Bar) */
.hierarchy-tree-connectors {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: 52px;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none !important;
  z-index: 1 !important;
}

.hierarchy-trunk-line {
  width: 2px;
  height: 26px;
  background: linear-gradient(to bottom, #f59e0b 0%, #38bdf8 100%);
  position: relative;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.hierarchy-trunk-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.hierarchy-branch-bar {
  position: relative;
  width: 76%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #38bdf8 12%, #818cf8 50%, #34d399 88%, transparent 100%);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.hierarchy-branch-bar::after {
  content: "";
  position: absolute;
  top: -3.5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

/* Tier 2: Operational Specialists Grid */
.hierarchy-tier-specialists {
  position: relative;
  width: 100%;
  max-width: 1160px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  justify-items: center;
  align-items: flex-start;
  z-index: 10 !important;
}

.hierarchy-tier-specialists:hover,
.hierarchy-tier-specialists:focus-within {
  z-index: 50 !important;
}

/* Connector drop stem connecting the branch bar to each specialist node */
.specialist-branch-node {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.specialist-stem-line {
  width: 2px;
  height: 24px;
  margin-bottom: 2px;
  background: linear-gradient(to bottom, rgba(56, 189, 248, 0.8), rgba(56, 189, 248, 0.2));
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
  position: relative;
}

.specialist-stem-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
}

.specialist-stem-line.stem-jobScout {
  background: linear-gradient(to bottom, #38bdf8, rgba(56, 189, 248, 0.2));
}
.specialist-stem-line.stem-resumeTailor {
  background: linear-gradient(to bottom, #818cf8, rgba(129, 140, 248, 0.2));
}
.specialist-stem-line.stem-browserApplicant {
  background: linear-gradient(to bottom, #34d399, rgba(52, 211, 153, 0.2));
}
.specialist-stem-line.stem-emailTriage {
  background: linear-gradient(to bottom, #64748b, rgba(100, 116, 139, 0.2));
}

/* Individual Bot Pod */
.bot-pod {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  min-width: 140px;
}

/* Invisible hover bridge so cursor traveling into dossier never drops hover */
.bot-pod::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 18px;
  background: transparent;
  pointer-events: auto;
  z-index: 999;
}

.bot-pod:hover,
.bot-pod.is-active {
  transform: translateY(-6px);
  z-index: 9999 !important;
}

.bot-pedestal-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bot-pedestal-glow {
  width: 76px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.55) 0%, transparent 70%);
  filter: blur(3px);
  margin-top: 4px;
  transition: all 0.3s ease;
}

.bot-pod.state-working .bot-pedestal-glow {
  background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.8) 0%, transparent 70%);
  filter: blur(4px);
  transform: scaleX(1.15);
}

.bot-pod.state-attention .bot-pedestal-glow {
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.8) 0%, transparent 70%);
  filter: blur(4px);
}

.bot-pod.is-disabled .bot-pedestal-glow {
  background: radial-gradient(ellipse at center, rgba(244, 63, 94, 0.35) 0%, transparent 70%);
}

.bot-pod-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 10px;
  text-align: center;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.bot-pod:hover .bot-pod-name {
  color: #38bdf8;
}

.bot-pod-status {
  margin-top: 6px;
}

/* Holographic Hover HUD Dossier */
.bot-hover-dossier {
  position: absolute;
  top: calc(100% + 6px);
  width: 295px;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 24px 50px -10px rgba(0, 0, 0, 0.92), 0 0 30px rgba(56, 189, 248, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000 !important;
  text-align: left;
}

/* Upward bridge on dossier so cursor entering never loses focus */
.bot-hover-dossier::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
  pointer-events: auto;
}

/* Arrow indicator on top of dossier */
.bot-hover-dossier::before {
  content: "";
  position: absolute;
  top: -7px;
  width: 12px;
  height: 12px;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid rgba(56, 189, 248, 0.45);
  border-top: 1px solid rgba(56, 189, 248, 0.45);
}

/* Alignment variants for dossiers to avoid clipping */
.bot-hover-dossier.dossier-pos-center {
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.95);
}
.bot-hover-dossier.dossier-pos-center::before {
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.bot-hover-dossier.dossier-pos-left {
  left: 0;
  transform: translateY(10px) scale(0.95);
}
.bot-hover-dossier.dossier-pos-left::before {
  left: 38px;
  transform: rotate(45deg);
}

.bot-hover-dossier.dossier-pos-right {
  left: auto;
  right: 0;
  transform: translateY(10px) scale(0.95);
}
.bot-hover-dossier.dossier-pos-right::before {
  left: auto;
  right: 38px;
  transform: rotate(45deg);
}

/* Hover & Active triggers */
.bot-pod:hover .bot-hover-dossier.dossier-pos-center,
.bot-pod.is-active .bot-hover-dossier.dossier-pos-center {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

.bot-pod:hover .bot-hover-dossier.dossier-pos-left,
.bot-pod.is-active .bot-hover-dossier.dossier-pos-left {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.bot-pod:hover .bot-hover-dossier.dossier-pos-right,
.bot-pod.is-active .bot-hover-dossier.dossier-pos-right {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Fallback for legacy layout */
.bot-pod:first-child .bot-hover-dossier:not([class*="dossier-pos"]) {
  left: 0;
  transform: translateY(10px) scale(0.95);
}
.bot-pod:first-child .bot-hover-dossier:not([class*="dossier-pos"])::before {
  left: 42px;
}
.bot-pod:last-child .bot-hover-dossier:not([class*="dossier-pos"]) {
  left: auto;
  right: 0;
  transform: translateY(10px) scale(0.95);
}
.bot-pod:last-child .bot-hover-dossier:not([class*="dossier-pos"])::before {
  left: auto;
  right: 42px;
}
.bot-pod:first-child:hover .bot-hover-dossier:not([class*="dossier-pos"]),
.bot-pod:first-child.is-active .bot-hover-dossier:not([class*="dossier-pos"]) {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.bot-pod:last-child:hover .bot-hover-dossier:not([class*="dossier-pos"]),
.bot-pod:last-child.is-active .bot-hover-dossier:not([class*="dossier-pos"]) {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Responsive hierarchy tree */
@media (max-width: 1024px) {
  .hierarchy-tier-specialists {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 16px;
  }
  .hierarchy-branch-bar {
    width: 60%;
  }
  .specialist-branch-node:nth-child(odd) .bot-hover-dossier {
    left: 0 !important;
    right: auto !important;
    transform: translateY(10px) scale(0.95) !important;
  }
  .specialist-branch-node:nth-child(odd) .bot-hover-dossier::before {
    left: 38px !important;
    right: auto !important;
  }
  .specialist-branch-node:nth-child(odd) .bot-pod:hover .bot-hover-dossier,
  .specialist-branch-node:nth-child(odd) .bot-pod.is-active .bot-hover-dossier {
    transform: translateY(0) scale(1) !important;
  }

  .specialist-branch-node:nth-child(even) .bot-hover-dossier {
    left: auto !important;
    right: 0 !important;
    transform: translateY(10px) scale(0.95) !important;
  }
  .specialist-branch-node:nth-child(even) .bot-hover-dossier::before {
    left: auto !important;
    right: 38px !important;
  }
  .specialist-branch-node:nth-child(even) .bot-pod:hover .bot-hover-dossier,
  .specialist-branch-node:nth-child(even) .bot-pod.is-active .bot-hover-dossier {
    transform: translateY(0) scale(1) !important;
  }
}

@media (max-width: 640px) {
  .hierarchy-tier-specialists {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hierarchy-branch-bar,
  .specialist-stem-line {
    display: none;
  }
  .hierarchy-tree-connectors {
    height: 20px;
  }
  .bot-hover-dossier {
    width: 270px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(10px) scale(0.95) !important;
  }
  .bot-hover-dossier::before {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) rotate(45deg) !important;
  }
  .bot-pod:hover .bot-hover-dossier,
  .bot-pod.is-active .bot-hover-dossier {
    transform: translateX(-50%) translateY(0) scale(1) !important;
  }
}

.agent-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  overflow: visible;
  transition: all 0.35s ease;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.agent-avatar-wrap.state-working {
  border-color: rgba(56, 189, 248, 0.75);
  background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.28) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.45), inset 0 0 12px rgba(56, 189, 248, 0.25);
  animation: botWorkingGlow 2.5s infinite alternate ease-in-out;
}

.agent-avatar-wrap.state-resting {
  border-color: rgba(129, 140, 248, 0.35);
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0.88) 100%);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.18);
  animation: botRestingBreathe 3.6s ease-in-out infinite;
}

.agent-avatar-wrap.state-attention {
  border-color: rgba(245, 158, 11, 0.85);
  background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.28) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.55), inset 0 0 14px rgba(245, 158, 11, 0.3);
  animation: botAttentionGlow 1.8s infinite alternate ease-in-out;
}

.agent-avatar-wrap.state-disabled {
  opacity: 0.55;
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(15, 23, 42, 0.6);
  filter: grayscale(0.7);
}

/* Bot Face Keyframe Animations */
@keyframes botWorkingGlow {
  0% { box-shadow: 0 0 12px rgba(56, 189, 248, 0.35), inset 0 0 8px rgba(56, 189, 248, 0.2); }
  100% { box-shadow: 0 0 26px rgba(56, 189, 248, 0.75), inset 0 0 16px rgba(56, 189, 248, 0.4); }
}

@keyframes botRestingBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2.5px); }
}

@keyframes botAttentionGlow {
  0% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.35); }
  100% { box-shadow: 0 0 26px rgba(245, 158, 11, 0.85); }
}

@keyframes botEyeScan {
  0%, 100% { transform: translateX(-2.5px); }
  50% { transform: translateX(2.5px); }
}

@keyframes botScanBeam {
  0% { transform: translateY(-4px); opacity: 0.2; }
  50% { opacity: 0.95; }
  100% { transform: translateY(4px); opacity: 0.2; }
}

@keyframes botZzzFloat {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  40% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(8px, -14px) scale(1.2); }
}

@keyframes botRadarRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes botSignalPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes tagPulseGreen {
  0%, 100% { box-shadow: 0 0 6px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.55); }
}

@keyframes tagPulseAmber {
  0%, 100% { box-shadow: 0 0 6px rgba(245, 158, 11, 0.2); }
  50% { box-shadow: 0 0 14px rgba(245, 158, 11, 0.6); }
}

.bot-eye-working {
  animation: botEyeScan 1.6s ease-in-out infinite;
  transform-origin: center;
}

.bot-scan-beam {
  animation: botScanBeam 2s ease-in-out infinite;
}

.bot-zzz {
  animation: botZzzFloat 2.8s ease-in-out infinite;
  transform-origin: center;
}

.bot-signal-wave {
  animation: botSignalPulse 1.8s ease-in-out infinite;
  transform-origin: center;
}

.bot-eye-resting {
  animation: botRestingBreathe 3.6s ease-in-out infinite;
}

/* Activity Tags */
.agent-activity-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.tag-working {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  animation: tagPulseGreen 2s infinite ease-in-out;
}

.tag-resting {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.tag-attention {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  animation: tagPulseAmber 1.5s infinite ease-in-out;
}

.tag-disabled {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.agent-badge-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.agent-identity {
  margin-bottom: 16px;
}

.agent-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.agent-role {
  font-size: 12px;
  color: var(--text-muted);
}

.agent-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 16px;
}

.agent-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-active { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.dot-idle { background: var(--accent-indigo); }
.dot-attention { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); animation: pulse-glow 1.5s infinite; }

.agent-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}

.agent-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-key {
  color: var(--text-muted);
}

.metric-val {
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Tabs Navigation */
.view-tabs {
  position: relative;
  z-index: 5 !important;
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--bg-card-border);
  padding-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
  width: 100%;
  box-sizing: border-box;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: clamp(12px, 2.2vw, 14px);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.tab-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.tab-btn.active .tab-badge {
  background: var(--accent-cyan);
  color: #070a12;
}

.tab-content {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 5 !important;
}

.tab-content.active {
  display: block;
}

/* Panel Card */
.panel-card {
  position: relative;
  z-index: 5;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}

.panel-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.panel-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.select-input {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
}

.select-input:focus {
  border-color: var(--accent-cyan);
}

/* Staged Applications Cards */
.applications-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) auto;
  gap: 22px;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s ease;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.app-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.6);
}

.app-thumb-box {
  width: 100%;
  height: 145px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  cursor: pointer;
  flex-shrink: 0;
}

.app-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.app-thumb-box:hover .app-thumb-img {
  transform: scale(1.05);
}

.app-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.app-thumb-box:hover .app-thumb-overlay {
  opacity: 1;
}

.app-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.app-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.app-meta {
  font-size: 13px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.app-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.badge-score {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: capitalize;
}

.status-pending_approval { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-submitted { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-rejected { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

.app-fields-preview {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 6px;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  max-width: 100%;
  line-height: 1.4;
}

.app-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
  max-width: 220px;
  flex-shrink: 0;
}

/* Data Table */
.jobs-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--bg-card-border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
}

.job-cell-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.job-cell-company {
  font-size: 12px;
  color: var(--text-muted);
}

/* Terminal Log Stream */
.log-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terminal-log-viewer {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: clamp(12px, 2vw, 18px);
  max-height: 480px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  width: 100%;
  min-width: 0;
}

.log-time {
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.log-agent {
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 11px;
  flex-shrink: 0;
}

.log-msg {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.agent-TeamLeader { background: rgba(192, 132, 252, 0.2); color: #d8b4fe; }
.agent-EmailTriage { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.agent-JobScout { background: rgba(129, 140, 248, 0.2); color: #a5b4fc; }
.agent-ResumeTailor { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.agent-BrowserApplicant { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

.log-entry-info .log-msg { color: #e2e8f0; }
.log-entry-warn .log-msg { color: #fde047; }
.log-entry-error .log-msg { color: #f87171; }
.log-entry-debug .log-msg { color: #94a3b8; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--bg-card-border);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
}

.modal-screenshot {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--bg-card-border);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  animation: slide-in 0.3s ease;
}

.toast-success { border-color: rgba(16, 185, 129, 0.5); }
.toast-error { border-color: rgba(244, 63, 94, 0.5); }

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

/* Footer */
.bottom-footer {
  text-align: center;
  padding: 24px 36px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--bg-card-border);
  background: rgba(7, 10, 18, 0.5);
}

/* Live Stage Tool Card */
.live-stage-card {
  margin-bottom: 30px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  box-shadow: 0 8px 32px rgba(56, 189, 248, 0.08);
  position: relative;
  overflow: hidden;
}

.live-stage-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-indigo));
}

.live-stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-stage-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.live-stage-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-stage-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.live-stage-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 900px;
  line-height: 1.5;
}

.live-stage-input-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.live-stage-input {
  flex: 1;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.live-stage-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Tailored CV Inspection Styles */
.modal-cv-content {
  max-width: 940px;
}

.cv-section-block {
  margin-bottom: 24px;
}

.cv-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-summary-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
}

.cv-role-group {
  margin-bottom: 16px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.cv-role-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-bullet-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

.cv-bullet-list li {
  position: relative;
}

/* ============================================================================
   Fluid Responsive Multi-Device Design System (PC, Laptop, Tablet, Phones)
   ============================================================================ */

/* 1. Laptops & Small Desktops (961px - 1200px) */
@media (max-width: 1200px) {
  .btn-text-full { display: none; }
  .btn-text-short { display: inline; }
  .nav-actions .nav-btn {
    padding: 7px 11px;
    font-size: 12px;
  }
  .top-nav {
    gap: 12px;
    padding: 14px 24px;
  }
  .nav-left {
    gap: 12px;
  }
  .nav-right {
    gap: 12px;
  }
  .app-card {
    grid-template-columns: 210px minmax(0, 1fr) 180px;
    gap: 16px;
  }
}

/* 2. Tablets (Portrait) & Large Phones (641px - 960px) */
@media (max-width: 960px) {
  .top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 20px;
  }
  .nav-left {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .nav-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .candidate-pill {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
  }
  .nav-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }
  .nav-actions .nav-btn {
    width: 100%;
    padding: 9px 8px;
    font-size: 12px;
    justify-content: center;
  }
  .dashboard-container {
    padding: 18px 20px 40px;
  }
  .app-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .app-thumb-box {
    height: 200px;
    max-width: 100%;
    width: 100%;
  }
  .app-actions {
    min-width: 100%;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .app-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 130px;
    justify-content: center;
  }
  .live-stage-input-group {
    flex-direction: column;
    align-items: stretch;
  }
  .schedule-header-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .schedule-options-bar {
    flex-direction: column;
  }
  .interval-options-group {
    grid-template-columns: 1fr 1fr;
  }
  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .panel-filters {
    width: 100%;
    flex-wrap: wrap;
  }
  .panel-filters input,
  .panel-filters select {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }
  .cv-split-view {
    grid-template-columns: 1fr !important;
    gap: 18px;
  }
}

/* 3. Mobile Phones (381px - 640px) */
@media (max-width: 640px) {
  .dashboard-container {
    padding: 14px 14px 36px;
  }
  .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 22px !important;
  }
  .kpi-card:last-child {
    grid-column: 1 / -1 !important;
  }
  .kpi-card {
    padding: 12px 14px !important;
    gap: 10px !important;
  }
  .kpi-icon-wrap {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
  }
  .kpi-value {
    font-size: 20px !important;
  }
  .kpi-label {
    font-size: 11px !important;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-sub {
    font-size: 10px;
  }
  .hex-logo {
    width: 36px;
    height: 36px;
  }
  .system-health-pill,
  .schedule-pill {
    padding: 4px 9px;
    font-size: 11px;
  }
  .nav-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .nav-actions .nav-btn {
    padding: 8px 6px;
    font-size: 11px;
  }
  .view-tabs {
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 8px;
  }
  .tab-btn {
    padding: 7px 12px;
    font-size: 12px;
  }
  .app-actions .btn {
    flex: 1 1 100%;
  }
  .interval-options-group {
    grid-template-columns: 1fr;
  }
  .cv-scorecards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .cv-scorecard {
    padding: 10px 8px !important;
  }
  .cv-score-val {
    font-size: 20px !important;
  }
  .cv-score-label {
    font-size: 10px !important;
  }
  .cv-subtabs-nav {
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 6px;
  }
  .cv-subtab-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .cv-pill-filter {
    padding: 3px 8px;
    font-size: 11px;
  }
  .modal-overlay {
    padding: 10px;
  }
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 12px;
  }
  .modal-header {
    padding: 12px 16px;
  }
  .modal-body {
    padding: 14px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* 4. Extra-Small Mobile Devices (<= 380px) */
@media (max-width: 380px) {
  .brand-title {
    font-size: 13px;
  }
  .system-health-pill,
  .schedule-pill {
    font-size: 10px;
    padding: 3px 7px;
  }
  .kpi-row {
    grid-template-columns: 1fr !important;
  }
  .kpi-card:last-child {
    grid-column: auto !important;
  }
  .nav-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Automatic Email Scan Schedule Card Styles
   ============================================================================ */

.schedule-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-indigo);
  transition: all 0.2s ease;
}

.schedule-pill:hover {
  background: rgba(129, 140, 248, 0.2);
  border-color: var(--accent-indigo);
}

.schedule-pill-icon {
  font-size: 13px;
}

.schedule-card {
  margin-bottom: 30px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: 0 8px 32px rgba(129, 140, 248, 0.08);
  position: relative;
  overflow: hidden;
}

.schedule-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-indigo), var(--accent-cyan));
}

.schedule-card-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.schedule-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.schedule-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 780px;
}

.schedule-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: var(--accent-indigo);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.schedule-status-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.schedule-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.schedule-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.schedule-next-scan-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: inset 0 0 15px rgba(56, 189, 248, 0.05);
  align-self: flex-start;
}

.schedule-next-scan-badge .pulse-ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  animation: pulse-ring 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 14px var(--accent-cyan); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.next-scan-content {
  display: flex;
  flex-direction: column;
}

.next-scan-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.next-scan-time {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.schedule-options-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.interval-options-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.interval-card {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.interval-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.interval-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.interval-card.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(129, 140, 248, 0.12));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.22);
  transform: translateY(-2px);
}

.interval-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.interval-hours-display {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.interval-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.interval-chip {
  display: inline-block;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.interval-chip.chip-default {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.interval-subtext {
  font-size: 11px;
  color: var(--text-dim);
}

.interval-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.interval-card.active .interval-check-icon {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #070a12;
  font-weight: 800;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.schedule-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  flex-wrap: wrap;
}

.btn-save-schedule {
  min-width: 150px;
}

.schedule-last-run {
  font-size: 12px;
  color: var(--text-dim);
}

.schedule-last-run span {
  color: var(--text-muted);
  font-family: var(--font-mono);
}


/* ============================================================================
   CV Analysis Reviews — 3-Phase ResumeTailor Pipeline (v2.8.0)
   ============================================================================ */

/* Tab badge — amber for pending CV analyses */
.tab-badge.cv-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Analysis card list */
.cv-analysis-card {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: border-color .2s, box-shadow .2s;
}

.cv-analysis-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.08);
}

.cv-analysis-card.cv-card-pending {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.04);
}

.cv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.cv-card-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cv-card-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.cv-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.cv-card-company {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.cv-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.cv-card-date {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.cv-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.cv-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Detail panel */
.cv-analysis-detail {
  border-color: rgba(56, 189, 248, 0.25);
}

/* Phase progress bar */
.phase-status-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.phase-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

.phase-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-mono);
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all .3s;
}

.phase-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.phase-connector {
  height: 2px;
  flex: 1;
  background: var(--border);
  margin-top: -18px;
}

.phase-step.phase-active .phase-num {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.phase-step.phase-active .phase-label { color: #38bdf8; }

.phase-step.phase-done .phase-num {
  border-color: #34d399;
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.phase-step.phase-done .phase-label { color: #34d399; }

.phase-step.phase-passed .phase-num {
  border-color: #34d399;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

.phase-step.phase-warn .phase-num {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

/* Report header row */
.cv-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cv-report-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Report body — scrollable rich text viewer */
.cv-report-body {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  max-height: 520px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  font-family: var(--font-mono);
  scrollbar-width: thin;
  scrollbar-color: rgba(56,189,248,.3) transparent;
}

.cv-report-body h2, .cv-report-body h3, .cv-report-body h4 {
  font-family: var(--font-body);
}

/* Approval form */
.cv-approval-form {
  background: rgba(56, 189, 248, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 20px;
}

.form-row {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px 14px;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color .2s;
  line-height: 1.6;
}

.form-textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(0, 0, 0, 0.4);
}

.approval-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Danger button */
.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.22);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fca5a5;
}

/* ============================================================================
   Phase 1 Side-by-Side Diagnostic & Keyword Matrix UI (v3.0.0)
   ============================================================================ */

/* Fullscreen toggle */
.cv-analysis-detail.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  z-index: 9999 !important;
  border-radius: 0 !important;
  overflow-y: auto !important;
  background: var(--bg-deep) !important;
  padding: 24px 32px 60px !important;
}

/* Hero Scorecards & Verdict Banner */
.cv-hero-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.cv-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cv-verdict-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cv-verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cv-verdict-pill.verdict-strong {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.cv-verdict-pill.verdict-shortlist {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.cv-verdict-pill.verdict-borderline {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.cv-verdict-pill.verdict-reject {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.cv-prob-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.cv-scorecards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.cv-scorecard {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
  transition: transform .15s, border-color .15s;
}

.cv-scorecard:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.cv-score-val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
  margin-bottom: 4px;
}

.cv-score-val.high { color: #34d399; }
.cv-score-val.medium { color: #fbbf24; }
.cv-score-val.low { color: #f87171; }

.cv-score-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cv-verdict-expl {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #38bdf8;
  border-radius: 4px 8px 8px 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Phase 1 Sub-Navigation Tabs */
.cv-subtabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
}

.cv-subtab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all .2s;
}

.cv-subtab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.cv-subtab-btn.active {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.subtab-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Split View Container */
.cv-split-view {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 992px) {
  .cv-split-view {
    grid-template-columns: 1fr;
  }
}

.cv-column {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.cv-col-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.cv-col-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cv-col-title h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.cv-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-filter-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 7px 12px;
  box-sizing: border-box;
}

.cv-filter-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.5);
}

.cv-pill-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cv-pill-filter {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all .15s;
}

.cv-pill-filter:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.cv-pill-filter.active {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
  font-weight: 600;
}

.cv-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Requirement Card (Left) */
.cv-req-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  cursor: pointer;
}

.cv-req-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cv-req-card.highlighted {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3) !important;
  background: rgba(56, 189, 248, 0.06);
}

.cv-req-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cv-importance-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 4px;
}

.cv-importance-tag.critical { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.cv-importance-tag.important { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.cv-importance-tag.preferred { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }

.cv-req-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
}

/* Amendment Card (Right) */
.cv-amend-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  position: relative;
}

.cv-amend-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.cv-amend-card.highlighted {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3) !important;
  background: rgba(56, 189, 248, 0.05);
}

/* Color border states */
.cv-card-match { border-left: 4px solid #10b981; }
.cv-card-partial { border-left: 4px solid #f59e0b; }
.cv-card-weak { border-left: 4px solid #f97316; }
.cv-card-missing { border-left: 4px solid #ef4444; }

.cv-amend-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.cv-section-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
}

.cv-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
}

.cv-status-pill.match { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.cv-status-pill.partial { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.cv-status-pill.weak { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.cv-status-pill.missing { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.cv-related-jd {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 2px solid rgba(56, 189, 248, 0.4);
}

.cv-amend-block {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.55;
}

.cv-block-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.cv-block-evidence {
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 8px;
  border-radius: 4px;
}

.cv-block-gap {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
  padding: 6px 8px;
  border-radius: 4px;
}

.cv-block-suggestion {
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(30, 58, 138, 0.15) 100%);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 500;
}

.cv-amend-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-add-finding {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}

.btn-add-finding:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

/* Accordion for Raw JD */
.cv-accordion summary {
  cursor: pointer;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.cv-raw-text-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 8px;
  max-height: 350px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: pre-wrap;
}

/* Keywords Matrix */
.cv-kw-stats-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.cv-kw-stat {
  flex: 1;
  min-width: 140px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cv-kw-stat-val {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.cv-keywords-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cv-keyword-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.cv-kw-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.cv-kw-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.cv-kw-rec {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 8px;
  border-radius: 4px;
}

/* Raw Split View */
.cv-raw-split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cv-raw-pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-height: 600px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Markdown Table Enhancements */
.cv-report-body table, .cv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  overflow: hidden;
}

.cv-report-body th, .cv-table th {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
}

.cv-report-body td, .cv-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
  color: var(--text-muted);
}

.cv-report-body tr:nth-child(even), .cv-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.cv-report-body tr:hover, .cv-table tr:hover {
  background: rgba(56, 189, 248, 0.04);
}
