/* ====================================================================
   «Informe de ejecución presupuestal 2026» de Villa Ejemplo (FICTICIO)
   -- versión CORREGIDA.
   Misma identidad visual que datos.css (colores, tipografía, piezas);
   lo que cambia es lo que la hacía inaccesible. B# remite a la ficha.
   ==================================================================== */

:root {
    --verde: #0d3b5e;
    --acento: #1b8a8f;
    --suave: #eef4f8;
    --gris-apoyo: #4a5560;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: Verdana, Geneva, sans-serif; font-size: 1rem; line-height: 1.5; color: #2b2b2b; background: #ffffff; overflow-wrap: break-word; }
a { color: #0d5a99; }
img { max-width: 100%; height: auto; }

/* Foco siempre visible, con doble anillo para que se vea sobre cualquier fondo. */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #f2b134;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--verde);
}
main:focus { outline: none; }

.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap;
}
.saltar { position: absolute; left: 8px; top: -100px; z-index: 2000; padding: 10px 16px; background: #ffffff; color: var(--verde); font-weight: bold; }
.saltar:focus { top: 8px; }

/* B1: la maquetación es CSS (grilla), no una tabla: header / nav / main. */
.pagina { max-width: 1000px; margin: 0 auto; }
.cabecera { background: var(--verde); color: #ffffff; padding: 18px clamp(16px, 3vw, 28px); }
.cabecera h1 { margin: 6px 0 2px; font-size: clamp(1.5rem, 5vw, 1.75rem); line-height: 1.2; }
.cabecera p { margin: 0; font-size: .875rem; color: #e3eef7; }
.marca { display: flex; align-items: center; gap: 10px; font-size: .875rem; }
.marca img { width: 32px; height: 36px; }

.cuerpo { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) {
    .cuerpo { grid-template-columns: 220px minmax(0, 1fr); }
}
.lateral { background: var(--suave); padding: 20px 18px; }
.lateral h2 { font-size: 1rem; margin: 0 0 8px; border: 0; padding: 0; color: #2b2b2b; }
.lateral ul { list-style: none; margin: 0; padding: 0; }
.lateral li { margin: 0 0 4px; }
.lateral a { display: inline-block; padding: 6px 0; }
.contenido { padding: 10px clamp(16px, 3vw, 28px) 30px; }

h2 { font-size: 1.375rem; color: var(--verde); margin: 30px 0 10px; border-bottom: 3px solid var(--acento); padding-bottom: 4px; line-height: 1.25; }
h3 { font-size: 1.0625rem; color: var(--verde); margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.nota { font-size: .8125rem; color: var(--gris-apoyo); }

/* B11: la cifra clave es texto real, con el mismo aspecto que tenía la imagen. */
.cifra-clave { background: var(--suave); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.cifra-clave .cifra-num { font-family: Arial, sans-serif; font-size: clamp(1.75rem, 7vw, 3rem); font-weight: 700; color: var(--verde); line-height: 1.2; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Tablas (B2, B3, B4, B5): tablas reales con <caption>, <th scope> y headers. */
.desplazable { overflow-x: auto; max-width: 100%; }
table.datos { border-collapse: collapse; width: 100%; margin: 8px 0 4px; }
table.datos caption { text-align: left; font-weight: bold; color: var(--verde); padding: 0 0 6px; }
table.datos td, table.datos th { border: 1px solid #b4c3d0; padding: 7px 10px; text-align: left; vertical-align: middle; }
table.datos thead th { background: var(--suave); }
table.datos tbody th, table.datos tfoot th { font-weight: normal; background: #ffffff; }
table.datos .num { text-align: right; }
table.datos tfoot th, table.datos tfoot td { font-weight: bold; border-top: 2px solid var(--verde); }
table.ancha { min-width: 640px; }

/* Avance: la barra es decorativa; el valor va SIEMPRE escrito en la celda (B12). */
.avance { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.barra { flex: 1; height: 14px; background: #dfe7ee; min-width: 60px; }
.barra .relleno { display: block; height: 100%; background: var(--acento); }
.pct { min-width: 4.2em; text-align: right; }

/* B6: encabezados ordenables = botones reales con aria-sort. */
th button.orden {
    font: inherit; font-weight: bold; color: var(--verde); background: none; border: 0; padding: 4px 2px;
    cursor: pointer; text-align: inherit; display: inline-flex; gap: 6px; align-items: center; min-height: 32px;
}
th button.orden:hover { text-decoration: underline; }
th[aria-sort="ascending"] button.orden .flecha::before { content: "\25B2"; }
th[aria-sort="descending"] button.orden .flecha::before { content: "\25BC"; }
th[aria-sort="none"] button.orden .flecha::before { content: "\21C5"; }

/* Gráficos (B7, B8, B9, B10). */
.graficos { display: flex; flex-wrap: wrap; gap: 20px 30px; align-items: flex-start; }
.graficos figure { margin: 0; flex: 1 1 320px; min-width: 0; }
.graficos figcaption { font-weight: bold; color: var(--verde); margin: 0 0 8px; }
/* B9: leyenda con contraste suficiente y muestras con el MISMO relleno que las barras (B8). */
.leyenda { font-size: .875rem; color: #222222; margin: 6px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; }
.leyenda li { display: flex; align-items: center; gap: 6px; }
.leyenda .sw { display: inline-block; width: 18px; height: 18px; border: 1.5px solid #111111; }
.sw.f { background: #12406e; }
.sw.i { background: repeating-linear-gradient(45deg, #8a5a00 0 3px, #ffffff 3px 7px); border-color: #8a5a00; }
.sw.d { background: radial-gradient(circle, #3f4a56 28%, #ffffff 32%) 0 0 / 7px 7px; border-color: #3f4a56; }

.descargas li { margin: 0 0 8px; }
.pie { max-width: 1000px; margin: 0 auto; padding: 14px clamp(16px, 3vw, 28px) 30px; font-size: .8125rem; color: var(--gris-apoyo); }
