/* Densidad del back office (10-ago-2026): el body entero de las páginas de
   administración renderiza al 75% (texto corriente ~10.6-11.4px) escalando TODO
   en proporción — tarjetas, paddings, sidebar del hub-shell incluida (por eso
   va en body y no en .rrhh-page: el hub-shell se monta fuera de .rrhh-page).
   El portal /yo no monta .rrhh-page → no se ve afectado. */
body:has(.rrhh-page) { zoom: 0.75; }

/* ─────────────────────────────────────────────────────────────────
   rrhh.css  ·  RRHH Ecosystem Design System  ·  Light theme
   ───────────────────────────────────────────────────────────────── */

/* ── Fonts ──────────────────────────────────────────────────────── */
@font-face {
  font-family: "Bw Modelica";
  src: url("fonts/BwModelica-Regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bw Modelica";
  src: url("fonts/BwModelica-Medium.woff") format("woff");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bw Modelica";
  src: url("fonts/BwModelica-Bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Bw Modelica";
  src: url("fonts/BwModelica-ExtraBold.woff") format("woff");
  font-weight: 800; font-style: normal; font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:        #f95a5c;
  --brand-dark:   #d94040;
  --brand-light:  #fff0f0;

  /* Semantic */
  --danger:       #e03956;
  --danger-dark:  #bd2544;
  --danger-light: #fdeef2;
  --warning:      #f59e0b;
  --warning-light:#fffbeb;
  --info:         #3b82f6;
  --info-light:   #eff6ff;

  /* Text */
  --t1: #111827;
  --t2: #374151;
  --t3: #6b7280;
  --t4: #9ca3af;

  /* Surfaces */
  --bg:        #f8f6f3;
  --bg-card:   #ffffff;
  --border:    #e5e7eb;
  --border-md: #d1d5db;

  /* Shadows */
  --s-card:  0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --s-hover: 0 6px 20px rgba(0,0,0,0.10);
  --s-pop:   0 20px 48px rgba(0,0,0,0.14);

  /* Radii */
  --r-xs:   6px;
  --r-sm:   8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill:999px;

  /* Transitions */
  --ease: 0.15s ease;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Bw Modelica", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ── Page shell ─────────────────────────────────────────────────── */
.rrhh-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top nav ────────────────────────────────────────────────────── */
.rrhh-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 32px;
  height: 56px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--t1);
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.nav-sep {
  height: 20px;
  width: 1px;
  background: var(--border);
  margin: 0 4px;
}

.nav-breadcrumb {
  font-size: 0.88rem;
  color: var(--t3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-breadcrumb a { color: var(--t3); transition: color var(--ease); }
.nav-breadcrumb a:hover { color: var(--t1); }
.nav-breadcrumb-sep { color: var(--t4); }
.nav-breadcrumb-current { color: var(--t1); font-weight: 600; }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background var(--ease);
}
.nav-user:hover { background: var(--border); }

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-light);
  border: 2px solid var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-dark);
  flex-shrink: 0;
}

.nav-user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--t2);
}

.nav-btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-md);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--t3);
  transition: all var(--ease);
}
.nav-btn-logout:hover { border-color: var(--t3); color: var(--t1); }

/* ── Main content area ──────────────────────────────────────────── */
.rrhh-main {
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 32px 80px;
}

/* ── Section header ─────────────────────────────────────────────── */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 14px;
}

/* ── Generic card ───────────────────────────────────────────────── */
.rrhh-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--s-card);
  padding: 24px;
}

/* ── Department card grid ───────────────────────────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.dept-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--s-card);
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  cursor: pointer;
  transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease);
  position: relative;
  text-decoration: none;
  color: inherit;
}
.dept-card:hover {
  box-shadow: var(--s-hover);
  transform: translateY(-2px);
  border-color: var(--border-md);
}
.dept-card:active { transform: translateY(0); }

.dept-card-pending {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,0.35);
}

.dept-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.dept-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--t1);
  margin-bottom: 6px;
}

.dept-desc {
  font-size: 0.85rem;
  color: var(--t3);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 18px;
}

.dept-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}

.dept-sections {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--t3);
}

.dept-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
  transition: background var(--ease), color var(--ease);
}
.dept-card:hover .dept-arrow {
  background: var(--t1);
  color: #fff;
}

/* ── Todo list (Cosas por hacer) ────────────────────────────────── */
.todo-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--s-card);
  padding: 20px 24px;
}

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

.todo-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--t1);
}

.todo-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--t3);
}

.todo-items {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none;
  color: inherit;
}
.todo-item:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.todo-item-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.todo-item-text { flex: 1; }

.todo-item-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--t1);
  display: flex;
  align-items: center;
  gap: 6px;
}

.todo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.todo-item-sub {
  font-size: 0.78rem;
  color: var(--t3);
  margin-top: 1px;
}

.todo-empty {
  font-size: 0.88rem;
  color: var(--t4);
  padding: 8px 0;
  font-style: italic;
}

/* ── KPI card ───────────────────────────────────────────────────── */
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--s-card);
  padding: 20px 24px;
}

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

.kpi-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--t1);
}

.kpi-note {
  font-size: 0.78rem;
  color: var(--t4);
  font-weight: 500;
}

.kpi-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
}

.kpi-tab {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
  flex: 1;
  min-width: 0;
}
.kpi-tab:last-child { border-right: none; }

.kpi-tab-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--t2);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-tab-value {
  font-size: 0.78rem;
  color: var(--t4);
  font-weight: 500;
}

.kpi-tab-bar {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 8px;
}
.kpi-tab-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--brand);
  width: 0%;
}

/* ── Greeting section ───────────────────────────────────────────── */
.greeting-section {
  margin-bottom: 32px;
}

.greeting-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--t1);
  margin-bottom: 4px;
}

.greeting-name { color: var(--brand); }

.greeting-sub {
  font-size: 0.95rem;
  color: var(--t3);
  font-weight: 500;
}

/* ── Stat mini card ─────────────────────────────────────────────── */
.stat-mini {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--s-card);
  padding: 18px 20px;
  border-top: 3px solid transparent;
}
.stat-mini--ok      { border-top-color: var(--brand); }
.stat-mini--error   { border-top-color: var(--danger); }
.stat-mini--warning { border-top-color: var(--warning); }
.stat-mini--info    { border-top-color: var(--info); }
.stat-mini--muted   { border-top-color: var(--border-md); }

.stat-mini-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-mini--ok .stat-mini-value      { color: var(--brand-dark); }
.stat-mini--error .stat-mini-value   { color: var(--danger); }
.stat-mini--warning .stat-mini-value { color: #92400e; }
.stat-mini--info .stat-mini-value    { color: #1d4ed8; }
.stat-mini--muted .stat-mini-value   { color: var(--t4); }

.stat-mini-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t4);
}

/* ── Badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-ok      { background: rgba(249,90,92,0.1);   color: var(--brand-dark); }
.badge-exceso  { background: rgba(245,158,11,0.12); color: #92400e; }
.badge-deficit { background: rgba(224,57,86,0.1);   color: var(--danger-dark); }
.badge-no-enc  { background: rgba(107,114,128,0.1); color: var(--t3); }
.badge-solo    { background: rgba(107,114,128,0.06);color: var(--t4); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all var(--ease);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover   { background: var(--brand-dark); }
.btn-primary:disabled { background: var(--t4); cursor: not-allowed; }

.btn-secondary {
  background: var(--bg);
  color: var(--t2);
  border: 1px solid var(--border-md);
}
.btn-secondary:hover { border-color: var(--t3); color: var(--t1); }

.btn-ghost {
  background: transparent;
  color: var(--t3);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--t2); }

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--r-md);
}

.btn-full { width: 100%; }

/* ── Tool page layout ───────────────────────────────────────────── */
.tool-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px 60px;
}

.tool-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--t1);
  margin-bottom: 4px;
}

.tool-page-sub {
  font-size: 0.9rem;
  color: var(--t3);
  font-weight: 500;
  margin-bottom: 28px;
}

/* ── Upload card ────────────────────────────────────────────────── */
.upload-zone {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 2px dashed var(--border-md);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--ease);
  position: relative;
  text-align: center;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-zone.has-file {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

.upload-zone-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-lg);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: background var(--ease);
}
.upload-zone.has-file .upload-zone-icon { background: rgba(249,90,92,0.12); }

.upload-zone-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--t1);
}
.upload-zone-sub {
  font-size: 0.8rem;
  color: var(--t3);
}
.upload-zone-filename {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-dark);
  word-break: break-all;
}

/* ── Results table ──────────────────────────────────────────────── */
.results-table-wrap {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--s-card);
  overflow: hidden;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.results-table thead th {
  background: var(--bg);
  padding: 10px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--t4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.results-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--ease);
}
.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody tr:hover { background: var(--bg); }
.results-table tbody tr[hidden] { display: none; }

.results-table td {
  padding: 12px 16px;
  color: var(--t1);
  vertical-align: middle;
}

.td-name { font-weight: 600; }
.td-name-pdf {
  font-size: 0.76rem;
  color: var(--t4);
  font-weight: 400;
  margin-top: 2px;
}
.td-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  color: var(--t2);
}
.td-diff {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}
.td-diff.pos  { color: #92400e; }
.td-diff.neg  { color: var(--danger); }
.td-diff.zero { color: var(--brand-dark); }

.page-tag {
  font-size: 0.7rem;
  color: var(--t4);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
}

/* ── Filter bar ─────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--t3);
  cursor: pointer;
  transition: all var(--ease);
}
.filter-chip:hover { border-color: var(--border-md); color: var(--t2); }
.filter-chip.active {
  background: var(--t1);
  color: #fff;
  border-color: var(--t1);
}

.filter-search {
  margin-left: auto;
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  width: 200px;
  background: var(--bg-card);
  color: var(--t1);
  transition: border-color var(--ease);
}
.filter-search:focus { border-color: var(--brand); }

/* ── Empty / loading states ─────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 10px;
  color: var(--t4);
}
.empty-state-icon { font-size: 2.2rem; opacity: 0.6; }
.empty-state-text { font-size: 0.95rem; font-weight: 600; color: var(--t3); }
.empty-state-sub  { font-size: 0.85rem; text-align: center; max-width: 320px; }

.spinner {
  width: 24px; height: 24px;
  border: 2.5px solid rgba(249,90,92,0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────────────────────────── */
.rrhh-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--t1);
  color: #fff;
  padding: 11px 22px;
  border-radius: var(--r-pill);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: var(--s-pop);
}
.rrhh-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.rrhh-toast.error   { background: var(--danger); }
.rrhh-toast.success { background: var(--brand); }

/* ── Export button ──────────────────────────────────────────────── */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--t3);
  cursor: pointer;
  transition: all var(--ease);
}
.btn-export:hover { border-color: var(--border-md); color: var(--t2); }

/* ── Role badges ─────────────────────────────────────────────────── */
.role-badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; display: inline-block; }
.rb-admin       { background: #FEF3C7; color: #92400E; }
.rb-interviewer { background: #EEF2FF; color: #4F46E5; }
.rb-viewer      { background: var(--bg); color: var(--t3); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dept-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .rrhh-nav   { padding: 0 16px; }
  .nav-user-name { display: none; }
  .rrhh-main  { padding: 24px 16px 60px; }
  .dept-grid  { grid-template-columns: repeat(2, 1fr); }
  .kpi-tabs   { display: none; }
  .filter-search { width: 100%; margin-left: 0; }
  .tool-content  { padding: 20px 16px 40px; }
  .greeting-title { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .dept-grid  { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dept-card  { padding: 16px; }
  .dept-title { font-size: .9rem; }
  .dept-desc  { display: none; }
  .dept-footer { display: none; }
  .nav-btn-logout span { display: none; }
  .nav-btn-logout { padding: 7px 10px; }
}
