/* Shell móvil: scroll natural y espacio para barra inferior */
@media (max-width: 767px) {
    body.app-mobile-shell {
        min-height: 100dvh;
        height: auto !important;
        overflow-x: hidden;
        overflow-y: auto !important;
        flex-direction: column;
    }
    body.app-mobile-shell > main.app-main-scroll {
        height: auto !important;
        min-height: 0;
        overflow-y: visible !important;
        flex: 1 1 auto;
        width: 100%;
        padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
    }
    body.app-mobile-shell > aside {
        display: none !important;
    }
}

.mobile-nav-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid #cbd5e1;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    min-height: 3.5rem;
}
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item.active {
    color: #1e3a8a;
    background: #eff6ff;
}
.mobile-nav-item span {
    line-height: 1.1;
    text-align: center;
}
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.45);
}
.mobile-nav-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: #fff;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.15);
}
.mobile-nav-sheet-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    text-decoration: none;
}
.mobile-nav-sheet-link.active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1e3a8a;
}
.mobile-nav-sheet-logout {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Solo estilos WhatsApp — el resto usa Tailwind clásico en cada página */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: #25d366;
    color: #fff;
    font-weight: 700;
    font-size: 0.65rem;
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    transition: background 0.15s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}
.btn-whatsapp:hover { background: #1da851; }
.btn-whatsapp-outline {
    background: #fff;
    color: #128c7e;
    border: 1px solid #86efac;
}
.btn-whatsapp-outline:hover { background: #f0fdf4; }
.btn-whatsapp-sm { width: 100%; }

/* Lector cámara — códigos de barras móvil/tablet */
.lector-camara-wrap {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}
.lector-camara-wrap video {
    border-radius: 0.375rem;
    width: 100% !important;
    object-fit: cover;
}
.lector-camara-wrap #qr-shaded-region,
.lector-camara-wrap canvas {
    border-radius: 0.375rem;
}
.btn-camara-scan {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 0.25rem;
    border: 2px solid #1e3a8a;
    background: #eff6ff;
    color: #1e3a8a;
    cursor: pointer;
}
.btn-camara-scan:hover { background: #dbeafe; }
.btn-camara-scan.cerrar {
    border-color: #64748b;
    background: #f1f5f9;
    color: #475569;
    margin-top: 0.5rem;
}

/* Alertas pedidos multi-bulto */
#panelAlertasBultos,
#barraAlertasBultos {
    background: #fffbeb;
    border-bottom: 2px solid #f59e0b;
}
.alerta-bultos-encabezado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #fef3c7;
    border-bottom: 1px solid #fcd34d;
    color: #92400e;
    flex-wrap: wrap;
}
.alerta-bultos-encabezado-derecha {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.alerta-bultos-fecha-hoy {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: capitalize;
    color: #b45309;
    margin-top: 0.1rem;
}
.alerta-bultos-filtros {
    display: flex;
    gap: 0.25rem;
}
.alerta-bultos-filtro-btn {
    font-size: 0.5625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0.45rem;
    border: 1px solid #fcd34d;
    border-radius: 0.25rem;
    background: #fffbeb;
    color: #92400e;
    cursor: pointer;
}
.alerta-bultos-filtro-btn.active {
    background: #f59e0b;
    border-color: #d97706;
    color: #fff;
}
.alerta-bultos-filtro-btn:hover:not(.active) { background: #fef3c7; }
.alerta-bultos-sin-hoy {
    padding: 0.65rem 1rem;
    font-size: 0.6875rem;
    color: #a16207;
    background: #fffbeb;
}
.alerta-bultos-lista {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 12rem;
    overflow-y: auto;
}
.alerta-bultos-pedido {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #fde68a;
    background: #fffbeb;
}
.alerta-bultos-pedido:last-child { border-bottom: none; }
.alerta-bultos-pedido.destacada {
    background: #fff7ed;
    border-left: 4px solid #ea580c;
    padding-left: calc(1rem - 4px);
}
.alerta-bultos-icono {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}
.alerta-bultos-cuerpo { flex: 1; min-width: 0; }
.alerta-bultos-titulo {
    font-size: 0.8125rem;
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.3;
}
.alerta-bultos-sub {
    font-size: 0.6875rem;
    color: #b45309;
    margin-top: 0.15rem;
}
.alerta-bultos-detalle {
    font-size: 0.625rem;
    color: #a16207;
    margin-top: 0.2rem;
}
.alerta-bultos-contador {
    flex-shrink: 0;
    text-align: center;
    font-family: ui-monospace, monospace;
    font-weight: 800;
    font-size: 0.875rem;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.25rem;
    padding: 0.35rem 0.5rem;
    line-height: 1.1;
}
.alerta-bultos-num { color: #c2410c; font-size: 1rem; }
.alerta-bultos-sep { opacity: 0.5; margin: 0 0.1rem; }
.alerta-bultos-reg {
    display: block;
    font-size: 0.5625rem;
    font-weight: 600;
    color: #a16207;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.alerta-bultos-cajas {
    margin: 0.35rem 0 0;
    padding: 0.35rem 0 0 1rem;
    font-size: 0.625rem;
    color: #78350f;
    line-height: 1.45;
}
.alerta-bultos-aviso-registro {
    margin-top: 0.35rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #c2410c;
    line-height: 1.35;
}
.alerta-bultos-btn-buscar {
    margin-top: 0.4rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}
.alerta-bultos-btn-buscar:hover { background: #dbeafe; }
