/* SAIH - Resumen de precipitación y nivometría. */
/* =========================================================
   Patrón visual SAIH · Precipitación y nivometría
   ========================================================= */

#resumenPluviometria.resumen-pluvio-page {
    color: #355765;
}

#resumenPluviometria .resumen-filtro-alertas {
    margin-bottom: 12px;
}

#resumenPluviometria .saih-table-card {
    overflow: hidden;
    width: 100%;
    margin-bottom: 16px;
    border: 1px solid #d8e3e7;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(34, 67, 80, 0.07);
}

#resumenPluviometria .tableFixHead,
#resumenPluviometria .tableFixHead2 {
    margin: 0;
    border: 0;
    overflow: auto;
}

#resumenPluviometria .tableFixHead {
    height: 700px;
}

#resumenPluviometria .saih-data-table {
    min-width: 1120px;
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: #355765;
}

#resumenPluviometria .saih-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 9px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.36);
    border-bottom: 1px solid #d5e1e5;
    background: #5f8f9f;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
    box-shadow: none;
}

#resumenPluviometria .saih-data-table thead th:last-child {
    border-right: 0;
}

#resumenPluviometria .saih-data-table thead th.headerSort {
    cursor: pointer;
}

#resumenPluviometria .saih-data-table thead th.headerSort:hover {
    background: #557f8e;
}

#resumenPluviometria .saih-data-table tbody td {
    position: relative;
    padding: 8px 9px;
    border: 0;
    border-right: 1px solid #e5ecef;
    border-bottom: 1px solid #e1e9ec;
    background: #fff;
    color: #365d6d;
    font-size: 11.5px;
    line-height: 1.3;
    vertical-align: middle;
}

#resumenPluviometria .saih-data-table tbody td:last-child {
    border-right: 0;
}

#resumenPluviometria .saih-data-table tbody tr:nth-child(even) td {
    background: #fbfcfd;
}

#resumenPluviometria .saih-data-table tbody tr:hover td {
    background: #f2f7f9;
}

#resumenPluviometria .saih-data-table__name {
    padding-left: 10px !important;
    color: #2f596a !important;
    font-weight: 600;
}

/* Alertas: conserva las clases funcionales, suavizando la presentación */
#resumenPluviometria .saih-data-table tbody td.amarillo {
    background: #fff9dc !important;
    color: #806900 !important;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #dfbd28;
}

#resumenPluviometria .saih-data-table tbody td.naranja {
    background: #fff2e5 !important;
    color: #a65e16 !important;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #e38c31;
}

#resumenPluviometria .saih-data-table tbody td.rojo {
    background: #fdebed !important;
    color: #a73742 !important;
    font-weight: 700;
    box-shadow: inset 3px 0 0 #d85863;
}

/* Botón de gráfica, común con ríos / embalses / temperaturas */
#resumenPluviometria .saih-table-chart-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border: 1px solid #cbd9df;
    border-radius: 7px;
    background: #f7fafb;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#resumenPluviometria .saih-table-chart-btn:hover,
#resumenPluviometria .saih-table-chart-btn:focus {
    border-color: #9db9c4;
    background: #edf5f7;
    box-shadow: 0 1px 4px rgba(41, 79, 96, .12);
    text-decoration: none;
}

#resumenPluviometria .saih-table-chart-btn img {
    display: block;
    max-width: 15px;
    max-height: 15px;
}

/* Estado sin registros */
#resumenPluviometria .saih-empty-state {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    margin: 4px 0 16px;
    padding: 10px 12px;
    border: 1px solid #dbe6ea;
    border-radius: 8px;
    background: #f7f9fa;
    color: #607983;
    font-size: 11.5px;
}

#resumenPluviometria .saih-empty-state__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    border: 1px solid #a9c0ca;
    border-radius: 50%;
    color: #4f7889;
    font-size: 11px;
    font-weight: 700;
}

/* Leyenda de umbrales */
#resumenPluviometria .saih-threshold-card {
    max-width: 560px;
    margin: 20px 0 0;
    border: 1px solid #d8e3e7;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(34, 67, 80, 0.06);
    overflow: hidden;
}

#resumenPluviometria .saih-threshold-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2eaed;
    background: #f5f8f9;
    color: #365d6d;
    font-size: 11.5px;
}

#resumenPluviometria .saih-threshold-card__head span {
    color: #7c919a;
    font-size: 10.5px;
    white-space: nowrap;
}

#resumenPluviometria .saih-threshold-card__table-wrap {
    margin: 0;
    border: 0;
}

#resumenPluviometria .saih-threshold-table {
    width: 100%;
    margin: 0;
    table-layout: fixed;
    color: #405f6c;
    font-size: 11.5px;
}

#resumenPluviometria .saih-threshold-table td:first-child {
    width: 32%;
}

#resumenPluviometria .saih-threshold-table td:nth-child(2),
#resumenPluviometria .saih-threshold-table td:nth-child(3),
#resumenPluviometria .saih-threshold-table td:nth-child(4) {
    width: 22.666%;
}

#resumenPluviometria .saih-threshold-table tr:first-child td {
    white-space: nowrap;
}

#resumenPluviometria .saih-threshold-table td {
    padding: 8px 10px;
    border: 0;
    border-right: 1px solid #e5ecef;
    border-bottom: 1px solid #e5ecef;
    text-align: center;
    vertical-align: middle;
}

#resumenPluviometria .saih-threshold-table tr:first-child td {
    background: #edf3f5;
    color: #4a6975;
    font-weight: 700;
    text-transform: uppercase;
}

#resumenPluviometria .saih-threshold-table tr:last-child td {
    border-bottom: 0;
}

#resumenPluviometria .saih-threshold-table td:last-child {
    border-right: 0;
}

#resumenPluviometria .saih-threshold-table__period {
    font-weight: 700;
    color: #4a6975;
    background: #fafcfc;
}

#resumenPluviometria .saih-threshold-table td.amarillo {
    background: #fff4b8 !important;
    color: #756000 !important;
    font-weight: 700;
}

#resumenPluviometria .saih-threshold-table td.naranja {
    background: #ffe0bd !important;
    color: #8e4b0c !important;
    font-weight: 700;
}

#resumenPluviometria .saih-threshold-table td.rojo {
    background: #f5c6cb !important;
    color: #8e2f38 !important;
    font-weight: 700;
}

@media (max-width: 767px) {
    #resumenPluviometria .saih-threshold-card__head {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    #resumenPluviometria .saih-threshold-card {
        max-width: none;
    }
}
