::-webkit-scrollbar { display: none; }
    body { overscroll-behavior: none; min-height: max(844px, 100dvh); }
    .pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }
    .pt-safe { padding-top: env(safe-area-inset-top, 0px); }
    .spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
    .spinner-light { border-top-color: #829bca; border-color: rgba(130,155,202,.3); }
    @keyframes spin { to { transform: rotate(360deg); } }
    .sheet-overlay { position: fixed; inset: 0; background: rgba(11,28,48,.6); z-index: 200; display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
    .sheet-overlay.open { opacity: 1; pointer-events: auto; }
    .sheet-panel { width: 100%; max-width: 520px; background: #fff; border-radius: 1.25rem 1.25rem 0 0; padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .3s cubic-bezier(.32,.72,0,1); max-height: 88dvh; overflow-y: auto; }
    /* Variante ancha: sheets con tabla de previsualización (carga masiva) que se ven apretados en 520px en escritorio/tablet. */
    .sheet-panel-lg { max-width: 720px; }
    #carga-masiva-dropzone.drag-activo { border-color: #16325b; background: rgba(22,50,91,.05); }
    .sheet-overlay.open .sheet-panel { transform: translateY(0); }
    #toast-container { position: fixed; bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; width: calc(100% - 2rem); max-width: 420px; }
    .toast { padding: .75rem 1rem; border-radius: .5rem; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; font-weight: 500; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.18); opacity: 0; transform: translateY(12px); animation: toast-in .3s ease forwards, toast-out .3s ease 3.2s forwards; }
    @keyframes toast-in { to { opacity: 1; transform: translateY(0); } }
    @keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-8px); } }
    .view { display: none; }
    .view.active { display: flex; flex-direction: column; min-height: 100dvh; }
    .num-key:active { background: #16325b; color: #fff; transform: scale(.93); }
    #area-gafetes { display: none; }
    .gafete-print { width: 320px; border: 1px dashed #999; border-radius: 10px; padding: 16px; text-align: center; page-break-inside: avoid; margin-bottom: 14px; display: inline-block; }
    @media print { body * { visibility: hidden; } #area-gafetes, #area-gafetes * { visibility: visible; } #area-gafetes { display: block !important; position: absolute; top: 0; left: 0; } }
    .dash-tab.active-tab { color: #fff; border-color: #fea619; background: rgba(254,166,25,.14); }
    .dash-tab { border-left-width: 3px; }
    .dash-tab:not(.active-tab):hover { background: rgba(255,255,255,.06); }
    /* Drawer del sidebar abierto en móvil: quita el scroll de fondo */
    body.menu-abierto { overflow: hidden; }
    #vista-scanner-qr { position: fixed; inset: 0; background: #000; z-index: 1070; flex-direction: column; }
    #vista-scanner-qr:not(.hidden) { display: flex; }
    #lector-qr { width: 100%; height: 100%; }
    #lector-qr video { object-fit: cover; }
    .qr-frame-hint { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
    .qr-frame-hint span { width: 240px; height: 240px; border: 3px solid rgba(255,255,255,.85); border-radius: 1rem; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
