/* -------------------------------
   GLOBAL / BODY / LOGIN
---------------------------------- */
body {
    background: linear-gradient(135deg, #E5243B, #4C9F38);
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
}

.login-card h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.ods-logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-height: 80px;
}

.form-label {
    font-weight: 500;
}

.esg-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    /* separación limpia entre E/S/G */
    margin-bottom: 28px;
    /* evita que se “peguen” a ODS */
    flex-wrap: wrap;
}

.btn-esg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* borde pegado a la imagen */
    line-height: 0;
    /* elimina “aire” vertical */
    background: transparent;
    border: 2px solid transparent;
    /* hover fino */
    border-radius: 0;
    /* rectángulo, no círculo */
    cursor: pointer;
    transition: border 0.2s ease;
}

.btn-esg:hover {
    border-color: #000;
}

.btn-esg.active {
    border: 4px solid #000;
    /* clickado más grueso */
}

.esg-img {
    height: 160px;
    /* doble que ODS (80px) */
    width: auto;
    /* IMPORTANTÍSIMO: no deformar */
    display: block;
    object-fit: contain;
    pointer-events: none;
}
.btn-ods {
    background-color: #4C9F38;
    color: #fff;
    border: none;
}

.btn-ods:hover {
    background-color: #3a7d2b;
    color: #fff;
    border: none;
}

.text-ods {
    color: #4C9F38;
}

.bg-ods {
    background-color: #4C9F38;
}

.alert {
    font-size: 0.9rem;
}

/* -------------------------------
   DASHBOARD LAYOUT
---------------------------------- */
.dashboard-body {
    background: #f4f4f4;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 90%;
}

.dashboard-header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.dashboard-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #E5243B;
}

.dashboard-header .subtitle {
    font-size: 1rem;
    color: #666;
    margin-left: 1rem;
    flex-grow: 1;
}

.ods-header-logo {
    max-height: 40px;
    margin-left: 1rem;
}

/* -------------------------------
   USUARIO / DROPDOWN
---------------------------------- */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    z-index: 1;
    min-width: 150px;
}

.dropdown-content a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
}

.dropdown-content a:hover {
    background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* -------------------------------
   MAIN & CARDS
---------------------------------- */

main.dashboard-main {
    flex-grow: 1;
    padding: 2rem;
    width: 100%; 
}

main.dashboard-main.with-form-card {
    max-width: 1200px; 
    margin: auto;
}

main.dashboard-main.with-companyfile {
    max-width: 1200px; 
    margin: auto;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    width: 100%;
    justify-content: center;
    align-items: stretch;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

/* -------------------------------
   FORM FIELDS
---------------------------------- */

.form-card:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

input.form-control:not([type="search"]) {
    text-align: center;
}

div.col-md-6 {
    margin-top: 10px;
}

div.col-md-12.check {
    margin-top: 25px;
}

/* -------------------------------
   FLASH MESSAGES
---------------------------------- */

.flash-message {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    opacity: 0.95;
    animation: slide-in 0.5s ease-out;
}

body.login-page .flash-message {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 90%;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 0.95; transform: translateX(-50%) translateY(0); }
}

/* -------------------------------
   BOOTBOX Y MODAL
---------------------------------- */

#personasSeleccionadas {
    min-height: 3rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    background-color: #fff;
    padding: 0.5rem;
    gap: 0.25rem;
    overflow-x: hidden;
}

.persona-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.modal.with-form {
    text-align: center;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:focus-visible,
.select2-container--default .select2-selection--single:focus-within {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-radius: 0.375rem;
}

/* Dual Listbox */

.bootstrap-duallistbox-container select.form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    box-shadow: none;
}

.bootstrap-duallistbox-container .box1,
.bootstrap-duallistbox-container .box2 {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    background-color: #f8f9fa;
}

.bootstrap-duallistbox-container .moveall,
.bootstrap-duallistbox-container .removeall {
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    margin: 0.25rem;
}

.bootstrap-duallistbox-container label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.bootstrap-duallistbox-container select {
    min-height: 200px !important;
    overflow-y: auto !important;
    background-color: #fff !important;
    color: #000 !important;
}

.bootstrap-duallistbox-container .box1 select option,
.bootstrap-duallistbox-container .box2 select option {
    white-space: normal !important;
    word-break: break-word;
    text-align: justify;
    text-justify: inter-word;
}

.bootstrap-duallistbox-container  button.moveall,
.bootstrap-duallistbox-container  button.removeall {
    display: none;
}

/* Choices */

.choices .choices__list--dropdown .choices__item {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.choices .choices__list--multiple .choices__item {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* Botonera ODS - Acciones */

.btn-ods {
    font-weight: bold;
    min-width: 80px;
    text-align: center;
}

#resumen-acciones ul {
    list-style-type: disc;
    margin-left: 1.5em;
}
  

.btn-ods.active {
    box-shadow: 0 0 0 2px white, 0 0 0 4px black;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

.btn-ods.estrategico {
    border: 3px solid green; /* Opcional: borde azul */
    position: relative;
    z-index: 1;
}

.btn-ods img {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* .btn-ods:hover img {
	transform: scale(1.05);
	box-shadow: 0 0 5px black(0, 0, 0, 0.3);
} */

.btn-ods.estrategico img {
	outline: 2px solid red; /* o el color que prefieras para destacar */
}

/* Cuando está activo, el estilo base se mantiene, pero reforzamos el estratégico */
.btn-ods.active.estrategico {
    box-shadow: 0 0 0 2px white, 0 0 0 4px black, 0 0 8px 3px rgba(0, 123, 255, 0.75); /* mismo halo */
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* -------------------------------
   DOCUMENTOS INICIALES - RESPONSIVE
---------------------------------- */
@media (max-width: 576px) {
    /* Ajusta los ítems para que el contenido se apile */
    .list-group-item.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* Badge o ícono informativo debajo del link */
    .list-group-item.justify-content-between > .badge,
    .list-group-item.justify-content-between > .bi-info-circle-fill {
        margin-top: 0.5rem;
    }

    /* Ajustes al enlace para evitar desbordes */
    .list-group-item .text-decoration-none {
        word-break: break-word;
        max-width: 100%;
    }
}

/* -------------------------------
   DATATABLES
---------------------------------- */

table.dataTable {
    border-collapse: collapse;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #fff;
}

table.dataTable td .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.5rem;
    border: 1px solid #ccc;
    padding: 0.4rem 0.6rem;
}

ul.dtr-details {
    width: 100%;
}

table.dataTable td[title] {
    cursor: default;
}

td.middle-valing-cell {
    vertical-align: middle;
}

td a {
    vertical-align: middle;
}

.acciones-cell {
    padding-left: 15px !important;
    padding-right: 15px !important;
    text-overflow: clip !important;
}

.separator-row td {
    padding: 0;
    height: 12px;         /* separador vertical visible */
    background: blue;  /* azul muy suave */
    border-top: 2px solid #bcd4ff; /* línea divisoria elegante */
}

/* -------------------------------
   DATATABLES UI LAYOUT
---------------------------------- */

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
}


.dataTables_wrapper .row.mb-3,
.dataTables_wrapper .row.mt-3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-left: 0;
    margin-right: 0;
}

.dataTables_wrapper .row.mb-3 > .col-sm-6,
.dataTables_wrapper .row.mt-3 > .col-sm-6 {
    padding-left: 0;
    padding-right: 0;
}

.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0; /* elimina espacio innecesario */
    white-space: nowrap;
}

.dataTables_length select {
    width: auto;
    display: inline-block;
}

.dataTables_filter label {
    /* display: flex; */
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    white-space: nowrap;
}

.dataTables_filter input {
    width: auto;
    display: inline-block;
}

.dataTables_filter input {
    margin-top: 4px;
    border-radius: 0.375rem;
    box-shadow: none;
}

.dataTables_filter input:focus {
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,0.25); /* Bootstrap default */
    outline: none;
}

#entrevistas-table_wrapper .row,
#formaciones-table_wrapper .row,
#mejoras-table_wrapper .row,
#hitos-table_wrapper .row,
#presu-table_wrapper .row {
    text-align: initial !important;
}


div#contenedorexp.container {
    max-width: 1100px !important;
}

/* -------------------------------
   RESPONSIVE DATATABLE
---------------------------------- */
@media (max-width: 768px) {

    table.dataTable {
        table-layout: fixed;
    }

    .dashboard-body {
        width: 100%;
        overflow-x: hidden;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .card-grid {
        padding-left: 0;
        padding-right: 0;
    }

    table.dataTable .card {
        margin: 0;
        width: 70%;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    table.dataTable {
        table-layout: auto !important;
        width: 100% !important;
    }

    table.dataTable th,
    table.dataTable td {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    table.dataTable td.col-id,
    table.dataTable th.col-id {
        width: 20px;
        max-width: 20px;
        text-align: center;
    }

    ul.dtr-details {
        word-break: break-word;
        padding-left: 0;
        margin: 0;
    }

    ul.dtr-details li {
        justify-content: space-between;
        align-items: baseline;
        gap: 0.5rem;
        width: 100%;
        border-bottom: 1px solid #dee2e6;
    }

    ul.dtr-details li .dtr-title {
        font-weight: 600;
        margin-right: 0.5rem;
    }

    ul.dtr-details li .dtr-data {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        max-width: 60%;
        /* margin: 0 auto; */
        margin-left: 15px;
    }

    .dataTables_filter {
        width: 95% !important;
        display: flex;
        justify-content: flex-start;
    }

    .dataTables_filter label {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .dataTables_filter input {
        width: 100% !important;
        box-sizing: border-box;
        margin-left: 2px !important;
    }

    div.dataTables_wrapper {
        width: 100%;
        overflow-x: hidden;
    }

    div.dataTables_wrapper div.dataTables_paginate {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.25rem;
        padding: 1rem 0;
        max-width: 100%;
        box-sizing: border-box;
        scrollbar-width: thin; /* Firefox */
    }

    .dataTables_paginate .paginate_button {
        flex: 0 0 auto;
        font-size: 0.85rem;
    }

    #entrevistas-table ul.dtr-details li .dtr-data,
    #formaciones-table ul.dtr-details li .dtr-data,
    #mejoras-table ul.dtr-details li .dtr-data,
    #hitos-table ul.dtr-details li .dtr-data, 
    #presu-table ul.dtr-details li .dtr-data {
        margin: 0 auto !important;
    }
}

@media (max-width: 575px) {
    ul.dtr-details li {
        flex-direction: column;
        align-items: flex-start;
    }

    ul.dtr-details li .dtr-title {
        margin-bottom: 0.25rem;
    }

    ul.dtr-details li .dtr-data {
        max-width: 100% !important;
        white-space: normal;
        overflow-wrap: break-word;
        text-overflow: unset;
    }
}

@media (min-width: 769px) {
    table.dataTable {
        table-layout: fixed;
        width: 100%;
        border-collapse: collapse;
        background-color: #fff;
    }

    table#metas-table.dataTable {
        table-layout: auto !important;
    }
    
    table.dataTable th,
    table.dataTable td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    table.dataTable th:nth-child(1), /* Nombre */
    table.dataTable td:nth-child(1) {
        max-width: 25px;
    }
    
    table.dataTable th:nth-child(2), /* Nombre */
    table.dataTable td:nth-child(2) {
        max-width: 250px;
    }
    
    table.dataTable td:nth-child(6), /* Email */
    table.dataTable td:nth-child(7) { /* Web */
        max-width: 200px;
    }

    th.sorting_disabled, 
    td:last-child {
        width: 100px !important;
        white-space: nowrap;
    }

    .dataTables_wrapper .row.mb-3 > .col-sm-6,
    .dataTables_wrapper .row.mt-3 > .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* -------------------------------
   HORIZONTAL SCROLLEABLE DATATABLE
---------------------------------- */

div#resumen-acciones.scroll-horizontal,
div#editakpi.scroll-horizontal {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

div#resumen-acciones.scroll-horizontal table#acciones-table,
div#editakpi.scroll-horizontal table  {
    min-width: 1000px; /* Ajusta según el contenido */
}