/* En-tête unique, partagé par Actuel, A et B. La marque et les commandes
   occupent exactement les mêmes 64px ; seul le menu de débordement se déploie. */
:root { --site-header-height: 64px; }
.site-header { display: flex; position: sticky; top: 0; z-index: 400; height: var(--site-header-height); min-height: var(--site-header-height); background: var(--color-surface); }
.site-header__brand { display: flex; align-items: center; gap: 9px; flex: 0 0 var(--sidebar-w); min-width: 0; height: var(--site-header-height); padding: 0 16px; border-right: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); color: var(--color-text); font-size: 16px; font-weight: 650; text-decoration: none; }
.site-header__brand:hover { color: var(--color-primary); text-decoration: none; }
.site-header__brand-icon { flex: none; font-size: 22px; line-height: 1; }
.site-header__brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header .topbar { display: flex; flex: 1; flex-wrap: nowrap; align-items: center; gap: 10px; min-width: 0; height: var(--site-header-height); min-height: var(--site-header-height); padding: 0 20px; position: relative; top: auto; z-index: auto; border-bottom: 1px solid var(--color-border); background: var(--color-surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-header .topbar__title { flex: 1 1 auto; min-width: 180px; max-height: 40px; margin: 0; font-size: 19px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-skin="maison"] .site-header .topbar__title { font-size: 22px; }
.site-header .topbar__title .show-breadcrumb { display: flex; flex-wrap: nowrap; min-width: 0; }
.site-header .topbar__title .show-breadcrumb__current { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-header .topbar__title .board-selector { display: flex !important; max-width: 100%; min-width: 0; }
.site-header .topbar__title .board-selector select { min-width: 0; max-width: 100%; flex: 1; }
.site-header .topbar__actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; margin: 0; }
.site-header :is(.topbar__page-actions, .topbar-actions-extra, .topbar__badge) { display: contents; }
.site-header .topbar__context-info { white-space: nowrap; flex-shrink: 0; }
.site-header .topbar__context-info:empty { display: none; }
.site-header .topbar__actions > .notif-wrap { margin: 0; flex: none; }
.site-header .topbar__actions :is(.btn, .page-dropdown) { flex-shrink: 0; white-space: nowrap; }
.site-header :is(.sidebar-toggle, .notif-bell, #topbar-overflow-trigger) { width: 44px; height: 44px; min-height: 44px; flex: none; padding: 0; }
.site-header .topbar__page-actions > .btn { max-height: 44px; }
.site-header [hidden] { display: none !important; }
.site-header .gsearch { flex: 0 0 auto; min-width: 0; }
.site-header .gsearch__form { width: 240px; max-width: none; height: 40px; min-height: 40px; }
.site-header .gsearch__form:focus-within { width: 280px; }
.site-header .gsearch__input { opacity: 1; }
.site-header .topbar--compact-search .gsearch { width: 44px; height: 44px; position: relative; }
.site-header .topbar--compact-search .gsearch__form { width: 44px; height: 44px; min-height: 44px; padding: 0 12px; }
.site-header .topbar--compact-search .gsearch__kbd { display: none; }
.site-header .topbar--compact-search .gsearch__input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.site-header .topbar--compact-search .gsearch__form:focus-within { position: fixed; top: 10px; right: 10px; z-index: 5; width: min(360px, calc(100vw - 20px)); max-width: none; padding: 0 12px; box-shadow: var(--shadow-md); }
.site-header .topbar--compact-search .gsearch__form:focus-within .gsearch__input { position: static; width: auto; height: auto; padding: 0; opacity: 1; cursor: text; }
.site-header .gsearch__dropdown { position: fixed; top: calc(var(--site-header-height) + 8px); right: 10px; width: 420px; max-width: calc(100vw - 20px); max-height: calc(100dvh - var(--site-header-height) - 20px); }
.site-header .notif-dropdown { overflow: auto; position: fixed; top: calc(var(--site-header-height) + 8px); right: 10px; max-width: calc(100vw - 20px); max-height: calc(100dvh - var(--site-header-height) - 20px); }
.site-header .topbar-overflow { display: inline-block; position: relative; }
.topbar-overflow__menu { position: fixed; top: calc(var(--site-header-height) + 8px); right: 10px; width: 320px; max-width: calc(100vw - 20px); max-height: calc(100dvh - var(--site-header-height) - 20px); overflow: auto; padding: 8px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg); z-index: 650; overscroll-behavior: contain; }
.topbar-overflow__menu > * { margin: 0 0 4px; max-width: 100%; }
.site-header .topbar-overflow__menu :is(.btn, .page-dropdown__trigger) { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 44px; padding: 9px 10px; border: 0; border-radius: var(--radius); white-space: normal; text-align: left; }
.topbar-overflow__menu .btn:hover { background: var(--color-hover, var(--color-bg)); }
html[data-skin] .topbar-overflow .btn--primary { background: var(--color-primary-light); color: var(--color-primary); }
.topbar-overflow__menu .page-dropdown { display: block; width: 100%; }
.topbar-overflow__menu .page-dropdown__menu { position: static; min-width: 0; width: 100%; box-shadow: none; }
.topbar-overflow__menu .topbar__context-info { display: block; padding: 8px 10px; font-size: 12px; color: var(--color-muted); }
/* Le header est désormais hors de .app : garder les pages plein-cadre bornées. */
.app { min-height: calc(100vh - var(--site-header-height)); min-height: calc(100dvh - var(--site-header-height)); }
.app:has(.content--flush), body.page-flush .app { height: calc(100vh - var(--site-header-height)); height: calc(100dvh - var(--site-header-height)); min-height: 0; }
.sidebar { top: var(--site-header-height); height: calc(100vh - var(--site-header-height)); height: calc(100dvh - var(--site-header-height)); }
.sidebar__nav { min-height: 0; }
@media (max-width: 1024px) {
    .site-header__brand { flex-basis: 170px; padding: 0 12px; font-size: 14px; }
    .site-header .topbar { gap: 6px; padding: 0 10px; }
    .site-header .topbar__title { min-width: 110px; font-size: 17px; }
    html[data-skin="maison"] .site-header .topbar__title { font-size: 19px; }
    .site-header .topbar__actions { gap: 6px; }
    .sidebar { top: var(--site-header-height); height: calc(100dvh - var(--site-header-height)); }
    .sidebar-backdrop { top: var(--site-header-height); }
}
@media (max-width: 480px) {
    .site-header__brand { flex-basis: 110px; padding: 0 6px; gap: 4px; font-size: 12px; }
    .site-header__brand-icon { font-size: 19px; }
    .site-header .topbar { padding: 0 4px; gap: 4px; }
    .site-header .topbar__title { min-width: 48px; font-size: 15px; }
    html[data-skin="maison"] .site-header .topbar__title { font-size: 17px; }
    .site-header .topbar__actions { gap: 4px; }
}
@media (max-width: 360px) {
    .site-header__brand { flex-basis: 94px; font-size: 11px; }
    .site-header__brand-icon { font-size: 17px; }
    .site-header :is(.sidebar-toggle, .notif-bell, #topbar-overflow-trigger) { width: 38px; }
    .site-header .topbar--compact-search .gsearch, .site-header .topbar--compact-search .gsearch__form { width: 38px; }
    .site-header .topbar__title { min-width: 38px; }
}

/* Le repère Dev reste dans les 64 px du logo, sans masquer une action. */
.site-header__brand-icon { position: relative; }
.site-header__dev-indicator {
    position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
    padding: 1px 3px; border-radius: 3px; color: #fff; background: #b00020;
    font: 800 8px/1.2 system-ui, sans-serif; letter-spacing: .3px;
}
