/* ==========================================================
   AQUALIVE - Pool Technology
   Hoja base. Paleta tomada del logo oficial (perfil FOGRA27).

   Azul corporativo   #00519e   C100 M70 Y0 K0   (AQUA)
   Negro              #000000   K100             (ALIVE)
   Gris corporativo   #5f6062   K77              (descriptor)
   Azul agua          #91d4f2   C46 M0 Y0 K0     (icono)
   Azul agua claro    #c9e9f8   C25 M0 Y0 K0     (icono)
   Indigo profundo    #332b67   C92 M97 Y25 K10  (gotas)
   ========================================================== */


/* ----------Base-------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background-color: #b1d1fc;
    color: #1a1a1a;
}


/* ----------Barra superior-------------- */

.barra-superior {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 0 30px;
    height: 64px;
    background-color: #ffffff;
    border-bottom: 3px solid #00519e;
}

.barra-superior-marca {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #00519e;
    text-decoration: none;
    transition: 0.4s;
}

.barra-superior-marca:hover {
    color: #003a78;
}

.barra-superior-logo {
    height: 38px;
    width: auto;
}

.barra-superior-descriptor {
    font-size: 12px;
    font-weight: normal;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #5f6062;
}


/* ----------Contenedor general-------------- */

.contenedor-general {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 25px;
}

.vista-titulo {
    font-size: 26px;
    font-weight: 600;
    color: #00519e;
    padding-bottom: 12px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e3e7ed;
}

.texto-vacio {
    font-size: 15px;
    color: #5f6062;
}


/* ----------Mensajes-------------- */

.mensaje {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
    font-size: 14px;
    background-color: #ffffff;
}

.mensaje-exito {
    border-left-color: #1b7a4b;
    color: #1b7a4b;
}

.mensaje-alerta {
    border-left-color: #c07a00;
    color: #c07a00;
}

.mensaje-error {
    border-left-color: #b3261e;
    color: #b3261e;
}


/* ----------Tablet-------------- */

@media (max-width: 768px) {

    .barra-superior {
        padding: 0 18px;
        height: 56px;
    }

    .barra-superior-marca {
        font-size: 18px;
    }

    .barra-superior-logo {
        height: 32px;
    }

    .barra-superior-descriptor {
        display: none;
    }

    .contenedor-general {
        padding: 22px 16px;
    }

    .vista-titulo {
        font-size: 22px;
    }

}


/* ----------Movil-------------- */

@media (max-width: 480px) {

    .barra-superior {
        padding: 0 14px;
        height: 52px;
    }

    .barra-superior-marca {
        font-size: 16px;
    }

    .barra-superior-logo {
        height: 28px;
    }

    .contenedor-general {
        padding: 18px 12px;
    }

    .vista-titulo {
        font-size: 19px;
    }

    .mensaje {
        font-size: 13px;
    }

}


/* ----------Menu de la barra-------------- */

.barra-superior-menu {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.enlace-menu {
    font-size: 14px;
    font-weight: 600;
    color: #5f6062;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: 0.4s;
}

.enlace-menu:hover {
    color: #00519e;
    border-bottom-color: #00519e;
}

.barra-superior-sesion {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 22px;
    border-left: 1px solid #e3e7ed;
}

.sesion-usuario {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: 0.4s;
}

.sesion-usuario:hover {
    color: #00519e;
    border-bottom-color: #00519e;
}

.boton-salir {
    background-color: transparent;
    color: #5f6062;
    border: 1px solid #c3ceda;
    border-radius: 3px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: 0.4s;
}

.boton-salir:hover {
    color: #b3261e;
    border-color: #b3261e;
}


/* ----------Botones-------------- */

.boton-primario {
    display: inline-block;
    background-color: #00519e;
    color: #ffffff;
    border: 1px solid #00519e;
    border-radius: 3px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: 0.4s;
}

.boton-primario:hover {
    background-color: #003a78;
    border-color: #003a78;
}

.boton-secundario {
    display: inline-block;
    background-color: #ffffff;
    color: #00519e;
    border: 1px solid #c3ceda;
    border-radius: 3px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: 0.4s;
}

.boton-secundario:hover {
    border-color: #00519e;
}

.boton-ancho {
    width: 100%;
}


/* ----------Formularios-------------- */

.elemento-formulario {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.titulo-elemento {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5f6062;
}

.campo-formulario {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a1a;
    background-color: #ffffff;
    border: 1px solid #c3ceda;
    border-radius: 3px;
    transition: 0.4s;
}

.campo-formulario:focus {
    outline: none;
    border-color: #00519e;
    box-shadow: 0 0 0 3px #c9e9f8;
}


/* ----------Tablas-------------- */

.caja-tabla {
    width: 100%;
    overflow-x: auto;
    background-color: #ffffff;
    border: 1px solid #e3e7ed;
    border-radius: 4px;
}

.caja-tabla table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.caja-tabla th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5f6062;
    background-color: #eaf0f6;
    padding: 12px 15px;
    border-bottom: 1px solid #e3e7ed;
    white-space: nowrap;
}

.caja-tabla td {
    padding: 12px 15px;
    border-bottom: 1px solid #eef2f6;
    color: #1a1a1a;
}

.caja-tabla tr:last-child td {
    border-bottom: 0;
}


/* ----------Pop up-------------- */

.fondo-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.55);
    padding: 20px;
    overflow-y: auto;
    z-index: 50;
}

.popup-visible {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.popup {
    width: 100%;
    max-width: 460px;
    margin-top: 60px;
    background-color: #ffffff;
    border-radius: 4px;
    padding: 26px 28px 28px;
}

.titulo-popup {
    font-size: 20px;
    color: #00519e;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e3e7ed;
}

.linea-botones-popup {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}


/* ----------Menu y tabla en tablet-------------- */

@media (max-width: 768px) {

    .barra-superior {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 18px;
        gap: 10px;
    }

    .barra-superior-menu {
        gap: 16px;
        order: 3;
        width: 100%;
        margin-left: 0;
        padding-top: 8px;
        border-top: 1px solid #e3e7ed;
    }

    .barra-superior-sesion {
        padding-left: 0;
        border-left: 0;
    }

    .popup {
        margin-top: 20px;
    }

}


/* ----------Tabla apilada en movil-------------- */

@media (max-width: 480px) {

    .caja-tabla {
        border: 0;
        background-color: transparent;
        overflow-x: visible;
    }

    .caja-tabla thead {
        display: none;
    }

    .caja-tabla tr {
        display: block;
        background-color: #ffffff;
        border: 1px solid #e3e7ed;
        border-radius: 4px;
        margin-bottom: 12px;
        padding: 6px 0;
    }

    .caja-tabla td {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        border-bottom: 0;
        padding: 7px 14px;
    }

    .caja-tabla td::before {
        content: attr(data-titulo);
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #5f6062;
    }

    .linea-botones-popup {
        flex-direction: column-reverse;
    }

    .linea-botones-popup button {
        width: 100%;
    }

}


/* ----------Etiquetas de estado-------------- */

.etiqueta-estado {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
}

.etiqueta-activo {
    background-color: #e6f4ec;
    color: #1b7a4b;
}

.etiqueta-inactivo {
    background-color: #eaf0f6;
    color: #5f6062;
}


/* ----------Boton chico y notas-------------- */

.boton-chico {
    padding: 6px 14px;
    font-size: 13px;
}

.nota-formulario {
    font-size: 12px;
    color: #4a4b4d;
    margin-top: 12px;
}

/*  La nota que va suelta debajo de un titulo, no pegada a un campo  */
.nota-suelta {
    margin-top: 0;
    margin-bottom: 14px;
}

.boton-eliminar {
    background-color: transparent;
    color: #b3261e;
    border: 1px solid #e3c4c2;
    border-radius: 3px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: 0.4s;
}

.boton-eliminar:hover {
    background-color: #fbe9e8;
    border-color: #b3261e;
}

.boton-eliminar:disabled {
    opacity: 0.5;
    cursor: default;
}


/* ----------Columna de acciones-------------- */

.columna-acciones {
    width: 1%;
    white-space: nowrap;
}

.columna-acciones .boton-secundario,
.columna-acciones .boton-eliminar {
    vertical-align: middle;
}

.nota-bloqueado {
    font-size: 12px;
    font-style: italic;
    color: #5f6062;
}


/* ----------Acciones en movil-------------- */

@media (max-width: 480px) {

    .columna-acciones {
        width: auto;
        white-space: normal;
    }

}


/* ----------Franja de suplantacion-------------- */

.franja-suplantacion {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    background-color: #c07a00;
    color: #ffffff;
    padding: 9px 20px;
    font-size: 13px;
    text-align: center;
}

.franja-suplantacion strong {
    font-weight: 600;
}

.boton-volver-cuenta {
    background-color: #ffffff;
    color: #c07a00;
    border: 0;
    border-radius: 3px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: 0.4s;
}

.boton-volver-cuenta:hover {
    transform: scale(1.05);
}

.formulario-ver-como {
    display: inline-block;
    vertical-align: middle;
}


/* ----------Contenedores estrechos y centrados-------------- */

.contenedor-estrecho {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
}

.contenedor-medio {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.titulo-centrado {
    text-align: center;
}


/* ----------Encabezado del historial-------------- */
/*  Nombra las columnas de las filas. Se oculta en movil, donde las
    filas se apilan y cada dato se lee por si solo.  */

.encabezado-historial {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 18px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #4a4b4d;
}

.encabezado-historial .fila-fecha {
    background-color: transparent;
    padding: 0;
    justify-content: flex-start;
}


/* ----------Fila de historial-------------- */
/*  Una linea por registro en escritorio, apilada en movil.
    La usan el panel y la pantalla de registro.  */

.fila-historial {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #ffffff;
    border: 1px solid #e3e7ed;
    border-radius: 4px;
    padding: 12px 18px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: 0.4s;
}

.fila-historial:hover {
    border-color: #00519e;
}

.fila-fecha {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 5px 0;
    background-color: #eaf0f6;
    border-radius: 3px;
    flex-shrink: 0;
}

.fila-fecha strong {
    font-size: 15px;
    color: #00519e;
    line-height: 1.2;
}

.fila-fecha span {
    font-size: 11px;
    color: #5f6062;
}

.fila-datos {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.fila-titulo {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fila-nota {
    font-size: 12px;
    color: #5f6062;
}

.fila-marca {
    font-size: 12px;
    font-weight: 600;
    color: #5f6062;
    background-color: #eaf0f6;
    border-radius: 2px;
    padding: 4px 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

.marca-verde {
    color: #1b7a4b;
    background-color: #e6f4ec;
}

.marca-azul {
    color: #00519e;
    background-color: #c9e9f8;
}

.fila-acciones {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.caja-vacia {
    background-color: #ffffff;
    border: 1px dashed #c3ceda;
    border-radius: 4px;
    padding: 34px 20px;
    text-align: center;
    color: #5f6062;
    font-size: 15px;
}


/* ----------Titulo de seccion con boton al lado-------------- */

.linea-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e3e7ed;
}

.sin-borde {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}


/* ----------Historial en tablet-------------- */

@media (max-width: 768px) {

    .encabezado-historial {
        display: none;
    }

    .fila-historial {
        flex-wrap: wrap;
    }

    .fila-acciones {
        margin-left: auto;
    }

}


/* ----------Historial en movil-------------- */

@media (max-width: 480px) {

    .linea-titulo {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .linea-titulo .boton-primario {
        width: 100%;
        text-align: center;
    }

    .fila-historial {
        padding: 12px 14px;
        gap: 12px;
    }

    .fila-acciones {
        width: 100%;
        margin-left: 0;
    }

    .fila-acciones .boton-secundario {
        flex: 1;
        text-align: center;
    }

}


/* ----------Boton grande, para pantallas de captura-------------- */

.boton-grande {
    padding: 14px 26px;
    font-size: 15px;
}

.campo-grande {
    font-size: 16px;
    padding: 12px 12px;
}


/* ----------Indicador de guardado automatico-------------- */

.estado-guardado {
    font-size: 12px;
    color: #4a4b4d;
    white-space: nowrap;
    transition: 0.4s;
}

.estado-trabajando {
    color: #00519e;
}

.estado-hecho {
    color: #1b7a4b;
}

.estado-fallo {
    color: #b3261e;
    font-weight: 600;
    white-space: normal;
}


/* ----------Enlace destacado de la barra-------------- */

.enlace-destacado {
    color: #ffffff;
    background-color: #00519e;
    border-radius: 3px;
    padding: 6px 14px;
    border-bottom: 0;
}

.enlace-destacado:hover {
    color: #ffffff;
    background-color: #003a78;
    border-bottom-color: transparent;
}


/* ----------Marca de reparaciones abiertas-------------- */

.marca-abiertos {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #00519e;
    background-color: #ffffff;
    border-radius: 20px;
    min-width: 20px;
    padding: 1px 7px;
    margin-left: 6px;
    text-align: center;
}

.marca-vacia {
    opacity: 0.45;
}

.marca-latiendo {
    animation: latido 0.9s ease-in-out 2;
}

@keyframes latido {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}


/* ----------Aviso de reparaciones-------------- */

.aviso-reparaciones {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    align-items: center;
    gap: 16px;
    width: calc(100% - 32px);
    max-width: 520px;
    background-color: #00519e;
    border-left: 5px solid #91d4f2;
    border-radius: 4px;
    box-shadow: 0 6px 22px rgba(26, 26, 26, 0.28);
    padding: 14px 16px;
    z-index: 70;
}

.aviso-visible {
    display: flex;
    animation: entra-aviso 0.4s ease-out;
}

@keyframes entra-aviso {
    from { opacity: 0; transform: translate(-50%, 18px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

.texto-aviso {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.botones-aviso {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.boton-aviso {
    font-size: 13px;
    font-weight: 600;
    color: #00519e;
    background-color: #ffffff;
    border-radius: 3px;
    padding: 7px 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: 0.4s;
}

.boton-aviso:hover {
    background-color: #d9e6f2;
}

.cerrar-aviso {
    font-size: 20px;
    line-height: 1;
    color: #ffffff;
    background-color: transparent;
    border: 0;
    padding: 0 4px;
    cursor: pointer;
    transition: 0.4s;
}

.cerrar-aviso:hover {
    color: #91d4f2;
}


/* ----------Aviso en movil-------------- */

@media (max-width: 480px) {

    .aviso-reparaciones {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        bottom: 14px;
        width: calc(100% - 24px);
    }

    .botones-aviso {
        width: 100%;
        justify-content: space-between;
    }

    .boton-aviso {
        flex: 1;
        text-align: center;
    }

}


/* ----------Legibilidad y tamano de toque en el telefono-------------- */

@media (max-width: 480px) {

    /*  Las etiquetas en versalitas se leen mal a 12 px con el sol de frente  */
    .titulo-elemento {
        font-size: 13px;
        letter-spacing: 0.4px;
    }

    /*  Nada que haya que tocar baja de 44 px de alto  */
    .boton-primario,
    .boton-secundario,
    .boton-eliminar {
        min-height: 44px;
    }

    .boton-chico {
        min-height: 40px;
    }

    /*  La barra superior tambien se toca con el dedo: los enlaces y el boton
        de salir estaban en 31 px  */
    .enlace-menu,
    .boton-salir,
    .sesion-usuario {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

}


/* ----------Paginacion-------------- */

.paginacion {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 22px;
}

.numeros-pagina {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagina {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
    color: #00519e;
    background-color: #ffffff;
    border: 1px solid #c3ceda;
    border-radius: 3px;
    padding: 0 12px;
    text-decoration: none;
    transition: 0.4s;
}

.pagina:hover {
    border-color: #00519e;
    background-color: #eaf0f6;
}

.pagina-actual {
    font-weight: 600;
    color: #ffffff;
    background-color: #00519e;
    border-color: #00519e;
}

.pagina-actual:hover {
    background-color: #00519e;
}

.pagina-apagada {
    color: #5f6062;
    opacity: 0.45;
}

.pagina-apagada:hover {
    border-color: #c3ceda;
    background-color: #ffffff;
}

.salto-pagina {
    color: #5f6062;
    padding: 0 2px;
}


/* ----------Paginacion en el telefono-------------- */

@media (max-width: 480px) {

    .pagina {
        min-width: 44px;
        min-height: 44px;
    }

    /*  En pantalla estrecha manda poder avanzar, no el numero exacto  */
    .numeros-pagina {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 4px;
    }

    .paginacion > .pagina {
        flex: 1;
    }

}
