/* Safe override layer: loaded after base styles */
html body #app .reports-audience-card,
html body #app .reports-audience-card * {
    box-sizing: border-box;
}

html body #app .reports-modern-title {
    margin: 0;
    font-size: clamp(1.9rem, 2.4vw, 2.5rem);
    line-height: 1.05;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.03em;
}

html body #app .reports-modern-card {
    overflow: hidden;
    background: #ffffff;
}

html body #app .reports-modern-toolbar {
    background: #eef2f6;
}

html body #app .reports-modern-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
}

html body #app .reports-modern-filters {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1 1 720px;
    flex-wrap: wrap;
}

html body #app .reports-modern-field-wrap,
html body #app .reports-modern-date-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

html body #app .reports-modern-field-grow {
    flex: 1 1 220px;
    min-width: 220px;
}

html body #app .reports-modern-select,
html body #app .reports-modern-date-button {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    font-size: 13px;
    font-weight: 700;
}

html body #app .reports-modern-select {
    appearance: auto;
    padding: 0 0.9rem;
    min-width: 160px;
    width: 100%;
}

html body #app .reports-modern-date-wrap {
    min-width: 120px;
}

html body #app .reports-modern-date-native {
    /* FIX REAL CALENDARIO CENTRO DE REPORTES:
       El input date nativo queda transparente sobre TODO el control para que
       el clic sea directo sobre el selector del navegador dentro del iframe. */
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    z-index: 4;
    cursor: pointer;
    pointer-events: auto;
}

html body #app .reports-modern-date-button {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0 0.9rem;
    width: 100%;
    cursor: pointer;
    pointer-events: auto;
}

html body #app .reports-modern-export-group {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

html body #app .reports-modern-export-btn {
    width: 52px;
    height: 44px;
    border: none;
    border-radius: 12px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

html body #app .reports-modern-export-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

html body #app .reports-modern-export-btn--excel {
    background: #107c41;
}

html body #app .reports-modern-export-btn--pdf {
    background: #dc2626;
}

html body #app .reports-modern-export-label {
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0.08em;
    font-weight: 900;
}

html body #app .reports-modern-tabs-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

html body #app .reports-modern-tab {
    width: 100%;
    min-height: 74px;
    padding: 0.75rem 0.5rem 0.65rem;
    border-radius: 12px;
    border: 1px solid #d7dee8;
    background: #ffffff;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    text-align: center;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

html body #app .reports-modern-tab:hover {
    transform: translateY(-1px);
}

html body #app .reports-modern-tab[data-active="true"] {
    border-color: #60a5fa;
    background: #eef4ff;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

html body #app .reports-modern-tab[data-active="false"] {
    background: #ffffff;
}

html body #app .reports-modern-tab-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html body #app .reports-tab-svg {
    width: 100%;
    height: 100%;
    display: block;
    transform-origin: center;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

html body #app .reports-modern-tab[data-active="false"] .reports-tab-svg {
    filter: grayscale(1);
    opacity: 0.6;
}

html body #app .reports-modern-tab[data-active="true"] .reports-tab-svg {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.08);
}

html body #app .reports-modern-tab-label {
    font-size: 10px;
    line-height: 1.15;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.01em;
}

html body #app .reports-modern-tab[data-active="false"] .reports-modern-tab-label {
    color: #475569;
}

html body #app .reports-modern-tab[data-active="true"] .reports-modern-tab-label {
    color: #0f172a;
}

html body #app .reports-audience-card {
    overflow: hidden;
}

html body #app .reports-audience-card .reports-audience-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

html body #app .reports-audience-card .reports-audience-copy,
html body #app .reports-audience-card .reports-audience-actions,
html body #app .reports-audience-card .reports-audience-trigger,
html body #app .reports-audience-card .reports-audience-menu {
    max-width: 100%;
    min-width: 0;
}

html body #app .reports-audience-card .reports-audience-copy p {
    overflow-wrap: anywhere;
}

html body #app .reports-audience-card .reports-audience-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
}

html body #app .reports-audience-card .reports-audience-trigger {
    flex-shrink: 1;
}

@media (max-width: 1024px) {
    html body #app .reports-modern-toolbar-row {
        align-items: stretch;
    }

    html body #app .reports-modern-filters {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    html body #app .reports-modern-shell {
        gap: 0.75rem;
        padding-bottom: 0.5rem;
    }

    html body #app .reports-modern-title {
        font-size: 1.6rem;
        line-height: 1.08;
    }

    html body #app .reports-modern-card {
        border-radius: 16px;
    }

    html body #app .reports-modern-toolbar {
        padding: 10px 12px;
    }

    html body #app .reports-modern-toolbar-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        align-items: stretch;
    }

    html body #app .reports-modern-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        align-items: stretch;
    }

    html body #app .reports-modern-field-wrap--audience,
    html body #app .reports-modern-field-wrap--employee {
        grid-column: 1 / -1;
    }

    html body #app .reports-modern-field-wrap,
    html body #app .reports-modern-field-grow,
    html body #app .reports-modern-date-wrap,
    html body #app .reports-modern-export-group,
    html body #app .reports-modern-export-btn,
    html body #app .reports-modern-select,
    html body #app .reports-modern-date-button {
        width: 100%;
        min-width: 0;
    }

    html body #app .reports-modern-date-wrap {
        min-width: 0;
    }

    html body #app .reports-modern-select,
    html body #app .reports-modern-date-button {
        min-height: 42px;
        height: 42px;
        font-size: 12px;
    }

    html body #app .reports-modern-export-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        justify-content: stretch;
    }

    html body #app .reports-modern-export-btn {
        height: 42px;
        flex: none;
    }

    html body #app .reports-modern-tabs-wrap {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        gap: 8px;
    }

    html body #app .reports-modern-tab {
        max-width: none;
        min-height: 72px;
        padding: 8px 6px;
    }

    html body #app .reports-modern-tab-icon,
    html body #app .reports-tab-svg {
        width: 26px !important;
        height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
    }

    html body #app .reports-modern-tab-label {
        font-size: 8.5px;
        line-height: 1.15;
    }

    html body #app .reports-audience-card .reports-audience-layout {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    html body #app .reports-audience-card .reports-audience-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    html body #app .reports-audience-card .reports-audience-label {
        align-self: flex-start;
    }

    html body #app .reports-audience-card .reports-audience-trigger {
        width: 100%;
        justify-content: center;
    }

    html body #app .reports-audience-card .reports-audience-menu {
        width: 100%;
        min-width: 0;
    }

    html body #app #reportsContent .overflow-x-auto {
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
    }

    html body #app #reportsContent .space-y-6 > :not([hidden]) ~ :not([hidden]) {
        margin-top: 1rem;
    }

    html body #app #reportsContent .p-6 {
        padding: 1rem;
    }

    html body #app #reportsContent .rounded-2xl {
        border-radius: 1rem;
    }
}

@media (max-width: 480px) {
    html body #app .reports-modern-toolbar {
        padding: 8px 10px;
    }

    html body #app .reports-modern-filters {
        gap: 7px;
    }

    html body #app .reports-modern-select,
    html body #app .reports-modern-date-button {
        min-height: 40px;
        height: 40px;
        font-size: 11.5px;
    }

    html body #app .reports-modern-tabs-wrap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    html body #app .reports-modern-tab {
        min-height: 68px;
        padding: 8px 5px;
    }

    html body #app .reports-modern-tab-label {
        font-size: 8px;
    }

    html body #app #reportsContent .p-6 {
        padding: 0.875rem;
    }
}
