﻿/* ================================================================
   HEADER / TOOLBAR PRINCIPAL
   ================================================================ */

.layout-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #dfe3e7;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.045);
}


/* ================================================================
   DEVEXTREME TOOLBAR
   ================================================================ */

#main-toolbar {
    min-height: 64px;
    padding-left: 14px;
    padding-right: 18px;
    background: transparent;
}


    #main-toolbar .dx-toolbar-items-container {
        height: 64px;
    }


    #main-toolbar .dx-toolbar-before,
    #main-toolbar .dx-toolbar-after {
        display: flex;
        align-items: center;
        height: 100%;
    }


/* ================================================================
   BOTON MENU
   ================================================================ */

.menu-button {
    margin-right: 8px;
}


#main-menu-button {
    width: 42px;
    height: 42px;
    border-radius: 9px;
}


    #main-menu-button.dx-state-hover {
        background: #e9ecef;
    }


    #main-menu-button .dx-icon {
        color: #4d5761;
        font-size: 21px;
    }


/* ================================================================
   MARCA
   ================================================================ */

.header-brand {
    height: 100%;
}


.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    height: 100%;
    color: inherit;
    text-decoration: none;
}


    .app-brand:hover,
    .app-brand:focus {
        color: inherit;
        text-decoration: none;
    }


.app-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    background: #3e4852;
    border-radius: 9px;
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}


.app-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}


.app-brand-title {
    color: #313940;
    font-size: 1rem;
    font-weight: 650;
}


.app-brand-subtitle {
    margin-top: 3px;
    color: #808993;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


/* ================================================================
   USUARIO
   ================================================================ */

.header-user-item {
    margin-right: 8px;
}


.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 7px;
    background: #f5f7f8;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
}


.header-user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    background: #e4e8eb;
    border-radius: 8px;
    color: #525d67;
    font-size: 16px;
}


.header-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}


.header-user-name {
    max-width: 220px;
    overflow: hidden;
    color: #343d45;
    font-size: 0.85rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.header-user-role {
    margin-top: 3px;
    color: #7d8791;
    font-size: 0.69rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}


/* ================================================================
   LOGOUT
   ================================================================ */

.header-logout {
    margin-left: 2px;
}


#logout-button {
    height: 40px;
    padding-left: 7px;
    padding-right: 9px;
    border-radius: 9px;
    color: #5f6872;
}


    #logout-button.dx-state-hover {
        background: #f3e9e9;
        color: #804b4b;
    }


    #logout-button .dx-icon {
        margin-right: 4px;
    }


/* ================================================================
   QUITAR ESTETICA PESADA DE DEVEXTREME
   ================================================================ */

.layout-header .dx-toolbar {
    border: 0;
}


.layout-header .dx-button {
    box-shadow: none;
}


.layout-header .dx-button-mode-text {
    border-color: transparent;
}


/* ================================================================
   TABLET
   ================================================================ */

@media (max-width: 900px) {

    #main-toolbar {
        padding-left: 9px;
        padding-right: 10px;
    }


    .header-user-name {
        max-width: 150px;
    }
}


/* ================================================================
   MOVIL
   ================================================================ */

@media (max-width: 650px) {

    #main-toolbar {
        min-height: 58px;
        padding-left: 6px;
        padding-right: 6px;
    }


        #main-toolbar .dx-toolbar-items-container {
            height: 58px;
        }


    .menu-button {
        margin-right: 3px;
    }


    #main-menu-button {
        width: 40px;
        height: 40px;
    }


    .app-brand {
        gap: 8px;
    }


    .app-brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }


    .app-brand-title {
        font-size: 0.92rem;
    }


    .app-brand-subtitle {
        display: none;
    }


    /*
     * En móvil dejamos solamente el icono del usuario.
     */

    .header-user {
        padding: 3px;
        background: transparent;
        border: 0;
    }


    .header-user-info {
        display: none;
    }


    .header-user-icon {
        width: 36px;
        height: 36px;
    }


    /*
     * Ocultar texto logout y mantener icono.
     */

    #logout-button .dx-button-text {
        display: none;
    }


    #logout-button {
        width: 38px;
        padding: 0;
    }
}


/* ================================================================
   MOVIL MUY PEQUEÑO
   ================================================================ */

@media (max-width: 390px) {

    .app-brand-text {
        display: none;
    }
}
/* ================================================================
   CENTRADO VERTICAL MARCA
   ================================================================ */

.header-brand {
    display: flex;
    align-items: center;
    height: 64px;
}


    .header-brand .dx-toolbar-item-content {
        display: flex;
        align-items: center;
        height: 100%;
    }


.app-brand {
    display: flex;
    align-items: center;
    height: 100%;
}