/* =====================================================
   CONFIGURACIÓN GENERAL DEL MÓDULO
===================================================== */

*{

    box-sizing: border-box;

}


body.body-modulo{

    min-height: 100vh;
    margin: 0;

    color: #18233a;
    background: #f4f7fb;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

}


/* =====================================================
   ENCABEZADO
===================================================== */

.encabezado-agenda{

    display: flex;
    align-items: center;

    min-height: 64px;
    margin-left: 72px;
    padding: 0 24px;

    color: var(--bio-texto-claro);
    background: var(--bio-fondo-principal);

}


.encabezado-agenda h1{

    margin: 0;

    font-size: 26px;
    font-weight: 500;

}


/* =====================================================
   CONTENIDO PRINCIPAL
===================================================== */

.contenido-agenda{

    margin-left: 72px;
    padding: 20px 24px 32px;

}


/*
    Panel temporal.

    Después será reemplazado por la tabla de solicitudes
    y el panel lateral de notas.
*/
.panel-inicial-agenda{

    min-height: 400px;
    padding: 24px;

    background: #ffffff;

    border: 1px solid #d6deea;
    border-radius: 12px;

}


.panel-inicial-agenda h2{

    margin-top: 0;
    margin-bottom: 10px;

    font-size: 22px;
    font-weight: 600;

}


.panel-inicial-agenda p{

    margin: 0;

    color: #64748b;
    font-size: 15px;

}


/* =====================================================
   ADAPTACIÓN PARA PANTALLAS PEQUEÑAS
===================================================== */

@media(max-width: 700px){

    .encabezado-agenda{

        padding-right: 16px;
        padding-left: 16px;

    }


    .encabezado-agenda h1{

        font-size: 21px;

    }


    .contenido-agenda{

        padding:
            16px
            14px
            24px;

    }

}

/* =====================================================
   DISTRIBUCIÓN PRINCIPAL
===================================================== */

.distribucion-agenda{

    display: grid;

    /*
        Solicitudes ocupa aproximadamente 3/4.
        Notas ocupa aproximadamente 1/4.
    */
    grid-template-columns:
        minmax(0, 3fr)
        minmax(280px, 1fr);

    gap: 6px;
    align-items: stretch;

}


/* =====================================================
   AVISO DE RECORDATORIOS
===================================================== */

.aviso-recordatorios-agenda{

    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 16px;
    padding: 11px 14px;

    color: #24405e;
    background: #edf7fc;

    border-left: 4px solid var(--bio-acento);
    border-radius: 9px;

}


.aviso-recordatorios-agenda p{

    margin: 0;

}


.aviso-recordatorios-agenda
.btn-enlace-agenda{

    margin-left: auto;

}


/* =====================================================
   PANEL DE SOLICITUDES
===================================================== */

.panel-solicitudes{

    min-width: 0;
    padding: 18px;

    background: #ffffff;

    border: 1px solid #d6deea;
    border-radius: 12px;

}


.encabezado-panel-solicitudes{

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;

}


.encabezado-panel-solicitudes h2{

    margin: 0 0 5px;

    font-size: 21px;
    font-weight: 600;

}


.encabezado-panel-solicitudes p{

    margin: 0;

    color: #64748b;
    font-size: 13px;

}


/* =====================================================
   BOTONES GENERALES
===================================================== */

.btn-principal-agenda{

    min-height: 42px;
    padding: 0 16px;

    color: #ffffff;
    background: var(--bio-acento);

    border: 0;
    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    white-space: nowrap;

}


.btn-principal-agenda:hover{

    background: #237db1;

}


.btn-principal-agenda:focus-visible,
.btn-orden-solicitudes:focus-visible,
.btn-enlace-agenda:focus-visible{

    outline: 3px solid
        rgba(
            var(--bio-acento-rgb),
            0.25
        );

    outline-offset: 2px;

}


.btn-enlace-agenda{

    padding: 5px;

    color: #267ba9;
    background: transparent;

    border: 0;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

}


/* =====================================================
   FILTROS DE SOLICITUDES
===================================================== */

.controles-solicitudes{

    display: grid;

    grid-template-columns:
        minmax(160px, 0.8fr)
        minmax(190px, 1fr)
        auto;

    gap: 10px;
    align-items: end;

    margin-bottom: 16px;

}


.campo-control-agenda{

    display: flex;
    flex-direction: column;
    gap: 7px;

}


.campo-control-agenda label{

    color: #64748b;

    font-size: 13px;
    font-weight: 600;

}


.campo-control-agenda input,
.campo-control-agenda select{

    width: 100%;
    min-height: 42px;
    padding: 9px 12px;

    color: #18233a;
    background: #ffffff;

    border: 1px solid #d6deea;
    border-radius: 9px;

    font-size: 14px;

}


.campo-control-agenda input:focus,
.campo-control-agenda select:focus{

    border-color: var(--bio-acento);

    outline: 3px solid
        rgba(
            var(--bio-acento-rgb),
            0.15
        );

}


.btn-orden-solicitudes{

    min-height: 42px;
    padding: 0 14px;

    color: #253653;
    background: #edf2f8;

    border: 1px solid #d6deea;
    border-radius: 9px;

    font-weight: 600;

    cursor: pointer;

}


/* =====================================================
   TABLA DE SOLICITUDES
===================================================== */

.contenedor-tabla-solicitudes{

    width: 100%;
    overflow-x: auto;

}


.tabla-solicitudes{

    width: 100%;
    min-width: 760px;

    border-collapse: collapse;

}


.tabla-solicitudes th{

    padding: 11px 10px;

    color: #5b6880;
    background: #f2f5f9;

    border-bottom: 1px solid #d6deea;

    font-size: 12px;
    font-weight: 600;
    text-align: left;

}


.tabla-solicitudes td{

    padding: 13px 10px;

    border-bottom: 1px solid #e5eaf1;

    font-size: 13px;
    vertical-align: middle;

}


.mensaje-solicitudes-vacias{

    margin: 0;
    padding: 34px 16px;

    color: #64748b;

    text-align: center;

}


/* =====================================================
   SECUENCIA VISUAL DE CADA SOLICITUD
===================================================== */

.proceso-solicitud{

    display: flex;
    align-items: center;

    min-width: 340px;

}


.etapa-solicitud{

    min-width: 88px;
    min-height: 34px;
    margin-right: -7px;
    padding: 0 14px 0 18px;

    color: #64748b;
    background: #dce3ed;

    border: 0;

    /*
        Construye la forma de flecha
        sin utilizar imágenes externas.
    */
    clip-path:
        polygon(
            0 0,
            86% 0,
            100% 50%,
            86% 100%,
            0 100%,
            14% 50%
        );

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

}


.etapa-solicitud:first-child{

    padding-left: 12px;

    clip-path:
        polygon(
            0 0,
            86% 0,
            100% 50%,
            86% 100%,
            0 100%
        );

}


/* Etapa que ya fue completada */
.etapa-solicitud.completada{

    color: #082638;

    background:
        linear-gradient(
            90deg,
            var(--bio-acento),
            #63d3eb
        );

}


/* =====================================================
   PIE DEL PANEL
===================================================== */

.pie-panel-solicitudes{

    display: flex;
    justify-content: flex-end;

    padding-top: 14px;

}


/* =====================================================
   ADAPTACIÓN DE LA DISTRIBUCIÓN
===================================================== */

@media(max-width: 1050px){

    .distribucion-agenda{

        grid-template-columns: 1fr;

    }

}


@media(max-width: 700px){

    .encabezado-panel-solicitudes{

        align-items: stretch;
        flex-direction: column;

    }


    .controles-solicitudes{

        grid-template-columns: 1fr;

    }


    .btn-principal-agenda,
    .btn-orden-solicitudes{

        width: 100%;

    }

}

/* =====================================================
   PANEL DE NOTAS
===================================================== */

.panel-notas-agenda{

    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 620px;

    background: #ffffff;

    border: 1px solid #d6deea;
    border-radius: 12px;

    overflow: hidden;

}


/* =====================================================
   ENCABEZADO DEL PANEL DE NOTAS
===================================================== */

.encabezado-panel-notas{

    padding: 14px;

    background: #f7f3e5;

    border-bottom: 1px solid #e8dfc3;

}


.titulo-panel-notas{

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 12px;

}


.titulo-panel-notas h2{

    margin: 0;

    font-size: 19px;
    font-weight: 600;

}


/* =====================================================
   BLOC PARA CREAR UNA NOTA
===================================================== */

.bloc-nueva-nota{

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    padding: 12px 13px;

    color: #4c401c;
    background: #f5cf63;

    border: 0;
    border-radius: 9px;

    text-align: left;

    box-shadow:
        0 6px 12px
        rgba(
            88,
            68,
            14,
            0.14
        );

    cursor: pointer;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease;

}


.bloc-nueva-nota:hover{

    transform:
        translateY(-2px)
        rotate(-1deg);

    box-shadow:
        0 9px 16px
        rgba(
            88,
            68,
            14,
            0.18
        );

}


.bloc-nueva-nota:focus-visible{

    outline: 3px solid
        rgba(
            var(--bio-acento-rgb),
            0.28
        );

    outline-offset: 2px;

}


.bloc-nueva-nota strong,
.bloc-nueva-nota small{

    display: block;

}


.bloc-nueva-nota strong{

    margin-bottom: 3px;

    font-size: 14px;

}


.bloc-nueva-nota small{

    color: #756125;

    font-size: 11px;

}


.simbolo-nueva-nota{

    font-size: 24px;
    font-weight: 400;

}


/* =====================================================
   NOTAS DESTACADAS
===================================================== */

.seccion-notas-destacadas{

    padding: 12px;

    border-bottom: 1px solid #dce3ec;

}


.encabezado-notas-destacadas{

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 9px;

    color: #64748b;

    font-size: 12px;
    font-weight: 600;

}


.rejilla-notas-destacadas{

    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 7px;

}


/*
    Los seis espacios siempre permanecen visibles,
    aunque todavía no tengan una nota.
*/
.espacio-nota-destacada{

    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 0;
    min-height: 76px;
    padding: 5px;

    color: #9aa7b9;
    background: #f8fafc;

    border: 1px dashed #c6d0de;
    border-radius: 8px;

    font-size: 11px;

    transition:
        transform 160ms ease,
        border-color 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;

}


/*
    Todos los espacios se iluminarán cuando
    el usuario arrastre una nota hacia esta zona.
*/
.espacio-nota-destacada.zona-disponible{

    background: #edf8fc;
    border-color: #70bfdf;

}


/*
    Este será el espacio exacto sobre el cual
    el usuario está sosteniendo la nota.
*/
.espacio-nota-destacada.zona-seleccionada{

    transform: translateY(-4px);

    color: #1f6f98;
    background: #d9f3fb;

    border-color: var(--bio-acento);

    box-shadow:
        0 7px 15px
        rgba(
            var(--bio-acento-rgb),
            0.18
        );

}


/* Tarjeta pequeña que ocupará un espacio destacado */
.tarjeta-nota-destacada{

    position: relative;
    z-index: 1;

    width: 100%;
    min-height: 64px;
    padding: 7px;

    color: #493f1e;
    background: #fff0a9;

    border-radius: 7px;

    cursor: grab;
    overflow: hidden;

    transition:
        transform 180ms ease,
        box-shadow 180ms ease;

}


.tarjeta-nota-destacada:hover{

    z-index: 5;

    transform: scale(1.1);

    box-shadow:
        0 8px 20px
        rgba(
            45,
            51,
            66,
            0.20
        );

}


.tarjeta-nota-destacada strong{

    display: block;

    font-size: 11px;
    font-weight: 600;

}


.tarjeta-nota-destacada small{

    display: block;

    margin-top: 4px;

    font-size: 10px;

}


/* =====================================================
   ESPACIO DE NOTAS ACTIVAS
===================================================== */

.contenedor-notas-activas{

    position: relative;

    flex: 1;

    min-height: 280px;

    overflow: hidden;

    /*
        Cuadrícula suave ubicada detrás
        de las notas que estarán circulando.
    */
    background:
        linear-gradient(
            #edf2f7 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            #edf2f7 1px,
            transparent 1px
        ),
        #fbfcfe;

    background-size:
        26px
        26px;

}


/*
    Crea una desaparición suave en la parte
    superior e inferior del recorrido.
*/
.contenedor-notas-activas::before,
.contenedor-notas-activas::after{

    content: "";

    position: absolute;
    right: 0;
    left: 0;

    z-index: 3;

    height: 35px;

    pointer-events: none;

}


.contenedor-notas-activas::before{

    top: 0;

    background:
        linear-gradient(
            #fbfcfe,
            transparent
        );

}


.contenedor-notas-activas::after{

    bottom: 0;

    background:
        linear-gradient(
            transparent,
            #fbfcfe
        );

}


/*
    notasAgenda.js llenará este recorrido
    con las notas activas.
*/
.recorrido-notas-activas{

    position: absolute;

    /*
        El recorrido comienza dentro del panel.
        Las copias calculadas por JavaScript evitan
        que aparezcan espacios vacíos.
    */
    top: 0;
    right: 9px;
    left: 9px;

    display: grid;
    gap: 16px;

}


/* Se activa únicamente cuando existen notas */
.recorrido-notas-activas.en-movimiento{

    /*
        JavaScript calcula la duración según la altura
        real del grupo de notas.
    */
    animation:
        mover-notas-agenda
        var(--duracion-recorrido-notas, 28s)
        linear
        infinite;

}


/*
    Cuando el usuario coloca el mouse sobre las notas,
    la animación se detiene para facilitar la lectura.
*/
.contenedor-notas-activas:hover
.recorrido-notas-activas{

    animation-play-state: paused;

}


@keyframes mover-notas-agenda{

    from{

        transform:
            translateY(0);

    }

    to{

        /*
            Se desplaza exactamente la altura de un grupo.
            La copia siguiente ocupa su lugar sin saltos.
        */
        transform:
            translateY(
                var(
                    --desplazamiento-recorrido-notas,
                    -720px
                )
            );

    }

}


/* =====================================================
   TARJETAS DE NOTAS ACTIVAS
===================================================== */

.tarjeta-nota-activa{

    width: 92%;
    margin: 0 auto;
    padding: 10px;

    color: #27344b;
    background: #ffedaa;

    border-radius: 9px;

    box-shadow:
        0 7px 16px
        rgba(
            30,
            43,
            67,
            0.14
        );

    cursor: grab;

}


.tarjeta-nota-activa h3{

    margin: 0 0 5px;

    font-size: 14px;
    font-weight: 600;

}


.tarjeta-nota-activa p{

    margin: 0 0 8px;

    color: #4b5669;

    font-size: 12px;

}


.informacion-nota-activa{

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;

    font-size: 10px;

}


/* Colores aprobados para las cuatro etiquetas */
.nota-urgente{

    background: #f8cdd2;

}


.nota-pendiente{

    background: #ffedaa;

}


.nota-seguimiento{

    background: #ddd8f4;

}


.nota-informativa{

    background: #caedf6;

}


/* =====================================================
   MENSAJE SIN NOTAS
===================================================== */

.mensaje-notas-vacias{

    position: absolute;

    top: 50%;
    left: 50%;

    width: calc(100% - 30px);
    margin: 0;

    color: #64748b;

    text-align: center;

    transform:
        translate(
            -50%,
            -50%
        );

}


/* =====================================================
   PIE DEL PANEL DE NOTAS
===================================================== */

.pie-panel-notas{

    display: flex;
    justify-content: flex-end;

    padding: 8px 10px;

    background: #f4f7fb;

    border-top: 1px solid #dce3ec;

}


/* =====================================================
   PANEL DE NOTAS EN PANTALLAS PEQUEÑAS
===================================================== */

@media(max-width: 1050px){

    .panel-notas-agenda{

        min-height: 600px;

    }

}


@media(max-width: 420px){

    .rejilla-notas-destacadas{

        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

    }

}

/* =====================================================
   OCUPAR TODA LA ALTURA DISPONIBLE
===================================================== */

.contenido-agenda{

    /*
        La pantalla completa mide 100vh.

        Restamos los 64px correspondientes
        al encabezado superior.
    */
    min-height:
        calc(
            100vh - 64px
        );

    display: flex;
    flex-direction: column;

}


/*
    La distribución crece hasta ocupar todo
    el espacio disponible dentro del contenido.
*/
.distribucion-agenda{

    flex: 1;

}


/*
    Restamos:

    - 64px del encabezado.
    - 20px del espacio superior.
    - 32px del espacio inferior.
*/
.panel-solicitudes,
.panel-notas-agenda{

    min-height:
        calc(
            100vh - 116px
        );

}

/* =====================================================
   ENCABEZADO FIJO DEL MÓDULO
===================================================== */

.encabezado-agenda{

    position: fixed;

    top: 0;
    right: 0;
    left: 72px;

    z-index: 20;

    /*
        Se elimina el margen anterior porque
        la posición izquierda ya respeta el dashboard.
    */
    margin-left: 0;

}


/*
    Como el encabezado está fijo, deja de ocupar
    espacio dentro del documento.

    Por eso reservamos arriba sus 64px más
    los 20px de separación del contenido.
*/
.contenido-agenda{

    /*
        Reserva el espacio del encabezado fijo
        más la separación superior.
    */
    padding-top: 84px;

}

/* =====================================================
   AJUSTE EXACTO A LA PANTALLA DE ESCRITORIO
===================================================== */

@media(min-width: 1051px){

    /*
        Evita que toda la página produzca desplazamiento
        cuando los dos paneles caben en la pantalla.
    */
    body.body-modulo{

        height: 100vh;

        overflow: hidden;

    }


    /*
        El contenido ocupa exactamente la altura
        disponible de la ventana.
    */
    .contenido-agenda{

        height: 100vh;
        min-height: 0;

        /*
            Reduce el espacio inferior de 32px
            a aproximadamente una tercera parte.
        */
        padding-bottom: 10px;

        overflow: hidden;

    }


    /*
        La distribución utiliza solamente el espacio
        restante debajo del encabezado fijo.
    */
    .distribucion-agenda{

        flex: 1;

        min-height: 0;

        overflow: hidden;

    }


    /*
        Los paneles se estiran dentro de la distribución,
        pero no obligan a crecer a toda la página.
    */
    .panel-solicitudes,
    .panel-notas-agenda{

        min-height: 0;

    }


    /*
        Convierte el panel izquierdo en una columna.

        De esta manera, si existen muchas solicitudes,
        solamente se desplazará el contenido de la tabla.
    */
    .panel-solicitudes{

        display: flex;
        flex-direction: column;

    }


    .contenedor-tabla-solicitudes{

        flex: 1;

        min-height: 0;

        overflow: auto;

    }

}

/* =====================================================
   INFORMACIÓN INTERNA DE LAS SOLICITUDES
===================================================== */

.informacion-repuesto-solicitud strong,
.informacion-repuesto-solicitud small,
.informacion-equipo-solicitud span,
.informacion-equipo-solicitud small{

    display: block;

}


.informacion-repuesto-solicitud strong{

    margin-bottom: 4px;

    font-weight: 600;

}


.informacion-repuesto-solicitud small,
.informacion-equipo-solicitud small{

    margin-top: 4px;

    color: #64748b;

    font-size: 11px;

}


.codigo-solicitud{

    color: #267ba9;

    font-weight: 600;
    white-space: nowrap;

}


/* =====================================================
   ACCIONES DE LAS SOLICITUDES
===================================================== */

.acciones-solicitud{

    display: flex;
    align-items: center;
    gap: 5px;

}


.btn-accion-solicitud{

    padding: 6px 7px;

    color: #267ba9;
    background: transparent;

    border: 0;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

}


.btn-accion-solicitud:hover{

    text-decoration: underline;

}


.accion-cancelar-solicitud{

    color: #bd4b59;

}


/* =====================================================
   CONTENIDO DE LAS NOTAS DESTACADAS
===================================================== */

.contenido-nota-destacada{

    display: none;

    margin: 6px 0 0;

    color: #554a29;

    font-size: 10px;

}


/*
    Al colocar el mouse sobre una destacada,
    aumenta su tamaño y muestra el contenido.
*/
.tarjeta-nota-destacada:hover
.contenido-nota-destacada{

    display: block;

}


/* =====================================================
   ENCABEZADO DE LAS NOTAS ACTIVAS
===================================================== */

.encabezado-tarjeta-nota{

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;

}


.encabezado-tarjeta-nota h3{

    flex: 1;

}


/*
    El símbolo aparece cuando el usuario
    coloca el mouse sobre la nota.
*/
.btn-destacar-nota{

    flex: 0 0 auto;

    width: 28px;
    height: 28px;
    padding: 0;

    color: #46536a;
    background: transparent;

    border: 0;
    border-radius: 6px;

    font-size: 18px;

    cursor: grab;

    opacity: 0;

    transition:
        opacity 150ms ease,
        background 150ms ease;

}


.tarjeta-nota-activa:hover
.btn-destacar-nota,
.btn-destacar-nota:focus-visible{

    opacity: 1;

}


.btn-destacar-nota:hover{

    background:
        rgba(
            255,
            255,
            255,
            0.48
        );

}


/*
    Las copias mantienen continuo el recorrido,
    pero conservan las mismas interacciones
    de la tarjeta original.
*/
.copia-visual-nota{

    pointer-events: auto;

}


/*
    En dispositivos táctiles no existe hover,
    por eso el botón de destacar permanece visible.
*/
@media(pointer: coarse){

    .btn-destacar-nota{

        width: 42px;
        height: 42px;

        opacity: 1;

    }

}

/* =====================================================
   FONDO DE LOS MODALES
===================================================== */

.fondo-modal-agenda{

    position: fixed;
    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(
            15,
            23,
            42,
            0.72
        );

}


/*
    Garantiza que el atributo hidden
    siempre oculte completamente el modal.
*/
.fondo-modal-agenda[hidden]{

    display: none;

}


/* =====================================================
   VENTANA DEL MODAL
===================================================== */

.ventana-modal-agenda{

    width: min(
        720px,
        100%
    );

    max-height:
        calc(
            100vh - 40px
        );

    overflow-y: auto;

    color: #18233a;
    background: #ffffff;

    border-radius: 14px;

    box-shadow:
        0 22px 55px
        rgba(
            8,
            18,
            35,
            0.32
        );

}


/* =====================================================
   ENCABEZADO DEL MODAL
===================================================== */

.encabezado-modal-agenda{

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 18px 20px;

    color: var(--bio-texto-claro);
    background: var(--bio-fondo-principal);

}


.encabezado-modal-agenda h2{

    margin: 5px 0;

    font-size: 21px;
    font-weight: 600;

}


.encabezado-modal-agenda p{

    margin: 0;

    color: var(--bio-texto-suave);

    font-size: 13px;

}


.etiqueta-modal-agenda{

    color: #66d3ec;

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.07em;

}


.btn-cerrar-modal-agenda{

    flex: 0 0 auto;

    width: 36px;
    height: 36px;
    padding: 0;

    color: var(--bio-texto-claro);
    background: transparent;

    border: 0;
    border-radius: 8px;

    font-size: 24px;

    cursor: pointer;

}


.btn-cerrar-modal-agenda:hover{

    background:
        rgba(
            255,
            255,
            255,
            0.10
        );

}


/* =====================================================
   FORMULARIO
===================================================== */

.formulario-agenda{

    padding: 20px;

}


.rejilla-formulario-agenda{

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 14px;

}


.campo-formulario-agenda{

    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 0;

}


.campo-completo-agenda{

    grid-column:
        1 / -1;

}


.campo-formulario-agenda label{

    color: #526079;

    font-size: 13px;
    font-weight: 600;

}


.campo-formulario-agenda label span{

    color: #8490a3;

    font-weight: 400;

}


.campo-formulario-agenda input,
.campo-formulario-agenda select,
.campo-formulario-agenda textarea{

    width: 100%;
    padding: 10px 12px;

    color: #18233a;
    background: #ffffff;

    border: 1px solid #d2dbe7;
    border-radius: 9px;

    font-size: 14px;

}


.campo-formulario-agenda input,
.campo-formulario-agenda select{

    min-height: 42px;

}


.campo-formulario-agenda textarea{

    resize: vertical;

}


.campo-formulario-agenda input:focus,
.campo-formulario-agenda select:focus,
.campo-formulario-agenda textarea:focus{

    border-color: var(--bio-acento);

    outline: 3px solid
        rgba(
            var(--bio-acento-rgb),
            0.14
        );

}


/* =====================================================
   MENSAJE Y ACCIONES DEL FORMULARIO
===================================================== */

.mensaje-formulario-agenda{

    margin: 16px 0 0;
    padding: 10px 12px;

    color: #33445e;
    background: #edf4fa;

    border-left: 4px solid var(--bio-acento);
    border-radius: 7px;

}


.acciones-formulario-agenda{

    display: flex;
    justify-content: flex-end;
    gap: 9px;

    margin-top: 20px;

}


.btn-secundario-agenda{

    min-height: 42px;
    padding: 0 16px;

    color: #33445e;
    background: #edf2f8;

    border: 1px solid #d2dbe7;
    border-radius: 9px;

    font-weight: 600;

    cursor: pointer;

}


.btn-secundario-agenda:hover{

    background: #e2e9f2;

}


/* =====================================================
   FORMULARIO EN CELULARES
===================================================== */

/* =====================================================
   CONFIRMACIÓN DE RECEPCIÓN
===================================================== */

/*
    Reduce el tamaño del modal porque solamente
    contiene una decisión corta.
*/
.ventana-confirmacion-agenda{

    width: min(
        470px,
        100%
    );

}


/*
    Separa el mensaje de confirmación
    del encabezado del modal.
*/
.contenido-confirmacion-agenda{

    padding: 20px;

}


/*
    Advierte que la solicitud dejará
    de aparecer en la tabla activa.
*/
.advertencia-confirmacion-agenda{

    margin: 0;
    padding: 14px 16px;

    color: #8a3030;
    background: #fff1f1;

    border-left:
        4px solid
        #cf4d4d;

    border-radius: 9px;

    font-size: 14px;
    line-height: 1.5;

}



@media(max-width: 600px){

    .fondo-modal-agenda{

        padding: 10px;

    }


    .ventana-modal-agenda{

        max-height:
            calc(
                100vh - 20px
            );

    }


    .rejilla-formulario-agenda{

        grid-template-columns: 1fr;

    }


    .campo-completo-agenda{

        grid-column: auto;

    }


    .acciones-formulario-agenda{

        flex-direction: column-reverse;

    }


    .acciones-formulario-agenda button{

        width: 100%;

    }

}

/* =====================================================
   AVISO GENERAL DEL MÓDULO
===================================================== */

.aviso-operacion-agenda{

    position: fixed;

    right: 22px;
    bottom: 20px;

    z-index: 900;

    display: flex;
    align-items: flex-start;
    gap: 14px;

    width: min(
        360px,
        calc(
            100% - 32px
        )
    );

    padding: 13px 14px;

    color: var(--bio-texto-claro);
    background: var(--bio-fondo-secundario);

    border-left: 4px solid var(--bio-acento);
    border-radius: 9px;

    box-shadow:
        0 12px 30px
        rgba(
            8,
            18,
            35,
            0.28
        );

}


/* Mantiene oculto el aviso cuando corresponde */
.aviso-operacion-agenda[hidden]{

    display: none;

}


/* Resultado correcto */
.aviso-operacion-agenda.aviso-exito-agenda{

    border-left-color: #3ba982;

}


/* Error o acción que no está permitida */
.aviso-operacion-agenda.aviso-error-agenda{

    border-left-color: #d85a68;

}


#texto-aviso-operacion-agenda{

    flex: 1;

    line-height: 1.4;

}


.btn-cerrar-aviso-operacion-agenda{

    flex: 0 0 auto;

    width: 26px;
    height: 26px;
    padding: 0;

    color: var(--bio-texto-claro);
    background: transparent;

    border: 0;
    border-radius: 6px;

    font-size: 20px;

    cursor: pointer;

}


.btn-cerrar-aviso-operacion-agenda:hover{

    background:
        rgba(
            255,
            255,
            255,
            0.10
        );

}


@media(max-width: 500px){

    .aviso-operacion-agenda{

        right: 16px;
        bottom: 16px;

    }

}

/* Ventana un poco más compacta para las notas */
.ventana-nota-agenda{

    width: min(
        580px,
        100%
    );

}

/* =====================================================
   ACCIÓN REVERSIBLE: ARCHIVAR NOTA
===================================================== */

.acciones-tarjeta-nota{

    display: flex;

    align-items: center;

    gap: 2px;

}


.btn-archivar-nota{

    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    padding: 0;

    color: #596579;

    background: transparent;

    border: 0;

    border-radius: 6px;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity 160ms ease,
        background 160ms ease,
        color 160ms ease;

}


/*
    En las tarjetas que circulan, la acción aparece
    junto al control de destacar al pasar el mouse.
*/
.tarjeta-nota-activa:hover
.btn-archivar-nota,

.tarjeta-nota-activa
.btn-archivar-nota:focus-visible{

    opacity: 1;

}


.btn-archivar-nota:hover{

    color: #306a4a;

    background:
        rgba(
            255,
            255,
            255,
            0.56
        );

}


/*
    En Destacadas se ubica en la esquina para no ocupar
    espacio del título ni del contenido pequeño.
*/
.tarjeta-nota-destacada
.btn-archivar-nota{

    position: absolute;

    top: 3px;
    right: 3px;

    width: 22px;
    height: 22px;

    font-size: 12px;

}


.tarjeta-nota-destacada:hover
.btn-archivar-nota,

.tarjeta-nota-destacada
.btn-archivar-nota:focus-visible{

    opacity: 1;

}


/*
    Evita que un título extenso quede debajo del botón
    cuando la tarjeta está en formato destacado.
*/
.tarjeta-nota-destacada
strong{

    padding-right: 18px;

}


/*
    En pantallas táctiles los controles siempre deben
    permanecer visibles y ser fáciles de pulsar.
*/
@media(pointer: coarse){

    .btn-archivar-nota{

        width: 42px;
        height: 42px;

        opacity: 1;

    }


    .tarjeta-nota-destacada
    .btn-archivar-nota{

        top: 2px;
        right: 2px;

        width: 28px;
        height: 28px;

        font-size: 14px;

    }

}

/* =====================================================
   HISTORIAL DE NOTAS ARCHIVADAS
===================================================== */

.ventana-notas-archivadas{

    width: min(
        920px,
        calc(100vw - 40px)
    );

    max-height: min(
        78vh,
        760px
    );

    display: flex;

    flex-direction: column;

}


.lista-notas-archivadas{

    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(230px, 1fr)
        );

    gap: 14px;

    overflow-y: auto;

    padding: 4px 3px 12px;

}


.tarjeta-nota-archivada{

    display: flex;

    flex-direction: column;

    min-height: 170px;

    padding: 15px;

    color: #334158;

    background: #fffdf3;

    border: 1px solid #e4dfc8;

    border-radius: 10px;

    box-shadow:
        0 6px 15px
        rgba(
            30,
            43,
            67,
            0.08
        );

}


.tarjeta-nota-archivada h3{

    margin: 0 0 8px;

    font-size: 15px;

}


.tarjeta-nota-archivada p{

    flex: 1;

    margin: 0 0 12px;

    color: #596579;

    font-size: 13px;

    line-height: 1.45;

}


.tarjeta-nota-archivada small{

    margin-bottom: 12px;

    color: #778297;

    font-size: 11px;

}


.btn-restaurar-nota{

    align-self: flex-start;

    padding: 7px 10px;

    color: #35634b;

    background: #edf7ef;

    border: 1px solid #a9d3b2;

    border-radius: 6px;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 160ms ease,
        transform 160ms ease;

}


.btn-restaurar-nota:hover{

    background: #dff1e3;

    transform: translateY(-1px);

}


.mensaje-lista-vacia-agenda{

    margin: 16px 0 4px;

    color: #778297;

    text-align: center;

}


@media(max-width: 640px){

    .ventana-notas-archivadas{

        width: calc(100vw - 24px);

        max-height: 84vh;

    }


    .lista-notas-archivadas{

        grid-template-columns: 1fr;

    }

}

/* =====================================================
   ACCIÓN IRREVERSIBLE: ELIMINAR NOTA ARCHIVADA
===================================================== */

.btn-peligro-agenda{

    padding: 9px 13px;

    color: #ffffff;

    background: #b94a4a;

    border: 1px solid #9e3939;

    border-radius: 7px;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 160ms ease,
        transform 160ms ease;

}


.btn-peligro-agenda:hover{

    background: #a63d3d;

    transform: translateY(-1px);

}


.btn-peligro-agenda:focus-visible{

    outline: 3px solid rgba(185, 74, 74, 0.28);

    outline-offset: 2px;

}

/* Acciones de cada tarjeta archivada */

.acciones-nota-archivada{

    display: flex;

    align-items: center;

    gap: 8px;

}


.btn-eliminar-nota{

    padding: 7px 10px;

    color: #8f3b3b;

    background: #fff2f2;

    border: 1px solid #e4bbbb;

    border-radius: 6px;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 160ms ease,
        transform 160ms ease;

}


.btn-eliminar-nota:hover{

    background: #ffe3e3;

    transform: translateY(-1px);

}

/* =====================================================
   ESPACIADO DE LOS MODALES DE CONFIRMACIÓN
===================================================== */

/*
    El encabezado ya tiene su propio espacio interno.
    Estas reglas dan el mismo aire al aviso y a los
    botones, evitando que toquen los bordes del modal.
*/
.ventana-confirmacion-agenda
.advertencia-confirmacion-agenda{

    margin: 20px 20px 0;

}


.ventana-confirmacion-agenda
.acciones-formulario-agenda{

    margin-top: 20px;

    padding: 0 20px 20px;

}

/* =====================================================
   ACCIÓN: EDITAR NOTA
===================================================== */

.btn-editar-nota{

    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    padding: 0;

    color: #465f7a;

    background: transparent;

    border: 0;

    border-radius: 6px;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    opacity: 0;

    transition:
        opacity 160ms ease,
        background 160ms ease,
        color 160ms ease;

}


.tarjeta-nota-activa:hover
.btn-editar-nota,

.tarjeta-nota-activa
.btn-editar-nota:focus-visible{

    opacity: 1;

}


.btn-editar-nota:hover{

    color: #235f93;

    background:
        rgba(
            255,
            255,
            255,
            0.56
        );

}


/*
    En Destacadas, Editar queda a la izquierda de
    Archivar, ambos en la esquina superior derecha.
*/
.tarjeta-nota-destacada
.btn-editar-nota{

    position: absolute;

    top: 3px;
    right: 27px;

    width: 22px;
    height: 22px;

    font-size: 13px;

}


.tarjeta-nota-destacada:hover
.btn-editar-nota,

.tarjeta-nota-destacada
.btn-editar-nota:focus-visible{

    opacity: 1;

}


/*
    Ahora hay dos controles en esa esquina.
*/
.tarjeta-nota-destacada
strong{

    padding-right: 40px;

}


@media(pointer: coarse){

    .btn-editar-nota{

        width: 42px;
        height: 42px;

        opacity: 1;

    }


    .tarjeta-nota-destacada
    .btn-editar-nota{

        top: 2px;
        right: 31px;

        width: 28px;
        height: 28px;

        font-size: 15px;

    }

}

/* =====================================================
   CONSULTA DE SOLICITUDES FINALIZADAS
===================================================== */

.ventana-solicitudes-finalizadas{

    display: flex;
    flex-direction: column;

    width: min(1280px, 100%);

    overflow: hidden;

}

.ventana-solicitudes-finalizadas
> .encabezado-modal-agenda{

    flex-shrink: 0;

}

.contenido-solicitudes-finalizadas{

    min-height: 0;
    padding: 16px 20px 20px;

    overflow: auto;

}

.tabla-solicitudes-finalizadas{

    min-width: 1000px;

}

.tabla-solicitudes-finalizadas td{

    overflow-wrap: anywhere;

}

/* Confirmación situada por encima de Finalizadas. */
#modal-confirmar-eliminar-solicitud{
    z-index: 1001;
}

/* Evita que los avisos queden detrás de los modales. */
#aviso-operacion-agenda{
    z-index: 1002;
}

/* =====================================================
   VISIBILIDAD Y ESPACIO DEL AVISO DE RECORDATORIOS
===================================================== */

.aviso-recordatorios-agenda[hidden]{
    display: none;
}

.aviso-recordatorios-agenda{
    flex-shrink: 0;
    flex-wrap: wrap;
}

.aviso-recordatorios-agenda p{
    flex: 1 1 200px;
    min-width: 0;
}

.aviso-recordatorios-agenda .btn-enlace-agenda{
    flex-shrink: 0;
}

/* =====================================================
   REEMPLAZO DE UNA NOTA DESTACADA
===================================================== */

.ventana-reemplazo-destacada{
    display: flex;
    flex-direction: column;

    width: min(1440px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);

    overflow: hidden;
}

.ventana-reemplazo-destacada > .encabezado-modal-agenda,
.ventana-reemplazo-destacada > .acciones-formulario-agenda{
    flex-shrink: 0;
}


/* Dos paneles: destacadas actuales y nota entrante */

.contenido-reemplazo-destacada{
    display: grid;
    grid-template-columns:
        minmax(0, 3fr)
        minmax(260px, 1fr);

    flex: 1 1 auto;
    min-height: 0;

    gap: 24px;
    padding: 20px;

    overflow: auto;
    overscroll-behavior: contain;
}

.panel-actuales-reemplazo,
.panel-entrante-reemplazo{
    min-width: 0;
}

.panel-actuales-reemplazo > h3,
.panel-entrante-reemplazo > h3{
    margin: 0 0 6px;

    color: #253f5c;
    font-size: 17px;
}

.panel-actuales-reemplazo > p,
.panel-entrante-reemplazo > p{
    margin: 0 0 16px;

    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.panel-entrante-reemplazo{
    align-self: start;
    padding: 16px;

    background: #f5f9fd;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
}


/* Las seis notas conservan el orden de sus posiciones */

.lista-notas-reemplazo-destacada{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 14px;
    align-items: stretch;
}

.nota-entrante-reemplazo-destacada{
    display: grid;
    gap: 12px;
}


/* Tarjetas completas, sin recortar el contenido */

.tarjeta-reemplazo-nota{
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 200px;

    gap: 10px;
    padding: 14px;

    color: #18233a;

    border: 2px solid transparent;
    border-radius: 12px;

    overflow-wrap: anywhere;

    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.tarjeta-reemplazo-nota h4{
    margin: 0;

    font-size: 15px;
    line-height: 1.4;
}

.posicion-tarjeta-reemplazo{
    align-self: flex-start;
    padding: 3px 8px;

    background: rgba(255, 255, 255, 0.65);
    border-radius: 20px;

    font-size: 11px;
    font-weight: 700;
}

.informacion-tarjeta-reemplazo{
    margin: 0;

    font-size: 12px;
    line-height: 1.5;
}

.contenido-tarjeta-reemplazo{
    margin: 0;

    font-size: 13px;
    line-height: 1.6;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tarjeta-reemplazo-nota.seleccionada{
    border-color: var(--bio-acento);

    box-shadow:
        0 0 0 3px
        rgba(var(--bio-acento-rgb), 0.18);
}


/* Selección accesible mediante mouse, teclado o pantalla táctil */

.btn-seleccionar-reemplazo{
    width: 100%;
    min-height: 40px;

    margin-top: auto;
    padding: 9px 12px;

    color: #253f5c;
    background: rgba(255, 255, 255, 0.8);

    border: 1px solid #a9b9cc;
    border-radius: 8px;

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        opacity 160ms ease,
        background-color 160ms ease;
}

.btn-seleccionar-reemplazo:hover{
    background: #ffffff;
}

.btn-seleccionar-reemplazo:focus-visible{
    outline: 3px solid var(--bio-acento);
    outline-offset: 3px;
}

.btn-seleccionar-reemplazo[aria-pressed="true"]{
    color: #ffffff;
    background: #245b7c;
    border-color: #245b7c;
}

#modal-reemplazo-destacada button:disabled{
    opacity: 0.55;
    cursor: not-allowed;
}


/* Resumen y controles fuera del área desplazable */

.seleccion-reemplazo-destacada{
    flex-shrink: 0;
    margin: 0;
    padding: 12px 20px;

    color: #33445e;
    background: #f2f7fc;

    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

#mensaje-reemplazo-destacada{
    flex-shrink: 0;
    margin: 12px 20px 0;
}

.ventana-reemplazo-destacada > .acciones-formulario-agenda{
    margin: 0;
    padding: 14px 20px;

    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}


/* En computador, la acción aparece al acercarse a la tarjeta.
   Con teclado también aparece al recibir el foco. */

@media (hover: hover) and (pointer: fine){

    .tarjeta-reemplazo-nota .btn-seleccionar-reemplazo{
        opacity: 0;
    }

    .tarjeta-reemplazo-nota:hover .btn-seleccionar-reemplazo,
    .tarjeta-reemplazo-nota:focus-within .btn-seleccionar-reemplazo,
    .tarjeta-reemplazo-nota.seleccionada .btn-seleccionar-reemplazo{
        opacity: 1;
    }

}


/* Adaptación a pantallas pequeñas */

@media (max-width: 1100px){

    .lista-notas-reemplazo-destacada{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 800px){

    .contenido-reemplazo-destacada{
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        padding: 16px;
    }

    .panel-entrante-reemplazo{
        order: -1;
    }

}

@media (max-width: 560px){

    .lista-notas-reemplazo-destacada{
        grid-template-columns: minmax(0, 1fr);
    }

}


/* Respeta la preferencia de reducir animaciones */

@media (prefers-reduced-motion: reduce){

    .tarjeta-reemplazo-nota,
    .btn-seleccionar-reemplazo{
        transition: none;
    }

}

/* Con poca altura, permite desplazar toda la ventana
   para mantener accesibles su encabezado y controles. */

@media (max-height: 600px){

    .ventana-reemplazo-destacada{
        display: block;
        overflow-y: auto;
    }

    .contenido-reemplazo-destacada{
        overflow: visible;
    }

}

/* =====================================================
   CONSULTA DE TODAS LAS NOTAS ACTIVAS
===================================================== */

.ventana-todas-notas-agenda{
    display: flex;
    flex-direction: column;

    width: min(1080px, 100%);

    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);

    overflow: hidden;
}

.ventana-todas-notas-agenda > .encabezado-modal-agenda{
    flex-shrink: 0;
    min-width: 0;
}

.ventana-todas-notas-agenda .encabezado-modal-agenda > div{
    min-width: 0;
    overflow-wrap: anywhere;
}

.lista-todas-notas-agenda{
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(min(225px, 100%), 1fr)
        );

    align-items: start;
    gap: 14px;

    min-height: 0;
    padding: 20px;

    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Cada nota conserva su puesto en la cuadrícula. */
.espacio-todas-notas-agenda{
    position: relative;
    min-width: 0;
    height: 147px;
}

.tarjeta-todas-notas-agenda{
    display: flex;
    flex-direction: column;
    gap: 8px;

    height: 100%;
    min-width: 0;
    padding: 16px;

    color: #26354b;

    border: 1px solid rgba(38, 53, 75, 0.15);
    border-radius: 10px;

    overflow: hidden;
    overflow-wrap: anywhere;

    transition: box-shadow 160ms ease;
}

.tarjeta-todas-notas-agenda h3{
    flex-shrink: 0;
    margin: 0;

    font-size: 16px;
    line-height: 1.4;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.tarjeta-todas-notas-agenda small{
    flex-shrink: 0;

    color: #45546b;
    font-size: 12px;
    line-height: 1.5;
}

.tarjeta-todas-notas-agenda p{
    flex: 1;
    min-height: 0;
    margin: 0;

    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

/* La nota crece sin cambiar el tamaño de su puesto. */
.tarjeta-todas-notas-agenda.nota-ampliada{
    position: absolute;
    z-index: 5;

    top: var(--desplazamiento-nota, 0px);
    right: 0;
    left: 0;

    height: auto;
    min-height: min(225px, var(--alto-maximo-nota, 225px));
    max-height: var(--alto-maximo-nota, 70vh);

    overflow-y: auto;
    overscroll-behavior: contain;

    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
}

.tarjeta-todas-notas-agenda.nota-ampliada h3,
.tarjeta-todas-notas-agenda.nota-ampliada p{
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.tarjeta-todas-notas-agenda.nota-ampliada p{
    flex: none;
}

.ventana-todas-notas-agenda > .mensaje-lista-vacia-agenda{
    margin: 0;
    padding: 20px;
}

.ventana-todas-notas-agenda .btn-cerrar-modal-agenda:focus-visible{
    outline: 2px solid #66d3ec;
    outline-offset: 2px;
}

@media (max-height: 480px){

    .ventana-todas-notas-agenda{
        display: block;
        overflow-y: auto;
    }

    .lista-todas-notas-agenda{
        overflow: visible;
    }

}


/* =====================================================
   CONSERVAR VISIBLE EL ACCESO A ARCHIVADAS
===================================================== */

@media (min-width: 1051px){

    .panel-notas-agenda > .encabezado-panel-notas,
    .panel-notas-agenda > .seccion-notas-destacadas,
    .panel-notas-agenda > .pie-panel-notas{
        flex-shrink: 0;
    }

    .panel-notas-agenda > .contenedor-notas-activas{
        flex: 1 1 0;
        min-height: 0;
    }

}


/* =====================================================
   DETALLE DE LA SOLICITUD
===================================================== */

.ventana-detalle-solicitud-agenda{
    display: flex;
    flex-direction: column;

    width: min(1040px, 100%);

    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);

    overflow: hidden;
}

.ventana-detalle-solicitud-agenda [hidden]{
    display: none !important;
}

.ventana-detalle-solicitud-agenda > .encabezado-modal-agenda{
    flex-shrink: 0;
    min-width: 0;
}

.ventana-detalle-solicitud-agenda .encabezado-modal-agenda > div{
    min-width: 0;
    overflow-wrap: anywhere;
}

.contenido-detalle-solicitud-agenda{
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px;

    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-wrap: anywhere;
}

.mensaje-detalle-solicitud-agenda{
    margin: 0;

    color: #45546b;
    font-size: 14px;
    line-height: 1.5;
}

.datos-detalle-solicitud-agenda{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;

    margin: 0;
}

.datos-detalle-solicitud-agenda > div{
    min-width: 0;
    padding: 14px;

    background: #f4f7fb;

    border: 1px solid #dce3ed;
    border-radius: 9px;
}

.datos-detalle-solicitud-agenda dt{
    margin-bottom: 6px;

    color: #526078;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.datos-detalle-solicitud-agenda dd{
    margin: 0;

    color: #18233a;
    font-size: 14px;
    line-height: 1.5;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.seccion-pdf-detalle-solicitud-agenda,
.observacion-detalle-solicitud-agenda{
    margin-top: 20px;
    padding: 16px;

    border: 1px solid #dce3ed;
    border-radius: 9px;
}

.seccion-pdf-detalle-solicitud-agenda{
    background: #f4f7fb;
}

.seccion-pdf-detalle-solicitud-agenda h3,
.observacion-detalle-solicitud-agenda h3{
    margin: 0 0 10px;

    color: #26354b;
    font-size: 15px;
    line-height: 1.4;
}

.seccion-pdf-detalle-solicitud-agenda p,
.observacion-detalle-solicitud-agenda p{
    margin: 0;

    color: #45546b;
    font-size: 14px;
    line-height: 1.6;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ventana-detalle-solicitud-agenda .btn-cerrar-modal-agenda:focus-visible{
    outline: 2px solid #66d3ec;
    outline-offset: 2px;
}

@media (max-width: 760px){

    .datos-detalle-solicitud-agenda{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 480px){

    .datos-detalle-solicitud-agenda{
        grid-template-columns: minmax(0, 1fr);
    }

    .contenido-detalle-solicitud-agenda{
        padding: 14px;
    }

}

@media (max-height: 480px){

    .ventana-detalle-solicitud-agenda{
        display: block;
        overflow-y: auto;
    }

    .contenido-detalle-solicitud-agenda{
        overflow: visible;
    }

}


/* =====================================================
   SELECCIÓN DEL PDF DE COTIZACIÓN
===================================================== */

.controles-pdf-solicitud-agenda{
    margin-top: 16px;
}

.zona-subida-pdf-agenda{
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 112px;
    padding: 20px;

    text-align: center;
    overflow-wrap: anywhere;

    background: #eef7fc;

    border: 2px dashed #88b8cf;
    border-radius: 9px;

    overflow: hidden;
}

.zona-subida-pdf-agenda strong{
    color: #26354b;
    font-size: 14px;
    line-height: 1.5;
}

.zona-subida-pdf-agenda span{
    color: #526078;
    font-size: 13px;
    line-height: 1.5;
}

.entrada-pdf-cotizacion-agenda{
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    opacity: 0;
    cursor: pointer;
}

.entrada-pdf-cotizacion-agenda:disabled{
    cursor: not-allowed;
}

.zona-subida-pdf-agenda[aria-disabled="true"]{
    opacity: 0.6;
}

.zona-subida-pdf-agenda:focus-within,
.zona-subida-pdf-agenda.arrastrando-pdf{
    background: #e0f1fa;

    border-color: #267ba9;

    box-shadow: 0 0 0 3px rgba(38, 123, 169, 0.18);
}

.controles-pdf-solicitud-agenda > p{
    margin-top: 10px;
    font-size: 13px;
}

.acciones-pdf-solicitud-agenda{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;

    margin-top: 14px;
}

.acciones-pdf-solicitud-agenda button{
    min-height: 40px;
}

.acciones-pdf-solicitud-agenda button:disabled{
    opacity: 0.6;
    cursor: not-allowed;
}

#mensaje-subida-pdf-cotizacion[data-tipo="error"]{
    color: #a32738;
}

/* =====================================================
   RECUPERACIÓN Y CONFIRMACIÓN DEL PDF
===================================================== */

.aviso-pdf-solicitud-agenda{
    margin: 14px 0;
    padding: 14px;

    background: #fff7e5;

    border: 1px solid #e4c67d;
    border-radius: 9px;

    overflow-wrap: anywhere;
}

.aviso-pdf-solicitud-agenda > p{
    margin: 0 0 8px;

    color: #59451e;
    font-size: 13px;
    line-height: 1.5;
}

#btn-retomar-pdf-pendiente[hidden]{
    display: none !important;
}

.mensaje-detalle-solicitud-agenda:not([hidden]){
    margin-bottom: 14px;
}

.mensaje-detalle-solicitud-agenda[data-tipo="error"]{
    color: #a32738;
}


#btn-vista-previa-cotizacion {
    margin-top: 10px;
}

#vista-previa-cotizacion {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #d7deeb;
    border-radius: 10px;
    background: #f5f7fb;
}

#mensaje-vista-previa-cotizacion {
    margin: 12px 0;
    overflow-wrap: anywhere;
}

#visor-cotizacion {
    display: block;
    width: 100%;
    height: 60vh;
    min-height: 280px;
    border: 0;
    border-radius: 6px;
    background: #fff;
}

#ayuda-pdf-cotizacion {
    margin: 10px 0;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
    white-space: normal;
}

/* =====================================================
   EXPANSIÓN DE LAS FILAS DE SOLICITUDES
===================================================== */

#cuerpo-tabla-solicitudes > .fila-resumen-solicitud > td {
    padding: 0;
    border: 0;
}

.fila-resumen-solicitud [hidden] {
    display: none !important;
}

.envoltura-resumen-solicitud {
    height: 0;
    overflow: hidden;
    visibility: hidden;
    background: #f3f7fc;
    transition: height 180ms ease;
}

.fila-solicitud-expandible:hover > td,
.fila-solicitud-expandible:focus-within > td {
    background: #f3f7fc;
}

.fila-solicitud-expandible:hover
    + .fila-resumen-solicitud .envoltura-resumen-solicitud,
.fila-solicitud-expandible:focus-within
    + .fila-resumen-solicitud .envoltura-resumen-solicitud,
.fila-resumen-solicitud:hover .envoltura-resumen-solicitud,
.fila-resumen-solicitud:focus-within .envoltura-resumen-solicitud {
    height: var(--alto-resumen, 0px);
    visibility: visible;
}

.contenido-resumen-solicitud {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    height: var(--alto-resumen, 0px);
    padding: 8px 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.observacion-resumen-solicitud {
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #526078;
    font-size: 12px;
    line-height: 1.5;
}

.pdf-resumen-solicitud {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.nombre-pdf-resumen {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #526078;
    font-size: 12px;
}

.pdf-resumen-solicitud > button {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .envoltura-resumen-solicitud {
        transition: none;
    }
}