  We investigate the secular dynamics of three-body circumbinary systems under
the effect of tides. We use the octupolar non-restricted approximation for the
orbital interactions, general relativity corrections, the quadrupolar
approximation for the spins, and the viscous linear model for tides. We derive
the averaged equations of motion in a simplified vectorial formalism, which is
suitable to model the long-term evolution of a wide variety of circumbinary
systems in very eccentric and inclined orbits. In particular, this vectorial
approach can be used to derive constraints for tidal migration, capture in
Cassini states, and stellar spin-orbit misalignment. We show that circumbinary
planets with initial arbitrary orbital inclination can become coplanar through
a secular resonance between the precession of the orbit and the precession of
the spin of one of the stars. We also show that circumbinary systems for which
the pericenter of the inner orbit is initially in libration present chaotic
motion for the spins and for the eccentricity of the outer orbit. Because our
model is valid for the non-restricted problem, it can also be applied to any
three-body hierarchical system such as star-planet-satellite systems and triple
stellar systems.
