/* Raizbotﾒ — styles du dashboard (mêmes couleurs que la doc : assets/style.css) */
.noscript { padding: 24px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.btn-primary.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.dash-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 40px 0; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.dash-head .lead { margin-bottom: 14px; }
.dash-title { display: flex; gap: 16px; align-items: flex-start; }
.dash-user { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-soft); font-size: 13.5px; }
.av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.av-letter { display: grid; place-items: center; background: var(--panel); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.btn-ghost.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-discord { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
.btn-discord:hover { opacity: .9; }

/* connexion */
.login-card { max-width: 460px; margin: 40px auto; padding: 34px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg-soft); text-align: center; }
.login-card h1 { font-size: 26px; }
.login-logo { width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 26px; }
.login-note { font-size: 12.5px; color: var(--muted); margin: 18px 0 0; }
.login-note a { color: var(--text-soft); }
.login-card .note-box { text-align: left; }

/* serveurs */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 24px; }
.guild-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); text-decoration: none; transition: border-color .15s, transform .15s; }
.guild-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.guild-card.locked { opacity: .65; }
.guild-card.add { border-style: dashed; }
.guild-icon { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; font-size: 22px; }
.guild-icon.lg { width: 64px; height: 64px; }
.guild-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.guild-meta { font-size: 12.5px; color: var(--muted); }
.guild-action { margin-top: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); }

/* modules */
.dash-search { margin: 6px 0 4px; height: 42px; }
.mod-section[hidden], .mod-card[hidden] { display: none; }
.mod-section h2 { font-size: 17px; margin: 30px 0 12px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.mod-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); transition: border-color .15s; }
.mod-card:hover { border-color: var(--border-strong); }
.mod-card.locked { opacity: .55; }
.mod-link { flex: 1; display: block; padding: 14px 14px 8px; text-decoration: none; }
.mod-title { display: block; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.mod-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--muted); line-height: 1.45; }
.mod-foot { display: flex; align-items: center; gap: 8px; padding: 6px 12px 12px 14px; }
.mod-foot .switch { margin-left: auto; }
.lock { font-size: 12px; color: var(--muted); }

/* interrupteur */
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel); cursor: pointer; transition: background .15s, border-color .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
/* Activé = argent (comme l'étoile) ; la position du rond suffit à lire l'état, sans couleur */
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(18px); background: var(--accent-text); }
.switch:disabled { opacity: .5; cursor: wait; }
.switch:focus-visible, .seg-btn:focus-visible, .f-input:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* formulaire */
.dash-form { display: grid; margin: 8px 0 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); }
.f-row { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.f-row:last-child { border-bottom: 0; }
.f-row[hidden] { display: none; }
.f-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.f-label { display: block; font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.f-toggle .f-label { margin-bottom: 2px; }
.f-help { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.f-hint { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.f-input { display: block; width: 100%; max-width: 520px; min-height: 38px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; outline: 0; }
.f-input:focus { border-color: var(--border-strong); }
.f-input.sm { max-width: 260px; }
textarea.f-input { resize: vertical; min-height: 90px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
select.f-input { cursor: pointer; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.seg-btn { height: 32px; padding: 0 14px; border-radius: 7px; border: 0; background: none; color: var(--text-soft); font-size: 13.5px; cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.chips-field { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip.on-soft { cursor: default; gap: 6px; padding-right: 4px; }
.chip.on-soft button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--panel); color: var(--muted); cursor: pointer; line-height: 1; }
.chip.on-soft button:hover { color: var(--danger); }
.role-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.color-field { display: flex; align-items: center; gap: 14px; }
.color-field input[type=color] { width: 54px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: pointer; }
.color-field input[type=color]:disabled { opacity: .35; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-soft); cursor: pointer; }

/* barre d'enregistrement */
.save-bar { position: fixed; z-index: 45; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  width: min(620px, calc(100vw - 32px)); padding: 10px 10px 10px 18px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); }
.save-bar[hidden] { display: none; }
.save-bar span { flex: 1; font-size: 14px; color: var(--text-soft); }
.btn-save { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: var(--accent); color: var(--accent-text); font-weight: 700; cursor: pointer; }
.btn-save kbd { background: rgba(0, 0, 0, .12); border-color: transparent; color: inherit; }
.btn-save:disabled { opacity: .6; cursor: wait; }

/* notifications */
.toasts { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast { padding: 11px 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--tip) 45%, transparent); background: var(--bg); color: var(--text); box-shadow: var(--shadow); font-size: 14px; animation: toastIn .2s ease-out; }
.toast.err { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* menus déroulants (remplacent les menus natifs du navigateur) */
.dd { position: relative; width: 100%; max-width: 520px; }
.dd.dd-add { max-width: 300px; }
.dd-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; transition: border-color .15s; }
.dd-btn:hover, .dd.open .dd-btn { border-color: var(--border-strong); }
.dd-btn:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.dd-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.dd-ph { color: var(--muted); }
.dd-add .dd-ph { color: var(--text-soft); }
.dd-chev { flex-shrink: 0; color: var(--muted); transition: transform .15s; }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-panel { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); min-width: 240px; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg); box-shadow: var(--shadow); }
.dd.up .dd-panel { top: auto; bottom: calc(100% + 6px); }
.dd-search-wrap { padding: 8px; border-bottom: 1px solid var(--border); }
.dd-search { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font: inherit; font-size: 13.5px; outline: 0; }
.dd-search:focus { border-color: var(--border-strong); }
.dd-list { max-height: 290px; overflow-y: auto; padding: 6px; }
.dd-group { display: flex; align-items: center; gap: 6px; padding: 10px 10px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dd-group[hidden], .dd-opt[hidden], .dd-empty[hidden] { display: none; }
.dd-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text-soft); cursor: pointer; }
.dd-opt.indent { padding-left: 22px; }
.dd-opt:hover, .dd-opt.hl { background: var(--hover); color: var(--text); }
.dd-opt.sel { background: var(--panel); color: var(--text); font-weight: 600; }
.dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-ico { width: 16px; flex-shrink: 0; text-align: center; color: var(--muted); font-size: 13px; }
.dd-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dd-check { flex-shrink: 0; color: var(--tip); visibility: hidden; }
.dd-opt.sel .dd-check { visibility: visible; }
.dd-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
/* liste « rôle + nombre » */
.pairs { display: grid; gap: 8px; margin-bottom: 10px; }
.pair-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pair-row .chip { min-width: 150px; }
.f-input.xs { width: 110px; max-width: 110px; }

/* pas de sélection du texte du site (les champs restent modifiables) */
body { -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable="true"] { -webkit-user-select: text; user-select: text; }

/* organisation comme la doc : barre latérale, lignes de modules, badges */
.side-av { width: 18px; height: 18px; border-radius: 5px; font-size: 10px; }
.dash-sub a { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 13px; }
.dash-sub a.muted { opacity: .5; }
/* État d'un module : étoile argentée = activé, petit point = désactivé, rien = pas d'interrupteur */
.state-dot { width: 5px; height: 5px; margin: 0 3px; border-radius: 50%; flex-shrink: 0; background: var(--border-strong); }
.state-dot.on { width: 11px; height: 11px; margin: 0; border-radius: 0; background: var(--silver);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.state-dot.none { background: transparent; }
.dash-row { grid-template-columns: 220px minmax(0, 1fr) auto; align-items: center; }
.dash-row a { text-decoration: none; }
.dash-row .n { font-family: var(--font); font-weight: 600; }
.dash-row .d b { color: var(--text-soft); font-weight: 600; }
.dash-row.locked { opacity: .55; }
.row-end { display: flex; align-items: center; gap: 12px; }
.badge.on-badge { color: var(--tip); border-color: color-mix(in srgb, var(--tip) 45%, transparent); background: var(--tip-bg); }
.pager .pg { font-family: var(--font); font-weight: 600; }
.tag-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-add .f-input { flex: 1; min-width: 180px; }

@media (max-width: 860px) {
  .dash-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dash-row .d { grid-column: 1 / -1; grid-row: 2; margin-top: -6px; }
  .save-bar { bottom: 12px; padding-left: 14px; }
  .save-bar span, .save-bar .btn-save kbd { display: none; }
  .save-bar .btn-ghost, .save-bar .btn-save { flex: 1; justify-content: center; }
  .guild-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-title { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* page Tickets : un bloc par panel, ses catégories de ticket, création en un clic */
.tk-list { display: grid; gap: 18px; margin: 10px 0 30px; }
.tk-panel { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); padding: 18px 20px; }
.tk-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tk-head h2 { margin: 0 6px 0 0; font-size: 18px; padding: 0; }
.tk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.tk-grid .f-row { padding: 12px 0; border: 0; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; }
.tk-panel h3 { font-size: 15px; color: var(--text-soft); margin: 20px 0 10px; }
.tk-panel .cmd-rows { margin-bottom: 12px; }
.tk-new { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.tk-new .f-input { flex: 1; min-width: 220px; max-width: none; }
.tk-empty { padding: 34px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--muted); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* accessibilité et règles d'interface (revue WCAG 2.2 / Vercel) */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
#content:focus { outline: none; }
html { scroll-padding-bottom: 110px; }
.chip.on-soft button { width: 24px; height: 24px; }
.switch { height: 24px; }
.switch::after { top: 3px; }
.filter-input:focus-visible, .dd-search:focus-visible, .search-input input:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.f-row.f-error .f-input, .f-row.f-error .dd-btn { border-color: var(--danger); }
.f-error-msg { margin: 8px 0 0; font-size: 13px; color: var(--danger); }
.dd-opt[aria-selected="true"] { font-weight: 600; }
.guild-meta, .count, .stat b, .h-count { font-variant-numeric: tabular-nums; }

/* Gestionnaire : cartes « Mes bots » */
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin: 12px 0 28px; }
.bot-card { display: flex; flex-direction: column; gap: 16px; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft); transition: border-color .15s; }
.bot-card:hover { border-color: var(--border-strong); }
.bot-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bot-av { width: 48px; height: 48px; flex: none; border-radius: 12px; object-fit: cover; font-size: 20px; }
.bot-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.bot-name { font-weight: 700; font-size: 15.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bot-sub { font-size: 12.5px; color: var(--muted); }
.bot-top .badge { flex: none; }
.bot-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.bot-stat { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); min-width: 0; }
.bot-stat.wide { grid-column: 1 / -1; }
.bot-stat dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 4px; }
.bot-stat dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.bot-stat dd small { font-weight: 400; color: var(--muted); }
.bot-stat code { font-size: 12.5px; }
.bot-bar { display: block; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--border); overflow: hidden; }
.bot-bar i { display: block; height: 100%; border-radius: 2px; background: var(--text-soft); }
.bot-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.bot-actions .btn-save, .bot-actions .btn-ghost { justify-content: center; text-align: center; text-decoration: none; }
@media (max-width: 520px) { .bot-grid { grid-template-columns: 1fr; } .bot-actions { grid-template-columns: 1fr 1fr; } }
