/* ═══════════════════════════════════════════════════════
   informe-provincia.css
   Extiende el sistema de diseño de portada.css
   ═══════════════════════════════════════════════════════ */

/* ── CONTENEDOR ─────────────────────────────────────── */
.informe-wrap {
    max-width: 1590px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ── HERO BANNER ────────────────────────────────────── */
.informe-hero {
    background: linear-gradient(135deg, var(--azul) 0%, var(--azul-claro) 100%);
    color: #fff;
    border-radius: 16px;
    padding: 30px 40px;
    margin: 20px 0 18px;
    display: flex;
    align-items: center;
    gap: 22px;
    box-shadow: var(--sombra);
}
.informe-hero-icon {
    font-size: 54px;
    opacity: .9;
    flex-shrink: 0;
}
.informe-hero h1 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 900;
    margin: 0 0 4px;
    color: #fff;
    letter-spacing: .02em;
}
.informe-hero p {
    font-size: 14px;
    margin: 0;
    opacity: .75;
}

/* ── KPI CARDS ──────────────────────────────────────── */
.informe-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}
.kpi-card {
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--sombra-suave);
    transition: transform .2s ease, box-shadow .2s ease;
}
.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sombra);
}
.kpi-card.kpi-blue   { background: #edf5ff; color: #005ecb; }
.kpi-card.kpi-green  { background: #edf6e9; color: var(--verde-oscuro); }
.kpi-card.kpi-yellow { background: #fff5df; color: #c8860a; }

.kpi-icon {
    font-size: 44px;
    flex-shrink: 0;
    margin-top: 2px;
}
.kpi-info {
    flex: 1;
    min-width: 0;
}
.kpi-info strong {
    display: block;
    font-size: clamp(22px, 2.5vw, 30px);
    font-weight: 900;
    line-height: 1.1;
}
.kpi-info small {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--azul);
    margin: 3px 0 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.kpi-diffs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.kpi-diff {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.kpi-diff.fw-bold {
    font-weight: 800 !important;
}
.kpi-diff .kpi-diff-label {
    font-size: 11px;
    font-weight: 400;
    color: var(--azul);
    opacity: .75;
    margin-right: 2px;
}
.kpi-diff.fw-bold .kpi-diff-label {
    font-weight: 700 !important;
    opacity: 1;
}
.kpi-diff.pos { color: #1d6fcf; }
.kpi-diff.neg { color: var(--rojo); }
.kpi-diff.neu { color: #888; }
.kpi-detalle-cp {
    margin-bottom: 22px;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
}
.kpi-detalle-cp .kpi-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    align-items: center;
}
.kpi-detalle-cp-head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    justify-content: center;
    max-width: 860px;
    margin: 0 auto 2px;
}
.kpi-detalle-cp .codigo-postal {
    color: var(--rojo);
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: .04em;
}
.kpi-detalle-cp .zona {
    color: #5f6b7a;
    font-size: .95rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.35;
    opacity: .95;
}
.kpi-detalle-cp .kpi-info small {
    margin: 2px 0 0;
}
.kpi-detalle-cp .kpi-info strong {
    line-height: 1;
}
.kpi-detalle-cp .kpi-diffs {
    justify-content: center;
    margin-top: 6px;
}

/* ── SELECTORES / CABECERAS BLANCAS ─────────────────── */
.comarca-header {
    max-width: 900px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.comarca-label {
    display: inline-block;
    color: #dc3545;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.comarca-nombre {
    font-weight: 700;
    color: #212529;
}
.comarca-select {
    border-radius: 10px;
    min-height: 44px;
}

/* ── ESTADOS VACÍOS ─────────────────────────────────── */
.informe-empty {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: var(--sombra-suave);
    color: var(--azul);
    font-weight: 600;
    margin-bottom: 22px;
}

/* ── ACORDEÓN ───────────────────────────────────────── */
.informe-accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.informe-accordion .accordion-item {
    border: none !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: var(--sombra-suave);
}
.informe-accordion .accordion-button {
    background: #fff;
    color: var(--azul);
    font-weight: 700;
    font-size: 15px;
    padding: 13px 18px;
    gap: 10px;
    border-radius: 12px !important;
    box-shadow: none !important;
}
.informe-accordion .accordion-button:hover {
    background: #f4f6fa;
}
.informe-accordion .accordion-button:not(.collapsed) {
    background: var(--azul);
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
}
.informe-accordion .accordion-button:not(.collapsed)::after {
    filter: invert(1) brightness(2);
}
.informe-accordion .accordion-body {
    background: #fafbfc;
    padding: 20px 20px 16px;
    border-top: 1px solid #e8edf3;
}

/* Número de sección */
.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--rojo);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
    transition: background .2s;
}
.accordion-button:not(.collapsed) .section-badge {
    background: rgba(255,255,255,.25);
}

/* ── TABLAS ─────────────────────────────────────────── */
.informe-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    margin-bottom: 12px;
}
.informe-table-wrap::-webkit-scrollbar {
    height: 5px;
}
.informe-table-wrap::-webkit-scrollbar-thumb {
    background: #c5cfe0;
    border-radius: 3px;
}

/* Aplica el wrap automáticamente a las tablas del acordeón */
.informe-accordion .accordion-body > div[style*="overflow"] {
    overflow-x: auto !important;
    border-radius: 8px;
    margin-bottom: 12px;
}

.informe-accordion .table {
    font-size: 0.80rem;
    margin-bottom: 0;
}
.informe-accordion .table thead th {
    font-size: 0.77rem;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
}
/* DataTables 2.x convierte th ordenables en flex; text-align no funciona en flex */
.informe-accordion .table thead th .dt-column-title {
    flex: 1;
    text-align: center;
}
.informe-accordion .table tbody td {
    vertical-align: middle;
}
.informe-accordion .table tfoot td {
    font-weight: 700;
    background: #edf0f5;
}

/* ---------- COLORES AUXILIARES DE TABLAS Y TARJETAS ---------- */
.color_Formasjuridicas  { background: #FCF75E; }
.color_antiguedad      { background: #98FF98; }
.color_epigrafes       { background: #2ECC71; }
.color_cp              { background: #80FFBF; }
.color_municipio       { background: #1DFAF5; }
.color_hombre_mujer    { background: #E0B0FF; }
.color_SUPERFICIE      { background: #FFBF00; }
.color_numeros_cp      { color: #28a745; }
.color_n_actividades   { background: #FFCC0F; }
.Silvia   { background: #FCE4EC; } 


.hidden-column {
    display: none !important;
}

/* Fuerza colores de cabecera frente a reglas base de .table de Bootstrap */
.informe-accordion .table thead th.color_Formasjuridicas { background-color: #FCF75E !important; }
.informe-accordion .table thead th.color_antiguedad      { background-color: #98FF98 !important; }
.informe-accordion .table thead th.color_epigrafes       { background-color: #2ECC71 !important; }
.informe-accordion .table thead th.color_cp              { background-color: #80FFBF !important; }
.informe-accordion .table thead th.color_municipio       { background-color: #1DFAF5 !important; }
.informe-accordion .table thead th.color_hombre_mujer    { background-color: #E0B0FF !important; }
.informe-accordion .table thead th.color_SUPERFICIE      { background-color: #FFBF00 !important; }
.informe-accordion .table thead th.color_n_actividades   { background-color: #FFCC0F !important; }
.informe-accordion .table thead th.Silvia                { background-color: #FCE4EC !important; }
.informe-accordion .table tbody td.color_numeros_cp      { color: #28a745 !important; }

/* ── GRÁFICOS ZINGCHART ─────────────────────────────── */
.informe-accordion [id^="graf_"],
.informe-accordion [id^="fj_"],
.informe-accordion [id^="evo_"] {
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
    background: #fff;
}

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 960px) {
    .informe-kpis {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .informe-hero {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
}
@media (max-width: 768px) {
    .comarca-header {
        padding: 16px;
    }
}
