/* Morgane · dashboard v2 — layout and visual harmony for every panel page.
   Loaded last by site-start.ejs. One spacing scale (4/8/12/16/24/32), one radius scale
   (10/14/18), one surface hierarchy (page < sidebar < card < raised). */
html body[data-site-shell=morgane]{
 --panel-rail:72px;--panel-menu-width:264px;
 --ds-page:#0b0a10;--ds-side:#0e0d14;--ds-rail:#0b0a10;--ds-card:#121019;--ds-raised:#191622;--ds-line:#25222f;--ds-line-soft:#ffffff0b;
 --ds-text:#f2efff;--ds-muted:#a8a3c7;--ds-subtle:#7a7599;--ds-accent:#a78bfa;--ds-accent-2:#a99ee0;
 --ds-r1:10px;--ds-r2:14px;--ds-r3:18px;
 background:var(--ds-page);
}
/* Rules nested under the shell selector so they win over the header/theme sheets loaded later. */
html body[data-site-shell=morgane]{

/* ---------- Shell ---------- */
.panel-layout{min-height:calc(100dvh - var(--panel-header))}
.panel-side{top:var(--panel-header);height:calc(100dvh - var(--panel-header));background:var(--ds-side);border-right:1px solid var(--ds-line)}
.panel-rail{gap:10px;padding:14px 0;background:var(--ds-rail);border-right:1px solid var(--ds-line-soft)}
.panel-rail .panel-token{width:46px;height:46px;border-radius:50%;background:var(--ds-raised);border:2px solid transparent;transition:border-radius .18s,border-color .18s,box-shadow .18s}
.panel-rail .panel-token:hover{border-radius:14px;border-color:#a855f788}
.panel-rail .panel-token.is-selected{border-radius:14px;border-color:#8b5cf6;box-shadow:none}
.panel-rail .panel-token.is-selected::before{content:"";position:absolute;left:-13px;top:50%;width:4px;height:28px;margin-top:-14px;border-radius:0 4px 4px 0;background:#8b5cf6}
.panel-rail .rail-account{margin-bottom:6px;padding-bottom:0}
.panel-rail .rail-account::after{content:"";position:absolute;bottom:-11px;left:8px;right:8px;height:1px;background:var(--ds-line)}
.panel-context{padding:18px 14px 24px}
.panel-identity{gap:12px;padding:12px;margin:0 0 16px;border:1px solid var(--ds-line);border-radius:var(--ds-r2);background:#15131f}
.panel-identity .identity-token{width:44px;height:44px;border-radius:12px}
.panel-identity strong{font-size:.95rem;color:var(--ds-text)}.panel-identity small{color:var(--ds-subtle)}
/* Sidebar search: one clean field (no nested borders) */
.panel-search{gap:8px;margin:0 0 18px;padding:0 12px;height:40px;border:1px solid var(--ds-line);border-radius:var(--ds-r1);background:var(--ds-page);color:var(--ds-subtle);transition:border-color .15s,box-shadow .15s}
.panel-search:focus-within{border-color:#8b5cf6;box-shadow:none}
.panel-search input{height:38px;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;outline:none;color:var(--ds-text)}
.panel-search svg{width:16px;height:16px}
/* Menu */
.panel-menu-group{gap:2px;margin-top:20px}
.panel-menu h2{margin:0 0 6px;padding:0 10px;font-size:.68rem;letter-spacing:.14em;color:var(--ds-subtle)}
.panel-menu a{min-height:40px;gap:12px;padding:8px 10px;border-radius:var(--ds-r1);font-size:.9rem;font-weight:600;color:var(--ds-muted)}
.panel-menu a span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:#ffffff08;color:#c4b5fd}
.panel-menu a span svg{width:16px;height:16px}
.panel-menu a:hover{background:#ffffff08;color:var(--ds-text)}
.panel-menu a[aria-current]{background:#ffffff0d;color:#fff;box-shadow:inset 3px 0 0 #8b5cf6}
.panel-menu a[aria-current] span{background:#8b5cf6;color:#fff}
/* ---------- Workspace ---------- */
.panel-workspace main#main-content{max-width:1320px;padding:28px clamp(16px,3vw,40px) 40px}
.panel-workspace :is(.page-heading,.org-heading,.studio-heading,.service-heading){display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-end;gap:16px;margin:0 0 24px;padding:24px 28px;border:1px solid var(--ds-line);border-radius:var(--ds-r3);
 background:linear-gradient(180deg,#15131f,var(--ds-card))}
.panel-workspace :is(.page-heading,.org-heading,.studio-heading,.service-heading) h1{margin:.2rem 0 .3rem;font-size:clamp(1.6rem,2.6vw,2.3rem);line-height:1.15}
.panel-workspace :is(.page-heading,.org-heading,.studio-heading) .lead,.panel-workspace .service-heading p{margin:0;max-width:62ch;color:var(--ds-muted)}
.panel-workspace :is(.wide-card,.config-card,.server-card,.studio-card,.org-section,.org-card,.module-card,.status-card,.site-content .panel){padding:20px 22px;margin-bottom:16px;border:1px solid var(--ds-line);border-radius:var(--ds-r3);background:var(--ds-card);box-shadow:none}
.panel-workspace :is(.wide-card,.org-section) h2{margin-top:0;font-size:1.15rem}
.panel-workspace .studio-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:0 0 16px}
.panel-workspace .studio-metrics>article{display:flex;flex-direction:column;gap:4px;padding:16px 18px;margin:0;border-radius:var(--ds-r2)}
.panel-workspace .studio-metrics>article>span{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--ds-subtle)}
.panel-workspace .studio-metrics>article strong{font-size:1.7rem;line-height:1.1}
.panel-workspace .section-title{display:flex;justify-content:space-between;align-items:center;gap:12px}
/* Tables */
.panel-workspace .table-wrap{overflow:auto;border:1px solid var(--ds-line-soft);border-radius:var(--ds-r2)}
.panel-workspace table{width:100%;font-size:.9rem}
.panel-workspace th{position:sticky;top:0;background:#14112a;padding:10px 12px;text-align:left}
.panel-workspace td{padding:10px 12px;vertical-align:middle}
/* Forms */
.panel-workspace label{color:var(--ds-muted);font-weight:600;font-size:.88rem}
.panel-workspace :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){min-height:40px;padding:8px 12px;border-radius:var(--ds-r1)}
.panel-workspace :is(.button,button.button){min-height:40px;padding:0 16px;border-radius:var(--ds-r1);display:inline-flex;align-items:center;gap:8px;font-weight:700}
/* Dashboard footer sits inside the workspace */
.panel-workspace .mg-footer{margin:40px calc(-1 * clamp(16px,3vw,40px)) -40px;border-radius:0}
@media (max-width:800px){
 &{--panel-rail:64px;--panel-menu-width:248px}
 .panel-side{top:var(--panel-header);height:calc(100dvh - var(--panel-header));box-shadow:20px 0 60px #000a}
 .panel-workspace main#main-content{padding:18px 16px 32px}
 .panel-workspace :is(.page-heading,.org-heading,.studio-heading,.service-heading){padding:18px}
}


/* ---------- Mes serveurs ---------- */
.sv-hero{align-items:center}
.sv-counts{display:flex;gap:10px}.sv-counts span{padding:8px 14px;border:1px solid var(--ds-line);border-radius:12px;background:#ffffff06;color:var(--ds-muted);font-size:.88rem}
.sv-counts strong{color:#fff;font-size:1.05rem;margin-right:4px}
.sv-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:0 0 8px}
.sv-section-title{margin:24px 0 12px;font-size:1.05rem}.sv-section-title small{color:var(--ds-subtle);font-weight:600;margin-left:6px}
.sv-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.sv-card{display:grid!important;grid-template-columns:56px 1fr;align-items:center;gap:12px 14px;padding:16px!important;margin:0!important}
.sv-card>.button{grid-column:1/-1;justify-content:center;width:100%}
.sv-card.is-off{opacity:.8}
.sv-icon{display:grid;place-items:center;width:56px;height:56px;border-radius:16px;overflow:hidden;background:var(--ds-raised);font-weight:800;font-size:1.3rem}
.sv-icon img{width:100%;height:100%;object-fit:cover}
.sv-card h3{margin:0 0 4px;font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sv-card-body{min-width:0}.sv-card .muted{margin:0;font-size:.85rem}
.sv-modules{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0;color:var(--ds-muted);font-size:.82rem}
.sv-modules i{width:16px;height:5px;border-radius:3px;background:#ffffff1a}.sv-modules i.on{background:#8b5cf6}.sv-modules span{flex-basis:100%;margin-top:4px}
/* ---------- Configuration d'un serveur ---------- */
.gd-identity{display:flex;align-items:center;gap:18px;min-width:0}
.gd-icon{display:grid;place-items:center;flex:none;width:72px;height:72px;border-radius:20px;overflow:hidden;background:var(--ds-raised);font-size:1.8rem;font-weight:800}
.gd-icon img{width:100%;height:100%;object-fit:cover}
.gd-shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin:0 0 24px}
.gd-shortcut{display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:12px;padding:14px 16px;border:1px solid var(--ds-line);border-radius:var(--ds-r2);background:var(--ds-card);color:var(--ds-text);text-decoration:none;transition:border-color .15s,background .15s}
.gd-shortcut:hover{border-color:#ffffff2a;background:#15131f}
.gd-shortcut-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:#8b5cf61f;color:#c4b5fd}.gd-shortcut-icon svg{width:20px;height:20px}
.gd-shortcut strong{display:block;font-size:.95rem}.gd-shortcut small{display:block;color:var(--ds-muted);font-size:.8rem}
.gd-title{margin:0 0 12px;flex-wrap:wrap}.gd-title h2{margin:0;font-size:1.15rem}
.gd-modules{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:12px;margin:0 0 24px}
.gd-module{display:flex;flex-direction:column;gap:10px;margin:0!important}
.gd-module.is-on{border-color:#8b5cf655}
.gd-module-head{display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:12px}
.gd-module-head h3{margin:0 0 4px;font-size:1.05rem}
.gd-module-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:12px;background:var(--ds-raised);color:#c4b5fd}.gd-module-icon svg{width:22px;height:22px}
.gd-module>.muted{margin:0;font-size:.88rem}
.gd-toggle{position:relative;display:inline-block;width:46px;height:26px;cursor:pointer}
.gd-toggle input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.gd-toggle span[aria-hidden]{position:absolute;inset:0;border-radius:99px;background:#ffffff1f;transition:background .15s}
.gd-toggle span[aria-hidden]::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .15s}
.gd-toggle input:checked+span{background:#8b5cf6}.gd-toggle input:checked+span::after{transform:translateX(20px)}
.gd-toggle input:focus-visible+span{outline:2px solid #a78bfa;outline-offset:2px}
.gd-module .module-details{border:1px solid var(--ds-line-soft);border-radius:12px;padding:10px 12px;background:#ffffff04}
.gd-module .module-details summary{cursor:pointer;font-weight:700;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.gd-module .module-details summary span{color:var(--ds-subtle);font-weight:600;font-size:.82rem}
.gd-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:12px 0}
.gd-fields label{display:flex;flex-direction:column;gap:6px}.gd-wide{grid-column:1/-1}
.gd-switch{flex-direction:row!important;align-items:center}
.gd-module .card-save{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:auto;padding-top:6px;border-top:1px solid var(--ds-line-soft)}
.gd-module .card-save small{color:var(--ds-subtle)}
}
