* { box-sizing: border-box; }
body {
  margin: 0;
  background: #313338;
  color: #dbdee1;
  font-family: 'gg sans', 'Noto Sans', Arial, sans-serif;
  min-height: 100vh;
}
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: #1e1f22;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #232428;
}
.topbar .title { font-weight: 700; font-size: 16px; color: #f2f3f5; }
.topbar nav { display: flex; gap: 4px; margin-left: 16px; flex-wrap: wrap; row-gap: 6px; }
.topbar nav a {
  color: #b5bac1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}
.topbar nav a:hover { background: #2b2d31; text-decoration: none; color: #f2f3f5; }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.topbar .user img { width: 28px; height: 28px; border-radius: 50%; }
.topbar .logout { color: #f23f42; font-size: 13px; }

.container { max-width: 900px; margin: 24px auto; padding: 0 24px 48px; }
.container h1 { color: #f2f3f5; font-size: 24px; margin-bottom: 4px; }
.hint { color: #949ba4; font-size: 14px; margin: 0 0 20px; }

.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; flex-direction: column; gap: 24px;
}
.login-card {
  background: #2b2d31; border-radius: 12px; padding: 40px 48px;
  text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.login-card h1 { margin: 0 0 8px; color: #f2f3f5; font-size: 22px; }
.login-card p { color: #949ba4; margin: 0 0 24px; }

.bot-select-card { min-width: 320px; }
.bot-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.bot-choice {
  background: #1e1f22; border: 1px solid #3f4147; color: #f2f3f5;
  padding: 14px 20px; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: left;
}
.bot-choice:hover { background: #26282c; border-color: #5865f2; }
.bot-choice { display: flex; align-items: center; gap: 10px; width: 100%; }
.guild-icon { width: 24px; height: 24px; border-radius: 50%; }
.alert-error {
  background: rgba(242,63,66,0.12); border: 1px solid #f23f42; color: #ff8a8c;
  padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; text-align: left;
}
.btn-discord {
  display: inline-flex; align-items: center; gap: 8px;
  background: #5865f2; color: white; border: none;
  padding: 12px 24px; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer;
}
.btn-discord:hover { background: #4752c4; text-decoration: none; }

table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #949ba4; padding: 8px 12px; border-bottom: 1px solid #3f4147;
}
td { padding: 10px 12px; border-bottom: 1px solid #3f4147; font-size: 14px; vertical-align: middle; }
tr:hover td { background: #2e3035; }
code { background: #1e1f22; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

.user-cell { display: flex; align-items: center; gap: 8px; }
.user-cell img { width: 24px; height: 24px; border-radius: 50%; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
}
.badge-open { background: rgba(46,204,113,0.15); color: #2ecc71; }
.badge-claimed { background: rgba(88,101,242,0.15); color: #5865f2; }
.badge-none { background: rgba(148,155,164,0.15); color: #949ba4; }

.error-wrap {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; flex-direction: column; gap: 16px;
}
.error-wrap .icon { font-size: 48px; }
.error-wrap p { color: #dbdee1; max-width: 400px; text-align: center; }

.btn-link { background: #2b2d31; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; }
.btn-link-danger {
  background: transparent; border: 1px solid #f23f42; color: #f23f42;
  padding: 8px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; margin-top: 12px;
}
.btn-link-danger:hover { background: rgba(242,63,66,0.12); }

.card {
  background: #2b2d31; border-radius: 10px; padding: 20px 24px; margin-bottom: 16px;
}
.card h2 { font-size: 15px; color: #f2f3f5; margin: 0 0 4px; }

.btn {
  border: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-success { background: #2ecc71; color: #0a1f14; }
.btn-success:hover { background: #29b765; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #cf4436; }

.tag-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li {
  background: #1e1f22; border-radius: 6px; padding: 4px 6px 4px 10px;
  font-size: 13px; display: flex; align-items: center; gap: 6px;
}
.btn-x {
  background: none; border: none; color: #949ba4; cursor: pointer; font-size: 12px;
  padding: 2px 4px; border-radius: 4px;
}
.btn-x:hover { color: #f23f42; background: rgba(242,63,66,0.12); }

.inline-form { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.inline-form select, .inline-form input[type="text"] {
  background: #1e1f22; border: 1px solid #3f4147; color: #dbdee1;
  padding: 7px 10px; border-radius: 6px; font-size: 14px; flex: 1;
}
form.inline { display: inline; }

.inline-form input[type="number"] {
  background: #1e1f22; border: 1px solid #3f4147; color: #dbdee1;
  padding: 7px 10px; border-radius: 6px; font-size: 14px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-top: 8px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #b5bac1; }
.form-grid input[type="number"], .form-grid input[type="text"], .form-grid select, .form-grid textarea {
  background: #1e1f22; border: 1px solid #3f4147; color: #dbdee1;
  padding: 8px 10px; border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-grid .full-width { grid-column: 1 / -1; }
.switch-row { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 14px !important; color: #dbdee1 !important; }
.switch-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #5865f2; }

.btn-delete {
  background: transparent; border: 1px solid #f23f42; color: #f23f42;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-delete:hover { background: rgba(242,63,66,0.12); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Dashboard des commandes groupées par catégorie — remplace l'ancienne
   liste à plat, dont le rendu était jugé peu lisible sur beaucoup de
   commandes (une seule longue colonne de lignes identiques). */
.container.wide { max-width: 1400px; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.cat-card { margin-bottom: 0; display: flex; flex-direction: column; }
.cat-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cat-header h2 { margin: 0; }

.cmd-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid #3f4147; }
.cmd-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid #3f4147;
  cursor: pointer; font-size: 13px;
}
.cmd-row:hover { background: #313338; }
.cmd-row code { flex-shrink: 0; }
.cmd-desc {
  flex: 1; color: #949ba4; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 12.5px;
}
.cmd-row .badge { flex-shrink: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Sélecteur de rôles recherchable + multi-sélection (remplace les <select>
   simples, difficiles à parcourir sur un serveur avec beaucoup de rôles). */
.role-picker { max-width: 420px; }
.role-picker-search {
  width: 100%; background: #1e1f22; border: 1px solid #3f4147; color: #dbdee1;
  padding: 8px 10px; border-radius: 6px 6px 0 0; font-size: 14px; border-bottom: none;
}
.role-picker-list {
  max-height: 220px; overflow-y: auto;
  background: #1e1f22; border: 1px solid #3f4147; border-radius: 0 0 6px 6px;
  padding: 4px;
}
.role-picker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 4px; font-size: 14px; cursor: pointer;
}
.role-picker-item:hover { background: #2b2d31; }
.role-picker-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: #5865f2; flex-shrink: 0; }

/* Page publique /commands — pas de topbar (page non authentifiée), mise en
   page à deux colonnes : liste par catégorie à gauche, recherche + nav des
   catégories fixée à droite. */
.cmdpage { display: flex; gap: 32px; max-width: 1400px; margin: 0 auto; padding: 32px 24px 64px; align-items: flex-start; }
.cmdpage-main { flex: 1; min-width: 0; }
.cmdpage-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.cmdpage-heading h1 { color: #f2f3f5; font-size: 26px; margin: 0; }
.cmdpage-botswitch { display: flex; gap: 6px; }
.cmdpage-botswitch a {
  background: #2b2d31; color: #b5bac1; padding: 6px 14px; border-radius: 6px; font-size: 13px; font-weight: 600;
}
.cmdpage-botswitch a.active { background: #5865f2; color: white; }
.cmdpage-botswitch a:hover { text-decoration: none; }

.cat-section { margin-bottom: 28px; }
.cat-bar {
  background: #e0654f; color: white; font-weight: 700; font-size: 15px;
  padding: 8px 14px; border-radius: 6px 6px 0 0;
}
.cmd-table { width: 100%; border-collapse: collapse; background: #2b2d31; border-radius: 0 0 6px 6px; overflow: hidden; }
.cmd-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #949ba4; padding: 8px 14px; border-bottom: 1px solid #3f4147;
}
.cmd-table td { padding: 8px 14px; font-size: 13.5px; border-bottom: 1px solid #35373c; vertical-align: top; }
.cmd-table tr:last-child td { border-bottom: none; }
.cmd-table tr:hover td { background: #313338; }
.cmd-name { color: #e0654f; font-weight: 600; white-space: nowrap; }

.cmdpage-sidebar { width: 220px; flex-shrink: 0; position: sticky; top: 24px; }
.cmdpage-search {
  width: 100%; background: #1e1f22; border: 1px solid #3f4147; color: #dbdee1;
  padding: 9px 12px; border-radius: 6px; font-size: 14px; margin-bottom: 16px;
}
.cmdpage-sidebar h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #949ba4; margin: 0 0 8px; }
.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-nav-item {
  padding: 7px 10px; border-radius: 6px; font-size: 13.5px; font-weight: 600;
  color: #b5bac1;
}
.cat-nav-item:hover { background: #2b2d31; text-decoration: none; }
.cat-nav-item.active { background: #e0654f; color: white; }

@media (max-width: 800px) {
  .cmdpage { flex-direction: column; }
  .cmdpage-sidebar { width: 100%; position: static; }
}

/* Page publique /docs — sidebar de navigation façon docs.draftbot.fr, plus
   large et plus verticale que la nav de /commands puisqu'elle porte du texte
   explicatif, pas juste des libellés courts. */
.docspage { display: flex; min-height: 100vh; }
.docs-sidebar {
  width: 260px; flex-shrink: 0; background: #1e1f22; border-right: 1px solid #232428;
  padding: 20px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.docs-brand { display: block; color: #f2f3f5; font-weight: 700; font-size: 16px; margin-bottom: 16px; }
.docs-brand:hover { text-decoration: none; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.docs-nav-item { padding: 8px 10px; border-radius: 6px; font-size: 14px; font-weight: 500; color: #b5bac1; }
.docs-nav-item:hover { background: #2b2d31; text-decoration: none; color: #f2f3f5; }
.docs-nav-item.active { background: #5865f2; color: white; font-weight: 600; }
.docs-sidebar-footer { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #2b2d31; }
.docs-sidebar-footer a { font-size: 13px; color: #949ba4; padding: 4px 10px; }
.docs-sidebar-footer a:hover { color: #f2f3f5; text-decoration: none; }

.docs-main { flex: 1; max-width: 760px; padding: 48px 40px 80px; min-width: 0; }
.docs-main h1 { color: #f2f3f5; font-size: 28px; margin: 0 0 24px; }
.docs-content { color: #dbdee1; font-size: 15px; line-height: 1.7; }
.docs-content h3 { color: #f2f3f5; font-size: 17px; margin: 28px 0 10px; }
.docs-content p { margin: 0 0 14px; }
.docs-content ul { margin: 0 0 14px; padding-left: 22px; }
.docs-content li { margin-bottom: 8px; }
.docs-content code { background: #1e1f22; padding: 2px 6px; border-radius: 4px; font-size: 13.5px; color: #f2b790; }
.docs-content a { color: #00a8fc; }
.docs-content strong { color: #f2f3f5; }

.docs-pager { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 20px; border-top: 1px solid #2b2d31; }
.docs-pager-link { color: #dbdee1; font-weight: 600; font-size: 14px; }
.docs-pager-link:hover { color: #00a8fc; }

@media (max-width: 800px) {
  .docspage { flex-direction: column; }
  .docs-sidebar { width: 100%; position: static; height: auto; }
  .docs-main { padding: 24px 20px 60px; }
}
