.pagina-ficha {
  width: 100%;
  max-width: 1150px;
  margin: 15px auto;
  padding: 20px;
  font-family: "Poppins", sans-serif;
  color: #263238;
}

.ficha {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #dce3e8;
  border-radius: 12px;
  padding: 35px;
  box-shadow: 0 5px 22px rgba(0, 0, 0, 0.07);
}

.ficha-encabezado {
  text-align: center;
  border-bottom: 2px solid #174b82;
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.ficha-encabezado img {
  max-width: 150px;
  max-height: 100px;
  object-fit: contain;
  margin-bottom: 10px;
}

.ficha-encabezado h1 {
  color: #174b82;
  font-size: 25px;
  margin: 8px 0;
}

.ficha-encabezado p {
  margin: 5px 0;
  color: #52616b;
}

.estado-inscripcion {
  display: inline-block;
  background: #e7f5eb;
  color: #216e39;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}

.bloque-codigo {
  text-align: center;
  padding: 20px 10px;
  background: #f5f8fb;
  border: 1px dashed #b7c8d8;
  border-radius: 8px;
  margin-bottom: 28px;
}

.bloque-codigo span {
  display: block;
  font-size: 13px;
  color: #e91a13;
  margin-bottom: 8px;
}

.bloque-codigo strong {
  display: block;
  color: #174b82;
  font-size: 27px;
  overflow-wrap: anywhere;
}

#codigoBarras {
  display: block;
  width: 100%;
  max-width: 360px;
  height: 90px;
  margin: 15px auto 0;
}

.titulo-seccion {
  color: #174b82;
  font-size: 17px;
  margin: 25px 0 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dce3e8;
}

.datos-ficha {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
  margin: 0;
}

.dato {
  min-width: 0;
  overflow-wrap: anywhere;
}

.dato dt {
  color: #647480;
  font-size: 12px;
  margin-bottom: 4px;
}

.dato dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #263238;
}

.nota-ficha {
  margin: 20px 0 28px;
  padding: 20px 22px;
  background: #fff8e8;
  border: 2px solid #e0a52b;
  border-left: 6px solid #d99100;
  border-radius: 10px;
  font-size: 17px;
  line-height: 1.8;
  color: #263238;
}

.nota-ficha strong {
  display: block;
  margin-bottom: 8px;
  color: #9a5b00;
  font-size: 22px;
  font-weight: 800;
}

.nota-ficha p {
  margin: 5px 0;
}

.acciones-ficha {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 25px;
}

.acciones-ficha button,
.acciones-ficha a {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.btn-imprimir {
  background: #da1721;
  color: #fff;
}

.btn-volver {
  background: #e9eef3;
  color: #263238;
}

.error-ficha {
  text-align: center;
  padding: 30px 15px;
}

.error-ficha h1 {
  color: #b42318;
}

.error-ficha p {
  line-height: 1.7;
}

@media (max-width: 600px) {
  .pagina-ficha {
    margin: 10px auto;
    padding: 10px;
  }

  .ficha {
    padding: 20px 15px;
  }

  .ficha-encabezado h1 {
    font-size: 21px;
  }

  .datos-ficha {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .bloque-codigo strong {
    font-size: 22px;
  }

  .acciones-ficha {
    flex-direction: column;
  }

  .acciones-ficha button,
  .acciones-ficha a {
    width: 100%;
    box-sizing: border-box;
  }
}

@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    background: #fff !important;
  }

  .pagina-ficha {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .ficha {
    border: 1px solid #bbb;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
  }

  .acciones-ficha,
  .error-ficha .acciones-ficha {
    display: none !important;
  }

  .bloque-codigo,
  .nota-ficha {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .dato,
  .bloque-codigo {
    break-inside: avoid;
  }
}
/* Elementos que no deben aparecer en el PDF */
.pdf-temporal .acciones-ficha {
  display: none !important;
}

/* Mantener el código de barras nítido y visible */
.pdf-temporal #codigoBarras {
  display: block;
  width: 100%;
  max-width: 350px;
  height: auto;
  margin: 10px auto;
  overflow: visible;
}

/* Hora de ingreso centrada y destacada */
.hora-ingreso {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin: 35px auto 25px;
  padding: 25px 15px;
  text-align: center;
  background: #eff6ff;
  border: 2px solid #174b82;
  border-radius: 12px;
}

.hora-ingreso span {
  color: #174b82;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.hora-ingreso strong {
  display: block;
  color: #174b82;
  font-size: 40px;
  line-height: 1.2;
  font-weight: 900;
}

@media (max-width: 600px) {
  .nota-ficha {
    padding: 16px;
    font-size: 15px;
  }

  .nota-ficha strong {
    font-size: 19px;
  }

  .hora-ingreso {
    padding: 20px 10px;
    margin-top: 25px;
  }

  .hora-ingreso span {
    font-size: 15px;
  }

  .hora-ingreso strong {
    font-size: 32px;
  }
}
