.tabs {
    background: #f3f3f3;
    border-radius: 22px;
    padding: 28px;
    margin: 32px 0;
    box-sizing: border-box;
}

.tabs-top-title {
    margin-bottom: 18px;
}

.tabs-top-title h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
    color: #0077c8;
    letter-spacing: -0.02em;
}

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.tab-btn {
    appearance: none;
    border: 0;
    background: #ffffff;
    color: #20405f;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.tab-btn:hover {
    transform: translateY(-1px);
}

/* Estado activo según color */
.tab-btn.theme-blue.active {
    background: #2f8fd8;
    color: #ffffff;
}

.tab-btn.theme-cyan.active {
    background: #23b8b3;
    color: #ffffff;
}

.tab-btn.theme-green.active {
    background: #36b36d;
    color: #ffffff;
}

.tab-btn.theme-brown.active {
    background: #b9835a;
    color: #ffffff;
}

.tab-btn.theme-purple.active {
    background: #8f76d7;
    color: #ffffff;
}

.tab-btn.theme-orange.active {
    background: #ef944f;
    color: #ffffff;
}

/* Inactivos con guiño del color */
.tab-btn.theme-blue:not(.active) {
    background: #eef7ff;
    color: #2b78b7;
}

.tab-btn.theme-cyan:not(.active) {
    background: #ecfbfa;
    color: #18948f;
}

.tab-btn.theme-green:not(.active) {
    background: #eefbf3;
    color: #2f8e58;
}

.tab-btn.theme-brown:not(.active) {
    background: #faf2eb;
    color: #9a6d4a;
}

.tab-btn.theme-purple:not(.active) {
    background: #f3efff;
    color: #775fc2;
}

.tab-btn.theme-orange:not(.active) {
    background: #fff3ea;
    color: #da7d36;
}

.tab-btn.active {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.tab-btn:not(.active) {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.tabs-content {
    width: 100%;
}

.tab-panel {
    display: none;
    border-radius: 24px;
    padding: 24px;
}

.tab-panel.active {
    display: block;
}

.tab-panel>h2 {
    margin: 0 0 14px;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 700;
    color: #1b2c3d;
    letter-spacing: -0.02em;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.left,
.right {
    min-width: 0;
}

.left {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    padding: 22px;
    backdrop-filter: blur(2px);
}

.right {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 20px;
    padding: 22px;
    backdrop-filter: blur(2px);
}

.left h3,
.right h3 {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    color: #17324a;
    letter-spacing: -0.01em;
}

/* ===== TEMAS POR TAB ===== */

.tab-panel.theme-blue {
    background: linear-gradient(180deg, #b9defa 0%, #93c8f0 100%);
}

.tab-panel.theme-cyan {
    background: linear-gradient(180deg, #b7efec 0%, #8bded9 100%);
}

.tab-panel.theme-green {
    background: linear-gradient(180deg, #bdeccf 0%, #8ed5ab 100%);
}

.tab-panel.theme-brown {
    background: linear-gradient(180deg, #e0c4aa 0%, #c89f7d 100%);
}

.tab-panel.theme-purple {
    background: linear-gradient(180deg, #d8cdf8 0%, #b7a8eb 100%);
}

.tab-panel.theme-orange {
    background: linear-gradient(180deg, #ffd4b2 0%, #f2ab72 100%);
}


.tab-panel {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tab-panel.active {
    opacity: 1;
    transform: translateY(0);
}

.tab-panel {
    position: relative;
}

.tab-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
}

.grafico {
    min-height: 320px;
}

.grafico canvas,
.grafico svg {
    max-height: 420px !important;
}

/* ===== GRÁFICO / WPDATATABLES ===== */



.grafico-loading,
.grafico-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    font-size: 14px;
    color: #27445c;
    text-align: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 12px;
}

.grafico-error {
    color: #8a2d2d;
}



.grafico {
    background: rgba(255, 255, 255, 0.38);
    border-radius: 16px;
    padding: 14px;
    overflow-x: auto;
    max-width: 100%;
}

/* Wrapper general */
.grafico .wpDataTablesWrapper,
.grafico .dataTables_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    box-sizing: border-box;
}

/* Tablas */
.grafico table,
.grafico .wpDataTable,
.grafico .dataTable {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
}

/* Si wpDataTables mete chart canvas/svg/iframe */
.grafico canvas,
.grafico svg,
.grafico iframe,
.grafico img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Controles y filtros */
.grafico .dataTables_length,
.grafico .dataTables_filter,
.grafico .dataTables_info,
.grafico .dataTables_paginate {
    font-size: 12px;
    max-width: 100%;
}

/* Scroll horizontal cuando sea necesario */
.grafico .dataTables_scroll,
.grafico .dataTables_scrollBody {
    max-width: 100% !important;
}

/* Evita columnas absurdamente anchas */
.grafico th,
.grafico td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Si es chart y no tabla, lo deja más contenido */
.grafico .google-visualization-charteditor-dialog,
.grafico .highcharts-container,
.grafico .chartjs-render-monitor {
    max-width: 100% !important;
}

/* Fuente */
.grafico-fuente {
    margin-top: 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #27445c;
    opacity: 0.9;
}

.right p,
.right li {
    font-size: 14px;
    line-height: 1.55;
    color: #1d3850;
}

.right p {
    margin-top: 0;
    margin-bottom: 10px;
}

.right p:last-child {
    margin-bottom: 0;
}

.right ul {
    margin: 0;
    padding-left: 18px;
}

.right li+li {
    margin-top: 6px;
}

.tabs-empty {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    color: #333;
}

@media (max-width: 1024px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .tab-panel>h2 {
        font-size: 22px;
    }
}

@media (max-width: 767px) {
    .tabs {
        padding: 18px;
        border-radius: 16px;
    }

    .tabs-top-title h2 {
        font-size: 21px;
    }

    .tabs-nav {
        gap: 8px;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
    }

    .tab-panel {
        padding: 18px;
        border-radius: 18px;
    }

    .tab-panel>h2 {
        font-size: 20px;
    }

    .left,
    .right {
        padding: 18px;
        border-radius: 16px;
    }

    .left h3,
    .right h3 {
        font-size: 16px;
    }

    .right p,
    .right li {
        font-size: 13px;
    }
}