/* ============================================
   MAIN APP
   ============================================ */

.main-app {
    display: none;
}

.main-app.active {
    display: block;
}

/* ============================================
   SIDE MENU
   ============================================ */

.side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    /* No a pantalla completa: se ve una franja de la app detrás (y que se
       puede tocar para cerrar) */
    width: 82%;
    max-width: 320px;
    height: 100%;
    background: white;
    z-index: 1000;
    /* Cerrado = oculto de verdad (visibility), también para el tabulador */
    visibility: hidden;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.4s;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0);
    /* Barra siempre puesta, aunque no haga falta: con "auto" aparecía y
       desaparecía al abrir o cerrar un desplegable y el menú daba un salto */
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

.side-menu.open {
    left: 0;
    visibility: visible;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-header {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    padding: 24px;
    color: white;
}

.menu-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.menu-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-user-info h3 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.menu-user-info p {
    font-size: 14px;
    opacity: 0.9;
}

.menu-content {
    padding: 8px 0;
}

/* Opciones del menú más juntas, con la misma línea fina entre todas */
.menu-section {
    padding: 0;
}
.menu-section + .menu-section::before {
    content: '';
    display: block;
    height: 1px;
    background: var(--border-color);
    margin: 4px 24px;
}

.menu-item {
    padding: 11px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    border-left: 4px solid transparent;
}

.menu-item:hover {
    background: var(--bg-main);
    border-left-color: var(--primary-green);
}

.menu-item.expandable:hover {
    background: var(--border-color);
}

.menu-item.expanded {
    background: var(--border-color);
    border-left-color: var(--primary-green);
}

.menu-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-green);
    flex-shrink: 0;
}

.menu-item:hover .menu-item-icon {
    background: white;
}

.menu-item-content {
    flex: 1;
}

.menu-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.menu-item-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.menu-item-arrow {
    color: var(--text-light);
    transition: transform 0.3s ease;
}

.menu-item.expanded .menu-item-arrow {
    transform: rotate(90deg);
}

.menu-expandable-content {
    max-height: 0;
    overflow: hidden !important;
    /* Plegada = oculta de verdad (visibility): si no, el tabulador se paraba en
       sus botones sin verse. Se oculta al acabar la animación de plegado. */
    visibility: hidden;
    transition: max-height 0.4s ease, visibility 0s linear 0.4s;
    background: var(--bg-main);
}

.menu-expandable-content.open {
    max-height: 800px;
    visibility: visible;
    transition: max-height 0.4s ease, visibility 0s;
}

.menu-detail-item {
    padding: 6px 24px 6px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.menu-detail-item:first-child {
    padding-top: 10px;
}

.menu-detail-item:last-child {
    padding-bottom: 10px;
}

.menu-detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.menu-detail-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.maestro-count {
    display: inline-block;
    background: var(--primary-green);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 28px;
    text-align: center;
}

.maestro-version {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 1px;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.maestro-label-group {
    display: flex;
    flex-direction: column;
}

.maestro-row {
    min-height: 36px;
}

.sync-countdown {
    display: inline-block;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
    background: rgba(76, 175, 80, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    min-width: 42px;
    text-align: center;
}

.menu-action-btn {
    margin: 8px 24px 10px 24px;
    padding: 12px 16px;
    /* Con relleno, como "Cambiar cliente" (verde corporativo en degradado) */
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    border: 2px solid transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(124, 179, 66, 0.18);
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 48px);
    box-shadow: 0 2px 8px rgba(124, 179, 66, 0.1);
}

.menu-action-btn:hover,
.menu-action-btn:focus-visible {
    background: linear-gradient(135deg, var(--primary-dark), #33691E);
    color: white;
}
.menu-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(85, 139, 47, 0.25);
}

.menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 24px;
}

.menu-version {
    padding: 24px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
}

/* ============================================
   HEADER
   ============================================ */

.app-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-self: start;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
}

.app-logo-wrapper {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.app-logo-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    width: 120px;
}

.logo-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: logoSpin 0.8s linear infinite;
}

@keyframes logoSpin {
    to { transform: rotate(360deg); }
}

.menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-main);
    /* Sin color propio el icono (currentColor) sale en el azul de sistema del iPhone */
    color: var(--text-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--border-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   BOTTOM NAV
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 12px 24px 20px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.nav-item:hover {
    background: var(--bg-main);
}

.nav-item.active {
    color: var(--primary-green);
    background: var(--border-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

/* Abajo, hueco para la barra y para el botón Nueva devolución (fijo de 120 a
   176 px del borde): si no, tapaba los botones de la última tarjeta del listado */
.main-content {
    padding: 24px 24px calc(200px + env(safe-area-inset-bottom, 0px));
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   UTILIDADES VIEW
   ============================================ */

.view-utilidades {
    display: none;
}

.utilities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.utility-card {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.utility-card:hover {
    border-color: var(--primary-green);
    background: #F7FBF2;
}

/* Sin activar en el laboratorio (n_cuenta, gestion_muestras): se ve, apagada;
   al tocarla sale el aviso de que no está disponible */
.utility-card.deshabilitada {
    opacity: 0.45;
    filter: grayscale(1);
    cursor: not-allowed;
}
.utility-card.deshabilitada:hover {
    border-color: var(--border-color);
    background: white;
}

.utility-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Cerrar sesión: en rojo, como en el menú */
.utility-icon.utility-icon-salir {
    background: linear-gradient(135deg, #EF9A9A, #F44336);
}

.utility-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.utility-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

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

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

/* Aviso para instalar la app (js/instalar.js): tarjeta abajo, encima de la
   barra de navegación y del botón Nueva devolución */
.instalar-aviso {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    z-index: 900;   /* sobre la app y su barra (100); bajo el menú (1000) y los modales */
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    background: white;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .3s ease, transform .3s ease;
}
.instalar-aviso.visible { opacity: 1; transform: none; }
.instalar-logo { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; }
.instalar-cuerpo { flex: 1; min-width: 0; }
.instalar-titulo { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--text-primary); }
.instalar-texto { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.instalar-ico { vertical-align: -3px; color: #1976D2; }
.instalar-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.instalar-no,
.instalar-si {
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.instalar-no { background: white; border: 1.5px solid var(--border-color); color: var(--text-secondary); }
.instalar-no:hover { background: #FFF5F5; border-color: #F44336; color: #F44336; }
.instalar-si { background: var(--primary-green); border: none; color: white; }
.instalar-si:hover { background: var(--primary-dark); }

.toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10050; /* por encima de todo: modales (10000) y la vista de recuperar contraseña (10001) */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    gap: 12px;
}

.toast {
    background: white;
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    /* Nunca más ancho que la pantalla (a 320 px se salía por los dos lados) */
    min-width: min(280px, calc(100vw - 32px));
    max-width: min(360px, calc(100vw - 32px));
    box-sizing: border-box;
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: none;
    border-top: 4px solid;
    pointer-events: all;
    position: relative;
}

.toast.success { border-top-color: #4CAF50; }
.toast.error { border-top-color: #F44336; }
.toast.warning { border-top-color: #FF9800; }
.toast.info { border-top-color: #2196F3; }

.toast-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.toast.error .toast-icon {
    color: #F44336;
    background: rgba(244, 67, 54, 0.1);
}

.toast.warning .toast-icon {
    color: #FF9800;
    background: rgba(255, 152, 0, 0.1);
}

.toast.info .toast-icon {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.toast-content {
    flex: 1;
    width: 100%;
    min-width: 0;
}

.toast-title {
    overflow-wrap: anywhere;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow-wrap: anywhere;   /* un email largo es una sola "palabra": que se parta */
}

.toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-main);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

@keyframes toastIn {
    from {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    to {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
}

/* ============================================
   OFFLINE BANNER
   ============================================ */

.offline-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #EF6C00;
    color: white;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.offline-banner.visible {
    display: flex;
}

/* Sin conexión: lo que va pegado arriba se baja lo que mide la franja
   (--franja la pone init.js), o la franja tapa Volver, Enviar, Buscar... */
body.sin-conexion {
    padding-top: var(--franja, 40px);
}
body.sin-conexion .app-header {
    top: var(--franja, 40px);
}
body.sin-conexion .side-menu {
    top: var(--franja, 40px);
    height: auto;
    bottom: 0;
}
body.sin-conexion .search-fullscreen,
body.sin-conexion .detalle-fullscreen,
body.sin-conexion .manual-entry-view,
body.sin-conexion .add-line-modal,
body.sin-conexion .scanner-modal {
    top: var(--franja, 40px);
}

/* ============================================
   MOBILE OPTIMIZATION (≤480px)
   ============================================ */

@media (max-width: 480px) {
    /* 10px de lado, no 12: el envoltorio comun de todas las vistas. Suma al
       relleno propio de cada ficha (.step-card 14, .list-card-body 12,
       .stat-card 14), asi que aqui cada pixel cuenta el doble. */
    .main-content {
        padding: 16px 10px calc(200px + env(safe-area-inset-bottom, 0px));
    }

    .app-header {
        padding: 14px 16px;
        min-height: 60px;
    }

    

    .bottom-nav {
        padding: 8px 12px 14px;
    }

    

    .modal-overlay {
        padding: 12px;
    }

    .modal-header {
        padding: 16px 16px 14px;
    }

    .modal-title {
        font-size: 17px;
    }

    .modal-body {
        padding: 16px;
    }

    .menu-header {
        padding: 20px 16px;
    }

    .menu-item {
        padding: 14px 16px;
    }

    .toast-content {
        padding: 14px 18px;
    }
}

/* ============================================
   HUESOS (contenido fantasma mientras carga)
   ============================================

   Un "hueso" es un bloque gris con un brillo que lo recorre, colocado en el
   sitio exacto que va a ocupar el dato real. Frente a un círculo girando, no
   obliga a recolocar la vista cuando termina y, sobre todo, no cambia la
   composición al sustituirlo: la silueta ya es la definitiva.

   Se define aquí, en el fichero común, porque lo usan el panel (contadores y
   gráfica) y el listado, y antes había dos copias del mismo degradado. */

:root {
    --brillo-espera: linear-gradient(90deg, #E8ECF1 25%, #F5F7FA 50%, #E8ECF1 75%);
}

@keyframes brilloEspera {
    to { background-position: -200% 0; }
}

.hueso {
    background: var(--brillo-espera);
    background-size: 200% 100%;
    animation: brilloEspera 1.2s linear infinite;
    border-radius: 8px;
}

/* Piezas con la silueta de lo que sustituyen. */
.hueso-icono {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
}

.hueso-linea {
    height: 11px;
    border-radius: 6px;
}

.hueso-linea-1 {
    width: 62%;
    margin-bottom: 8px;
}

.hueso-linea-2 {
    width: 38%;
}

.hueso-chip {
    width: 66px;
    height: 22px;
    flex-shrink: 0;
}

.hueso-dato {
    width: 72px;
    height: 14px;
}

.hueso-boton {
    flex: 1;
    height: 42px;
    border-radius: 10px;
}

/* Las filas fantasma no responden: no hay nada que abrir todavía. */
.fantasma {
    pointer-events: none;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .hueso {
        animation: none;
        background: #E8ECF1;
    }
}

/* ============================================
   "ACTUALIZANDO LA APP…" (mostrarActualizando en main.js)
   De fondo, una copia del splash (se clona su HTML, así que lleva sus mismas
   clases); encima, velado y desenfocado, el modal del progreso de entrada.
   Por encima de todo, también del splash y del login.
   ============================================ */
.actualizando-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(160deg, #5BBFB5 0%, #8DD4B8 18%, #C5E8C0 35%, #EAF2D0 50%, #C5E8C0 65%, #8DD4B8 82%, #5BBFB5 100%);
}
.actualizando-overlay.active {
    display: flex;
}
/* Sin las entradas del splash (rebote del logo, fundido de la marca, caída de
   "Pharma Returns Services", línea): aquí todo está desde el principio. Se
   quedan el anillo que gira, los orbes y las partículas. */
.actualizando-overlay .splash-glow-ring,
.actualizando-overlay .splash-text,
.actualizando-overlay .splash-line {
    animation: none;
}
.actualizando-overlay .splash-word {
    animation: none;
    opacity: 1;
}
/* Velo y modal: los del progreso de entrada (.login-modal-overlay y
   .login-modal, login.css), con el splash desenfocado detrás */
.actualizando-velo {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.actualizando-cabecera {
    display: flex;
    align-items: center;
    gap: 12px;
}
.actualizando-titulo {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.actualizando-texto {
    margin: 6px 0 20px 34px; /* alineado con el título, pasado el indicador */
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary);
}
.actualizando-modal .login-modal-progress {
    margin-bottom: 0;
}

/* Banda "Ya tienes la última versión" (avisoUltimaVersion en main.js):
   arriba, entra deslizándose y se va sola. Por encima del splash. */
.version-banda {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    z-index: 20001;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--primary-dark);
    color: white;
    font-size: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, -150%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    pointer-events: none;
}
.version-banda.visible {
    transform: translate(-50%, 0);
    opacity: 1;
}
.version-banda svg {
    flex-shrink: 0;
}

/* Contador de devoluciones "En espera" sobre Listado (SyncQueue.updateBadge).
   Ámbar si solo esperan a salir; rojo si alguna la ha rechazado el servidor. */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #D97706;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.nav-badge.alerta { background: #DC2626; }
.nav-badge[hidden] { display: none; }

/* Menú > Ajustes: datos obligatorios del laboratorio (main.js pintarObligatorios) */
/* Menú > Ajustes (pintarAjustes, main.js): la lista es larga, más alto que
   el resto de desplegables del menú */
.menu-expandable-content.ajustes-lab.open { max-height: 2400px; }
.ajustes-lista { padding: 16px 24px 12px 28px; display: flex; flex-direction: column; gap: 14px; }
.ajustes-grupo-titulo {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin-bottom: 4px;
}
.ajuste-fila {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}
.ajuste-fila:last-child { border-bottom: 0; }
.ajuste-nombre { color: var(--text-secondary); }
.ajuste-valor { font-weight: 600; color: var(--text-light); text-align: right; }
.ajuste-valor.on { color: var(--text-primary); }
/* Activado: ✓ verde; desactivado: ✕ gris. Solo el signo, sin recuadro ni
   fondo, para que no parezca una casilla que se pueda pulsar */
.ajuste-check {
    flex-shrink: 0;
    align-self: center;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #B0BEC5;
    pointer-events: none;
}
.ajuste-check.on { color: var(--primary-dark); }

.ajuste-chip {
    padding: 4px 10px;
    background: var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Zona táctil de al menos 44 px sin cambiar el dibujo: un pseudo-elemento
   transparente alrededor del botón recibe el toque (el aspa del aviso medía 28,
   el menú 40 y el paginador 36: fáciles de fallar con el dedo). */
.menu-toggle,
.pagination-btn {
    position: relative;
}
.menu-toggle::after,
.toast-close::after,
.pagination-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
}

/* Botones dentro de los desplegables del menú: en una línea */
.menu-expandable-content .menu-action-btn { white-space: nowrap; }
.menu-btn-estado { font-weight: 500; opacity: 0.8; }

/* Cambio de contraseña obligatorio (clave de la app anterior que no cumple la
   política): sin botón de volver y con el motivo arriba */
#cambiarClaveFullscreen.obligatorio #cambiarClaveBack { visibility: hidden; }
.clave-obligatoria-aviso {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    color: #5D4037;
    font-size: 14px;
    line-height: 1.45;
}
.clave-obligatoria-aviso p { margin: 0 0 10px; }
