/* css/pages-common.css — Mobile-First Design System CEL/SENER */

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
    /* Paleta Institucional */
    --color-gobmx-guinda:       #9B2247;
    --color-gobmx-guinda-dark:  #7a1b38;
    --color-gobmx-guinda-deep:  #5a1429;
    --color-gobmx-verde:        #1E5B4F;
    --color-gobmx-verde-dark:   #165845;
    --color-gobmx-dorado:       #A57F2C;
    --color-gobmx-dorado-light: #c9a84c;
    --color-gobmx-gris:         #98989A;
    --color-gobmx-gris-claro:   #E5E5E5;

    /* Semánticos */
    --color-text-primary:   #1a1a1a;
    --color-text-secondary: #555555;
    --color-text-muted:     #888888;
    --color-bg-body:        #efe9e1;
    --color-bg-card:        #ffffff;
    --color-bg-surface:     #f8f9fa;
    --color-border:         #e0e0e0;
    --color-border-light:   #f0f0f0;

    /* Alias de compatibilidad */
    --color-verde-profundo:  var(--color-gobmx-verde);
    --color-verde-claro:     #24a47a;
    --color-text:            var(--color-text-primary);
    --color-muted:           var(--color-text-muted);
    --color-surface-soft:    var(--color-bg-surface);
    --color-pill-bg:         rgba(30, 91, 79, 0.12);
    --color-pill-text:       var(--color-gobmx-verde);
    --color-button:          var(--color-gobmx-guinda);
    --color-button-hover:    var(--color-gobmx-guinda-dark);
    --color-guinda:          var(--color-gobmx-guinda);
    --color-guinda-light:    rgba(155, 34, 71, 0.15);

    /* Gradientes */
    --gradient-header: linear-gradient(120deg,
        var(--color-gobmx-guinda) 0%,
        var(--color-gobmx-guinda-dark) 55%,
        var(--color-gobmx-guinda-deep) 100%);
    --gradient-verde: linear-gradient(120deg,
        var(--color-gobmx-verde) 0%,
        var(--color-gobmx-verde-dark) 55%,
        #0d3a2d 100%);

    /* Sombras */
    --shadow-xs:   0 1px 3px rgba(0,0,0,0.08);
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.10);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg:   0 8px 30px rgba(0,0,0,0.15);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08), 0 0 0 1px var(--color-border-light);
    --shadow-nav:  0 2px 12px rgba(0,0,0,0.15);
    --shadow-guinda: 0 4px 20px rgba(155, 34, 71, 0.25);

    /* Tipografía */
    --font-family-headings: 'Merriweather', 'Georgia', serif;
    --font-family-body:     'Noto Sans', 'Segoe UI', sans-serif;

    /* Escala tipográfica fluida (mobile → desktop) */
    --text-xs:   0.75rem;    /* 12px */
    --text-sm:   0.875rem;   /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg:   1.125rem;   /* 18px */
    --text-xl:   clamp(1.15rem, 2.5vw, 1.375rem);
    --text-2xl:  clamp(1.25rem, 3vw, 1.625rem);
    --text-3xl:  clamp(1.4rem, 4vw, 2rem);

    /* Espaciado (escala 8pt) */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */

    /* Alias históricos */
    --spacing-sm: var(--space-4);
    --spacing-md: var(--space-6);
    --spacing-lg: var(--space-8);

    /* Bordes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transiciones */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Altura reservada para navegación fija */
    --site-nav-height: 56px;
    --site-nav-total-space: var(--site-nav-height);
}


/* ================================================================
   BASE RESET
   ================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--text-base);
    color: var(--color-text-primary);
    background-color: var(--color-bg-body);
    line-height: 1.65;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--site-nav-total-space);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(circle at top left, rgba(155, 34, 71, 0.05), transparent 26%),
        linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 200px);
}

.site-header {
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(165, 127, 44, 0.12), transparent 26%),
        linear-gradient(180deg, #f7f4ee 0%, #f2ede6 100%);
    border-bottom: 1px solid rgba(107, 15, 26, 0.08);
    padding: 20px 0 22px;
    box-shadow: 0 10px 28px -24px rgba(61, 19, 31, 0.35);
}

.site-header__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.site-header__brand img {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 6px 12px rgba(107, 15, 26, 0.08));
}

.site-header__divider {
    width: 1px;
    height: 54px;
    background: linear-gradient(180deg, rgba(165, 127, 44, 0.05), rgba(165, 127, 44, 0.6), rgba(155, 34, 71, 0.08));
}

.site-header__text {
    min-width: 0;
}

.site-header__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-gobmx-verde);
}

.site-header__eyebrow::before {
    content: '';
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--color-gobmx-verde);
}

.site-header__text h1 {
    font-family: var(--font-family-headings);
    color: var(--color-gobmx-guinda);
    font-size: clamp(1.1rem, 2.4vw, 1.55rem);
    margin: 0;
    line-height: 1.2;
}

.site-header__text p {
    font-size: 0.86rem;
    color: #6d6161;
    margin: 6px 0 0;
    letter-spacing: 0.02em;
    max-width: 720px;
}

.site-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.site-header__pill {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(107, 15, 26, 0.08);
    background: rgba(255, 255, 255, 0.7);
    color: #6b5151;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 10px 24px -20px rgba(107, 15, 26, 0.35);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text-primary);
    margin-top: 0;
    margin-bottom: var(--space-3);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin-top: 0; margin-bottom: var(--space-4); }

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { margin: 0; padding: 0; list-style: none; }


/* ================================================================
   NAVEGACIÓN — Mobile First (guinda institucional)
   ================================================================ */
.site-nav {
    background:
        linear-gradient(180deg, rgba(252, 250, 246, 0.96) 0%, rgba(244, 238, 230, 0.94) 100%);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.72) inset,
        0 14px 30px -26px rgba(48, 8, 22, 0.45);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    height: var(--site-nav-height);
    width: 100%;
    margin: 0;
    border-bottom: 1px solid rgba(107, 15, 26, 0.08);
    border-radius: 0;
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    overflow: visible;
}

.site-nav::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(155, 34, 71, 0), rgba(165, 127, 44, 0.46), rgba(30, 91, 79, 0));
    pointer-events: none;
}

/* Marca / Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-family-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-gobmx-guinda);
    letter-spacing: 0.01em;
    flex-shrink: 0;
}

.nav-brand a {
    color: var(--color-gobmx-guinda) !important;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand__link {
    min-height: 40px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-brand__link:hover {
    opacity: 0.96;
    transform: translateY(-1px);
}

.nav-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(155, 34, 71, 0.14), rgba(165, 127, 44, 0.18));
    border: 1px solid rgba(155, 34, 71, 0.08);
    box-shadow: 0 10px 24px -18px rgba(107, 15, 26, 0.4);
}

.nav-brand__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.nav-brand__eyebrow {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-gobmx-verde);
    opacity: 0.92;
    white-space: nowrap;
}

.nav-brand__label {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-gobmx-guinda);
    white-space: nowrap;
}

.nav-brand i {
    font-size: 1rem;
    color: var(--color-gobmx-guinda);
    opacity: 1;
}

/* Botón hamburguesa (solo mobile) */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: rgba(155, 34, 71, 0.05);
    border: 1px solid rgba(155, 34, 71, 0.1);
    border-radius: 999px;
    cursor: pointer;
    padding: var(--space-2);
    flex-shrink: 0;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.nav-toggle:hover {
    background: rgba(155, 34, 71, 0.08);
    border-color: rgba(155, 34, 71, 0.18);
    transform: translateY(-1px);
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--color-gobmx-guinda);
    border-radius: 2px;
    transition: var(--transition-base);
    transform-origin: center;
}

/* Animación X al abrir */
.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Menú (oculto en mobile por defecto) */
.nav-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: rgba(255,253,249,0.985);
    border: 1px solid rgba(97, 22, 47, 0.08);
    border-bottom: 3px solid var(--color-gobmx-dorado);
    box-shadow: 0 24px 34px -26px rgba(67, 12, 31, 0.35);
    display: none;
    flex-direction: column;
    padding: var(--space-2) 0;
    z-index: 999;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    border-radius: 0 0 18px 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-menu.active {
    display: flex;
    animation: slideDown var(--transition-slow) forwards;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Items del menú */
.nav-item {
    position: relative;
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    color: #3f2c30;
    font-size: 0.95rem;
    font-weight: 600;
    border-left: 2px solid transparent;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
    width: 100%;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(155, 34, 71, 0.055);
    border-left-color: rgba(155, 34, 71, 0.8);
    color: var(--color-gobmx-guinda);
    transform: none;
}

.nav-link:focus-visible,
.nav-dropdown-link:focus-visible,
.nav-toggle:focus-visible,
.nav-brand a:focus-visible {
    outline: 2px solid rgba(165, 127, 44, 0.9);
    outline-offset: 2px;
}

/* Dropdown icon */
.dropdown-icon {
    font-size: 0.68em;
    opacity: 0.55;
    transition: transform var(--transition-base);
    margin-left: var(--space-2);
}

.nav-item.open > .nav-link .dropdown-icon {
    transform: rotate(180deg);
    opacity: 1;
}

/* Submenú dropdown */
.nav-dropdown-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(248, 244, 238, 0.92);
    border-left: 2px solid rgba(107, 15, 26, 0.72);
    width: 100%;
}

.nav-dropdown-menu.active {
    display: block;
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-5) var(--space-3) calc(var(--space-5) + var(--space-6));
    color: #5c4c4c;
    font-size: 0.84rem;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--transition-fast), color var(--transition-fast), padding-left var(--transition-fast);
    line-height: 1.4;
}

.nav-dropdown-link:hover,
.nav-dropdown-link.active {
    background-color: rgba(155, 34, 71, 0.05);
    color: var(--color-gobmx-guinda);
    padding-left: calc(var(--space-5) + var(--space-6) + 4px);
}

.nav-dropdown-link.active {
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Desktop nav (≥1200px)
   ---------------------------------------------------------------- */
@media (min-width: 1200px) {
    :root {
        --site-nav-height: 60px;
        --site-nav-total-space: var(--site-nav-height);
    }

    .site-nav {
        height: 60px;
        padding: 0 clamp(1rem, 3vw, 2.5rem);
        width: 100%;
        top: 0;
        border-radius: 0;
    }

    .nav-brand__mark {
        width: 42px;
        height: 42px;
    }

    .nav-toggle {
        display: none;
    }

    .nav-menu {
        position: static;
        display: flex !important;
        flex-direction: row;
        align-items: stretch;
        width: auto;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        gap: 0.25rem;
        max-height: none;
        overflow: visible;
        height: 60px;
        animation: none;
    }

    .nav-item {
        width: auto;
        height: 100%;
        display: flex;
        align-items: stretch;
    }

    .nav-link {
        padding: 0 1rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        color: rgba(83, 48, 54, 0.88);
        font-size: 0.84rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        height: 100%;
        align-items: center;
        white-space: nowrap;
        position: relative;
        border-radius: 0;
        margin: 0;
    }

    .nav-link:hover,
    .nav-link.active {
        background: transparent;
        border-left-color: transparent;
        border-bottom-color: var(--color-gobmx-dorado);
        color: var(--color-gobmx-guinda);
        transform: none;
    }

    /* Hover bridge invisible para no perder el dropdown */
    .nav-item::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 0;
        width: 100%;
        height: 8px;
        background: transparent;
    }

    /* Dropdown desktop */
    .nav-dropdown-menu {
        display: none !important;
        position: absolute;
        top: calc(100% - 2px);
        left: 0;
        min-width: 280px;
        background: rgba(255,252,248,0.985);
        border: 1px solid rgba(107, 15, 26, 0.08);
        border-top: 2px solid rgba(165, 127, 44, 0.9);
        border-left: none;
        border-radius: 18px;
        box-shadow: 0 22px 40px -28px rgba(39, 8, 19, 0.55);
        z-index: 1100;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        padding: 0.45rem 0;
    }

    .nav-item:hover > .nav-dropdown-menu {
        display: block !important;
    }

    .nav-dropdown-link {
        padding: 0.8rem 1.15rem;
        color: #564848;
        border-bottom: none;
    }

    .nav-dropdown-link:hover,
    .nav-dropdown-link.active {
        background-color: rgba(155, 34, 71, 0.045);
        color: var(--color-gobmx-guinda);
        padding-left: 1.35rem;
    }
}


/* ================================================================
   LAYOUT PRINCIPAL
   ================================================================ */
.main-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-4) var(--space-10);
}

/* Contenedor genérico */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 768px) {
    .main-wrapper {
        padding: var(--space-6) var(--space-6) var(--space-12);
    }
    .container {
        padding: 0 var(--space-6);
    }
}


/* ================================================================
   CABECERA DE PÁGINA (page-header)
   ================================================================ */
.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding: var(--space-5) var(--space-5) var(--space-5);
    background: white;
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--color-gobmx-guinda);
    box-shadow: var(--shadow-card);
    text-align: left;
}

.page-header h1 {
    font-size: var(--text-2xl);
    color: var(--color-gobmx-guinda);
    margin-bottom: var(--space-1);
    line-height: 1.25;
}

.page-header h2 {
    font-size: var(--text-base);
    color: var(--color-gobmx-verde);
    font-weight: 600;
    font-family: var(--font-family-body);
    margin-bottom: var(--space-1);
}

.page-header h3 {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 400;
    font-family: var(--font-family-body);
    margin: 0;
}

.header-logos {
    display: none;
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .header-logos {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .header-logos img {
        height: 56px;
        margin-left: var(--space-5);
    }
}


/* ================================================================
   ZONA DE CONTROLES
   ================================================================ */
.controls-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.control-label {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-gobmx-guinda);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.control-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 11px var(--space-10) 11px var(--space-4);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--color-border);
    font-family: var(--font-family-body);
    font-size: var(--text-base);
    width: 100%;
    color: var(--color-text-primary);
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239B2247' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-4) center;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    line-height: 1.5;
}

.control-select:hover {
    border-color: var(--color-gobmx-guinda);
}

.control-select:focus {
    outline: none;
    border-color: var(--color-gobmx-guinda);
    box-shadow: 0 0 0 3px rgba(155, 34, 71, 0.12);
}

/* Botones */
.btn-nav,
.btn-export-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 11px var(--space-5);
    border-radius: var(--radius-md);
    font-family: var(--font-family-body);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: all var(--transition-fast);
    line-height: 1;
    white-space: nowrap;
    border: 1.5px solid;
}

.btn-nav {
    color: var(--color-gobmx-guinda);
    background-color: transparent;
    border-color: var(--color-gobmx-guinda);
}

.btn-nav:hover {
    background-color: rgba(155, 34, 71, 0.06);
    transform: translateY(-1px);
}

.btn-export-full {
    background: var(--gradient-header);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-guinda);
}

.btn-export-full:hover {
    box-shadow: 0 6px 24px rgba(155, 34, 71, 0.35);
    transform: translateY(-1px);
}

.btn-export-full:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-export-full:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (min-width: 768px) {
    .controls-area {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: var(--space-3);
    }

    .control-group {
        flex-direction: row;
        align-items: center;
    }

    .control-select {
        width: auto;
        min-width: 220px;
    }

    .btn-nav,
    .btn-export-full {
        width: auto;
    }
}


/* ================================================================
   ÁREA DE CONTENIDO / CAPTURA
   ================================================================ */
#report-capture-area {
    background: white;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

#container-chart {
    width: 100%;
    height: 380px;
    margin-bottom: var(--space-5);
}

@media (min-width: 768px) {
    #report-capture-area {
        padding: var(--space-8);
    }

    #container-chart {
        height: 520px;
    }
}


/* ================================================================
   TABLAS
   ================================================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    margin-top: var(--space-4);
    margin-bottom: var(--space-5);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    font-family: var(--font-family-body);
    text-align: right;
    min-width: 560px;
}

.data-table th,
.data-table td {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table th {
    background-color: var(--color-gobmx-guinda);
    color: white;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td:first-child,
.data-table th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 5;
    font-weight: 600;
    min-width: 130px;
    box-shadow: 2px 0 6px rgba(0,0,0,0.08);
    border-right: 2px solid var(--color-border);
}

.data-table th:first-child {
    background-color: var(--color-gobmx-guinda);
    color: white;
    z-index: 6;
}

.data-table tbody tr:nth-child(even) td {
    background-color: var(--color-bg-surface);
}

.data-table tbody tr:nth-child(even) td:first-child {
    background-color: var(--color-bg-surface);
}

.data-table tbody tr:hover td {
    background-color: rgba(155, 34, 71, 0.04);
}

.data-table tbody tr:hover td:first-child {
    background-color: rgba(155, 34, 71, 0.04);
}

/* Filas especiales */
.row-highlight td {
    background-color: #e8f5e9 !important;
    font-weight: 700;
    border-top: 2px solid var(--color-gobmx-verde);
}

.total-row td {
    background-color: #eeeeee !important;
    font-weight: 700;
    border-top: 2px solid #666;
}

.highlight-row-yellow td {
    background-color: #fffae6 !important;
    font-weight: 700;
    color: var(--color-gobmx-dorado);
}

.highlight-row-green td {
    background-color: #e8f5e9 !important;
    font-weight: 700;
    border-top: 2px solid var(--color-gobmx-verde);
}

.highlight-row-orange td {
    background-color: #fff3e0 !important;
    font-weight: 700;
    border-top: 2px solid var(--color-gobmx-dorado);
}

@media (min-width: 768px) {
    .data-table {
        font-size: var(--text-base);
    }

    .data-table th {
        font-size: var(--text-xs);
    }

    .data-table td:first-child,
    .data-table th:first-child {
        min-width: 220px;
    }
}


/* ================================================================
   NOTA AL PIE DE GRÁFICOS
   ================================================================ */
.footer-note {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    line-height: 1.5;
}

.footer-note p {
    margin: 0;
}

.footer-note strong {
    color: var(--color-text-secondary);
}

@media (min-width: 768px) {
    .footer-note {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-5);
    }
}


/* ================================================================
   SECTION TITLE (tablas)
   ================================================================ */
.table-section-title {
    background-color: var(--color-gobmx-verde);
    color: white;
    padding: var(--space-2) var(--space-4);
    font-weight: 700;
    font-size: var(--text-sm);
    margin-top: var(--space-5);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    letter-spacing: 0.02em;
}

/* Caja de fórmula */
.formula-box {
    background-color: #f1f8f5;
    border: 1.5px solid #c8e6d9;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    flex: 1;
    min-width: 260px;
    font-size: var(--text-sm);
    line-height: 1.55;
}


/* ================================================================
   FOOTER GLOBAL
   ================================================================ */
footer,
.site-footer {
    background: #1a1a1a;
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: var(--space-8) var(--space-5);
    margin-top: auto;
    font-size: var(--text-sm);
    line-height: 1.7;
}

footer p,
.site-footer p {
    margin: var(--space-1) 0;
}

footer strong,
.site-footer strong {
    color: rgba(255,255,255,0.95);
}

footer .footer-brand {
    display: inline-block;
    margin-bottom: var(--space-3);
    font-family: var(--font-family-headings);
    font-size: var(--text-lg);
    color: white;
}

footer .footer-sep {
    display: block;
    width: 40px;
    height: 2px;
    background: var(--color-gobmx-dorado);
    margin: var(--space-3) auto;
    border-radius: 2px;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-nav {
        background: linear-gradient(135deg, rgba(252, 250, 246, 0.98), rgba(244, 238, 230, 0.97));
    }

    .nav-menu,
    .nav-dropdown-menu {
        background: rgba(255,255,255,0.99);
    }
}

.site-footer {
    background: #F0EDE8;
    border-top: 1px solid rgba(107, 15, 26, 0.08);
    padding: 28px 24px;
    color: inherit;
    text-align: initial;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer__inner p {
    font-size: 0.8rem;
    color: #8a7575;
    margin: 0;
}

.site-footer__logo {
    opacity: 0.45;
    height: 28px;
}


/* ================================================================
   REDESIGN GLOBAL — Editorial + Glass (2025)
   Override al final para no romper estilos existentes.
   ================================================================ */

/* Fondo global cálido con textura institucional sutil */
body {
    background-color: #F7F6F3;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(155, 34, 71, 0.04) 0%, transparent 42%),
        radial-gradient(circle at 88% 72%, rgba(30, 91, 79, 0.03) 0%, transparent 40%);
}

/* Nav: dropdown links con radio */
.nav-dropdown-link {
    border-radius: 6px;
}

/* Cards (index.html y páginas de contenido) */
.card {
    border-radius: 16px;
    box-shadow: 0 20px 50px -12px rgba(107, 15, 26, 0.06), 0 8px 12px -4px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(228, 224, 218, 0.6);
    transition: transform 260ms ease, box-shadow 260ms ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 28px 60px -12px rgba(107, 15, 26, 0.10), 0 14px 20px -6px rgba(0, 0, 0, 0.04);
}

/* Page header */
.page-header {
    border-radius: 12px;
    box-shadow: 0 20px 50px -12px rgba(107, 15, 26, 0.06), 0 8px 12px -4px rgba(0, 0, 0, 0.02);
}

/* Report capture */
.report-capture-area {
    border-radius: 16px;
}

/* Method steps globales */
.method-step {
    border-radius: 14px;
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.method-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(107, 15, 26, 0.08);
}

/* Control selects */
.control-select {
    border-radius: 10px;
}

/* Sankey stats globales (páginas sin pilot-redesign) */
.cel-sankey-stat {
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.cel-sankey-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -6px rgba(107, 15, 26, 0.08);
}

/* Buttons */
.btn-export-full,
.btn-download,
.btn-nav {
    border-radius: 10px;
}

/* Highcharts fullscreen */
.chart-container:fullscreen,
.chart-container:-webkit-full-screen,
.highcharts-container:fullscreen,
.highcharts-container:-webkit-full-screen {
    background: #f7f4ee;
    padding: 24px;
    box-sizing: border-box;
}

.chart-container:fullscreen .highcharts-background,
.chart-container:-webkit-full-screen .highcharts-background,
.highcharts-container:fullscreen .highcharts-background,
.highcharts-container:-webkit-full-screen .highcharts-background {
    fill: #f7f4ee;
}

.chart-container:fullscreen .highcharts-root,
.chart-container:-webkit-full-screen .highcharts-root,
.highcharts-container:fullscreen .highcharts-root,
.highcharts-container:-webkit-full-screen .highcharts-root {
    background-color: #f7f4ee;
}

@media (max-width: 768px) {
    .site-header__content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .site-header__brand {
        flex-direction: column;
        gap: 10px;
    }

    .site-header__divider {
        display: none;
    }

    .site-header__meta {
        justify-content: center;
    }

    .nav-brand__eyebrow {
        display: none;
    }
}
