/* ============================================================
   HOM Talent Filter — Estilos (sobrio, corporativo)
   ============================================================ */
:root {
  /* === Identidad HOM Modular === */
  --charcoal: #20242a;      /* carbon: barras, titulos, estructura */
  --charcoal-dark: #15181c;
  --brand: #f23d49;         /* rojo insignia HOM */
  --brand-dark: #d92f3a;
  --brand-tint: #fdecee;
  --cream: #faf7f2;         /* fondo calido (muebleria) */
  --warm-line: #ebe5da;

  /* Mapeo a los nombres usados en el resto del CSS */
  --navy: var(--charcoal);
  --navy-dark: var(--charcoal-dark);
  --blue: var(--brand);
  --blue-light: var(--brand-tint);
  --gray-bg: var(--cream);
  --gray-line: var(--warm-line);
  --gray-text: #837b6e;
  --ink: #1a1a1a;

  /* Estados semanticos (NO se mezclan con el rojo de marca) */
  --green: #1f9d55;
  --green-bg: #e6f6ed;
  --red: #c0392b;           /* rechazo: ladrillo, distinto del rojo HOM */
  --red-bg: #fbeae8;
  --yellow: #c98a00;
  --yellow-bg: #fdf6e3;
  --slate: #4d555b;         /* gris HOM para estados neutros */

  --radius: 12px;
  --shadow: 0 2px 14px rgba(32, 36, 42, 0.07);
  --font: "Helvetica Neue", Helvetica, Arial, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--gray-bg);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--blue); }
h1, h2, h3 { color: var(--navy); margin: 0 0 .4em; }
.muted { color: var(--gray-text); }
.center { text-align: center; }
.hidden { display: none !important; }

/* Header */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; display: flex; align-items: center; gap: 11px; }
.topbar .brand img { height: 24px; width: auto; display: block; }
.topbar .brand span { opacity: .72; font-weight: 400; font-size: 15px; }
.topbar .right { font-size: 14px; display: flex; gap: 14px; align-items: center; }

/* Layout */
.wrap { max-width: 820px; margin: 28px auto; padding: 0 18px; }
.wrap-wide { max-width: 1180px; }
.card {
  background: #fff;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 20px;
}

/* Forms */
label.field { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: #344256; }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  margin-top: 5px;
  border: 1px solid var(--gray-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
textarea { min-height: 110px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--brand); color: #fff; border: none;
  padding: 11px 22px; border-radius: 8px; font: inherit; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--gray-line); }
.btn.secondary:hover { background: var(--gray-bg); }
.btn.ghost { background: transparent; color: var(--gray-text); border: 1px solid transparent; }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.small { padding: 7px 13px; font-size: 13px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* Stepper */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.steps .dot {
  font-size: 12px; padding: 5px 11px; border-radius: 20px;
  background: #fff; border: 1px solid var(--gray-line); color: var(--gray-text);
}
.steps .dot.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.steps .dot.done { background: var(--green-bg); color: var(--green); border-color: #bce6cd; }
.progress { height: 6px; background: var(--gray-line); border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.progress > div { height: 100%; background: var(--blue); transition: width .3s; }

/* Test elements */
.q { padding: 14px 0; border-bottom: 1px solid var(--gray-line); }
.q:last-child { border-bottom: none; }
.q .qtext { font-weight: 600; margin-bottom: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--gray-line);
  border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.opt:hover { background: var(--blue-light); }
.opt input { width: auto; margin: 3px 0 0; }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale label { flex: 1; min-width: 56px; text-align: center; border: 1px solid var(--gray-line);
  border-radius: 8px; padding: 8px 4px; cursor: pointer; font-size: 13px; }
.scale input { display: none; }
.scale input:checked + span { font-weight: 700; }
.scale label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Sortable (organizacion) */
.sortable li { list-style: none; }
.sortable { padding: 0; margin: 0; }
.sort-item {
  background: #fff; border: 1px solid var(--gray-line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: grab;
}
.sort-item.dragging { opacity: .4; }
.sort-item .rank { background: var(--navy); color: #fff; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.sort-item .handle { color: var(--gray-text); margin-left: auto; }
.sort-move { display: flex; flex-direction: column; gap: 2px; }
.sort-move button { background: var(--gray-bg); border: 1px solid var(--gray-line); border-radius: 5px;
  cursor: pointer; width: 26px; height: 20px; line-height: 1; padding: 0; }

/* Data table (numeric/detail) */
table.data { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 14px; }
table.data th, table.data td { border: 1px solid var(--gray-line); padding: 8px 10px; text-align: left; }
table.data th { background: var(--blue-light); color: var(--navy); }
.record-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--gray-line);
  border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.record-row input { width: auto; }
.record-row .cells { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Result screen */
.result-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 38px; margin: 0 auto 14px; }
.result-icon.ok { background: var(--green-bg); color: var(--green); }
.result-icon.no { background: var(--red-bg); color: var(--red); }
.score-big { font-size: 46px; font-weight: 800; color: var(--navy); }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.pendiente { background: var(--gray-bg); color: var(--gray-text); }
.badge.aprobado { background: var(--green-bg); color: var(--green); }
.badge.rechazado { background: var(--red-bg); color: var(--red); }
.badge.entrevista_agendada { background: #eef0f2; color: var(--slate); }
.badge.contratado { background: #ece9fb; color: #5b3fb3; }
.badge.descartado { background: #eceff3; color: #707b8a; }
.rec-excelente { color: var(--green); font-weight: 700; }
.rec-buena { color: var(--slate); font-weight: 700; }
.rec-revision { color: var(--yellow); font-weight: 700; }
.rec-no { color: var(--red); font-weight: 700; }

/* Admin */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--gray-line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 30px; font-weight: 800; color: var(--navy); }
.stat .l { font-size: 13px; color: var(--gray-text); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; margin: 0; }
.toolbar .spacer { flex: 1; }
table.candidates { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.candidates th, table.candidates td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--gray-line); font-size: 14px; }
table.candidates th { background: var(--navy); color: #fff; font-weight: 600; cursor: default; }
table.candidates tbody tr:hover { background: var(--blue-light); cursor: pointer; }
.scorebar { background: var(--gray-line); border-radius: 6px; height: 8px; width: 90px; overflow: hidden; display: inline-block; vertical-align: middle; }
.scorebar > div { height: 100%; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: #fff; border: 1px solid var(--gray-line); padding: 9px 16px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; color: var(--gray-text); }
.tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.bar-row .lbl { width: 160px; flex-shrink: 0; }
.bar-row .track { flex: 1; background: var(--gray-line); height: 14px; border-radius: 7px; overflow: hidden; }
.bar-row .track > div { height: 100%; background: var(--blue); }
.bar-row .val { width: 70px; text-align: right; font-weight: 600; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(20,30,45,.5); display: flex; align-items: flex-start;
  justify-content: center; padding: 30px 16px; overflow-y: auto; z-index: 50; }
.modal { background: #fff; border-radius: var(--radius); max-width: 760px; width: 100%; padding: 26px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }

/* Toast */
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--navy); color: #fff; padding: 13px 18px;
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 100; font-size: 14px; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
.alert { padding: 11px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; }
.alert.err { background: var(--red-bg); color: var(--red); }
.alert.info { background: var(--blue-light); color: var(--navy); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--gray-text); }

/* Texto de bienvenida (portada del aspirante) */
.welcome-text { max-width: 640px; margin: 20px auto 0; text-align: left; color: #33312e; font-size: 15.5px; line-height: 1.7; }
.welcome-text p { margin: 0 0 14px; }
.welcome-links { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--gray-line);
  display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; font-size: 14px; }
.welcome-links a { color: var(--gray-text); text-decoration: none; font-weight: 600; }
.welcome-links a:hover { color: var(--brand); }

/* Modal de descripción del puesto */
.job-modal { color: #33312e; line-height: 1.6; }
.job-modal h3 { color: var(--navy); margin: 20px 0 6px; font-size: 16px; }
.job-modal ul { margin: 6px 0 0; padding-left: 20px; }
.job-modal li { margin-bottom: 5px; }
.job-modal p { margin: 0 0 8px; }
