.pa-tabs {
    font-family: sans-serif;
    padding: 10px;
}

.pa-tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.pa-tab-btn {
    padding: 10px 20px;
    border: 1px solid #ccc;
    background: #cce4f6;
    cursor: pointer;
}

.pa-tab-btn.active {
    background: #007cba;
    color: white;
}

.pa-tab-content {
    display: none;
    border: 1px solid #ddd;
    padding: 15px;
    background: #fff;
}

.pa-tab-content.active {
    display: block;
}

.pa-items-productos {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}

.pa-item-producto {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.pa-producto img {
    border: 1px solid #ccc;
    border-radius: 4px;
}

.pa-producto-detalle {
    font-size: 14px;
    line-height: 1.4;
}

.pa-pedido-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #fff;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pa-pedido-header {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
}

.pa-pedido-barrio {
    margin-bottom: 12px;
    font-style: italic;
    color: #444;
}

.pa-producto {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.pa-producto img {
    max-width: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.pa-producto-detalle {
    font-size: 14px;
    color: #333;
}

.pa-boton-alistado {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    padding: 10px 14px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 12px;
    transition: background-color 0.3s;
}

.pa-boton-alistado:hover {
    background-color: #388e3c;
}

.pa-listado-pedidos {
    display: flex;
    flex-direction: column;
    gap: 24px; /* separa los bloques entre sí */
    padding: 10px;
}

.pa-pedido-card {
    border: 1px solid #ccc;
    border-radius: 12px;
    background-color: #f9f9f9;
    padding: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.pa-pedido-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pa-pedido-header {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.pa-pedido-barrio {
    margin-bottom: 12px;
    color: #666;
    font-style: italic;
}

.pa-producto {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    border-top: 1px dashed #ccc;
    padding-top: 10px;
}

.pa-producto:first-of-type {
    border-top: none;
    padding-top: 0;
}

.pa-producto img {
    width: 60px;
    height: auto;
    border-radius: 5px;
    margin-right: 12px;
}

.pa-producto-detalle {
    font-size: 14px;
    color: #333;
}

.pa-boton-alistado {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.pa-boton-alistado:hover {
    background-color: #388e3c;
}


.pa-barcode-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.pa-barcode-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pa-barcode-input {
  width: 100%;
  padding-right: 40px; /* espacio para el botón */
  box-sizing: border-box;
}

.pa-scan-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background-color: transparent;
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
  height: 100%;
  color: #555;
}

.pa-scan-button:hover {
  color: #000;
}

.pa-barcode-camera {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 200px;
  margin-top: 10px;
  border: 2px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
}

.pa-barcode-camera video, 
.pa-barcode-camera canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 300px;
    border-radius: 8px;
}

.pa-pedido-vendedor {
    margin-bottom: 12px;
    font-style: italic;
    color: #444;
}

.pa-buscador-wrapper {
    text-align: center;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
}

#pa-buscador-pedidos {
    width: 80%;
    max-width: 500px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex: 1 1 300px !important;
}

#pa-filtro-fecha {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    flex: 0 0 auto !important;
    width: 15%;
}

#pa-limpiar-filtros {
    background-color: #cce4f6; /* Azul pastel */
    color: #1a73e8;            /* Azul Google */
    border: 1px solid #a7c9e6;
    padding: 6px 14px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 10px;
    flex: 0 0 auto !important;
}


/* Mostrar el modal solo cuando tiene la clase "activo" */
#pa-image-modal.activo {
  display: flex;
}

#pa-image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  text-align: center;
}

#pa-image-modal .pa-modal-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px #000;
}

#pa-image-modal .pa-close-modal {
  position: absolute;
  top: 20px; right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
}

.pa-observaciones {
    max-height: 6em;
    overflow-y: auto;
    font-size: 0.9em;
    background: #f5f5f5;
    padding: 6px 10px;
    border-radius: 5px;
    margin: 8px 0;
    line-height: 1.2em;
}

.pa-observacion-item {
    margin-bottom: 4px;
    color: #333;
}

.pa-observacion-fecha {
    font-size: 0.75em;
    color: #666;
    font-style: italic;
}

/* Oculto por defecto */
.pa-modal-notas {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 10000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pa-modal-notas.activo {
  display: flex; /* Se activa el centro al agregar la clase */
}


.pa-modal-content {
  background: white;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
  position: relative;
}

/* Contenido centrado */
.pa-modal-notas-contenido {
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  /* Elimina cualquier posición absoluta que cause desplazamiento */
  position: relative;
}

/* Botón de cerrar */
.pa-modal-notas-cerrar {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.pa-modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.pa-modal-nota {
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.pa-modal-fecha {
  font-size: 0.85em;
  color: #777;
}

.pa-modal-texto {
  font-size: 1em;
  color: #222;
}

.pa-observaciones-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.pa-ver-todas-notas {
  background-color: #e0f0ff;
  border: 1px solid #0073aa;
  color: #0073aa;
  padding: 2px 8px;
  font-size: 0.8em;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}

.pa-modal-etiqueta {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Modal */

.pa-modal-etiqueta-content {
  background-color: #fff;
  margin: 50px auto;
  padding: 0;
  border-radius: 10px;
  width: 320px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

/* Botón de cerrar */
.pa-modal-etiqueta-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 20px;
  font-weight: bold;
  color: #000;
  cursor: pointer;
  z-index: 10;
}


/* General */
.pa-etiqueta-content {
  font-family: Arial, sans-serif;
  font-size: 13px;
  width: 300px;
  padding: 10px;
  border: 1px dashed #000;
  background: #fff;
}

.pa-etiqueta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pa-etiqueta-logo {
  height: 60px;
}

.pa-fecha-cuadro {
  border: 1px solid black;
  padding: 2px 6px;
  display: inline-block;
  margin: 0 1px;
  font-weight: bold;
}

.pa-fecha-campos {
  display: flex;
  gap: 4px;
}

.pa-etiqueta-valor {
  margin-top: 10px;
  font-weight: bold;
}

.pa-etiqueta-dato {
  margin-top: 6px;
  line-height: 1.3;
}

.pa-etiqueta-datos-superiores {
  text-align: right;
  font-size: 11px;
  max-width: 200px;
}

.pa-etiqueta-contacto div {
  margin-bottom: 2px;
  text-align: center;
  font-size: 10px;
}



#pa-imprimir-etiqueta {
  margin-top: 10px;
  display: block;
  width: 100%;
  padding: 5px;
  font-size: 13px;
}




.pa-modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 20px;
  width: 320px;
  border-radius: 10px;
}

.pa-modal-close {
  float: right;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
}


.pa-etiqueta-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}
.pa-etiqueta-modal-content {
    background: white;
    width: 300px;
    margin: 60px auto;
    padding: 20px;
    border-radius: 10px;
    position: relative;
}
.pa-etiqueta-close {
    position: absolute;
    top: 2px; right: 5px;
    font-size: 24px;
    cursor: pointer;
}



/* Modal de impresión de etiqueta */

/* Contenido de la etiqueta */
.pa-etiqueta-contenido {
  padding: 20px 16px 16px 16px;
  font-family: Arial, sans-serif;
  font-size: 12px;
  border: 1px dashed #000;
  color: #000;
}

.pa-etiqueta-content {
  font-family: Arial, sans-serif;
  font-size: 13px;
  width: 300px;
  padding: 10px;
  border: 1px dashed #000;
  background: #fff;
}

.pa-etiqueta-contenido img.pa-etiqueta-logo {
  max-width: 120px;
  display: block;
  margin: 0 auto 10px;
}

.pa-etiqueta-fecha {
  text-align: right;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
}

.pa-fecha-label {
  font-weight: bold;
  margin-bottom: 3px;
}

.pa-valor-cobrar {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
}

.pa-valor-caja {
  display: inline-block;
  padding: 4px 8px;
  border: 2px solid #000;
  font-size: 14px;
  margin-top: 4px;
}

#pa-etiqueta-contenido div {
  margin-bottom: 6px;
}

#pa-etiqueta-contenido strong {
  display: inline-block;
  min-width: 80px;
}

.pa-etiqueta-footer {
  font-size: 11px;
  text-align: center;
  border-top: 1px dashed #000;
  margin-top: 12px;
  padding-top: 8px;
}

.pa-etiqueta-print-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  margin-top: 12px;
  padding: 8px 12px;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
}



.pa-etiqueta-wrapper {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pa-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 1px 1px 6px rgba(0,0,0,0.1);
}

.pa-card-header {
    font-size: 16px;
    margin-bottom: 10px;
}

.pa-card-body {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.pa-card-left img.pa-producto-img {
    width: 90px;
    height: auto;
    border-radius: 6px;
}

.pa-card-center {
    flex: 1 1 200px;
}

.pa-card-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 180px;
}

.pa-btn-asignar {
    background-color: #3B82F6;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
}

.pa-reimprimir-etiqueta {
    background-color: #10B981;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
}

.pa-ver-observaciones {
    background: #E5E7EB;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.pa-asignacion-masiva {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.pa-asignacion-masiva select,
.pa-asignacion-masiva button {
    padding: 6px 12px;
    font-size: 14px;
}

.pa-checkbox-label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

#pa-despachar-filtros {
    margin-bottom: 30px;
}

.pa-filtros-contenedor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px; /* Espaciado entre elementos */
}


.pa-asignar-seleccionados button,
.pa-imprimir-seleccionados button {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
    transition: background-color 0.3s ease;
}


.pa-asignar-seleccionados button {
    background-color: #7b9f52;
    color: white;
    border: none;
}

.pa-asignar-seleccionados button:hover {
    background-color: #688b44;
}

.pa-imprimir-seleccionados button {
    background-color: #5a7aa3;
    color: white;
    border: none;
}

.pa-imprimir-seleccionados button:hover {
    background-color: #4c6990;
}

@media (max-width: 600px) {
    .pa-filtros-contenedor {
        flex-direction: column;
        align-items: stretch;
    }
}

.pa-footer-botones {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.pa-asignar-individual,
.pa-imprimir-individual {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.pa-asignar-individual select {
    min-width: 200px;
}

.pa-producto {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px dashed #ccc;
    margin-top: 10px;
    padding-top: 10px;
    align-items: flex-start;
}

.pa-producto-img img {
    width: 60px;
    height: auto;
}

.pa-producto-detalle {
    flex: 1;
    min-width: 200px;
    font-size: 13px;
}

.pa-producto-linea {
    margin-bottom: 4px;
    word-break: break-word;
}

/* Mobile: asegúrate de que no se desborde */
@media screen and (max-width: 480px) {
    .pa-producto {
        flex-direction: column;
    }

    .pa-producto-img img {
        width: 100px;
    }

    .pa-producto-detalle {
        font-size: 14px;
    }
}

.pa-asignar-contenedor {
    margin-top: 10px;
    font-size: 14px;
}

.pa-asignar-fila {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    flex-wrap: wrap;
    align-items: center;
}

.pa-asignar-fila select {
    flex: 1;
    min-width: 150px;
}

.pa-asignar-fila button {
    white-space: nowrap;
}

/* En pantallas pequeñas, poner cada cosa en su línea */
@media screen and (max-width: 480px) {
    .pa-asignar-fila {
        flex-direction: column;
        align-items: stretch;
    }

    .pa-asignar-fila button {
        width: 100%;
    }

    .pa-asignar-fila select {
        width: 100%;
    }
}

.pa-filtros-despachar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.pa-filtros-despachar input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    flex: 1;
    min-width: 180px;
}

#pa-limpiar-filtros-despachar {
    background-color: #cce4f6; /* Azul pastel */
    color: #1a73e8;            /* Azul Google */
    border: 1px solid #a7c9e6;
    padding: 6px 14px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 10px;
    flex: 0 0 auto !important;
}

#pa-limpiar-filtros-despachar:hover {
    background-color: #b3d8f2;
}

#pa-limpiar-filtros-despachados {
    background-color: #cce4f6; /* Azul pastel */
    color: #1a73e8;            /* Azul Google */
    border: 1px solid #a7c9e6;
    padding: 6px 14px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: 10px;
}

#pa-limpiar-filtros-despachados:hover {
    background-color: #b3d8f2;
}

.pa-filtros-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
}

.pa-filtro-texto,
.pa-filtro-fecha {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  min-width: 250px;
  font-size: 14px;
}

.btn-limpiar {
  background-color: #a6c4ff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  color: #1d1d1d;
}

#pa-buscar-texto-despachar {
    width: 80%;
    max-width: 500px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex: 1 1 300px !important;
}

#pa-buscar-texto-despachados {
    width: 80%;
    max-width: 500px;
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#pa-buscar-fecha-despachar {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    flex: 0 0 auto !important;
    width: 15%;
}

#pa-buscar-fecha-despachados {
     padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    flex: 0 0 auto !important;
    width: 15%;
}


.pa-footer-botones-despachados {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.pa-asignar-contenedor {
    flex: 1 1 100%;
}

.pa-asignar-fila-despachados {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pa-selector-mensajero {
    flex: 1 1 auto;
    width: 30%;
}

.pa-actualizar-mensajero-individual {
    flex: 0 0 auto;
    white-space: nowrap;
}


.pa-imprimir-individual,
.pa-entregar-individual {
    flex: 1 1 calc(50% - 10px)  !important;
    min-width: 140px  !important;
}

.pa-imprimir-etiqueta,
.pa-imprimir-etiqueta-despachados,
.pa-marcar-entregado-individual {
    width: 100%;
}


@media (min-width: 600px) {
    .pa-footer-botones{
        flex-wrap: nowrap;
        align-items: flex-end;
    }
    .pa-footer-botones-despachados {
        flex-wrap: nowrap;
        align-items: flex-end;
    }

    .pa-asignar-contenedor {
        flex: 2;
    }

    .pa-imprimir-individual,
    .pa-entregar-individual {
        flex: 1  !important;
    }

    .pa-imprimir-etiqueta,
    .pa-imprimir-etiqueta-despachados,
    .pa-marcar-entregado-individual {
        width: auto;
    }
}

.mensajero-select {
  width: 100% !important;
  min-width: 250px !important;
  max-width: 100% !important;
}

.pa-asignar-seleccionados{
    width: 30%;
    align-items: center;
}


/* === Alineación horizontal de Asignar seleccionados e Imprimir etiquetas seleccionadas === */
.pa-filtros-contenedor {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
}

/* Contenedor del bloque de asignación */
.pa-asignar-seleccionados {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Select de mensajero */
.pa-asignar-seleccionados select {
    height: 42px !important;
    padding: 8px 10px !important;
    border-radius: 5px !important;
    border: 1px solid #ccc !important;
    font-size: 14px !important;
}

/* Botón asignar */
.pa-asignar-seleccionados button {
    height: 42px !important;
    padding: 0 18px !important;
    font-weight: bold !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
}

/* Botón imprimir etiquetas seleccionadas */
.pa-imprimir-seleccionados button {
    height: 42px !important;
    padding: 0 18px !important;
    border-radius: 6px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Responsive */
@media (max-width: 768px) {
    .pa-filtros-contenedor {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .pa-asignar-seleccionados,
    .pa-imprimir-seleccionados {
        width: 100% !important;
    }

    .pa-asignar-seleccionados select,
    .pa-asignar-seleccionados button,
    .pa-imprimir-seleccionados button {
        width: 100% !important;
    }
}



