
#mensaje-rechazado {
    max-width: 390px;
    margin: 0 auto 14px auto !important;
    width: 100%;
}
#mensaje-rechazado > div {
    padding: 10px 18px !important;
    font-size: 1.12rem !important;
    word-break: break-word;
    line-height: 1.3;
}
@media (max-width: 400px) {


    #contenedor-cuentas{
        margin-bottom: 0;
    }
    #mensaje-rechazado {
        max-width: 98vw;
        padding-left: 0;
        padding-right: 0;
    }
    #mensaje-rechazado > div {
        padding: 8px 6px !important;
        font-size: 0.99rem !important;
    }
}
@media only screen and (max-width: 600px) {

    /* Botón de atrás absoluto en header */
    .btn-flat.btn-back-absolute {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 2;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        min-width: 0;
        padding: 0 !important;
        background: none !important;
        box-shadow: none !important;
        border-radius: 12px;
        transition: background 0.2s;
    }
    html,
    body {
        margin: 0;
        padding: 0;
        height: 100%;
    }

    @media only screen and (max-width: 600px) {
        #modal-pago.modal {
            top: 0 !important;
            transform: none !important;
            width: 100% !important;
            height: 100% !important;
            max-height: none !important;
            border-radius: 0;
        }
        /* Reduce el padding del contenido principal del modal */
        #modal-pago.modal .modal-content {
            padding: 10px !important;
        }
        /* Reduce padding de secciones internas del modal */
        #modal-pago #modal-contenido,
        #modal-pago #pantalla-cuentas,
        #modal-pago #pantalla-detalle,
        #modal-pago #pantalla-previa {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
        /* Reduce padding de header y márgenes */
        #modal-pago #modal-header-global {
            min-height: 48px !important;
            padding: 0 !important;
        }
        #modal-pago #modal-header-global .modal-header-title-container {
            padding-top: 2px !important;
            padding-bottom: 2px !important;
            height: 48px !important;
            min-height: 48px !important;
        }
        #modal-pago #modal-header-global #modal-header-title {
            font-size: 1.08rem !important;
        }
        /* Reduce margen superior de selección de cuentas */
        #modal-pago #pantalla-cuentas {
            margin-top: 10px !important;
        }
        #modal-pago #pantalla-cuentas h5 {
            margin-bottom: 8px !important;
            font-size: 1.08rem !important;
        }
        #modal-pago #contenedor-cuentas .card-content {
            padding: 10px 2px !important;
        }
        /* Monto a pagar sección */
        #modal-pago #pantalla-cuentas .center-align[style*="margin-top: 16px"] {
            margin-top: 0 !important;
            margin-bottom: 0 !important;
        }
        /* Botón Ver Recibos */
        #modal-pago #pantalla-cuentas .center-align[style*="margin-top: 20px"] {
            margin-top: 12px !important;
        }
        /* Detalle pantalla */
        #modal-pago #pantalla-detalle h5,
        #modal-pago #pantalla-detalle h6 {
            margin-top: 0 !important;
            margin-bottom: 6px !important;
            font-size: 1.05rem !important;
        }
        #modal-pago #pantalla-detalle .center-align[style*="margin-bottom: 15px"] {
            margin-bottom: 7px !important;
        }
        #modal-pago #pantalla-detalle .center-align[style*="margin-bottom: 20px"] {
            margin-bottom: 10px !important;
        }
        #modal-pago #pantalla-detalle .center-align[style*="margin-top: 20px"] {
            margin-top: 10px !important;
        }
        #modal-pago #pantalla-detalle label.upload-dropzone {
            padding: 14px !important;
        }
        /* Pantalla previa */
        #modal-pago #pantalla-previa .row[style*="margin-bottom: 10px"] {
            margin-bottom: 4px !important;
        }
        #modal-pago #pantalla-previa .center-align[style*="margin-bottom: 15px"] {
            margin-bottom: 7px !important;
        }
        #modal-pago #pantalla-previa .center-align[style*="margin-bottom: 20px"] {
            margin-bottom: 10px !important;
        }
        /* Botones generales */
        #modal-pago .btn,
        #modal-pago .btn-large {
            min-height: 36px !important;
            font-size: 0.95rem !important;
            padding: 0 12px !important;
        }
        #modal-pago .btn i.material-icons.left {
            font-size: 20px !important;
            margin-right: 4px !important;
        }
        /* Contáctanos y salir */
        #modal-pago > div[style*="margin-top: 24px"] {
            margin-top: 12px !important;
        }
        #modal-pago > .center-align[style*="margin-top: 20px"] {
            margin-top: 10px !important;
        }
    }

    #contenedor-cuentas .card {
        height: 100%;
    }

    /* # Forzar alineación centrada en el modal de confirmación en móviles */
    @media only screen and (max-width: 600px) {
        #modal-confirmacion .modal-content {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100%;
        }
    }

    .btn i.material-icons {
        display: block;
        font-size: 24px;
    }

    .btn span.label-text {
        display: block;
        font-size: 12px;
    }

    /* Skeleton loader styles (horizontal pulse) */
    .skeleton {
        background: linear-gradient(90deg, #eeeeee 25%, #e0e0e0 50%, #eeeeee 75%);
        background-size: 200% 100%;
        animation: pulse-horizontal 1.5s infinite linear;
        border-radius: 4px;
        color: transparent;
    }

    @keyframes pulse-horizontal {
        0% {
            background-position: 200% 0;
        }

        100% {
            background-position: -200% 0;
        }
    }

    /* Dropzone animation */
    @keyframes pulse-shadow {
        0% {
            box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4);
        }

        70% {
            box-shadow: 0 0 0 10px rgba(33, 150, 243, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
        }
    }

    .upload-dropzone {
        animation: pulse-shadow 2s infinite;
        transition: box-shadow 0.3s ease-in-out;
    }

    /* === Mejora de botones para pantalla previa === */
    #pantalla-previa .btn {
        height: 48px !important;
        min-height: 48px !important;
        line-height: 20px !important;
        font-size: 1.1rem !important;
        font-weight: 600;
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        text-align: center !important;
    }

    #pantalla-previa .btn i.material-icons.left {
        font-size: 24px !important;
        margin-right: 8px !important;
    }

    #pantalla-previa .row.center-align {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #pantalla-previa .col.s6 {
        padding-left: 1% !important;
        padding-right: 1% !important;
        box-sizing: border-box;
    }
}



     /* Evitar selección de texto e iconos en el header global del modal */
 #modal-header-global,
 #modal-header-global .btn-back-absolute,
 #modal-header-global .btn-header-back-inner,
 #modal-header-global #modal-header-title,
 #modal-header-global #btn-header-back-text,
 #modal-header-global .btn-back-absolute i.material-icons {
     user-select: none;
     -webkit-user-select: none;
     -moz-user-select: none;
     -ms-user-select: none;
 }

#pantalla-cuentas h5.teal-text {
    font-weight: bold !important;
}
#contenedor-cuentas .card-content p.teal-text {
    font-weight: bold !important;
}
#pantalla-cuentas .teal-text.text-darken-4 {
    font-weight: bold !important;
}
#pantalla-cuentas #monto-a-pagar-seleccion.teal-text.text-darken-4 {
    font-weight: bold !important;
    font-size: 2rem !important;
}

/* Header global */
#modal-header-global {
    position: sticky;
    top: 0;
    z-index: 11;
    background: none !important;
    border-bottom: 0;
    box-shadow: none;
    min-height: 80px;
    align-items: stretch;
    display: flex;
    flex-direction: row;
    padding: 0 0 0 0;
}
#modal-header-global .btn-back-absolute {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 48px;
    min-width: 0;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    z-index: 2;
    border-radius: 12px;
    transition: background 0.2s;
}
#modal-header-global .btn-back-absolute .btn-header-back-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
}
#modal-header-global .btn-back-absolute i.material-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px !important;
    margin: 0 auto;
    width: 22px;
    height: 22px;
}
#modal-header-global .btn-back-absolute #btn-header-back-text {
    display: block;
    text-align: center;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    margin: 4px 0 0;
}
#modal-header-global .btn-flat {
    background: none !important;
    box-shadow: none !important;
}
#modal-header-global .btn-flat:focus {
    background: #f0f0f0 !important;
}

#modal-header-global .modal-header-title-container {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    min-height: 80px;
    padding-top: 10px;
    padding-bottom: 8px;
    position: relative;
}
#modal-header-global #modal-header-title {
    display: inline-block;
    font-weight: 600;
    font-size: 1.7rem;
    margin: 0;
    line-height: 1.2;
    position: relative;
    left: 0;
    right: 0;
    text-align: center;
    width: 100%;
    pointer-events: none;
}

@media only screen and (max-width: 600px) {
    #modal-header-global {
        min-height: 56px;
    }
    #modal-header-global .btn-back-absolute {
        width: 44px;
        height: 44px;
    }
    #modal-header-global .btn-back-absolute .btn-header-back-inner {
        margin-top: 0;
    }
    #modal-header-global .modal-header-title-container {
        height: 56px;
        min-height: 56px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
    #modal-header-global #modal-header-title {
        font-size: 1.3rem;
    }
}

@media only screen and (min-width: 601px) {
    #modal-pago.modal {
        max-height: 100vh !important;
        overflow-y: auto !important;
    }
    #modal-pago.modal .modal-content {
        max-height: 90vh !important;
        overflow-y: auto !important;
        padding: 16px;
    }

    #modal-pago{
        top: 50% !important;
        transform: translateY(-50%) scaleX(1) scaleY(1) !important;
    }

    #modal-pago #modal-header-global {
        min-height: 64px;
    }
    #modal-pago #modal-header-global .btn-back-absolute {
        width: 52px;
        height: 52px;
    }
    #modal-pago #modal-header-global .modal-header-title-container {
        height: 64px;
        min-height: 64px;
        padding-top: 12px;
        padding-bottom: 10px;
    }
    #modal-pago #modal-header-global #modal-header-title {
        font-size: 1.65rem;
    }
}


 #pantalla-detalle .input-field input.monto-a-pagar-input {
     font-size: 2.2rem !important;
     font-weight: bold !important;
     text-align: center !important;
     margin-top: 8px !important;
     max-width: 60% !important;
 }
#pantalla-detalle .input-field input.monto-a-pagar-input:focus {
    border-color: #004d40 !important;
    outline: none;
}
#pantalla-detalle .input-field label[for="input-monto-a-pagar"] {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    display: block !important;
    color: #1e88e5 !important;
    text-align: center !important;
    transform: translateY(-18px) scale(1) !important;
}


     /* Ajuste botones y espaciado en pantalla previa comprobante */
 #pantalla-previa .row.center-align {
     margin-left: 0 !important;
     margin-right: 0 !important;
 }
#pantalla-previa .col.s6 {
    padding-left: 1% !important;
    padding-right: 1% !important;
    box-sizing: border-box;
}
#pantalla-previa #btn-cambiar-imagen,
#pantalla-previa #btn-cambiar-cuenta {
    min-width: 0;
    width: 98% !important;
    white-space: normal;
}
#pantalla-previa #btn-cambiar-imagen {
    margin-right: 2% !important;
}
#pantalla-previa #btn-cambiar-cuenta {
    margin-left: 2% !important;
}
/* Reduce margen vertical entre elementos en pantalla previa */
#pantalla-previa .center-align,
#pantalla-previa .row {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}
#pantalla-previa .row.center-align {
    margin-bottom: 0 !important;
}
#pantalla-previa .center-align[style*="margin-bottom: 15px"],
#pantalla-previa .center-align[style*="margin-bottom: 20px"] {
    margin-bottom: 8px !important;
}
#pantalla-previa .center-align[style*="margin-top: 18px"] {
    margin-top: 10px !important;
}
@media only screen and (max-width: 600px) {
    #pantalla-previa .row.center-align {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    #pantalla-previa .col.s6 {
        padding-left: 1% !important;
        padding-right: 1% !important;
    }
    #pantalla-previa #preview-img {
        max-height: 210px !important;
    }
}
/* Monto a pagar en pantalla previa: reducir tamaño pero legible */
#pantalla-previa #preview-monto {
    font-size: 2rem !important;
    font-weight: bold;
}
#pantalla-previa .teal-text.text-darken-4 {
    font-size: 1.25rem !important;
}
/* Cuenta seleccionada arriba del monto: pequeño y discreto */
#pantalla-previa #preview-cuenta-label {
    color: #666 !important;
    font-size: 0.93rem !important;
    text-transform: lowercase !important;
    letter-spacing: 0.03em !important;
    margin-bottom: 2px !important;
    margin-top: 0 !important;
}
#pantalla-previa #btn-preview-div {
    display: flex;
}




     /* Icono error_outline a la izquierda del mensaje rechazado, usando ::before */
 #mensaje-rechazado > div::before {
     content: "error_outline";
     font-family: 'Material Icons';
     font-style: normal;
     font-weight: normal;
     font-size: 1.1em;
     line-height: 1;
     position: absolute;
     left: 4px;
     top: 50%;
     transform: translateY(-50%);
     color: #c62828;
     opacity: 0.85;
     pointer-events: none;
     /* Prevent selection, smooth appearance */
     user-select: none;
 }

/* Ajuste del padding para dejar espacio al icono izquierdo y derecho */
#mensaje-rechazado > div {
    padding-left: 34px !important;
    padding-right: 26px !important;
    cursor: pointer;
    transition: box-shadow 0.2s, border 0.2s;
    box-shadow: 0 1px 4px rgba(183,28,28,0.04);
    border: 2px dashed #ffcdd2;
    position: relative;
    text-align: start;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Indicador de expandir/colapsar (▲▼) a la derecha, fuera del flujo de texto */
#mensaje-rechazado > div.colapsado::after,
#mensaje-rechazado > div.expandido::after {
    content: attr(data-icon);
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
    color: #c62828;
    pointer-events: none;
    opacity: 0.64;
    transition: transform 0.18s;
    user-select: none;
}

#mensaje-rechazado > div.colapsado {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.7em;
}

#mensaje-rechazado > div.expandido {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
}

