body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: white;
  color: #333;
}
.container {
  width: 21cm;
  min-height: 29.7cm;
  padding: 20px;
  margin: auto;
  box-sizing: border-box;
}
header {
  border-bottom: 3px solid #8e5d92;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 100px;
  width: auto;
}

.logo-title h1 {
  color: #40b19a;
  font-size: 1.6em;
}
.header-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
  font-size: 1em;
}

.sin-bordes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.tabla-historial {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

.sin-bordes td {
  padding: 3px 6px;
  text-align: center;
  vertical-align: middle;
}

.tabla-historial td {
  padding: 3px 6px;
  vertical-align: middle;
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.qr-img {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.left .section,
.right .section {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background: #f9f9f9;
}
.section h2,
.section h3 {
  margin-top: 0;
  font-size: 1.1em;
  border-bottom: 1px solid #ccc;
  color: #333;
}
.body-composition ul {
  list-style: none;
  padding: 0;
}
.body-composition li {
  padding: 5px 0;
}
.muscle-fat-control {
  background: #fce4ec;
}
.history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}
.history th,
.history td {
  border: 1px solid #aaa;
  padding: 5px;
  text-align: center;
}
.exercise-planner img,
.right img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-top: 10px;
}
.espacio {
  background: #00485c;
  color: white;
  text-align: center;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}
footer {
  text-align: center;
  margin-top: 5px;
  font-size: 0.85em;
  color: #666;
}

 .espacio {
  display: flex;
  flex-direction: column;  
  justify-content: center;
  align-items: center;
  height: 160px;
  background: #00485c;
  color: white;
  text-align: center;
  font-weight: bold;
} 

.historial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
}

.historial-table th,
.historial-table td {
  padding: 6px 8px;
  text-align: center;
  border: none;
}

/* Bandas verticales */
.historial-table td:nth-child(even),
.historial-table th:nth-child(even) {
  background-color: #f3f3f3;
}

/* Primera columna estilo original */
.historial-table td:first-child {
  font-weight: bold;
  text-align: left;
  background-color: transparent;
}

/* Primera fila estilo original */
.historial-table thead th {
  font-weight: bold;
  background-color: transparent;
}

.img-contenedor {
  position: relative;
  width: 100%;
  display: inline-block;
}

.img-contenedor img {
  width: 100%;
  height: auto;
  display: block;
}

.texto {
  position: absolute;
  color: #000;
  font-size: 0.75em;
  text-align: center;
  line-height: 1.1;
}

/* Posiciones */
.superior.izquierda {
  top: 50px;
  left: 10px;
}

.superior.derecha {
  top: 50px;
  right: 10px;
}

.inferior.izquierda {
  bottom: 10px;
  left: 10px;
}

.inferior.derecha {
  bottom: 10px;
  right: 10px;
}

.centro {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}



@media print {
  body,
  html {
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    font-size: 11px;
    background: white;
  }

  .container {
    width: 100%;
    padding: 0.5cm;
    box-sizing: border-box;
  }

  .section {
    page-break-inside: avoid;
  }

  footer {
    page-break-after: avoid;
  }

  /* Evita dividir columnas en hojas separadas */
  .grid {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
  }

  .left,
  .right {
    width: 100%;
  }

  .left {
    flex: 2;
  }

  .right {
    flex: 1;
  }

  .espacio {
  height: 110px !important;
  font-size: 0.9em;
  padding: 0 !important;
}

.qr-img {
  width: 145px !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
}


}
