/* Black Market — gestion. Thème Maxx Présence : noir, dégradé rouge. */
:root {
  --gunmetal: #070708;
  --steel: #0e0e11;
  --steel-2: #141418;
  --rivet: #25252b;
  --line-2: #36363f;
  --bone: #ecebea;
  --ash: #8e8e98;
  --brass: #ff3b3b;
  --brass-dim: #d4111f;
  --oxblood: #d4111f;
  --oxblood-hi: #ff3b3b;
  --red-deep: #5c0710;
  --ok: #3ecf7a;
  --font-head: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 6px;
}
html { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { min-height: 100vh; color: var(--bone); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 520px at 10% -140px, rgba(212,17,31,.36), transparent 70%) fixed,
              radial-gradient(760px 520px at 100% 115%, rgba(92,7,16,.5), transparent 70%) fixed, var(--gunmetal); }
a { color: var(--oxblood-hi); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: .01em; margin: 0; line-height: 1.15; }
h1 { font-size: 46px; line-height: 1.05; }
h2 { font-size: 25px; }
h3 { font-size: 19px; }
p { margin: 0 0 .6em; }
.muted { color: var(--ash); }
.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Ossature ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: rgba(7,7,8,.72); backdrop-filter: blur(10px); border-right: 1px solid var(--rivet); padding: 22px 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 0 22px 22px; display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: linear-gradient(135deg, #ff3b3b, #a30b17); color: #fff; display: grid; place-items: center; font: 700 19px/1 var(--font-head); letter-spacing: .02em; box-shadow: 0 6px 22px -8px rgba(255,59,59,.7); flex: none; }
.brand b { font: 600 25px/1 var(--font-head); letter-spacing: .03em; display: block; }
.brand span { font-size: 12px; color: var(--ash); }
.nav { list-style: none; margin: 0; padding: 0; flex: 1; overflow: auto; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 22px; color: var(--ash); text-decoration: none; border-left: 3px solid transparent; font-size: 14.5px; }
.nav a:hover { color: var(--bone); background: rgba(255,255,255,.03); }
.nav a[aria-current="page"] { color: #fff; border-left-color: var(--oxblood-hi); background: linear-gradient(90deg, rgba(212,17,31,.2), transparent); }
.nav .count { font: 700 13px var(--font-head); background: linear-gradient(135deg, #ff3b3b, #a30b17); color: #fff; border-radius: 9px; padding: 1px 7px; }
.nav .sep { height: 1px; background: var(--rivet); margin: 10px 22px; }
.me { padding: 14px 22px 0; border-top: 1px solid var(--rivet); display: flex; gap: 10px; align-items: center; font-size: 13px; }
.me img, .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--steel-2); object-fit: cover; flex: none; }
.me .grow { flex: 1; min-width: 0; }
.me .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 30px 38px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--ash); max-width: 62ch; }
.btn.menu-btn { display: none; }

/* ---------- Blocs ---------- */
.panel { background: rgba(14,14,17,.88); border: 1px solid var(--rivet); border-radius: var(--r); padding: 20px; margin-bottom: 18px; }
.panel > h2, .panel > .row-head { margin-bottom: 14px; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 18px; align-items: start; }
.split > .sticky { position: sticky; top: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- Formulaires ---------- */
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: 13px; color: var(--ash); margin-bottom: 5px; }
label.f > small { display: block; color: var(--ash); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--gunmetal); color: var(--bone); border: 1px solid var(--rivet); border-radius: var(--r);
  padding: 9px 11px; font: inherit; font-size: 14.5px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--brass-dim); outline: none; box-shadow: 0 0 0 2px rgba(255,59,59,.2); }
input[type=color] { width: 44px; height: 38px; padding: 2px; background: var(--gunmetal); border: 1px solid var(--rivet); border-radius: var(--r); cursor: pointer; }
.check { display: flex; gap: 9px; align-items: center; margin-bottom: 12px; cursor: pointer; font-size: 14.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--brass); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > input, .inline > select { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--rivet); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; }
.seg button { background: transparent; color: var(--ash); border: 0; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #d4111f; color: #fff; }

.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--steel-2); color: var(--bone); border: 1px solid var(--line-2); border-radius: var(--r); padding: 8px 15px; font: 500 14.5px var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--oxblood-hi); }
.btn.primary { background: linear-gradient(135deg, #ff3b3b, #a30b17); color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 6px 22px -8px rgba(255,59,59,.7); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: #ffb3b3; border-color: var(--red-deep); }
.btn.danger:hover { background: var(--oxblood); color: #fff; border-color: var(--oxblood); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ash); padding: 6px 9px; }
.btn.ghost:hover { color: var(--bone); background: var(--steel-2); }
.btn:disabled { opacity: .5; cursor: progress; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Image ---------- */
.imgfield { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.imgfield .thumb { width: 64px; height: 48px; border-radius: var(--r); background: var(--gunmetal) center/cover no-repeat; border: 1px dashed var(--rivet); }
.imgfield .thumb.has { border-style: solid; }

/* ---------- Tableaux ---------- */
table.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.list th { text-align: left; font-weight: 500; color: var(--ash); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--rivet); }
table.list td { padding: 10px; border-bottom: 1px solid rgba(37,37,43,.9); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num { font-family: var(--font-head); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.list th.num { text-align: right; }
.empty { padding: 26px; text-align: center; color: var(--ash); }

/* ---------- Le manifeste (catalogue) ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rivet); margin-bottom: 0; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--ash); padding: 10px 14px; font: 600 17px var(--font-head); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--brass); }
.tabs .n { color: var(--ash); font-size: 12px; margin-left: 5px; }
.manifest { background: rgba(14,14,17,.88); border: 1px solid var(--rivet); border-top: 0; border-radius: 0 0 var(--r) var(--r); }
.item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 12px 18px; border-bottom: 1px solid rgba(37,37,43,.9); cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover { background: rgba(255,255,255,.02); }
.item .pic { width: 72px; height: 50px; border-radius: 3px; background: var(--gunmetal) center/cover no-repeat; border: 1px solid var(--rivet); }
.item .name { font: 600 20px var(--font-head); letter-spacing: .01em; }
.item .desc { color: var(--ash); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font: 700 26px/1 var(--font-head); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.price s { display: block; font-size: 13px; color: var(--ash); font-weight: 400; margin-bottom: 3px; text-decoration-color: var(--oxblood-hi); text-decoration-thickness: 2px; }
.price.promo { color: var(--oxblood-hi); }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--rivet); color: var(--ash); white-space: nowrap; }
.tag.dispo { color: #a6d4b0; border-color: #35543c; }
.tag.limite { color: #e6c27d; border-color: #5e4c26; }
.tag.rupture { color: #f0aaa4; border-color: #5c2a27; }
.tag.promo { background: var(--oxblood); color: #fff; border-color: var(--oxblood); }
.tag.live { color: #a6d4b0; border-color: #35543c; }

/* ---------- Statut ---------- */
.status { display: flex; gap: 14px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--oxblood-hi); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(95,158,110,.18); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rivet); border: 1px solid var(--rivet); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; }
.stats a { background: rgba(14,14,17,.92); padding: 16px 18px; text-decoration: none; color: var(--bone); }
.stats a:hover { background: var(--steel-2); }
.stats b { display: block; font: 700 38px/1 var(--font-head); font-variant-numeric: tabular-nums; }
.stats span { color: var(--ash); font-size: 13px; }

/* ---------- Aperçu Discord ---------- */
.dc { background: #313338; border-radius: var(--r); padding: 16px; font: 15px/1.375 "gg sans", "Noto Sans", "Segoe UI", sans-serif; color: #dbdee1; }
.dc-label { font-size: 12px; color: var(--ash); margin-bottom: 8px; }
.dc-msg { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.dc-av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #ff3b3b, #a30b17) center/cover; }
.dc-name { font-weight: 600; color: #f2f3f5; }
.dc-name em { font-style: normal; font-size: 10px; background: #5865f2; color: #fff; padding: 1px 4px; border-radius: 3px; margin-left: 5px; vertical-align: 2px; font-weight: 600; }
.dc-name time { font-size: 12px; color: #949ba4; font-weight: 400; margin-left: 6px; }
.dc-text { white-space: pre-wrap; word-wrap: break-word; }
.dc-embed { margin-top: 6px; background: #2b2d31; border-left: 4px solid #d4111f; border-radius: 4px; padding: 10px 14px 14px 12px; max-width: 432px; display: grid; grid-template-columns: 1fr auto; gap: 0 12px; }
.dc-embed .t { font-weight: 600; color: #f2f3f5; margin: 2px 0 6px; grid-column: 1; }
.dc-embed .d { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; grid-column: 1; }
.dc-embed .th { grid-column: 2; grid-row: 1 / span 3; width: 80px; height: 80px; border-radius: 4px; background: #1e1f22 center/cover; }
.dc-embed .im { grid-column: 1 / -1; margin-top: 14px; border-radius: 4px; max-width: 100%; max-height: 300px; object-fit: cover; }
.dc-embed .fl { grid-column: 1 / -1; display: flex; gap: 22px; margin-top: 8px; font-size: 14px; flex-wrap: wrap; }
.dc-embed .fl b { display: block; color: #f2f3f5; font-size: 13.5px; }
.dc-embed .ft { grid-column: 1 / -1; font-size: 12px; color: #b5bac1; margin-top: 8px; }
.dc-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dc-btn { font-size: 14px; padding: 5px 14px; border-radius: 3px; background: #4e5058; color: #fff; }
.dc-btn.success { background: #248046; } .dc-btn.primary { background: #5865f2; } .dc-btn.danger { background: #da373c; }
.dc s { color: #949ba4; }
.dc code { background: #1e1f22; padding: 0 3px; border-radius: 3px; font-size: 13px; }
.dc .mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }

/* ---------- Questions (tickets) ---------- */
.qlist { counter-reset: q; list-style: none; padding: 0; margin: 0 0 12px; }
.qlist li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid rgba(37,37,43,.9); }
.qlist li::before { counter-increment: q; content: counter(q); font: 700 18px var(--font-head); color: var(--oxblood-hi); padding-top: 8px; text-align: right; }
.qlist .opts { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--ash); flex-wrap: wrap; }
.qlist .opts label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.qlist .ctl { display: flex; flex-direction: column; gap: 2px; }
.qlist li.over::before { color: var(--ash); text-decoration: line-through; }

/* ---------- Fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4,4,5,.78); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.dialog { background: #0e0e11; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(212,17,31,.15); border: 1px solid var(--rivet); border-radius: 6px; width: min(960px, 100%); padding: 22px 24px; animation: rise .16s ease-out; }
.dialog.narrow { width: min(520px, 100%); }
.dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.dialog footer { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--rivet); flex-wrap: wrap; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
pre.transcript { background: var(--gunmetal); border: 1px solid var(--rivet); border-radius: var(--r); padding: 14px; max-height: 60vh; overflow: auto; white-space: pre-wrap; font-size: 13px; }

#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: #141418; border: 1px solid var(--rivet); border-left: 3px solid var(--ok); padding: 10px 14px; border-radius: var(--r); font-size: 14px; animation: rise .16s ease-out; white-space: pre-line; }
.toast.err { border-left-color: var(--oxblood-hi); }
.toast.warn { border-left-color: var(--brass); }

/* ---------- Connexion ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(320px, 440px); }
.gate-art { background: radial-gradient(700px 500px at 0% 100%, rgba(212,17,31,.35), transparent 70%), rgba(7,7,8,.6); border-right: 1px solid var(--rivet); display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; overflow: hidden; position: relative; }
.gate-art .word { font: 700 clamp(64px, 11vw, 168px)/.82 var(--font-head); color: #1d1d23; letter-spacing: -.02em; user-select: none; }
.gate-art .word span { display: block; background: linear-gradient(180deg, #ff3b3b, #a30b17); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-art p { color: var(--ash); max-width: 40ch; margin-top: 22px; }
.gate-form { padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.gate-form h1 { margin-bottom: 6px; }
.gate-form > p { color: var(--ash); margin-bottom: 26px; }
.gate-form .err { color: #f0aaa4; font-size: 14px; min-height: 1.4em; margin-bottom: 8px; }

@media (max-width: 1050px) {
  .split { grid-template-columns: 1fr; }
  .split > .sticky { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; width: 250px; transform: translateX(-100%); transition: transform .18s; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; margin-bottom: 14px; }
  .main { padding: 18px 16px 50px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .item { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .item .pic { width: 56px; height: 42px; }
  .item .tagcol { display: none; }
  .gate { grid-template-columns: 1fr; }
  .gate-art { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
