/* EXDEV AutoGestion V1.6.0 — Étape 5 */

/* États de modules : source et état réel séparés. */
.module-badges { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; margin-left:auto; }
.badge.module-source, .badge.module-state { font-size:10px; letter-spacing:.035em; white-space:nowrap; }
.badge.source-web { color:#7dd3fc; border-color:rgba(56,189,248,.34); background:rgba(14,116,144,.18); }
.badge.source-bot { color:#c4b5fd; border-color:rgba(167,139,250,.34); background:rgba(109,40,217,.18); }
.badge.source-hybrid { color:#a7f3d0; border-color:rgba(52,211,153,.32); background:rgba(5,150,105,.16); }
.badge.source-bridge { color:#fbcfe8; border-color:rgba(244,114,182,.34); background:rgba(190,24,93,.17); }
.badge.state-active { color:#86efac; border-color:rgba(34,197,94,.38); background:rgba(22,163,74,.18); }
.badge.state-disabled { color:#fdba74; border-color:rgba(249,115,22,.40); background:rgba(194,65,12,.18); }
.badge.state-unconfigured { color:#cbd5e1; border-color:rgba(148,163,184,.28); background:rgba(71,85,105,.18); }
.badge.state-incomplete { color:#fde68a; border-color:rgba(234,179,8,.38); background:rgba(161,98,7,.18); }
.badge.state-error { color:#fda4af; border-color:rgba(244,63,94,.42); background:rgba(159,18,57,.20); }
.badge.state-future { color:#d8b4fe; border-color:rgba(168,85,247,.40); background:rgba(107,33,168,.20); }
.plugin-card:has(.state-future) { border-color:rgba(168,85,247,.20); opacity:.82; }
.plugin-card:has(.state-error) { border-color:rgba(244,63,94,.28); }
.plugin-card:has(.state-active) { box-shadow:inset 0 1px 0 rgba(255,255,255,.025); }
.v160-nav-count { margin-left:auto; min-width:20px; height:20px; display:grid; place-items:center; border-radius:999px; background:#f59e0b; color:#16100a; font-size:10px; font-weight:950; }

/* Interrupteurs accessibles : remplace les gros carrés blancs natifs. */
.exdev-switch-card { position:relative; display:grid !important; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; min-height:58px; padding:12px 14px; border:1px solid rgba(96,165,250,.18); border-radius:16px; background:rgba(11,24,42,.58); cursor:pointer; }
.exdev-switch-card.compact { min-height:52px; margin-top:12px; }
.exdev-switch-card input { position:absolute !important; opacity:0 !important; width:1px !important; height:1px !important; pointer-events:none; }
.exdev-switch-track { width:46px; height:26px; border-radius:999px; border:1px solid rgba(148,163,184,.35); background:rgba(71,85,105,.52); position:relative; transition:.18s ease; }
.exdev-switch-track::after { content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#cbd5e1; box-shadow:0 3px 10px rgba(0,0,0,.32); transition:.18s ease; }
.exdev-switch-card input:checked + .exdev-switch-track { background:rgba(6,182,212,.34); border-color:#22d3ee; }
.exdev-switch-card input:checked + .exdev-switch-track::after { transform:translateX(20px); background:#67e8f9; }
.exdev-switch-card input:focus-visible + .exdev-switch-track { outline:3px solid rgba(56,189,248,.30); outline-offset:3px; }
.exdev-switch-card b, .exdev-switch-card small { display:block; }
.exdev-switch-card small { margin-top:4px; color:var(--muted); line-height:1.35; }
.exdev-switch-card.is-disabled { opacity:.58; cursor:not-allowed; }
.admin-config-switch { margin-top:4px; }

/* Présence Discord. */
.presence-cover { align-items:center; }
.presence-settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.presence-settings-grid .exdev-switch-card { grid-column:1 / -1; }
.presence-activity-list { display:grid; gap:14px; }
.presence-activity-row { display:grid; grid-template-columns:38px minmax(140px,.55fr) minmax(260px,1.4fr) minmax(210px,.9fr) auto auto; align-items:end; gap:12px; padding:15px; border:1px solid rgba(56,189,248,.17); border-radius:18px; background:linear-gradient(145deg,rgba(13,29,49,.84),rgba(8,18,33,.84)); }
.presence-drag { width:34px; height:34px; display:grid; place-items:center; align-self:center; border-radius:11px; background:rgba(34,211,238,.12); border:1px solid rgba(34,211,238,.24); color:#7dd3fc; font-weight:950; }
.presence-enabled { align-self:center; display:flex !important; gap:7px; align-items:center; white-space:nowrap; }
.presence-enabled input { width:18px !important; height:18px !important; }
.presence-line-preview { grid-column:2 / -1; display:flex; gap:12px; align-items:center; min-width:0; padding:9px 12px; border-radius:12px; background:rgba(2,8,23,.50); }
.presence-line-preview small { color:var(--muted); }
.presence-line-preview b { min-width:0; overflow-wrap:anywhere; }
.presence-save-bar { display:flex; justify-content:space-between; align-items:center; gap:18px; padding-top:14px; border-top:1px solid rgba(148,163,184,.13); }
.presence-save-bar > div { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; }
.presence-save-bar small, .presence-save-bar span { color:var(--muted); }
.presence-variable-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.presence-variable { display:flex; justify-content:space-between; gap:15px; padding:14px; border:1px solid rgba(148,163,184,.14); border-radius:15px; background:rgba(8,20,36,.55); }
.presence-variable > div:last-child { text-align:right; display:grid; justify-items:end; gap:4px; }
.presence-variable p { margin:7px 0 0; color:var(--muted); }
.presence-variable.unavailable { opacity:.62; }

/* Demandes produit. */
.product-request-list, .content-admin-list { display:grid; gap:14px; }
.product-request-card { padding:16px; border:1px solid rgba(56,189,248,.16); border-radius:18px; background:rgba(9,22,39,.66); }
.product-request-head { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.product-request-head h3 { margin:8px 0 4px; }
.product-request-card > p { white-space:pre-wrap; }
.product-request-meta { display:flex; flex-wrap:wrap; gap:8px 16px; color:var(--muted); font-size:12px; }
.content-admin-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.content-admin-card { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.content-admin-main { min-width:0; flex:1; }
.content-admin-main > p { white-space:pre-wrap; }
.content-admin-title { display:flex; flex-wrap:wrap; gap:8px; }
.content-editor-form { width:min(940px,100%); }

/* Documentation publique. */
.docs-page-shell { width:min(1240px,calc(100% - 28px)); margin:0 auto; padding:34px 0 70px; }
.docs-topbar { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:14px 18px; border:1px solid rgba(56,189,248,.16); border-radius:20px; background:rgba(7,18,34,.78); position:sticky; top:12px; z-index:20; backdrop-filter:blur(16px); }
.docs-brand { display:flex; align-items:center; gap:12px; }
.docs-brand img { width:38px; height:38px; object-fit:contain; }
.docs-layout { display:grid; grid-template-columns:300px minmax(0,1fr); gap:22px; margin-top:24px; align-items:start; }
.docs-sidebar { position:sticky; top:98px; max-height:calc(100vh - 120px); overflow:auto; padding:15px; border:1px solid rgba(56,189,248,.14); border-radius:18px; background:rgba(8,20,36,.72); }
.docs-search { margin-bottom:12px; }
.docs-nav { display:grid; gap:6px; }
.docs-nav button { width:100%; text-align:left; padding:11px 12px; border-radius:12px; border:1px solid transparent; background:transparent; color:#cbd5e1; cursor:pointer; }
.docs-nav button:hover, .docs-nav button.active { background:rgba(34,211,238,.10); border-color:rgba(34,211,238,.20); color:#effcff; }
.docs-nav small { display:block; margin-top:3px; color:var(--muted); }
.docs-article { min-height:520px; padding:clamp(20px,3vw,38px); border:1px solid rgba(56,189,248,.14); border-radius:24px; background:linear-gradient(145deg,rgba(10,24,43,.86),rgba(6,14,27,.88)); }
.docs-article h1 { font-size:clamp(32px,5vw,54px); margin:0 0 12px; }
.docs-article h2 { margin:32px 0 12px; }
.docs-article h3 { margin:24px 0 10px; }
.docs-article p, .docs-article li { line-height:1.75; color:#c8d6e8; }
.docs-article pre { overflow:auto; padding:15px; border-radius:14px; background:#050b16; border:1px solid rgba(148,163,184,.16); }
.docs-meta { display:flex; flex-wrap:wrap; gap:8px 16px; margin-bottom:22px; color:var(--muted); }

/* Dernier verrouillage responsive : le voile ne recouvre jamais la sidebar. */
@media (max-width: 980px) {
  .presence-activity-row { grid-template-columns:38px repeat(2,minmax(0,1fr)); }
  .presence-text-field { grid-column:2 / -1; }
  .presence-url-field { grid-column:2 / -1; }
  .presence-enabled { grid-column:2; }
  .presence-line-preview { grid-column:2 / -1; }
  .presence-variable-grid { grid-template-columns:1fr; }
  .docs-layout { grid-template-columns:1fr; }
  .docs-sidebar { position:static; max-height:none; }
}
@media (max-width: 860px) {
  body.sidebar-open::before { content:"" !important; position:fixed !important; inset:0 0 0 min(342px,88vw) !important; z-index:2147483000 !important; background:rgba(1,7,16,.72) !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; pointer-events:auto !important; }
  body.sidebar-open .client-dashboard .workspace-sidebar,
  body.sidebar-open .admin-dashboard .workspace-sidebar { z-index:2147483001 !important; width:min(342px,88vw) !important; max-width:min(342px,88vw) !important; height:100dvh !important; transform:translate3d(0,0,0) !important; opacity:1 !important; visibility:visible !important; filter:none !important; backdrop-filter:none !important; -webkit-backdrop-filter:none !important; pointer-events:auto !important; overflow-y:auto !important; background:#071526 !important; }
  body.sidebar-open .workspace-sidebar, body.sidebar-open .workspace-sidebar * { filter:none !important; opacity:1 !important; pointer-events:auto !important; }
  .password-field { position:relative !important; display:grid !important; grid-template-columns:minmax(0,1fr) 46px !important; width:100% !important; min-height:46px !important; overflow:hidden !important; }
  .password-field > input { width:100% !important; min-width:0 !important; padding-right:12px !important; }
  .password-toggle { width:46px !important; min-width:46px !important; padding:0 !important; font-size:16px !important; }
  .content-admin-hero, .content-admin-card, .presence-save-bar { align-items:stretch; flex-direction:column; }
  .presence-settings-grid { grid-template-columns:1fr; }
  .presence-settings-grid .exdev-switch-card { grid-column:auto; }
  .presence-activity-row { grid-template-columns:34px minmax(0,1fr); align-items:stretch; }
  .presence-activity-row > label, .presence-activity-row > button, .presence-line-preview { grid-column:1 / -1; }
  .presence-drag { grid-column:1; }
  .presence-enabled { grid-column:2 !important; align-self:center; }
  .docs-topbar { position:static; flex-direction:column; align-items:stretch; }
}
@media (max-width: 560px) {
  .module-badges { width:100%; justify-content:flex-start; margin-top:8px; }
  .plugin-head { align-items:flex-start; flex-wrap:wrap; }
  .presence-variable { flex-direction:column; }
  .presence-variable > div:last-child { text-align:left; justify-items:start; }
  .docs-page-shell { width:min(100% - 18px,1240px); padding-top:12px; }
  .docs-article { padding:18px; }
}
.docs-nav a { display:block; width:100%; text-align:left; padding:11px 12px; border-radius:12px; border:1px solid transparent; background:transparent; color:#cbd5e1; text-decoration:none; }
.docs-nav a:hover, .docs-nav a.active { background:rgba(34,211,238,.10); border-color:rgba(34,211,238,.20); color:#effcff; }
.docs-nav a small { display:block; margin-top:3px; color:var(--muted); }
