/* Hack nuclear para permitir position: sticky liberando overflow en ancestros */
html,
body,
.wrapper,
.main_content,
.full_main_content,
.content-wrapper,
.main_content_iner,
.overly_inner,
.content,
.box,
.box-body,
.tab-content,
.tab-pane {
    overflow: visible !important;
}


.fix-to-top2 {
    position: -webkit-sticky;
    position: sticky;
    z-index: 1;
    top: 60px;

    /* Heredar ancho del padre */
    width: inherit;
    max-width: inherit;
}

.modal-content .fix-to-top2 {
    top: 35px;
}


.itemBlock {
    overflow: visible;
    display: block;
}

/* Estilos Header Petición Rediseñado */
.header-peticion.head_itemBlock {
    background: #fff;
    border: 1px solid #e2e8ef;
    /* Borde teal solicitado */
    border-left: 5px solid #1ab1b8;
    /* Acento lateral más fuerte */
    border-radius: 6px;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    padding: 5px 10px;
    /* Reducido para optimizar espacio */
    transition: all 0.3s ease;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Contenido Izquierdo (Título + Toolbar) */
.header-content-left {
    display: flex;
    flex-direction: row;
    /* Alineación horizontal para ahorrar altura */
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    flex: 1;
    min-width: 300px;
}

.title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.analitica.text-dark {
    color: #2c3e50;
    /* Color oscuro profesional */
    font-weight: 700;
}

/* Toolbar de Acciones unificada */
.actions-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Botones Tool unificados */
.btn-tool {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    /* Más compacto */
    width: auto;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    background-color: #f8f9fa !important;
    /* Asegurar fondo gris claro */
    border: 1px solid #dee2e6 !important;
    color: #555 !important;
    transition: all 0.2s;
    box-shadow: none;
}

.btn-tool:hover {
    background-color: #e2e6ea !important;
    color: #1ab1b8 !important;
    border-color: #1ab1b8 !important;
    /* Borde activo */
    transform: translateY(-1px);
}

.btn-tool.active {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

.btn-tool span.material-symbols-outlined {
    font-size: 16px;
    /* Iconos más pequeños */
}


/* Badges externos */
.external-badges {
    display: flex;
    gap: 5px;
}

/* Ajustes en controles derechos (ya existentes, solo retoques) */
.header-peticion.head_itemBlock .cont-btns {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #f8f9fa;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.header-peticion.head_itemBlock .cont-btns label {
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.contenedor-diagnosticos {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Área con scroll para los resultados */
.scroll-diagnosticos {
    max-height: 65vh;
    /* Ajuste dinámico a altura de pantalla */
    overflow-y: auto;
    padding: 5px;
    background-color: #f8f9fa;
}

.sticky-search-container {
    position: -webkit-sticky;
    position: sticky;
    top: 160px;
    z-index: 1;
    /* Ajustar según posición respecto al sticky header principal */
    align-self: flex-start;
    /* Necesario para que sticky funcione dentro de un flex/grid item alto */
}

.modal-content .sticky-search-container {
    top: 140px;
}

/* Estilo de cada "tarjeta" de diagnóstico */
.diag-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none !important;
    color: inherit;
}

.diag-item:hover {
    border-color: #00a8b0;
    background-color: #f0f7ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Clase para cuando uno está seleccionado (puedes aplicarla dinámicamente) */
.diag-item.seleccionado {
    background-color: #00a8b0;
    border-color: #0056b3;
    color: white;
}

.diag-item.seleccionado .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.badge-especie {
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
}

.content-wrapper>.content>.box>.box-header {
    display: none;
}

.table .btn {
    padding: 6px;
}

@media print {
    body * {
        visibility: hidden;
    }

    .print-content * {
        visibility: visible;
        overflow: visible;
    }

    #mainPage * {
        display: none;
    }


    .modal-dialog {
        visibility: visible !important;
        /**Remove scrollbar for printing.**/
        overflow: visible !important;
    }

    li {
        page-break-after: auto;
    }

    .onPrint {
        display: none;
    }
}


.to-top-fix .contaff {
    position: static;
}

@media (min-width: 992px) {

    /* .comm.to-top-fix{
            width:92%;
            position: relative;
          } */
    .comm.to-top-fix .contaff {

        top: 0px;
        position: absolute;
        width: 100%;
        /* animation: slidebottom 0.3s 0s ease-out forwards; */


    }

    /* @keyframes slidebottom {
            to {
              position: fixed;
              top: 45px;
              max-width:23%;
            }
          } */
}

/* Sticky Header para la tabla de resultados */
.sticky-header-row th {
    position: -webkit-sticky;
    position: sticky;
    top: 50px;
    z-index: 1020;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Sticky para comentarios */
.sticky-header-comm {
    position: -webkit-sticky;
    position: sticky;
    top: 60px;
    /* Ajustar posición vertical */
    z-index: 3;
    align-self: flex-start;
}

.modal-content .sticky-header-comm {
    top: 35px;
}


/* Sticky para el box superior (paciente/acciones) */
.sticky-top-main {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
    width: 100%;
    margin-left: 0;
    margin-right: 0;

}

.modal-content .sticky-top-main {
    top: -28px;
}

.modal-full .modal-content {
    border-radius: 0px;
}

.modal-content .resultados-peticiones {
    margin-left: -3px;
}

.collapse-peticion {
    z-index: 999;
}

.modal-content .callout.callout-white {
    margin-left: -3px;
}

/* Extension Header Sticky */
/* Extension Header Sticky */
.extension-sticky-header {
    position: -webkit-sticky;
    position: sticky;
    top: 112px;
    left: 0;
    z-index: 3;
    width: fit-content;
    min-width: 150px;
    background-color: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e0e0;
    border-left: 5px solid #1ab1b8;
    padding: 2px 10px;
    margin-bottom: 10px !important;
    border-radius: 0 5px 5px 0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.05);
}

.extension-sticky-header .btn {
    padding: 0px 5px;
}

.extension-sticky-header p {
    margin-bottom: 0;
    font-size: 14px !important;
    margin-right: 10px;
}


.modal-content .extension-sticky-header {
    top: 87px;
}

.footer-fixed span.material-symbols-outlined {
    font-size: 1em;
}

@media (min-width: 992px) {
    .footer-fixed {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }
}

@media (max-width: 1399.98px) {

    .modal-fullscreen-xl-down .modal-body,
    .modal-full .modal-body {
        max-height: 94vh !important;
    }
}

.modal-peticion .modal-full .modal-content {
    height: calc(100vh - 60px) !important;
}

/* Bloquear scroll del fondo (body) cuando hay un modal abierto */
body.modal-open {
    overflow: hidden !important;
}

.inner-pet {
    overflow: auto;

}