/* Dashboard ejecutivo — eventos territoriales */
.evt-exec-page {
    max-width: 1280px;
    padding: 1rem 1rem 2.5rem;
}

.evt-exec-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.evt-exec-toolbar .export-bar {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.evt-exec-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.evt-exec-nav a {
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-weight: 600;
    text-decoration: none;
}

.evt-exec-nav a:hover {
    border-color: #3b82f6;
    color: #1d4ed8;
}

.evt-exec-board {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.evt-exec-header {
    background: linear-gradient(180deg, #1e3a5f 0%, #1e40af 100%);
    color: #fff;
    padding: 1.1rem 1.25rem 1rem;
    text-align: center;
}

.evt-exec-header h1 {
    margin: 0;
    font-size: clamp(0.95rem, 2.5vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.evt-exec-sub {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    opacity: 0.92;
}

.evt-exec-nota {
    margin: 0.5rem auto 0;
    max-width: 52rem;
    font-size: 0.72rem;
    line-height: 1.4;
    opacity: 0.88;
}

.evt-exec-version {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    background: #e2e8f0;
    border-radius: 6px;
}

.evt-chart-fallback {
    margin: 0;
    padding: 2rem 0.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: #64748b;
}

/* Gráficos CSS — sin JavaScript externo */
.evt-css-chart-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.evt-css-donut {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.evt-css-donut-hole {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.evt-css-donut-hole strong {
    font-size: 1.15rem;
    color: #0f172a;
    line-height: 1.1;
}

.evt-css-donut-hole small {
    font-size: 0.62rem;
    color: #64748b;
    text-transform: uppercase;
}

.evt-css-legend {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.72rem;
    color: #475569;
}

.evt-css-legend li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.evt-leg {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.evt-leg-green { background: #22c55e; }
.evt-leg-red { background: #ef4444; }
.evt-leg-orange { background: #f97316; }
.evt-leg-purple { background: #7c3aed; }

.evt-css-bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: flex-start;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.evt-css-bar-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr 1.75rem;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.68rem;
}

.evt-css-bar-label {
    color: #334155;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.evt-css-bar-track {
    height: 14px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.evt-css-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 3px;
    min-width: 2px;
}

.evt-css-bar-num {
    text-align: right;
    font-weight: 700;
    color: #1e40af;
}

.evt-exec-table-warn td {
    background: #fffbeb;
    color: #92400e;
    font-weight: 600;
}

/* KPIs */
.evt-exec-kpis {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    border-bottom: 2px solid #94a3b8;
}

.evt-exec-kpi {
    padding: 0.85rem 0.5rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}

.evt-exec-kpi:last-child {
    border-right: none;
}

.evt-exec-kpi-icon {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    opacity: 0.9;
}

.evt-exec-kpi strong {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
}

.evt-exec-kpi small {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.25;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.evt-exec-kpi-navy { background: #1e3a5f; }
.evt-exec-kpi-green { background: #15803d; }
.evt-exec-kpi-red { background: #b91c1c; }
.evt-exec-kpi-blue { background: #2563eb; }
.evt-exec-kpi-orange { background: #ea580c; }
.evt-exec-kpi-purple { background: #7c3aed; }
.evt-exec-kpi-gold { background: #a16207; }

/* Semáforo */
.evt-exec-semaforo {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.evt-exec-semaforo-excelente {
    background: linear-gradient(90deg, #dcfce7, #f0fdf4);
}

.evt-exec-semaforo-medio {
    background: linear-gradient(90deg, #fef9c3, #fffbeb);
}

.evt-exec-semaforo-bajo {
    background: linear-gradient(90deg, #fee2e2, #fef2f2);
}

.evt-exec-semaforo-leyenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.evt-exec-semaforo-leyenda strong {
    margin-right: 0.25rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #334155;
}

.evt-exec-semaforo-result {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.evt-exec-semaforo-result strong {
    color: #15803d;
}

/* Cuadro provincial — municipios y tipo de evento */
.evt-exec-cuadro-prov {
    padding: 1rem 1.25rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}

.evt-exec-cuadro-titulo {
    margin: 0 0 0.85rem;
    text-align: center;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 800;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.evt-exec-cuadro-sub {
    margin: -0.35rem 0 0.75rem;
    text-align: center;
    font-size: 0.82rem;
    color: #475569;
}

.evt-exec-cuadro-resumen {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.evt-cuadro-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.evt-cuadro-chip-balance {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.evt-cuadro-chip-fuera {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.evt-cuadro-chip-ok {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.evt-cuadro-chip-falta {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.evt-cuadro-chip-distinto {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.evt-mun-en-balance {
    font-weight: 600;
    color: #0f172a;
}

.evt-exec-cuadro-scroll {
    overflow-x: auto;
    border: 1px solid #0f172a;
}

.evt-exec-cuadro-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.evt-exec-cuadro-table th,
.evt-exec-cuadro-table td {
    border: 1px solid #0f172a;
    vertical-align: middle;
    padding: 0.65rem 0.75rem;
}

.evt-exec-cuadro-table thead th {
    background: #f8fafc;
    font-weight: 700;
    text-align: center;
}

.evt-cuadro-prov-nombre {
    width: 11%;
    min-width: 6.5rem;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: #2563eb;
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.evt-cuadro-col-lista {
    width: 44%;
}

.evt-cuadro-col-tipos {
    width: 45%;
    text-align: center;
}

.evt-cuadro-lista {
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.55;
}

.evt-cuadro-tipos {
    list-style: none;
    padding-left: 0;
}

.evt-cuadro-tipos li {
    margin: 0.15rem 0;
}

.evt-tipo-badge {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.evt-tipo-caravana {
    background: #ffedd5;
    color: #9a3412;
}

.evt-tipo-banderazo {
    background: #ede9fe;
    color: #5b21b6;
}

.evt-tipo-doble {
    background: #fef9c3;
    color: #854d0e;
}

.evt-tipo-pendiente {
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
}

.evt-estado-badge {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.evt-estado-ok {
    background: #dcfce7;
    color: #166534;
}

.evt-estado-falta {
    background: #fef3c7;
    color: #92400e;
}

.evt-estado-distinto {
    background: #fee2e2;
    color: #991b1b;
}

.evt-exec-cuadro-nota {
    margin: 0.65rem 0 0;
    font-size: 0.72rem;
    color: #64748b;
    text-align: center;
}

/* Tablas + gráficos */
.evt-exec-mid {
    display: grid;
    grid-template-columns: minmax(280px, 34%) 1fr;
    gap: 0;
    border-bottom: 2px solid #94a3b8;
}

.evt-exec-mini-tables {
    border-right: 1px solid #e2e8f0;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #f8fafc;
}

.evt-exec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
    background: #fff;
    border: 1px solid #cbd5e1;
}

.evt-exec-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 800;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: #1e40af;
    padding: 0.35rem 0.4rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-bottom: none;
}

.evt-exec-table th,
.evt-exec-table td {
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0.45rem;
}

.evt-exec-table th {
    background: #f1f5f9;
    font-weight: 700;
    text-align: left;
}

.evt-exec-table td:last-child,
.evt-exec-table th:last-child {
    text-align: right;
}

.evt-exec-table-prov tbody {
    display: block;
    max-height: 220px;
    overflow-y: auto;
}

.evt-exec-table-prov thead,
.evt-exec-table-prov tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.evt-exec-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 0.75rem;
    padding: 0.75rem;
}

.evt-exec-chart-card {
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.65rem 0.65rem;
    background: #fff;
}

.evt-exec-chart-card figcaption {
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
    color: #1e40af;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.evt-exec-chart-wide {
    grid-column: 1 / -1;
}

.evt-exec-chart-wrap {
    position: relative;
    height: 180px;
}

.evt-exec-chart-wrap-tall {
    height: 280px;
}

/* Conclusiones */
.evt-exec-conclusiones {
    padding: 0.85rem 1rem 1rem;
    background: #fafafa;
}

.evt-exec-conclusiones h2 {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e3a5f;
    text-align: center;
}

.evt-exec-conc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.evt-exec-conc-table td {
    border: 1px solid #e2e8f0;
    padding: 0.45rem 0.6rem;
    vertical-align: middle;
}

.evt-exec-conc-icon {
    width: 2rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.evt-exec-conc-titulo {
    width: 11rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.7rem;
    white-space: nowrap;
}

.evt-exec-conc-texto {
    color: #334155;
    line-height: 1.4;
}

.evt-exec-conc-ok .evt-exec-conc-titulo { background: #dcfce7; color: #166534; }
.evt-exec-conc-alerta .evt-exec-conc-titulo { background: #fee2e2; color: #991b1b; }
.evt-exec-conc-banderazo .evt-exec-conc-titulo { background: #ede9fe; color: #5b21b6; }
.evt-exec-conc-caravana .evt-exec-conc-titulo { background: #ffedd5; color: #9a3412; }
.evt-exec-conc-meta .evt-exec-conc-titulo { background: #dbeafe; color: #1e40af; }
.evt-exec-conc-lider .evt-exec-conc-titulo { background: #fef9c3; color: #854d0e; }
.evt-exec-conc-doble .evt-exec-conc-titulo { background: #fef3c7; color: #92400e; }
.evt-exec-conc-duplicado .evt-exec-conc-titulo { background: #fff7ed; color: #c2410c; }

/* Listado municipios (detalle) */
.evt-exec-lista {
    padding: 1rem;
    border-top: 2px solid #94a3b8;
    background: #fff;
}

.evt-lista-munis-titulo {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e3a5f;
}

.evt-lista-munis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

.evt-lista-munis-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.evt-lista-munis-header {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.evt-lista-munis-header h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 800;
}

.evt-lista-munis-caravanas .evt-lista-munis-header h3 span { color: #ea580c; }
.evt-lista-munis-banderazos .evt-lista-munis-header h3 span { color: #7c3aed; }

.evt-lista-munis-body {
    padding: 0.75rem 0.85rem;
    max-height: 360px;
    overflow-y: auto;
}

.export-area-capturing .evt-lista-munis-body {
    max-height: none !important;
    overflow: visible !important;
}

.evt-lista-munis-prov {
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.evt-lista-munis-prov:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.evt-lista-munis-prov h4 {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #1e293b;
}

.evt-lista-munis-prov h4 span {
    color: #64748b;
}

.evt-lista-munis-prov ul {
    margin: 0;
    padding: 0 0 0 1rem;
    list-style: disc;
}

.evt-lista-munis-prov li {
    font-size: 0.72rem;
    line-height: 1.45;
    color: #334155;
}

.evt-export-area {
    background: #fff;
}

.export-area-capturing {
    background: #fff !important;
}

@media (max-width: 1100px) {
    .evt-exec-kpis {
        grid-template-columns: repeat(4, 1fr);
    }

    .evt-exec-kpi {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .evt-exec-mid {
        grid-template-columns: 1fr;
    }

    .evt-exec-mini-tables {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

@media (max-width: 768px) {
    .evt-exec-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .evt-cuadro-prov-nombre {
        font-size: 1rem;
    }

    .evt-exec-charts {
        grid-template-columns: 1fr;
    }

    .evt-exec-chart-wide {
        grid-column: 1;
    }

    .evt-lista-munis-grid {
        grid-template-columns: 1fr;
    }

    .evt-exec-conc-titulo {
        width: auto;
        white-space: normal;
    }
}
