/* Retake — espace admin V3. Chargé après style.css. Même identité : near-black (ou blanc cassé en thème clair), hairlines, accent « REC », libellés mono.
   Les palettes (sombre / clair) et leurs variables vivent dans style.css. */

:root {
  --side-w: 264px;
  --top-h: 56px;
}
body.app-body { min-height: 100dvh; background: var(--bg); }
.fine { font-size: 12px; }
.mono { font-family: var(--mono); }
.boot { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
kbd { font: 500 10.5px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-2); background: var(--bg-1); border-radius: 4px; padding: 3px 5px; }
.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn .ic { margin: 0 -2px; }
.btn.block { width: 100%; min-height: 42px; margin-top: 8px; }
.btn.danger-solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.danger-solid:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.toggle.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.field.sm, select.field.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; width: auto; }
select.field.sm { padding-right: 28px; }
.field:disabled, .btn:disabled, select:disabled { opacity: .55; }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.bordered { border: 1px solid var(--line-2); background: var(--bg-2); width: 34px; height: 34px; }
.icon-btn.bordered:hover { background: var(--bg-3); border-color: var(--line-3); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.link-btn { font-family: inherit; }
.tag { display: inline-block; font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-2); border-radius: 3px; padding: 3px 5px; }
.cdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* =========================================================== coque */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; transition: grid-template-columns .22s var(--ease); }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.view { flex: 1; min-width: 0; outline: none; }

.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); overflow: hidden; z-index: 30; }
.sb-head { padding: 14px 12px 10px; display: flex; flex-direction: column; gap: 12px; }
.sb-head .brand { padding: 0 6px; height: 22px; }
.brand-top { display: none; align-items: center; min-height: var(--tap); padding: 0 4px; border-radius: 6px; flex: none; }
.brand-top:focus-visible, .sb-head .brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ws-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-align: left; transition: background .15s var(--ease), border-color .15s var(--ease); }
.ws-btn:hover { background: var(--bg-2); border-color: var(--line-2); }
.ws-btn .ic { color: var(--muted); }
.ws-ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font: 600 13px var(--mono); flex: none; }
.ws-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ws-txt b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-txt small { font: 400 10.5px var(--mono); color: var(--muted); letter-spacing: .04em; }

.sb-nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; }
.sb-link, .sb-client { position: relative; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 13.5px; transition: background .12s var(--ease), color .12s var(--ease); }
.sb-link:hover, .sb-client:hover { background: var(--bg-hover); color: var(--text); }
.sb-link.on, .sb-client.on { background: var(--bg-2); color: var(--text); }
.sb-link.on::before, .sb-client.on::before { content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.sb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count { font: 500 11px var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.sb-count.hot { color: var(--on-accent); background: var(--accent); border-radius: 99px; padding: 1px 6px; font-weight: 600; }
.sb-sec { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 8px 0; }
.sb-sec-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 8px; }
.sb-add { display: inline-flex; align-items: center; gap: 4px; background: none; border: 1px solid transparent; border-radius: 5px; color: var(--muted); font: 500 11px var(--mono); letter-spacing: .04em; padding: 3px 6px; cursor: pointer; transition: all .12s var(--ease); }
.sb-add:hover { color: var(--text); background: var(--bg-2); border-color: var(--line-2); }
.sb-filter { margin: 0 2px 8px; min-height: 30px; padding: 4px 10px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; }
.sb-filter:focus { outline: none; border-color: var(--accent); }
.sb-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; overscroll-behavior: contain; }
.sb-client .cdot { margin: 0 1px; }
.unseen-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); flex: none; }
.sb-empty { padding: 8px 10px; color: var(--dim); font-size: 12.5px; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px 4px 4px 8px; }
.su-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.su-txt b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.su-txt small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 600; flex: none; letter-spacing: .02em; --av-h: 0; background: hsl(var(--av-h) 38% 28%); color: hsl(var(--av-h) 80% 82%); }
:root[data-theme="light"] .avatar { background: hsl(var(--av-h) 55% 88%); color: hsl(var(--av-h) 60% 26%); }
.avatar.ghost, :root[data-theme="light"] .avatar.ghost { width: 34px; height: 34px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted); }
.sb-backdrop { display: none; }

body.side-collapsed .app { grid-template-columns: 0 minmax(0, 1fr); }
body.side-collapsed .sidebar { visibility: hidden; border-right: 0; }

.app-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: var(--top-h); padding: 0 20px 0 12px; background: var(--bg-glass); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-top .spacer { flex: 1; }
.search { position: relative; flex: 0 1 460px; min-width: 0; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); transition: border-color .15s var(--ease), background .15s var(--ease); }
.search:focus-within { border-color: var(--accent); background: var(--bg); color: var(--text); }
.search-in { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; font-size: 13.5px; -webkit-appearance: none; appearance: none; }
.search-in::-webkit-search-cancel-button { display: none; }
.search-in::placeholder { color: var(--dim); }
.search:focus-within kbd { display: none; }
.search-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70dvh, 520px); overflow-y: auto; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 40; color: var(--text); animation: pop .12s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.sp-group { padding: 8px 10px 4px; font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; border-radius: 6px; text-align: left; cursor: pointer; }
.sp-item.on { background: var(--bg-3); }
.sp-ic { width: 22px; display: grid; place-items: center; color: var(--muted); flex: none; }
.sp-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sp-txt b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-txt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.sp-empty .spinner { margin: 0 auto; }
body.role-viewer .new-btn, body.role-viewer .sb-add { display: none; }

/* =========================================================== pages */
.page { max-width: 1280px; margin: 0 auto; padding: 28px 28px 90px; }
.page.narrow { max-width: 880px; }
.pg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.pg-head h1 { margin: 8px 0 0; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; font-weight: 600; }
.crumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font: 500 12px var(--mono); letter-spacing: .04em; color: var(--muted); min-width: 0; }
.crumbs a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .ic { color: var(--dim); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.seg-icons { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.seg-btn { display: grid; place-items: center; width: 34px; height: 30px; background: transparent; border: 0; color: var(--muted); cursor: pointer; transition: all .12s var(--ease); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn:hover { color: var(--text); background: var(--bg-2); }
.seg-btn.on { background: var(--bg-3); color: var(--text); }
.chip-x { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px 0 10px; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); font: 500 12px var(--font); cursor: pointer; }
.chip-x:hover { filter: brightness(1.15); }

/* ---------- pastilles ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1 var(--mono); letter-spacing: .02em; padding: 4px 8px 4px 7px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; background: var(--tint); }
.st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.s-prog { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.st.s-rev { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.st.s-chg { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.st.s-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.st.s-del { color: var(--violet); border-color: var(--violet-line); background: var(--violet-soft); }
.cchip { display: inline-flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.cchip i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cchip.none { color: var(--dim); }
.due { display: inline-flex; align-items: center; gap: 5px; font: 400 12px var(--mono); color: var(--muted); white-space: nowrap; }
.due.over { color: var(--accent); font-weight: 500; }
.due.soon { color: var(--warn); }
.due.none { color: var(--dim); }
.oc { display: inline-flex; align-items: center; gap: 4px; font: 500 12px var(--mono); color: var(--accent); }
.oc-chip { display: inline-flex; align-items: center; gap: 5px; font: 500 11.5px var(--mono); color: var(--muted); padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 99px; width: fit-content; }
.oc-chip.hot { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pill.open { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- vignettes 16:9 ---------- */
.poster { position: relative; aspect-ratio: 16 / 9; background: #0d0d0f; overflow: hidden; border-radius: 6px; isolation: isolate; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s var(--ease), transform .35s var(--ease); }
.poster.has-img img { opacity: 1; }
.poster-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #5d5d68; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .015) 0 10px, transparent 10px 20px); }
.poster.has-img .poster-ph { display: none; }
.poster.pending .poster-ph { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }
.p-v, .p-dur, .p-unseen { position: absolute; z-index: 2; font: 600 10.5px/1 var(--mono); padding: 4px 6px; border-radius: 4px; background: rgba(0, 0, 0, .72); color: #fff; backdrop-filter: blur(4px); letter-spacing: .02em; }
.p-v { left: 8px; bottom: 8px; }
.p-dur { right: 8px; bottom: 8px; font-weight: 500; font-variant-numeric: tabular-nums; }
.p-unseen { left: 8px; top: 8px; background: #ff4a2b; color: #140400; box-shadow: 0 2px 10px rgba(255, 74, 43, .4); }
.poster.big .p-v, .poster.big .p-dur { font-size: 12px; padding: 5px 8px; }

/* ---------- grille de projets ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 18px; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; transition: border-color .15s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease), background .15s var(--ease); }
.pcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-hover); background: var(--card-hover); }
.pcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcard .poster { border-radius: 0; border-bottom: 1px solid var(--line); }
.pcard:hover .poster img { transform: scale(1.03); }
.pcard.archived { opacity: .55; }
.pc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pc-name { font-weight: 600; font-size: 14.5px; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.pc-row { display: flex; align-items: center; gap: 10px; min-height: 18px; }
.pc-row .oc { margin-left: auto; }
.pc-act { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-top: 8px; border-top: 1px solid var(--line); }
.pc-act.hot { color: var(--text); }

/* ---------- squelettes ---------- */
.sk-b { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 4px; }
.sk-l { height: 11px; margin: 9px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pcard.sk:hover { transform: none; box-shadow: none; }
.pcard.sk .poster { border-radius: 0; }

/* ---------- liste (tableau) ---------- */
.table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-1); }
.thead, .trow { display: grid; grid-template-columns: minmax(220px, 2.4fr) minmax(110px, 1.1fr) 150px 64px 74px 128px 96px; align-items: center; gap: 14px; padding: 0 16px; }
.thead { height: 38px; border-bottom: 1px solid var(--line); background: var(--bg); }
.th { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); text-align: left; }
button.th { cursor: pointer; }
button.th:hover, .th.on { color: var(--text); }
.trow { min-height: 62px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .12s var(--ease); }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--bg-2); }
.trow.archived { opacity: .55; }
.tc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tc-name .poster { width: 84px; flex: none; border-radius: 5px; }
.tn { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.new-dot { font: 600 10.5px var(--mono); color: var(--accent); }
.tc { min-width: 0; font-size: 13px; }
.tc-act { font-size: 12.5px; }

/* ---------- états vides / erreurs ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 56px 20px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--muted); }
.empty b { color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 10px; max-width: 420px; font-size: 13.5px; }
.empty-ic { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted); margin-bottom: 8px; }
.empty.err .empty-ic { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.panel-flat .empty { border: 0; padding: 32px 16px; }

/* =========================================================== tableau de bord */
.counters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.counter { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 14px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); }
a.counter:hover { border-color: var(--line-2); background: var(--bg-2); transform: translateY(-1px); }
.c-lbl { display: inline-flex; align-items: center; gap: 7px; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-lbl i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.c-num { font: 600 32px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.counter.zero .c-num { color: var(--dim); }
.c-go { position: absolute; right: 12px; top: 14px; color: var(--dim); opacity: 0; transition: all .15s var(--ease); }
a.counter:hover .c-go { opacity: 1; transform: translateX(2px); }
.counter.s-prog .c-lbl i { color: var(--info); }
.counter.s-rev .c-lbl i { color: var(--warn); }
.counter.s-chg .c-lbl i { color: var(--accent); }
.counter.s-ok .c-lbl i { color: var(--ok); }
.counter.s-del .c-lbl i { color: var(--violet); }
.counter.s-late .c-lbl i { color: var(--accent); }
.counter.s-late:not(.zero) { border-color: var(--accent-line); }
.counter.s-late:not(.zero) .c-num { color: var(--accent); }
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 26px; }
.card-sec { margin-bottom: 4px; min-width: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sec-count { font: 500 11px var(--mono); color: var(--text); background: var(--bg-3); border-radius: 99px; padding: 2px 7px; letter-spacing: 0; }
.sec-count.hot { color: var(--on-accent); background: var(--accent); }
.sec-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.sec-link:hover { color: var(--text); }
.sub-head { margin: 22px 0 10px; font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.panel-flat { background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mrow { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .12s var(--ease); }
.mrow:last-child { border-bottom: 0; }
a.mrow:hover { background: var(--bg-2); }
.mrow .poster { width: 96px; flex: none; border-radius: 5px; }
.mthumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 5px; }
.mr-main { flex: 1; min-width: 0; }
.mr-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-sub { display: flex; align-items: center; gap: 12px; margin-top: 4px; min-width: 0; }
.mr-act { font-size: 12px; color: var(--dim); }
.badge-new { flex: none; font: 600 11px/1 var(--mono); padding: 5px 8px; border-radius: 99px; color: var(--on-accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- activité ---------- */
.feed { display: block; }
.panel-flat .feed .act:last-child { border-bottom: 0; }
.act { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .12s var(--ease); }
.act:hover { background: var(--bg-2); }
.act .dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.act.new .dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.act.new { background: var(--accent-faint); }
.act-main { min-width: 0; }
.act-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act .who { font-weight: 600; }
.act .pill { display: inline-flex; align-items: center; gap: 4px; }
.act .where { color: var(--muted); font: 400 12px var(--mono); margin-top: 1px; }
.act .ex { color: var(--muted); font-size: 13px; margin-top: 3px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act .when { color: var(--dim); font-size: 12px; white-space: nowrap; }
.day-head { margin: 22px 0 10px; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day-head:first-of-type { margin-top: 0; }
.more { text-align: center; padding: 20px 0; }

/* =========================================================== page client */
.client-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.client-badge { width: 56px; height: 56px; border-radius: 14px; border: 1px solid; display: grid; place-items: center; font: 600 24px var(--mono); flex: none;
  --cc: #6b6b76; color: var(--cc); background: color-mix(in srgb, var(--cc) 13%, transparent); border-color: color-mix(in srgb, var(--cc) 40%, transparent); }
:root[data-theme="light"] .client-badge { color: color-mix(in srgb, var(--cc) 62%, #000); }
.ch-main { flex: 1; min-width: 220px; }
.ch-main h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 600; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; color: var(--muted); font-size: 13px; align-items: center; }
.ch-contact { display: inline-flex; align-items: center; gap: 6px; }
.ch-contact a { color: inherit; }
.ch-notes { margin: 12px 0 0; max-width: 620px; padding: 10px 12px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================== page projet */
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px 24px; margin-bottom: 26px; flex-wrap: wrap; }
.ph-main { flex: 1 1 420px; min-width: 0; }
.title-input { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 2px 8px; margin: 0 0 8px -8px; font: 600 28px/1.25 var(--font); letter-spacing: -.02em; color: var(--text); text-overflow: ellipsis; transition: border-color .15s var(--ease), background .15s var(--ease); }
.title-input:hover:not([readonly]) { background: var(--bg-1); border-color: var(--line); }
.title-input:focus { outline: none; background: var(--bg-1); border-color: var(--accent); }
.ph-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ctl { display: inline-flex; align-items: center; gap: 8px; }
.lbl-s { font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.st-sel { font-weight: 500; }
.st-sel.s-prog { color: var(--info); } .st-sel.s-rev { color: var(--warn); } .st-sel.s-chg { color: var(--accent); } .st-sel.s-ok { color: var(--ok); } .st-sel.s-del { color: var(--violet); }
.st-sel option { color: var(--text); background: var(--bg-1); }
.ph-sub { margin-top: 12px; font-size: 12.5px; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.vhero { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 24px; padding: 16px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; }
.vh-poster { position: relative; display: block; border-radius: 8px; text-decoration: none; }
.vh-poster .poster { border: 1px solid var(--line); }
.vh-play { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; z-index: 3; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 10, 11, .6); border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(4px); color: #fff; opacity: 0; transform: scale(.9); transition: all .18s var(--ease); }
.vh-play .ic { fill: currentColor; stroke: none; margin-left: 3px; }
.vh-poster:hover .vh-play, .vh-poster:focus-visible .vh-play { opacity: 1; transform: none; }
.vh-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 4px 2px; }
.vh-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-mono { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.vh-title { margin: 0; font-size: 20px; letter-spacing: -.01em; font-weight: 600; overflow-wrap: anywhere; }
.vh-meta { font-size: 12px; color: var(--muted); }
.vh-notes { margin: 0; color: var(--muted); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 10px; border-left: 2px solid var(--line-2); }
.vh-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; align-items: center; }
.vhero.sk { pointer-events: none; }

.vstrip { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity; }
.vcard { position: relative; flex: 0 0 232px; scroll-snap-align: start; display: flex; flex-direction: column; background: var(--bg-1); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; transition: border-color .15s var(--ease), transform .18s var(--ease); }
a.vcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.vcard .poster { border-radius: 0; border-bottom: 1px solid var(--line); }
.vc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.vc-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.vc-date { font-size: 11.5px; }
.vc-more { position: absolute; top: 6px; right: 6px; z-index: 3; width: 28px; height: 28px; display: grid; place-items: center; background: rgba(0, 0, 0, .65); border: 0; border-radius: 6px; color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; backdrop-filter: blur(4px); }
.vcard:hover .vc-more, .vc-more:focus-visible { opacity: 1; }

.upload-sec { margin: 22px 0 8px; }
.upload-sec .drop { display: flex; align-items: center; justify-content: center; gap: 4px 14px; flex-wrap: wrap; padding: 22px 16px; border-radius: 12px; text-align: left; }
.upload-sec .drop b { display: inline; margin: 0; }
.upload-sec .drop.big { flex-direction: column; padding: 48px 16px; text-align: center; background: repeating-linear-gradient(135deg, var(--hatch) 0 12px, transparent 12px 24px); }
.upload-sec .drop.big b { font-size: 16px; margin-bottom: 2px; }
.drop-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--muted); flex: none; }
.drop:hover .drop-ic, .drop.over .drop-ic { color: var(--accent); border-color: var(--accent-line); }
.drop.flash { border-color: var(--accent); animation: flash 1.6s ease-in-out 3; }
@keyframes flash { 50% { background: var(--accent-soft); } }
.up-card { padding: 16px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; }
.file-line .ic { color: var(--muted); }
.up-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.share-sec { margin: 22px 0 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); overflow: hidden; }
.share-head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 16px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--text); transition: background .12s var(--ease); }
.share-head:hover { background: var(--bg-2); }
.share-head > .ic:first-child { color: var(--dim); }
.share-head b { font-weight: 600; font-size: 13.5px; }
.sh-badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sh-badges .pill, .sec-st .pill { display: inline-flex; align-items: center; gap: 5px; }
.share-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.share { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.share input.mono-in { flex: 1; min-width: 200px; font: 400 13px var(--mono); }
.sec-row { grid-template-columns: 120px minmax(0, 1fr) auto; }

/* =========================================================== modales, menus */
.modal { padding: 16px; align-items: start; overflow-y: auto; }
.m-card { margin: auto; width: min(480px, 100%); padding: 0; }
.m-card.wide { width: min(640px, 100%); }
.m-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.m-head h2 { font-size: 18px; margin: 0; }
.m-sub { margin: 4px 0 0 !important; font-size: 13px; }
.m-body { padding: 14px 22px 22px; }
.m-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 20px; }
.m-text { margin: 0 !important; color: var(--muted); line-height: 1.55; }
.m-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; align-items: center; flex-wrap: wrap; }
.m-actions.left { justify-content: flex-start; }
.fgroup { margin-bottom: 14px; min-width: 0; }
.grid2.tight { gap: 12px; }
.inline-new { padding: 14px; margin-bottom: 14px; background: var(--bg); border: 1px dashed var(--line-2); border-radius: 8px; }
.inline-new label.lbl { margin-bottom: 8px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px var(--swatch-ring); transition: transform .12s var(--ease); }
.sw:hover { transform: scale(1.1); }
.sw.on { border-color: var(--text); }

.menu { position: fixed; z-index: 90; min-width: 210px; padding: 5px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-pop); animation: pop .12s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; background: none; border: 0; border-radius: 6px; font-size: 13px; text-align: left; cursor: pointer; text-decoration: none; color: var(--text); }
.menu-item .ic { color: var(--muted); }
.menu-item span { flex: 1; white-space: nowrap; }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-3); outline: none; }
.menu-item.on { color: var(--accent); }
.menu-item.danger, .menu-item.danger .ic { color: var(--accent); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* =========================================================== réglages */
.set-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--top-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.set-nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 13.5px; transition: all .12s var(--ease); }
.set-nav a:hover { background: var(--bg-hover); color: var(--text); }
.set-nav a.on { background: var(--bg-2); color: var(--text); }
.set-panel { min-width: 0; max-width: 760px; }
.set-head { margin-bottom: 20px; }
.set-head h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -.01em; }
.set-head p { margin: 0; font-size: 13.5px; }
.card-form { padding: 20px; background: var(--bg-1); border: 1px solid var(--line); border-radius: 12px; }
.who-line { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.who-line b { font-size: 15px; }
.inline-form-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.inline-form-row .field { flex: 1 1 200px; width: auto; }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.mb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.mb-main b { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.mb-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-sel { min-width: 130px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 4px 0 14px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.note .ic { margin-top: 2px; color: var(--muted); }
.note code, .m-text code { font: 500 11.5px var(--mono); color: var(--text); background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
.note.ok { border-color: var(--ok-line); background: var(--ok-soft); color: var(--text); }
.note.ok .ic { color: var(--ok); }
.token-new { padding: 16px; margin-bottom: 20px; background: var(--bg-1); border: 1px solid var(--ok-line); border-radius: 12px; }
.roles-help { margin-top: 18px; line-height: 1.7; }
.appearance { margin-top: 20px; }
.ap-row { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; }
.ap-row b { font-size: 14px; }
.ap-row .muted { margin-top: 2px; max-width: 360px; }
.codebox { margin-bottom: 0; }

/* =========================================================== accès (connexion / installation / invitation) */
.auth { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; background:
  radial-gradient(600px 300px at 50% -80px, var(--accent-glow), transparent 70%),
  repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 64px); mask-image: linear-gradient(#000 0, transparent 75%); -webkit-mask-image: linear-gradient(#000 0, transparent 75%); }
.auth-wrap { position: relative; width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.auth-card { width: 100%; padding: 28px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-modal); }
.auth-wrap:has(.auth-card.wide) { width: min(560px, 100%); }
.auth-card h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; font-weight: 600; }
.auth-lead { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.auth-err { min-height: 20px; margin-top: 10px; }
.auth-alt { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.auth-foot { margin: 0; font: 400 11.5px var(--mono); color: var(--dim); letter-spacing: .04em; text-align: center; }
.pw-wrap { position: relative; }
.pw-wrap .field { padding-right: 42px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { color: var(--text); background: var(--bg-3); }

/* =========================================================== responsive */
@media (max-width: 1180px) {
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .thead, .trow { grid-template-columns: minmax(200px, 2.4fr) minmax(100px, 1fr) 140px 120px 90px; }
  .thead .tc-ver, .trow .tc-ver, .thead .tc-open, .trow .tc-open { display: none; }
}
@media (max-width: 899px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .24s var(--ease); box-shadow: none; visibility: visible !important; border-right: 1px solid var(--line); }
  body.side-open .sidebar { transform: none; box-shadow: var(--shadow-drawer); }
  .sb-backdrop { position: fixed; inset: 0; z-index: 25; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
  body.side-open .sb-backdrop { opacity: 1; pointer-events: auto; }
  body.side-open { overflow: hidden; }
  .app-top { padding: 0 12px 0 6px; gap: 6px; }
  .brand-top { display: inline-flex; }
  .search { flex: 1 1 auto; }
  .search kbd { display: none; }
  .new-lbl { display: none; }
  .new-btn { min-width: 40px; padding: 0 10px; }
  .page { padding: 20px 16px 80px; }
  .vhero { grid-template-columns: 1fr; gap: 16px; padding: 12px; }
  .dash-cols { grid-template-columns: 1fr; }
  .set-layout { grid-template-columns: 1fr; gap: 18px; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
  .set-nav a { white-space: nowrap; }
}
@media (max-width: 560px) {
  .brand-top .brand-txt { display: none; }
  .brand-top { padding: 0 8px; }
}
@media (max-width: 640px) {
  .pgrid { grid-template-columns: 1fr; gap: 14px; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .counter { padding: 12px 14px; }
  .c-num { font-size: 26px; }
  .pg-head h1, .ch-main h1 { font-size: 22px; }
  .title-input { font-size: 22px; }
  .thead { display: none; }
  .trow { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 14px; }
  .trow .tc-name { grid-column: 1 / -1; }
  .trow .tc-client, .trow .tc-act { display: none; }
  .trow .tc-due { text-align: right; }
  .toolbar .tb-left, .toolbar .tb-right { width: 100%; }
  .toolbar .field.sm { flex: 1 1 130px; min-width: 0; font-size: 16px; min-height: 40px; }
  .tb-right .seg-icons { margin-left: auto; }
  .ph-actions { width: 100%; }
  .ph-ctl .ctl { flex: 1 1 100%; justify-content: space-between; }
  .ph-ctl .ctl .field { flex: 1; max-width: 70%; font-size: 16px; min-height: 40px; }
  .vcard { flex-basis: 200px; }
  .vc-more { opacity: 1; }
  .vh-actions .btn { flex: 1 1 auto; }
  .upload-sec .drop { flex-direction: column; text-align: center; }
  .sec-row { grid-template-columns: 1fr; }
  .sh-badges { display: none; }
  .share-head .muted { display: none; }
  .member { flex-wrap: wrap; }
  .role-sel { min-width: 0; flex: 1 1 120px; }
  .auth-card { padding: 22px 18px; }
  .m-body { padding: 12px 18px 18px; }
  .m-head { padding: 18px 18px 4px; }
  .inline-form-row .btn { flex: 1 1 100%; }
  .act { grid-template-columns: 8px minmax(0, 1fr); }
  .act .when { grid-column: 2; }
  .mrow .poster { width: 78px; }
  .field.sm, select.field.sm { font-size: 16px; }
  .client-head { gap: 14px; }
  .ch-actions { width: 100%; }
  .ch-actions .btn { flex: 1 1 auto; }
}
@media (hover: none) { .vc-more { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sk-b, .poster.pending .poster-ph, .drop.flash { animation: none !important; }
}
