/* =====================================================
   ÁREA 02 - TALENTO HUMANO | G.R. PAVICONS
   Usa los colores institucionales de institucional.css
   ===================================================== */

.th {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 18px 22px 40px;
}

/* Barra de navegación del área */
.th-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 6px;
    background: var(--pav-white);
    border: 1px solid var(--pav-border);
    border-radius: 10px;
}

.th-nav a {
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #444;
}

.th-nav a:hover { background: #F4F4F4; }
.th-nav a.activo { background: var(--pav-black); color: var(--pav-yellow); }
.th-nav .th-nav-derecha { margin-left: auto; }
.th-nav a.volver { color: var(--pav-muted); font-weight: 400; }

/* Títulos */
.th-titulo {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.th-titulo h2 { margin: 0; font-size: 24px; }
.th-titulo p { margin: 4px 0 0; color: var(--pav-muted); font-size: 14px; }
.th-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

/* Botones */
.th-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 9px 16px;
    border: 2px solid var(--pav-yellow);
    border-radius: 8px;
    background: var(--pav-yellow);
    color: var(--pav-black);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.th-btn:hover { filter: brightness(.95); }
.th-btn.borde { background: var(--pav-white); }
.th-btn.oscuro { background: var(--pav-black); border-color: var(--pav-black); color: var(--pav-white); }
.th-btn.rojo { background: #FFF; border-color: #C62828; color: #C62828; }
.th-btn.verde { background: #1E7B34; border-color: #1E7B34; color: #FFF; }
.th-btn.mini { min-height: 30px; padding: 4px 10px; font-size: 12px; }

/* Tarjetas */
.th-tarjeta {
    background: var(--pav-white);
    border: 1px solid var(--pav-border);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.05);
    padding: 20px;
    margin-bottom: 16px;
}

.th-tarjeta h3 { margin: 0 0 14px; font-size: 17px; }
.th-tarjeta h3 small { color: var(--pav-muted); font-weight: 400; font-size: 13px; }

/* Indicadores */
.th-indicadores {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.th-indicador {
    display: block;
    padding: 16px 18px;
    background: var(--pav-white);
    border: 1px solid var(--pav-border);
    border-left: 5px solid var(--pav-yellow);
    border-radius: 10px;
}

.th-indicador:hover { border-color: var(--pav-yellow); }
.th-indicador small { display: block; color: var(--pav-muted); font-size: 13px; }
.th-indicador strong { display: block; margin-top: 4px; font-size: 30px; }
.th-indicador.alerta { border-left-color: #C62828; }
.th-indicador.alerta strong { color: #C62828; }

.th-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Módulos del área */
.th-modulos {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.th-modulo {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    background: var(--pav-white);
    border: 1px solid var(--pav-border);
    border-radius: 10px;
}

a.th-modulo:hover { border-color: var(--pav-yellow); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.th-modulo .icono {
    width: 42px; height: 42px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 10px; background: var(--pav-yellow-light); font-size: 20px;
}
.th-modulo strong { display: block; font-size: 15px; }
.th-modulo small { color: var(--pav-muted); font-size: 12px; }
.th-modulo.pronto { opacity: .55; border-style: dashed; }

/* Filtros */
.th-filtros {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.th-filtros label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; color: #555; }
.th-filtros input, .th-filtros select {
    min-height: 40px; padding: 8px 10px; font-size: 14px; font-family: inherit;
    border: 1px solid #CFCFCF; border-radius: 8px; background: #FFF;
}
.th-filtros .buscar input { width: 280px; }

/* Tablas */
.th-tabla-caja { overflow-x: auto; }
.th-tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.th-tabla th {
    background: var(--pav-black); color: var(--pav-white);
    text-align: left; padding: 10px; font-size: 12px; white-space: nowrap;
}
.th-tabla td { padding: 10px; border-bottom: 1px solid var(--pav-border); vertical-align: middle; }
.th-tabla tbody tr:hover td { background: #FFFBEA; }
.th-tabla .nombre a { font-weight: 700; }
.th-tabla .nombre a:hover { text-decoration: underline; }
.th-tabla small { color: var(--pav-muted); }

/* Etiquetas */
.th-etq {
    display: inline-block; padding: 3px 9px; border-radius: 20px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.th-etq.ok { background: #E3F6E8; color: #165C2C; }
.th-etq.falta { background: #FDECEA; color: #9B1C1C; }
.th-etq.aviso { background: var(--pav-yellow-light); color: #6B4E00; }
.th-etq.gris { background: #ECECEC; color: #555; }

/* Ficha */
.th-ficha-cabecera {
    display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
    padding: 20px; margin-bottom: 16px;
    background: var(--pav-dark); color: var(--pav-white);
    border-radius: 12px; border-left: 6px solid var(--pav-yellow);
}
.th-avatar {
    width: 64px; height: 64px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--pav-yellow); color: var(--pav-black);
    font-size: 24px; font-weight: 800;
}
.th-ficha-cabecera h2 { margin: 0 0 4px; font-size: 22px; }
.th-ficha-cabecera p { margin: 0; color: #D0D0D0; font-size: 14px; }
.th-ficha-cabecera .th-acciones { margin-left: auto; }

.th-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; }
.th-dato small { display: block; color: var(--pav-muted); font-size: 12px; }
.th-dato span { display: block; font-size: 15px; font-weight: 600; min-height: 20px; overflow-wrap: anywhere; }
.th-dato span.vacio { color: #B0B0B0; font-weight: 400; }

/* Formularios */
.th-form-seccion { margin-bottom: 16px; }
.th-campos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.th-campo label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 700; }
.th-campo input, .th-campo select, .th-campo textarea {
    width: 100%; min-height: 42px; padding: 9px 11px;
    font-size: 15px; font-family: inherit;
    border: 1px solid #CFCFCF; border-radius: 8px; background: #FFF;
}
.th-campo input:focus, .th-campo select:focus, .th-campo textarea:focus {
    outline: none; border-color: var(--pav-yellow); box-shadow: 0 0 0 3px rgba(229,169,0,.18);
}
.th-campo.ancho { grid-column: 1 / -1; }
.th-campo .ayuda { display: block; margin-top: 4px; font-size: 12px; color: var(--pav-muted); }
.th-campo .error { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: #C62828; }
.th-campo.con-error input, .th-campo.con-error select { border-color: #C62828; }
.th-form-botones {
    position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end;
    padding: 12px 0; background: var(--pav-bg);
}

/* Mensajes */
.th-mensajes { list-style: none; margin: 0 0 14px; padding: 0; }
.th-mensajes li { padding: 11px 14px; margin-bottom: 6px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.th-mensajes .success { background: #E3F6E8; color: #165C2C; }
.th-mensajes .error { background: #FDECEA; color: #9B1C1C; }
.th-mensajes .warning, .th-mensajes .info { background: var(--pav-yellow-light); color: #6B4E00; }

/* Listas cortas */
.th-lista { list-style: none; margin: 0; padding: 0; }
.th-lista li {
    display: flex; justify-content: space-between; gap: 10px; align-items: center;
    padding: 9px 0; border-bottom: 1px solid var(--pav-border); font-size: 14px;
}
.th-lista li:last-child { border-bottom: 0; }
.th-vacio { color: var(--pav-muted); font-size: 14px; margin: 0; }

/* Paginación */
.th-paginas { display: flex; gap: 6px; justify-content: center; margin-top: 14px; font-size: 14px; }
.th-paginas a, .th-paginas span { padding: 6px 11px; border-radius: 6px; border: 1px solid var(--pav-border); background: #FFF; }
.th-paginas span.actual { background: var(--pav-black); color: var(--pav-yellow); border-color: var(--pav-black); }

details.th-desplegable summary { cursor: pointer; list-style: none; }
details.th-desplegable summary::-webkit-details-marker { display: none; }

/* Atajo: imprimir carnet por cédula */
.th-carnet-rapido { padding: 14px 18px; border-left: 5px solid var(--pav-yellow); }
.th-carnet-rapido form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.th-carnet-rapido label { font-size: 16px; font-weight: 800; white-space: nowrap; }
.th-carnet-rapido input {
    flex: 1 1 240px; max-width: 360px; min-height: 42px; padding: 8px 12px;
    font-size: 16px; font-family: inherit; border: 2px solid #CFCFCF; border-radius: 8px;
}
.th-carnet-rapido input:focus { outline: none; border-color: var(--pav-yellow); }
.th-carnet-rapido small { display: block; margin-top: 8px; color: var(--pav-muted); font-size: 12px; }

/* Responsivo */
@media (max-width: 1100px) {
    .th-indicadores, .th-modulos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .th-campos, .th-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .th { padding: 12px 10px 30px; }
    .th-dos { grid-template-columns: 1fr; }
    .th-campos, .th-datos { grid-template-columns: 1fr; }
    .th-filtros .buscar, .th-filtros .buscar input { width: 100%; }
    .th-filtros > div { flex: 1 1 140px; }
    .th-filtros select { width: 100%; }
    .th-ficha-cabecera .th-acciones { margin-left: 0; width: 100%; }
    .th-tabla .ocultar-cel { display: none; }
}

/* Frentes de trabajo */
.th-frente-nombre {
    flex: 1; min-width: 0; padding: 9px 12px; font: inherit; font-weight: 600;
    border: 1px solid #D0D0D0; border-radius: 8px; background: #fff;
}
.th-frente-nombre:focus { outline: 2px solid var(--pav-amarillo, #E8A800); border-color: transparent; }

/* Asistencia */
.as-marca { display: flex; gap: 8px; align-items: flex-start; position: relative; }
.as-marca img { width: 74px; height: 34px; object-fit: contain; background: #fff; border: 1px solid var(--pav-border); border-radius: 6px; }
.as-marca span { line-height: 1.25; }
.as-anular summary { list-style: none; cursor: pointer; color: #B0B0B0; font-size: 12px; padding: 0 4px; }
.as-anular summary::-webkit-details-marker { display: none; }
.as-anular[open] form { position: absolute; z-index: 3; top: 100%; left: 0; display: flex; gap: 6px; background: #fff; padding: 8px; border: 1px solid var(--pav-border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.as-anular input { padding: 6px 8px; border: 1px solid #CFCFCF; border-radius: 6px; min-width: 210px; }
.th-campo input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--pav-yellow); }
