/* ============================================
   LISTADO VIEW
   ============================================ */

.view-listado {
    display: none;
}

.view-dashboard,
.view-listado {
    display: none;
}

.view-dashboard {
    display: block;
}

.listado-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.listado-subtitle {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.search-btn {
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--primary-green);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(124,179,66,0.3);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.search-btn:active {
    transform: scale(0.95);
}

/* Tabs - Segmented Control */
.listado-tabs {
    display: flex;
    margin-bottom: 16px;
    background: white;
    border-radius: 14px;
    padding: 4px;
    border: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 11px 16px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
}

.tab-btn.active {
    background: var(--primary-green);
    color: white;
    box-shadow: 0 2px 8px rgba(124,179,66,0.3);
}

.tab-label {
    font-size: 14px;
}

.tab-badge {
    background: rgba(0,0,0,0.06);
    color: var(--text-light);
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.tab-btn.active .tab-badge {
    background: rgba(255,255,255,0.25);
    color: white;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Search Fullscreen View */
.search-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-main);
    z-index: 9000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.search-fullscreen.active {
    display: flex !important;
    animation: entraDerecha 0.3s ease;
}

.search-fs-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

/* A todo lo ancho, con los botones pegados a los bordes. El centrado es cosa
   del contenido, no de la barra: una cabecera de accion se lee mejor con los
   controles en las esquinas, donde el pulgar llega sin estirarse. */
.search-fs-header-inner {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.search-fs-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    min-width: 0;              /* que el título ceda sitio a los botones */
    overflow-wrap: break-word;
    text-align: center;
}

.search-fs-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.search-fs-btn-clear {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid #9CA3AF;
    background: white;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: #4B5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Buscar, Enviar (cuenta, incidencia), Cambiar (contraseña) y Limpiar: el
   mismo alto que "Siguiente" de Nueva devolución (42 px; 48 en móvil) */
.search-fs-btn-clear,
.search-fs-btn-search {
    min-height: 42px;
    justify-content: center;
    transition: background .2s, border-color .2s, color .2s;
}
@media (max-width: 768px) {
    .search-fs-btn-clear,
    .search-fs-btn-search { min-height: 48px; }
}
.search-fs-btn-search:hover { background: var(--primary-dark); }
.search-fs-btn-search:active { background: #33691E; }
/* Limpiar, con el mismo efecto que Cancelar */
.search-fs-btn-clear:hover { background: #FFF5F5; border-color: #F44336; color: #F44336; }

.search-fs-btn-search {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: var(--primary-green);
    color: white;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* El contenedor que se desplaza ocupa todo el ancho: asi la barra queda en el
   borde de la ventana y no flotando a mitad de pantalla, que es lo que pasaba
   cuando el max-width estaba aqui. */
.search-fs-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
    width: 100%;
}

/* El centrado se aplica al contenido, no al contenedor. 600 px porque esto es
   un formulario: mas ancho obligaria a recorrer la linea entera con la vista
   para llegar de la etiqueta al campo. */
.search-fs-content > * {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-field {
    margin-bottom: 18px;
}

.search-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.search-hint {
    display: block;
    margin: -4px 0 8px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1.35;
}

/* Las vistas de incidencia y cambio de contraseña reutilizan .search-field,
   así que el textarea tiene que verse igual que los input. */
.search-field input,
.search-field textarea,
.search-field select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: white;
}

.search-field input:focus,
.search-field textarea:focus,
.search-field select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(124, 179, 66, 0.1);
}

.search-field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Para la descripción de una incidencia: ahí se escriben párrafos, no una
   línea, y un campo bajo invita a resumir de más. */
.search-field textarea.search-field-alto {
    min-height: 260px;
}

.search-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.search-field-row {
    display: flex;
    gap: 12px;
}

.search-field-row .search-field {
    flex: 1;
    min-width: 0;
}

/* Móvil estrecho (un Android normal mide 360 px): la cabecera de estas
   pantallas no cabía (Buscar se salía por la derecha) y las dos fechas
   juntas tampoco */
@media (max-width: 420px) {
    .search-fullscreen .search-fs-header-inner { gap: 8px; padding-left: 12px; padding-right: 12px; }
    .search-fullscreen .search-fs-title { font-size: 16px; }
    .search-fullscreen .search-fs-title .solo-ancho { display: none; }   /* "Buscar devoluciones" -> "Buscar" */
    .search-fullscreen .search-fs-header-actions { gap: 6px; }
    .search-fullscreen .search-fs-btn-clear,
    .search-fullscreen .search-fs-btn-search { padding-left: 10px; padding-right: 10px; }
}
/* Las dos fechas, una debajo de otra en cualquier móvil: de lado a lado en
   un iPhone grande (430 px) se juntaban y no se leían (6.105.4) */
@media (max-width: 640px) {
    .search-fullscreen .search-field-row { flex-direction: column; gap: 0; }
}
@media (max-width: 359px) {
    #searchFullscreen .search-fs-header-actions svg { display: none; }
}

/* List Cards */
.returns-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-card {
    display: flex;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    animation: cardSlideIn 0.35s ease backwards;
    transition: box-shadow 0.2s ease;
}

/* Sin efecto al pulsar la ficha: la ficha entera no es pulsable —solo lo son
   los botones de dentro—, y encogerla al tocarla hacia creer que si. */

@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(8px); }
}

.list-card-accent {
    width: 4px;
    background: linear-gradient(180deg, #7CB342, #558B2F);
    flex-shrink: 0;
}

.list-card-body {
    flex: 1;
    padding: 14px 16px;
    min-width: 0;
}

.list-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.list-card-main {
    flex: 1;
    min-width: 0;
}

.list-card-client {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card-date {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
}

.list-card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-top: 2px;
}

.list-card-bottom {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    align-items: center;
    justify-content: space-between;
}

.list-card-chips {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

/* La clase (canal) arriba a la derecha de la tarjeta (.list-card-badge), con
   los colores de la franja del justificante: verde y roja en retiradas */
.list-card-canal {
    border: 1px solid #d1fae5;
    background: #ecfdf5;
    color: #065f46;
    white-space: nowrap;
}

.list-card-canal--retirada {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.list-card-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.list-card-chip.badge-aptos {
    /* Va después de dashboard.css: sin esto ganaba el gris del chip (6.104.4) */
    color: #1565C0;
    padding: 2px 8px;
    border-radius: 8px;
}

.list-card-chip svg {
    color: var(--text-light);
    flex-shrink: 0;
}

.list-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.list-card-actions .btn-line-action {
    font-size: 11px;
    padding: 0 10px;
    /* Mismo alto que .search-btn (38 px) */
    height: 38px;
    box-sizing: border-box;
}

/* Con fondo, como el resto de la app: Estado en azul suave con borde (igual
   que Generar incidencia en ámbar) y Ver detalle igual en verde (abajo). */
.list-card-actions .btn-estado {
    color: #1565C0;
    background: #E3F2FD;
    border-color: #90CAF9;
    font-weight: 700;
}
.list-card-actions .btn-estado:hover { background: #BBDEFB; border-color: #64B5F6; }
.list-card-actions .btn-estado:active { background: #90CAF9; }

/* Ver detalle en verde suave, como Estado en azul (6.110.4): lleno, una por
   tarjeta, cargaba la lista y competía con el naranja de Nueva devolución */
.list-card-actions .btn-contenido {
    color: #33691E;
    background: #F1F8E9;
    border-color: var(--accent-green);
    font-weight: 700;
}
.list-card-actions .btn-contenido:hover { background: #DCEDC8; border-color: var(--primary-light); }
.list-card-actions .btn-contenido:active { background: #C5E1A5; }

/* Responsive */
@media (max-width: 768px) {
    .listado-title {
        font-size: 24px;
    }
}

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

@media (max-width: 480px) {
    .listado-header {
        margin-bottom: 12px;
    }

    .listado-title {
        font-size: 20px;
    }

    .listado-tabs {
        margin-bottom: 12px;
        gap: 4px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .list-card-body {
        padding: 12px;
    }

    /* ── Ficha del listado en movil ──
       Solo tenia el relleno ajustado; el resto se quedaba con los tamanos de
       escritorio (cliente a 14px, fecha a 12, etiqueta a 10). */
    .list-card-client {
        font-size: 16px;
    }

    .list-card-date {
        font-size: 13px;
        margin-top: 4px;
    }

    .list-card-badge {
        font-size: 11px;
        padding: 4px 11px;
    }

    .list-card-chip {
        font-size: 13px;
        gap: 6px;
    }

    .list-card-chip svg {
        width: 15px;
        height: 15px;
    }

    /* Los datos y los dos botones no caben en la misma linea con este tamano:
       unidades + importe + "Estado" + "Ver detalle" piden unos 381px y en una
       pantalla de 390 quedan 342. Se reparten en dos filas y los botones pasan
       a ocupar el ancho completo, que ademas los hace mas faciles de acertar. */
    .list-card-bottom {
        flex-wrap: wrap;
        gap: 10px;
    }

    .list-card-chips {
        flex: 1 1 100%;
        gap: 14px;
    }

    .list-card-actions {
        flex: 1 1 100%;
        gap: 8px;
    }

    .list-card-actions .btn-line-action {
        flex: 1;
        font-size: 13px;
        padding: 0 12px;
        height: 38px;
        justify-content: center;
        gap: 6px;
    }

    .list-card-actions .btn-line-action svg {
        width: 16px;
        height: 16px;
    }

    

    .search-fs-content {
        padding: 16px;
    }

    .search-fs-header-inner {
        padding: 12px 16px;
    }

    .search-field label {
        font-size: 13px;
    }
}

/* ── Detalle de una devolución ──────────────────────────────────────────────
   Replica el justificante que el cliente recibe por email: mismos colores,
   misma agrupación de columnas y misma fila de totales. El delegado ya conoce
   ese documento, así que la pantalla no le pide aprender otra cosa.

   Los colores van literales y no con las variables del tema: son la identidad
   del justificante, y si el tema de la app cambia, este documento no debería
   cambiar con él. */
.detalle-fullscreen {
    --j-accent: #16a34a;
    --j-dark:   #0f172a;
    --j-text:   #0f172a;
    --j-muted:  #64748b;
    --j-line:   #e5e7eb;
    --j-soft:   #f8fafc;
    --j-zebra:  #fffef5;
    --j-chip-bg: #ecfdf5;
    --j-chip-tx: #065f46;
    --j-warn-bg: #fffbeb;
    --j-warn-ln: #fde68a;
    --j-warn-tx: #78350f;

    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    /* El MARCO de la pantalla usa la paleta de la app, igual que la busqueda;
       la del justificante (--j-*) se reserva para el documento de dentro. Si
       no, el fondo tira a gris azulado y desentona con el resto. */
    background: var(--bg-main);
    z-index: 9000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.detalle-fullscreen.active {
    display: flex !important;
    animation: entraDerecha 0.3s ease;
}

/* Con una pantalla superpuesta abierta (detalle o busqueda), la pagina de
   debajo no debe desplazarse: si no, se ven dos barras a la vez y la rueda del
   raton mueve lo de detras en vez de lo que se esta mirando.
   Clase compartida para no acabar con un nombre distinto por cada panel. */
body.overlay-abierto {
    overflow: hidden;
}

.detalle-fs-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

/* El contenido se centra con el mismo ancho maximo que .main-content, para
   que en pantallas anchas el detalle quede alineado con el resto de la app y
   no pegado al borde izquierdo. */
.detalle-fs-header-inner {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Hueco del mismo ancho que el boton de volver. Sin el, el titulo con flex:1
   se centra en el espacio QUE SOBRA a la derecha del boton, no en la barra:
   el resultado es un titulo descentrado y un boton que no parece pegado a la
   izquierda. Es el mismo equilibrio de tres huecos que tiene la cabecera de
   busqueda, donde el tercero son los botones de accion. */
.detalle-fs-hueco {
    width: 44px;
    flex-shrink: 0;
}

.detalle-fs-header-inner .btn-back {
    flex-shrink: 0;
}

.detalle-fs-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--j-text);
    margin: 0;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detalle-fs-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mismo ancho y mismo relleno que .main-content. La barra de desplazamiento se
   queda en el borde de la ventana, no en el del contenido, igual que en el
   resto de pantallas. */
.detalle-contenido {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 40px;
}

@media (max-width: 640px) {
    .detalle-contenido { padding: 16px 16px 32px; }
}

/* ── Tarjetas de cabecera, como los bloques del justificante ── */
.detalle-bloque {
    border: 1px solid var(--j-line);
    border-radius: 14px;
    background: white;
    padding: 10px 12px;
    margin-bottom: 6px;
}

.detalle-bloque:first-child {
    background: var(--j-soft);
}

.detalle-bloque dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: var(--j-muted);
    font-weight: 600;
    margin: 0;
}

.detalle-bloque dd {
    margin: 5px 0 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--j-text);
    line-height: 1.35;
}

/* Dos columnas en movil y cuatro a partir de tablet. Se fijan a proposito en
   vez de usar auto-fit: con cuatro bloques, una rejilla automatica cae en un
   3 + 1 en las anchuras intermedias y deja dos huecos. */
.detalle-bloques {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}

@media (min-width: 620px) {
    .detalle-bloques {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* El cliente ocupa la fila entera: es el dato mas largo y el que primero se
   busca al abrir el documento. */
.detalle-bloque--ancho {
    grid-column: 1 / -1;
}

.detalle-bloques .detalle-bloque {
    margin-bottom: 0;
}

/* ── Título de sección ── */
.detalle-seccion {
    margin: 18px 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .10em;
    font-weight: 700;
    color: var(--j-chip-tx);
}

/* ── Tabla de productos ── */
.detalle-tabla-wrap {
    border: 1px solid var(--j-line);
    border-radius: 14px;
    overflow: hidden;
    background: white;
}

/* Cinco columnas: caben en la anchura de un movil sin desplazamiento lateral,
   que es el motivo de agrupar EAN/CN y lote/caducidad en vez de separarlos. */
.detalle-tabla {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.detalle-tabla th {
    padding: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .10em;
    color: #374151;
    font-weight: 700;
    background: var(--j-soft);
    border-bottom: 1px solid var(--j-line);
    text-align: left;
}

.detalle-tabla td {
    padding: 7px 8px;
    font-size: 13px;
    color: var(--j-text);
    border-bottom: 1px solid var(--j-line);
    vertical-align: top;
    word-break: break-word;
}

.detalle-tabla tbody tr:nth-child(even) td {
    background: var(--j-zebra);
}

.detalle-tabla .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* La información secundaria va debajo del producto, en gris pequeño: es lo
   que permite bajar de 15 columnas a 5 sin perder ningún dato. */
.detalle-meta {
    font-size: 11px;
    color: var(--j-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.detalle-sust {
    margin-top: 4px;
    font-size: 11px;
    color: var(--j-warn-tx);
    background: var(--j-warn-bg);
    border: 1px solid var(--j-warn-ln);
    border-radius: 8px;
    padding: 4px 6px;
}

/* ── Fila de totales, en oscuro ── */
.detalle-tabla tfoot td {
    background: var(--j-dark);
    border-bottom: none;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
}

.detalle-tabla tfoot .rotulo {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .10em;
}

/* Las cifras no se parten por dentro ("10," / "50" / "€"): como mucho baja el € */
.detalle-tabla .num,
.detalle-tabla tfoot .uds,
.detalle-tabla tfoot .imp {
    word-break: normal;
    overflow-wrap: normal;
}
@media (max-width: 480px) {
    .detalle-tabla th { letter-spacing: .02em; }
    .detalle-tabla th.num,
    .detalle-tabla td.num { padding-left: 4px; padding-right: 4px; }
    .detalle-tabla th[data-corto] .rot-largo { display: none; }
    .detalle-tabla th[data-corto]::after { content: attr(data-corto); }
}
.detalle-tabla tfoot .uds { color: #ffffff; }
.detalle-tabla tfoot .imp { color: #34d399; }

.detalle-vacio,
.detalle-cargando {
    text-align: center;
    padding: 40px 20px;
    color: var(--j-muted);
    font-size: 14px;
}

/* ── Campos de fecha sin el "dd/mm/aaaa" ────────────────────────────────────
   Ese texto no es un placeholder: lo pinta el propio navegador dentro del
   campo y no hay atributo que lo quite. Se oculta poniendo transparente la
   zona de edición mientras el campo está vacío, y vuelve a verse al enfocarlo
   (si no, al pulsar no sabrías qué se está escribiendo).

   Los selectores son de WebKit, que cubre Chrome, Edge, Safari y los móviles.
   Firefox de escritorio seguirá mostrándolo: no expone esa parte al CSS. */
.search-field input[type="date"][data-vacio]:not(:focus)::-webkit-datetime-edit {
    color: transparent;
}

/* Fechas con el mismo ancho y alto que los demás campos y un icono de
   calendario propio (6.105.5). En el iPhone el campo de fecha nativo era más
   ancho que su caja, centraba la fecha y no tenía ningún icono: vacío quedaba
   un recuadro sin pista de que es una fecha. El icono del navegador (Chrome)
   queda invisible encima del nuestro, para que al pulsarlo abra el calendario. */
.search-field input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    padding-right: 48px;
    text-align: left;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px 20px;
}

.search-field input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.search-field input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    width: 24px;
    height: 24px;
    margin-right: -4px;
}

/* ============================================
   DETALLE DE LA DEVOLUCIÓN EN MÓVIL
   ============================================

   La pantalla de detalle no tenía ningún ajuste para móvil: se quedaba con
   los tamaños pensados para verse en un monitor (cabeceras de tabla a 11px,
   celdas a 13, etiquetas de los bloques a 12).

   Va al final del fichero a propósito. Sus reglas base se declaran más
   arriba, así que un bloque colocado antes perdería contra ellas por orden
   de cascada al tener la misma especificidad.

   Subir el tamaño de la tabla es seguro: `.detalle-tabla` es `table-layout:
   fixed` con `word-break: break-word`, así que las celdas parten la línea en
   vez de ensanchar la tabla. Las filas quedan algo más altas; desplazamiento
   lateral no aparece. */

@media (max-width: 480px) {
    .detalle-fs-title {
        font-size: 17px;
    }

    .detalle-bloque dd {
        font-size: 15px;
    }

    .detalle-seccion {
        font-size: 15px;
    }

    .detalle-tabla th {
        font-size: 12px;
        padding: 9px 8px;
    }

    .detalle-tabla td {
        font-size: 14px;
        padding: 9px 8px;
    }

    .detalle-meta,
    .detalle-sust {
        font-size: 12px;
    }

    .detalle-tabla tfoot td {
        font-size: 14px;
        padding: 10px 8px;
    }

    .detalle-tabla tfoot .rotulo {
        font-size: 12px;
    }

    .detalle-cargando {
        font-size: 15px;
    }
}

/* El paginador se queda en su sitio mientras se carga la página nueva: solo
   se atenúa y deja de admitir pulsaciones, para que no se encolen dos
   peticiones si alguien toca dos números seguidos. */
#listadoPaginador.cargando {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ============================================
   ESTADO DE LA DEVOLUCION
   ============================================
   Reutiliza el armazon de .detalle-fullscreen (cabecera, cuerpo que se
   desplaza). Dos escenas animadas en SVG: la caja viajando (en transito) y la
   caja aterrizando con su sello (tratada). */
#estadoFullscreen {
    --est-ambar: #F59E0B;
    --est-ambar-suave: #FEF3C7;
    --est-verde: var(--primary-green);
    --est-verde-osc: var(--primary-dark);
    --est-carton: #D6A56B;
    --est-carton-osc: #B98147;
    --est-carton-claro: #E8C28F;
}

.est-contenido {
    max-width: 520px;
    margin: 0 auto;
    padding: 18px 16px 32px;
    text-align: center;
}

.est-consultando {
    padding: 70px 0;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.est-radar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--est-verde);
    animation: estRadar 1.1s ease-out infinite;
}

@keyframes estRadar {
    0%   { transform: scale(.4); opacity: .9; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ── Escena ── */
.est-escena {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 16px;
    animation: estEntra .45s ease both;
}
.est-escena-transito { background: linear-gradient(180deg, #FFFBEB 0%, #FEF3C7 100%); }
.est-escena-tratada  { background: linear-gradient(180deg, #F1F8E9 0%, #DCEDC8 100%); }

.est-svg { display: block; width: 100%; height: auto; max-height: 200px; }

.est-caja-lado     { fill: var(--est-carton-osc); }
.est-caja-frente   { fill: var(--est-carton); }
.est-caja-tapa     { fill: var(--est-carton-claro); }
.est-caja-cinta    { fill: #F5E6CC; opacity: .9; }
.est-caja-etiqueta { fill: #FFFFFF; opacity: .85; }

.est-solapa        { fill: var(--est-carton-claro); stroke: var(--est-carton-osc); stroke-width: .8; }
.est-solapa-atras  { fill: var(--est-carton-osc); }
.est-solapa-der    { filter: brightness(.94); }
.est-caja-hueco    { fill: #6B4423; }
.est-caja-dentro   { fill: #8A5A2E; }
.est-med path     { stroke: #94A3B8; stroke-width: .5; stroke-linejoin: round; }
.est-med-tapa     { fill: #FFFFFF; }
.est-med-frente   { fill: #F1F5F9; }
.est-med-lado     { fill: #CBD5E1; }
.est-med-2 .est-med-tapa   { fill: #E0F2FE; }
.est-med-2 .est-med-frente { fill: #BAE6FD; }
.est-med-2 .est-med-lado   { fill: #7DD3FC; }
.est-med-cruz     { fill: #22C55E; }

/* Lo de dentro asoma un poco y vuelve a bajar: se esta revisando. */
.est-contenido-caja {
    animation: estAsoma 2.4s ease-in-out 1.3s infinite;
}
@keyframes estAsoma {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}

.est-sombra { fill: rgba(0, 0, 0, .12); }

/* En transito: la caja traquetea, las lineas de velocidad pasan, la carretera
   corre y levanta polvo. */
/* La caja sale por la puerta de la farmacia, recorre la carretera y se
   queda a media carretera, sin volver a empezar. Al llegar se apagan el polvo y las
   lineas de velocidad; los saltos siguen. */
.est-viaje {
    animation: estViaje 1.9s ease-out .3s both;
}
/* Se para a media carretera: centrada en el tramo libre entre la farmacia y
   el borde derecho. */
@keyframes estViaje {
    0%   { transform: translateX(0);     opacity: 0; }
    12%  { transform: translateX(10px);  opacity: 1; }
    100% { transform: translateX(84px);  opacity: 1; }
}
.est-viaje .est-velocidad,
.est-viaje .est-polvo {
    animation: estApaga .35s ease 1.9s forwards;
}
@keyframes estApaga {
    to { opacity: 0; }
}

.est-fa-muro    { fill: #FFFFFF; stroke: #E5E7EB; stroke-width: 1.5; }
.est-fa-toldo   { fill: var(--est-verde); }
.est-fa-ventana { fill: #E0F2FE; stroke: #CBD5E1; stroke-width: 1; }
.est-fa-puerta  { fill: #CFE3B8; stroke: #9CC47A; stroke-width: 1; }
.est-fa-pomo    { fill: #558B2F; }
.est-fa-cruz rect { fill: #22C55E; }
.est-fa-cruz {
    animation: estCruz 1.6s ease-in-out infinite;
}
/* El neon de la cruz: se enciende y brilla. */
@keyframes estCruz {
    0%, 100% { opacity: .75; filter: drop-shadow(0 0 0 rgba(34, 197, 94, 0)); }
    50%      { opacity: 1;   filter: drop-shadow(0 0 5px rgba(34, 197, 94, .9)); }
}

/* La caja salta suave, como si la levantaran y la dejaran otra vez: sube
   despacio, casi sin inclinarse, y apoya con un leve asiento. No para: sigue
   saltando durante el viaje y cuando ya ha llegado. */
.est-salta {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: estSalta .8s ease-in-out .3s infinite;
}
@keyframes estSalta {
    0%, 100% { transform: translateY(0) scale(1.03, .97); }
    15%      { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-12px) rotate(2deg); }
    85%      { transform: translateY(0) scale(1); }
}

.est-escena-transito .est-sombra {
    fill: rgba(0, 0, 0, .14);
    transform-box: fill-box;
    transform-origin: center;
    animation: estSombra .8s ease-in-out .3s infinite;
}
/* Acompasada con el salto: se encoge cuando la caja esta arriba. */
@keyframes estSombra {
    0%, 100% { transform: scaleX(1);   opacity: 1; }
    50%      { transform: scaleX(.75); opacity: .6; }
}

/* Paisaje: dos copias seguidas que desfilan hacia la izquierda; al llegar a
   -240 la segunda ocupa el sitio de la primera y el bucle no se nota. */
.est-nubes   { animation: estDesfile 14s linear infinite; }
@keyframes estDesfile {
    to { transform: translateX(-240px); }
}
.est-copa   { fill: #A3C98A; }
.est-tronco { fill: #9C7A54; }
.est-nube circle, .est-nube rect { fill: #FFFFFF; opacity: .9; }
.est-asfalto { fill: #E9D9B5; }

.est-velocidad line {
    stroke: var(--est-ambar);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 24 60;
    animation: estViento .6s linear infinite;
}
.est-velocidad line:nth-child(2) { animation-delay: -.2s; stroke-width: 3; opacity: .7; }
.est-velocidad line:nth-child(3) { animation-delay: -.4s; stroke-width: 3; opacity: .5; }
@keyframes estViento {
    from { stroke-dashoffset: -84; }
    to   { stroke-dashoffset: 0; }
}

.est-carretera line {
    stroke: #FFFFFF;
    stroke-width: 3;
    stroke-dasharray: 16 10;
    animation: estCarretera .35s linear infinite;
}
@keyframes estCarretera {
    to { stroke-dashoffset: 26; }
}

.est-polvo circle {
    fill: #D9C08C;
    transform-box: fill-box;
    transform-origin: center;
    animation: estPolvo .8s ease-out infinite;
}
.est-polvo circle:nth-child(2) { animation-delay: .1s; }
.est-polvo circle:nth-child(3) { animation-delay: .2s; }
@keyframes estPolvo {
    0%   { transform: translate(0, 0) scale(.6); opacity: .9; }
    100% { transform: translate(-16px, -6px) scale(1.8); opacity: 0; }
}

/* Tratada: la caja cae y rebota, el halo late, el sello aparece y se dibuja
   el check, y salta un cerco de chispas. */
.est-aterriza {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: estAterriza .9s cubic-bezier(.3, 1.4, .5, 1) .35s both,
               estFlota 2.6s ease-in-out 1.4s infinite;
}
@keyframes estFlota {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}
@keyframes estAterriza {
    0%   { transform: translateY(-70px) scale(.9); opacity: 0; }
    55%  { transform: translateY(0) scale(1.06, .92); opacity: 1; }
    75%  { transform: translateY(-6px) scale(.98, 1.03); }
    100% { transform: translateY(0) scale(1); }
}

.est-sombra-fija {
    transform-box: fill-box;
    transform-origin: center;
    animation: estSombraCae .9s ease .35s both,
               estSombraFlota 2.6s ease-in-out 1.4s infinite;
}
@keyframes estSombraFlota {
    0%, 100% { transform: scaleX(1); opacity: 1; }
    50%      { transform: scaleX(.85); opacity: .7; }
}
@keyframes estSombraCae {
    0%   { transform: scaleX(.3); opacity: 0; }
    60%  { transform: scaleX(1.05); opacity: 1; }
    100% { transform: scaleX(1); }
}

.est-halo {
    fill: rgba(124, 179, 66, .16);
    transform-box: fill-box;
    transform-origin: center;
    animation: estHalo 2.4s ease-in-out .8s infinite;
}
@keyframes estHalo {
    0%, 100% { transform: scale(.94); opacity: .7; }
    50%      { transform: scale(1.06); opacity: 1; }
}

.est-sello {
    transform: scale(0);
    animation: estSello .5s cubic-bezier(.3, 1.6, .5, 1) 3s forwards,
               estSelloLatido 2.6s ease-in-out 4s infinite;
}
@keyframes estSelloLatido {
    0%, 100% { transform: scale(1); }
    12%      { transform: scale(1.18); }
    24%      { transform: scale(1); }
}
@keyframes estSello {
    to { transform: scale(1); }
}
.est-sello-fondo {
    fill: var(--est-verde);
    stroke: #FFFFFF;
    stroke-width: 4;
}
.est-sello-check {
    fill: none;
    stroke: #FFFFFF;
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 32;
    stroke-dashoffset: 32;
    animation: estCheck .4s ease-out 3.35s forwards;
}
@keyframes estCheck {
    to { stroke-dashoffset: 0; }
}

.est-chispa {
    stroke: var(--est-verde);
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0;
    animation: estChispa 2.6s ease-out calc(3.25s + var(--i) * 20ms) infinite;
}
/* Estallan al principio de cada vuelta y descansan el resto. */
@keyframes estChispa {
    0%   { opacity: 0; transform: scale(.7); }
    8%   { opacity: 1; }
    25%  { opacity: 0; transform: scale(1.35); }
    100% { opacity: 0; transform: scale(1.35); }
}

/* La hoja de verificacion: entra junto a la caja, se escriben los renglones
   uno a uno con su check, se firma, y despues cae el sello (3 s). */
.est-hoja {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: estHoja .6s cubic-bezier(.3, 1.4, .5, 1) .9s both,
               estHojaFlota 3.2s ease-in-out 3.6s infinite;
}
@keyframes estHoja {
    from { transform: translateY(24px) rotate(-10deg) scale(.7); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes estHojaFlota {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-4px) rotate(-1.5deg); }
}
.est-hoja-papel {
    fill: #FFFFFF;
    stroke: #D1D5DB;
    stroke-width: 1.2;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .12));
}
.est-hoja-doblez { fill: #E5E7EB; }
.est-hoja-pie    { stroke: #D1D5DB; stroke-width: 1; stroke-dasharray: 2 2; }

.est-hoja-titulo,
.est-renglon,
.est-hoja-check,
.est-hoja-firma {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: estEscribe .3s linear forwards;
}
.est-hoja-titulo { stroke: #374151; stroke-width: 3.2; animation-delay: 1.35s; }
.est-renglon {
    stroke: #9CA3AF;
    stroke-width: 2.4;
    animation-delay: calc(1.6s + var(--i) * .3s);
}
.est-hoja-check {
    stroke: var(--est-verde);
    stroke-width: 2.2;
    animation-duration: .2s;
    animation-delay: calc(1.85s + var(--i) * .3s);
}
.est-hoja-firma {
    stroke: #1E3A8A;
    stroke-width: 1.6;
    animation-duration: .45s;
    animation-delay: 2.85s;
}
@keyframes estEscribe {
    to { stroke-dashoffset: 0; }
}

/* ── Textos ── */
.est-titulo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    animation: estEntra .45s ease .1s both;
}
.est-es-transito .est-titulo { color: #B45309; }
.est-es-tratada  .est-titulo { color: var(--est-verde-osc); }

.est-sub {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-secondary);
    animation: estEntra .45s ease .15s both;
}

@keyframes estEntra {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ── Linea de progreso ── */
.est-pasos {
    list-style: none;
    margin: 20px 0 0;
    padding: 16px 18px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.est-paso {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 0 0 18px;
    animation: estEntra .4s ease calc(.25s + var(--i) * 90ms) both;
}
.est-paso:last-child { padding-bottom: 0; }

/* El tramo que une un punto con el siguiente. */
.est-paso:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: 2px;
    width: 2px;
    background: #E5E7EB;
}
.est-paso.est-hecho:not(:last-child)::after { background: var(--est-verde); }

.est-punto {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-top: 1px;
    border: 2px solid #D1D5DB;
    background: #FFFFFF;
    position: relative;
}
.est-hecho .est-punto {
    border-color: var(--est-verde);
    background: var(--est-verde);
}
.est-hecho .est-punto::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.est-actual .est-punto {
    border-color: var(--est-ambar);
    background: var(--est-ambar);
}
.est-actual .est-punto::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--est-ambar);
    animation: estLatido 1.4s ease-out infinite;
}
@keyframes estLatido {
    0%   { transform: scale(.6); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.est-paso-t { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.est-paso-f { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.est-pendiente .est-paso-t { color: var(--text-light); font-weight: 600; }
.est-pendiente .est-paso-f { color: var(--text-light); }
.est-actual .est-paso-f { color: #B45309; font-weight: 600; }
.est-paso-nota {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 3px;
    line-height: 1.35;
}
.est-paso-nota svg { flex-shrink: 0; margin-top: 1px; }

/* ── Datos ── */
.est-datos {
    margin-top: 14px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 4px 18px;
    text-align: left;
    animation: estEntra .45s ease .6s both;
}
.est-dato {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    font-size: 13px;
    border-bottom: 1px solid #F1F5F9;
}
.est-dato:last-child { border-bottom: none; }
.est-dato span { color: var(--text-secondary); flex-shrink: 0; }
.est-dato strong { color: var(--text-primary); text-align: right; word-break: break-word; }
.est-dato-dest strong { color: var(--est-verde-osc); font-size: 14px; letter-spacing: .02em; }

.est-demo {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--est-ambar-suave);
    color: #92400E;
    font-size: 12px;
    line-height: 1.4;
}

/* ── Reenviar justificante (arriba a la derecha del detalle) ── */
.detalle-acciones {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
/* "Incidencia" junto a "Reenviar justificante": mismo tamaño, en ámbar */
.btn-incidencia-detalle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    /* Mismo alto que .search-btn (38 px) */
    height: 38px;
    box-sizing: border-box;
    border: 1.5px solid #FCD34D;
    border-radius: 10px;
    background: #FFFBEB;
    color: #B45309;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.btn-incidencia-detalle { transition: background .2s, border-color .2s, color .2s; }
.btn-incidencia-detalle:hover { background: #FEF3C7; border-color: #F59E0B; color: #92400E; }
.btn-incidencia-detalle:active { background: #FDE68A; }
/* Móvil estrecho: los dos botones, iguales y en una fila (si no, uno bajaba
   solo a la línea de abajo) */
@media (max-width: 480px) {
    .detalle-acciones { flex-wrap: nowrap; }
    .detalle-acciones .btn-incidencia-detalle,
    .detalle-acciones .btn-reenviar {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        text-align: center;
        font-size: 12px;
        padding: 0 8px;
        line-height: 1.2;
    }
    .detalle-acciones svg { flex-shrink: 0; width: 15px; height: 15px; }
}
.btn-reenviar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    /* Mismo alto que .search-btn (38 px) */
    height: 38px;
    box-sizing: border-box;
    border: none;
    border-radius: 10px;
    background: var(--primary-green);
    color: #FFFFFF;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
}
.btn-reenviar { transition: background .2s; }
.btn-reenviar:hover { background: var(--primary-dark); }
.btn-reenviar:active { background: #33691E; }

.reenvio-email {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    font: inherit;
    font-size: 15px;
}
.reenvio-email:focus { outline: none; border-color: var(--primary-green); }

/* ============================================
   CONSULTAS FRECUENTES (#ayudaFullscreen)
   ============================================ */
.ayuda-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ayuda-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
}
.ayuda-item[open] {
    border-color: var(--primary-green);
}
.ayuda-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
}
.ayuda-item summary::-webkit-details-marker {
    display: none;
}
/* Flecha que gira al abrir */
.ayuda-item summary::after {
    content: '';
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2.5px solid var(--text-secondary);
    border-bottom: 2.5px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}
.ayuda-item[open] summary::after {
    transform: rotate(-135deg);
}
.ayuda-respuesta {
    padding: 0 16px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.ayuda-respuesta p {
    margin: 0 0 10px;
}
.ayuda-respuesta ul {
    margin: 0 0 10px;
    padding-left: 20px;
}
.ayuda-respuesta li {
    margin-bottom: 6px;
}
.ayuda-respuesta strong {
    color: var(--text-primary);
}
.ayuda-respuesta a {
    color: var(--primary-dark);
    font-weight: 600;
}
.ayuda-ejemplo {
    display: inline-block;
    margin-bottom: 10px;
    padding: 2px 10px;
    border-radius: 20px;
    background: #FEF3C7;
    color: #92400E;
    font-size: 12px;
    font-weight: 700;
}
.ayuda-cargando {
    text-align: center;
    color: var(--text-secondary);
}

/* ── Cuenta bancaria del cliente (js/cuentas.js) ── */
/* Fondo como el resto de ventanas (el de .search-fs-content) */
.cta-contenido { padding-bottom: 40px; }
/* Sobre ese fondo, la tarjeta del cliente va en blanco para que se distinga
   (en Nueva devolución es al revés: tarjeta verde claro sobre el paso blanco) */
#cuentasFullscreen .selected-client { background: #fff; }
/* Borrar (⊘) con el mismo diseño que el "+" de cliente manual: .input-with-button
   y .input-button de devolucion.css. El IBAN lleva delante el "ES" fijo. */
.input-with-button .cta-iban { flex: 1; min-width: 0; border-radius: 14px 0 0 14px; border-right: none; }
/* El botón ⊘ del IBAN toma el alto del campo (el .input-button fija 50 px y
   el campo del IBAN, con su "ES" y su borde, mide algo más: quedaba descuadrado) */
.input-with-button .cta-iban + .input-button { height: auto; border-radius: 0 14px 14px 0; }
.input-with-button:focus-within .cta-iban { border-color: var(--primary-green); box-shadow: none; }
.cta-iban {
    display: flex;
    align-items: center;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}
.cta-iban:focus-within { border-color: var(--primary-green); box-shadow: 0 0 0 4px rgba(124, 179, 66, 0.1); }
.cta-iban-es { padding: 0 2px 0 12px; font-weight: 700; font-size: 15px; color: var(--text-primary); }
.search-field .cta-iban input {
    border: none;
    box-shadow: none;
    /* Que quepan las 22 cifras en un móvil estrecho (390 px) sin desplazarse */
    padding: 14px 8px 14px 4px;
    font-size: 15px;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.search-field .cta-iban input:focus { box-shadow: none; }
.cta-firma { margin-top: 6px; }
.cta-elegido { margin-bottom: 18px; }
/* Enviar: el azul y el avión de papel del Enviar de las devoluciones */
.search-fs-btn-search.cta-enviar { background: #1976D2; border-color: #1976D2; color: #fff; }
.search-fs-btn-search.cta-enviar:hover { background: #1565C0; }
.search-fs-btn-search.cta-enviar:active { background: #0D47A1; }
/* Tarjeta del cliente en Cuenta bancaria: "Editar NIF / email" como botón secundario junto a "Cambiar cliente" */
.cta-elegido .selected-client-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.cta-elegido .btn-change-client.cta-editar-datos {
    background: #fff;
    color: var(--primary-dark);
    border: 1.5px solid var(--primary-green);
    box-shadow: none;
}


/* Listado sin conexión: aviso de que salen las guardadas de los últimos N días */
.listado-aviso-local {
    margin: 0 0 12px; padding: 10px 14px; border-radius: 12px;
    background: #FFF8E1; border: 1px solid #FFE082; color: #7A5B00; font-size: 13px; line-height: 1.4;
}

/* Detalle de una devolución valorada: importe bruto y neto bajo la tabla */
.detalle-importes {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px;
}
.detalle-importes > div {
    display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px;
    background: #F1F3F4; color: var(--text-secondary); font-size: 12px;
    /* A la derecha, como las cifras de la columna Importe y de los totales */
    align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums;
}
.detalle-importes strong { font-size: 17px; color: var(--text-primary); }
.detalle-importes .neto { background: #F0FFF4; }
.detalle-importes .neto strong { color: var(--primary-dark); }

/* Franja de la clase encima del cliente, como la del justificante (6.105.2):
   verde (#ecfdf5 / #d1fae5 / #065f46) y roja en las retiradas */
.detalle-franja {
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #065f46;
    border-radius: 12px;
    padding: 9px 18px;
    margin-bottom: 8px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.detalle-franja--retirada {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

/* ── Sugerencias (Utilidades) ─────────────────────────────────────────────── */
/* margin con auto a los lados: con 0 se perdía el centrado de
   .search-fs-content > * y en pantallas anchas quedaba a la izquierda */
.sugerencia-intro {
    margin: 0 auto 20px;
    text-align: center;
    text-wrap: balance;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}
/* Rótulo de un grupo de botones (no hay un campo al que apuntar con <label>) */
.search-field .search-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.sugerencia-tipos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sugerencia-tipo {
    min-height: 44px;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 22px;
    background: white;
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.sugerencia-tipo[aria-checked="true"] {
    border-color: var(--primary-green);
    background: rgba(124, 179, 66, 0.12);
    color: var(--primary-dark);
}
.sugerencia-cuenta {
    margin-top: 6px;
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
}

/* ── Detalle en móvil: una tarjeta por línea en vez de la tabla ──────────────
   La tabla de cinco columnas no cabe en 390 px: partía el EAN, la caducidad y
   el «€», y el producto ocupaba siete renglones. Hasta 640 px se ocultan la
   tabla y su fila de totales, y cada línea va en su tarjeta con los datos
   rotulados. Desde tableta se queda la tabla, que se lee bien. */
.detalle-tarjetas { display: none; }

@media (max-width: 640px) {
    .detalle-tabla-wrap { display: none; }

    .detalle-tarjetas {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .detalle-tarjeta {
        border: 1px solid var(--j-line);
        border-radius: 14px;
        background: white;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .detalle-tarjeta-cab {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .detalle-tarjeta-prod {
        font-size: 15px;
        line-height: 1.35;
        color: var(--j-text);
    }

    .detalle-tarjeta-cifras {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .detalle-tarjeta-cifras .uds {
        font-size: 13px;
        font-weight: 700;
        color: var(--j-chip-tx);
        background: var(--j-chip-bg);
        border-radius: 999px;
        padding: 3px 10px;
    }

    .detalle-tarjeta-cifras .imp {
        font-size: 17px;
        font-weight: 800;
        color: var(--j-text);
    }

    /* Rótulo pequeño encima y valor debajo, en dos columnas: el EAN (13
       cifras) cabe entero en media tarjeta de un móvil de 360 px. */
    .detalle-tarjeta-datos {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        margin: 0;
        padding-top: 12px;
        border-top: 1px solid var(--j-line);
    }

    .detalle-tarjeta-datos dt {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--j-muted);
        font-weight: 600;
    }

    .detalle-tarjeta-datos dd {
        margin: 2px 0 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--j-text);
        font-variant-numeric: tabular-nums;
        overflow-wrap: anywhere;
    }

    .detalle-tarjeta-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .detalle-tarjeta-chips span {
        font-size: 12px;
        font-weight: 600;
        color: #374151;
        background: var(--j-soft);
        border: 1px solid var(--j-line);
        border-radius: 999px;
        padding: 3px 10px;
    }

    .detalle-tarjeta .detalle-sust {
        margin-top: 0;
        font-size: 13px;
        padding: 8px 10px;
    }

    /* Totales en oscuro, como la fila del justificante */
    .detalle-tarjeta-total {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 6px 14px;
        background: var(--j-dark);
        border-radius: 14px;
        padding: 14px;
        font-variant-numeric: tabular-nums;
    }

    .detalle-tarjeta-total .rotulo {
        flex: 1 1 auto;
        color: #cbd5e1;
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
    }

    .detalle-tarjeta-total .uds {
        color: #ffffff;
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
    }

    .detalle-tarjeta-total .imp {
        color: #34d399;
        font-size: 17px;
        font-weight: 800;
        white-space: nowrap;
    }
}
