/************************************************/
/*************** TABLA SAI ***********************/
/************************************************/

#stick_mod {
    width: 100%;
    margin-top: 15px;
    overflow: auto;

    border: 1px solid #133b67;
    border-radius: 5px;

    background: #061528;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .03),
        0 8px 25px rgba(0, 0, 0, .35);

    max-height: calc(100vh - 280px);
}


/*************** TABLA **************************/

table.normal {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #EAF3FF;
    font-size: 12px;
    background: #07182E;
}

table.normal_dash {
    width: 100%;
    border-collapse: collapse;
    color: #EAF3FF;
    font-size: 12px;
    background: #07182E;
}

/**************************************************/

/* Antes: max-height: 300px fijo. Ahora usa vh para escalar igual
   que #div_mapa_calor (su vecino en la misma fila) y no quedar
   desparejo en pantallas de distinta altura. */
.table-container {
    max-height: 27vh;
    min-height: 150px;
    overflow-y: auto;
    overflow-x: auto;
}

/* Pantallas grandes: acompaña el crecimiento de #div_mapa_calor
   (su vecino en la misma fila) para que ambas columnas queden
   parejas. */
@media (min-height: 900px) {
    .table-container {
        max-height: 36vh;
        min-height: 220px;
    }
}

/* ==========================================================
   ÚNICA definición de .tabla_dashboard en todo el proyecto.
   Antes estaba duplicada en init.css, tablas.css y dashboard.css
   con valores en conflicto (table-layout fixed/auto, height 80%).
   table-layout: auto reparte columnas según su contenido real,
   sin depender de una cadena de % rota.
   ========================================================== */
.tabla_dashboard {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
    table-layout: auto;
}

table.normal_dash th {
    position: sticky;
    top: 0;
    background-color: #132742;
    height: 30px;
    z-index: 2;
}

.tabla_dashboard td {
    background: linear-gradient(180deg, #0A223E 0%, #07182E 100%);
    border: 1px solid #1B4F86;
    border-radius: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .05),
        0 3px 10px rgba(0, 0, 0, .35);
    padding: 8px;
    color: #EAF3FF;
    vertical-align: top;
}

.tabla_dashboard td.vigente_td {
    text-align: center;
    background: transparent url("../img/vigente.png") center center / 27px 27px no-repeat;
    filter: drop-shadow(0 0 2px rgba(80, 255, 80, .5));
}

/* TD que envuelve .fila_graficos (ver dashboard.css). Ya NO debe
   verse como una tarjeta propia (fondo degradado + borde): a pedido
   del usuario, Criticidad y Tendencia vuelven a verse como DOS
   cuadros separados, igual que la fila de arriba (Ultimas
   observaciones + mapa, que son 2 <td> reales, cada uno con su
   propio marco). Cada tarjeta ahora copia ese mismo marco
   directamente en .card-criticidad (ver dashboard.css), asi que
   este TD contenedor se neutraliza para no duplicar el fondo/borde
   en el espacio entre ambas. */
.tabla_dashboard td.td_fila_graficos {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

/* ==========================================================
   ÚNICA definición de #div_mapa_calor. Antes duplicada en
   init.css (height:80%) y en tablas.css. Ahora usa min-height
   fijo en px para garantizar alto visible sin depender del %
   de sus ancestros.
   ========================================================== */
/* Antes: height fijo en px (320px/220px), que no escalaba con el
   viewport y volvía a sumar más alto que el disponible en notebooks.
   Ahora usa vh (igual que .chart-container-line), así se achica
   proporcionalmente en pantallas bajas sin necesidad de media query. */
#div_mapa_calor {
    width: 100%;
    height: 27vh;
    min-height: 170px;
    border-radius: 6px;
    overflow: hidden;
}

#div_mapa_calor > div {
    width: 100%;
    height: 100%;
}

/* Pantallas grandes (monitores altos): agranda el mapa para
   aprovechar el espacio vertical extra en vez de dejarlo vacío. */
@media (min-height: 900px) {
    #div_mapa_calor {
        height: 36vh;
        min-height: 260px;
    }
}

/**************************************************/

/*************** CABECERA ***********************/

table.normal thead th {
    position: sticky;
    top: 0;
    z-index: 100;

    background: linear-gradient(to bottom,
            #0A223E,
            #08182F);

    color: #F5F7FA;
    height: 42px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;

    border-right: 1px solid rgba(255, 255, 255, .08);
    border-bottom: 1px solid #1F4D80;
}

table.normal thead th:last-child {
    border-right: none;
}


/*************** FILAS **************************/

table.normal tbody tr {
    transition: .20s;
}

table.normal tbody tr:nth-child(odd) {
    background: #0A1D36;
}

table.normal tbody tr:nth-child(even) {
    background: #0C223F;
}

table.normal tbody tr:hover {
    background: #14345F;
}


/*************** CELDAS *************************/

table.normal tbody td {
    padding: 11px 12px;
    border-right: 1px solid rgba(255, 255, 255, .05);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    color: #D7E5F5;
    font-size: 12px;
}

table.normal tbody td:last-child {
    border-right: none;
}

table.normal_dash tbody td {
    all: revert;
    padding: 11px 12px;
    border-right: 1px solid rgba(255, 255, 255, .05);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    color: #D7E5F5;
    font-size: 12px;
}


/* ==========================================================
   RESPONSIVE ANCHO -- dashboard principal (home).
   Arriba solo habia media queries por ALTURA. Esto agrega el
   comportamiento por ANCHO para que el dashboard no se desborde
   horizontalmente en ninguna resolucion (probado hasta ~360px,
   celular). Por debajo de 900px la grilla de 2 columnas (colspan 2 /
   colspan 3) ya no tiene espacio real para su contenido (tabla de
   observaciones + mapa, graficos + leyenda), asi que se apila todo
   en 1 sola columna: table/tr/td pasan a display:block, con lo que
   el colspan deja de tener efecto (que es justo lo que se busca al
   apilar) y cada bloque ocupa el 100% del ancho disponible.
   ========================================================== */
@media (max-width: 900px) {
    .tabla_dashboard,
    .tabla_dashboard tbody,
    .tabla_dashboard tr,
    .tabla_dashboard td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .tabla_dashboard {
        border-spacing: 0;
    }

    .tabla_dashboard td {
        margin-bottom: 16px;
    }
}

/* Tabla de seleccion de ducto/periodo (arriba del dashboard): sus 3
   celdas (label + select + periodos) dejan de entrar en una sola
   fila a partir de cierto ancho sin desbordar. */
@media (max-width: 600px) {

    .contenedor_busqueda_inicial table,
    .contenedor_busqueda_inicial tbody,
    .contenedor_busqueda_inicial tr,
    .contenedor_busqueda_inicial td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .contenedor_busqueda_inicial td {
        margin-bottom: 6px;
        text-align: left;
    }
}

/* Tarjetas de resumen operativo (las 5 del final del dashboard): en
   celular se achican icono y valor para no depender de que el texto
   se corte o desborde. */
@media (max-width: 480px) {

    .contenedor_resumen img {
        max-width: 48px;
    }

    .texto_resumen_operativo .valor {
        font-size: 26px;
    }
}


/*************** TOTAL **************************/

legend {
    height: auto;
    padding-top: 2px;
    padding-bottom: 2px;
    text-align: center;
    vertical-align: middle;
    font-family: 'Verdana';
    color: #ffffff;
    font-size: 12px;
}

legend table td {
    border: 0px;
    padding-left: 10px;
    text-align: left;
    vertical-align: middle;
    font-family: 'Verdana';
    color: #ffffff;
    font-size: 11px;
}

legend table th {
    text-align: left;
    vertical-align: middle;
    font-family: 'Verdana';
    color: #ffffff;
    font-size: 11px;
}

.CajaSrvLargo {
    cursor: default;
    width: 64px;
    height: 110px;
    background-size: 50px 50px;
    background-position: top;
    background-repeat: no-repeat;
    font-size: 8px;
    box-shadow: 2px 2px 2px 2px #8587f7;
    float: left;
    margin: 0px 0px 5px 5px;
    padding-top: 10px;
    padding-left: 3px;
    text-align: left;
}

.chk_srv {
    transform: scale(0.8);
    width: 12px;
    height: 12px;
}

.srv_titulo {
    height: 20px;
    color: #000000;
    text-align: center;
    padding-top: 40px;
}

.opciones {
    width: 36px;
    height: 36px;
    cursor: pointer;
    background-size: 36px 36px;
    background-position: center;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
}


/*************** SCROLL *************************/

#stick_mod::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#stick_mod::-webkit-scrollbar-track {
    background: #08182D;
}

#stick_mod::-webkit-scrollbar-thumb {
    background: #2A5EA5;
    border-radius: 20px;
}


/*************** ESTADOS ************************/

.estado_ok {
    color: #69D36E;
    font-weight: bold;
}

.estado_warn {
    color: #FFC533;
    font-weight: bold;
}

.estado_error {
    color: #FF5757;
    font-weight: bold;
}

/************************************************/
/*RESUMEN OPERATIVO*/
/************************************************/

.resumen_operativo {
    padding: 6px;
}

.contenedor_resumen {
    display: flex;
    align-items: center;
    gap: 14px;
}

.contenedor_resumen img {
    width: 15%;
    max-width: 72px;
    height: auto;
    flex-shrink: 0;
}

.texto_resumen_operativo {
    border-collapse: collapse;
}

.texto_resumen_operativo td {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.texto_resumen_operativo .titulo {
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.texto_resumen_operativo .valor {
    color: #FFFFFF;
    font-size: 34px;
    line-height: 1.1;
}

.texto_resumen_operativo .periodo {
    color: #43A2FF;
    font-size: 14px;
}

/*****************************************************************/
/******************** DIV SCROLL **********************************/
/*****************************************************************/

.scroll {
    height: 95%;
    overflow-y: scroll;
}


/*****************************************************************/
/******************** FORMULARIO **********************************/
/*****************************************************************/

.formulario {
    width: 99.9%;
    height: auto;
    font-size: 10px;
    border: solid 1px #1B4F86;
    font-family: Verdana;
    color: #ffffff;
    overflow-y: scroll;
    border-radius: 2px;
}

.formulario th,
.formulario_bg th {
    text-align: left;
    height: 30px;
    padding-left: 5px;
    padding-top: 5px;
    color: #ffffff;
    font-weight: bold;
}

.formulario td,
.formulario_bg td {
    border: 0px;
    text-align: left;
    padding-left: 5px;
    padding-bottom: 5px;
    height: 20px;
    color: #ffffff;
}

.formulario td.top {
    vertical-align: top;
}

.formulario th.centro {
    text-align: center;
}

.formulario td.centro {
    text-align: center;
}

.formulario td.derecha {
    text-align: right;
}

.formulario td.invisible {
    text-align: left;
    height: 20px;
    color: #484848;
    border: 0px;
}


/*****************************************************************/
/******************** SELECT **************************************/
/*****************************************************************/

select {
    width: 100%;
    max-width: 220px;
    height: 34px;

    padding: 0 35px 0 12px;

    border: 1px solid #1C4377;
    border-radius: 6px;

    background: #071428;
    color: #FFFFFF;

    font-size: 12px;

    outline: none;

    transition: .25s;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("../img/home/flecha_select.png");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}