.menu-badge-nuevo {
    display: inline-block;
    margin-left: 7px;
    padding: 1px 7px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: latido-nuevo 2.2s ease-in-out infinite;
}

@keyframes latido-nuevo {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

.menu-item-nuevo {
    font-weight: bold;
}

.ajuste-rapido {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 50px);
    background-color: #f4f6fb;
}

.ajuste-barra {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background-color: #eef3ff;
    color: #143DD4;
    border-bottom: 1px solid #d8e2fb;
    flex-shrink: 0;
}

.ajuste-barra-titulo {
    flex: 1;
    min-width: 0;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 0.2px;
    color: #0f2a9e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ajuste-sede-unica {
    margin-left: auto;
    padding: 4px 11px;
    border-radius: 20px;
    background-color: #fff;
    color: #143DD4;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}





.ajuste-modal.fade .modal-dialog,
.ajuste-modal.in .modal-dialog {
    transform: none !important;
    transition: none !important;
}

/* El modal se limita al alto real de la pantalla y el que scrollea es el
   cuerpo, para que el pie con Cancelar/Crear nunca quede fuera. */
#modalCrearProducto .modal-dialog {
    position: relative;
    bottom: auto;
    margin: 12px auto;
    width: auto;
    max-width: 460px;
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
}

/* dvh descuenta la barra del navegador y el teclado; vh no. */
@supports (height: 100dvh) {
    #modalCrearProducto .modal-dialog {
        max-height: calc(100dvh - 24px);
    }
}

#modalCrearProducto .modal-content {
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#modalCrearProducto .modal-body {
    padding: 0 16px 8px;
    flex: 1 1 auto;
    min-height: 0;
}

/* El stock casi siempre queda en cero: se pliega para no estorbar. */
.crear-plegable {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 2px 0;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.crear-plegable-flecha {
    font-size: 11px;
    color: #96a0b5;
    transition: transform .15s;
}

.crear-plegable-abierto .crear-plegable-flecha {
    transform: rotate(90deg);
}

.crear-plegable-nota {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: #96a0b5;
}

.crear-hero {
    display: flex;
    gap: 14px;
    padding: 18px 16px 16px;
    margin: 0 -16px 16px;
    background: linear-gradient(160deg, #eef3ff 0%, #f7f9fd 100%);
    border-bottom: 1px solid #e4eaf6;
    border-radius: 20px 20px 0 0;
}

.crear-foto {
    position: relative;
    width: 96px;
    height: 96px;
    box-shadow: 0 4px 14px rgba(20,61,212,0.12);
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    background-color: #f4f6fb;
    border: 1px solid #e6eaf2;
}

.crear-foto img,
.crear-foto video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.crear-foto video,
.crear-foto canvas {
    display: none;
}

.crear-foto-grabando img { display: none; }
.crear-foto-grabando video { display: block; }

/* Mientras se encuadra la foto, la vista se agranda a todo el ancho.
   El padding-bottom la mantiene cuadrada, igual que la foto que se guarda. */
.crear-modo-camara .crear-hero {
    flex-direction: column;
}

.crear-modo-camara .crear-foto {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
}

.crear-modo-camara .crear-foto video,
.crear-modo-camara .crear-foto img,
.crear-modo-camara .crear-foto-cargando {
    position: absolute;
    top: 0;
    left: 0;
}

.crear-modo-camara .crear-hero-datos {
    margin-top: 12px;
}

.crear-foto-cargando {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.85);
    color: #143DD4;
    font-size: 22px;
}

.crear-foto-ocupada .crear-foto-cargando { display: flex; }

.crear-hero-datos {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Muestra la descripción mientras se escribe, para saber qué se está creando. */
.crear-titulo {
    font-size: 17px;
    font-weight: bold;
    color: #2d3748;
    line-height: 1.2;
    max-height: 3.6em;
    overflow: hidden;
    word-break: break-word;
}

.crear-titulo-vacio {
    color: #a0a8bd;
    font-weight: 600;
}

.crear-origen {
    font-size: 11px;
    color: #8b93a7;
    margin-top: 2px;
}

.crear-origen-master {
    color: #15803d;
    font-weight: bold;
}

.crear-barras {
    font-size: 11px;
    color: #a0a8bd;
    margin-top: 1px;
}

.crear-foto-acciones {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

.crear-btn-img {
    flex: 1;
    height: 34px;
    border: 1px solid #d3d9e6;
    border-radius: 8px;
    background-color: #fff;
    color: #4a5568;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.crear-btn-img i { font-size: 13px; }

.crear-btn-img-ok {
    display: none;
    border-color: #15803d;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    color: #fff;
}

.crear-foto-grabando ~ .crear-hero-datos #btnImagenCapturar,
.crear-modo-camara .crear-btn-img-ok { display: flex; }

.crear-modo-camara #btnImagenGoogle,
.crear-modo-camara #btnImagenCamara,
.crear-modo-camara #btnImagenGaleria { display: none; }

/* Mientras se encuadra, el modal se convierte en pantalla de cámara:
   se ocultan los campos, el pie y el título del alta. */
.crear-modo-camara .modal-body > *:not(.crear-hero),
.crear-modo-camara .modal-footer,
.crear-modo-camara .crear-titulo,
.crear-modo-camara .crear-origen {
    display: none !important;
}

.crear-btn-img-cancel {
    display: none;
}

.crear-modo-camara .crear-btn-img-cancel {
    display: flex;
    border-color: #c0392b;
    color: #c0392b;
}

/* Los dos botones de la pantalla de cámara comparten alto y tipografía;
   solo cambia el ancho, para que TOMAR FOTO pese más. */
.crear-modo-camara .crear-btn-img-cancel,
.crear-modo-camara .crear-btn-img-ok {
    height: 46px;
    font-size: 13px;
    letter-spacing: 0.4px;
}

.crear-modo-camara .crear-btn-img-ok {
    flex: 2;
}

.crear-barras-fila {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.crear-barras-fila .crear-campo {
    flex: 1;
    min-width: 0;
    letter-spacing: 0.5px;
}

.crear-btn-scan {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #143DD4 0%, #0f2a9e 100%);
    color: #fff;
    font-size: 19px;
    box-shadow: 0 3px 10px rgba(20,61,212,0.3);
}

.crear-campo {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    margin-bottom: 12px;
    border: 1px solid #dde3ee;
    border-radius: 11px;
    font-size: 15px;
    background-color: #fbfcfe;
    color: #2d3748;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.crear-campo:focus {
    background-color: #fff;
    border-color: #143DD4;
}

/* La descripción es lo que identifica al producto: va más grande. */
.crear-campo-fuerte {
    font-size: 16px;
    font-weight: 600;
}

/* Secciones: el alta se lee como tres pasos y no como una lista larga. */
.crear-seccion + .crear-seccion {
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid #edf0f6;
}

.crear-seccion-titulo {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #143DD4;
}

/* Marca los campos que el guardado exige, para no descubrirlos al fallar. */
.crear-obligatorio {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 3px;
    border-radius: 50%;
    background-color: #e03131;
    vertical-align: 2px;
}

.crear-categoria-fila {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.crear-categoria-fila .crear-campo {
    flex: 1;
    min-width: 0;
}

.crear-categoria-mas {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    padding: 0;
    border: 1px solid #143DD4;
    border-radius: 11px;
    background-color: #fff;
    color: #143DD4;
    font-size: 16px;
    cursor: pointer;
}

.crear-categoria-mas:active {
    background-color: #143DD4;
    color: #fff;
}

.crear-categoria-ok {
    border-color: #1e7e34;
    color: #1e7e34;
}

.crear-categoria-ok:active {
    background-color: #1e7e34;
}

.crear-categoria-cancel {
    border-color: #c0392b;
    color: #c0392b;
}

.crear-categoria-cancel:active {
    background-color: #c0392b;
}

.crear-oculto {
    display: none;
}

/* El alto va forzado porque "#html5-qrcode-ajuste > *" estira todo al 100%
   para el video, y eso tapaba la cámara con el cartel. */
.scan-cartel-pausa {
    height: auto !important;
    background: #cfdefd !important;
    color: #0f2a9e !important;
    padding: 7px 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* El relleno inferior sube el texto un poco por encima del centro */
#crearCategoriaNombre {
    padding-bottom: 15px;
}

#crearCategoriaNombre::placeholder {
    font-size: 11px;
    letter-spacing: 0.5px;
}

#crearCategoriaNombre::-webkit-input-placeholder {
    font-size: 11px;
    letter-spacing: 0.5px;
}

#crearCosto,
#crearPventa {
    text-align: center;
}

.crear-media .ajuste-rotulo-contado {
    text-align: center;
}

#modalCrearProducto .modal-body {
    overflow-y: auto;
}

.crear-campo-precio {
    font-size: 17px;
}

#modalCrearProducto .ajuste-btn-guardar {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    box-shadow: 0 4px 12px rgba(21,128,61,0.3);
}

.crear-campo-precio {
    border-color: #15803d;
    font-weight: bold;
    color: #15803d;
}

.crear-campo-precio:focus {
    border-color: #15803d;
}

/* Doble clase a propósito: .ajuste-rotulo-contado se define más abajo y
   con una sola clase le ganaba el gris. */
.ajuste-rotulo-contado.crear-rotulo-precio {
    color: #15803d;
    font-weight: bold;
}

.crear-sedes {
    margin-bottom: 4px;
}

.crear-sede {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    margin-bottom: 8px;
    border-radius: 11px;
    background-color: #f7f9fd;
}

.crear-sede .crear-stock-sede {
    width: 96px;
    flex-shrink: 0;
    margin-bottom: 0;
    text-align: center;
    background-color: #fff;
}

.crear-sede-nombre {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crear-sede .crear-campo {
    width: 120px;
    flex-shrink: 0;
    text-align: center;
}

.crear-fila {
    display: flex;
    gap: 10px;
}

.crear-media {
    flex: 1;
    min-width: 0;
}

.ajuste-cuerpo {
    flex: 1;
    padding: 14px;
}

.ajuste-buscador {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ajuste-input-wrap {
    position: relative;
    flex: 1;
}

.ajuste-input {
    width: 100%;
    height: 46px;
    padding: 0 12px 0 40px;
    border: 1px solid #d3d9e6;
    border-radius: 10px;
    font-size: 16px;
    background-color: #fff;
}

.ajuste-input-icono {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0ac;
    pointer-events: none;
}

.ajuste-btn-camara {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #143DD4 0%, #0f2a9e 100%);
    color: #fff;
    font-size: 20px;
}

/* La cámara se oculta solo en equipos de escritorio: pantalla ancha Y puntero
   de mouse. Con una de las dos no basta: la terminal Sunmi puede reportar
   pantalla ancha, y ahí el botón sí hace falta. */
@media (min-width: 769px) and (pointer: fine) {
    .ajuste-btn-camara,
    .crear-btn-scan {
        display: none !important;
    }

    .ajuste-buscador .ajuste-input-wrap,
    .crear-barras-fila .crear-campo {
        width: 100%;
    }
}

.ajuste-resultados {
    margin-top: 12px;
}

.ajuste-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 10px;
    cursor: pointer;
}

/* Se marca con !important porque el modo masivo repinta el borde más abajo. */
.ajuste-item-resaltado {
    border-color: #143DD4 !important;
    background-color: #eef3ff;
    box-shadow: 0 0 0 2px rgba(20,61,212,0.16);
}

.ajuste-item-datos {
    flex: 1;
    min-width: 0;
}

.ajuste-item-nombre {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
    line-height: 1.25;
}

.ajuste-item-barras {
    font-size: 12px;
    color: #8b93a7;
    margin-top: 2px;
}

.ajuste-item-saldo {
    flex-shrink: 0;
    min-width: 58px;
    text-align: center;
    font-size: 19px;
    font-weight: bold;
    color: #143DD4;
}

.ajuste-item-sinstock .ajuste-item-saldo {
    color: #c53030;
}

.ajuste-vacio {
    text-align: center;
    padding: 48px 20px;
    color: #a0a8bd;
}

.ajuste-vacio i {
    font-size: 46px;
    margin-bottom: 12px;
    display: block;
}

.ajuste-vacio p {
    font-size: 15px;
    margin: 0;
}

.ajuste-historial {
    margin-top: 18px;
}

.ajuste-historial-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 6px;
    background-color: #eef7ef;
    border-left: 3px solid #38a169;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #2f5855;
}

.ajuste-historial-item span:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ajuste-historial-dif {
    font-weight: bold;
    white-space: nowrap;
}

.ajuste-modal .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: none;
    position: absolute;
    bottom: 0;
    left: 0;
}

.ajuste-modal .modal-content {
    border: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -6px 24px rgba(0,0,0,0.2);
}

.ajuste-modal .modal-body {
    padding: 18px 16px 8px;
}

.ajuste-producto-nombre {
    font-size: 17px;
    font-weight: bold;
    color: #2d3748;
    line-height: 1.3;
}

.ajuste-producto-barras {
    font-size: 12px;
    color: #8b93a7;
    margin-top: 3px;
}

.ajuste-cifras {
    display: flex;
    gap: 10px;
    margin: 14px 0 10px;
}

.ajuste-cifra {
    flex: 1;
    padding: 8px;
    text-align: center;
    background-color: #f4f6fb;
    border-radius: 10px;
}

.ajuste-cifra-rotulo {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b93a7;
    letter-spacing: 0.5px;
}

.ajuste-cifra-valor {
    display: block;
    font-size: 22px;
    font-weight: bold;
    color: #2d3748;
    margin-top: 2px;
}

.ajuste-cifra-dif .ajuste-cifra-valor {
    color: #8b93a7;
}

.ajuste-dif-positiva .ajuste-cifra-valor {
    color: #2f855a;
}

.ajuste-dif-negativa .ajuste-cifra-valor {
    color: #c53030;
}

.ajuste-rotulo-contado {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: #8b93a7;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

#modalCrearProducto .ajuste-rotulo-contado {
    margin-top: 0;
    margin-bottom: 3px;
    font-weight: 700;
    color: #6b7590;
}

.crear-campo:focus {
    outline: none;
    border-color: #143DD4;
    box-shadow: 0 0 0 3px rgba(20,61,212,0.12);
}

.crear-campo-precio::placeholder {
    color: #9ecdae;
}

#modalCrearProducto .ajuste-pie {
    border-top: 1px solid #eef1f7;
    background-color: #fbfcfe;
    border-radius: 0 0 16px 16px;
}

.ajuste-contado {
    width: 100%;
    height: 56px;
    text-align: center;
    font-size: 30px;
    font-weight: bold;
    color: #143DD4;
    border: 2px solid #143DD4;
    border-radius: 10px;
    background-color: #fff;
}

.ajuste-teclado {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.ajuste-teclado button {
    height: 52px;
    border: 1px solid #dde2ec;
    border-radius: 10px;
    background-color: #fff;
    font-size: 22px;
    font-weight: 600;
    color: #2d3748;
}

.ajuste-teclado button:active {
    background-color: #e8edf9;
}

.ajuste-tecla-borrar {
    color: #c53030 !important;
}

.ajuste-pie {
    display: flex;
    gap: 10px;
    border: none;
    padding: 10px 16px 16px;
}

.ajuste-btn-cancelar,
.ajuste-btn-guardar {
    flex: 1;
    height: 50px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
}

.ajuste-btn-cancelar {
    background-color: #edf0f7;
    color: #5a6478;
}

.ajuste-btn-guardar {
    background: linear-gradient(135deg, #143DD4 0%, #0f2a9e 100%);
    color: #fff;
}

.ajuste-btn-guardar[disabled] {
    opacity: 0.5;
}

#html5-qrcode-ajuste {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

#html5-qrcode-ajuste > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#html5-qrcode-ajuste video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#html5-qrcode-ajuste #qr-shaded-region {
    box-sizing: border-box;
    width: auto !important;
    height: auto !important;
}

@media (min-width: 769px) {
    .ajuste-rapido {
        position: relative;
        height: calc(100vh - 100px);
        max-width: 560px;
        margin: 0 auto;
        border-radius: 12px;
        overflow: hidden;
    }

    .ajuste-modal .modal-dialog {
        position: relative;
        max-width: 460px;
        margin: 40px auto;
    }

    .ajuste-modal .modal-content {
        border-radius: 16px;
    }
}

.ajuste-modos {
    display: flex;
    gap: 7px;
    padding: 10px 14px 2px;
    flex-shrink: 0;
    background-color: #f4f6fb;
}

.ajuste-modo {
    flex: 1;
    height: 38px;
    border: 1px solid #d3d9e6;
    border-radius: 9px;
    background-color: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

.ajuste-modo-activa {
    border-color: #143DD4;
    background: linear-gradient(135deg, #143DD4 0%, #0f2a9e 100%);
    color: #fff;
}

.ajuste-modo[data-modo="masivo"].ajuste-modo-activa {
    border-color: #15803d;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.lote-panel {
    display: none;
    margin-top: 12px;
}

.en-masivo .lote-panel {
    display: block;
}

.en-masivo .ajuste-vacio,
.en-masivo .ajuste-historial {
    display: none !important;
}


.lote-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.lote-contador {
    font-size: 13px;
    font-weight: bold;
    color: #15803d;
}

.lote-btn-vaciar {
    border: none;
    background: none;
    color: #c53030;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 6px;
}

.lote-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    margin-bottom: 7px;
    background-color: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 10px;
}

.lote-item-datos {
    flex: 1;
    min-width: 0;
}

.lote-item-nombre {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    line-height: 1.2;
}

.lote-item-sistema {
    font-size: 11px;
    color: #8b93a7;
    margin-top: 2px;
}

.lote-item-cant {
    width: 74px;
    height: 40px;
    flex-shrink: 0;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #143DD4;
    border: 1px solid #d3d9e6;
    border-radius: 9px;
    background-color: #fbfcfe;
}

.lote-item-cant:focus {
    outline: none;
    border-color: #143DD4;
    background-color: #fff;
}

.lote-item-contado .lote-item-cant {
    border-color: #15803d;
    color: #15803d;
}

.lote-item-quitar {
    border: none;
    background: none;
    color: #c9cedb;
    font-size: 15px;
    padding: 4px;
    flex-shrink: 0;
}

.lote-vacio {
    text-align: center;
    padding: 34px 20px;
    color: #a0a8bd;
}

.lote-vacio i {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.lote-vacio p {
    font-size: 14px;
    margin: 0;
    line-height: 1.45;
}

.lote-btn-guardar {
    display: none;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(21,128,61,0.3);
}

.lote-btn-guardar[disabled] {
    opacity: 0.45;
    box-shadow: none;
}

.lote-con-items .lote-btn-guardar {
    display: block;
}

.lote-con-items .lote-vacio {
    display: none;
}

.aviso-grande {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3000;
    padding: 26px 20px;
    border-radius: 18px;
    text-align: center;
    color: #fff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    pointer-events: none;
    animation: aviso-entra .16s ease-out;
}

@keyframes aviso-entra {
    from { opacity: 0; transform: translateY(-50%) scale(0.92); }
    to   { opacity: 1; transform: translateY(-50%) scale(1); }
}

.aviso-grande-icono {
    font-size: 46px;
    display: block;
    margin-bottom: 10px;
}

.aviso-grande-titulo {
    font-size: 26px;
    font-weight: bold;
    line-height: 1.15;
    letter-spacing: 0.5px;
}

.aviso-grande-detalle {
    font-size: 17px;
    font-weight: 600;
    margin-top: 8px;
    opacity: 0.95;
    line-height: 1.25;
    word-break: break-word;
}

.aviso-grande-ok {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.aviso-grande-repetido {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}

.aviso-grande-error {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}

.aviso-grande-saliendo {
    opacity: 0;
    transition: opacity .2s ease-in;
}





.en-masivo .ajuste-item {
    border-color: #cfe3d4;
}

.en-masivo .ajuste-item:active {
    background-color: #eef7ef;
}

.ajuste-buscador {
    position: relative;
}

.ajuste-panel-resultados {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    z-index: 1200;
    max-height: 52vh;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #dde3ee;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(30,41,59,0.18);
}

.ajuste-panel-abierto {
    display: block;
}

.ajuste-panel-titulo {
    padding: 9px 13px;
    background-color: #f7f9fd;
    border-bottom: 1px solid #eef1f7;
    color: #6b7590;
    font-size: 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.ajuste-panel-resultados .ajuste-item {
    margin: 0;
    border: none;
    border-bottom: 1px solid #f2f4f9;
    border-radius: 0;
}

.ajuste-panel-resultados .ajuste-item:last-child {
    border-bottom: none;
}

.ajuste-panel-resultados .ajuste-item:active {
    background-color: #eef3ff;
}

#ajusteOverlay .tk-peso-titulo {
    font-size: 19px;
    line-height: 1.2;
}

#ajusteOverlay .tk-peso-teclado button[data-tecla="borrar"] {
    background-color: #ffe6e6;
    color: #d32f2f;
}

#ajusteOverlay .tk-peso-teclado button[data-tecla="borrar"]:hover,
#ajusteOverlay .tk-peso-teclado button[data-tecla="borrar"]:active {
    background-color: #ffd0d0;
}

.ajuste-chip-sede {
    margin-left: auto;
    flex-shrink: 0;
    max-width: 48%;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid #c3d3f7;
    border-radius: 20px;
    background-color: #fff;
    color: #143DD4;
    font-size: 13px;
    font-weight: 600;
}

.ajuste-chip-sede span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ajuste-segmentado {
    display: flex;
    padding: 3px;
    margin-bottom: 16px;
    border-radius: 12px;
    background-color: #e6eaf3;
}

.ajuste-segmentado .ajuste-modo {
    flex: 1;
    height: 38px;
    border: none;
    border-radius: 9px;
    background: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
}

/* El seleccionado va en azul suave, sea rápido o masivo; el otro queda plomo. */
.ajuste-segmentado .ajuste-modo-activa,
.ajuste-segmentado .ajuste-modo[data-modo="masivo"].ajuste-modo-activa {
    background: #cfdefd;
    color: #0f2a9e;
    box-shadow: 0 2px 6px rgba(30,41,59,0.14), inset 0 0 0 1px #9fbdf2;
}

.ajuste-enlace-crear {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 11px;
    border: 1px dashed #b9c2d6;
    border-radius: 11px;
    background-color: transparent;
    color: #5a6478;
    font-size: 13px;
    font-weight: 600;
}

.ajuste-enlace-crear:active {
    background-color: #eef3ff;
    border-color: #143DD4;
    color: #143DD4;
}

.sede-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2500;
    background-color: rgba(15,23,42,0.5);
}

.sede-overlay.activo {
    display: flex;
    align-items: flex-end;
}

.sede-hoja {
    width: 100%;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    background-color: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
}

.sede-hoja-titulo {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b93a7;
    margin-bottom: 12px;
}

.sede-opcion {
    display: block;
    width: 100%;
    height: 50px;
    margin-bottom: 8px;
    padding: 0 15px;
    text-align: left;
    border: 1px solid #dde3ee;
    border-radius: 12px;
    background-color: #fbfcfe;
    color: #2d3748;
    font-size: 15px;
    font-weight: 600;
}

.sede-opcion-activa {
    border-color: #143DD4;
    background: linear-gradient(135deg, #143DD4 0%, #0f2a9e 100%);
    color: #fff;
}

@media (max-width: 360px) {
    .ajuste-barra {
        padding: 11px 12px;
        gap: 8px;
    }

    .ajuste-barra-titulo {
        font-size: 16px;
    }

    .ajuste-chip-sede {
        max-width: 44%;
        padding: 6px 10px;
        font-size: 12px;
    }

    .ajuste-cuerpo {
        padding: 12px;
    }

    .ajuste-segmentado .ajuste-modo {
        font-size: 12px;
    }
}

.scan-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2600;
    background-color: #000;
    flex-direction: column;
}

.scan-overlay.activo {
    display: flex;
}

.scan-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    flex-shrink: 0;
    background: linear-gradient(to bottom, rgba(20,61,212,0.95), rgba(20,61,212,0.55), transparent);
    color: #fff;
}

.scan-linterna,
.scan-zoom {
    margin-right: 10px;
}

.scan-zoom {
    font-size: 13px;
    font-weight: bold;
}

.scan-linterna-encendida {
    background-color: #f7b500;
    color: #4a3200;
}

.scan-pie {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    pointer-events: none;
}

/* Deja ver qué ajustes de cámara aceptó el equipo. */
.scan-ajustes {
    margin-left: auto;
    margin-right: 12px;
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    white-space: nowrap;
}

.scan-titulo {
    font-size: 16px;
    font-weight: bold;
}

.scan-titulo i {
    margin-right: 9px;
}

/* Icono de escaneo: toma el tamaño y el color del elemento que lo contiene. */
.icono-escanear {
    width: 1.1em;
    height: 1.1em;
    display: block;
    margin: auto;
}

.scan-titulo .icono-escanear {
    display: inline-block;
    vertical-align: -0.17em;
    margin: 0 9px 0 0;
}

.scan-cerrar {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 20px;
}

.scan-visor {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.scan-visor #html5-qrcode-ajuste {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.crear-archivo-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.crear-modo-camara #btnImagenGaleria {
    display: none;
}

#ajusteContado:empty::before {
    content: "—";
    opacity: 0.3;
}
