/* Dashboard No More Redemption — mêmes teintes que les embeds du bot (or #B8863B sur cuir sombre). */
:root {
  --bg: #15110c;
  --panel: #1f1912;
  --panel-2: #271f16;
  --line: #3a2d1f;
  --text: #eadfc8;
  --muted: #a8977a;
  --gold: #b8863b;
  --gold-2: #d9aa55;
  --red: #c0563f;
  --green: #7c9a4b;
  --blue: #6c8fb3;
  --radius: 10px;
  --discord-bg: #313338;
  --discord-embed: #2b2d31;
  --discord-text: #dbdee1;
  --discord-muted: #949ba4;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--gold-2); }
h1, h2, h3 { font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.5em; margin: 8px 0 0; }

/* Connexion */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at top, #2a1f13 0%, var(--bg) 60%); }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--radius); padding: 32px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.login-card h1 { font-family: Rye, Georgia, serif; font-weight: 400; color: var(--gold-2); font-size: 24px; margin-top: 8px; }
.login-card .field { text-align: left; margin: 24px 0 16px; }
.login-card .discord-login { margin-top: 24px; text-decoration: none; }
.login-card .small-note { font-size: 12px; margin: 10px 0 0; }
#login-local { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
#login-local .field { margin-top: 12px; }
.me { display: flex; align-items: center; gap: 8px; padding: 10px 8px; margin-top: auto; border-top: 1px solid var(--line); font-size: 13px; min-width: 0; }
.me img { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 56px; height: 56px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: var(--panel-2); border: 2px solid var(--gold); color: var(--gold-2); font-size: 28px; }
.brand-mark.small { width: 36px; height: 36px; font-size: 18px; margin: 0; flex: none; }

/* Mise en page */
.app { display: flex; min-height: 100%; }
.sidebar { width: 240px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand strong { display: block; font-family: Rye, Georgia, serif; font-weight: 400; color: var(--gold-2); font-size: 14px; line-height: 1.2; }
.state { font-size: 12px; color: var(--muted); }
.state.on::before, .state.off::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.state.on::before { background: var(--green); }
.state.off::before { background: var(--red); }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 4px; }
nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
nav a:hover { background: var(--panel-2); }
nav a.active { background: rgba(184,134,59,.16); color: var(--gold-2); box-shadow: inset 3px 0 0 var(--gold); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); background: var(--bg);
  position: sticky; top: 0; z-index: 5; }
.topbar h2 { font-family: Rye, Georgia, serif; font-weight: 400; font-size: 22px; color: var(--gold-2); flex: 1; }
#menu-toggle { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.page { padding: 24px; max-width: 1280px; width: 100%; }
.banner { margin: 16px 24px 0; padding: 10px 14px; border-radius: var(--radius); background: rgba(192,86,63,.12); border: 1px solid rgba(192,86,63,.4); color: #e9b4a6; }

/* Blocs */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card h3 { font-size: 15px; margin-bottom: 4px; }
.card > .hint { margin: 0 0 16px; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .hint { margin: 0; color: var(--muted); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .value { font-size: 28px; font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.card > summary::after { content: "▾"; color: var(--muted); }
details.card[open] > summary { margin-bottom: 16px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 500; }
.field small { color: var(--muted); }
input, textarea, select { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: inherit; }
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(184,134,59,.55); border-color: var(--gold); }
input[type="color"] { padding: 2px; height: 38px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); margin-bottom: 6px; }
.toggle span small { display: block; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 12px; transition: .15s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: var(--text); transition: .15s; }
.switch input:checked + i { background: var(--gold); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--gold-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.chip button:hover { color: var(--red); }
.repeater-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--bg); }
.repeater-item header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); padding: 8px 14px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a130b; font-weight: 600; }
.btn.primary:hover { background: var(--gold-2); }
.btn.danger { color: #f0b3a5; border-color: rgba(192,86,63,.5); }
.btn.danger:hover { background: rgba(192,86,63,.15); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.icon { padding: 6px 10px; }

/* Tableaux et listes */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td .actions { justify-content: flex-end; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.gold { color: var(--gold-2); border-color: rgba(184,134,59,.5); }
.badge.green { color: #b9d18e; border-color: rgba(124,154,75,.5); }
.badge.red { color: #f0b3a5; border-color: rgba(192,86,63,.5); }
.badge.blue { color: #b3cae3; border-color: rgba(108,143,179,.5); }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters .btn.active { border-color: var(--gold); color: var(--gold-2); }
.log { padding: 10px 0; border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: 0; }
.log header { display: flex; justify-content: space-between; gap: 8px; }
.log p { margin: 4px 0 0; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.sugg { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: var(--bg); }
.sugg h4 { margin: 0 0 6px; }
.sugg p { margin: 0 0 10px; white-space: pre-wrap; word-break: break-word; }
.sugg .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.sugg .decide { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; margin-top: 10px; }

/* Aperçu Discord */
.preview { position: sticky; top: 84px; }
.discord { background: var(--discord-bg); border-radius: var(--radius); padding: 16px; color: var(--discord-text); font: 15px/1.375 "gg sans", "Noto Sans", Inter, sans-serif; }
.discord .msg { display: flex; gap: 14px; }
.discord .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); flex: none; object-fit: cover; }
.discord .name { font-weight: 600; color: #f2f3f5; }
.discord .tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 4px; border-radius: 3px; margin-left: 4px; vertical-align: 1px; }
.discord .time { color: var(--discord-muted); font-size: 12px; margin-left: 6px; }
.discord .content { margin: 2px 0 4px; word-break: break-word; }
.embed { display: grid; max-width: 520px; background: var(--discord-embed); border-left: 4px solid var(--gold); border-radius: 4px; padding: 10px 16px 14px 12px; margin-top: 4px; }
.embed .e-author { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; margin-top: 4px; }
.embed .e-author img { width: 24px; height: 24px; border-radius: 50%; }
.embed .e-title { font-weight: 600; color: #f2f3f5; margin-top: 6px; font-size: 16px; }
.embed .e-desc { font-size: 14px; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.embed .e-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.embed .e-field { grid-column: 1 / -1; font-size: 14px; }
.embed .e-field.inline { grid-column: auto; }
.embed .e-field b { display: block; color: #f2f3f5; margin-bottom: 2px; }
.embed .e-field div { white-space: pre-wrap; word-break: break-word; }
.embed .e-image { max-width: 100%; border-radius: 4px; margin-top: 16px; }
.embed .e-thumb { float: right; width: 80px; height: 80px; border-radius: 4px; object-fit: cover; margin: 6px 0 0 16px; }
.embed .e-footer { font-size: 12px; color: var(--discord-muted); margin-top: 8px; }
.d-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.d-button { background: #4e5058; color: #fff; border-radius: 4px; padding: 5px 14px; font-size: 14px; font-weight: 500; }
.d-button.success { background: #248046; }
.d-button.danger { background: #da373c; }
.d-button.primary { background: #5865f2; }
.d-select { background: #1e1f22; color: var(--discord-muted); border-radius: 4px; padding: 9px 12px; margin-top: 8px; max-width: 520px; }
.md-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.md-code { background: #1e1f22; border-radius: 3px; padding: 0 4px; font-family: Consolas, monospace; font-size: 85%; }
.md-h1 { font-size: 20px; font-weight: 700; display: block; }
.md-h2 { font-size: 18px; font-weight: 700; display: block; }
.md-h3 { font-size: 16px; font-weight: 700; display: block; }
.md-quote { border-left: 4px solid #4e5058; padding-left: 8px; display: block; }

/* Notifications */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100% - 32px); }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: 420px; }
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }

/* Petits écrans */
@media (max-width: 1000px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  .sidebar.open { transform: none; }
  #menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .page { padding: 16px; }
  .banner { margin: 12px 16px 0; }
  .sugg .decide { grid-template-columns: 1fr; }
  .embed .e-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Emojis */
.md-emoji { width: 1.375em; height: 1.375em; vertical-align: -.3em; object-fit: contain; }
.emoji-btn { background: none; border: 0; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; margin-left: 6px; opacity: .75; vertical-align: middle; }
.emoji-btn:hover, .emoji-btn:focus-visible { opacity: 1; }
.emoji-pop { position: absolute; z-index: 60; width: min(340px, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,.5); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.emoji-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-tabs .btn.active { border-color: var(--gold); color: var(--gold-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; max-height: 220px; overflow-y: auto; }
.emoji-grid .emoji { background: none; border: 0; border-radius: 6px; cursor: pointer; font-size: 20px; height: 34px; display: grid; place-items: center; padding: 0; }
.emoji-grid .emoji:hover, .emoji-grid .emoji:focus-visible { background: var(--panel-2); }
.emoji-grid .emoji img { width: 26px; height: 26px; object-fit: contain; }
.emoji-grid .empty { grid-column: 1 / -1; }
.toast { white-space: pre-line; }

/* Membres */
.member { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.member img { width: 32px; height: 32px; border-radius: 50%; flex: none; }
.member div { display: flex; flex-direction: column; min-width: 0; }
.member b, .member small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.members td { vertical-align: middle; }
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius);
  width: min(560px, calc(100vw - 32px)); padding: 20px; }
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog h3 { margin-bottom: 4px; }

/* Réseaux sociaux */
.steps { margin: 0 0 12px; padding-left: 20px; color: var(--text); }
.steps li { margin: 4px 0; }
.steps code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.add-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.advanced { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.advanced summary { cursor: pointer; color: var(--muted); }
