/* Listado de estaciones: estilos específicos de esta vista. */
.saih-stations-card {
    position: relative;
    margin-top: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(44, 76, 91, 0.08);
}

.saih-stations-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 14px;
    border-bottom: 1px solid #dce7eb;
    background: var(--saih-raster-surface);
}

.saih-stations-card__title {
    margin: 0 0 2px;
    color: #294b5b;
    font-size: 13px;
    font-weight: 700;
}

.saih-stations-card__subtitle,
.saih-stations-card__hint {
    color: #718891;
    font-size: 11px;
}

#mapa-estaciones {
    position: relative;
    height: 450px;
}

.station-map-legend {
    padding: 8px 10px;
    border-radius: 8px;
    color: #385865;
    font-size: 11px;
    line-height: 1.55;
}

.station-map-legend__title {
    margin-bottom: 4px;
    font-weight: 700;
}

.station-map-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.station-map-legend__dot {
    width: 10px;
    height: 10px;
    border: 1px solid rgba(0,0,0,0.22);
    border-radius: 50%;
    flex: 0 0 10px;
}

.leaflet-tooltip.station-tooltip {
    padding: 4px 7px;
    border: 1px solid #cad9df;
    border-radius: 6px;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 2px 7px rgba(35, 70, 84, 0.12);
    color: #294b5b;
    font-size: 11px;
    font-weight: 600;
}

.station-filters-card {
    margin-right: 0;
    margin-left: 0;
    padding: 13px 8px 10px;
    border: 1px solid #d7e3e8;
    border-radius: 9px;
    background: #f8fafb;
}

.station-filters-card label {
    margin-bottom: 5px;
    color: #385866;
    font-size: 12px;
    font-weight: 600;
}

.station-filters-card .form-control {
    height: 34px;
    border-color: #cbd9df;
    border-radius: 6px;
    box-shadow: none;
    font-size: 12px;
}

.station-filter-count {
    padding-top: 24px;
}

#count-visible {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid #d5e2e7;
    border-radius: 15px;
    background: #fff;
    color: #607984;
    font-size: 11px;
    font-weight: 600;
}

.station-table-card {
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(44, 76, 91, 0.07);
}

.station-table-card > .panel-heading {
    padding: 10px 13px;
    border: 0;
    border-bottom: 1px solid #d9e5e9;
    background: var(--saih-raster-surface);
    color: #294b5b;
}

.station-table-card > .panel-heading .panel-title {
    font-size: 13px;
    font-weight: 700;
}

.station-table-card > .panel-body {
    padding: 0;
}

#table-container {
    max-height: 430px;
    overflow: auto;
    background: #fff;
}

#estaciones-table {
    min-width: 1480px;
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: #355865;
    font-size: 11.5px;
}

#estaciones-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 8px;
    border: 0;
    border-right: 1px solid rgba(255,255,255,0.35);
    border-bottom: 1px solid #527d8c;
    background: #638f9d;
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: default;
    white-space: nowrap;
}

#estaciones-table thead th[onclick] {
    cursor: pointer;
}

#estaciones-table tbody td {
    padding: 8px 8px;
    border: 0;
    border-right: 1px solid #e1e9ec;
    border-bottom: 1px solid #dfe8eb;
    background: #fff;
    vertical-align: middle;
}

#estaciones-table tbody tr:nth-child(even) td {
    background: #f9fbfc;
}

#estaciones-table tbody tr:hover td,
#estaciones-table tbody tr.map-active-row td {
    background: #eef6f8;
}

#estaciones-table tbody td:nth-child(2) {
    color: #2e5969;
    font-weight: 600;
    text-align: left;
}

/* Mantener visibles Nº y Nombre durante el scroll horizontal. */
#estaciones-table th:nth-child(1),
#estaciones-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 70px;
    min-width: 70px;
    max-width: 70px;
}

#estaciones-table th:nth-child(2),
#estaciones-table td:nth-child(2) {
    position: sticky;
    left: 70px;
    z-index: 3;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    box-shadow: 2px 0 0 rgba(105, 137, 149, 0.14);
}

#estaciones-table thead th:nth-child(1),
#estaciones-table thead th:nth-child(2) {
    z-index: 32;
    background: #638f9d;
}

#estaciones-table tbody tr:nth-child(odd) td:nth-child(1),
#estaciones-table tbody tr:nth-child(odd) td:nth-child(2) {
    background: #fff;
}

#estaciones-table tbody tr:nth-child(even) td:nth-child(1),
#estaciones-table tbody tr:nth-child(even) td:nth-child(2) {
    background: #f9fbfc;
}

#estaciones-table tbody tr:hover td:nth-child(1),
#estaciones-table tbody tr:hover td:nth-child(2),
#estaciones-table tbody tr.map-active-row td:nth-child(1),
#estaciones-table tbody tr.map-active-row td:nth-child(2) {
    background: #eef6f8;
}

.station-sensor-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #b9d0d8;
    border-radius: 6px;
    background: #eaf4f7;
    color: #356879;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.station-ficha-btn,
.station-ficha-btn:link,
.station-ficha-btn:visited {
    padding: 4px 7px;
    border: 1px solid #c4d6dc;
    border-radius: 6px;
    background: var(--saih-raster-surface);
    color: #335d6c !important;
    box-shadow: none;
}

.station-ficha-btn:hover,
.station-ficha-btn:focus,
.station-ficha-btn:active {
    border-color: #8eb1bd;
    background: #eaf3f6;
    color: #244d5b !important;
}

.station-table-card .panel-body > .text-muted {
    margin: 8px 12px 0 !important;
}

.station-table-card #export-geojson,
.station-table-card #export-csv {
    border-radius: 6px;
}

#mapa-estaciones .leaflet-popup-content {
    font-size: 12px;
    line-height: 1.4;
}

#mapa-estaciones .leaflet-popup-content-wrapper {
    padding: 2px;
    border-radius: 9px;
}

#mapa-estaciones .leaflet-control-layers-list label,
#mapa-estaciones .leaflet-control-layers-overlays label,
#mapa-estaciones .leaflet-control-layers-base label {
    font-size: 12px;
}

#mapa-estaciones .leaflet-control-layers-list input[type="checkbox"],
#mapa-estaciones .leaflet-control-layers-list input[type="radio"] {
    margin-right: 6px;
    transform: scale(1.2);
}

.station-list-popup {
    min-width: 190px;
}

.station-list-popup__title {
    margin-bottom: 5px;
    color: #294b5b;
    font-size: 13px;
}

.station-list-popup__meta {
    margin-bottom: 9px;
    color: #667d88;
    font-size: 11px;
    line-height: 1.5;
}

.station-list-popup__actions {
    padding-top: 7px;
    border-top: 1px solid #e1e8eb;
    text-align: right;
}

.station-list-popup__actions .btn {
    font-size: 11px;
}

.station-list-popup__actions .btn,
.station-list-popup__actions .btn:link,
.station-list-popup__actions .btn:visited {
    color: #fff !important;
}

.station-list-popup__actions .btn:hover,
.station-list-popup__actions .btn:focus,
.station-list-popup__actions .btn:active {
    color: #fff !important;
}

@media (max-width: 767px) {
    .saih-stations-card__header {
        display: block;
    }

    .saih-stations-card__hint {
        display: block;
        margin-top: 5px;
    }

    .station-filter-count {
        padding-top: 10px;
    }

    #mapa-estaciones {
        height: 390px;
    }
}

.station-type-dot--E {
    background: #1f78b4;
}

.station-type-dot--A {
    background: #e31a1c;
}

.station-type-dot--P {
    background: #6a3d9a;
}

.station-type-dot--D {
    background: #33a02c;
}

.station-type-dot--M {
    background: #f9d12f;
}


.station-type-dropdown {
    width: 100%;
}


.station-type-dropdown__button {
    position: relative;
    width: 100%;
    text-align: left;
    background: #fff;
}


.station-type-dropdown__button .caret {
    position: absolute;
    top: 50%;
    right: 12px;
    margin-top: -2px;
}


#filter-tipo-current {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}


.station-type-dropdown__menu {
    width: 100%;
    max-height: 390px;
    overflow-y: auto;
    padding: 5px 0;
}


.station-type-dropdown__menu > li > a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    color: #385866;
    font-size: 12px;
}


.station-type-dropdown__menu > li > a:hover,
.station-type-dropdown__menu > li > a:focus {
    background: #eef6f8;
    color: #294b5b;
}


.station-type-dropdown__menu .dropdown-header {
    padding: 7px 12px 4px;
    color: #607984;
    font-size: 11px;
    font-weight: 700;
}

/* ==========================================================
   Coordenadas del mapa de estaciones
   ========================================================== */

.station-mouse-position {
    margin-left: 10px !important;
    margin-bottom: 10px !important;
}

.station-mouse-position button {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 30px;
    padding: 6px 10px;

    border-radius: 7px;



    color: #385865;
    font-size: 11px;
    font-weight: 600;

    white-space: nowrap;
    cursor: pointer;
}

.station-mouse-position button:hover {
    background: #eef6f8;
    border-color: #8eb1bd;
    color: #294b5b;
}

.station-mouse-position button:focus-visible {
    outline: 2px solid #638f9d;
    outline-offset: 2px;
}

.station-mouse-position button i {
    color: #638f9d;
    font-size: 12px;
}
