/* ================================================== */
/* BASE GLOBAL                                         */
/* ================================================== */

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;                 /* 🔑 todo 14px */
    background: #f5f6fa;
    padding-bottom: 64px;
}

/* ================================================== */
/* TOPBAR                                              */
/* ================================================== */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #34495e;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.topbar a {
    color: #fffd82;
    text-decoration: none;
}

/* ================================================== */
/* LAYOUT                                              */
/* ================================================== */

.app-container {
    padding: 10px;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .app-grid {
        grid-template-columns: 1.2fr 1.4fr;
    }
}

@media (min-width: 1000px) {
    .app-grid {
        grid-template-columns: 1.1fr 1.3fr 1.1fr;
    }
}

.panel {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* TÍTULOS (única excepción >14px) */
.panel h2,
.panel h3,
table thead th {
    font-size: 15px;
    font-weight: 600;
}

/* ================================================== */
/* LAYOUT PRINCIPAL         */
/* ================================================== */

.layout {
    max-width: 1200px;
    margin: 12px auto 24px;
    padding: 0 12px;
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.8fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================== */
/* TARJETAS / CARDS                                  */
/* ================================================== */

.card {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ================================================== */
/* GRID FORMULARIOS                                   */
/* ================================================== */

.grid-form {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 10px;
}

.grid-form input,
.grid-form select {
    width: 100%;
}

.grid-form > .campo-doble {
    grid-column: 1 / -1;
}

/* ================================================== */
/* ALERTAS                                            */
/* ================================================== */

.alert {
    padding: 6px;
    border-radius: 6px;
    display: none;
    font-size: 14px;
}

.alert-ok {
    background: #ecfdf3;
    color: #166534;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
}


/* ================================================== */
/* FORMULARIOS – NORMALIZACIÓN TOTAL                   */
/* ================================================== */

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.form-row label {
    font-size: 14px;
    margin-bottom: 2px;
}

select,
input[type="number"],
input[type="text"] {
    height: 34px;                 /* 🔑 mismo height */
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.2;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
}

/* ================================================== */
/* X1 / X2                                             */
/* ================================================== */

.x-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.x-row label {
    width: 32px;
    text-align: right;
}

.select-uniforme {
    width: 121px;
}

/* ================================================== */
/* TABLA DOSIFICACIÓN                                  */
/* ================================================== */

.tabla-dosificacion {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabla-dosificacion th,
.tabla-dosificacion td {
    border: 1px solid #d0d0d0;
    padding: 6px 6px;
}

.tabla-dosificacion th:first-child,
.tabla-dosificacion td:first-child {
    text-align: left;
}

.tabla-dosificacion .col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ocultar {
    display: none !important;
}


.fila-densidad td.col-num {
    font-weight: 600;
}

/* ================================================== */
/* RESULTADOS CÁLCULO                                  */
/* ================================================== */

.resultados-calculo .result-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px;
}

.resultados-calculo .res-num {
    text-align: right;                /* 🔑 CORREGIDO */
    min-width: 90px;
    font-variant-numeric: tabular-nums;
}

/* ================================================== */
/* PROPIEDADES FÍSICAS                                 */
/* ================================================== */

#propiedades-fisicas table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

#tabla-propiedades-fisicas td {
    padding: 4px;
    text-align: center;
}

#tabla-propiedades-fisicas td:first-child,
#propiedades-fisicas thead th:first-child {
    text-align: left;
    padding-left: 8px;
    font-weight: 500;
}

#tabla-propiedades-fisicas input {
    width: 100%;
    text-align: center;
}

/* ================================================== */
/* PORCENTAJES ENTRE ÁRIDOS                             */
/* ================================================== */

#seccion-porcentajes table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
}

#seccion-porcentajes th,
#seccion-porcentajes td {
    padding: 6px;
}

#seccion-porcentajes th:first-child,
#seccion-porcentajes td:first-child {
    text-align: left;
    width: 25%;
}

#seccion-porcentajes th:not(:first-child),
#seccion-porcentajes td:not(:first-child) {
    text-align: center;
    width: 25%;
}

/* ================================================== */
/*  MODO MÓVIL – OCULTAR BANDA DE TRABAJO              */
/* ================================================== */

@media (max-width: 768px) {

    /* Encabezado */
    .col-banda-trabajo {
        display: none;}
	.col-banda_nch {
        display: none;
    }

}

/* Mantener el orden: etiqueta izquierda / widget derecha,
   pero que fp sea UNA fila completa del grid */

#fp-compresion-block,
#fp-flexo-block {
    grid-column: 1 / -1;
    display: grid;
     grid-template-columns: 150px 1fr;
    gap: 6px 10px
    align-items: center;
}

.ocultar {
    display: none !important;
}

.grafico-wrapper {
  width: 100%;
  position: relative;
}

@media (min-width: 501px) {
  .grafico-wrapper {
    aspect-ratio: 2 / 1;
  }
}

@media (max-width: 500px) {
  .grafico-wrapper {
    height: 260px;
  }
}

.grafico-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.gaba-tags {
    height: 34px;                
    padding: 4px 8px;
    font-size: 14px;
    line-height: 1.2;
    align-items: center;
}

.dosificacion-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gaba-tags {
  display: flex;
  gap: 10px;
  font-weight: 600;
}

.gaba-tags span {
  padding: 2px 6px;
}

/* ================================================== */
/* BOTONES – BARRA STICKY                */
/* ================================================== */

.bar-sticky {position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: #f7f7f7;
             padding: 10px 16px; display: flex; justify-content: flex-end; gap: 8px;  border-top: 0px solid #e5e7eb; }

button { padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px;}

.btn-sticky { background: #e5e7eb; border: none;font-size: 20px;}

.btn-sticky :hover {background: #1558c0;}

/* =============================== */
/* FP / HC – ancho correcto        */
/* =============================== */
#fp-normal,
#fp-dens,
#fp-flexo-block {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;              /* 🔑 ocupa la columna */
}
