/*
 * ==========================================================
 * Ventas MVP
 * Archivo : estilos.css
 * Descripción:
 * Hoja de estilos principal de la aplicación.
 * ==========================================================
 */


/*
 * ==========================================================
 * General
 * ==========================================================
 */

* {

    box-sizing: border-box;

}

body {

    margin: 0;

    padding: 0;

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

    background-color: #f4f4f4;

    color: #222;

}

#contenedor {

    width: 100%;

    max-width: 700px;

    margin: 0 auto;

    background-color: #ffffff;

    min-height: 100vh;

}

/*
 * ==========================================================
 * Encabezado
 * ==========================================================
 */

#encabezado {

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        88px;

    column-gap: 10px;

    background-color: #1d5fa7;

    color: white;

    padding: 8px 10px;

    box-sizing: border-box;

    overflow: hidden;

    position: relative;

    z-index: 1100;

}


/*
 * ==========================================================
 * Área principal del encabezado
 * ==========================================================
 */

#encabezadoPrincipal {

    display: grid;

    height: 88px;

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

    row-gap: 2px;

    column-gap: 6px;

    min-width: 0;

    position: relative;

    z-index: 1100;

}


/*
 * ==========================================================
 * Fila 1 — 2 áreas
 * ==========================================================
 */

#filaEncabezado1 {

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 6px;

    min-width: 0;

}


/*
 * ==========================================================
 * Fila 2 — 3 áreas
 * ==========================================================
 */

#filaEncabezado2 {

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 6px;

    min-width: 0;

}

/*
 * ==========================================================
 * Indicadores internos
 *
 * Se conservan para la lógica del sistema,
 * pero no forman parte del encabezado visible.
 * ==========================================================
 */

#indicadoresInternos {

    display: none;

}


/*
 * ==========================================================
 * Fila 3 — 2 áreas
 * ==========================================================
 */

#filaEncabezado3 {
/*
    display: flex;
*/
    min-width: 0;

}

#areaProcesos {

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 24px;

    min-width: 0;

}

#areaProcesos > span {

    min-width: 36px;

    min-height: 36px;

    padding: 5px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

}

/*
#areaProcesos {

    display: flex;

    align-items: center;

    justify-content: space-around;

    width: 100%;

    min-width: 0;

}

#areaProcesos > span {

    min-width: 36px;

    min-height: 0px;

    padding: 2px 5px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

}

*/
#estadoComision {

    white-space: nowrap;

}

/*
 * ==========================================================
 * Áreas de prueba
 * ==========================================================
 */

.area-prueba {

    border: 1px solid white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1rem;

    font-weight: bold;

    min-width: 0;

    overflow: hidden;

}


/*
 * ==========================================================
 * Logo
 * ==========================================================
 */

#encabezadoDerecho {

    align-self: stretch;

    display: flex;

    align-items: center;

    justify-content: center;

}

#logoEmpresa {

    width: 88px;

    height: 88px;

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;


}

#logoEmpresa img {

    width: 88px;

    height: 88px;

    object-fit: contain;

}

/*
 * ==========================================================
 * Barra de estado
 * ==========================================================
 */

#barraEstado {

    display: flex;

    align-items: center;

    gap: 14px;

    min-height: 42px;

    flex-wrap: nowrap;

    white-space: nowrap;

}

#estadoUsuario,
#estadoUsuarioGestion,
#estadoSupervisora {

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 0.80rem;

    font-weight: bold;

    white-space: nowrap;

}

#estadoEnviadas,
#estadoPendientes {

    min-width: 24px;

    font-size: 1.10rem;

    font-weight: bold;

    text-align: right;

}

#estadoMensajes,
#estadoPreparacionVenta,
#estadoSistema {

    min-width: 32px;

    padding: 4px;

    text-align: center;

    font-size: 1.30rem;

    cursor: pointer;

}

#empresaActual,
#tituloAplicacion {

    position: static;

    left: auto;

    transform: none;

    width: auto;

    font-size: 1rem;

    font-weight: bold;

    white-space: nowrap;

}

#formaPago {

    width: 100%;

    min-height: 44px;

    padding: 8px 10px;

    font-size: 1.10rem;

}

/*
 * ==========================================================
 * Colores de indicadores
 * ==========================================================
 */

.estado-gris {

    color: #9e9e9e;

}

.estado-verde {

    color: #5fd35f;

}

.estado-amarillo {

    color: #ffd400;

}

.estado-azul {

    color: #6ec6ff;

}

.estado-blanco {

    color: white;

}

/*
 * ==========================================================
 * Animaciones
 * ==========================================================
 */

@keyframes parpadear {

    0% {

        opacity: 1;

    }

    50% {

        opacity: 0.25;

    }

    100% {

        opacity: 1;

    }

}

.estado-parpadeando {

    animation: parpadear 1s infinite;

}

/*
 * ==========================================================
 * Escritorio
 * ==========================================================
 */

#escritorio {

    padding: 16px;

}

#ventaActual h2 {

    margin-top: 0;

    margin-bottom: 12px;

}

#preparacionVenta h2 {

    margin-top: 0;

    margin-bottom: 12px;

}

#panelTotal {

    margin-top: 16px;

    font-size: 1.20rem;

}

#totalVenta {

    font-weight: bold;

}


/*
 * ==========================================================
 * Tabla de venta
 * ==========================================================
 */

#tablaVenta {

    width: 100%;

    border-collapse: collapse;

    margin-top: 12px;

}

#tablaVenta thead {

    background-color: #e8e8e8;

}

#tablaVenta th {

    padding: 10px;

    border: 1px solid #cccccc;

    text-align: left;

}

#tablaVenta td {

    padding: 10px;

    border: 1px solid #cccccc;

}

#tablaVenta .fila-totales td {

    border-top: 2px solid #cccccc;

}

#tablaVenta tbody tr.fila-totales {

    background-color: #dcecff;

    font-size: 1.15rem;

    font-weight: bold;

}

#tablaVenta tbody tr:not(.fila-totales):nth-child(even) {

    background-color: #f0f0f0;

}

#tablaVenta td:nth-child(3),

#tablaVenta th:nth-child(3) {

    text-align: right;

}


/*
 * ==========================================================
 * Botones
 * ==========================================================
 */

button {

    width: 100%;

    margin-top: 12px;

    padding: 12px;

    border: none;

    border-radius: 6px;

    background-color: #1d5fa7;

    color: white;

    font-size: 1rem;

    cursor: pointer;

}

button:hover {

    background-color: #174d88;

}


/*
 * ==========================================================
 * Estado de sincronización
 * ==========================================================
 */

.estado-sincronizacion {

    margin-top: 20px;

    padding: 10px;

    text-align: center;

    font-size: 0.90rem;

    color: #555;

}


/*
 * ==========================================================
 * Modal
 * ==========================================================
 */

.modal {

    position: fixed;

    top: 110px;
    right: 0;
    bottom: 0;
    left: 0;

    display: flex;

    align-items: flex-start;

    justify-content: center;

    padding: 20px;

    background-color: rgba(0, 0, 0, 0.55);

    z-index: 1000;

}

.oculto {

    display: none;

}

.modal-contenido {

    width: 100%;

    max-width: 520px;

    padding: 20px;

    border-radius: 8px;

    background-color: white;

    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30);

    font-size: 1rem;

}

.modal-contenido h2 {

    margin-top: 0;

    margin-bottom: 16px;

    font-size: 1.25rem;

}

/*
 * ==========================================================
 * Panel de Administración
 * ==========================================================
 */

#menuAdministracion {

    display: flex;

    flex-direction: column;

    gap: 10px;

    margin-top: 20px;

    margin-bottom: 20px;

}

#menuAdministracion button {

    width: 100%;

    text-align: left;

    padding: 12px 14px;

    font-size: 1rem;

}

/*
 * ==========================================================
 * Visor QR
 * ==========================================================
 */

#visorQR {

    width: 100%;

    height: 300px;

    margin: 16px 0;

    border: 2px solid #999;

    border-radius: 8px;

    background-color: #f5f5f5;

    overflow: hidden;

}

#codigoQR {

    display: none;

}


/*
 * ==========================================================
 * Campos de datos
 * ==========================================================
 */

.campo-datos {

    min-height: 42px;

    margin-bottom: 14px;

    padding: 10px;

    border: 1px solid #cccccc;

    border-radius: 4px;

    background-color: #fafafa;

    word-break: break-word;

}

input[type="text"],
input[type="number"] {

    width: 100%;

    margin-top: 6px;

    margin-bottom: 16px;

    padding: 10px;

    border: 1px solid #cccccc;

    border-radius: 4px;

    font-size: 1rem;

}


/*
 * ==========================================================
 * Configuración
 * ==========================================================
 */

.pantalla {

    display: none;

    padding: 16px;

}

.pantalla.activa {

    display: block;

}

.pantalla label {

    display: block;

    margin-top: 16px;

}


/*
 * ==========================================================
 * Utilitarios
 * ==========================================================
 */

hr {

    margin: 20px 0;

}

@media (min-width: 768px) {

    #contenedor {

        margin-top: 20px;

        margin-bottom: 20px;

        border-radius: 8px;

        overflow: hidden;

        box-shadow: 0 2px 10px rgba(0,0,0,0.15);

    }

}

/*
 * ==========================================================
 * Responsive
 * ==========================================================
 */

@media (max-width: 600px) {

    /*
     * Encabezado general
     */

    #encabezado {

        grid-template-columns:
            minmax(0, 1fr)
            70px;

        column-gap: 6px;

        padding: 4px 6px;

    }


    /*
     * Área principal
     */

    #encabezadoPrincipal {

        height: 88px;

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

        row-gap: 2px;

        column-gap: 3px;

    }


    /*
     * ======================================================
     * Encabezado Gestión
     * ======================================================
     */

    #encabezadoGestion {

        grid-template-columns:
            minmax(0, 1fr)
            70px;

        column-gap: 6px;

        padding: 4px 6px;

    }


    #encabezadoPrincipalGestion {

        height: 70px;

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

        row-gap: 2px;

        column-gap: 3px;

    }


    #filaEncabezado1Gestion,
    #filaEncabezado2Gestion,
    #filaEncabezado3Gestion {

        gap: 3px;

    }


    #encabezadoDerechoGestion {

        align-self: stretch;

    }


    #logoEmpresaGestion {

        width: 70px;

        height: 70px;

    }


    #logoEmpresaGestion img {

        width: 70px;

        height: 70px;

    }


    /*
     * Filas
     */

    #filaEncabezado1,
    #filaEncabezado2,
    #filaEncabezado3 {

        gap: 3px;

    }

    /*
     * ======================================================
     * Ventas — estructura explícita de las tres filas
     * Prueba de estabilización del encabezado móvil
     * ======================================================
     */

    #filaEncabezado1,
    #filaEncabezado2,
    #filaEncabezado3 {

        min-width: 0;

        min-height: 0;

    }


    /*
     * Fila 1
     */

    #empresaActual {

        font-size: 1rem;

        font-weight: bold;

        white-space: nowrap;

    }

    #tituloAplicacion {

        font-size: 1rem;

        font-weight: bold;

        white-space: nowrap;

    }


    /*
     * Fila 2
     */

    #estadoUsuario,
    #estadoSupervisora {

        font-size: 1rem;

        font-weight: bold;

        white-space: nowrap;

        overflow: hidden;

        text-overflow: ellipsis;

    }


    /*
     * Fila 3 — estados
     */

    #areaEstados {

        display: flex;

        align-items: center;

        justify-content: flex-start;

        gap: 18px;

        min-width: 0;

    }

    #areaEstados > span {

        min-width: 36px;

        min-height: 30px;

        padding: 4px 6px;

        display: flex;

        align-items: center;

        justify-content: center;

        text-align: center;

    }

     /*
      * Fila 3 — procesos
      */

     #areaProcesos {

         display: flex;

         align-items: center;

         justify-content: center;

         gap: 24px;

         width: 100%;

         height: 100%;

         min-width: 0;

     }

     #areaProcesos > span {

         min-width: 36px;

         min-height: 36px;

         padding: 5px;

         display: flex;

         align-items: center;

         justify-content: center;

         cursor: pointer;

     }

    /*
     * Indicadores técnicos:
     * se conservan para la lógica interna,
     * pero no se muestran al operador.
     */

    #estadoConexion,
    #estadoTransmision {

        display: none;

    }

    #tablaVenta th:first-child,
    #tablaVenta td:first-child {

        display: none;

    }

    #tablaVenta th:nth-child(3),
    #tablaVenta td:nth-child(3) {

        width: 72px;

        white-space: nowrap;

    }

    #tablaVenta td:nth-child(2) {

        padding-right: 6px;

    }

    /*
     * Logo
     */

    #encabezadoDerecho {

        align-self: stretch;

    }

    #logoEmpresa {

        width: 70px;

        height: 70px;

    }


    #logoEmpresa img {

        width: 70px;

        height: 70px;

    }

}

/*
 * ==========================================================
 * Intercambio
 * ==========================================================
 */

#encabezadoIntercambio {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

}

#encabezadoIntercambio h2 {

    margin: 0;

}

#intercambioModos {

    display: flex;

    gap: 4px;

}

#intercambioModos button {

    padding: 6px 10px;

    border: 1px solid #cccccc;

    background-color: #eeeeee;

}

#intercambioModos
.intercambio-modo-activo {

    background-color: #1d5fa7;

    color: white;

}

#qrVendedor {

    width: 160px;

    height: 160px;

    margin: 10px auto;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #cccccc;

}

#qrVendedorIntercambio {

    width: 150px;

    height: 150px;

    margin: 10px auto;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #cccccc;

    box-sizing: border-box;

}

#btnLeerPiezasIntercambio {

    margin-top: 10px;

}

.intercambio-ultima-pieza {

    margin: 18px 0 0 0;

    min-height: 32px;

    line-height: 16px;

}

/*
 * ==========================================================
 * Modal : Intercambio
 * ==========================================================
 */

.modal-contenido.intercambio {

    width: 100%;

    max-width: 520px;

    max-height: calc(
        100vh - var(--altura-encabezado, 0px) - 32px
    );

    overflow-y: auto;

}

.intercambio-encabezado {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 12px;

}


.intercambio-encabezado h2 {

    margin: 0;

}


.intercambio-confirmacion {

    display: flex;

    align-items: center;

    gap: 4px;

    font-size: 0.75rem;

}


.intercambio-vendedores {

    display: flex;

    gap: 8px;

    width: 100%;

    margin-bottom: 8px;

}


.intercambio-vendedor {

    flex: 1;

    min-width: 0;

    height: 34px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0 8px;

    box-sizing: border-box;

    border: 1px solid #cccccc;

    border-radius: 4px;

    background: white;

    font-size: 0.9rem;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    cursor: pointer;

}


.intercambio-vendedor-activo {

    border-color: #0066cc;

    color: #0066cc;

    background-color: #dcecff;

}


#intercambioVendedorEntrega,
#intercambioVendedorRecepcion {

    font-weight: bold;

}


#intercambioInfo {

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    height: 160px;

    padding-top: 12px;

    box-sizing: border-box;


}
.intercambio-mensajes {

    margin-bottom: 8px;

}


.intercambio-mensajes p {

    margin: 4px 0;

}


.intercambio-informacion {

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

}


#qrVendedorIntercambio {

    width: 160px;

    height: 160px;

    margin: 0 0 0 auto;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid #cccccc;

    box-sizing: border-box;

    flex-shrink: 0;

}


#qrVendedorIntercambio img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;

}


#intercambioUltimaPieza {

    margin-top: 8px;

    padding: 8px 10px;

    min-height: 44px;

    box-sizing: border-box;

    font-size: 15px;

    line-height: 1.25;

    font-weight: 600;

    text-align: left;

    word-break: break-word;

    white-space: normal;

}


.intercambio-estado-texto {

    color: #0066cc;

    font-weight: 600;

}


#intercambioPiezas {

    color: #0066cc;

    font-weight: 600;

}


.visor-intercambio {

    width: 100%;

    height: 250px;

    background: #111;

    border-radius: 4px;

    overflow: hidden;

}


#gestionPiezasTotal {
    text-align: right;
}


#resumenCierreVenta {

    text-align: center;

    font-weight: bold;

}

#estadoIntercambio {
    font-size: 24px;
}

/*
 * ==========================================================
 * Ajuste de columna Importe — Piezas vendidas
 * ==========================================================
 */

#tablaGestionPiezas td:nth-child(3) {

    position: relative;

    left: 1ch;

}


/* ==========================================================
   Aplicación: Impresión de etiquetas QR
   ========================================================== */

.formulario-etiquetas-compacto {

    display: flex;

    align-items: center;

    gap: 8px;

    flex-wrap: wrap;

}


.formulario-etiquetas-compacto span {

    font-size: 14px;

}


.formulario-etiquetas-compacto input {

    width: 55px;

    min-width: 0;

}


#tablaPedidosEtiquetasQR {

    width: 100%;

    margin-top: 20px;

    border-collapse: collapse;

}


#tablaPedidosEtiquetasQR th,
#tablaPedidosEtiquetasQR td {

    padding: 4px 6px;

    border-bottom:
        1px solid #c8c8c8;

}


#tablaPedidosEtiquetasQR th {

    font-size: 12px;

    font-weight: normal;

}


#tablaPedidosEtiquetasQR td {

    font-size: 12px;

}


.btnEliminarPedidoEtiqueta {

    border: none;

    background: transparent;

    padding: 2px 6px;

    cursor: pointer;

}

.celdaEliminarPedidoEtiqueta {

    width: 32px;

    text-align: center;

}


.btnEliminarPedidoEtiqueta {

    border: none;

    background: transparent;

    padding: 2px 4px;

    font-size: 16px;

    cursor: pointer;

    opacity: 0.65;

}


.btnEliminarPedidoEtiqueta:active {

    opacity: 1;

}

/* ==========================================================
   Ajuste fino definitivo - Etiquetas QR
   ========================================================== */

/* Campos G T C V D H */

.formulario-etiquetas-compacto input {

    width: 38px !important;

    min-width: 38px !important;

    max-width: 38px !important;

    height: 38px;

    padding: 3px !important;

}


/* Tabla: distribución compacta */

#tablaPedidosEtiquetasQR {

    width: 100%;

    table-layout: fixed;

}


/* CANT */

#tablaPedidosEtiquetasQR th:nth-child(1),
#tablaPedidosEtiquetasQR td:nth-child(1) {

    width: 12% !important;

}


/* DENOMINACIÓN */

#tablaPedidosEtiquetasQR th:nth-child(2),
#tablaPedidosEtiquetasQR td:nth-child(2) {

    width: 54% !important;

}


/* DDE */

#tablaPedidosEtiquetasQR th:nth-child(3),
#tablaPedidosEtiquetasQR td:nth-child(3) {

    width: 10% !important;

}


/* HAS */

#tablaPedidosEtiquetasQR th:nth-child(4),
#tablaPedidosEtiquetasQR td:nth-child(4) {

    width: 10% !important;

}


/* PAPELERA */

#tablaPedidosEtiquetasQR th:nth-child(5),
#tablaPedidosEtiquetasQR td:nth-child(5) {

    width: 14% !important;

}


/* ==========================================================
   Etiquetas QR - ancho de campos de ingreso
   ========================================================== */

#eqGenerico,
#eqTalle,
#eqColor,
#eqVariante,
#eqSerieInicial,
#eqSerieFinal {

    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;

    box-sizing: border-box;

    padding-left: 2px !important;
    padding-right: 2px !important;

}

#tituloEtiquetasQR {

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

}


#tituloEtiquetasQR h2 {

    margin: 0;

}


#resumenEtiquetasQR {

    white-space: nowrap;

}

/*
 * ==========================================================
 * Login
 * ==========================================================
 */

.modal-login {

    position: fixed;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(0, 0, 0, 0.45);

    z-index: 10000;

}


.login-contenido {

    width: 320px;

    max-width: calc(100vw - 40px);

    padding: 30px;

    box-sizing: border-box;

    background: white;

    border-radius: 8px;

    display: flex;

    flex-direction: column;

    gap: 16px;

}


.login-contenido h1 {

    margin: 0;

    text-align: center;

}


.login-contenido h2 {

    margin: 0;

    text-align: center;

    font-size: 18px;

    font-weight: normal;

}


.login-contenido label {

    display: flex;

    flex-direction: column;

    gap: 6px;

}


.login-contenido input {

    padding: 10px;

    box-sizing: border-box;

    font-size: 16px;

}


.login-contenido button {

    padding: 12px;

    font-size: 16px;

    cursor: pointer;

}


#loginMensaje {

    min-height: 20px;

    text-align: center;

}
/* ==========================================================
 * Aplicación: Asignación de piezas a UF
 * ========================================================== */

#tituloAsignarUF {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

}


#tituloAsignarUF h2 {

    margin: 0;

}


#totalAsignarUF {

    white-space: nowrap;

}


/*
 * Segundo renglón:
 *
 * Depósito | Vendedor | Destino
 */

#formularioAsignarUF {

    display: flex;

    align-items: center;

    gap: 10px;

    margin-top: 15px;

    margin-bottom: 15px;

}


/*
 * Botones de tipo de UF.
 */

#tipoUFAsignar {

    display: flex;

    gap: 10px;

}


#tipoUFAsignar button {

    width: auto;

    margin: 0;

    padding: 10px 18px;

    background-color: white;

    color: inherit;

}


/*
 * Tipo seleccionado.
 */

#tipoUFAsignar button.tipo-uf-activo {

    background-color: #d9e6f2;

}


/*
 * Tipo seleccionado.
 */

#tipoUFAsignar button.tipo-uf-activo {

    background-color: #d9e6f2;

}


/*
 * Lista desplegable del destino.
 */

#destinoUFAsignar {

    flex: 1;

    min-width: 0;

}


#listaAsignarUF table {

    width: 100%;

    table-layout: fixed;

}


.celdaEliminarAsignarUF {

    width: 32px;

    text-align: right;

    vertical-align: middle;

    padding: 0;

}


.btnEliminarAsignarUF {

    border: none;

    background: transparent;

    padding: 2px 4px;

    font-size: 16px;

    color: #333;

    cursor: pointer;

    opacity: 0.65;

    position: relative;

    top: -2px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

}


.btnEliminarAsignarUF:active {

    opacity: 1;

}

/* ==========================================================
   Asignación UF - columna eliminar
   ========================================================== */

#cuerpoListaAsignarUF td:last-child {

    width: 32px;

    text-align: right;

    padding-right: 0;

}


#cuerpoListaAsignarUF td:last-child button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    vertical-align: middle;

    transform: translateY(-2px);

}

/*
 * ==========================================================
 * Asignación de piezas a UF
 * Desplazamiento vertical en pantallas pequeñas
 * ==========================================================
 */

#aplicacionAsignarUF {

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;

}


#aplicacionAsignarUF .modal-contenido {

    margin-bottom: 20px;

}

/* ==========================================================
   Asignación UF - lista de piezas
   ========================================================== */

#tablaAsignarUF {

    width: 100%;

}

/* ==========================================================
   LISTADO - ASIGNACIÓN DE UNIDAD FÍSICA
   Vista previa e impresión
   ========================================================== */


/*
 * ----------------------------------------------------------
 * Documento
 * ----------------------------------------------------------
 */

#documentoAsignarUF {

    background: white;

    color: #222;

    padding: 20px;

    font-family: Arial, sans-serif;

    font-size: 14px;

}


/*
 * ----------------------------------------------------------
 * Encabezado
 * ----------------------------------------------------------
 */

#encabezadoListadoAsignarUF {

    margin-bottom: 25px;

}


#encabezadoListadoFila1,
#encabezadoListadoFila2 {

    display: grid;

    grid-template-columns:
        1fr
        2fr
        1fr;

    align-items: center;

    column-gap: 15px;

}


#encabezadoListadoFila1 {

    font-weight: bold;

    font-size: 15px;

}


#encabezadoListadoFila2 {

    margin-top: 4px;

    font-size: 13px;

}


/*
 * Empresa y usuario
 */

#listadoAsignarUFEmpresa,
#listadoAsignarUFUsuario {

    text-align: left;

}


/*
 * Título y subtítulo
 */

#listadoAsignarUFTitulo,
#listadoAsignarUFSubtitulo {

    text-align: center;

}


/*
 * Fecha y hora
 */

#listadoAsignarUFFecha,
#listadoAsignarUFHora {

    text-align: right;

}


/*
 * ----------------------------------------------------------
 * Tabla
 * ----------------------------------------------------------
 */

#tablaListadoAsignarUF {

    width: 100%;

    border-collapse: collapse;

    margin-top: 10px;

}


#tablaListadoAsignarUF th {

    text-align: left;

    font-size: 12px;

    font-weight: bold;

    padding:

        6px
        5px;

    border-bottom:

        2px
        solid
        #444;

}


#tablaListadoAsignarUF td {

    padding:

        5px;

    border-bottom:

        1px
        solid
        #ddd;

    font-size: 13px;

}


/*
 * Primera columna: número
 */

#tablaListadoAsignarUF th:first-child,
#tablaListadoAsignarUF td:first-child {

    width: 35px;

    text-align: right;

}


/*
 * Última columna: serie
 */

#tablaListadoAsignarUF th:last-child,
#tablaListadoAsignarUF td:last-child {

    text-align: right;

    white-space: nowrap;

}


/*
 * ----------------------------------------------------------
 * Totales
 * ----------------------------------------------------------
 */

#totalesListadoAsignarUF {

    margin-top: 15px;

    padding-top: 8px;

    border-top:

        2px
        solid
        #444;

    text-align: right;

    font-weight: bold;

}

/* ==========================================================
 * Ventas — ajuste de procesos en celular
 * Gestión es el modelo visual
 * ========================================================== */

@media (max-width: 600px) {

    #areaProcesos {

        justify-content: center;

        gap: 24px;

    }

}


/*
 * ==========================================================
 * IMPRESIÓN
 * ========================================================== */

@media print {


    /*
     * Ocultar toda la aplicación.
     */

    body > * {

        display: none !important;

    }


    /*
     * Mostrar solamente el documento.
     */

    #vistaPreviaAsignarUF,
    #vistaPreviaAsignarUF *,
    #documentoAsignarUF,
    #documentoAsignarUF * {

        visibility: visible;

    }


    #vistaPreviaAsignarUF {

        display: block !important;

        position: absolute;

        left: 0;

        top: 0;

        width: 100%;

        background: white;

    }


    #documentoAsignarUF {

        width: 100%;

        padding: 0;

    }


    /*
     * No imprimir botones.
     */

    #accionesVistaPreviaAsignarUF {

        display: none !important;

    }


    /*
     * Repetir cabecera de tabla
     * en cada página.
     */

    #tablaListadoAsignarUF thead {

        display: table-header-group;

    }


    #tablaListadoAsignarUF tr {

        break-inside: avoid;

        page-break-inside: avoid;

    }


    /*
     * Márgenes de impresión.
     */

    @page {

        margin:

            15mm
            12mm;

    }

}

/* ==========================================================
   AJUSTE VISUAL DEFINITIVO
   LISTADO ASIGNACIÓN UF
   ========================================================== */


/*
 * Más espacio para el título central.
 */

#encabezadoListadoFila1,
#encabezadoListadoFila2 {

    grid-template-columns:

        1.2fr
        2.8fr
        1.2fr;

    column-gap: 10px;

}


/*
 * Título principal.
 */

#listadoAsignarUFTitulo {

    white-space: nowrap;

    font-size: 15px;

}


/*
 * Subtítulo.
 */

#listadoAsignarUFSubtitulo {

    white-space: nowrap;

}


/*
 * Encabezado general.
 */

#encabezadoListadoAsignarUF {

    margin-bottom: 20px;

}


/*
 * Tabla.
 */

#tablaListadoAsignarUF {

    margin-top: 8px;

}


#tablaListadoAsignarUF th {

    padding-top: 6px;

    padding-bottom: 6px;

}


#tablaListadoAsignarUF td {

    padding-top: 5px;

    padding-bottom: 5px;

}


/*
 * Total.
 */

#totalesListadoAsignarUF {

    margin-top: 12px;

}

/*
 * ==========================================================
 * Área : Gestión
 * Encabezado
 * ==========================================================
 */

#encabezadoGestion {

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        88px;

    column-gap: 10px;

    background-color: #287a52;

    color: white;

    padding: 8px 10px;

    box-sizing: border-box;

    overflow: hidden;

    position: relative;

    z-index: 1100;

}

#encabezadoPrincipalGestion {

    display: grid;

    height: 88px;

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

    row-gap: 2px;

    column-gap: 6px;

    min-width: 0;

    position: relative;

    z-index: 1100;

}

#filaEncabezado1Gestion {

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 6px;

    min-width: 0;

}


#filaEncabezado2Gestion {

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 6px;

    min-width: 0;

}


#filaEncabezado3Gestion {

    min-width: 0;

}


/*
 * ----------------------------------------------------------
 * Áreas del encabezado
 * ----------------------------------------------------------
 */

.area-encabezado-gestion {

    border: 1px solid white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1rem;

    font-weight: bold;

    min-width: 0;

    overflow: hidden;

}

#areaProcesosGestion {

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 24px;

}

#areaProcesosGestion > span {

    min-width: 36px;

    min-height: 36px;

    padding: 5px;

    display: flex;

    align-items: center;

    justify-content: center;

    cursor: pointer;

}

/*
 * ----------------------------------------------------------
 * Encabezado derecho
 * ----------------------------------------------------------
 */

#encabezadoDerechoGestion {

    align-self: stretch;

    display: flex;

    align-items: center;

    justify-content: center;

}


#logoEmpresaGestion {

    width: 88px;

    height: 88px;

    display: flex;

    align-items: center;

    justify-content: center;

}


#logoEmpresaGestion img {

    width: 88px;

    height: 88px;

    object-fit: contain;

}


/*
 * ==========================================================
 * Escritorio de Gestión
 * ==========================================================
 */

#escritorioGestion {

    padding: 20px;

}


/*
 * ==========================================================
 * Encabezados
 * Ajuste de recuadros
 * ==========================================================
 */

/* ----------------------------------------------------------
 * Ventas
 * ---------------------------------------------------------- */

#filaEncabezado2 .area-prueba,
#filaEncabezado3 .area-prueba,
#logoEmpresa {

    border: none;

}


/* ----------------------------------------------------------
 * Gestión
 * ---------------------------------------------------------- */

#filaEncabezado2Gestion .area-encabezado-gestion,
#filaEncabezado3Gestion .area-encabezado-gestion,
#logoEmpresaGestion {

    border: none;

}

/*
 * ==========================================================
 * PRUEBA TEMPORAL
 * Visualización de cajas reales del encabezado
 * ==========================================================
 */

@media (max-width: 600px) {

    #encabezado {

        outline: 2px solid red;

    }

    #encabezadoPrincipal {

        outline: 2px solid yellow;

    }

    #encabezadoGestion {

        outline: 2px solid red;

    }

    #encabezadoPrincipalGestion {

        outline: 2px solid yellow;

    }

}


/* ==========================================================
   AJUSTE DEFINITIVO DE LA VISTA DE IMPRESIÓN
   ========================================================== */

@media print {

    html,
    body {

        width: 100% !important;

        height: 100% !important;

        margin: 0 !important;

        padding: 0 !important;

        background: white !important;

    }


    /*
     * La vista previa deja de comportarse como modal.
     */

    #vistaPreviaAsignarUF {

        position: fixed !important;

        inset: 0 !important;

        width: 100vw !important;

        height: 100vh !important;

        max-width: none !important;

        max-height: none !important;

        margin: 0 !important;

        padding: 0 !important;

        border: none !important;

        border-radius: 0 !important;

        box-shadow: none !important;

        background: white !important;

        overflow: visible !important;

    }

    /*
     * El contenedor interno deja de tener
     * el ancho máximo de los modales.
     */

    #vistaPreviaAsignarUF .modal-contenido {

        width: 100% !important;

        max-width: none !important;

        min-width: 0 !important;

        margin: 0 !important;

        padding: 0 !important;

        border: none !important;

        border-radius: 0 !important;

        box-shadow: none !important;

    }

    /*
     * Documento.
     */

    #documentoAsignarUF {

        width: 100% !important;

        max-width: none !important;

        min-height: 100% !important;

        margin: 0 !important;

        padding: 15mm 12mm !important;

        box-sizing: border-box !important;

        background: white !important;

    }


    /*
     * No imprimir acciones.
     */

    #accionesVistaPreviaAsignarUF {

        display: none !important;

    }

}

/*
 * ==========================================================
 * PRUEBA — Igualación geométrica del encabezado de Ventas
 * ==========================================================
 */

@media (max-width: 600px) {

    #encabezado {

        grid-template-columns:
            minmax(0, 1fr)
            88px;

        column-gap: 10px;

        padding: 8px 10px;

    }


    #encabezadoPrincipal {

        height: 88px;

    }


    #logoEmpresa,
    #logoEmpresa img {

        width: 88px;

        height: 88px;

    }

}

/*
 * CORRECCION 30/09/2026
 * La regla #areaProcesosGestion > span establece display:flex
 * con mayor especificidad que .oculto.
 * Se fuerza aquí la ocultación de los procesos inactivos.
 */
#areaProcesosGestion > span.oculto {
    display: none !important;
}

/*
 * ==========================================================
 * 30/09/2026 - Consultas
 *
 * Los selectores de entidad y consulta dejan de ser la
 * interfaz visible. La selección se realiza mediante el
 * modal abierto desde el proceso Seleccionar.
 *
 * Los elementos HTML se conservan para mantener la lógica
 * existente de App.Entidades y App.Consultas.
 * ==========================================================
 */
.selector-entidad-base,
.selector-consulta {
    display: none !important;
}


/*
 * 30/09/2026
 * Color dominante del área Abastecimiento.
 * RGB 143,39,118 - #8F2776
 */

#encabezadoAbastecimiento {
    background-color: #8F2776;
}

#encabezadoPrincipalAbastecimiento {
    background-color: #8F2776;
}

#encabezadoDerechoAbastecimiento {
    background-color: #8F2776;
}

/*
 * 30/09/2026
 * Ajuste estructural del encabezado de Abastecimiento.
 * Mantiene la geometría utilizada por Gestión.
 */

#encabezadoAbastecimiento {

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        88px;

    column-gap: 10px;

    background-color: #8F2776;

    color: white;

    padding: 8px 10px;

    box-sizing: border-box;

    overflow: hidden;

    position: relative;

    z-index: 1100;

}

#encabezadoPrincipalAbastecimiento {

    display: grid;

    height: 88px;

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

    row-gap: 2px;

    column-gap: 6px;

    min-width: 0;

    position: relative;

    z-index: 1100;

}

#filaEncabezado1Abastecimiento {

    display: grid;

    grid-template-columns:
        1fr
        1fr;

    gap: 6px;

    min-width: 0;

}

#filaEncabezado2Abastecimiento {

    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 6px;

    min-width: 0;

}

#filaEncabezado3Abastecimiento {

    min-width: 0;

}

#encabezadoDerechoAbastecimiento {

    align-self: stretch;

    display: flex;

    align-items: center;

    justify-content: center;

}

#logoEmpresaAbastecimiento {

    width: 88px;

    height: 88px;

    display: flex;

    align-items: center;

    justify-content: center;

}

#logoEmpresaAbastecimiento img {

    width: 88px;

    height: 88px;

    object-fit: contain;

}


/*
 * 30/09/2026
 * Separación entre los procesos del encabezado de Abastecimiento.
 */

#areaProcesosAbastecimiento {

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 24px;

}
