/* MODULO TALENTO HUMANO — estilos (full-width, sin max-width ni margin:0 auto) */
/* TH-REDISENO-v1: Clean Modern — tarjetas blancas, borde fino, radio 12px, acento azul var(--azul) */

#page-talentoHumano { max-width: 100%; animation: none !important; }

.th-hero {
  background: #fff;
  color: var(--texto, #1E293B);
  border: 1px solid var(--borde, #E2E8F0);
  padding: 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.th-hero h2 { font-weight: 800; letter-spacing: -0.4px; }
.th-hero-sub { font-size: 12px; color: #64748b; margin-top: 4px; }

.th-body { padding: 14px 16px; }

.th-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--azul-bg, #EDF1F9); color: var(--azul, #1A3C8F);
  font-weight: 800; font-size: 12px;
}
.th-avatar-lg { width: 52px; height: 52px; font-size: 18px; }

.th-estado { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #475569; }
.th-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.th-tag {
  display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 11px; font-weight: 600;
  background: var(--gris-light, #F1F5F9); color: #475569;
}

.th-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 16px 0;
}
.th-kpi {
  background: #fff;
  border: 1px solid var(--borde, #E2E8F0);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--sombra, 0 4px 12px rgba(0,0,0,0.08));
}
.th-kpi-icono {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 15px; margin-bottom: 8px;
}
.th-kpi-icono-azul { background: var(--azul-bg, #EDF1F9); }
.th-kpi-icono-verde { background: #dcfce7; }
.th-kpi-icono-rosa { background: #fce7f3; }
.th-kpi-icono-ambar { background: #fef3c7; }
.th-kpi-label { font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; color: #64748b; }
.th-kpi-valor { font-size: 24px; font-weight: 900; color: var(--texto, #1E293B); margin: 4px 0 2px; }
.th-kpi-sub { font-size: 10px; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* TH-REDISENO-v1: franja de 4 cifras debajo del encabezado de la ficha */
.th-franja { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 12px 16px 0; }
.th-franja-tile {
  background: #fff; border: 1px solid var(--borde, #E2E8F0); border-radius: 12px; padding: 12px 14px;
}
.th-franja-valor { font-size: 18px; font-weight: 800; color: var(--texto, #1E293B); margin-top: 4px; }

/* TH-REDISENO-v1: barra de cartera (facturas/préstamos/notas débito) */
.th-barra { display: flex; width: 100%; height: 8px; border-radius: 99px; overflow: hidden; background: var(--gris-light, #F1F5F9); margin-bottom: 8px; }
.th-barra span { height: 100%; }
.th-barra-leyenda { display: flex; gap: 12px; font-size: 11px; color: #64748b; margin-bottom: 10px; flex-wrap: wrap; }
.th-barra-leyenda i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

.th-filtros { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.th-input {
  padding: 9px 12px;
  border: 1px solid var(--borde, #E2E8F0);
  border-radius: var(--radio, 10px);
  font-family: inherit;
  font-size: 13px;
  flex: 1;
  min-width: 140px;
  background: #fff;
}
.th-input:focus { outline: none; border-color: var(--azul, #1A3C8F); box-shadow: 0 0 0 3px rgba(26,60,143,.12); }

.th-tabla-wrap { overflow-x: auto; }
.th-tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 13px; }
.th-tabla th {
  text-align: left; padding: 10px 12px; background: var(--gris-light, #F1F5F9);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b;
}
.th-tabla td { padding: 10px 12px; border-top: 1px solid var(--borde, #E2E8F0); vertical-align: top; }
.th-tabla tbody tr:hover { background: var(--azul-bg, #EDF1F9); }
.th-tabla-mini { font-size: 12px; }
.th-num { font-weight: 700; white-space: nowrap; }
.th-sub { font-size: 11px; color: #94a3b8; }

.th-chip {
  display: inline-block; padding: 2px 10px; border-radius: 99px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
}

.th-btn {
  background: var(--azul, #1A3C8F); color: #fff; border: 1px solid var(--azul, #1A3C8F);
  padding: 9px 16px; border-radius: 12px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: filter 0.2s;
}
.th-btn:hover { filter: brightness(1.15); }
/* TH-REDISENO-v1: secundario (borde fino, fondo claro) en vez del bloque blanco translúcido sobre el degradado */
.th-btn-sec { background: #fff; color: var(--azul, #1A3C8F); border: 1px solid var(--borde, #E2E8F0); }
/* TH-REDISENO-v1: Retirar en texto/borde rojo, no bloque rojo */
.th-btn-rojo { background: #fff; color: var(--rojo, #EF4444); border: 1px solid var(--rojo, #EF4444); }
.th-btn-gris { background: var(--gris, #64748B); border-color: var(--gris, #64748B); }
.th-btn-mini { padding: 5px 10px; font-size: 11px; }

.th-info-btn, .th-info-mini { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0 2px; }
.th-info-mini { font-size: 0.8rem; }

.th-empty {
  text-align: center; padding: 40px 20px; color: #94a3b8;
  background: #fff; border: 1px dashed var(--borde, #E2E8F0); border-radius: var(--radio-lg, 16px);
  font-size: 14px;
}

.th-tabs { display: flex; gap: 6px; padding: 12px 16px 0; }
.th-tab {
  background: #fff; border: 1px solid var(--borde, #E2E8F0); border-bottom: none;
  padding: 9px 18px; border-radius: 10px 10px 0 0; font-family: inherit;
  font-size: 13px; font-weight: 700; color: #64748b; cursor: pointer;
}
.th-tab-activo { color: var(--azul, #1A3C8F); border-top: 3px solid var(--azul, #1A3C8F); }

.th-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.th-card {
  background: #fff; border: 1px solid var(--borde, #E2E8F0);
  border-radius: 12px; padding: 14px; box-shadow: var(--sombra, 0 4px 12px rgba(0,0,0,0.08));
}
.th-card-titulo { font-size: 13px; font-weight: 800; margin-bottom: 10px; color: var(--texto, #1E293B); }
.th-fila { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--gris-light, #F1F5F9); font-size: 13px; }
.th-fila-label { color: #64748b; font-size: 12px; }
.th-costo-total {
  margin-top: 10px; padding: 10px; background: var(--azul-bg, #EDF1F9);
  border-radius: 8px; font-size: 14px; text-align: center;
}
.th-alerta {
  margin-top: 8px; padding: 8px 10px; background: #fef3c7; color: #92400e;
  border-radius: 8px; font-size: 12px;
}

.th-doc-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.th-modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px); z-index: 9998;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.th-modal {
  background: #fff; border-radius: var(--radio-lg, 16px); padding: 20px;
  width: 100%; max-width: calc(100vw - 40px); max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.th-info-campo { margin-bottom: 10px; font-size: 13px; }
.th-info-campo b { color: var(--azul, #1A3C8F); }
.th-info-campo p { margin: 3px 0 0; color: #475569; }

.th-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.th-form-campo { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: #64748b; }
.th-form-campo .th-input { font-weight: 400; }
.th-form-check { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 10px; }

/* TH-LIQUIDACION-v1: pestaña "Liquidar quincena" */
.th-liq-selector { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.th-input-mini { width: 90px; padding: 6px 8px; }
.th-tabla-liq { font-size: 12px; }
.th-tabla-liq td, .th-tabla-liq th { white-space: nowrap; }
.th-chip-aviso { background: #fef3c7; color: #92400e; margin: 0 2px; cursor: help; }

@media (max-width: 900px) {
  .th-kpis { grid-template-columns: repeat(2, 1fr); }
  .th-grid-2 { grid-template-columns: 1fr; }
  .th-form-grid { grid-template-columns: repeat(2, 1fr); }
}
/* TH-REDISENO-v1: <760px una columna; la franja de 4 cifras queda en 2x2 */
@media (max-width: 760px) {
  .th-franja { grid-template-columns: repeat(2, 1fr); }
  .th-tabs { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .th-kpis { grid-template-columns: 1fr; }
  .th-franja { grid-template-columns: 1fr 1fr; }
  .th-form-grid { grid-template-columns: 1fr; }
  .th-hero { padding: 16px 14px; }
}
