/* ==========================================
   SECCIÓN TEMÁTICAS / ESTADÍSTICAS
   Sistema visual compartido (Política/Estrategia)
   ========================================== */

.tema-page {
    background: #f5f8f9;
    min-height: 100vh;
    padding-bottom: 80px;
}


/* ==========================================
   HEADER
   ========================================== */

.tema-header {
    background: linear-gradient( 135deg, #1B6C6D 0%, #1B6C6D 100% );
    padding: 40px 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.tema-header::after {
    content: "";
    position: absolute;
    width: 350px;
    height: 350px;
    right: -120px;
    top: -150px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}

.tema-header-content {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 2;
}

.tema-header-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.15);
    border-radius: 18px;
    font-size: 32px;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
}

.tema-header-subtitle {
    font-size: 13px;
    letter-spacing: 2px;
    opacity: .8;
    margin-bottom: 6px;
}

.tema-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #a5e8cc;
}

.tema-header p {
    margin: 10px 0 0;
    font-size: 16px;
    opacity: .9;
    max-width: 650px;
}

.tema-header-back {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 9px;
    color: white !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all .25s ease;
    position: relative;
    z-index: 2;
}

.tema-header-back:hover {
    background: rgba(255,255,255,.15);
}


/* ==========================================
   SUB-NAV (tabs)
   ========================================== */

.tema-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    position: relative;
    z-index: 2;
}

.tema-subnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    color: white !important;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    text-decoration: none !important;
    transition: all .25s ease;
}

.tema-subnav a:hover {
    background: rgba(255,255,255,.25);
}

.tema-subnav a.active {
    background: #a5e8cc;
    color: #104e4f !important;
}


/* ==========================================
   CONTENIDO
   ========================================== */

.tema-content {
    padding: 45px 0;
}

.tema-intro {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.tema-intro h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #104e4f;
    font-weight: 700;
}

.tema-intro p {
    margin: 0;
    color: #6c757d;
    font-size: 15px;
}

.tema-count {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,.06);
}

.tema-count span {
    font-size: 20px;
    font-weight: 700;
    color: #037481;
}

.tema-count small {
    color: #777;
    font-size: 13px;
}


/* ==========================================
   LISTA / CARD
   ========================================== */

.tema-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tema-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5eeee;
    overflow: hidden;
    transition: all .25s ease;
    box-shadow: 0 3px 12px rgba(0,0,0,.04);
}

.tema-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3,116,129,.12);
    border-color: #c9e1e3;
}

.tema-card-header {
    padding: 0;
    border: none;
    background: transparent;
}

.tema-card-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 22px;
    background: #037481;
    color: white !important;
    text-decoration: none !important;
    transition: all .25s ease;
}

.tema-card-button:hover {
    background: #025b64;
    color: white !important;
}

.tema-card-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.tema-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,.15);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.tema-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.4;
    color: white;
    transition: color .25s ease;
}

.tema-arrow {
    width: 34px;
    height: 34px;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: white;
    transition: transform .3s ease, background .3s ease, color .3s ease;
}

.tema-card-button:not(.collapsed) {
    background: white;
    color: #104e4f !important;
    border-bottom: 1px solid #edf2f2;
}

.tema-card-button:not(.collapsed) .tema-title {
    color: #104e4f;
}

.tema-card-button:not(.collapsed) .tema-number {
    background: #e8f5f6;
    color: #037481;
}

.tema-card-button:not(.collapsed) .tema-arrow {
    transform: rotate(180deg);
    background: #037481;
    color: white;
}

.tema-card-body {
    padding: 22px 30px 25px;
    background: white;
}

.tema-description {
    color: #555;
    font-size: 15px;
    line-height: 1.7;
    text-align: justify;
    margin-bottom: 20px;
}

.tema-actions {
    display: flex;
    justify-content: flex-end;
}

.tema-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 17px;
    background: #037481;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all .25s ease;
}

.tema-button:hover {
    background: #025b64;
    transform: translateX(3px);
    box-shadow: 0 5px 15px rgba(3,116,129,.25);
}


.tema-list-acordeon {
    max-width: 1000px;
    margin: 25px auto 0;
}


/* ==========================================
   CONTENIDO DETALLADO (acordeón Noticias/Eventos)
   ========================================== */

.tema-card-body-detalle {
    padding: 28px 34px 30px;
}

.tema-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 13px;
    border-radius: 8px;
    background: #eef7f8;
    color: #037481;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.tema-card-body-detalle .tema-description {
    font-size: 15px;
    line-height: 1.9;
    color: #4a5a5b;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid #eef3f3;
}

.tema-card-body-detalle .tema-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.tema-card-body-detalle .tema-button {
    padding: 11px 22px;
    font-size: 14px;
}


/* ==========================================
   TEXTO LARGO / DETALLE DE PAGINA (Pagina1)
   ========================================== */

.tema-texto {
    font-size: 15px;
    line-height: 1.9;
    color: #4a5a5b;
    text-align: justify;
    margin-bottom: 24px;
}

.tema-acciones-top {
    border-top: 1px solid #eef3f3;
    padding-top: 24px;
}


/* ==========================================
   BUSQUEDA
   ========================================== */

.busqueda-ancho {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.busqueda-lista {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#busqueda-resultados .panel {
    border: 1px solid #e5eeee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,.04);
    transition: all .25s ease;
}

#busqueda-resultados .panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(3,116,129,.12);
    border-color: #c9e1e3;
}

#busqueda-resultados .panel-heading {
    background: #037481;
    border: none;
    padding: 18px 22px;
}

#busqueda-resultados .panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.4;
}

#busqueda-resultados .panel-title a {
    color: white;
    text-decoration: none !important;
}

#busqueda-resultados .panel-title a:hover {
    color: #a5e8cc;
}

#busqueda-resultados .panel-body {
    padding: 22px 24px 24px;
    background: white;
}

.busqueda-tipo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 8px;
    background: #eef7f8;
    color: #037481;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.busqueda-descripcion {
    font-size: 15px;
    line-height: 1.9;
    color: #4a5a5b;
    text-align: justify;
    margin: 0 0 22px;
}

.busqueda-acciones {
    display: flex;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #eef3f3;
}

.busqueda-vacio {
    background: white;
    border: 1px solid #e5eeee;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,.04);
    padding: 45px 30px;
    text-align: center;
    color: #6c757d;
}

.busqueda-vacio i {
    display: block;
    font-size: 32px;
    color: #b7cfd1;
    margin-bottom: 14px;
}

.busqueda-vacio p {
    margin: 0;
    font-size: 15px;
}


/* ==========================================
   INDICADOR / RECURSO
   ========================================== */

.tema-indicador {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid #eef3f3;
}

.tema-indicador:last-child {
    border-bottom: none;
}

.tema-indicador-name {
    font-size: 15px;
    font-weight: 600;
    color: #104e4f;
    text-transform: uppercase;
    line-height: 1.4;
}

.tema-recurso-name {
    font-size: 15px;
    font-weight: 600;
    color: #104e4f;
    line-height: 1.4;
}

.tema-recurso-link {
    color: #037481 !important;
    text-decoration: none !important;
    font-weight: 600;
}

.tema-recurso-link:hover {
    text-decoration: underline !important;
}


/* ==========================================
   SELECTOR DE TEMÁTICAS
   ========================================== */

.tema-ejes {
    padding: 40px 0 10px;
}

.tema-ejes-title {
    margin: 0 0 25px;
    font-size: 22px;
    font-weight: 700;
    color: #104e4f;
    text-align: center;
}

.tema-ejes-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.tema-eje {
    width: 170px;
    padding: 22px 12px 16px;
    background: white;
    border: 1px solid #e5eeee;
    border-radius: 14px;
    text-align: center;
    text-decoration: none !important;
    box-shadow: 0 3px 12px rgba(0,0,0,.04);
    transition: all .25s ease;
}

.tema-eje:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(3,116,129,.15);
    border-color: #c9e1e3;
}

.tema-eje img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 12px;
}

.tema-eje span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1B6C6D;
    text-transform: uppercase;
    line-height: 1.3;
}

.tema-eje.active {
    border-color: #037481;
    background: #eef7f8;
}

.tema-eje.active span {
    color: #037481;
}


/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 767px) {

    .tema-header {
        padding: 40px 20px;
    }

    .tema-header-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .tema-header-icon {
        width: 55px;
        height: 55px;
        font-size: 24px;
        border-radius: 14px;
    }

    .tema-header h1 {
        font-size: 24px;
    }

    .tema-header p {
        font-size: 14px;
    }

    .tema-header-back {
        margin-left: 0;
    }

    .tema-content {
        padding: 30px 15px;
    }

    .tema-intro {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .tema-card-button {
        padding: 16px;
    }

    .tema-card-left {
        gap: 12px;
    }

    .tema-number {
        width: 35px;
        height: 35px;
        min-width: 35px;
    }

    .tema-title {
        font-size: 14px;
    }

    .tema-card-body {
        padding: 18px 20px 22px;
    }

    .tema-card-body-detalle {
        padding: 20px 18px 22px;
    }

    .tema-list-acordeon {
        max-width: 100%;
        margin-top: 20px;
    }

    .tema-card-body-detalle .tema-description {
        font-size: 14px;
        line-height: 1.8;
    }

    .tema-texto {
        font-size: 14px;
        line-height: 1.8;
    }

    .tema-acciones-top {
        padding-top: 18px;
    }

    .busqueda-ancho {
        max-width: 100%;
    }

    #busqueda-resultados .panel-heading {
        padding: 15px 16px;
    }

    #busqueda-resultados .panel-body {
        padding: 18px 16px 20px;
    }

    #busqueda-resultados .panel-title {
        font-size: 14px;
    }

    .busqueda-descripcion {
        font-size: 14px;
        line-height: 1.8;
    }

    .tema-actions {
        justify-content: flex-start;
    }

    .tema-indicador {
        flex-direction: column;
        align-items: flex-start;
    }

    .tema-eje {
        width: 140px;
    }
}


/* ==========================================
   ADMINISTRACIÓN (área con sidebar)
   ========================================== */

.admin-main-content > .tema-page {
    min-height: calc(100vh - 40px);
    padding-bottom: 40px;
}

.admin-landing {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.admin-landing-hello {
    font-size: 26px;
    font-weight: 700;
    color: #1B6C6D;
    margin: 0 0 6px;
}

.admin-landing-sub {
    font-size: 15px;
    color: #4a5a5b;
    margin: 0 0 25px;
}

.admin-acciones-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}


/* --------- Tablas teal (bootstrap .table) --------- */

.tema-tabla {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    background: #fff;
    border-collapse: collapse;
}

.tema-tabla > thead > tr > th {
    background: #1B6C6D;
    color: #fff;
    border: 1px solid #17605f !important;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: .3px;
    padding: 12px 14px;
    vertical-align: middle;
    text-align: left;
}

.tema-tabla > tbody > tr > td {
    border: 1px solid #e3ecec !important;
    padding: 11px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5a5b;
    vertical-align: middle;
}

.tema-tabla > tbody > tr:nth-child(even) > td {
    background: #f5f8f9;
}

.tema-tabla > tbody > tr:hover > td {
    background: #eaf5f4;
}

.tema-tabla > tbody > tr > td a {
    color: #1B6C6D;
    font-weight: 600;
    text-decoration: none;
}

.tema-tabla > tbody > tr > td a:hover {
    color: #104e4f;
    text-decoration: underline;
}


/* --------- Botones pequeños / paginación --------- */

.tema-button-sm {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 6px;
    display: inline-block;
    margin: 2px 3px 2px 0;
    line-height: 1.5;
}

.tema-button-disabled,
.tema-button-disabled:hover {
    background: #b7c9c9;
    color: #fff !important;
    opacity: .8;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.tema-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding-top: 6px;
}

.tema-pagination span {
    font-size: 14px;
    color: #4a5a5b;
}

.tema-pagination strong {
    color: #1B6C6D;
}

.tema-vacio {
    text-align: center;
    padding: 34px 20px;
    color: #7a8a8b;
    font-size: 15px;
}

.tema-vacio i {
    display: block;
    font-size: 30px;
    color: #1B6C6D;
    opacity: .5;
    margin-bottom: 10px;
}


@media (max-width: 768px) {
    .admin-main-content > .tema-page {
        min-height: calc(100vh - 30px);
    }

    .admin-landing {
        min-height: 45vh;
    }
}

/* ================= ADMIN — FORMULARIOS ================= */
.tema-form label {
    color: #4a6b6c;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tema-form .form-control,
.tema-form select,
.tema-form textarea,
.tema-form input[type="text"],
.tema-form input[type="number"],
.tema-form input[type="date"] {
    border: 1px solid #cfe0e0;
    border-radius: 6px;
    padding: 8px 10px;
    color: #333;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.tema-form .form-control:focus,
.tema-form select:focus,
.tema-form textarea:focus,
.tema-form input:focus {
    border-color: #1B6C6D;
    box-shadow: 0 0 0 3px rgba(27,108,109,.12);
    outline: none;
}

.tema-form .form-control[disabled],
.tema-form select[disabled],
.tema-form input[disabled] {
    background: #eef4f4;
    color: #7a8c8c;
}

/* ================= ADMIN — FILTROS ================= */
.admin-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.admin-filtros .form-group {
    margin-bottom: 0;
    min-width: 180px;
}

.admin-filtros label {
    color: #4a6b6c;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.admin-filtros select,
.admin-filtros .form-control {
    border: 1px solid #cfe0e0;
    border-radius: 6px;
    padding: 7px 10px;
    color: #333;
}

.admin-filtros select:focus,
.admin-filtros .form-control:focus {
    border-color: #1B6C6D;
    box-shadow: 0 0 0 3px rgba(27,108,109,.12);
    outline: none;
}

.admin-filtros .link {
    display: inline-block;
    background: #1B6C6D;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.admin-filtros .link:hover {
    background: #145657;
    color: #fff;
    text-decoration: none;
}

/* ================= ADMIN — ACCIONES DE FILA ================= */
.tema-fila-acciones {
    text-align: right;
    white-space: nowrap;
}

.tema-link-accion {
    color: #1B6C6D;
    font-size: 13px;
    font-weight: 600;
    margin-left: 12px;
}

.tema-link-accion:hover {
    color: #145657;
    text-decoration: underline;
}
