/* ============================================================
   Header applicatif (logo CLEM AI + menu compte), affiché sur le
   dashboard "app" (racine) à la place de la barre EasyAdmin par défaut.
   Toutes les classes sont préfixées "as-header" pour ne jamais
   entrer en collision avec les sélecteurs globaux EasyAdmin.
   ============================================================ */

/* .content-top (EasyAdmin) est en display:flex à toutes les largeurs :
   sans flex:1 + min-width:0, l'espacement interne "space-between" ne
   jouerait que sur la largeur propre de .as-header (shrink-to-fit),
   collant l'avatar contre le logo au lieu du bord droit de la barre
   (même piège que .as-quicknav, cf. commentaire dans admin-shell.css). */
.as-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 10px 4px;
}

.as-header-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #1a1c2e;
}

.as-header-logo b {
    color: #4f46e5;
}

.as-header-mark {
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 3px 10px rgba(99, 102, 241, .25);
}

.as-header-user {
    position: relative;
    flex: none;
}

.as-header-avatar {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(15, 23, 42, .1);
    background: #fafaff;
    border-radius: 11px;
    color: #6b7080;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.as-header-avatar:hover,
.as-header-user.is-open .as-header-avatar {
    border-color: #6366f1;
    color: #4f46e5;
}

.as-header-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1100;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    padding: 6px;
    border-radius: 13px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}

.as-header-menu a {
    padding: 9px 11px;
    border-radius: 9px;
    color: #1a1c2e;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.as-header-menu a:hover {
    background: #eef0fe;
    color: #4f46e5;
}

@media (max-width: 640px) {
    .as-header {
        position: sticky;
        top: 0;
        z-index: 900;
        background: #fff;
        margin: 0 -16px 8px;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(15, 23, 42, .06);
    }
}
