/* ============================================================
   Menu Compte du header principal (travailleur connecté)
   Le bouton « Moi » ouvre ce menu sur place, sur toutes les pages.
   ============================================================ */
.am { position: relative; order: 11; margin-left: .6rem; display: flex; align-items: center; }
.am-btn {
    width: 40px; height: 40px; padding: 0; display: grid; place-items: center; overflow: hidden; cursor: pointer;
    border: 2px solid rgba(11,37,82,.18); border-radius: 50%;
    background: linear-gradient(140deg, #061a3a 0%, #0b2552 50%, #04326d 100%); color: #fff;
    font: inherit; font-size: .8rem; font-weight: 800; transition: border-color .2s ease, box-shadow .2s ease;
}
.am-btn img { width: 100%; height: 100%; object-fit: cover; }
.am-btn:hover, .am-btn[aria-expanded="true"] { border-color: #0b2552; box-shadow: 0 0 0 3px rgba(11,37,82,.12); }

.am-panel {
    position: absolute; right: 0; top: calc(100% + 14px); z-index: 1200; width: 310px; max-height: calc(100vh - 110px); overflow: auto;
    padding: .4rem 0; border-radius: 14px; text-align: left;
    background: #fff; color: #1f2937; border: 1px solid rgba(0,0,0,.1); box-shadow: 0 22px 48px -18px rgba(0,0,0,.45);
}
.am-panel[hidden] { display: none; }
.am-head { display: flex; align-items: center; gap: .85rem; padding: .85rem 1.1rem .75rem; }
.am-photo { margin: 0; flex: none; }
.am-photo label { position: relative; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; cursor: pointer;
    background: linear-gradient(140deg, #061a3a 0%, #0b2552 50%, #04326d 100%); color: #fff; font-weight: 800; font-size: .95rem; }
.am-photo img { width: 100%; height: 100%; object-fit: cover; }
.am-cam { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; width: 100%; padding: 2px; background: rgba(0,0,0,.45); color: #fff; opacity: 0; transition: opacity .2s ease; }
.am-photo label:hover .am-cam { opacity: 1; }
.am-id { display: grid; gap: .12rem; min-width: 0; }
.am-id strong { font-size: 1rem; font-weight: 700; color: #111827; }
.am-id span { font-size: .8rem; color: #6b7280; overflow-wrap: anywhere; }

.am-list { display: grid; padding: .15rem 0; }
.am-list a, .am-row summary, .am-out, .am-theme {
    display: flex; align-items: center; gap: .85rem; padding: .6rem 1.1rem; font-size: .9rem; color: #1f2937; text-decoration: none;
}
.am-list a span, .am-row summary span, .am-theme > span { flex: 1; }
.am-list a:hover, .am-row summary:hover, .am-out:hover { background: #f3f5f9; }
.am-list a.is-on { background: #eef3fb; color: #0b2552; font-weight: 700; box-shadow: inset 3px 0 0 #0b2552; }
.am-panel svg, .am-panel i { width: 19px; height: 19px; flex: none; color: #374151; }
.am-list a.is-on svg, .am-list a.is-on i { color: #0b2552; }
.am-sep { height: 1px; margin: .35rem 0; background: #e5e7eb; }

.am-row summary { list-style: none; cursor: pointer; }
.am-row summary::-webkit-details-marker { display: none; }
.am-row summary em { font-style: normal; font-size: .85rem; color: #6b7280; }
.am-langs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .2rem 1.1rem .6rem 3.05rem; }
.am-langs a { padding: .4rem .6rem; border-radius: 8px; font-size: .82rem; font-weight: 600; color: #374151; text-decoration: none; background: #f3f5f9; }
.am-langs a:hover { color: #0b2552; background: #e8eef8; }
.am-langs a.is-on { color: #fff; background: linear-gradient(140deg, #061a3a 0%, #0b2552 50%, #04326d 100%); }

.am-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: #eef1f5; }
.am-seg button { width: 34px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: #6b7280; cursor: pointer; transition: background .2s ease, color .2s ease; }
.am-seg button svg, .am-seg button i { width: 16px; height: 16px; color: inherit; }
.am-seg button:hover { color: #0b2552; }
.am-seg button.is-on { background: #fff; color: #0b2552; box-shadow: 0 1px 4px rgba(0,0,0,.18); }

.am-out, .am-out svg, .am-out i { color: #b91c1c; }

/* Mode sombre */
:root[data-theme="dark"] .am-panel { background: #1f2023; color: #e5e7eb; border-color: rgba(255,255,255,.1); }
:root[data-theme="dark"] .am-id strong { color: #fff; }
:root[data-theme="dark"] .am-id span, :root[data-theme="dark"] .am-row summary em { color: #9ca3af; }
:root[data-theme="dark"] .am-list a, :root[data-theme="dark"] .am-row summary, :root[data-theme="dark"] .am-theme { color: #e5e7eb; }
:root[data-theme="dark"] .am-panel svg, :root[data-theme="dark"] .am-panel i { color: #d1d5db; }
:root[data-theme="dark"] .am-list a:hover, :root[data-theme="dark"] .am-row summary:hover, :root[data-theme="dark"] .am-out:hover { background: rgba(255,255,255,.06); }
:root[data-theme="dark"] .am-list a.is-on { background: rgba(157,184,230,.12); color: #fff; box-shadow: inset 3px 0 0 #9db8e6; }
:root[data-theme="dark"] .am-list a.is-on svg, :root[data-theme="dark"] .am-list a.is-on i { color: #9db8e6; }
:root[data-theme="dark"] .am-sep { background: rgba(255,255,255,.1); }
:root[data-theme="dark"] .am-langs a { background: rgba(255,255,255,.06); color: #e5e7eb; }
:root[data-theme="dark"] .am-seg { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .am-seg button { color: #9ca3af; }
:root[data-theme="dark"] .am-seg button.is-on { background: #fff; color: #111827; }
:root[data-theme="dark"] .am-out, :root[data-theme="dark"] .am-out svg, :root[data-theme="dark"] .am-out i { color: #f87171; }
:root[data-theme="dark"] .am-btn { border-color: rgba(255,255,255,.25); }

/* Connecté : l'icône « Moi » (lien vers /space) est remplacée par ce menu */
body.am-on .nav-links .nav-moi, body.am-on .nav-mobile-account { display: none !important; }

@media (max-width: 768px) {
    .am { order: 2; margin-left: auto; margin-right: .2rem; }
    .am-panel { position: fixed; left: .75rem; right: .75rem; top: calc(var(--ann-vis, 0px) + 84px); width: auto; max-height: calc(100vh - var(--ann-vis, 0px) - 100px); }
}


/* ── Cloche de notifications (header principal) ── */
.nb { position: relative; order: 11; margin-left: .6rem; display: flex; align-items: center; }
.nb ~ .am { margin-left: .4rem; }
.nb-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; cursor: pointer;
    border: 1px solid var(--line-1, #e5e7eb); border-radius: 50%; background: var(--surface-1, #fff); color: var(--tx-1, #111827); transition: background .2s ease, color .2s ease; }
.nb-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nb-btn:hover, .nb-btn[aria-expanded="true"] { background: var(--section-alt-bg, #f2f2f2); color: #0b2552; }
.nb-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center;
    border-radius: 999px; background: #dc2626; color: #fff; font-size: .64rem; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px var(--surface-1, #fff); }
.nb-panel { width: 340px; }
.nb-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1.1rem .65rem; border-bottom: 1px solid #e5e7eb; font-size: .9rem; }
.nb-head span { font-size: .78rem; color: #6b7280; }
.nb-empty { margin: 0; padding: 1.2rem 1.1rem; font-size: .88rem; color: #6b7280; }
.nb-list { list-style: none; margin: 0; padding: 0; }
.nb-list li { padding: .75rem 1.1rem; border-bottom: 1px solid #f1f3f5; font-size: .86rem; }
.nb-list li:last-child { border-bottom: 0; }
.nb-list li.is-new { background: #f5f8fd; box-shadow: inset 3px 0 0 #0b2552; }
.nb-list strong { display: block; font-weight: 700; color: #111827; }
.nb-list p { margin: .15rem 0 0; color: #4b5563; line-height: 1.45; }
.nb-list small { display: block; margin-top: .25rem; font-size: .74rem; color: #9ca3af; }
.nb-tag { display: inline-block; margin-bottom: .2rem; padding: .05rem .45rem; border-radius: 999px; font-style: normal; font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: #0b2552; color: #fff; }
:root[data-theme="dark"] .nb-head { border-bottom-color: rgba(255,255,255,.1); }
:root[data-theme="dark"] .nb-list li { border-bottom-color: rgba(255,255,255,.06); }
:root[data-theme="dark"] .nb-list li.is-new { background: rgba(157,184,230,.08); box-shadow: inset 3px 0 0 #9db8e6; }
:root[data-theme="dark"] .nb-list strong { color: #fff; }
:root[data-theme="dark"] .nb-list p { color: #d1d5db; }
@media (max-width: 768px) {
    .nb { order: 2; margin-left: auto; }
    .nb ~ .am { margin-left: .3rem; }
    .nb-panel { position: fixed; left: .75rem; right: .75rem; top: calc(var(--ann-vis, 0px) + 84px); width: auto; }
}

/* Cloche + Compte côte à côte, à droite des liens (l'espace libre va avant les liens) */
@media (min-width: 769px) {
    body.am-on .navbar .nav-links { margin-left: auto; }
    body.am-on .navbar .nb { margin-left: .9rem; }
    body.am-on .navbar .am { margin-left: .45rem; }
}
