:root {
  --bg: #0b0b0c; --card: #141416; --card2: #1a1a1d; --inner: #101012; --line: #27272b;
  --text: #f5f5f6; --muted: #8d8d96;
  --accent: #ff7a1a; --accent2: #ff9a4d; --accent-bg: rgba(255, 122, 26, .12); --accent-line: rgba(255, 122, 26, .5);
  --ok: #22c55e; --warn: #f59e0b; --err: #ef4444; --discord: #5865f2;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent2); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -.01em; } h2 { margin: 0; }
code { font-family: ui-monospace, Consolas, monospace; background: rgba(255, 255, 255, .07); padding: 1px 6px; border-radius: 6px; font-size: .88em; word-break: break-all; }
.muted { color: var(--muted); } .tiny { font-size: .78rem; } .tc { text-align: center; } .okt { color: #4ade80; }
.wrap { width: min(1216px, 100% - 32px); margin: 0 auto; }
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; } .row.gap, .gap { gap: 10px; } .between { justify-content: space-between; }

/* ---------- Barre du haut ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 12, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.15rem; } .logo:hover { text-decoration: none; }
.mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: #fff; background: linear-gradient(135deg, #ff9a4d, #ff5a00); }
.mark.big { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; margin: 0 auto 14px; }
.user { display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; }
.user img { width: 30px; height: 30px; border-radius: 50%; } .user span { padding-left: 8px; } .user img + span { padding-left: 0; }

/* ---------- En-tête de page et onglets ---------- */
.page { padding: 28px 0 70px; }
.appHead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.appIco { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; font-size: 1.6rem; background: var(--accent-bg); border: 1px solid var(--accent-line); }
.appIco img { width: 100%; height: 100%; object-fit: cover; }
.sub { color: var(--muted); font-size: .88rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: .85rem; font-weight: 700; border: 1px solid; }
.pill.ok { color: #4ade80; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .4); }
.pill.warn { color: #fbbf24; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .4); }
.pill.err { color: #f87171; background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .4); }
.pill.mute { color: var(--muted); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.tabs { display: flex; gap: 2px; margin: 20px 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: #fff; text-decoration: none; } .tabs a.active { color: #fff; border-bottom-color: var(--accent); }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin: 0 0 18px; }
.card.wide { width: min(680px, 100%); } .card.narrow { width: min(440px, 100%); }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 1.05rem; font-weight: 700; }
.cico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-bg); font-size: .95rem; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
body.bare { background: radial-gradient(900px 500px at 50% -10%, rgba(255, 122, 26, .12), transparent 70%), var(--bg); }
.grid2 { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 18px; } .grid2 .card { margin: 0 0 18px; }
.ctrls { display: grid; gap: 10px; } .ctrls form { margin: 0; }
.ctrl { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid; background: transparent; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ctrl span { width: 22px; text-align: center; } .ctrl:disabled { opacity: .35; cursor: not-allowed; } .ctrl:not(:disabled):hover { filter: brightness(1.25); }
.ctrl.go { color: #4ade80; border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .07); }
.ctrl.warn { color: #fbbf24; border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .07); }
.ctrl.stop { color: #f87171; border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .07); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.metric { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.metric .ml { color: var(--muted); font-size: .78rem; } .metric b { font-size: 1.45rem; }
progress.bar { width: 100%; height: 5px; border: 0; border-radius: 99px; overflow: hidden; background: #0b0b0c; appearance: none; }
progress.bar::-webkit-progress-bar { background: #0b0b0c; } progress.bar::-webkit-progress-value { background: var(--accent); border-radius: 99px; } progress.bar::-moz-progress-bar { background: var(--accent); }
.logs { margin: 10px 0 0; padding: 14px; max-height: 60vh; overflow: auto; background: #08080a; border: 1px solid var(--line); border-radius: 10px; font: 12.5px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.logs .le { color: #f87171; } .logs .lw { color: #fbbf24; }

/* ---------- Configurer le bot (menu vertical + formulaire) ---------- */
.cfg { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.cfg-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .85rem; margin-bottom: 16px; flex-wrap: wrap; }
.cfg-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.cfg-menu { display: grid; gap: 4px; position: sticky; top: 88px; }
.cfg-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; border: 1px solid transparent; color: #c9c9d0; font-weight: 500; }
.cfg-menu a:hover { background: var(--card2); text-decoration: none; color: #fff; }
.cfg-menu a.active { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-line); }
.cfg-menu .mi { width: 20px; text-align: center; } .cfg-menu .chev { margin-left: auto; font-style: normal; opacity: 0; } .cfg-menu a.active .chev { opacity: 1; }
.mgroup { margin: 16px 14px 6px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cfg-panel { background: var(--inner); border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-width: 0; }
.cfg-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.cfg-head .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-bg); font-size: 1.05rem; }
.cfg-head h2 { font-size: 1.2rem; font-weight: 700; }
.lead { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }
.subh { margin: 26px 0 12px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); } .lead + form .subh:first-child, .cfg-panel > .subh:first-child { margin-top: 6px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; } .fld { min-width: 0; } .fld.full { grid-column: 1 / -1; }
.lbl { font-size: .86rem; font-weight: 600; margin-bottom: 2px; } .hlp { font-size: .76rem; color: var(--muted); margin-bottom: 8px; }
input:not([type=checkbox]), select, textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #0b0b0c; color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input::placeholder, textarea::placeholder { color: #55555c; } textarea { resize: vertical; }
.savebar { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.tgl { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 16px 0 0; border-top: 1px solid var(--line); cursor: pointer; }
.tgl b { display: block; font-size: .92rem; } .tgl small { color: var(--muted); }
.switch { appearance: none; flex: none; width: 46px; height: 26px; border-radius: 99px; background: #2c2c31; position: relative; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch:checked { background: var(--accent); } .switch:checked::after { left: 23px; } .switch:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.rowlist { display: grid; gap: 8px; margin: 10px 0 14px; } .rowitem { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); } .rowitem form { margin: 0; } .rowitem .hlp { margin: 2px 0 0; }
.addrole select { flex: 1; min-width: 220px; }

/* ---------- Boutons, badges, messages ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.1); } .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.primary { background: linear-gradient(180deg, #ff8a2a, #f26a00); box-shadow: 0 6px 20px rgba(255, 122, 26, .22); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); } .btn.ghost:hover { border-color: var(--accent-line); }
.btn.danger { background: transparent; border-color: rgba(239, 68, 68, .5); color: #f87171; } .btn.discord { background: var(--discord); }
.btn.sm { padding: 7px 14px; font-size: .85rem; } .btn.big { padding: 14px 28px; font-size: 1.02rem; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; border: 1px solid; margin-bottom: 6px; }
.badge.ok { color: #4ade80; background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .4); } .badge.warn { color: #fbbf24; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .4); }
.flash { padding: 12px 16px; border-radius: 12px; margin: 0 0 18px; border: 1px solid; }
.flash.ok { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .4); color: #86efac; }
.flash.warn { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .4); color: #fcd34d; }
.flash.error { background: rgba(239, 68, 68, .08); border-color: rgba(239, 68, 68, .45); color: #fca5a5; } .flash a { text-decoration: underline; }
.steps { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 20px; } .steps p { margin: 0 0 6px; } .steps ol { margin: 6px 0 0; padding-left: 20px; } .steps li { margin: 8px 0; }
.copy { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; } .copy code { flex: 1; min-width: 0; padding: 9px 11px; }
.spinner { width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .cfg-grid { grid-template-columns: 1fr; } .cfg-menu { position: static; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .mgroup { display: none; } .cfg-menu .chev { display: none; }
  .grid2 { grid-template-columns: 1fr; } .fields { grid-template-columns: 1fr; } .user span { display: none; } .cfg-panel { padding: 18px; }
}

/* ---------- Icônes (SVG en traits fins) et finitions ---------- */
svg.ic { flex: none; display: block; }
.cico, .cfg-head .ico { color: var(--accent); }
.cico svg.ic, .cfg-head .ico svg.ic { width: 17px; height: 17px; }
.tabs a span, .cfg-menu .mi, .ctrl span { display: inline-flex; align-items: center; justify-content: center; }
.tabs a span svg.ic { width: 17px; height: 17px; }
.cfg-menu .mi svg.ic { width: 18px; height: 18px; }
.metric .ml { display: flex; align-items: center; gap: 7px; } .metric .ml svg.ic { width: 15px; height: 15px; color: var(--muted); }
.btn svg.ic { width: 16px; height: 16px; }
.ctrl svg.ic { width: 18px; height: 18px; }
.lead code, .hlp code, .muted code { white-space: nowrap; word-break: normal; }
select { appearance: none; padding-right: 40px; cursor: pointer; background: #0b0b0c url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238d8d96' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 14px center; }
select option { background: #141416; color: var(--text); }
/* Les champs d'une même ligne s'alignent par le bas, même si l'aide fait deux lignes */
.fld { display: flex; flex-direction: column; }
.fld > select, .fld > input, .fld > textarea { margin-top: auto; }

/* ---------- Éditeur d'embeds + aperçu ---------- */
input[type=color] { padding: 4px; height: 46px; cursor: pointer; }
.embed-ed { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.ee-preview { position: sticky; top: 88px; }
.ep { background: #313338; border-radius: 10px; padding: 14px; color: #dbdee1; font: 14px/1.4 system-ui, "Segoe UI", sans-serif; }
.ep-content { margin-bottom: 8px; white-space: pre-wrap; word-break: break-word; } .ep-content:empty { display: none; }
.ep-card { display: grid; gap: 8px; background: #2b2d31; border-left: 4px solid #ff7a1a; border-radius: 6px; padding: 12px 14px; max-width: 100%; }
.ep-card:empty { display: none; }
.ep-head { display: flex; gap: 12px; align-items: flex-start; }
.ep-main { flex: 1; min-width: 0; display: grid; gap: 6px; align-content: start; }
.ep-title { color: #fff; font-weight: 700; font-size: 1.2rem; line-height: 1.25; word-break: break-word; text-decoration: none; } a.ep-title[href] { color: #00a8fc; }
.ep-desc { white-space: pre-wrap; word-break: break-word; font-size: .9rem; }
.ep-hr { height: 1px; background: #3f4147; margin: 2px 0; }
.ep-image { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; }
.ep-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.ep-footer { font-size: .72rem; color: #b5bac1; }
.ep-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ep-buttons span { background: #4e5058; color: #fff; padding: 6px 14px; border-radius: 4px; font-size: .85rem; font-weight: 600; }
.ro { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: #0d0d0f; color: #c9c9d0; min-height: 46px; }
.badge { margin-right: 6px; } .errt { color: #f87171; }
@media (max-width: 1100px) { .embed-ed { grid-template-columns: 1fr; } .ee-preview { position: static; order: -1; } }
