:root {
  --primary: #1a1a2e;
  --accent: #e94560;
  --success: #27ae60;
  --warning: #f39c12;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2d3436;
  --text-light: #636e72;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  margin: 0;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--primary);
  color: white;
  padding: 0.75rem 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  z-index: 100;
}

.nav a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 0;
  opacity: 0.8;
}

.nav a:hover {
  opacity: 1;
}

.nav .nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  margin-right: auto;
}

.main-content {
  padding-top: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.card {
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  color: var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.75rem;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e9ecef;
}

.data-table tr:nth-child(even) {
  background: #f8f9fa;
}

.data-table tr:hover {
  background: #e8f4f8;
}

.data-table a {
  color: var(--accent);
  text-decoration: none;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--nuevo {
  background: #e3f2fd;
  color: #1565c0;
}

.badge--en_evaluacion {
  background: #fff3e0;
  color: #e65100;
}

.badge--seleccionado {
  background: #f3e5f5;
  color: #6a1b9a;
}

.badge--onboarding {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge--productivo {
  background: #e0f2f1;
  color: #00695c;
}

.badge--rechazado {
  background: #ffebee;
  color: #b71c1c;
}

.badge--abierta {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge--en_proceso {
  background: #fff3e0;
  color: #e65100;
}

.badge--cerrada {
  background: #f5f5f5;
  color: #616161;
}

.pipeline-funnel {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.pipeline-stage {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 1rem 0.5rem;
  border-radius: 8px;
  background: #f0f4ff;
  border: 2px solid #dde4ff;
}

.pipeline-stage .stage-count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.pipeline-stage .stage-name {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-bar-container {
  background: #e9ecef;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  overflow-x: auto;
}

.kanban-column {
  background: #f0f4ff;
  border-radius: 8px;
  padding: 0.75rem;
  min-width: 160px;
}

.kanban-column h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin: 0 0 0.5rem;
}

.kanban-card {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.page-header p {
  color: var(--text-light);
  margin: 0;
}

/* ── Screening / Reclutamiento ─────────────────────────────── */

.fit-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fit-alto { background: #d1fae5; color: #065f46; }
.fit-medio { background: #fef3c7; color: #92400e; }
.fit-bajo { background: #fee2e2; color: #991b1b; }

.screening-table th,
.screening-table td {
  white-space: nowrap;
}

.red-flag-badge {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
}

.no-flags {
  color: var(--text-light);
  font-size: 0.85rem;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.keyword-match {
  background: #d1fae5;
  color: #065f46;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.keyword-missing {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.screening-detail {
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  padding: 1rem 1.25rem;
  margin: 0;
}

.detail-row td {
  padding: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.justification-text {
  font-size: 0.875rem;
  color: var(--text-dark);
  margin: 0 0 0.5rem;
  font-style: italic;
}

.flag-list {
  margin: 0.25rem 0 0 1rem;
  padding: 0;
  font-size: 0.8rem;
  color: #991b1b;
}

/* Position selector cards */
.position-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.position-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.position-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.position-card-title {
  margin: 0;
  font-size: 1rem;
}

.position-card-title a {
  color: var(--primary);
  text-decoration: none;
}

.position-card-dept {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-light);
}

.fit-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px;
}

.fit-bar-segment {
  border-radius: 4px;
}

.fit-counts {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  align-items: center;
}

.fit-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.fit-total {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-left: auto;
}

.no-screening {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
}

.btn-view-report {
  display: inline-block;
  margin-top: auto;
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.btn-view-report:hover {
  text-decoration: underline;
}

.candidate-row {
  cursor: default;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .nav {
    gap: 0.75rem;
  }
}

/* ── Onboarding System (PWXTJIDLSA-3) ────────────────────── */

.timeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 100px;
  position: relative;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  z-index: 1;
}

.timeline-dot--done { background: var(--success, #27ae60); }
.timeline-dot--active { background: var(--accent, #6c63ff); }
.timeline-dot--pending { background: #ccc; color: #666; }

.timeline-connector {
  flex: 1;
  height: 3px;
  background: #e0e0e0;
  min-width: 20px;
}

.timeline-connector--done { background: var(--success, #27ae60); }

.timeline-label {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light, #636e72);
  text-align: center;
  font-weight: 600;
}

.timeline-count {
  font-size: 0.75rem;
  color: var(--text-light, #636e72);
}

.area-section {
  margin-top: 1.25rem;
}

.area-section:first-child {
  margin-top: 0;
}

.area-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--primary, #1a1a2e);
  margin-bottom: 0.5rem;
}

.area-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--primary, #1a1a2e);
}

.risk-card {
  border-left: 4px solid;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 0 6px 6px 0;
  background: var(--card-bg, #fff);
}

.risk-card--alta { border-left-color: #e74c3c; background: #fdf2f2; }
.risk-card--media { border-left-color: #f39c12; background: #fffcf0; }
.risk-card--baja { border-left-color: #27ae60; background: #f0fdf4; }

.severity-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.severity-alta { background: #fee2e2; color: #991b1b; }
.severity-media { background: #fef3c7; color: #92400e; }
.severity-baja { background: #d1fae5; color: #065f46; }

.survey-scores {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  text-align: center;
  margin-top: 0.5rem;
}

.survey-score-item {
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.survey-score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary, #1a1a2e);
}

.survey-score-label {
  font-size: 0.75rem;
  color: var(--text-light, #636e72);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.meta-item {
  font-size: 0.9rem;
}

.meta-item strong {
  display: block;
  font-size: 0.75rem;
  color: var(--text-light, #636e72);
  margin-bottom: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
