﻿/* =========================================================
   ESTILOS ETIQUETAS ENVIBOL (sufijo -ej)
   Archivo sugerido: /styles/etiquetas-ej.css
   ========================================================= */

/* ---------- Variables y base ---------- */
:root {
    --ej-tinta: #111111;
    --ej-tenue: #4B5563;
    --ej-borde: rgba(0,0,0,.18);
    --ej-papel: #FFFFFF;
    --ej-sombra: 0 4px 12px rgba(0,0,0,.08);
    --ej-radio: 12px;
    --ej-radio-sm: 6px;
    --ej-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

* {
    box-sizing: border-box;
}

.fila-etiquetas-ej {
    font-family: var(--ej-font-ui);
}

/* ---------- Rejilla exterior: 3 por fila (2 en md, 1 en sm) ---------- */
.fila-etiquetas-ej {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

@media (max-width: 1200px) {
    .fila-etiquetas-ej {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .fila-etiquetas-ej {
        grid-template-columns: 1fr;
    }
}

.columna-etiqueta-ej {
    display: flex;
}

/* ---------- Tarjeta principal ---------- */
.tarjeta-etiqueta-ej {
    position: relative;
    width: 100%;
    background: var(--ej-papel);
    border: 1px solid var(--ej-borde);
    border-radius: var(--ej-radio);
    box-shadow: var(--ej-sombra);
    padding: 19px 16px 12px;
    color: var(--ej-tinta);
    overflow: hidden;
}

/* ===== FRANJA SUPERIOR COMPACTA ===== */
/* ===== FRANJA SUPERIOR COMPACTA ===== */
.barra-superior-ej.compacta-ej {
    display: grid;
    grid-template-columns: 56px 1fr auto; /* logo / centro / caja */
    align-items: center;
    gap: 6px; /* ↓ separación entre columnas */
    margin: 0 0 4px 0; /* ↓ menos alto total */
    padding: 2px 0; /* ↓ menos padding vertical */
}

/* Logo IBNORCA (más pequeño) */
.logo-mini-ej {
    width: 40px; /* ↓ ancho */
    height: auto;
    object-fit: contain;
}

/* Centro: ENVIBOL + título (muy pegado) */
.centro-ej {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px; /* ↓ separación logo/título */
    min-height: 38px; /* ↓ altura del bloque centro */
}

.logo-envibol-superior-ej {
    width: 84px; /* ↓ ancho logo Envibol */
    height: auto;
    opacity: .9;
    margin: 0;
}

/* Título ceñido y una sola línea */
.titulo-faja-ej {
    margin: 0;
    border: 1px solid rgba(0,0,0,.9);
    border-radius: 3px;
    padding: 2px 10px; /* ↓ grosor de la “faja” */
    font-weight: 900;
    font-size: .92rem; /* ↓ tamaño */
    line-height: 1;
    background: #fff;
    text-align: center;
    letter-spacing: .35px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.02) inset;
    white-space: nowrap;
}

/* Caja de código a la derecha (mínima) */
.caja-codigo-tarjeta-ej {
    border: 1px solid #111;
    border-radius: 3px;
    background: #fff;
    padding: 2px 6px; /* ↓ padding interno */
    display: grid;
    grid-auto-rows: min-content;
    row-gap: 1px; /* ↓ espacio entre filas */
    width: max-content;
    justify-self: end; /* pegado a la derecha */
}

    .caja-codigo-tarjeta-ej .fila-ej {
        padding: 0;
        line-height: 1;
        font-size: .74rem; /* ↓ tipografía */
        white-space: nowrap;
    }

    .caja-codigo-tarjeta-ej .titulo-ej {
        text-align: center;
        font-weight: 800;
    }

    .caja-codigo-tarjeta-ej .codigo-ej {
        text-align: center;
        text-decoration: underline;
        font-weight: 800;
    }

    /* Versión / Página: etiquetas a la izq y valor a la der, con poco aire */
    .caja-codigo-tarjeta-ej .version-ej,
    .caja-codigo-tarjeta-ej .pagina-ej {
        display: grid;
        grid-template-columns: auto auto; /* label + valor */
        column-gap: 6px; /* ↓ separación */
        align-items: center;
    }

    .caja-codigo-tarjeta-ej .izq-ej {
        justify-self: start;
    }

    .caja-codigo-tarjeta-ej .der-ej {
        justify-self: end;
        font-weight: 800;
    }

/* Contenedor de las dos cajas grandes centradas (si lo usas) */
.contenedor-cabeceras-ej {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px; /* ↓ separación entre cajas */
    margin-top: -10px; /* acerca al cintillo */
}

/* Cajas ajustadas al texto (más delgadas) */
.caja-ajustada-ej {
    display: inline-block;
    border: 1px solid rgba(0,0,0,.9);
    border-radius: 3px;
    padding: 6px 12px; /* ↓ grosor */
    font-weight: 900;
    font-size: 1.1rem; /* ↓ tamaño */
    line-height: 1.05;
    background: #fff;
    text-align: center;
    letter-spacing: .3px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.02) inset;
}

    .caja-ajustada-ej .texto-grande-ej {
        margin: -2px;
        font-size: 1.1rem; /* en sincronía con el contenedor */
        font-weight: 800;
        white-space: nowrap;
    }

/* Responsivo suave: mantiene todo apretado */
@media (max-width: 768px) {
    .barra-superior-ej.compacta-ej {
        grid-template-columns: 48px 1fr auto;
        gap: 4px;
        margin-bottom: 2px;
    }

    .logo-envibol-superior-ej {
        width: 78px;
    }

    .titulo-faja-ej {
        font-size: .88rem;
        padding: 2px 8px;
    }

    .caja-codigo-tarjeta-ej .fila-ej {
        font-size: .7rem;
    }
}






/* ======== Secciones de datos ======== */
/* ======== Fila de datos ======== */
.seccion-datos-ej {
    display: flex;
    justify-content: flex-end; /* 🔹 todo a la derecha */
    gap: 3px; /* 🔹 solo 3px de espacio entre casillas */
    margin: 1px 0;
}

/* Celda compacta */
.dato-ej {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #000;
    border-radius: 3px;
    padding: 8px 6px 4px 6px; /* 🔹 menos aire interno */
    background: #fff;
    min-width: 90px; /* 🔹 más angosta por defecto */
    position: relative;
}

/* Subtítulos (fuera de la celda, arriba) */
.dato-etiqueta-ej {
    position: absolute;
    top: -1px; /* 🔹 más pegado a la celda */
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 4px;
    font-size: 0.7rem;
    font-weight: 900;
    text-align: center;
    border: 1px solid #000;
    border-radius: 3px;
    line-height: 1.1;
    white-space: nowrap;
}

/* Valor centrado */
.dato-valor-ej {
    font-size: 0.9rem;
    font-weight: 800;
    color: #000;
    text-align: center;
    margin-top: 6px;
    word-break: break-word;
}

/* Variante especial: CANTIDAD DE ENVASES PALLET */
.dato-ej.celda-ancha-ej {
    min-width: 170px; /* 🔹 más pequeña que antes */
}

    .dato-ej.celda-ancha-ej .dato-etiqueta-ej {
        font-size: 0.65rem; /* 🔹 subtítulo aún más compacto */
        white-space: nowrap; /* 🔹 nunca se parte */
    }







/* ===== BLOQUE COMPACTO (Auditor / Hora / Nº Pallet con Fechas) ===== */
/* ===== BLOQUE COMPACTO (tabla 4x2) ===== */
/* ===== BLOQUE COMPACTO (tabla 4x2) ===== */
.bloque-compacto-ej {
    display: grid;
    grid-template-columns: 120px 90px 90px 110px; /* 🔹 Reducimos la primera columna (Auditor) */
    grid-template-rows: auto auto; /* 2 filas */
    gap: 4px;
    justify-content: end;
    margin-top: 8px;
}

/* ===== Auditor ocupa 2 columnas (pero más estrecho) ===== */
.celda-auditor-compacta-ej {
    grid-column: 1 / span 2;
    grid-row: 1;
}

/* ===== Hora ocupa 1 columna ===== */
.celda-hora-compacta-ej {
    grid-column: 3/4;
    grid-row: 1;
}

/* ===== Nº Pallet ocupa 2 filas ===== */
.celda-pallet-compacta-ej {
    position: relative;
    grid-column: 4/5;
    grid-row: 1 / span 2;
    border: 2px solid #000;
    border-radius: 4px;
    background: #fff;
    min-width: 100px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pallet-num-compacta-ej {
    font-size: 2rem;
    font-weight: 1000;
    line-height: 1;
}

/* ===== Fechas ===== */
.celda-fecha-compacta-ej.f1 {
    grid-column: 1/2;
    grid-row: 2;
    max-width: 100px; /* 🔹 más angosta SOLO F. REPROC. */
}

.celda-fecha-compacta-ej.f2 {
    grid-column: 2/3;
    grid-row: 2;
}

.celda-fecha-compacta-ej.f3 {
    grid-column: 3/4;
    grid-row: 2;
}

.celda-compacta-ej,
.celda-micro-ej {
    position: relative;
    background: #fff;
    border: 1px solid #000;
    border-radius: 3px;
    min-height: 28px;
    padding: 4px 4px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Label flotante */
.label-flotante-ej {
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 4px;
    background: #fff;
    border: 1px solid #000;
    border-radius: 3px;
    font-size: .65rem;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1;
}

/* Valores */
.valor-compacto-ej {
    font-size: .85rem;
    font-weight: 700;
    text-align: center;
}

.valor-micro-ej {
    font-size: .75rem;
    font-weight: 600;
    line-height: 1;
}
/* =========================================================
   ) TIME LINE COMPACTA, ALERTA Y BOTONES
   ========================================================= */
.timeline-compacta {
    margin-top: 4px !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
}

.alerta-compacta {
    margin: 0 !important;
    padding: 2px 6px !important;
    font-size: 0.8rem !important;
}

.botones-aprobacion {
    display: flex;
    justify-content: center;
    margin-top: 4px;
    margin-bottom: 6px;
    gap: 8px;
}
.botones-aprobacion {
    display: flex;
    justify-content: center;
    margin-top: 4px;
    margin-bottom: 6px;
    gap: 8px;
}



/* =========================================================
   6) SELLO Y PIE
   ========================================================= */
/* ===== Sello Hecho en Bolivia ===== */
.sello-bolivia-ej {
    position: absolute;
    top: 120px; /* 🔹 controla altura (ajusta a gusto) */
    left: 15px; /* 🔹 controla desplazamiento lateral */
    width: 95px; /* tamaño */
    opacity: 0.45;
    pointer-events: none; /* no molesta clicks */
    z-index: 0; /* debajo de texto, ajusta si lo quieres encima */
}


.pie-ej {
    margin-top: 10px;
    border-top: 1px dashed rgba(0,0,0,.22);
    padding-top: 6px;
}

.nota-ej {
    color: #374151;
    text-align: center;
    font-size: .77rem;
    font-weight: 800;
}

/* ---------- Responsivo de secciones ---------- */
@media (max-width: 1200px) {
    .seccion-datos-ej,
    .seccion-datos-fila2-ej,
    .seccion-fechas-ej {
        grid-template-columns: repeat(2, 1fr);
    }

    .seccion-auditor-ej {
        grid-template-columns: 1.6fr 1fr 1.3fr;
    }
}

@media (max-width: 768px) {
    .seccion-datos-ej,
    .seccion-datos-fila2-ej,
    .seccion-fechas-ej {
        grid-template-columns: 1fr;
    }

    .seccion-auditor-ej {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    .dato-valor-grande-ej {
        font-size: 1.9rem;
    }
}


/* =========================================================
   7) MODO IMPRESIÓN (borde sólido, sin sombras)
   ========================================================= */
@media print {
    .fila-etiquetas-ej {
        break-inside: avoid;
    }

    .tarjeta-etiqueta-ej {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}



/* ✅ Impresora lista - Verde */
.estado-lista {
    background-color: #C8E6C9 !important;
}

/* ✅ Impresora en pausa - Amarillo */
.estado-pausa {
    background-color: #FFF9C4 !important;
}

/* ✅ Cabezal abierto o error - Rojo */
.estado-error {
    background-color: #FFCDD2 !important;
}

/* ✅ Estado desconocido o sin respuesta - Gris */
.estado-desconocido {
    background-color: #E0E0E0 !important;
}
