* {
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    font-weight: bold;
}

h2 {
    font-size: 1.2rem;
    color: #34495e;
    text-align: center;
    margin-bottom: 1rem;
}

/* Screen Readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}



/* ==================== Layout ==================== */
.dashboard-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: auto;
}

.content-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2.5rem;
    width: 100%;
}

.data-section {
    background-color: #fafdff;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    max-width: 380px;
    margin: 0;
    padding: 0.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex: 1 1 300px;
    align-self: flex-start;
    margin-top: 2.2rem;
}

.data-section:first-child { order: 1; }
.map-section { 
    order: 2;
    flex: 0 0 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.data-section:last-child { order: 3; }

.map-section img {
    max-width: 100%;
    height: auto;
}

/* ==================== Tablas ==================== */
.table-container {
    overflow-x: auto;
    max-width: 370px;
    margin: 0 auto;
}

.data-table {
    width: 100%;
    max-width: 350px;
    border-collapse: collapse;
    font-size: 0.80rem;
    margin: 0 auto;
    table-layout: fixed;
}

.data-table thead th {
    background-color: #ecf0f1;
    color: #2c3e50;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #bdc3c7;
}

.data-table tbody td,
.data-table tfoot td {
    padding: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f9fafc;
}

.data-table tfoot {
    font-weight: bold;
    color: #2c3e50;
}

.data-table .total,
.data-table tfoot .total {
    background-color: #e8f5e9;
    text-align: left;
}

/* Zona Norte encabezados */
#zona-norte-table thead th,
#zona-norte-table tfoot td,
#zona-norte-table .total {
    background-color: #70c964;
    color: #102a13; 
    font-weight: bold;
    letter-spacing: 0.02em;
}

#zona-norte-table tbody td {
    background-color: #eaf8ef;
}
.data-section:first-child h2 {
    color: #257a3a; 
}

/* Resto del País encabezados */
#resto-pais-table thead th,
#resto-pais-table tfoot td,
#resto-pais-table .total {
    background-color: #659ec9;
    color: #11263a; 
    font-weight: bold;
    letter-spacing: 0.02em;
}
#resto-pais-table tbody td {
    background-color: #eaf2fa;
}
.data-section:last-child h2 {
    color: #22507a; 
}

.data-table th,
.data-table td {
    border: 1px solid #e5eaf0;
    padding: 0.5rem;
    word-break: break-word;
    white-space: normal;
    text-align: left;
}


.data-table td.capacity, .data-table td.remaining-capacity, .data-table td.total{
text-align: right;

}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 6.5rem;
    min-width: 6.5rem;
    max-width: 10rem;
}
.data-table th:nth-child(1),
.data-table td:nth-child(1),
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 5.5rem;
}

/* ==================== Media Queries ==================== */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .data-section {
        margin-bottom: 1rem;
        max-width: 95vw;
        margin-top: 0.5rem;
        align-self: center; 
    }
    .map-section {
        width: 100%;
        flex: 1 1 auto;
        padding: 0 10px;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }
    .map-section {
        flex: 1 1 auto;
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }
    .map-section img {
        width: 100%;
        max-width: none;
    }
    .data-table th,
    .data-table td {
        white-space: normal;
    }
    
}