/* El embalaje de los pedidos (26/10): la seccion "Embalaje" del panel admin (sub-seccion de Productos),
   dentro de panel-admin.html. Todo va bajo .emb (la seccion) y lo que se pone encima de todo el panel
   (.emb-capa, .emb-modal, .emb-visor y el globo de ayuda, .emb-globo): no toca el resto del panel. Del
   panel llegan `* { font-family: Arial }` y `.content-section h2/p`; lo de abajo los pisa solo aca.
   La paleta: pizarra con el azul de la portada; cada tipo tiene el color que se le elige (en hex). */

:root {
    --emb-tinta: #0f172a;
    --emb-texto: #334155;
    --emb-apagado: #64748b;
    --emb-tenue: #94a3b8;
    --emb-linea: #e2e8f0;
    --emb-linea-suave: #edf1f7;
    --emb-fondo: #f4f4f9;
    --emb-cebra: #f8fafc;
    --emb-acento: #2563eb;
    --emb-acento-fuerte: #1d4ed8;
    --emb-acento-suave: #eff6ff;
    --emb-acento-medio: #dbeafe;
    --emb-acento-borde: #bfdbfe;
    --emb-elegida: #e7efff;
    --emb-elegida-hover: #dbe7ff;
    --emb-peligro: #dc2626;
    --emb-peligro-fuerte: #b91c1c;
    --emb-peligro-suave: #fef2f2;
    --emb-peligro-borde: #fecaca;
    --emb-naranja: #c2410c;
    --emb-naranja-suave: #fff7ed;
    --emb-naranja-borde: #fed7aa;
    --emb-violeta: #6d28d9;
    --emb-violeta-suave: #f5f3ff;
    --emb-violeta-borde: #ddd6fe;
    --emb-verde: #0f766e;
    --emb-verde-suave: #f0fdfa;
    --emb-verde-borde: #99f6e4;
    --emb-sombra-1: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
    --emb-sombra-2: 0 8px 22px rgba(15, 23, 42, 0.09), 0 2px 5px rgba(15, 23, 42, 0.05);
    --emb-sombra-3: 0 30px 70px rgba(15, 23, 42, 0.3), 0 8px 22px rgba(15, 23, 42, 0.12);
    --emb-anillo: 0 0 0 3px rgba(37, 99, 235, 0.22);
    --emb-curva: cubic-bezier(0.2, 0.8, 0.2, 1);
    --emb-letra: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* El color de cada tipo lo elige el panel (en hex) y llega en --emb-c (style). Las pastillas, la
   franja y el escudo lo mezclan con blanco (el fondo y el borde) y con negro (el texto), para que se
   lea aunque el color elegido sea claro. */

/* --- lo que llega del panel ---------------------------------------------------------------- */

#embalaje.content-section {
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.emb,
.emb :where(:not([class*="fa-"])),
.emb-capa,
.emb-capa :where(:not([class*="fa-"])),
.emb-modal,
.emb-modal :where(:not([class*="fa-"])),
.emb-visor,
.emb-visor :where(:not([class*="fa-"])),
.emb-globo {
    font-family: var(--emb-letra);
}

.emb [hidden],
.emb-capa[hidden],
.emb-capa [hidden],
.emb-modal[hidden],
.emb-modal [hidden],
.emb-visor[hidden],
.emb-visor [hidden],
.emb-globo[hidden] {
    display: none !important;
}

/* Sin peso (:where): los controles heredan la letra, y cada componente pone la suya encima. */
:where(.emb, .emb-modal, .emb-visor) :where(button, input, select, textarea) {
    font-size: inherit;
    color: inherit;
}

.emb {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 6px;
    color: var(--emb-tinta);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.emb .emb-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.emb-apagado {
    color: var(--emb-tenue);
}

/* --- la portada ------------------------------------------------------------------------------ */

.emb .emb-portada {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px 22px;
    padding: 24px 28px;
    overflow: hidden;
    border-radius: 20px;
    color: #ffffff;
    background:
        radial-gradient(circle at 92% -20%, rgba(96, 165, 250, 0.5), transparent 45%),
        radial-gradient(circle at 62% 140%, rgba(59, 130, 246, 0.35), transparent 50%),
        linear-gradient(130deg, #0a1222 0%, #10224f 55%, #1d4ed8 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
    animation: emb-aparecer 0.4s var(--emb-curva) backwards;
}

.emb .emb-portada::after {
    content: '';
    position: absolute;
    right: -60px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 36px solid rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.emb .emb-portada__icono {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    font-size: 25px;
}

.emb .emb-portada__textos {
    min-width: 0;
}

.emb .emb-portada__etiqueta {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #dbeafe;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.emb .emb-portada__titulo {
    margin: 7px 0 4px;
    color: #ffffff;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.emb .emb-portada__bajada {
    max-width: 760px;
    margin: 0;
    color: rgba(226, 232, 240, 0.86);
    font-size: 13.5px;
}

.emb .emb-portada__datos {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.emb .emb-dato {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 96px;
    padding: 10px 14px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    animation: emb-aparecer 0.45s var(--emb-curva) backwards;
}

.emb .emb-dato__valor {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.emb .emb-dato__nombre {
    color: rgba(219, 234, 254, 0.85);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* --- las pestanas ---------------------------------------------------------------------------- */

.emb .emb-pestanas {
    display: flex;
    align-self: flex-start;
    gap: 4px;
    max-width: 100%;
    padding: 5px;
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 15px;
    box-shadow: var(--emb-sombra-1);
}

.emb .emb-pestana {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 17px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--emb-apagado);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.emb .emb-pestana i {
    font-size: 14px;
}

.emb .emb-pestana:hover {
    background: var(--emb-cebra);
    color: var(--emb-tinta);
}

.emb .emb-pestana--activa,
.emb .emb-pestana--activa:hover {
    background: linear-gradient(135deg, var(--emb-acento) 0%, var(--emb-acento-fuerte) 100%);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.emb .emb-pestana:focus-visible {
    outline: none;
    box-shadow: var(--emb-anillo);
}

.emb .emb-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: emb-aparecer 0.28s var(--emb-curva) backwards;
}

/* --- tarjetas, el general y los tipos -------------------------------------------------------- */

.emb .emb-tarjeta {
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 18px;
    box-shadow: var(--emb-sombra-1);
}

.emb .emb-tarjeta__cabecera {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.emb .emb-tarjeta__titulo {
    margin: 0;
    color: var(--emb-tinta);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.emb .emb-tarjeta__bajada {
    margin: 3px 0 0;
    color: var(--emb-apagado);
    font-size: 13px;
}

.emb .emb-general {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    background: linear-gradient(110deg, #f3f8ff 0%, #ffffff 62%);
    border-color: var(--emb-acento-borde);
}

.emb .emb-general__icono {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--emb-acento-medio);
    color: var(--emb-acento-fuerte);
    font-size: 20px;
}

.emb .emb-general__campo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emb .emb-general__campo .emb-select {
    min-width: 210px;
}

.emb .emb-tipos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.emb .emb-tarjeta__acciones {
    display: flex;
    align-items: center;
    gap: 12px;
}

.emb .emb-tipo {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px 14px 8px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-left: 4px solid var(--emb-c, var(--emb-acento));
    border-radius: 14px;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.2s ease;
}

.emb .emb-tipo:hover {
    box-shadow: var(--emb-sombra-2);
}

.emb .emb-tipo button {
    cursor: pointer;
}

/* La manija: de ahi se arrastra con el dedo, y con el teclado (flechas) se sube o se baja. */
.emb .emb-tipo__asa {
    display: grid;
    place-items: center;
    width: 26px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 15px;
    touch-action: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.emb .emb-tipo .emb-tipo__asa {
    cursor: grab;
}

.emb .emb-tipo:hover .emb-tipo__asa,
.emb .emb-tipo__asa:focus-visible {
    background: #f1f5f9;
    color: var(--emb-apagado);
}

.emb .emb-tipo__asa:focus-visible {
    outline: none;
    box-shadow: var(--emb-anillo);
}

/* Lo que se arrastra: levantado, siguiendo al puntero. */
.emb .emb-tipo--arrastrado,
.emb .emb-tipo--arrastrado:hover {
    cursor: grabbing;
    border-top-color: var(--emb-acento-borde);
    border-right-color: var(--emb-acento-borde);
    border-bottom-color: var(--emb-acento-borde);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22), 0 6px 14px rgba(15, 23, 42, 0.1);
    scale: 1.015;
    rotate: -0.6deg;
    transition: scale 0.15s ease, rotate 0.15s ease, box-shadow 0.15s ease;
}

.emb .emb-tipo--soltando {
    scale: 1;
    rotate: 0deg;
}

/* El hueco donde va a quedar: punteado, latiendo. */
.emb .emb-tipo-hueco {
    list-style: none;
    background: repeating-linear-gradient(-45deg, rgba(37, 99, 235, 0.04) 0 10px, rgba(37, 99, 235, 0.08) 10px 20px);
    border: 2px dashed var(--emb-acento);
    border-radius: 14px;
    animation: emb-latir 1.2s ease-in-out infinite;
}

.emb.emb-arrastrando,
.emb.emb-arrastrando * {
    cursor: grabbing !important;
    user-select: none;
}

.emb .emb-orden-estado {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    background: #f1f5f9;
    border-radius: 999px;
    color: var(--emb-apagado);
    font-size: 12.5px;
    font-weight: 600;
    animation: emb-aparecer 0.2s ease backwards;
}

.emb .emb-orden-estado--guardado {
    background: var(--emb-verde-suave);
    color: var(--emb-verde);
}

.emb .emb-orden-estado .emb-girador {
    width: 13px;
    height: 13px;
    border-width: 2px;
}

.emb .emb-tipo--general {
    background: linear-gradient(90deg, color-mix(in srgb, var(--emb-c, #1d4ed8) 8%, #ffffff) 0%, #ffffff 60%);
}

.emb .emb-tipo__nivel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--emb-c, #1d4ed8) 10%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--emb-c, #1d4ed8) 30%, #ffffff);
    color: color-mix(in srgb, var(--emb-c, #1d4ed8) 85%, #000000);
}

.emb .emb-tipo__nivel i {
    font-size: 15px;
}

.emb .emb-tipo__numero {
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.emb .emb-tipo__cuerpo {
    min-width: 0;
}

.emb .emb-tipo__linea {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.emb .emb-tipo__nombre {
    color: var(--emb-tinta);
    font-size: 15px;
    font-weight: 700;
}

.emb .emb-tipo__uso {
    color: var(--emb-apagado);
    font-size: 12.5px;
}

.emb .emb-tipo__instrucciones {
    margin: 4px 0 0;
    color: var(--emb-texto);
    font-size: 13px;
    line-height: 1.5;
}

.emb .emb-tipo__acciones {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- la barra de filtros --------------------------------------------------------------------- */

.emb .emb-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.emb .emb-barra--lista {
    justify-content: space-between;
    margin-top: -4px;
}

.emb .emb-barra__cuenta {
    margin-left: auto;
    color: var(--emb-apagado);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.emb .emb-barra--lista .emb-barra__cuenta {
    margin-left: 2px;
}

.emb .emb-barra__derecha {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emb .emb-buscador {
    display: flex;
    flex: 0 1 340px;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    height: 42px;
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 12px;
    box-shadow: var(--emb-sombra-1);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emb .emb-buscador--ancho {
    flex: 1 1 420px;
}

.emb .emb-buscador i {
    color: var(--emb-tenue);
    font-size: 14px;
    transition: color 0.15s ease;
}

.emb .emb-buscador:focus-within {
    border-color: var(--emb-acento);
    box-shadow: var(--emb-anillo);
}

.emb .emb-buscador:focus-within i {
    color: var(--emb-acento);
}

.emb .emb-buscador input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--emb-tinta);
    font-size: 14px;
}

.emb .emb-buscador input::placeholder {
    color: var(--emb-tenue);
}

.emb-select {
    height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--emb-linea);
    border-radius: 12px;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center;
    box-shadow: var(--emb-sombra-1);
    color: var(--emb-tinta);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emb-select:hover {
    border-color: #cbd5e1;
}

.emb-select:focus {
    outline: none;
    border-color: var(--emb-acento);
    box-shadow: var(--emb-anillo);
}

.emb-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.emb-select--chico {
    height: 34px;
    border-radius: 10px;
    font-size: 13px;
}

.emb .emb-fecha {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 6px 0 12px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 12px;
    box-shadow: var(--emb-sombra-1);
    color: var(--emb-apagado);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.emb .emb-fecha input {
    height: 34px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--emb-tinta);
    font-size: 13.5px;
    letter-spacing: 0;
    text-transform: none;
}

.emb .emb-fecha:focus-within {
    border-color: var(--emb-acento);
    box-shadow: var(--emb-anillo);
}

.emb .emb-modo {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: #e8edf5;
    border-radius: 11px;
}

.emb .emb-modo__opcion {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--emb-apagado);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.emb .emb-modo__opcion:hover {
    color: var(--emb-tinta);
}

.emb .emb-modo__opcion--activa,
.emb .emb-modo__opcion--activa:hover {
    background: #ffffff;
    color: var(--emb-acento-fuerte);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.emb .emb-faltan {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 14px;
    background: var(--emb-peligro-suave);
    border: 1px solid var(--emb-peligro-borde);
    border-radius: 12px;
    color: var(--emb-peligro-fuerte);
    font-size: 13px;
    animation: emb-aparecer 0.25s var(--emb-curva) backwards;
}

/* --- las tablas ------------------------------------------------------------------------------ */

.emb .emb-tabla-caja {
    position: relative;
    overflow: clip;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 18px;
    box-shadow: var(--emb-sombra-1);
}

/* La barrita de "cargando" arriba de la tabla, mientras llega otra pagina o otra busqueda. */
.emb .emb-tabla-caja::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    width: 35%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--emb-acento), transparent);
    opacity: 0;
    pointer-events: none;
}

.emb .emb-tabla-caja--cargando::before {
    opacity: 1;
    animation: emb-barrita 1.1s ease-in-out infinite;
}

.emb .emb-tabla {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.emb .emb-tabla thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--emb-linea);
    color: var(--emb-apagado);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.emb .emb-tabla td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--emb-linea-suave);
    vertical-align: middle;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.emb .emb-tabla tbody tr:last-child td {
    border-bottom: 0;
}

.emb .emb-fila {
    cursor: pointer;
    user-select: none;
    animation: emb-aparecer 0.22s ease backwards;
}

.emb .emb-fila:nth-child(even) > td {
    background: var(--emb-cebra);
}

.emb .emb-fila:hover > td {
    background: #f0f5ff;
}

.emb .emb-fila.emb-fila--elegida > td {
    background: var(--emb-elegida);
}

.emb .emb-fila.emb-fila--elegida:hover > td {
    background: var(--emb-elegida-hover);
}

.emb .emb-fila.emb-fila--elegida > td:first-child {
    box-shadow: inset 3px 0 0 var(--emb-acento);
}

.emb .emb-cargando .emb-fila {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.emb .emb-tabla .emb-col-check {
    width: 48px;
    padding-right: 0;
}

.emb .emb-tabla .emb-col-imagen {
    width: 70px;
}

.emb .emb-tabla .emb-col-num {
    width: 170px;
    color: var(--emb-texto);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.emb .emb-tabla .emb-col-tipo {
    width: 230px;
}

.emb .emb-tabla .emb-col-info {
    width: 70px;
    text-align: center;
}

.emb .emb-fila-esqueleto td {
    padding: 14px;
    border-bottom: 1px solid var(--emb-linea-suave);
}

.emb .emb-fila-vacia td {
    cursor: default;
}

/* La casilla: dibujada, con su tilde (o la raya, si estan algunos). */
.emb-check {
    display: inline-grid;
    place-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.emb-check::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #ffffff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: transform 0.15s var(--emb-curva);
}

.emb-check:hover {
    border-color: var(--emb-acento);
}

.emb-check:checked,
.emb-check:indeterminate {
    background: var(--emb-acento);
    border-color: var(--emb-acento);
}

.emb-check:checked::before {
    transform: scale(1);
}

.emb-check:indeterminate::before {
    clip-path: inset(38% 8% 38% 8% round 2px);
    transform: scale(1);
}

.emb-check:focus-visible {
    outline: none;
    box-shadow: var(--emb-anillo);
}

.emb .emb-carrier,
.emb .emb-producto {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.emb .emb-carrier__nombre,
.emb .emb-producto__sku {
    color: var(--emb-tinta);
    font-weight: 600;
}

.emb .emb-producto__sku {
    letter-spacing: 0.01em;
    user-select: text;
}

.emb .emb-carrier__id {
    color: var(--emb-tenue);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* --- imagenes, pastillas y chips ------------------------------------------------------------- */

.emb-miniatura {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    overflow: hidden;
    vertical-align: middle;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 12px;
}

.emb-miniatura img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.25s var(--emb-curva);
}

button.emb-miniatura {
    cursor: zoom-in;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

button.emb-miniatura:hover,
button.emb-miniatura:focus-visible {
    outline: none;
    border-color: var(--emb-acento-borde);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

button.emb-miniatura:hover img {
    transform: scale(1.08);
}

.emb-miniatura__lupa {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    font-size: 9px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

button.emb-miniatura:hover .emb-miniatura__lupa,
button.emb-miniatura:focus-visible .emb-miniatura__lupa {
    opacity: 1;
    transform: none;
}

.emb-miniatura--vacia {
    background: var(--emb-cebra);
    border-style: dashed;
    color: #cbd5e1;
    font-size: 17px;
}

.emb-miniatura--chica {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.emb-miniatura--grande {
    width: 104px;
    height: 104px;
    border-radius: 18px;
}

.emb-pildora {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 11px;
    background: color-mix(in srgb, var(--emb-c, #1d4ed8) 10%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--emb-c, #1d4ed8) 32%, #ffffff);
    border-radius: 999px;
    color: color-mix(in srgb, var(--emb-c, #1d4ed8) 82%, #000000);
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
}

.emb-pildora i {
    font-size: 11px;
}

.emb-pildora--heredada {
    background: transparent;
    border: 1px dashed #cbd5e1;
    color: var(--emb-apagado);
    font-weight: 500;
}

.emb-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    background: #f1f5f9;
    border: 1px solid var(--emb-linea);
    border-radius: 999px;
    color: var(--emb-texto);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.emb-chip i {
    font-size: 10px;
}

.emb-chip--combo {
    background: var(--emb-violeta-suave);
    border-color: var(--emb-violeta-borde);
    color: var(--emb-violeta);
}

.emb-chip--retiro {
    background: var(--emb-naranja-suave);
    border-color: var(--emb-naranja-borde);
    color: var(--emb-naranja);
}

.emb-chip--oculto {
    background: #f8fafc;
    color: var(--emb-apagado);
}

.emb-chip--general {
    background: var(--emb-acento-medio);
    border-color: var(--emb-acento-borde);
    color: var(--emb-acento-fuerte);
}

.emb-chip--detalle {
    background: #ffffff;
    font-weight: 500;
}

.emb-chip--coincide {
    background: #fef9c3;
    border-color: #fde68a;
    color: #854d0e;
    font-weight: 700;
}

/* --- el globo de ayuda: que significa un chip. Va fijo encima de todo el panel (la tabla recorta lo
   que se sale de ella) y no atrapa el puntero. --------------------------------------------------- */

.emb-chip[data-ayuda] {
    cursor: help;
}

.emb-globo {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1300;
    max-width: min(300px, calc(100vw - 16px));
    padding: 8px 12px;
    background: var(--emb-tinta);
    border-radius: 10px;
    box-shadow: var(--emb-sombra-2);
    color: #f8fafc;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.45;
    pointer-events: none;
    animation: emb-globo-arriba 0.14s var(--emb-curva) backwards;
}

/* La flecha: un cuadrado girado, en el centro del chip (--emb-flecha, desde el borde del globo). */
.emb-globo::after {
    content: '';
    position: absolute;
    top: 100%;
    left: var(--emb-flecha, 50%);
    width: 10px;
    height: 10px;
    background: inherit;
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
}

.emb-globo[data-lado="abajo"] {
    animation-name: emb-globo-abajo;
}

.emb-globo[data-lado="abajo"]::after {
    top: 0;
}

@keyframes emb-globo-arriba {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@keyframes emb-globo-abajo {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: none; }
}

/* --- botones --------------------------------------------------------------------------------- */

.emb-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.emb-boton:active:not(:disabled) {
    transform: translateY(1px);
}

.emb-boton:focus-visible {
    outline: none;
    box-shadow: var(--emb-anillo);
}

.emb-boton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.emb-boton--primario {
    background: linear-gradient(135deg, var(--emb-acento) 0%, var(--emb-acento-fuerte) 100%);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
    color: #ffffff;
}

.emb-boton--primario:hover:not(:disabled) {
    filter: brightness(1.06);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32);
}

.emb-boton--peligro {
    background: linear-gradient(135deg, #ef4444 0%, var(--emb-peligro-fuerte) 100%);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.25);
    color: #ffffff;
}

.emb-boton--peligro:hover:not(:disabled) {
    filter: brightness(1.06);
}

.emb-boton--contorno {
    background: #ffffff;
    border-color: var(--emb-linea);
    box-shadow: var(--emb-sombra-1);
    color: var(--emb-texto);
}

.emb-boton--contorno:hover:not(:disabled) {
    background: var(--emb-cebra);
    border-color: #cbd5e1;
    color: var(--emb-tinta);
}

.emb-boton--texto {
    height: 36px;
    padding: 0 10px;
    background: transparent;
    color: var(--emb-apagado);
}

.emb-boton--texto:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--emb-tinta);
}

.emb-boton--enlace {
    height: auto;
    padding: 4px 8px;
    background: transparent;
    color: var(--emb-acento-fuerte);
    font-size: 13px;
}

.emb-boton--enlace:hover:not(:disabled) {
    background: var(--emb-acento-suave);
}

.emb-boton--chico {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

.emb-icono {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--emb-apagado);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.emb-icono:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--emb-tinta);
}

.emb-icono:focus-visible {
    outline: none;
    box-shadow: var(--emb-anillo);
}

.emb-icono:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.emb-icono--peligro:hover:not(:disabled) {
    background: var(--emb-peligro-suave);
    color: var(--emb-peligro-fuerte);
}

.emb-icono--info {
    width: 32px;
    height: 32px;
    background: var(--emb-acento-suave);
    border-color: var(--emb-acento-borde);
    border-radius: 999px;
    color: var(--emb-acento);
}

.emb-icono--info:hover:not(:disabled) {
    background: var(--emb-acento);
    border-color: var(--emb-acento);
    color: #ffffff;
    transform: scale(1.06);
}

/* --- cargando: esqueletos, la ruedita ------------------------------------------------------- */

.emb-esqueleto {
    display: block;
    width: 100%;
    height: 12px;
    border-radius: 7px;
    background: linear-gradient(90deg, #edf1f7 25%, #f8fafc 37%, #edf1f7 63%);
    background-size: 400% 100%;
    animation: emb-brillo 1.3s ease infinite;
}

.emb-esqueleto--check { width: 18px; height: 18px; border-radius: 6px; }
.emb-esqueleto--imagen { width: 44px; height: 44px; border-radius: 12px; }
.emb-esqueleto--miniatura { flex: none; width: 104px; height: 104px; border-radius: 18px; }
.emb-esqueleto--largo { width: 72%; }
.emb-esqueleto--medio { width: 48%; }
.emb-esqueleto--corto { width: 28%; }
.emb-esqueleto--pildora { width: 112px; height: 24px; border-radius: 999px; }
.emb-esqueleto--punto { width: 32px; height: 32px; margin: 0 auto; border-radius: 999px; }
.emb-esqueleto--redondo { width: 40px; height: 40px; border-radius: 999px; }

.emb-girador {
    display: inline-block;
    flex: none;
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(37, 99, 235, 0.18);
    border-top-color: var(--emb-acento);
    border-radius: 50%;
    animation: emb-girar 0.7s linear infinite;
}

.emb-girador--grande {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* --- el pie de la lista: paginas, "ir a" y el modo continuo --------------------------------- */

.emb .emb-pie {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    padding: 2px;
}

.emb .emb-pie__cuenta {
    color: var(--emb-apagado);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.emb .emb-paginas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.emb .emb-paginas__boton {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 10px;
    color: var(--emb-texto);
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.emb .emb-paginas__boton:hover:not(:disabled) {
    background: var(--emb-acento-suave);
    border-color: var(--emb-acento-borde);
    color: var(--emb-acento-fuerte);
}

.emb .emb-paginas__boton:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.emb .emb-paginas__boton--actual,
.emb .emb-paginas__boton--actual:disabled {
    background: linear-gradient(135deg, var(--emb-acento) 0%, var(--emb-acento-fuerte) 100%);
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    color: #ffffff;
    opacity: 1;
    cursor: default;
}

.emb .emb-paginas__boton--flecha {
    color: var(--emb-apagado);
}

.emb .emb-paginas__salto {
    padding: 0 4px;
    color: var(--emb-tenue);
}

.emb .emb-pie__ir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--emb-apagado);
    font-size: 13px;
}

.emb .emb-campo-pagina {
    width: 74px;
    height: 36px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 10px;
    color: var(--emb-tinta);
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emb .emb-campo-pagina::-webkit-outer-spin-button,
.emb .emb-campo-pagina::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.emb .emb-campo-pagina:focus {
    outline: none;
    border-color: var(--emb-acento);
    box-shadow: var(--emb-anillo);
}

.emb .emb-continuo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    color: var(--emb-apagado);
    font-size: 13px;
}

.emb .emb-continuo i {
    color: var(--emb-verde);
}

/* --- la barra de lo elegido (queda abajo, a la vista, mientras se recorre la lista) ---------- */

.emb .emb-seleccion {
    position: sticky;
    bottom: 18px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(900px, 100%);
    margin: 4px auto 0;
    padding: 10px 10px 10px 14px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--emb-acento-borde);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18), 0 2px 6px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
    animation: emb-subir 0.3s var(--emb-curva) backwards;
}

.emb .emb-seleccion__cuenta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--emb-texto);
    font-size: 14px;
    font-weight: 600;
}

.emb .emb-seleccion__numero {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--emb-acento) 0%, var(--emb-acento-fuerte) 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.emb .emb-seleccion__acciones {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- el historial ---------------------------------------------------------------------------- */

.emb .emb-historial {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.emb .emb-historial::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 19px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--emb-acento-borde), var(--emb-linea) 30%);
}

.emb .emb-entrada {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    animation: emb-aparecer 0.3s var(--emb-curva) backwards;
}

.emb .emb-entrada__icono {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 2px solid var(--emb-linea);
    border-radius: 999px;
    box-shadow: 0 0 0 4px var(--emb-fondo);
    color: var(--emb-apagado);
    font-size: 14px;
}

.emb .emb-entrada__icono--producto {
    background: var(--emb-violeta-suave);
    border-color: var(--emb-violeta-borde);
    color: var(--emb-violeta);
}

.emb .emb-entrada__icono--carrier {
    background: var(--emb-naranja-suave);
    border-color: var(--emb-naranja-borde);
    color: var(--emb-naranja);
}

.emb .emb-entrada__icono--tipo {
    background: var(--emb-acento-suave);
    border-color: var(--emb-acento-borde);
    color: var(--emb-acento-fuerte);
}

.emb .emb-entrada__icono--general {
    background: var(--emb-verde-suave);
    border-color: var(--emb-verde-borde);
    color: var(--emb-verde);
}

.emb .emb-entrada__cuerpo {
    min-width: 0;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 16px;
    box-shadow: var(--emb-sombra-1);
    transition: box-shadow 0.2s ease;
}

.emb .emb-entrada__cuerpo:hover {
    box-shadow: var(--emb-sombra-2);
}

.emb .emb-entrada__linea {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.emb .emb-entrada__frase {
    margin: 0;
    color: var(--emb-texto);
    font-size: 14px;
}

.emb .emb-entrada__frase strong {
    color: var(--emb-tinta);
    font-weight: 700;
}

.emb .emb-entrada__cuando {
    flex: none;
    color: var(--emb-tenue);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.emb .emb-entrada__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
}

.emb .emb-entrada__cambios {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
    color: var(--emb-texto);
    font-size: 13px;
}

.emb .emb-entrada__cambios li {
    padding: 6px 10px;
    background: var(--emb-cebra);
    border-radius: 9px;
}

.emb .emb-entrada--esqueleto .emb-entrada__icono {
    background: transparent;
    border: 0;
}

.emb .emb-entrada--esqueleto .emb-entrada__cuerpo {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.emb .emb-historial.emb-cargando > .emb-entrada {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* --- vacio ----------------------------------------------------------------------------------- */

.emb .emb-vacio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 36px 16px;
    color: var(--emb-apagado);
    font-size: 14px;
    list-style: none;
    text-align: center;
}

.emb .emb-vacio i {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--emb-cebra);
    color: #cbd5e1;
    font-size: 21px;
}

/* --- la capa de "Guardando…" ----------------------------------------------------------------- */

.emb-capa {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(2px);
    animation: emb-fundido 0.15s ease backwards;
}

.emb-capa__caja {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: var(--emb-sombra-3);
    color: var(--emb-tinta);
    font-size: 14px;
    font-weight: 600;
    animation: emb-asomar 0.2s var(--emb-curva) backwards;
}

/* --- el modal (tapa todo el panel: el menu y la cabecera incluidos) ------------------------- */

.emb-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
}

.emb-modal__fondo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    animation: emb-fundido 0.2s ease backwards;
}

.emb-modal__caja {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: var(--emb-sombra-3);
    color: var(--emb-tinta);
    font-size: 14px;
    line-height: 1.45;
    animation: emb-asomar 0.25s var(--emb-curva) backwards;
}

.emb-modal__caja--chico {
    width: min(440px, 100%);
}

.emb-modal__caja--grande {
    width: min(780px, 100%);
}

.emb-modal__cabecera {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid var(--emb-linea-suave);
}

.emb-modal__titulo {
    margin: 0;
    color: var(--emb-tinta);
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.emb-modal__subtitulo {
    margin: 3px 0 0;
    color: var(--emb-apagado);
    font-size: 13px;
}

.emb-modal__cuerpo {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 18px 22px;
    overflow-y: auto;
}

.emb-modal__pie {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 18px;
    background: #fbfcfe;
    border-top: 1px solid var(--emb-linea-suave);
}

.emb-modal__error {
    margin: 0;
    padding: 10px 12px;
    background: var(--emb-peligro-suave);
    border: 1px solid var(--emb-peligro-borde);
    border-radius: 10px;
    color: var(--emb-peligro-fuerte);
    font-size: 13px;
    animation: emb-sacudir 0.35s ease backwards;
}

.emb-modal__texto {
    margin: 0;
    color: var(--emb-texto);
}

.emb-modal__nota {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    background: var(--emb-acento-suave);
    border-radius: 10px;
    color: #1e40af;
    font-size: 12.5px;
}

.emb-modal__nota i {
    margin-top: 2px;
}

.emb-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.emb-campo__nombre {
    color: var(--emb-apagado);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* El color de un tipo: la paleta, uno propio (el selector del navegador, encima e invisible) y la muestra. */
.emb-colores {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.emb-color {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
    background: var(--emb-c, #1d4ed8);
    border: 2px solid #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px var(--emb-linea);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.emb-color:hover {
    transform: scale(1.1);
}

.emb-color:focus-visible,
.emb-color--propio:focus-within {
    outline: none;
    box-shadow: var(--emb-anillo);
}

.emb-color--elegido,
.emb-color--elegido:focus-visible {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--emb-c, #1d4ed8);
}

.emb-color--propio {
    background: conic-gradient(#ef4444, #eab308, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444);
}

.emb-color--propio.emb-color--elegido {
    background: var(--emb-c, #1d4ed8);
}

.emb-color--propio input {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.emb-color--propio i {
    color: #ffffff;
    font-size: 11px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.emb-color-muestra {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.emb-modal .emb-color-muestra__hex {
    color: var(--emb-apagado);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 12.5px;
}

.emb-campo__ayuda {
    align-self: flex-end;
    color: var(--emb-tenue);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
}

.emb-control {
    width: 100%;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid var(--emb-linea);
    border-radius: 11px;
    color: var(--emb-tinta);
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input.emb-control {
    height: 42px;
}

.emb-control:focus {
    outline: none;
    border-color: var(--emb-acento);
    box-shadow: var(--emb-anillo);
}

/* El modal de "Editar": el embalaje para todos y lo elegido, con su tipo de ahora y en que queda. */
.emb-edicion__instrucciones {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: -4px 0 0;
    padding: 10px 12px;
    background: var(--emb-cebra);
    border: 1px solid var(--emb-linea);
    border-radius: 11px;
    color: var(--emb-texto);
    font-size: 13px;
    animation: emb-aparecer 0.2s ease backwards;
}

.emb-edicion__instrucciones i {
    margin-top: 2px;
    color: var(--emb-acento);
}

.emb-edicion__resumen {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.emb-resumen-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    background: #f1f5f9;
    border-radius: 999px;
    color: var(--emb-texto);
    font-size: 12.5px;
    font-weight: 650;
}

.emb-resumen-chip--cambia {
    background: var(--emb-acento-medio);
    color: var(--emb-acento-fuerte);
}

.emb-resumen-chip--igual {
    color: var(--emb-apagado);
}

.emb-resumen-aviso {
    color: var(--emb-naranja);
    font-size: 12.5px;
    font-weight: 600;
}

.emb-edicion__lista {
    max-height: min(46vh, 430px);
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--emb-linea);
    border-radius: 14px;
}

.emb-edicion__fila {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--emb-linea-suave);
    transition: opacity 0.2s ease;
}

.emb-edicion__fila:nth-child(even) {
    background: var(--emb-cebra);
}

.emb-edicion__fila:last-child {
    border-bottom: 0;
}

.emb-edicion__fila--igual {
    opacity: 0.55;
}

.emb-edicion__icono {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--emb-naranja-suave);
    color: var(--emb-naranja);
    font-size: 13px;
}

.emb-edicion__nombre {
    overflow: hidden;
    color: var(--emb-tinta);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emb-edicion__cambio {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.emb-edicion__flecha {
    color: var(--emb-tenue);
    font-size: 11px;
}

.emb-edicion__igual {
    color: var(--emb-apagado);
    font-size: 12px;
    font-style: italic;
}

.emb-edicion__final {
    height: 1px;
}

/* La informacion de un producto: su imagen (se agranda), el SKU, el embalaje y la descripcion. */
.emb-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.emb-info__cabecera {
    display: flex;
    align-items: center;
    gap: 16px;
}

.emb-info__datos {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.emb-info__ayuda {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--emb-tenue);
    font-size: 12px;
}

.emb-info__tipo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.emb-info__rotulo {
    color: var(--emb-apagado);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.emb-info__descripcion {
    max-height: 46vh;
    padding: 14px 16px;
    overflow-y: auto;
    background: var(--emb-cebra);
    border: 1px solid var(--emb-linea);
    border-radius: 14px;
    color: var(--emb-texto);
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-line;
    animation: emb-aparecer 0.25s ease backwards;
}

.emb-info__descripcion--vacia {
    color: var(--emb-tenue);
    font-style: italic;
    text-align: center;
}

.emb-info__esqueleto {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--emb-linea);
    border-radius: 14px;
}

/* Lo que no se pudo traer dentro de un modal (la descripcion, el detalle de un cambio), con "Reintentar". */
.emb-falla {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px;
    background: var(--emb-peligro-suave);
    border-radius: 14px;
    color: var(--emb-peligro-fuerte);
    text-align: center;
}

.emb-falla i {
    font-size: 20px;
}

/* --- el detalle de una entrada del historial (modal): cada uno, de lo que tenia a lo que quedo ---- */

.emb-detalles {
    max-height: min(52vh, 480px);
    overflow-y: auto;
    border: 1px solid var(--emb-linea);
    border-radius: 14px;
}

.emb-detalles__lista {
    margin: 0;
    padding: 0;
    list-style: none;
}

.emb-detalles__fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--emb-linea-suave);
    font-size: 13px;
}

.emb-detalles__fila:nth-child(even) {
    background: var(--emb-cebra);
}

.emb-detalles__fila:last-child {
    border-bottom: 0;
}

.emb-detalles__nombre {
    overflow: hidden;
    color: var(--emb-tinta);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emb-detalles__cambio {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
}

.emb-detalles__cambio > i {
    color: var(--emb-tenue);
    font-size: 11px;
}

/* Abajo de la lista: "Cargando más…", cuantos van o, si fallo, el motivo; vacio, no ocupa lugar. */
.emb-detalles__final {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 1px;
    color: var(--emb-apagado);
    font-size: 12.5px;
}

.emb-detalles__final:not(:empty) {
    padding: 10px;
    border-top: 1px solid var(--emb-linea-suave);
}

/* --- la imagen grande ------------------------------------------------------------------------ */

.emb-visor {
    position: fixed;
    inset: 0;
    z-index: 1150;
}

.emb-visor__fondo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(2, 6, 23, 0.86);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
    animation: emb-fundido 0.2s ease backwards;
}

.emb-visor__cerrar {
    position: absolute;
    top: 18px;
    right: 18px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.2s ease;
}

.emb-visor__cerrar:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: rotate(90deg);
}

.emb-visor__marco {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0;
    cursor: default;
    animation: emb-asomar 0.25s var(--emb-curva) backwards;
}

.emb-visor__lienzo {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 260px;
    min-height: 260px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.emb-visor__girador {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -20px 0 0 -20px;
}

.emb-visor__imagen {
    display: block;
    max-width: min(86vw, 900px);
    max-height: 74vh;
    object-fit: contain;
    opacity: 0;
    cursor: zoom-in;
    transition: opacity 0.25s ease, transform 0.35s var(--emb-curva);
}

.emb-visor__imagen--lista {
    opacity: 1;
}

.emb-visor__imagen--zoom {
    transform: scale(2.2);
    cursor: zoom-out;
}

.emb-visor__aviso {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 24px;
    color: var(--emb-apagado);
    font-size: 14px;
}

.emb-visor__aviso i {
    color: #cbd5e1;
    font-size: 28px;
}

.emb-visor__pie {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #ffffff;
    font-size: 14px;
}

.emb-visor__pie span {
    color: rgba(226, 232, 240, 0.7);
    font-size: 12px;
}

/* --- movimiento ------------------------------------------------------------------------------ */

@keyframes emb-aparecer {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes emb-fundido {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes emb-asomar {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@keyframes emb-subir {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes emb-girar {
    to { transform: rotate(360deg); }
}

@keyframes emb-brillo {
    from { background-position: 100% 50%; }
    to { background-position: 0 50%; }
}

@keyframes emb-barrita {
    from { transform: translateX(-100%); }
    to { transform: translateX(290%); }
}

@keyframes emb-latir {
    50% { border-color: var(--emb-acento-borde); }
}

@keyframes emb-sacudir {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* --- pantallas angostas ---------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .emb .emb-portada {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .emb .emb-portada__datos {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .emb .emb-tabla-caja {
        overflow-x: auto;
    }

    .emb .emb-general {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .emb .emb-tipo {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .emb .emb-general__campo,
    .emb .emb-tipo__acciones {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .emb .emb-seleccion {
        flex-direction: column;
        align-items: stretch;
    }

    .emb .emb-seleccion__acciones {
        justify-content: flex-end;
    }

    .emb .emb-pie {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .emb .emb-portada {
        grid-template-columns: minmax(0, 1fr);
        padding: 18px;
    }

    .emb .emb-portada__icono {
        display: none;
    }

    .emb .emb-buscador {
        flex-basis: 100%;
    }

    .emb-modal__fondo {
        padding: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .emb *,
    .emb-capa,
    .emb-capa *,
    .emb-modal,
    .emb-modal *,
    .emb-visor,
    .emb-visor *,
    .emb-globo {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
