:root {
  --bg: #1e1f22;
  --bg-elevated: #2b2d31;
  --bg-card: #313338;
  --border: #3f4147;
  --text: #f2f3f5;
  --text-muted: #949ba4;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #57f287;
  --danger: #ed4245;
  --warning: #fee75c;
  --radius: 8px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "gg sans", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--bg-elevated);
  padding: 16px 12px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.sidebar .guild-name { font-weight: 700; padding: 8px 10px 16px; font-size: 16px; }
.sidebar a.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  margin-bottom: 2px;
  font-size: 14px;
}
.sidebar a.nav-link:hover { background: #3a3c43; color: var(--text); }
.sidebar a.nav-link.active { background: var(--accent); color: white; }
.sidebar .back-link { color: var(--text-muted); padding: 8px 10px; display: block; margin-bottom: 12px; font-size: 13px; }
.main { flex: 1; padding: 28px 36px; max-width: 980px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.subtitle { color: var(--text-muted); margin: 0 0 20px; font-size: 14px; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.module-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.module-tile .name { font-weight: 600; }
.module-tile .desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; min-height: 32px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: #3f4147; }
.btn.secondary:hover { background: #4a4d55; }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); color: #063; }
.btn.small { padding: 4px 10px; font-size: 12px; }
form.inline { display: inline; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-group .help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 70px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.on { background: rgba(87,242,135,.15); color: var(--success); }
.badge.off { background: rgba(237,66,69,.15); color: var(--danger); }
.badge.neutral { background: rgba(148,155,164,.15); color: var(--text-muted); }
.badge.pending { background: rgba(254,231,92,.15); color: var(--warning); }
.toggle-btn { background: none; border: 1px solid var(--border); padding: 4px 10px; border-radius: 12px; font-size: 12px; cursor: pointer; color: var(--text); }
.guild-list { display: grid; gap: 10px; }
.guild-list.grid-view { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.guild-list.grid-view .guild-item { flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; }
.guild-list.grid-view .guild-item .btn { align-self: stretch; justify-content: center; }
.view-toggle { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.view-toggle button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 30px; background: transparent; color: var(--text-muted); border: 0; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.view-toggle button:hover { color: var(--text); background: rgba(255,255,255,.06); }
.view-toggle button.active { background: var(--accent); color: #fff; }
.guild-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); border: 1px solid var(--border); padding: 14px 18px; border-radius: var(--radius); }
.guild-item .meta { display: flex; align-items: center; gap: 12px; }
.guild-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-weight: 700; object-fit: cover; flex-shrink: 0; }
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; flex-direction: column; gap: 20px; }
.empty { color: var(--text-muted); padding: 20px 0; text-align: center; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }
.lang-switch { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.lang-switch a { padding: 4px 9px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-decoration: none; border-radius: 6px; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { background: var(--accent); color: #fff; }
.sidebar .lang-switch { margin: 14px 0 6px; align-self: flex-start; }

/* --- Aperçu de message Discord (embedPreview.js) --- */
.dc-preview { background: #313338; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; color: #dbdee1; font-size: 14px; line-height: 1.4; }
.dc-msg { display: flex; gap: 12px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-name { font-weight: 600; color: #fff; }
.dc-bot { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 3px; }
.dc-content { word-break: break-word; }
.dc-embed { display: flex; gap: 12px; margin-top: 6px; max-width: 520px; background: #2b2d31; border-left: 4px solid #4f545c; border-radius: 4px; padding: 8px 14px 12px 12px; }
.dc-embed-main { min-width: 0; flex: 1; }
.dc-author, .dc-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.dc-footer { font-weight: 400; color: #949ba4; }
.dc-author img, .dc-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-title { font-weight: 700; color: #fff; margin-top: 6px; font-size: 15px; word-break: break-word; }
.dc-desc { margin-top: 6px; word-break: break-word; }
.dc-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.dc-field { grid-column: 1 / -1; }
.dc-field.inline { grid-column: auto; }
.dc-fname { font-weight: 700; font-size: 13px; color: #fff; }
.dc-fvalue { font-size: 13px; word-break: break-word; }
.dc-image { max-width: 100%; border-radius: 4px; margin-top: 10px; display: block; }
.dc-thumb { width: 72px; height: 72px; border-radius: 4px; object-fit: cover; align-self: flex-start; margin-top: 6px; }
.dc-card { margin-top: 6px; border: 1px dashed #4f545c; border-radius: 6px; padding: 18px; color: #949ba4; font-size: 12px; text-align: center; max-width: 520px; }
.dc-empty { color: #949ba4; font-style: italic; }
.dc-error { color: #f38688; font-size: 13px; }
.dc-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dc-link { color: #00a8fc; }
.dc-preview code { background: #1e1f22; border-radius: 3px; padding: 0 4px; font-size: 13px; }
.dc-preview pre { background: #1e1f22; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; }
.preview-label { font-size: 12px; color: var(--text-muted); margin: 4px 0 6px; }
