:root {
  --bg: #000;
  --panel: #0a0a0a;
  --panel-2: #111;
  --line: #1f1f1f;
  --line-2: #2c2c2c;
  --text: #f2f2f2;
  --muted: #8a8a8a;
  --dim: #5a5a5a;
  --white: #fff;
  --radius: 4px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.center { display: grid; place-items: center; padding: 24px 16px; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 22px;
  font: 600 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border-radius: var(--radius); border: 1px solid var(--white);
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--white); color: #000; }
.btn-primary:hover { background: #000; color: var(--white); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--white); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 11px; }
.btn:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

/* ---------- Auth ---------- */
.auth {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  text-align: center;
}
.auth-logo { width: 190px; height: auto; }
.auth-logo.small { width: 110px; }
.auth-banner { width: 280px; height: auto; margin-top: -4px; }
.auth-sub { font: 600 11px/1 var(--sans); letter-spacing: .4em; color: var(--muted); margin-bottom: 10px; }
.auth-text { color: var(--muted); }
.auth-foot { font-size: 11px; color: var(--dim); letter-spacing: .04em; }
.auth .btn-primary { width: 100%; }
.alert {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line-2); border-left: 3px solid var(--white);
  background: var(--panel); text-align: left; font-size: 13px;
}

.h-title { font: 700 13px/1 var(--sans); letter-spacing: .32em; }

.loader { width: 160px; height: 2px; background: var(--line); overflow: hidden; }
.loader span { display: block; width: 40%; height: 100%; background: var(--white); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(0,0,0,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 38px; width: auto; }
.brand .brand-banner { height: 22px; }
.me { display: flex; align-items: center; gap: 12px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; filter: grayscale(1); border: 1px solid var(--line-2); }

/* ---------- Layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.grow { flex: 1; }
.tag { font: 600 10px/1 var(--sans); letter-spacing: .2em; padding: 5px 8px; border: 1px solid var(--line-2); color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
.grid.two { grid-template-columns: 1fr 1fr; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.card h2 { font: 600 11px/1 var(--sans); letter-spacing: .24em; }

.stats .k { font: 600 10.5px/1 var(--sans); letter-spacing: .22em; color: var(--muted); }
.stats .v { font: 600 26px/1.1 var(--mono); margin: 12px 0 6px; }
.stats .sub { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.dot.on { background: var(--white); box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.dot.off { background: transparent; border: 1px solid var(--muted); }

/* ---------- Serveur ---------- */
.guild { display: flex; flex-direction: column; gap: 14px; }
.guild-id { display: flex; align-items: center; gap: 12px; }
.guild-id img { width: 44px; height: 44px; border-radius: var(--radius); filter: grayscale(1); border: 1px solid var(--line-2); }
.guild-id strong { font-size: 15px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.kv div { background: var(--panel); padding: 10px 12px; }
.kv span { display: block; font-size: 10.5px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.kv b { font: 600 14px/1.6 var(--mono); }

/* ---------- Liste ---------- */
.list { list-style: none; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.badge { font: 600 9.5px/1 var(--sans); letter-spacing: .18em; padding: 4px 6px; background: var(--white); color: #000; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font: 600 10.5px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.neg { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--dim); }

@media (max-width: 920px) {
  .grid.stats { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 10px 16px; }
  .brand .brand-banner, .me .mono { display: none; }
  .wrap { padding: 20px 16px 40px; }
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .v { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .loader span { animation: none; width: 100%; }
}

/* =====================================================================
   v2 : navigation, espace bot, console, editeur
   ===================================================================== */
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn-ghost:disabled:hover { border-color: var(--line-2); }
.btn-xs { height: 28px; padding: 0 10px; font-size: 10.5px; letter-spacing: .12em; }
.btn.on { background: var(--white); color: #000; border-color: var(--white); }

.input {
  height: 38px; width: 100%; padding: 0 12px;
  background: #000; color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 13px var(--mono); outline: none;
}
.input:focus { border-color: var(--white); }
.input-sm { height: 32px; width: 180px; }

/* topbar v2 */
.topbar { padding: 0 24px; height: 60px; }
.brand { text-decoration: none; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a {
  display: flex; align-items: center; padding: 0 16px; height: 100%;
  font: 600 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--white); border-bottom-color: var(--white); }
.me-name { display: flex; flex-direction: column; line-height: 1.25; }
.role { font: 600 9px/1 var(--sans); letter-spacing: .2em; color: var(--muted); margin-top: 3px; }

.pill { font: 600 10px/1 var(--sans); letter-spacing: .2em; padding: 6px 10px; border: 1px solid var(--line-2); color: var(--muted); }
.pill.on { background: var(--white); color: #000; border-color: var(--white); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid.stats.six { grid-template-columns: repeat(6, 1fr); }
.stats .v.sm { font-size: 18px; margin: 12px 0 6px; }
.flash { animation: flash .8s ease-out; }
@keyframes flash { from { color: #000; background: var(--white); } to { color: inherit; background: transparent; } }

.badge-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line-2); }
.guild-id > div { display: flex; flex-direction: column; gap: 2px; }
.kv { grid-template-columns: repeat(3, 1fr); }
.kv.kv-1 { grid-template-columns: 1fr; width: 100%; text-align: left; }
.kv.kv-1 b { font-size: 12.5px; word-break: break-all; }
.auth.wide { max-width: 460px; }
.row-btns { display: flex; gap: 10px; width: 100%; }
.row-btns form { flex: 1; }
.row-btns .btn { width: 100%; }

/* ---------- Console ---------- */
.console-card { display: flex; flex-direction: column; padding-bottom: 0; }
.console-card .card-head { flex-wrap: wrap; gap: 10px; }
#c-live { font-size: 11px; letter-spacing: .14em; }
#c-live.live { color: var(--white); }
#c-live.live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--white); margin-right: 8px; vertical-align: middle; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.filters { display: flex; gap: 4px; }
.chip {
  height: 28px; padding: 0 10px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--radius);
  font: 600 10px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--white); color: #000; border-color: var(--white); }
.console {
  height: calc(100vh - 380px); min-height: 320px; overflow: auto;
  margin: 0 -18px; padding: 10px 18px 14px;
  background: #000; border-top: 1px solid var(--line);
  font: 12.5px/1.65 var(--mono); outline: none;
}
.line { display: flex; gap: 12px; white-space: pre-wrap; word-break: break-word; }
.line:hover { background: var(--panel-2); }
.l-time { color: var(--dim); flex: none; }
.l-tag { color: var(--text); font-weight: 600; flex: none; }
.l-msg { color: #cfcfcf; }
.k-REST .l-tag, .k-REST .l-msg { color: var(--muted); }
.k-err { border-left: 2px solid var(--white); padding-left: 8px; margin-left: -10px; }
.k-err .l-msg { color: var(--white); font-weight: 600; }
.k-sys .l-tag { background: var(--white); color: #000; padding: 0 5px; }

/* ---------- Fichiers ---------- */
body.app-wide { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.files { flex: 1; display: grid; grid-template-columns: 280px 1fr; min-height: 0; }
.tree-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.editor-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-head { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-bottom: 1px solid var(--line); flex: none; }
.pane-head h2 { font: 600 11px/1 var(--sans); letter-spacing: .22em; }
#f-path { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dirty { font: 600 9.5px/1 var(--sans); letter-spacing: .16em; padding: 4px 6px; background: var(--white); color: #000; }
.tree { list-style: none; overflow: auto; flex: 1; padding: 6px 0; }
.tree .empty { padding: 12px 14px; }
.node { display: flex; align-items: center; gap: 8px; height: 28px; padding-right: 12px; cursor: pointer; font-size: 13px; user-select: none; outline: none; }
.node:hover, .node:focus-visible { background: var(--panel-2); }
.node .caret { width: 10px; flex: none; font: 12px var(--mono); color: var(--muted); }
.node .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node.dir .name { font-weight: 600; }
.node .size { font: 11px var(--mono); color: var(--dim); }
.node.active { background: var(--white); color: #000; }
.node.active .size, .node.active .caret { color: #444; }
.node.sel-dir .name { text-decoration: underline; text-underline-offset: 3px; }

.editor { flex: 1; display: flex; min-height: 0; background: #000; }
.gutter {
  flex: none; width: 56px; padding: 14px 10px 14px 0; margin: 0;
  overflow: hidden; text-align: right; color: var(--dim);
  font: 13px/1.6 var(--mono); border-right: 1px solid var(--line); user-select: none;
}
#editor {
  flex: 1; resize: none; border: 0; outline: none; padding: 14px 16px;
  background: #000; color: var(--text); caret-color: var(--white);
  font: 13px/1.6 var(--mono); tab-size: 2; white-space: pre; overflow: auto;
}
#editor::selection { background: var(--white); color: #000; }
#editor:disabled { color: var(--dim); }
.statusbar { display: flex; gap: 12px; height: 28px; align-items: center; padding: 0 14px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; flex: none; }

/* ---------- Modale + toast ---------- */
.modal {
  margin: auto; width: min(420px, calc(100vw - 32px));
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px;
}
.modal::backdrop { background: rgba(0,0,0,.75); }
.modal h3 { font: 700 12px/1 var(--sans); letter-spacing: .26em; margin-bottom: 12px; }
.modal p { color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.modal .input { margin-bottom: 16px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; }
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  padding: 12px 16px; background: var(--white); color: #000;
  font: 600 12px/1.3 var(--sans); letter-spacing: .04em; border-radius: var(--radius);
  opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #000; color: var(--white); border: 1px solid var(--white); }

@media (max-width: 1100px) {
  .grid.stats.six { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 920px) {
  .nav a { padding: 0 10px; }
  .files { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
  .tree-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane-head { flex-wrap: wrap; height: auto; min-height: 48px; padding: 8px 14px; }
}
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px 0; }
  .nav { order: 3; width: 100%; height: 42px; overflow-x: auto; }
  .me .me-name { display: none; }
  .grid.stats.six { grid-template-columns: repeat(2, 1fr); }
  .head { flex-wrap: wrap; }
  .input-sm { width: 100%; }
  .filters { width: 100%; overflow-x: auto; }
  .chip { flex: none; }
  .console { height: 60vh; }
  body.app-wide { height: auto; overflow: auto; }
  .editor { min-height: 60vh; }
}

/* =====================================================================
   v3 : sous-navigation, onglet Discord, embed maker
   ===================================================================== */
.subnav {
  display: flex; gap: 2px; padding: 0 24px; height: 44px;
  border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto;
}
.subnav a {
  display: flex; align-items: center; padding: 0 14px; flex: none;
  font: 600 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--text); }
.subnav a.active { color: var(--white); border-bottom-color: var(--white); }
.wrap-wide { max-width: 1480px; }
.hint { font-size: 12px; color: var(--dim); margin-top: 10px; }
.small { font-size: 12px; }
.empty-state { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; padding: 0; }
.link:hover { color: var(--white); }
.more { display: flex; justify-content: center; padding-top: 12px; }
.more:empty { display: none; }
.wrap-head { flex-wrap: wrap; gap: 10px; }
select.input { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option, select.input optgroup { background: #0a0a0a; color: var(--text); }
textarea.input.area { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; margin-top: 10px; }
.check input { accent-color: #fff; width: 15px; height: 15px; }
.card-head .check { margin-top: 0; }

/* ---------- formulaires ---------- */
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f > span { font: 600 10px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f-wide { grid-column: 1 / -1; }
.f-inline { display: flex; gap: 8px; align-items: center; }
.f-inline .input { flex: 1; min-width: 0; }
.check-f { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; font-size: 13px; color: var(--muted); }
.check-f input { accent-color: #fff; }
.modal .f { margin-bottom: 14px; }
.modal { width: min(480px, calc(100vw - 32px)); }

/* ---------- membres ---------- */
.members { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.m-side { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 420px; position: sticky; top: 76px; }
.m-tools { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.m-row { display: flex; gap: 8px; }
.m-row .input { flex: 1; height: 34px; font-size: 12px; }
.m-count { font-size: 11px; }
.m-list { list-style: none; overflow-y: auto; flex: 1; padding: 6px; }
.m-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius); cursor: pointer; outline: none; }
.m-item:hover, .m-item:focus-visible { background: var(--panel-2); }
.m-item.active { background: var(--white); color: #000; }
.m-item.active .m-sub { color: #444; }
.m-item.active .tag-s { border-color: #000; color: #000; }
.m-item.active .tag-s.inv { background: #000; color: #fff; }
.m-av { position: relative; flex: none; width: 34px; height: 34px; }
.m-av img { width: 34px; height: 34px; border-radius: 50%; filter: grayscale(1); }
.m-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-tags { display: flex; gap: 4px; flex: none; }
.tag-s { font: 600 8.5px/1 var(--sans); letter-spacing: .12em; padding: 3px 5px; border: 1px solid var(--line-2); color: var(--muted); }
.tag-s.inv { background: var(--white); color: #000; border-color: var(--white); }
.m-more { padding: 10px; text-align: center; }

/* pastilles de statut, en noir et blanc */
.sdot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--panel); box-sizing: content-box; }
.s-online { background: #fff; }
.s-idle { background: linear-gradient(90deg, #fff 50%, #555 50%); }
.s-dnd { background: #fff; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px #000; }
.s-offline { background: #000; box-shadow: inset 0 0 0 2px #666; }
.m-item.active .sdot { border-color: #fff; }

.m-detail { min-height: 420px; }
.p-head { display: flex; gap: 18px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.p-av { position: relative; flex: none; }
.p-av img { width: 76px; height: 76px; border-radius: 50%; filter: grayscale(1); border: 1px solid var(--line-2); }
.p-av .sdot { width: 16px; height: 16px; border-width: 3px; right: 0; bottom: 0; }
.p-id { min-width: 0; }
.p-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.p-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.p-status { font-size: 13px; margin-top: 6px; }
.p-activity { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-style: italic; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.m-detail > .kv { margin-top: 16px; }
.p-sec { margin-top: 22px; }
.p-sec h3, .sub-head h3 { font: 600 10.5px/1 var(--sans); letter-spacing: .22em; color: var(--muted); margin-bottom: 10px; }
.sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sub-head h3 { margin: 0; }
.roles { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; }
.role-chip .x { background: none; border: 0; color: var(--muted); cursor: pointer; font: 600 11px var(--mono); padding: 0 2px; }
.role-chip .x:hover { color: var(--white); }
.act-row { display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.act-row:first-of-type { border-top: 0; }
.act-label { font: 600 10px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.act-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- logs ---------- */
.logs { display: flex; flex-direction: column; gap: 8px; }
.log { border: 1px solid var(--line); border-left: 3px solid var(--white); border-radius: var(--radius); padding: 10px 14px; background: #000; }
.log.neg { border-left-color: var(--line-2); }
.log-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.log-time { font-size: 11.5px; color: var(--dim); }
.log-title { font: 700 11.5px/1.3 var(--sans); letter-spacing: .1em; }
.log.neg .log-title { text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
.log-desc { margin-top: 8px; font-size: 13px; color: #d0d0d0; white-space: pre-wrap; word-break: break-word; }
.log-fields { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; }
.lf { flex: 1 1 100%; min-width: 0; }
.lf.inline { flex: 0 1 auto; }
.lf-k { display: block; font: 600 9.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.lf-v { font-size: 12.5px; word-break: break-word; }
.lf-v code, .log-desc code { font: 12px var(--mono); background: var(--panel-2); padding: 1px 5px; border-radius: 3px; }
.mention, .ts { font-weight: 600; }
.logs.compact .log { padding: 8px 12px; }
.audit-det { white-space: normal !important; max-width: 520px; font-size: 12.5px; }
.audit-det .mono { font-size: 11px; word-break: break-all; }

/* ---------- sanctions ---------- */
.sanction-list { margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.sanction-list li { align-items: center; }
.s-left { display: flex; gap: 10px; align-items: center; min-width: 0; }
.s-av { width: 30px; height: 30px; border-radius: 50%; filter: grayscale(1); }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }

/* ---------- embed maker ---------- */
.maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 16px; align-items: start; }
.maker-form { display: flex; flex-direction: column; gap: 16px; }
.maker-side { position: sticky; top: 76px; }
.preview-head { display: flex; align-items: center; margin-bottom: 10px; }
.preview-head h2 { font: 600 11px/1 var(--sans); letter-spacing: .24em; }
#e-body.off { opacity: .35; pointer-events: none; }
#e-count.over { color: #fff; text-decoration: underline; }
.color { width: 42px; height: 38px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: #000; cursor: pointer; }
.color::-webkit-color-swatch-wrapper { padding: 4px; }
.color::-webkit-color-swatch { border: 0; border-radius: 2px; }
#e-color-hex { max-width: 110px; flex: none; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-item { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #000; }
.row-top { display: flex; gap: 8px; align-items: center; }
.row-top .input { flex: 1; min-width: 0; }
.row-top .check { margin: 0; white-space: nowrap; }
.maker-form .sub-head { margin-top: 18px; }

/* apercu facon Discord (rendu fidele : theme sombre de Discord) */
.dc { background: #313338; border-radius: 8px; padding: 16px 16px 18px; font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: #dbdee1; font-size: 15px; line-height: 1.375; }
.dc-msg { display: flex; gap: 16px; }
.dc-av { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-user { font-weight: 600; color: #f2f3f5; }
.dc-bot { font-size: 10px; font-weight: 700; background: #5865f2; color: #fff; padding: 1px 4px; border-radius: 3px; }
.dc-time { font-size: 12px; color: #949ba4; margin-left: 2px; }
.dc-md { white-space: pre-wrap; word-wrap: break-word; }
.dc-md a { color: #00a8fc; text-decoration: none; }
.dc-md code { background: #2b2d31; border-radius: 3px; padding: 0 3px; font: 13px Consolas, "Courier New", monospace; }
.dc-pre { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; padding: 8px; font: 13px Consolas, "Courier New", monospace; white-space: pre-wrap; margin: 4px 0; }
.dc-quote { border-left: 4px solid #4e5058; padding-left: 10px; }
.dc-h { font-weight: 700; color: #f2f3f5; margin: 4px 0 2px; }
h3.dc-h { font-size: 1.5em; } h4.dc-h { font-size: 1.25em; } h5.dc-h { font-size: 1em; }
.dc-small { font-size: 12px; color: #949ba4; }
.dc-mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-embed { margin-top: 6px; max-width: 516px; background: #2b2d31; border-left: 4px solid #fff; border-radius: 4px; padding: 8px 16px 16px 12px; }
.dc-em-main { display: flex; gap: 16px; }
.dc-em-inner { flex: 1; min-width: 0; }
.dc-author { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: #f2f3f5; }
.dc-author-ic { width: 24px; height: 24px; border-radius: 50%; }
.dc-title { margin-top: 8px; font-weight: 600; color: #f2f3f5; font-size: 16px; }
.dc-title.link { color: #00a8fc; }
.dc-desc { margin-top: 8px; font-size: 14px; }
.dc-fields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin-top: 8px; }
.dc-field { grid-column: 1 / -1; min-width: 0; }
.dc-field.inline { grid-column: span 4; }
.dc-fn { font-size: 14px; font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.dc-fv { font-size: 14px; }
.dc-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; flex: none; }
.dc-image { display: block; max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 16px; }
.dc-footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #b5bac1; }
.dc-footer-ic { width: 20px; height: 20px; border-radius: 50%; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; padding: 7px 16px; border-radius: 3px; }
.dc-empty { color: #949ba4; font-style: italic; }
img.broken { display: none; }

@media (max-width: 1180px) {
  .maker { grid-template-columns: 1fr; }
  .maker-side { position: static; order: -1; }
  .members { grid-template-columns: 300px 1fr; }
}
@media (max-width: 820px) {
  .members { grid-template-columns: 1fr; }
  .m-side { position: static; height: 50vh; }
  .f-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .act-row { grid-template-columns: 1fr; gap: 6px; }
  .subnav { padding: 0 8px; }
}

/* correctifs */
[hidden] { display: none !important; }
.card-head { gap: 10px; }
.m-detail .p-name { font: 700 22px/1.2 var(--sans); letter-spacing: -.01em; }
.p-sec .kv { grid-template-columns: repeat(2, 1fr); }

/* =====================================================================
   v4 : boutons, onglets en boutons, logs lisibles
   ===================================================================== */
:root { --radius: 6px; }

/* ---------- boutons ---------- */
.btn { gap: 8px; border-radius: 8px; transition: background .15s, color .15s, border-color .15s, transform .08s, box-shadow .15s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
.btn-primary:hover:not(:disabled) { background: #000; color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.btn-ghost { background: #0d0d0d; border-color: #2a2a2a; }
.btn-ghost:hover:not(:disabled) { border-color: #fff; background: #161616; }
.btn-danger { background: transparent; color: #fff; border: 1px solid #fff; }
.btn-danger:hover:not(:disabled) { background: #fff; color: #000; }
.btn-danger:disabled { border-color: var(--line-2); color: var(--dim); }

/* ---------- onglets = gros boutons ---------- */
.tabs {
  display: flex; gap: 8px; padding: 14px 24px; overflow-x: auto;
  border-bottom: 1px solid var(--line); background: #050505;
}
.tab {
  flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
  border: 1px solid #2a2a2a; border-radius: 10px; background: #0d0d0d;
  font: 600 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: .15s;
}
.tab:hover { color: #fff; border-color: #555; background: #141414; }
.tab.active { background: #fff; color: #000; border-color: #fff; }
body.app-wide .tabs { flex: none; }

/* ---------- barre de recherche ---------- */
.searchbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.search-main { display: flex; gap: 10px; }
.search-main .input-lg:first-child { flex: 1; }
.input-lg { height: 48px; font-size: 14px; padding: 0 16px; border-radius: 10px; }
.search-main .btn { height: 48px; padding: 0 24px; border-radius: 10px; }
#a-type { max-width: 280px; }

/* ---------- filtres segmentes ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.seg-btn {
  height: 36px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: #0d0d0d; color: var(--muted); border: 1px solid #2a2a2a;
  font: 600 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; transition: .15s;
}
.seg-btn:hover { color: #fff; border-color: #555; }
.seg-btn.on { background: #fff; color: #000; border-color: #fff; }

.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.toolbar .check { margin: 0; color: var(--text); }

/* ---------- logs ---------- */
.logs { gap: 10px; }
.day {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 2px;
  font: 700 10.5px/1 var(--sans); letter-spacing: .22em; color: var(--muted);
}
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day:first-child { margin-top: 0; }

.log {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid #fff; border-radius: 10px; transition: border-color .15s, background .15s;
}
.log:hover { border-color: #333; border-left-color: #fff; background: #0e0e0e; }
.log.neg { border-left-color: #fff; }
.log:not(.neg) { border-left-color: #3a3a3a; }
.log.sel { background: #151515; border-color: #fff; }
.log-check { margin-top: 3px; width: 16px; height: 16px; accent-color: #fff; cursor: pointer; }
.log-main { min-width: 0; }
.log-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat {
  font: 700 9.5px/1 var(--sans); letter-spacing: .16em; padding: 5px 8px; border-radius: 6px;
  border: 1px solid #3a3a3a; color: #cfcfcf;
}
.cat-strong { background: #fff; color: #000; border-color: #fff; }
.cat-dim { color: var(--dim); border-color: var(--line-2); }
.log-title { font: 700 14px/1.3 var(--sans); letter-spacing: .02em; text-decoration: none !important; }
.log-time { font-size: 12px; color: var(--muted); cursor: help; }
.log-clock { font-size: 11.5px; color: var(--dim); }
.log-desc {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #000; border: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.55; color: #e6e6e6; white-space: normal; word-break: break-word;
}
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 20px; margin-top: 12px; }
.lrow { min-width: 0; }
.lrow.long { grid-column: 1 / -1; }
.lk { display: block; font: 600 9.5px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.lv { font-size: 13.5px; line-height: 1.5; word-break: break-word; color: #ececec; }
.lv code { font: 12.5px var(--mono); background: #1a1a1a; padding: 1px 6px; border-radius: 4px; }
.lv a, .log-desc a { color: #fff; }
.lv-user { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.id-chip {
  font-size: 11px; padding: 3px 8px; border-radius: 6px; cursor: pointer;
  background: #141414; color: var(--muted); border: 1px solid #2a2a2a; transition: .15s;
}
.id-chip:hover { color: #000; background: #fff; border-color: #fff; }
.log-acts { display: flex; flex-direction: column; gap: 6px; opacity: .55; transition: opacity .15s; }
.log:hover .log-acts, .log.sel .log-acts { opacity: 1; }
.icon-btn {
  height: 28px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  background: #0d0d0d; color: var(--text); border: 1px solid #2a2a2a;
  font: 600 10px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; transition: .15s;
}
.icon-btn:hover { border-color: #fff; }
.icon-btn.danger:hover { background: #fff; color: #000; }
.more .btn { min-width: 200px; }

/* ---------- sanctions ---------- */
.count { font: 700 11px/1 var(--mono); padding: 5px 9px; border-radius: 999px; background: #fff; color: #000; }
.people { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 62vh; overflow-y: auto; }
.person {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #000;
}
.person:hover { border-color: #333; }
.p-img { width: 38px; height: 38px; border-radius: 50%; filter: grayscale(1); border: 1px solid var(--line-2); }
.p-img-empty { display: grid; place-items: center; font: 700 14px var(--sans); background: #141414; }
.p-txt { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.p-txt strong { font-size: 14px; }
.p-meta { font-size: 12px; color: var(--muted); }
.p-btns { display: flex; gap: 6px; }
.inline-form { margin-top: 2px; }
.inline-form .btn { height: 38px; }

@media (max-width: 820px) {
  .search-main { flex-wrap: wrap; }
  .search-main .btn { flex: 1; }
  #a-type { max-width: none; flex: 1 1 100%; }
  .log { grid-template-columns: auto 1fr; }
  .log-acts { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; opacity: 1; }
  .tabs { padding: 10px 12px; }
  .tab { height: 36px; padding: 0 14px; }
}
.log > .log-main:only-child { grid-column: 1 / -1; }
.chip { height: 32px; padding: 0 14px; border-radius: 999px; background: #0d0d0d; border-color: #2a2a2a; transition: .15s; }
.chip:hover { border-color: #555; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.actions .btn, .head .btn { border-radius: 8px; }
