/* ==========================================================================
   Espace membres : connexion, inscription, compte, panel d'administration.
   S'appuie sur les variables de style.css.
   ========================================================================== */

/* --- Utilitaires --------------------------------------------------------- */
.mono { font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace; font-size: .86em; letter-spacing: 0; }
.muted { color: var(--text-3); font-weight: 400; }
.nowrap { white-space: nowrap; }
.ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ok { color: #4ade80; }
.warn { color: var(--warn); }
.ok .icon, .warn .icon { width: 14px; height: 14px; vertical-align: -2px; }
.tone--good { color: var(--accent); }
.tone--warn { color: var(--warn); }
.tone--bad { color: var(--bad); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
code, .code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; }
code { padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .06); }
.code { display: block; margin: 0; padding: 14px 16px; border-radius: var(--r); background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); line-height: 1.7; overflow-x: auto; white-space: pre; }

.btn--block { width: 100%; }
.btn--danger { background: var(--bad); color: #fff; box-shadow: 0 8px 24px -12px rgba(244, 63, 94, .8); }
.btn--danger:hover { background: #fb7185; }
.btn:disabled, .btn.is-busy { opacity: .6; cursor: progress; }

/* --- Formulaires --------------------------------------------------------- */
.form { display: grid; gap: 16px; min-width: 0; }
fieldset.form { margin: 0; padding: 0; border: 0; }
fieldset.form:disabled { opacity: .75; }
.form--inline { display: flex; flex-wrap: wrap; gap: 10px; }
.form--inline .input { flex: 1 1 220px; width: auto; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { color: var(--text-2); font-size: .84rem; font-weight: 600; }
legend.field__label { margin-bottom: 4px; padding: 0; }
.field__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.field__link { color: var(--text-3); font-size: .8rem; font-weight: 500; transition: color .2s; }
.field__link:hover { color: var(--accent); }
.field__hint { color: var(--text-3); font-size: .78rem; line-height: 1.45; }

.input {
    width: 100%; height: 46px; padding: 0 14px;
    border: 0; border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    box-shadow: inset 0 0 0 1px var(--line-2);
    color: var(--text); font-size: .95rem;
    transition: box-shadow .2s, background .2s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { background: rgba(255, 255, 255, .06); }
.input:focus { outline: none; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .7), 0 0 0 4px rgba(var(--accent-rgb), .14); }
.input:disabled, .input[readonly] { color: var(--text-2); }
.input.is-invalid, .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .8); }
.input.is-valid { box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .6); }
.input--sm { height: 38px; font-size: .86rem; }
.input--area { height: auto; min-height: 84px; padding: 11px 14px; line-height: 1.5; resize: vertical; font-family: inherit; }
.input--code { font: 600 1.3rem/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3em; text-align: center; }
.input--select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.input--select option { background: var(--surface); color: var(--text); }
textarea.input { font: inherit; }

.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw__toggle { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--text-3); cursor: pointer; transform: translateY(-50%); transition: color .2s, background .2s; }
.pw__toggle:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.pw__toggle .icon { width: 18px; height: 18px; }

.check, .radio { position: relative; display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: .88rem; line-height: 1.4; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--line-2); background: rgba(255, 255, 255, .03); transition: background .2s, box-shadow .2s; }
.check__box .icon { width: 14px; height: 14px; color: var(--on-accent); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s var(--ease); }
.check input:checked + .check__box { background: var(--accent); box-shadow: none; }
.check input:checked + .check__box .icon { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio { padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, box-shadow .2s; }
.radio:hover { background: rgba(255, 255, 255, .03); }
.radio input { accent-color: var(--accent); margin: 2px 0 0; width: 16px; height: 16px; flex: none; }
.radio:has(input:checked) { background: rgba(var(--accent-rgb), .07); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); color: var(--text); }
.field .radio + .radio { margin-top: 2px; }

/* Jauge de robustesse du mot de passe */
.meter-pw { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 5px; }
.meter-pw span { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .08); transition: background .25s; }
.meter-pw em { margin-left: 8px; color: var(--text-3); font-size: .76rem; font-style: normal; white-space: nowrap; }
.meter-pw[data-level="1"] span:nth-child(-n+1) { background: var(--bad); }
.meter-pw[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.meter-pw[data-level="3"] span:nth-child(-n+3) { background: #a3e635; }
.meter-pw[data-level="4"] span { background: #4ade80; }
.meter-pw[data-level="1"] em { color: var(--bad); }
.meter-pw[data-level="2"] em { color: var(--warn); }
.meter-pw[data-level="4"] em { color: #4ade80; }

/* --- Alertes & toasts ---------------------------------------------------- */
.alerts { display: grid; gap: 10px; margin-bottom: 18px; }
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border-radius: var(--r); background: rgba(var(--panel2-rgb), .7); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font-size: .88rem; line-height: 1.45; }
.alert > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.alert__body { flex: 1; min-width: 0; }
.alert__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.alert__label { display: block; margin-bottom: 8px; color: var(--text-2); font-size: .8rem; font-weight: 600; }
.alert--success { background: rgba(34, 197, 94, .08); box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .28); }
.alert--success > .icon { color: #4ade80; }
.alert--error { background: rgba(244, 63, 94, .08); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .32); }
.alert--error > .icon { color: var(--bad); }
.alert--warn { background: rgba(245, 165, 36, .08); box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .3); }
.alert--warn > .icon { color: var(--warn); }
.alert--link { background: rgba(var(--accent-rgb), .08); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.alert--inline { display: inline-flex; margin-top: 10px; padding: 8px 12px; }
.alert__close { flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -6px -4px 0; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; }
.alert__close:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.alert__close .icon { width: 16px; height: 16px; }

.toasts { position: fixed; top: calc(var(--nav-h) + 14px); right: 16px; z-index: 80; display: grid; gap: 10px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toasts .alert { pointer-events: auto; background-color: rgba(var(--panel-rgb), .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 40px -16px rgba(0, 0, 0, .9); animation: toast-in .35s var(--ease) both; }
.toasts .alert.is-leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(16px); } }

.copyline { display: flex; gap: 8px; min-width: 0; }
.copyline__input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: 500 .82rem ui-monospace, "Cascadia Mono", Consolas, monospace; }
.copyline__input:focus { outline: none; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .6); }

/* --- Avatars, rôles, badges --------------------------------------------- */
.avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #0f2037); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); color: var(--text); font: 700 .86rem/1 var(--display); text-transform: uppercase; }
.avatar--sm { width: 28px; height: 28px; font-size: .76rem; }
.avatar--lg { width: 42px; height: 42px; font-size: 1.05rem; }
.avatar--xl { width: 68px; height: 68px; font-size: 1.7rem; }
.avatar--uploader { background: linear-gradient(135deg, #14532d, #0b2e1a); }
.avatar--moderator { background: linear-gradient(135deg, #713f12, #3b2207); }
.avatar--admin { background: linear-gradient(135deg, var(--accent-2), #075985); color: #fff; }

.role { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--text-2); font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; white-space: nowrap; }
.role--uploader { background: rgba(74, 222, 128, .12); color: #86efac; }
.role--moderator { background: rgba(245, 165, 36, .14); color: #fcd34d; }
.role--admin { background: rgba(var(--accent-rgb), .16); color: #7dd3fc; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--text-2); font-size: .72rem; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.badge .icon { width: 12px; height: 12px; }
.badge--active { background: rgba(74, 222, 128, .12); color: #86efac; }
.badge--utilisee { background: rgba(var(--accent-rgb), .12); color: #7dd3fc; }
.badge--expiree { background: rgba(245, 165, 36, .13); color: #fcd34d; }
.badge--revoquee { background: rgba(244, 63, 94, .13); color: #fda4af; }

/* --- Navigation : menu du compte ---------------------------------------- */
.nav__auth { display: flex; align-items: center; gap: 8px; flex: none; }
.nav__login { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px; color: var(--text-2); font-size: .88rem; font-weight: 600; transition: color .2s, background .2s; }
.nav__login:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav__login .icon { width: 17px; height: 17px; }

.usermenu { position: relative; flex: none; }
.usermenu__btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 4px 12px 4px 4px; border-radius: 999px; cursor: pointer; list-style: none; transition: background .2s; }
.usermenu__btn::-webkit-details-marker { display: none; }
.usermenu__btn:hover, .usermenu[open] .usermenu__btn { background: rgba(255, 255, 255, .07); }
.usermenu__name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; }
.usermenu__panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; width: 248px; padding: 6px; border-radius: 14px; background: rgba(var(--panel-rgb), .97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 48px -20px rgba(0, 0, 0, .95); animation: toast-in .2s var(--ease); }
.usermenu__head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); }
.usermenu__head > div { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.usermenu__head strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text-2); font-size: .88rem; font-weight: 500; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.usermenu__item:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.usermenu__item .icon { width: 17px; height: 17px; }
.usermenu__item--admin { color: #7dd3fc; }
.usermenu__item--out { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; }
.usermenu__item--out:hover { color: #fda4af; }

/* --- Pages connexion / inscription -------------------------------------- */
.is-auth main { min-height: 100vh; }
.auth { display: grid; place-items: center; min-height: 100vh; padding: calc(var(--nav-h) + 32px) var(--gutter) 48px; background: radial-gradient(50% 45% at 50% 0%, rgba(var(--accent-rgb), .1), transparent 70%); }
.auth__card { width: 100%; max-width: 420px; padding: 32px; border-radius: 20px; background: rgba(var(--panel-rgb), .7); box-shadow: inset 0 0 0 1px var(--line-2), 0 40px 80px -40px rgba(0, 0, 0, .95); }
.auth__card--wide { max-width: 560px; }
.auth__head { display: grid; justify-items: center; gap: 8px; margin-bottom: 24px; text-align: center; }
.auth__mark { width: 46px; height: 46px; margin-bottom: 6px; border-radius: 13px; }
.auth__mark .icon { width: 20px; height: 20px; margin: 0; }
.auth__title { font-size: 1.6rem; font-weight: 700; }
.auth__sub { color: var(--text-3); font-size: .9rem; line-height: 1.5; }
.auth__sub strong { color: var(--text); }
.auth__alt { margin-top: 22px; color: var(--text-3); font-size: .88rem; text-align: center; }
.auth__alt a { color: var(--accent); font-weight: 600; }
.auth__alt a:hover { text-decoration: underline; }
.auth__secure, .auth__note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; color: var(--text-3); font-size: .78rem; text-align: center; }
.auth__secure .icon, .auth__note .icon { width: 14px; height: 14px; color: #4ade80; }
.auth__note { margin: 4px 0 18px; }
.empty--auth { padding: 28px 18px; }
.steps { display: grid; gap: 12px; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: step; }
.steps li { position: relative; padding-left: 40px; color: var(--text-2); font-size: .9rem; line-height: 1.5; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(var(--accent-rgb), .14); color: var(--accent); font-size: .8rem; font-weight: 700; }
.steps strong { color: var(--text); }

/* --- Compte membre ------------------------------------------------------- */
.acct { padding-top: calc(var(--nav-h) + 32px); padding-bottom: 72px; }
.acct--narrow { max-width: 820px; }
.acct__head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.acct__who { flex: 1; min-width: 0; }
.acct__name { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.acct__meta { margin-top: 6px; color: var(--text-3); font-size: .88rem; }
.acct__meta a.warn:hover { text-decoration: underline; }
.acct__title { margin: 4px 0 18px; font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700; }
.acct__lead { margin-bottom: 20px; color: var(--text-2); line-height: 1.6; }
.acct > .btn { margin-top: 4px; }

.tabsnav { display: flex; gap: 4px; margin-bottom: 22px; padding-bottom: 1px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabsnav::-webkit-scrollbar { display: none; }
.tabsnav__item { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--text-3); font-size: .9rem; font-weight: 600; white-space: nowrap; transition: color .2s; }
.tabsnav__item .icon { width: 17px; height: 17px; }
.tabsnav__item:hover { color: var(--text); }
.tabsnav__item.is-active { color: var(--text); }
.tabsnav__item.is-active::after { content: ""; position: absolute; inset: auto 10px -2px; height: 2px; border-radius: 2px; background: var(--accent); }

.kpis-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 18px; border-radius: var(--r-lg); background: rgba(var(--panel-rgb), .6); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.kpis-row .kpi + .kpi { box-shadow: inset 1px 0 0 var(--line); }
.kpi__label { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__label .icon { width: 14px; height: 14px; }
.kpi__value { margin-top: 8px; font: 700 1.5rem/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__value small { font-size: .6em; color: var(--text-3); font-weight: 600; }
.kpi__value--sm { font-size: 1.15rem; }
.kpi--link { transition: background .2s; }
.kpi--link:hover { background: rgba(255, 255, 255, .03); }
.kpis + .adm-grid, .kpis + .panel, .kpis + .alert, .kpis + .toolbar { margin-top: 18px; }

.cols, .adm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.cols > .panel, .adm-grid > .panel { margin-bottom: 0; }

.panel { display: block; min-width: 0; margin-bottom: 18px; padding: 22px; border-radius: var(--r-lg); background: rgba(var(--panel-rgb), .55); box-shadow: inset 0 0 0 1px var(--line); }
.panel--flush { padding: 0; overflow: hidden; }
.panel__title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 1.05rem; font-weight: 700; }
.panel__title .icon { width: 18px; height: 18px; color: var(--text-3); }
.panel__subtitle { margin: 18px 0 10px; color: var(--text-2); font-size: .88rem; font-weight: 600; }
.panel__hint { color: var(--text-3); font-size: .84rem; line-height: 1.5; }
.panel__hint + .form, .panel__hint + .btn, .panel__hint + .tbl-wrap, .panel__hint + .panel__hint { margin-top: 12px; }
.panel__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-bottom: 14px; }
.panel__row .panel__title { margin-bottom: 4px; }
.panel--danger { box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .25); }
.panel--danger > summary { margin: 0; color: #fda4af; cursor: pointer; list-style: none; }
.panel--danger > summary::-webkit-details-marker { display: none; }
.panel--danger > summary .icon { color: inherit; }
.panel--danger[open] > summary { margin-bottom: 10px; }
.panel--danger .form { margin-top: 14px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: .82rem; font-weight: 600; transition: color .2s; }
.link-more .icon { width: 14px; height: 14px; }
.link-more:hover { color: var(--accent); }

.facts-list { display: grid; gap: 0; }
.facts-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.facts-list > div:last-child { border-bottom: 0; }
.facts-list dt { color: var(--text-3); }
.facts-list dd { min-width: 0; color: var(--text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.facts-list + .panel__hint { margin-top: 10px; }

.status { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9rem; font-weight: 600; }
.status .icon { width: 18px; height: 18px; }
.status--ok { color: #4ade80; }
.status--warn { color: var(--warn); }
.sub { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.sub > summary { color: var(--text-2); font-size: .88rem; font-weight: 600; cursor: pointer; }
.sub > summary:hover { color: var(--text); }
.sub[open] > summary { margin-bottom: 14px; }

.devices { display: grid; gap: 8px; }
.device { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r); background: rgba(255, 255, 255, .02); box-shadow: inset 0 0 0 1px var(--line); }
.device.is-current { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); background: rgba(var(--accent-rgb), .04); }
.device__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: rgba(255, 255, 255, .05); color: var(--text-2); }
.device__icon .icon { width: 20px; height: 20px; }
.device__info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.device__info strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .92rem; }
.device__info span { color: var(--text-3); font-size: .8rem; }
.devices--compact .device { padding: 10px; }
.devices--compact .device__icon { width: 34px; height: 34px; }
.devices--compact .device__info { display: block; }

.crumbs + .acct__title { margin-top: 0; }
.setup { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.setup__step { display: flex; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: rgba(var(--panel-rgb), .55); box-shadow: inset 0 0 0 1px var(--line); }
.setup__step h2 { margin-bottom: 6px; font-size: 1.02rem; }
.setup__step p { color: var(--text-3); font-size: .88rem; line-height: 1.5; }
.setup__num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(var(--accent-rgb), .15); color: var(--accent); font-weight: 700; }
.setup__body { flex: 1; min-width: 0; }
.setup__body .form { margin-top: 10px; }
.qr-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; margin-top: 12px; }
.qr { flex: none; display: grid; place-items: center; width: 196px; height: 196px; padding: 12px; border-radius: 14px; background: #fff; }
.qr img, .qr canvas { display: block; width: 172px !important; height: 172px !important; image-rendering: pixelated; }
.qr.is-empty { background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-3); font-size: .8rem; text-align: center; }
.qr-alt { flex: 1 1 260px; display: grid; gap: 10px; min-width: 0; }
.qr-alt .copyline__input { letter-spacing: .08em; }
.qr-alt a { color: var(--accent); }

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; padding: 0; list-style: none; }
.codes li { padding: 10px 12px; border-radius: 9px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line); font-size: 1rem; letter-spacing: .08em; text-align: center; }

/* --- Tableaux ------------------------------------------------------------ */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { padding: 11px 14px; border-bottom: 1px solid var(--line-2); color: var(--text-3); font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl a:not(.btn) { color: var(--text); font-weight: 500; }
.tbl a:not(.btn):hover { color: var(--accent); }
.tbl--hover tbody tr { transition: background .15s; }
.tbl--hover tbody tr:hover { background: rgba(255, 255, 255, .025); }
.tbl--compact td { padding: 8px 6px; }
.panel > .tbl-wrap, .panel > .panel__row + .tbl-wrap { margin-inline: -8px; width: calc(100% + 16px); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; font-weight: 600; }
.actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.actions-cell form { display: inline; }
.file { min-width: 220px; max-width: 520px; }
.file strong, .file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file strong { color: var(--text); font-weight: 500; }
.file span { margin-top: 2px; color: var(--text-3); font-size: .76rem; }
.cell-note { display: block; margin-top: 2px; color: var(--text-3); font-size: .76rem; }
.cell-details { max-width: 340px; color: var(--text-3); font-size: .8rem; overflow-wrap: anywhere; }

.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person__id { display: grid; min-width: 0; }
.person__id strong { color: var(--text); font-weight: 600; }
.person__id span { overflow: hidden; color: var(--text-3); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.person:hover .person__id strong { color: var(--accent); }
.people { display: grid; gap: 2px; }
.people .person { padding: 8px; margin-inline: -8px; border-radius: 10px; transition: background .15s; }
.people .person:hover { background: rgba(255, 255, 255, .04); }
.person__name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; }
.person__meta { color: var(--text-3); font-size: .78rem; white-space: nowrap; }

.feed { display: grid; }
.feed__item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.feed__item:last-child { border-bottom: 0; }
.feed__text { flex: 1; min-width: 0; color: var(--text-2); }
.feed__text strong { color: var(--text); font-weight: 600; }
.feed__time { flex: none; color: var(--text-3); font-size: .76rem; white-space: nowrap; }
.feed__dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.feed__dot--auth { background: #4ade80; }
.feed__dot--account { background: var(--accent); }
.feed__dot--admin { background: var(--warn); }

/* --- Panel d'administration --------------------------------------------- */
.adm { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 32px; padding-top: calc(var(--nav-h) + 28px); padding-bottom: 72px; }
.adm__side { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; display: grid; gap: 14px; }
.adm__brand { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--text-3); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.adm__brand .icon { width: 15px; height: 15px; color: var(--accent); }
.adm__nav { display: grid; gap: 2px; }
.adm__link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-size: .9rem; font-weight: 500; transition: background .15s, color .15s; }
.adm__link .icon { width: 18px; height: 18px; color: var(--text-3); transition: color .15s; }
.adm__link:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.adm__link.is-active { background: rgba(var(--accent-rgb), .1); color: var(--text); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .2); }
.adm__link.is-active .icon { color: var(--accent); }
.adm__back { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--text-3); font-size: .84rem; font-weight: 500; }
.adm__back .icon { width: 15px; height: 15px; }
.adm__back:hover { color: var(--text); }
.adm__main { min-width: 0; }
.adm__head { margin-bottom: 22px; }
.adm__head .crumbs { margin-bottom: 10px; }
.adm__title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; overflow-wrap: anywhere; }
.adm__sub { margin-top: 6px; color: var(--text-3); font-size: .9rem; }
.adm-count { margin-top: 12px; color: var(--text-3); font-size: .8rem; text-align: right; }
.adm__main .pager { margin-top: 20px; padding-top: 16px; }
.adm__main .pager + .adm-count { margin-top: 8px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar__search { position: relative; flex: 1 1 260px; min-width: 0; }
.toolbar__search .icon { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.toolbar__search .input { padding-left: 40px; }
.toolbar .input { height: 40px; font-size: .88rem; }
.toolbar .input--select { width: auto; min-width: 150px; }
.toolbar .btn { height: 40px; }

.segmented { display: inline-flex; gap: 2px; margin-bottom: 16px; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line-2); max-width: 100%; overflow-x: auto; }
.segmented__item { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 8px; color: var(--text-2); font-size: .85rem; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.segmented__item .icon { width: 16px; height: 16px; }
.segmented__item:hover { color: var(--text); }
.segmented__item.is-active { background: rgba(255, 255, 255, .09); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }

.bars { margin: 0; }
.bars__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; color: var(--text-2); font-size: .88rem; font-weight: 600; }
.bars__head strong { color: var(--text); font: 700 1.35rem/1 var(--display); }
.bars__plot { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars__col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.bars__bar { width: 100%; min-height: 2px; border-radius: 4px 4px 1px 1px; background: linear-gradient(to top, rgba(var(--accent-rgb), .55), var(--accent)); transition: opacity .15s; }
.bars__bar.is-zero { background: rgba(255, 255, 255, .08); }
.bars__col:hover .bars__bar { opacity: .75; }
.bars__axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--text-3); font-size: .74rem; }

.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head__info { flex: 1; min-width: 0; }
.profile-head__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.profile-head__meta { color: var(--text-3); font-size: .86rem; line-height: 1.6; }
.profile-head__meta a { color: var(--text); font-weight: 600; }
.profile-head__meta a:hover { color: var(--accent); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.action-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border-radius: var(--r); background: rgba(255, 255, 255, .02); box-shadow: inset 0 0 0 1px var(--line); }
.panel.action-card { padding: 22px; margin-bottom: 0; }
.action-card strong { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.action-card strong .icon { width: 17px; height: 17px; color: var(--text-3); }
.action-card > span { flex: 1; color: var(--text-3); font-size: .8rem; line-height: 1.5; }
.action-card .btn { margin-top: 4px; }
.action-card--danger { box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .25); }
.action-card--danger strong .icon { color: var(--bad); }
.action-card .input { margin-top: 2px; }

.toplist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: top; }
.toplist__item { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(80px, 180px) 34px; align-items: center; gap: 12px; font-size: .86rem; counter-increment: top; }
.toplist__item::before { content: counter(top); color: var(--text-3); font-weight: 700; text-align: right; }
.toplist__name { color: var(--text-2); }
.toplist__bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.toplist__bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.toplist__n { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Accueil : invité ---------------------------------------------------- */
.box__guest { display: grid; justify-items: center; gap: 10px; text-align: center; }
.box__guest .actions { justify-content: center; }

/* Les grilles de formulaire suivent la largeur de leur panneau, pas celle de l'écran. */
.panel, .setup__body { container-type: inline-size; }
@container (max-width: 520px) {
    .form__grid, .form__grid--4 { grid-template-columns: minmax(0, 1fr); }
    .form__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 300px) {
    .form__grid--3 { grid-template-columns: minmax(0, 1fr); }
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1180px) {
    .kpis-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kpis-row .kpi:nth-child(4) { box-shadow: none; }
    .kpis-row .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
    .form__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .adm { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .adm__side { position: static; display: block; }
    .adm__brand, .adm__back { display: none; }
    .adm__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
    .adm__nav::-webkit-scrollbar { display: none; }
    .adm__link { flex: none; padding: 8px 12px; box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
    .adm__head .crumbs { display: none; }
}
@media (max-width: 860px) {
    .cols, .adm-grid { grid-template-columns: minmax(0, 1fr); }
    .form__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .usermenu__name { display: none; }
    .usermenu__btn { padding: 4px; }
    .nav__login span { display: none; }
    .nav__login { padding: 0 9px; }
    .nav__signup { padding: 0 12px; }
    .acct { padding-top: calc(var(--nav-h) + 20px); }
    .acct__head { flex-wrap: wrap; gap: 14px; }
    .acct__head .avatar--xl { width: 56px; height: 56px; font-size: 1.4rem; }
    .acct__admin { width: 100%; }
    .adm { padding-top: calc(var(--nav-h) + 18px); }
    .kpis-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpis-row .kpi { box-shadow: none !important; }
    .kpis-row .kpi:nth-child(even) { box-shadow: inset 1px 0 0 var(--line) !important; }
    .kpis-row .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
    .kpi__value { font-size: 1.25rem; }
    .panel { padding: 18px 16px; }
    .panel--flush { padding: 0; }
    .form__grid, .form__grid--3, .form__grid--4 { grid-template-columns: minmax(0, 1fr); }
    .auth { padding: calc(var(--nav-h) + 16px) 12px 32px; align-items: start; }
    .auth__card { padding: 24px 18px; border-radius: 16px; }
    .toasts { right: 12px; left: 12px; width: auto; top: calc(var(--nav-h) + 8px); }
    .toolbar .input--select { flex: 1 1 140px; }
    .toolbar .btn { flex: 1; }
    .profile-head { align-items: flex-start; }
    .profile-head .avatar--xl { width: 52px; height: 52px; font-size: 1.3rem; }
    .device { flex-wrap: wrap; }
    .device form { width: 100%; }
    .device form .btn { width: 100%; }
    .setup__step { padding: 16px; gap: 12px; }
    .qr-row { justify-content: center; }
    .codes { grid-template-columns: minmax(0, 1fr); }
    .toplist__item { grid-template-columns: 18px minmax(0, 1fr) 30px; }
    .toplist__bar { display: none; }
    .copyline { flex-wrap: wrap; }
    .copyline .btn { flex: 1; }
    .facts-list > div { flex-direction: column; gap: 2px; }
    .facts-list dd { text-align: left; }
    .adm-count { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    .toasts .alert, .usermenu__panel { animation: none; }
}
