* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: sans-serif;
  overflow-x: hidden; /* 🚫 No scroll horizontal */
  overflow-y: auto;   /* ✅ Scroll vertical */
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#contenidoPDF {
  background: #fff;
  padding: 20px 25px 30px 25px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  text-align: left;
  margin-top: 15px;
  margin-bottom: 15px;
}

/* HEADER: mostrar logo a la izquierda y alinear con el resto */
.header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0;
  padding: 0;
}

.logo {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
  padding-top: 10px;
  padding-bottom: 10px;
 }

img.logo {
  display: block;
  width: 130px;
  height: auto;
     }

h2 {
  text-align: center;
  margin: 0 auto 20px auto;
  background-color: #ccc;
  padding: 10px;
  border-radius: 8px;
  width: 95%;
  max-width: 1200px;
  margin-top: 10px;
  
}

/* AGRUPAR LOS ELEMENTOS CENTRALES */
h2, .texto, .header, h3 {
  width: 95%;
  max-width: 1200px;
  margin: auto;
}

h3 {
  text-align: center;
  border: 1px solid black;
  padding: 8px;
}

.texto {
  margin-bottom: 20px;
}

.datos {
  width: 95%;
  max-width: 1200px;
  margin: 30px auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.contenedor-izquierda,
.columna-derecha {
  min-width: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.contenedor-izquierda {
  width: 65%;
}

.columna-derecha {
  width: 30%;
}

.fila-formulario {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 20px auto;
}

.form-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
}

.form-group label {
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #999;
  border-radius: 4px;
  text-align: center;
}

.form-group input,
.columna-derecha input {
  border: none;
  outline: none;
  padding: 5px;
  background-color: transparent;
  font-size: 14px;
  width: 100%;
  text-align: center;
}

.form-group label span,
.columna-derecha span {
  text-align: center;
  min-width: 80px;
}

.imagen-y-campos {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 40px auto;
  gap: 20px;
  width: 100%;
}

.canvas-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.canvas {
  display: flex;
  align-items: flex-end;
  width: 100%;
  overflow-x: auto;
}

.clear-button {
  margin-top: 8px;
  align-self: flex-end;
  margin-right: 20px;
  padding: 6px 12px;
  background-color: #005f9e;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.clear-button:hover {
  background-color: #00416d;
}
.columna-derecha label {
  display: flex;
  justify-content: center;
  text-align: center;
  border: 1px solid #999;
  padding: 10px;
  border-radius: 4px;
  gap: 35px;
  width: auto;
  margin-left: auto;
  margin-right: auto;
}

.columna-derecha .fecha {
  display: flex;
  justify-content: center;
  border: none;
  margin-bottom: 40px;
  margin-top: 20px;
  gap: 30px;
}

.columna-derecha .fecha label.Fecha {
  border: 1px solid #999;
  border-radius: 4px;
  padding: 10px;
  gap: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
}

.columna-derecha .fecha label.Fecha input {
  border: none;
  outline: none;
  max-width: 100%;
  text-align: center;
}

.columna-derecha .visual {
  margin-top: 30px;
  min-width: 110px;
  max-width: 100%;
}

.columna-derecha .stro label {
  border: 1px solid #999;
  border-radius: 4px;
  padding: 10px;
  gap: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
  margin-bottom: 20px;
}

.columna-derecha .stro label.siniestro {
  margin-bottom: 50px;
  margin-top: 70px;
}

.columna-derecha .stro label.visual {
  margin-top: 50px;
}

table {
  border-collapse: collapse;
  margin: 0 auto;
  table-layout: fixed;
  max-width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
  width: 100%;
}

th, td {
  border: 1px solid #000;
  padding: 5px;
  text-align: left;
}

td input {
  width: 100%;
  border: none;
  padding: 5px;
}

.tablas-piezas {
  display: flex;
  width: 95%;
  max-width: 1200px;
  margin: 40px auto 0 auto;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  overflow-y: auto;
}

.tablas-piezas table {
  width: 45%;
  max-width: 100%;
  vertical-align: top;
  margin-top: 0;
}

.boton {
  padding: 6px 12px;
  background-color: #005f9e;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.boton:hover {
  background-color: #00416d;
}

/* Estilos aplicados SOLO cuando se genera el PDF */

.modo-pdf #contenidoPDF {
  width: 100%;
  max-width: 210mm; /* límite real A4 */
  margin: 0 auto; /* centrado horizontal */
  margin-top: 0;
  padding: 10mm;
  background: white;
  box-sizing: border-box;
  transform: none !important;
}

.modo-pdf body{
  margin: 0;
}

/* Centrar el contenedor .datos */
.modo-pdf .datos {
  display: grid;
  grid-template-columns: 1fr 0.9fr; /* Proporción más segura */
  align-items: start;
  column-gap: 15px; /* reducir separación */
  width: 100%;
  box-sizing: border-box; /* evitar que padding sume ancho extra */
  font-size: 10pt;
}
 
.modo-pdf .contenedor-izquierda,
.modo-pdf .columna-derecha {
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.modo-pdf h2 {
  margin-top: 10px;
  width: 95%;
}

.modo-pdf .columna-derecha label {
  margin-bottom: 0;
  
}

.modo-pdf .stro {
  width: 60%;
  box-sizing: border-box;
}

.modo-pdf input[type="text"],
.modo-pdf input[type="date"],
.modo-pdf select,
.modo-pdf textarea {
  width: 100%;
  box-sizing: border-box;
}

.modo-pdf canvas {
  max-width: 100%;
  height: auto;
}

.modo-pdf h3{
  font-size: 9pt;
}

/* Tablas completas y sin cortes */
.modo-pdf table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  word-break: break-word;
  
}

.modo-pdf td, 
.modo-pdf th {
  padding: 4px;
  font-size: 8pt;
  white-space: normal;
}

/* Si la tabla es más ancha, se agrega scroll horizontal */
.modo-pdf .tablas-piezas {
  width: 100%;
  overflow-x: auto;
}

.modo-pdf .tablas-piezas table {
  width: 100%; /* ocupar todo el espacio para que no se corte */
  table-layout: auto;
  border-collapse: collapse;
}

.modo-pdf .tablas-piezas th,
.modo-pdf .tablas-piezas td {
  padding: 6px;
  word-break: break-word;
  font-size: 8pt;
  text-align: left;
}
