/* =====================================================================
   moderno.css - Capa de estetica moderna (mismos colores de siempre)
   Se carga DESPUES de bootstrap, site.css y W3.css para pisar lo viejo
   sin tocar el markup de las paginas.
   ===================================================================== */

:root {
    --rojo-claro: #D13535;
    --rojo: #C22F2F;
    --rojo-oscuro: #B82929;
    --rojo-suave: #fbeaea;
    --gris-azul: #607d8b;
    --gris-azul-oscuro: #4f6773;
    --gris-oscuro: #616161;
    --fondo: #f3f4f7;
    --superficie: #ffffff;
    --borde: #e3e6ea;
    --texto: #2b2f36;
    --texto-suave: #6b7280;
    --radio: 10px;
    --radio-chico: 8px;
    --sombra-chica: 0 1px 3px rgba(16, 24, 40, .10), 0 1px 2px rgba(16, 24, 40, .06);
    --sombra: 0 4px 14px rgba(16, 24, 40, .10);
    --sombra-grande: 0 12px 32px rgba(16, 24, 40, .18);
    --transicion: .18s ease;
}

/* ---------- Base ---------- */
html, body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--texto);
    background-color: var(--fondo);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -.01em;
}

a {
    color: var(--rojo-oscuro);
    text-decoration: none;
    transition: color var(--transicion);
}

    a:hover {
        color: var(--rojo-claro);
        text-decoration: underline;
    }

/* Barra de desplazamiento: mismo color, mas fina */
::-webkit-scrollbar {
    width: 12px !important;
    height: 12px;
    background-color: transparent !important;
}

/* Canal marcado para que se entienda que es una barra de desplazamiento */
::-webkit-scrollbar-track {
    background-color: #b4bac3;
    border-radius: 10px;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, .25);
}

::-webkit-scrollbar-thumb {
    background-color: brown !important;
    border-radius: 10px !important;
    border: 2px solid #b4bac3;
    min-height: 40px;
}

/* Firefox (solo ahi: en Chrome scrollbar-color anula los ::-webkit-scrollbar) */
@supports (-moz-appearance: none) {
    * {
        scrollbar-color: brown #b4bac3;
    }
}

/* ---------- Color del sistema (rojo) ---------- */
.colorsistema {
    background-image: linear-gradient(135deg, var(--rojo-claro) 0%, var(--rojo-oscuro) 100%) !important;
    color: #fff !important;
}

/* ---------- Botones W3 ---------- */
.w3-button {
    border-radius: var(--radio-chico);
    font-weight: 500;
    letter-spacing: .01em;
    transition: transform var(--transicion), box-shadow var(--transicion), filter var(--transicion), background-color var(--transicion);
}

    /* El hover de W3 pintaba gris y negro: ahora aclara el mismo color */
    .w3-button:hover {
        color: var(--texto) !important;
        background-color: #eef0f3 !important;
        filter: brightness(1.08);
        transform: translateY(-1px);
        box-shadow: var(--sombra) !important;
    }

.w3-button.colorsistema:hover, .w3-button.w3-red:hover, .w3-button.w3-blue-gray:hover,
.w3-button.w3-blue-grey:hover, .w3-button.w3-dark-gray:hover, .w3-button.w3-dark-grey:hover,
.w3-button.w3-green:hover, .w3-button.w3-blue:hover {
    color: #fff !important;
}

.w3-button.w3-red:hover { background-color: #f44336 !important; }
.w3-button.w3-blue-gray:hover, .w3-button.w3-blue-grey:hover { background-color: #607d8b !important; }
.w3-button.w3-dark-gray:hover, .w3-button.w3-dark-grey:hover { background-color: #616161 !important; }
.w3-button.w3-green:hover { background-color: #4CAF50 !important; }
.w3-button.w3-blue:hover { background-color: #2196F3 !important; }

    .w3-button:active {
        transform: translateY(0);
        filter: brightness(.96);
    }

    .w3-button:focus-visible, button:focus-visible {
        outline: 3px solid rgba(209, 53, 53, .35);
        outline-offset: 2px;
    }

.w3-button.w3-white:hover {
    color: #000 !important;
    background-color: #f5f5f5 !important;
}

.w3-round {
    border-radius: var(--radio-chico) !important;
}

.w3-card-4 {
    box-shadow: var(--sombra-chica) !important;
}

.w3-card {
    box-shadow: var(--sombra-chica) !important;
}

/* El borde gris oscuro de los botones queda casi invisible */
.w3-border.w3-border-dark-gray {
    border-color: rgba(0, 0, 0, .10) !important;
}

/* Colores W3 usados en el sistema, con un leve degradado */
.w3-blue-gray, .w3-blue-grey {
    background-image: linear-gradient(135deg, #6b8a99 0%, var(--gris-azul-oscuro) 100%);
}

.w3-red {
    background-image: linear-gradient(135deg, #f44336 0%, #d9362b 100%);
}

.w3-dark-gray, .w3-dark-grey {
    background-image: linear-gradient(135deg, #6e6e6e 0%, #4f4f4f 100%);
}

.w3-tag {
    border-radius: 999px !important;
    padding: 4px 14px;
    font-size: .85rem;
    box-shadow: var(--sombra-chica);
}

/* Ayuda del importe en Transferencias y Cobros ("Utilize separador decimal
   coma..."): tiene alto fijo de 18px en linea y con el relleno de arriba el
   texto quedaba cortado y montado sobre el campo */
.w3-tag[style*="height:18px"] {
    padding: 0 8px !important;
    line-height: 18px;
    vertical-align: middle;
    margin-left: 6px;
    border-radius: 2px !important;
    box-shadow: none;
    white-space: nowrap;
}

/* ---------- Menu lateral ---------- */
#mySidebar {
    background-color: var(--superficie);
    border: none;
    border-radius: 14px;
    box-shadow: var(--sombra);
    padding: 6px;
    margin-top: 0;
    max-height: calc(100vh - 110px);
}

    /* Titulos de grupo (rojos) */
    #mySidebar > .w3-button.w3-block {
        border-radius: var(--radio-chico);
        margin-bottom: 4px;
        padding: 7px 12px;
        font-size: .92rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        #mySidebar > .w3-button.w3-block .fa-caret-down {
            margin-left: auto;
        }

        #mySidebar > .w3-button.w3-block:hover {
            transform: translateX(2px);
        }

    /* Opciones del menu: fondo rojo, texto blanco y marcador gris oscuro
       casi negro a la izquierda (pisa el degrade de colorsistema y el
       color:white en linea).
       Prueba anterior (invertida): fondo #2b2f36, marcador #c22f2f,
       hover fondo #3a3f47 y marcador #e04040 */
    #mySidebar > .w3-button.w3-block.colorsistema {
        background-image: none !important;
        background-color: #c22f2f !important;
        color: #fff !important;
        border: 1px solid #c22f2f;
        border-left: 4px solid #6b7280;
        border-radius: 4px;
        box-shadow: none !important;
        font-weight: 600;
    }

        #mySidebar > .w3-button.w3-block.colorsistema i,
        #mySidebar > .w3-button.w3-block.colorsistema svg {
            color: #fff;
        }

        #mySidebar > .w3-button.w3-block.colorsistema:hover {
            background-color: #d13535 !important;
            color: #fff !important;
            border-color: #d13535;
            border-left-color: #4b5563;
        }

    /* Boton "Close" en celular */
    #mySidebar > .w3-bar-item.w3-hide-large {
        width: 100%;
        text-align: right;
        font-size: .95rem !important;
        color: var(--texto-suave);
        margin-bottom: 4px;
    }

    /* Opciones del submenu */
    #mySidebar .MenuMuestroOculto {
        margin: -2px 0 8px 10px;
        padding-left: 8px;
        border-left: 2px solid #d0d4da;
    }

        #mySidebar .MenuMuestroOculto a.w3-bar-item {
            border-radius: var(--radio-chico);
            padding: 8px 10px;
            font-size: .88rem;
            color: var(--texto);
        }

            #mySidebar .MenuMuestroOculto a.w3-bar-item i {
                color: var(--rojo-claro);
            }

            #mySidebar .MenuMuestroOculto a.w3-bar-item:hover {
                background-color: var(--rojo-suave) !important;
                color: var(--rojo-oscuro) !important;
                text-decoration: none;
                box-shadow: none !important;
                transform: translateX(2px);
            }

/* ---------- Formularios ---------- */
.form-control, .mi-select, select {
    border-radius: var(--radio-chico);
    border: 1px solid var(--borde);
    transition: border-color var(--transicion), box-shadow var(--transicion);
}

    .form-control:focus, .mi-select:focus, select:focus {
        border-color: var(--rojo-claro);
        box-shadow: 0 0 0 3px rgba(209, 53, 53, .15);
        outline: none;
    }

label {
    color: var(--texto);
}

/* Checkbox: gris oscuro en vez del azul del navegador, un poco mas chico */
input[type=checkbox] {
    accent-color: #616161;
    cursor: pointer;
}

.w3-check {
    width: 18px;
    height: 18px;
    top: 4px;
    margin-right: 4px;
}

/* Botones que esperan la verificacion de Cloudflare Turnstile (data-espera-turnstile,
   ver MiLibreriaScripts.js): mientras estan deshabilitados se tapa su contenido
   y se muestra "Verificando..." con un circulo girando. Solo CSS: el contenido
   del boton lo maneja Blazor y no se toca */
/* (el atributo va repetido para ganarle en prioridad al :hover de los botones
   w3-blue-gray/colorsistema, que si no vuelve a mostrar el texto original encima) */
button[data-espera-turnstile][data-espera-turnstile]:disabled,
button[data-espera-turnstile][data-espera-turnstile]:disabled:hover {
    position: relative;
    color: transparent !important;
    opacity: .85 !important;
    cursor: wait !important;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

    button[data-espera-turnstile]:disabled > * {
        visibility: hidden;
    }

    button[data-espera-turnstile]:disabled::after {
        content: "Verificando...";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 500;
        padding-left: 22px;
    }

    button[data-espera-turnstile]:disabled::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 14px;
        height: 14px;
        margin: -7px 0 0 -50px;
        border: 2px solid rgba(255, 255, 255, .45);
        border-top-color: #fff;
        border-radius: 50%;
        animation: giroVerificando .8s linear infinite;
        z-index: 1;
    }

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

/* Contraseña + boton del ojo pegados (inicio de sesion) */
#passwordInput {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#togglePasswordVisibility {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding: 0 14px;
}

/* ---------- Cuadros de formulario (caja1) ---------- */
.caja1.w3-card-4 {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--borde);
    box-shadow: 0 6px 20px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08) !important;
}

/* ---------- Pantallas de reporte/consulta ---------- */
/* Fondo gris para que el reporte parezca una hoja */
.grid-reporte {
    background-image: none !important;
    background-color: #d5d8dd !important;
    border-radius: var(--radio);
    padding-top: 8px;
    padding-bottom: 8px;
}

    /* El <br /> inicial de cada reporte empujaba la hoja hacia abajo */
    .grid-reporte > br:first-child {
        display: none;
    }

.detalle {
    border-radius: var(--radio);
}

/* Tablas de listados */
/* Se respeta el formato original (Verdana, encabezado compacto, bordes
   y lineas punteadas de cada pagina); solo se agrega sombra y se marcan
   mas las filas alternas */
.tablalis {
    box-shadow: var(--sombra) !important;
}

    /* Fila de titulos de columnas (la que tiene celdas sin colspan):
       sin la grilla negra; separadores blancos y linea gris abajo */
    .tablalis thead tr:last-child {
        border: none !important;
    }

        .tablalis thead tr:last-child th {
            background-color: #e6e7ea;
            color: #333;
            font-size: .9em !important;
            font-weight: normal !important;
            padding-top: 4px !important;
            padding-bottom: 4px !important;
            border: none !important;
            border-left: 2px solid #fff !important;
            border-bottom: 2px solid #9aa0a8 !important;
        }

            .tablalis thead tr:last-child th:first-child {
                border-left: none !important;
            }

    /* Aire entre los titulos del reporte y la fila de columnas */
    .tablalis thead tr:nth-last-child(2) th {
        padding-bottom: 8px !important;
    }

    /* Filas alternas: whitesmoke queda muy palido */
    .tablalis tbody tr[style*="whitesmoke"] {
        background-color: #ebebeb !important;
    }

/* Botonera de abajo: pegada al pie, sin el renglon en blanco que tenia arriba */
.grid-reporte + div[style*="line-height"] {
    display: none;
}

.grid-botonera {
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    margin-top: 6px;
    height: auto !important;
    /* 9px + 6px de relleno de la tarjeta = ~4mm hasta el borde */
    padding-bottom: 9px;
}

/* El renglon de mensajes de error (3% del alto) dejaba un hueco abajo de
   los botones; vacio no ocupa nada, con mensaje toma su alto */
.grid-botonera ~ .grid-layout-c {
    height: auto !important;
}

/* Fichas/solapas */
.bficha {
    border-radius: var(--radio-chico) var(--radio-chico) 0 0 !important;
}

/* ---------- Modales Bootstrap (inicio de sesion, etc.) ---------- */
.modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sombra-grande);
}

.modal.show[style*="rgba(10,10,10,.5)"] {
    background-color: rgba(20, 22, 28, .55) !important;
    backdrop-filter: blur(3px);
}

.modal-header {
    border-bottom: none;
}

/* ---------- SweetAlert ---------- */
.swal2-popup {
    border-radius: 16px !important;
    font-family: inherit !important;
}

.swal2-styled {
    border-radius: var(--radio-chico) !important;
}

/* Avisos "Ingreso correcto" y "Sesion finalizada" (CustomClass toast-sistema):
   mismo cadetblue y texto blanco, en forma de pastilla. Sin el icono de
   SweetAlert: el icono va dentro del titulo en un circulo blanco (.toast-ico) */
.swal2-popup.swal2-toast.toast-sistema {
    border-radius: 999px !important;
    padding: 9px 26px 9px 9px !important;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .28) !important;
    overflow: hidden;
    /* Ancho justo al contenido (SweetAlert lo fija en 340px y sobraba a la derecha) */
    width: auto !important;
    grid-template-columns: auto !important;
}

    .swal2-popup.swal2-toast.toast-sistema .swal2-title {
        display: flex !important;
        align-items: center;
        font-weight: 600 !important;
        letter-spacing: .02em;
        margin: 0 !important;
        padding: 0 !important;
    }

    .swal2-popup.swal2-toast.toast-sistema .toast-ico {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        margin-right: 12px;
        border-radius: 50%;
        background-color: #fff;
        color: #5f9ea0;
        font-size: 15px;
    }

    /* Barra de tiempo fina abajo, dentro de la pastilla */
    .swal2-popup.swal2-toast.toast-sistema .swal2-timer-progress-bar {
        background: rgba(255, 255, 255, .55) !important;
        height: 3px !important;
    }

/* ---------- Dropdowns W3 ---------- */
.w3-dropdown-content {
    border-radius: var(--radio-chico);
    box-shadow: var(--sombra) !important;
    overflow: hidden;
}

/* ---------- Error de Blazor y reconexion ---------- */
#blazor-error-ui {
    background: #fff8db;
    border-top: 3px solid #e0b100;
    font-size: .9rem;
}

#blazor-error-ui .reload {
    margin-left: 10px;
    font-weight: 600;
}

/* ---------- Aviso de conexion perdida (propio, ver _Layout.cshtml) ---------- */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(20, 22, 28, .45);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

    #components-reconnect-modal.components-reconnect-show,
    #components-reconnect-modal.components-reconnect-failed,
    #components-reconnect-modal.components-reconnect-rejected {
        display: flex;
    }

    #components-reconnect-modal .reconexion-caja {
        background: #fff;
        border-top: 4px solid var(--rojo-claro);
        border-radius: 4px;
        box-shadow: var(--sombra-grande);
        padding: 22px 26px;
        max-width: 360px;
        width: 100%;
        text-align: center;
        font-family: "Segoe UI", system-ui, Arial, sans-serif;
        color: var(--texto);
    }

    #components-reconnect-modal .reconexion-reintentando,
    #components-reconnect-modal .reconexion-fallo,
    #components-reconnect-modal .reconexion-rechazo {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    #components-reconnect-modal.components-reconnect-show .reconexion-reintentando,
    #components-reconnect-modal.components-reconnect-failed .reconexion-fallo,
    #components-reconnect-modal.components-reconnect-rejected .reconexion-rechazo {
        display: flex;
    }

    #components-reconnect-modal strong {
        font-size: 1.05rem;
    }

    #components-reconnect-modal span {
        font-size: .9rem;
        color: var(--texto-suave);
    }

    #components-reconnect-modal button {
        margin-top: 6px;
        padding: 6px 18px;
        border: none;
        border-radius: 2px;
        background-color: #c22f2f;
        color: #fff;
        font-weight: 500;
        cursor: pointer;
    }

        #components-reconnect-modal button:hover {
            background-color: #d13535;
        }

    #components-reconnect-modal .reconexion-giro {
        width: 28px;
        height: 28px;
        border: 3px solid #f0d4d4;
        border-top-color: var(--rojo-claro);
        border-radius: 50%;
        animation: giroVerificando .8s linear infinite;
    }

/* El aviso de conexion perdida va por encima del modal de inicio de sesion
   (Blazor le pone z-index 1050 en linea y el modal de Bootstrap tiene 1055) */
#components-reconnect-modal {
    z-index: 2000 !important;
}

/* ---------- Listas de seleccion (Mis Socios, Ahorro Comun) ---------- */
/* Recuadros de la izquierda: estilo del cartel "publicacion correcta" de
   Visual Studio (fondo apenas tintado, borde de color, esquinas poco
   redondeadas) en gris oscuro */
div.w3-round[style*="border: 1px solid black"] {
    border: 1px solid #616161 !important;
    border-radius: 4px !important;
    background-color: #f1f2f4;
}

    div.w3-round[style*="border: 1px solid black"] i,
    div.w3-round[style*="border: 1px solid black"] svg {
        color: #616161;
    }

/* Mis Socios: banquito y sucursal centrados en el recuadro */
.botonesMisSocios > div.w3-round[style*="border: 1px solid black"] {
    justify-content: center !important;
}

/* Flecha de seleccion (antes manito) y flecha hacia abajo: gris oscuro */
.flecha-seleccion, .fa-hand-point-right, .fa-arrow-circle-down {
    color: #616161;
}

/* ---- Prueba estilo plano: esquinas rectas y marcador a la izquierda ---- */
div.w3-round[style*="border: 1px solid black"],
div.w3-round[style*="dashed"] {
    border-radius: 2px !important;
}

/* TODOS los botones del contenido (saldos, seleccion, Volver, Aceptar,
   Excel, Imprimir, Iniciar sesion...): color liso (sin degrade), sin
   borde, esquinas rectas y marcador mas oscuro a la izquierda.
   Solo dentro de .cuerpob: el encabezado y el menu lateral tienen su estilo */
.cuerpob button.colorsistema, .cuerpob button.w3-red,
.cuerpob button.w3-blue-gray, .cuerpob button.w3-blue-grey {
    border-radius: 2px !important;
    border: none !important;
    background-image: none !important;
}

.cuerpob button.colorsistema {
    background-color: #c22f2f !important;
    border-left: 4px solid #8e1f1f !important;
}

.cuerpob button.w3-red {
    border-left: 4px solid #b71c1c !important;
}

.cuerpob button.w3-blue-gray, .cuerpob button.w3-blue-grey {
    border-left: 4px solid #37474f !important;
}

/* Botones chicos (w3-small: Volver, Aceptar, Excel, Imprimir, el ojito,
   Iniciar sesion...): sin marcador, quedaba muy cargado. Los saldos de
   Ahorro Comun tambien son w3-small pero son grandes: esos lo conservan */
.cuerpob button.w3-small:not(.grid-layout-b-saldo),
.cuerpob button#togglePasswordVisibility {
    border-left: none !important;
}

    .cuerpob button.colorsistema:hover {
        background-color: #d13535 !important;
    }

    .cuerpob button.w3-red:hover {
        background-color: #e53935 !important;
    }

    .cuerpob button.w3-blue-gray:hover, .cuerpob button.w3-blue-grey:hover {
        background-color: #546e7a !important;
    }

/* Mismo redondeo en el resto de los botones del sitio */
.w3-button, .btn {
    border-radius: 2px !important;
}

#mySidebar > .w3-button.w3-block.colorsistema {
    border-radius: 2px !important;
}

/* Recuadro del convenio AYE en Ahorro Comun (punteado celeste) */
div.w3-round[style*="dashed"] {
    border: 1px solid #93c4da !important;
    border-left: 4px solid #4a9cc2 !important;
    border-radius: 2px !important;
    background-color: #eaf5fa !important;
    box-shadow: var(--sombra-chica);
}

/* ---------- Consultas con boton de saldo (Fconaye, Fconaht, Fcontur) ---------- */
/* Filas con convenio: gris azulado claro (el celeste no combinaba con el
   rojo del saldo) y franja a la izquierda en el gris azulado del sistema */
.tablalis tbody tr[style*="lightblue"] {
    background-color: #e6ebef !important;
}

    .tablalis tbody tr[style*="lightblue"] > td:first-child {
        box-shadow: inset 4px 0 0 #607d8b;
    }


/* ---------- Celular: que los reportes entren a lo ancho ---------- */
@media (max-width: 767.98px) {
    /* Menos margen alrededor de las tarjetas */
    .cuerpo {
        padding: 4px 4px 0 4px !important;
    }

    .cuerpob {
        padding: 4px !important;
    }

    .grid-reporte {
        padding-left: 2px !important;
        padding-right: 2px !important;
    }
}

/* La tabla conserva su ancho (si no entra se desplaza de costado), pero los
   datos no se parten en dos renglones ("12 de / 24") en ningun tamaño */
.tablalis td:not([colspan]) {
    white-space: nowrap;
}

@media print {
    html, body {
        background-color: #fff;
        height: auto !important;
        overflow: visible !important;
    }

    /* Al imprimir el layout no puede tener alto fijo ni scroll propio:
       si no, el reporte se corta en la primera hoja */
    .flex-container, .cuerpo, .cuerpob, .grid-reporte, .detalle {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: none !important;
        overflow: visible !important;
    }

    .cuerpob {
        box-shadow: none !important;
        padding: 0 !important;
    }

    .detalle {
        margin: 0 auto;
    }

    /* Botones flotantes y cotizacion: al ser fixed salen en todas las hojas */
    .flotantecot, .flotantesociosini, .flotantesocios, .flotanteprincipal, .flotantesalir,
    .cuerpoa, #mySidebar {
        display: none !important;
    }

    .tablalis {
        box-shadow: none !important;
        border-radius: 0;
    }

    .grid-reporte {
        background-color: #fff !important;
        border-radius: 0;
    }
}
