﻿/* =====================================================
   RESET / BASE
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --header-height: 54px;
    --footer-height: 28px;
    /* ============ PALETA INSTITUCIONAL GP LOGISTICS ============ */
    --color-primary: #145DA0;
    --color-primary-dark: #0E4377;
    --color-secondary: #1E88E5;
    --color-secondary-dark: #1565C0;
    --color-surface: #D7D7D7;
    --color-bg: #F4F5F7;
    --color-text-light: #FFFFFF;
    --color-text-dark: #2B2B2B;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f5f7;
    color: #333;
    overflow: hidden;
}


/* =====================================================
   BODY
   ===================================================== */
body {
    display: flex;
    flex-direction: column;
}


/* =====================================================
   HEADER GENERAL eSipo
   ===================================================== */
.app-header {
    height: var(--header-height);
    min-height: var(--header-height);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    /* SIN LÍNEA */
    border-bottom: none;
    /* SOMBRA DIFUMINADA */
    box-shadow: 0 2px 6px rgba(15, 27, 45, 0.10);
    flex-shrink: 0;
    position: relative;
    z-index: 1000;
}
/* =====================================================
   HEADER - IDENTIDAD eSipo
   ===================================================== */
.header-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 100%;
}

.header-brand-home {
    display: flex;
    align-items: baseline;
    padding: 0;
    border: none;
    background: transparent;
    font-family: "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.header-brand-e {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-secondary);
}

.header-brand-sipo {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary-dark);
}

.header-brand-home:hover .header-brand-e {
    color: var(--color-secondary-dark);
}

.header-brand-home:hover .header-brand-sipo {
    color: var(--color-primary);
}


/* =====================================================
   HEADER - DIVISOR / PORTAL
   ===================================================== */
.header-brand-divider {
    width: 1px;
    height: 22px;
    margin: 0 12px;
    background: #d7dde5;
    flex-shrink: 0;
}

.header-portal-name {
    font-size: 13px;
    font-weight: 500;
    color: #5b6573;
    white-space: nowrap;
}


/* =====================================================
   HEADER - DERECHA
   ===================================================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}


/* =====================================================
   HEADER - EMPRESA
   ===================================================== */
.empresa-nombre {
    max-width: 260px;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =====================================================
   HEADER - BOTON MENU PRINCIPAL
   ===================================================== */
.header-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: none;
    flex-shrink: 0;
}

    .header-icon span {
        font-size: 21px;
        color: var(--color-primary-dark);
        font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    }

    .header-icon:hover {
        background: rgba(20, 93, 160, 0.08);
        transform: none;
        box-shadow: none;
    }

        .header-icon:hover span {
            color: var(--color-secondary);
        }

    .header-icon:active {
        transform: scale(0.94);
    }


/* =====================================================
   HEADER - NOMBRE USUARIO
   ===================================================== */
.header-usuario-nombre {
    max-width: 220px;
    font-size: 13px;
    font-weight: 500;
    color: #49515c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =====================================================
   HEADER - AVATAR
   ===================================================== */
.header-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-avatar {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(20, 93, 160, 0.18);
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(11, 37, 69, 0.12);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .header-avatar:hover {
        background: var(--color-primary-dark);
        box-shadow: 0 3px 8px rgba(11, 37, 69, 0.18);
    }

    .header-avatar:active {
        transform: scale(0.95);
    }


/* =====================================================
   HEADER - MENU AVATAR
   ===================================================== */
.avatar-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: #ffffff;
    border: 1px solid #e7eaf0;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(11, 37, 69, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 2000;
}

.avatar-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    text-decoration: none;
    color: #333333;
    font-size: 14px;
    transition: background 0.15s ease, color 0.15s ease;
}

    .avatar-menu-item .material-symbols-outlined {
        font-size: 18px;
        color: var(--color-secondary);
    }

    .avatar-menu-item:hover {
        background: var(--color-bg);
    }

.avatar-menu-item-logout {
    border-top: 1px solid #eeeeee;
    color: #b23b3b;
}

    .avatar-menu-item-logout .material-symbols-outlined {
        color: #b23b3b;
    }

    .avatar-menu-item-logout:hover {
        background: #FBEAEA;
    }


/* =====================================================
   CONTENT
   ===================================================== */
.app-content {
    flex: 1;
    background: var(--color-bg);
    padding: 30px;
    overflow-y: auto;
}


/* =====================================================
   FOOTER
   Misma identidad visual del login
   ===================================================== */
.app-footer {
    height: var(--footer-height);
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.82);
    border-top: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    font-size: 11px;
    z-index: 100;
}

.footer-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 14px;
    white-space: nowrap;
}

#footerRoute {
    font-weight: 600;
    color: #ffffff;
}


/* =====================================================
   UTILIDADES
   ===================================================== */
.hidden {
    display: none !important;
}


/* =====================================================
   MENU PRINCIPAL
   ===================================================== */
.menu-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}


/* =====================================================
   MENU - TARJETAS
   ===================================================== */
.menu-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eceff2;
    box-shadow: 0 4px 14px rgba(11, 37, 69, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
}

    .menu-card:hover {
        box-shadow: 0 10px 24px rgba(11, 37, 69, 0.12);
        transform: translateY(-2px);
    }


/* =====================================================
   MENU - HEADER TARJETA
   ===================================================== */
.menu-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    font-weight: 600;
    font-size: 15px;
    color: #2b2b2b;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .menu-card-header.active {
        background: var(--color-bg);
        color: var(--color-primary);
    }

        .menu-card-header.active .menu-icon {
            color: var(--color-primary);
        }

.menu-card.active {
    box-shadow: 0 8px 20px rgba(11, 37, 69, 0.12);
}


/* =====================================================
   MENU - ICONOS
   ===================================================== */
.menu-icon {
    font-size: 22px;
    color: var(--color-secondary);
}


/* =====================================================
   MENU - BODY
   ===================================================== */
.menu-card-body {
    display: none;
    padding: 12px 16px;
}


/* =====================================================
   MENU - OPCIONES
   ===================================================== */
.menu-option-item {
    padding: 8px 0;
    border-bottom: 1px solid #f2f2f2;
}

    .menu-option-item:last-child {
        border-bottom: none;
    }

    .menu-option-item a {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: #444;
        transition: 0.2s;
    }

        .menu-option-item a:hover {
            color: var(--color-secondary);
            padding-left: 6px;
        }

.menu-option-icon {
    font-size: 18px;
    color: var(--color-secondary);
}


/* =====================================================
   MODALES
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 37, 69, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

    .modal-overlay.hidden {
        display: none !important;
    }

.modal-box {
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    border-top: 4px solid var(--color-primary);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.30);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}


/* =====================================================
   COMPANY / SITE LIST
   ===================================================== */
#companyList,
#siteList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


    /* =====================================================
   COMPANY / SITE - TARJETA
   ===================================================== */
    #companyList .category-option-item,
    #siteList .category-option-item {
        background: #ffffff;
        border: 1.5px solid #ececec;
        border-radius: 14px;
        padding: 16px 14px;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

        #companyList .category-option-item:hover,
        #siteList .category-option-item:hover {
            background: var(--color-bg);
            border-color: var(--color-secondary);
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(11, 37, 69, 0.10);
        }


    /* =====================================================
   COMPANY / SITE - ICONO
   ===================================================== */
    #companyList .category-option-icon,
    #siteList .category-option-icon {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--color-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        color: var(--color-primary);
    }


    /* =====================================================
   COMPANY / SITE - TEXTO
   ===================================================== */
    #companyList .category-option-text,
    #siteList .category-option-text {
        font-size: 15px;
        font-weight: 500;
        color: #333;
    }


/* =====================================================
   FOOTER - IDENTIDAD eSipo
   ===================================================== */
.app-footer {
    height: var(--footer-height);
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.82);
    border-top: none;
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    font-size: 11px;
    z-index: 1000;
}

.footer-inner {
    width: 100%;
    height: 100%;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    white-space: nowrap;
}

    .footer-brand strong {
        color: #ffffff;
        font-size: 12px;
        font-weight: 700;
    }

.footer-divider {
    opacity: 0.4;
    margin: 0 3px;
}

.footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.footer-copy {
    white-space: nowrap;
    opacity: 0.78;
}


/* =====================================================
   FOOTER - BOTON INFORMACION
   ===================================================== */
.footer-info-button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

    .footer-info-button .material-symbols-outlined {
        font-size: 17px;
    }

    .footer-info-button:hover {
        background: rgba(255, 255, 255, 0.24);
    }

    .footer-info-button:active {
        transform: scale(0.92);
    }


/* =====================================================
   PANEL INFORMACION DE SESION
   ===================================================== */
.session-info-panel {
    position: absolute;
    right: 10px;
    bottom: calc(var(--footer-height) + 8px);
    width: 360px;
    max-width: calc(100vw - 20px);
    background: #ffffff;
    color: var(--color-text-dark);
    border: 1px solid #e4e9ef;
    border-radius: 12px;
    box-shadow: 0 14px 38px rgba(11, 37, 69, 0.22);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

    .session-info-panel.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }


/* =====================================================
   PANEL - HEADER
   ===================================================== */
.session-info-header {
    min-height: 58px;
    padding: 11px 12px 10px 14px;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.session-info-title {
    font-size: 14px;
    font-weight: 700;
}

.session-info-subtitle {
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.8;
}

.session-info-close {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .session-info-close:hover {
        background: rgba(255, 255, 255, 0.14);
    }

    .session-info-close .material-symbols-outlined {
        font-size: 19px;
    }


/* =====================================================
   PANEL - CONTENIDO
   ===================================================== */
.session-info-body {
    padding: 5px 14px;
}

.session-info-row {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid #edf0f3;
}

    .session-info-row:last-child {
        border-bottom: none;
    }

.session-info-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .session-info-icon .material-symbols-outlined {
        font-size: 18px;
    }

.session-info-data {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.session-info-label {
    font-size: 10px;
    font-weight: 700;
    color: #7a8490;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.session-info-value {
    font-size: 13px;
    font-weight: 600;
    color: #2f3740;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-info-value-muted {
    font-size: 12px;
    font-weight: 400;
    color: #8a929b;
}

.session-info-id {
    padding: 4px 7px;
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-primary-dark);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =====================================================
   RESPONSIVE - TABLET / PANTALLAS MEDIANAS
   ===================================================== */
@media (max-width: 900px) {

    .header-portal-name {
        display: none;
    }

    .header-brand-divider {
        display: none;
    }

    .empresa-nombre {
        max-width: 180px;
    }

    .header-usuario-nombre {
        max-width: 170px;
    }
}


/* =====================================================
   RESPONSIVE - MOVIL
   ===================================================== */
@media (max-width: 640px) {

    :root {
        --header-height: 50px;
    }

    .app-header {
        padding: 0 10px;
        border-bottom-width: 3px;
    }


    /* =========================
       MARCA
       ========================= */
    .header-brand {
        flex-shrink: 0;
    }

    .header-brand-e,
    .header-brand-sipo {
        font-size: 21px;
    }

    .header-brand-divider,
    .header-portal-name {
        display: none;
    }


    /* =========================
       DERECHA
       ========================= */
    .header-right {
        flex: 1;
        justify-content: flex-end;
        gap: 6px;
        min-width: 0;
        margin-left: 10px;
    }


    /* =========================
       EMPRESA
       ========================= */
    .empresa-nombre {
        max-width: 125px;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


    /* =========================
       NOMBRE USUARIO
       ========================= */
    .header-usuario-nombre {
        display: none;
    }


    /* =========================
       MENU PRINCIPAL
       ========================= */
    .header-icon {
        width: 30px;
        height: 30px;
        border-radius: 7px;
    }

        .header-icon span {
            font-size: 20px;
        }


    /* =========================
       AVATAR
       ========================= */
    .header-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }


    /* =========================
       MENU AVATAR
       ========================= */
    .avatar-menu {
        position: fixed;
        top: calc(var(--header-height) + 6px);
        right: 8px;
        width: min( 220px, calc(100vw - 16px) );
    }


    /* =========================
       CONTENIDO
       ========================= */
    .app-content {
        padding: 18px 12px;
    }
}


/* =====================================================
   RESPONSIVE - MOVIL PEQUEÑO
   ===================================================== */
@media (max-width: 420px) {

    .empresa-nombre {
        max-width: 105px;
    }

    .header-right {
        gap: 4px;
        margin-left: 8px;
    }
}
