/* =====================================================================
   Extranet v2 — Administration (onglets serveur, formulaires, accès)
   ===================================================================== */

/* Barre d'onglets + qui a accès */
.adm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.adm-tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 16px; background: var(--duo-surface); border: 1px solid var(--duo-border); box-shadow: var(--duo-shadow-sm); }
.adm-tab { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 12px; font-size: .84rem; font-weight: 650; color: var(--duo-muted) !important; transition: background .2s, color .2s; }
.adm-tab svg { width: 16px; height: 16px; }
.adm-tab:hover { background: var(--duo-plum-50); color: var(--duo-heading) !important; }
.adm-tab.is-active { background: var(--duo-plum-900); color: #fff !important; box-shadow: 0 8px 18px -10px rgba(34,21,48,.8); }
html[data-theme="dark"] .adm-tab.is-active { background: #4a3163; }
.adm-who { margin-left: auto; position: relative; }
.adm-who summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: 999px; cursor: pointer;
  font-size: .76rem; font-weight: 600; color: var(--duo-muted); background: var(--duo-surface); border: 1px solid var(--duo-border); }
.adm-who summary::-webkit-details-marker { display: none; }
.adm-who__faces { display: inline-flex; }
.adm-who__faces img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--duo-surface); margin-left: -8px; }
.adm-who__faces img:first-child { margin-left: 0; }
.adm-who__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; max-height: 280px; overflow: auto; padding: 10px; border-radius: 14px;
  display: flex; flex-wrap: wrap; gap: 6px; background: var(--duo-surface); border: 1px solid var(--duo-border-strong); box-shadow: var(--duo-shadow-lg); }
.adm-who__list span { padding: 3px 9px; border-radius: 999px; font-size: .74rem; background: var(--duo-plum-50); }
.adm-panel { animation: duoFadeUp .45s var(--duo-ease) both; }

/* Mouvements à venir */
.adm-moves { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-move { padding: 0; overflow: hidden; }
.adm-move summary, .adm-move__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.adm-move summary::-webkit-details-marker { display: none; }
.adm-move summary strong, .adm-move__head strong { flex: 1; font-size: .9rem; }
.adm-move summary b, .adm-move__head b { min-width: 26px; height: 24px; display: grid; place-items: center; border-radius: 999px; font-size: .74rem; background: var(--duo-plum-50); color: var(--duo-link); }
.adm-move ul { list-style: none; margin: 0; padding: 0 14px 12px; max-height: 240px; overflow: auto; }
.adm-move li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--duo-border); font-size: .84rem; }
.adm-move li small { color: var(--duo-muted); }
.adm-move li em { font-style: normal; font-weight: 700; font-size: .78rem; white-space: nowrap; color: var(--duo-link); }
.adm-empty { color: var(--duo-muted); justify-content: center !important; }

/* Formulaires en étapes */
.adm-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .adm-form { grid-template-columns: 1fr; } }
.adm-form__main { display: flex; flex-direction: column; gap: 12px; }
.adm-fs { margin: 0; padding: 14px 18px 16px; border: 1px solid var(--duo-border); min-width: 0; }
.adm-fs legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0; font: 800 .96rem var(--duo-font-display); color: var(--duo-heading); }
.adm-fs legend span { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: .8rem; color: #fff; background: var(--duo-grad-brand); }
.adm-grid { clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.adm-f { display: flex; flex-direction: column; gap: 5px; font-size: .76rem; font-weight: 700; color: var(--duo-label); min-width: 0; }
.adm-f > span { display: flex; justify-content: space-between; gap: 8px; }
.adm-f small { font-weight: 500; color: var(--duo-muted); }
.adm-f em { font-style: normal; font-weight: 700; }
.adm-f em.is-ok { color: var(--duo-green); }
.adm-f em.is-bad { color: var(--duo-danger); }
.adm-f--wide { grid-column: span 2; }
@media (max-width: 700px) { .adm-f--wide { grid-column: auto; } }
body.duo-v2 .duo-content .adm-f :is(input, select) { width: 100%; height: 44px; min-height: 44px; }
.adm-input-btn { display: flex; gap: 6px; }
.adm-input-btn input { flex: 1; }
.adm-input-btn button { width: 44px; border-radius: 12px; border: 1px solid var(--duo-border-strong); background: var(--duo-surface); color: var(--duo-link); cursor: pointer; display: grid; place-items: center; }
.adm-input-btn button svg { width: 18px; height: 18px; }
.adm-hint { margin: 10px 0 0; font-size: .76rem; color: var(--duo-muted); }
.adm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adm-inline input[type=date] { width: auto !important; }

/* Aperçu latéral */
.adm-form__side { position: sticky; top: calc(var(--duo-topbar-h) + 24px); }
.adm-preview { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px; }
.adm-preview__label { align-self: stretch; text-align: left; font-size: .66rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--duo-muted); margin-bottom: 6px; }
.adm-preview__avatar { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; font: 800 1.8rem var(--duo-font-display); color: #fff; background: var(--duo-grad-brand); box-shadow: 0 14px 30px -14px rgba(235,107,36,.8); }
.adm-preview__photo { width: 84px; height: 84px; border-radius: 26px; object-fit: cover; box-shadow: var(--duo-shadow); }
.adm-preview strong { font: 800 1.1rem var(--duo-font-display); color: var(--duo-heading); margin-top: 6px; }
.adm-preview > span { font-size: .8rem; color: var(--duo-muted); }
.adm-preview__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.adm-preview__chips em { font-style: normal; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--duo-plum-50); color: var(--duo-link); }
.adm-preview__todo { list-style: none; margin: 10px 0 12px; padding: 12px; width: 100%; text-align: left; border-radius: 12px; background: var(--duo-surface-2); border: 1px solid var(--duo-border); font-size: .78rem; display: flex; flex-direction: column; gap: 5px; color: var(--duo-text); }
.adm-preview .dx-btn { width: 100%; }

/* Liste des collaborateurs */
.adm-list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
body.duo-v2 .duo-content .adm-list-tools select { height: 42px; min-height: 42px; }
.adm-count { font-size: .82rem; color: var(--duo-muted); margin-left: auto; }
.adm-count b { color: var(--duo-heading); font-size: 1rem; }
.adm-table-wrap { overflow-x: auto; padding: 0; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.adm-table th { position: sticky; top: 0; z-index: 1; padding: 11px 12px; text-align: left; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--duo-muted); background: var(--duo-surface-2); border-bottom: 1px solid var(--duo-border); white-space: nowrap; }
.adm-table th[data-sort] { cursor: pointer; }
.adm-table th[data-sort]:hover { color: var(--duo-heading); }
.adm-table th.is-asc::after { content: ' ↑'; } .adm-table th.is-desc::after { content: ' ↓'; }
.adm-table td { padding: 9px 12px; border-bottom: 1px solid var(--duo-border); vertical-align: middle; }
.adm-table td small { color: var(--duo-muted); }
.adm-table tbody tr { cursor: pointer; transition: background .15s; }
.adm-table tbody tr:hover td { background: var(--duo-plum-50); }
.adm-table code { font-size: .78rem; padding: 2px 6px; border-radius: 6px; background: var(--duo-plum-50); color: var(--duo-link); }
.adm-person { display: flex; align-items: center; gap: 10px; }
.adm-person img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.adm-person strong { display: block; }

/* Gestion des accès */
.acc-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .acc-layout { grid-template-columns: 1fr; } }
.acc-people { padding: 10px; position: sticky; top: calc(var(--duo-topbar-h) + 24px); }
.acc-people .com-search { min-width: 0; width: 100%; margin-bottom: 8px; }
.acc-people__list { max-height: calc(100vh - 260px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.acc-people__list a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; color: var(--duo-text) !important; }
.acc-people__list a:hover { background: var(--duo-plum-50); }
.acc-people__list a.is-active { background: var(--duo-plum-900); color: #fff !important; }
html[data-theme="dark"] .acc-people__list a.is-active { background: #4a3163; }
.acc-people__list img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.acc-people__list strong { display: block; font-size: .84rem; }
.acc-people__list small { font-size: .7rem; opacity: .7; }
.acc-people__list b { margin-left: auto; font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: var(--duo-orange); color: #fff; }
.acc-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 12px; }
.acc-head img { width: 54px; height: 54px; border-radius: 16px; object-fit: cover; }
.acc-head h3 { margin: 0; }
.acc-head span { font-size: .8rem; color: var(--duo-muted); }
.acc-head .dx-btn { margin-left: auto; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.acc-rub { padding: 12px 14px; }
.acc-rub__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--duo-border); }
.acc-rub__head strong { font-family: var(--duo-font-display); color: var(--duo-heading); }
.acc-all { font-size: .74rem; color: var(--duo-muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.acc-switch { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.acc-switch input { position: absolute; opacity: 0; pointer-events: none; }
.acc-switch__track { position: relative; flex-shrink: 0; width: 38px; height: 22px; border-radius: 999px; background: var(--duo-plum-100); transition: background .25s; }
.acc-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .3s var(--duo-spring); }
.acc-switch input:checked + .acc-switch__track { background: var(--duo-green); }
.acc-switch input:checked + .acc-switch__track::after { transform: translateX(16px); }
.acc-switch input:disabled + .acc-switch__track { opacity: .55; }
.acc-switch input:focus-visible + .acc-switch__track { outline: 2px solid var(--duo-orange); outline-offset: 2px; }
.acc-switch__txt { display: flex; justify-content: space-between; flex: 1; font-size: .86rem; }
.acc-switch__txt small { color: var(--duo-muted); font-size: .7rem; }
.acc-who { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-bottom: 1px dashed var(--duo-border); }
.acc-who:last-child { border-bottom: 0; }
.acc-who > span:first-child { font-size: .84rem; font-weight: 650; display: flex; justify-content: space-between; }
.acc-who small { font-size: .72rem; padding: 0 7px; border-radius: 999px; background: var(--duo-plum-50); color: var(--duo-link); }
.acc-who__faces { display: flex; flex-wrap: wrap; gap: 3px; }
.acc-who__faces img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; transition: transform .2s var(--duo-spring); }
.acc-who__faces a:hover img { transform: scale(1.2); }
