* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f5f7fa;
    color: #17202a;
}

.page {
    width: min(1500px, 96%);
    margin: 0 auto;
    padding: 22px 0 40px;
}

header {
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 30px;
}

.subtitle {
    margin-top: 6px;
    color: #5d6d7e;
}

.controls {
    display: flex;
    gap: 14px;
    align-items: end;
    flex-wrap: wrap;

    background: white;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.control {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-size: 13px;
    font-weight: 600;
    color: #566573;
}

input,
select,
button {
    font-size: 16px;
    border-radius: 7px;
}

input,
select {
    padding: 9px 10px;
    border: 1px solid #ccd1d1;
    background: white;
}

#grid {
    width: 110px;
    text-transform: uppercase;
}

button {
    padding: 10px 18px;
    border: 0;
    background: #1f618d;
    color: white;
    cursor: pointer;
}

button:hover {
    opacity: 0.92;
}

.status {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;

    padding: 10px 4px 14px;
}

.status-label {
    color: #7b7d7d;
    margin-right: 5px;
}

#map {
    width: 100%;
    height: 66vh;
    min-height: 520px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d5d8dc;
}

.legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;

    padding: 16px 4px 10px;
}

.legend-item {
    display: flex;
    gap: 7px;
    align-items: center;
    font-size: 14px;
}

.dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    display: inline-block;
}

.level0 {
    background: #b3b6b7;
}

.level1 {
    background: #f4d03f;
}

.level2 {
    background: #f5b041;
}

.level3 {
    background: #e67e22;
}

.level4 {
    background: #28b463;
}

.openings {
    margin-top: 8px;
    background: white;
    border-radius: 10px;
    padding: 16px;
}

.openings h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.opening-row {
    display: grid;
    grid-template-columns:
        minmax(180px, 1fr)
        100px
        120px;

    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.opening-row:last-child {
    border-bottom: none;
}

@media (max-width: 650px) {

    .page {
        width: 100%;
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    #map {
        height: 58vh;
        min-height: 420px;
    }

    .opening-row {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}


/* =========================================================
   Resumen de propagación
   ========================================================= */

.prop-summary {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;

    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;

    border: 1px solid #e5e7e9;
}

.summary-main {
    display: flex;
    gap: 7px;
    align-items: baseline;

    font-size: 22px;
}

.summary-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;

    color: #34495e;
    font-size: 14px;
}

.summary-update {
    margin-left: auto;
    color: #7b7d7d;
    font-size: 13px;
}


@media (max-width: 750px) {

    .prop-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .summary-update {
        margin-left: 0;
    }

    .summary-stats {
        gap: 10px;
    }
}


/* =========================================================
   Listado compacto de evidencia
   ========================================================= */

.openings {
    max-width: 760px;
}

.opening-row {
    display: grid;

    grid-template-columns:
        90px
        90px
        minmax(180px, 260px);

    justify-content: start;
    align-items: center;

    column-gap: 18px;

    padding: 7px 4px;

    border-bottom: 1px solid #ecf0f1;
}

.opening-grid {
    font-weight: 700;
}

.opening-evidence {
    text-align: right;
    white-space: nowrap;
}

.opening-evidence::after {
    content: " evidencias";
    color: #7b7d7d;
    font-size: 12px;
}

.opening-state {
    white-space: nowrap;
}

.opening-more {
    margin-top: 10px;
    padding-top: 10px;

    border-top: 1px solid #e5e7e9;

    color: #7b7d7d;
    font-size: 13px;
}


@media (max-width: 700px) {

    .openings {
        max-width: none;
    }

    .opening-row {
        grid-template-columns:
            65px
            75px
            1fr;

        column-gap: 10px;
    }

    .opening-evidence::after {
        content: "";
    }

    .opening-state {
        white-space: normal;
    }
}


/* =========================================================
   Explicación del proyecto
   ========================================================= */

.project-info {
    margin-left: 10px;
    padding-left: 20px;
    border-left: 1px solid #d5d8dc;

    display: flex;
    flex-direction: column;
    gap: 4px;

    max-width: 780px;

    font-size: 13px;
    line-height: 1.35;

    color: #566573;
}

.project-info > strong {
    color: #17202a;
    font-size: 14px;
}

.project-info-legend {
    margin-top: 2px;
}

.project-info-note {
    font-style: italic;
    color: #7b7d7d;
}


/* =========================================================
   Ayuda Grid
   ========================================================= */

.field-help {
    margin-top: 1px;
    font-size: 11px;
    color: #7b7d7d;
}


/* =========================================================
   Vigencia de los datos
   ========================================================= */

.freshness {
    margin: -3px 4px 10px 4px;

    text-align: right;

    font-size: 16px;
    font-weight: 600;

    color: #c0392b;
}

.freshness strong {
    font-size: 18px;
}


/* ya no necesitamos reservar espacio
   para el antiguo summary-update */

.summary-update {
    display: none;
}


@media (max-width: 950px) {

    .project-info {
        flex-basis: 100%;
        margin-left: 0;
        margin-top: 8px;

        padding-left: 0;
        padding-top: 10px;

        border-left: 0;
        border-top: 1px solid #e5e7e9;

        max-width: none;
    }

    .freshness {
        text-align: left;
        font-size: 14px;
    }

    .freshness strong {
        font-size: 15px;
    }
}


/* =========================================================
   Alineación superior
   ========================================================= */

.controls {
    display: grid;

    grid-template-columns:
        170px
        110px
        auto
        1fr;

    align-items: end;

    column-gap: 14px;
    row-gap: 8px;

    padding: 16px 18px;
}


/* Cada control conserva una estructura uniforme */

.control {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    gap: 5px;

    min-height: 66px;
}


.control label {
    margin: 0;

    font-size: 13px;
    line-height: 1.2;

    font-weight: 600;
}


/* Inputs perfectamente alineados */

.control input,
.control select {
    height: 38px;
    margin: 0;
}


/* Campo Grid */

#grid {
    width: 100%;
}


/* Selector banda */

#band {
    width: 100%;
}


/* Botón alineado con los campos */

#show-button {
    height: 38px;

    margin: 0 0 0 0;

    align-self: end;

    white-space: nowrap;
}


/* Texto de ayuda debajo del grid */

.field-help {
    min-height: 14px;

    margin-top: 0;

    font-size: 11px;
    line-height: 1.2;
}


/* =========================================================
   Bloque explicativo
   ========================================================= */

.project-info {
    margin: 0;

    padding-left: 18px;

    align-self: stretch;

    justify-content: center;

    border-left: 1px solid #d5d8dc;
}


.project-info > strong {
    margin-bottom: 2px;
}


/* =========================================================
   Línea Origen / Banda / Ventana
   ========================================================= */

.status {
    align-items: baseline;

    gap: 26px;

    padding:
        10px
        6px
        12px;
}


.status > div {
    display: flex;
    align-items: baseline;
    gap: 4px;
}


/* =========================================================
   Resumen de propagación
   ========================================================= */

.prop-summary {
    display: flex;

    align-items: baseline;

    gap: 18px;

    padding:
        12px
        16px;
}


.summary-main {
    min-width: 120px;
}


/* =========================================================
   Vigencia
   ========================================================= */

.freshness {
    margin:
        4px
        6px
        9px;

    line-height: 1.2;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1050px) {

    .controls {
        grid-template-columns:
            160px
            100px
            auto;

        align-items: end;
    }

    .project-info {
        grid-column: 1 / -1;

        margin-top: 6px;

        padding-left: 0;
        padding-top: 10px;

        border-left: 0;
        border-top: 1px solid #e5e7e9;
    }
}


@media (max-width: 650px) {

    .controls {
        grid-template-columns:
            1fr
            1fr;

        column-gap: 10px;
    }

    #show-button {
        grid-column: 1 / -1;

        width: 100%;
    }

    .project-info {
        grid-column: 1 / -1;
    }

    .status {
        gap: 12px;
    }

    .prop-summary {
        align-items: flex-start;
    }
}


/* =========================================================
   Alineación final Grid / Banda / Botón
   ========================================================= */

.controls {
    align-items: end;
}

.control {
    min-height: 0;
    justify-content: flex-end;
}

.control label {
    min-height: 30px;

    display: flex;
    align-items: flex-end;

    line-height: 1.15;
}

.control input,
.control select,
#show-button {
    height: 40px;
}

#show-button {
    align-self: end;
    margin: 0;
}

/* ya no se usa la ayuda inferior */

.field-help {
    display: none;
}
