body {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrado horizontal */
    margin: 0;
    min-height: 100vh;
    justify-content: center; /* Centrado vertical (opcional) */
}

canvas {
    border: 1px solid rgb(172, 25, 12);
    display: block;
}

.canvas-container {
    display: flex;
    width: 630px;
    gap: 9px;
    box-sizing: border-box;
    margin: 0 auto;
    margin-top: 50px;
  }
  
  /* fijamos la anchura calculada de cada canvas */
  #diagrama {
    flex: 0 0 335px;
    aspect-ratio: 429 / 373;
    width: 335px;
    max-width: 100%;
    max-height: 100%;
    display: block;
  }
  #curva {
    flex: 0 0 281px;
    aspect-ratio: 360 / 373;
    width: 281px;
    max-width: 100%;
    max-height: 100%;
    display: block;
  }
  







#butIzq, #butDer {
  width: 20px;
  text-align: center;
  padding: 0 0 0 0;
  border-radius: 5px;
  border: 1px solid rgb(78, 54, 211);
  background-color: rgb(202, 212, 248);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

#butIzq:hover, #butDer:hover {
  background-color: rgb(180, 200, 245);
}

#butIzq:active, #butDer:active {
  background-color: rgb(160, 180, 240);
  transform: scale(0.95);
}


.controls-and-micro {
    width: 626px; /* 335 + 281 + 10 gap */
    display: flex;
    gap: 10px;
    align-items: flex-start; /* Alinea elementos en la parte superior */
    margin: 0px auto; /* Centrado horizontal */
    margin-top: 20px;
}

/* Añadir estas reglas para mejorar el layout */
.panel-controls {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-micro {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#HScroll1 {
    margin-left: 0px;
    margin-right: 5px;
    width: 280px;

}


.stats-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 0 auto;
    margin-top: 0px;
    gap: 8px;
    box-sizing: border-box;
    font-size: 13px;
}

.cell {
    flex: 1;
    border: 1px solid #be4209;
    border-radius: 6px;
    background-color: rgba(255, 208, 146, 0.3);
    padding: 8px 0px;
    display: flex;
    align-items: center;
    justify-content: center;

}

.cell label {
    margin-right: 4px;
    white-space: nowrap;
    font-weight: 600;
    color: rgb(172, 25, 12);
}

.cell span {
    font-weight: 500;
    color: #333;
    display: inline-block;
    min-width: 20px; /* ajusta según el contenido máximo esperado */
    text-align: right;
}
  

.botones {
    display: flex;
    justify-content: center; /* centra horizontalmente */
    gap: 35px;               /* espacio entre botones */
    margin-top: 0px;
  margin-bottom: 0;
  }
  
.botones button {
    width: 120px; /* ancho fijo */
    padding: 6px 0;
    font-size: 14px;
    font-weight: 600;
    background-color: rgb(18, 167, 18);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}
  
.botones button:hover {
background-color: rgb(94, 213, 94);
}
.botones button:active {
background-color: rgb(154, 243, 154);
}

#panelMicro {
    width: 281px;
    height: 281px;
    aspect-ratio: 1/1;
}

/* Ajustar tablas para altura consistente */

table {
    table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
    font-size: 11px;
    margin: 0;
  }



  /* Encabezado de fila destacado */
  table tbody th {
    background-color: #f2a07b;
    color: #4a1f0f;
    font-weight: 500;
}

/* Cabeceras */
table thead th {
    background-color: #be4209;
    color: #fff;
    font-weight: 300;
    padding: 3px;
    text-align: center;
    border: 1px solid #cd5c36;
    height: 10px;
  }
  
  /* Celdas del cuerpo */
  table tbody td, table tbody th {
    border: 1px solid #cd5c36;
    padding: 2px;
    text-align: center;
    vertical-align: middle;
    height: 14px;
  }
  
  /* Zebra stripes */
  table tbody tr:nth-child(odd) {
    background-color: rgba(255, 208, 146, 0.3);
  }
  table tbody tr:nth-child(even) {
    background-color: #fff;
  }

  #tablaFases thead th:first-child, #tablaMicro thead th:first-child {
    background-color: #be4209;
    color: #fff;
    font-weight: 600;
    padding: 3px;
    text-align: center;
    border: 1px solid #cd5c36;
    height: 10px;
}


.tiposBut {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.tiposBut button {
    width: 100px;
    padding: 6px 0;
    font-size: 13px;
    font-weight: 600;
    background-color: rgb(202, 212, 248);
    color: rgb(78, 54, 211);
    border: 1px solid rgb(78, 54, 211);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s;
    text-align: center;
}

.tiposBut button:hover {
    background-color: rgb(180, 200, 245);
}

.tiposBut button:active {
    background-color: rgb(160, 180, 240);
    transform: scale(0.95);
}