/* =====================================================
   TOOLBAR - Header Principal Premium
   Diseño impactante y limpio
   ===================================================== */

/* --- Contenedor del Header --- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 1001;
}

/* --- Base del Toolbar --- */
.app-toolbar.e-toolbar {
    position: relative !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 72px !important;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 255, 0.98) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(6, 0, 81, 0.08);
    border-bottom: none;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box;
    overflow: visible;
}

/* --- Contenedor del Buscador (fuera del Toolbar) --- */
.header-search-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1002;
}

/* Linea de gradiente superior impactante */
.app-toolbar.e-toolbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        #36C1FF 0%,
        #4459D7 25%,
        #6877F7 50%,
        #4459D7 75%,
        #36C1FF 100%);
    background-size: 200% 100%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.app-toolbar.e-toolbar .e-toolbar-items.e-tbar-pos .e-toolbar-left {
    height: 72px;
}

/* --- Menu Hamburguesa --- */
.menu.e-small {
    color: var(--pidt-primary-dark) !important;
    border: none;
    background: transparent;
    padding: 10px;
    min-width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.25s ease;
    margin-left: 8px;
}

.menu.e-small:hover {
    background: rgba(68, 89, 215, 0.08);
}

.menu.e-small:active {
    transform: scale(0.95);
}

.menu.e-small .e-btn-icon,
.menu.e-small .e-menu {
    font-size: 24px !important;
}

.menu.e-small .e-btn-icon::before,
.menu.e-small .e-icons::before {
    font-size: 22px !important;
    color: var(--pidt-primary-dark);
}

/* --- Brand Section --- */
.brand-with-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    height: 100%;
}

.brand-logo-container {
    display: flex;
    align-items: center;
}

.pidt-logo {
    height: 56px;
    width: auto;
    transition: transform 0.3s ease;
}

.brand-with-logo:hover .pidt-logo {
    transform: scale(1.03);
}

/* Separador vertical elegante */
.brand-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(68, 89, 215, 0.15) 20%,
        rgba(68, 89, 215, 0.25) 50%,
        rgba(68, 89, 215, 0.15) 80%,
        transparent 100%);
    margin: 0 4px;
}

.brand-text-simple {
    font-size: 18px;
    font-weight: 700;
    color: var(--pidt-primary-dark);
    letter-spacing: 0.3px;
    font-family: var(--pidt-font-secondary);
}

/* --- Company Badge (Cliente) --- */
.company-badge-subtle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg,
        rgba(68, 89, 215, 0.06) 0%,
        rgba(54, 193, 255, 0.06) 100%);
    border-radius: 12px;
    border: 1px solid rgba(68, 89, 215, 0.08);
    margin-right: 8px;
    transition: all 0.25s ease;
}

.company-badge-subtle:hover {
    background: linear-gradient(135deg,
        rgba(68, 89, 215, 0.1) 0%,
        rgba(54, 193, 255, 0.1) 100%);
    border-color: rgba(68, 89, 215, 0.15);
}

.company-label {
    font-size: 10px;
    color: var(--pidt-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.company-name-subtle {
    font-size: 14px;
    font-weight: 600;
    color: var(--pidt-primary-dark);
    font-family: var(--pidt-font-primary);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Toolbar Logo del Cliente --- */
.toolbar-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 68px;
}

.toolbar-logo {
    max-width: 42px;
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, opacity 0.8s ease-out;
    animation: logoFadeIn 1s ease-out forwards;
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.toolbar-logo:hover {
    transform: scale(1.05);
}

/* --- Ocultar separadores que solapan --- */
.e-toolbar .e-toolbar-items .e-separator {
    display: none !important;
}

/* --- Espaciado entre elementos del toolbar --- */
.e-toolbar-items {
    gap: 8px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .company-label {
        display: none;
    }

    .brand-text-simple {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .app-toolbar.e-toolbar {
        height: 64px !important;
    }

    .brand-text-simple {
        font-size: 14px;
    }

    .brand-divider {
        height: 24px;
        margin: 0 2px;
    }

    .company-badge-subtle {
        padding: 6px 12px;
    }

    .company-name-subtle {
        max-width: 100px;
        font-size: 13px;
    }

    .pidt-logo {
        height: 44px;
    }

    .menu.e-small {
        min-width: 40px;
        height: 40px;
        margin-left: 4px;
    }
}

@media (max-width: 480px) {
    .brand-with-logo {
        gap: 8px;
        padding: 0 8px;
    }

    .pidt-logo {
        height: 38px;
    }

    .brand-text-simple {
        display: none;
    }

    .brand-divider {
        display: none;
    }

    .company-badge-subtle {
        display: none;
    }
}
