/* =========================================================
   KAAY ERP - TOP HEADER
========================================================= */
.kaay-top-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 18px rgba(0,0,0,0.03);
}

.kaay-top-header .navbar {
    min-height: 82px;
    flex-wrap: nowrap;
    overflow: visible;
}

/* CONTEXTE ACTIF */
.kaay-context-card {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 14px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 18px;
    padding: 10px 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.04);
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

.kaay-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 145px;
    flex-shrink: 0;
}

.kaay-context-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.kaay-context-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.kaay-context-text small {
    color: #6c757d;
    font-size: 11px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.kaay-context-text span {
    font-weight: 600;
    color: #212529;
    font-size: 13px;
    line-height: 1.2;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kaay-context-divider {
    width: 1px;
    height: 34px;
    background: rgba(0,0,0,0.08);
    flex-shrink: 0;
}

.kaay-context-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kaay-context-action .btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* ZONE DROITE HEADER */
.kaay-header-actions {
    flex-shrink: 0;
    min-width: fit-content;
}

.kaay-user-menu {
    flex-shrink: 0;
    min-width: 0;
}

.kaay-user-menu .dropdown-toggle {
    white-space: nowrap;
    max-width: 220px;
}

.kaay-user-menu .user-meta {
    min-width: 0;
    overflow: hidden;
}

.kaay-user-menu .user-meta .fw-semibold,
.kaay-user-menu .user-meta small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================================================
   HEADER — MAINTENANCE & SUPPORT
   Alerte visuelle de J-5 à J-0
   ========================================================= */

@keyframes kaay-support-warning {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}

.kaay-support-warning {
    animation: kaay-support-warning 1.5s ease-in-out infinite;
}


/* =========================================================
   HEADER — RESPONSIVE INTERMEDIAIRE
   Priorité : Support / Aide / Utilisateur toujours accessibles
   ========================================================= */

/* Le centre peut se contracter, les actions restent visibles */
.kaay-top-header .navbar {
    min-width: 0;
}

.kaay-header-center {
    min-width: 0;
    flex: 1 1 auto;
}

.kaay-header-actions {
    flex: 0 0 auto;
    min-width: 0;
}

/*
 * Sur les largeurs où sidebar + contexte + actions
 * ne tiennent plus confortablement :
 * masquer le contexte complet.
 *
 * Le changement de contexte reste disponible
 * dans le menu utilisateur.
 */
@media (max-width: 1399.98px) {

    .kaay-header-center {
        display: none !important;
    }

    .kaay-top-header .navbar {
        justify-content: space-between;
    }
}