:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in { animation: slideIn 0.35s ease; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.card-modern {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.card-modern:hover { box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1); }

.stat-card {
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
}

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

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition);
}

.btn-primary-custom:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgb(30 64 175 / 0.4);
  color: white;
}

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 500px;
}

.kanban-column {
  min-width: 280px;
  max-width: 300px;
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 1rem;
  flex-shrink: 0;
}

.kanban-column-header {
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card {
  background: white;
  border-radius: 8px;
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  cursor: grab;
  transition: var(--transition);
}

.kanban-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}

.kanban-card.sortable-ghost { opacity: 0.4; }
.kanban-card.sortable-drag { box-shadow: 0 8px 25px rgb(0 0 0 / 0.15); }

.badge-score {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
}

.badge-excepcional { background: #fef2f2; color: #dc2626; }
.badge-alto { background: #fff7ed; color: #ea580c; }
.badge-buen { background: #fefce8; color: #ca8a04; }
.badge-moderado { background: #f1f5f9; color: #64748b; }
.badge-no { background: #fef2f2; color: #991b1b; }

.portal-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #0ea5e9 100%);
  color: white;
  padding: 3rem 0;
}

.progress-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 2rem 0;
}

.progress-stepper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.step-item {
  text-align: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-weight: 600;
  transition: var(--transition);
}

.step-item.active .step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.step-item.completed .step-circle {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.form-section-card {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.form-section-header {
  background: linear-gradient(90deg, #f8fafc, white);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.word-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.word-counter.over { color: var(--danger); }

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
  height: 20px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.table-hover-modern tbody tr { transition: var(--transition); }
.table-hover-modern tbody tr:hover { background: #f8fafc; }

/* Sidebar admin — navegación persistente */
.main-sidebar .nav-sidebar .nav-link {
  transition: var(--transition);
  border-radius: 8px;
  margin: 2px 8px;
}

.main-sidebar .nav-sidebar .nav-link:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
}

.main-sidebar .nav-sidebar .nav-link.active {
  background: var(--primary-light) !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.main-sidebar .brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Informe evaluación CV */
.cv-report {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.cv-report-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cv-score-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.cv-score-excellent { background: linear-gradient(135deg, #059669, #10b981); }
.cv-score-good { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.cv-score-partial { background: linear-gradient(135deg, #d97706, #f59e0b); }
.cv-score-low { background: linear-gradient(135deg, #dc2626, #ef4444); }

.cv-report-section {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cv-report-section:last-child { border-bottom: none; }

.cv-report-section h6 {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cv-criterion-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed var(--border);
}

.cv-criterion-row:last-child { border-bottom: none; }

.cv-criterion-score {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.cv-point-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--primary-light);
}

.cv-point-card.gap { border-left-color: var(--warning); }
.cv-point-card strong { display: block; margin-bottom: 0.25rem; }

.cv-recommendation-box {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border: 1px solid #bfdbfe;
}

/* Informe evaluación formulario */
.form-report { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }

.form-score-table { width: 100%; font-size: 0.9rem; }
.form-score-table th { background: #f1f5f9; font-weight: 600; padding: 0.6rem 0.75rem; }
.form-score-table td { padding: 0.6rem 0.75rem; border-top: 1px solid var(--border); vertical-align: middle; }

.answer-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  background: #fafbfc;
}

.answer-block.evaluated-high { border-left: 4px solid var(--success); }
.answer-block.evaluated-mid { border-left: 4px solid var(--warning); }
.answer-block.evaluated-low { border-left: 4px solid var(--danger); }

.answer-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }

.score-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.score-pill-high { background: #d1fae5; color: #065f46; }
.score-pill-mid { background: #fef3c7; color: #92400e; }
.score-pill-low { background: #fee2e2; color: #991b1b; }

.manual-score-panel {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: .75rem;
  margin-top: .75rem;
}
.manual-score-panel .form-control-sm { max-width: 90px; }
.holistic-report-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.holistic-metric {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .5rem .75rem;
  margin: 0 .5rem .5rem 0;
  font-size: .9rem;
}
.badge-manual { background: #e0e7ff; color: #3730a3; }

.section-accordion-header {
  background: linear-gradient(90deg, #f8fafc, #fff);
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.section-accordion-header:hover { border-color: var(--primary-light); }
.section-accordion-header.open { border-color: var(--primary); background: #eff6ff; }

.interpretation-band {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}

.nav-tabs-inner { border-bottom: 1px solid var(--border); }
.nav-tabs-inner .nav-link {
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
}
.nav-tabs-inner .nav-link.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom: 2px solid var(--primary);
  background: transparent;
}

/* Entrevistas — subida, conversación e informe */
.interview-upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  background: #f8fafc;
  transition: var(--transition);
}

.interview-upload-zone:hover {
  border-color: var(--primary-light);
  background: #eff6ff;
}

.interview-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.interview-status-pill.pending { background: #f1f5f9; color: #64748b; }
.interview-status-pill.transcribing,
.interview-status-pill.evaluating { background: #dbeafe; color: #1d4ed8; }
.interview-status-pill.completed { background: #d1fae5; color: #065f46; }

.interview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.interview-kpi-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  text-align: center;
}

.interview-kpi-card .kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.interview-kpi-card .kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.interview-chart-box {
  position: relative;
  height: 260px;
  padding: 0.5rem;
}

.interview-chat {
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.interview-chat-turn {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.interview-chat-turn.candidate {
  flex-direction: row-reverse;
}

.interview-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.interview-chat-avatar.interviewer { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.interview-chat-avatar.candidate { background: linear-gradient(135deg, #059669, #10b981); }
.interview-chat-avatar.unknown { background: linear-gradient(135deg, #64748b, #94a3b8); }

.interview-bubble-wrap {
  max-width: min(78%, 640px);
}

.interview-speaker-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.interview-chat-turn.candidate .interview-speaker-meta {
  justify-content: flex-end;
}

.interview-bubble {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.interview-bubble--interviewer {
  background: #fff;
  border: 1px solid #dbeafe;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.04);
}

.interview-bubble--candidate {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-top-right-radius: 4px;
}

.interview-bubble--unknown {
  background: #f8fafc;
  border: 1px solid var(--border);
}

.interview-transcript-plain {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  background: #f8fafc;
  border-radius: 10px;
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.upload-progress-bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.2s ease;
}

.interview-red-flag {
  background: #fef2f2;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  padding: 0.65rem 0.875rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
