/*
 * Tableau de bord MedBot — feuille de style
 *
 * Reprend le design system de goodloss.fr (data/symfony/public/css/theme.css) et de
 * Good Loss Support : mêmes variables, mêmes rayons, mêmes composants (barre latérale,
 * cartes, boutons, champs, badges). Thème « goodloss » (bleu) par défaut, « oriana »
 * (pierre et ambre) pour OrianaBot. Les éléments propres au tableau de bord sont plus bas.
 */

:root,
[data-theme="goodloss"] {
    /* Fond */
    --bg-body: #1a2332;
    --bg-sidebar: #111a27;
    --bg-card: #1e2d3f;
    --bg-subtle: rgba(255, 255, 255, 0.04);
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-input: rgba(0, 0, 0, 0.2);

    /* Accent */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-subtle: rgba(59, 130, 246, 0.1);
    --accent-light: #93c5fd;
    --accent-rgb: 59, 130, 246;

    /* Texte */
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Bordures */
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);

    /* Statuts */
    --success: #4ade80;
    --success-bg: rgba(34, 197, 94, 0.15);
    --danger: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --violet: #c4b5fd;
    --violet-bg: rgba(139, 92, 246, 0.15);

    --discord: #5865f2;
    --discord-hover: #4752c4;

    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-accent: 0 4px 12px rgba(59, 130, 246, 0.3);

    --sidebar-width: 280px;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --radius-pill: 20px;
}

[data-theme="oriana"] {
    --bg-body: #292524;
    --bg-sidebar: #1c1917;
    --bg-card: #44403c;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-subtle: rgba(245, 158, 11, 0.1);
    --accent-light: #fcd34d;
    --accent-rgb: 245, 158, 11;
    --text-primary: #f5f5f4;
    --text-secondary: #e7e5e4;
    --text-muted: #d6d3d1;
    --shadow-accent: 0 4px 12px rgba(245, 158, 11, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
}

a { color: var(--accent-light); }

svg { stroke: currentColor; fill: none; stroke-width: 1.5; }

[hidden] { display: none !important; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--bg-subtle);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* ─── Barre latérale ──────────────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    box-shadow: var(--shadow);
    padding: 8px 6px 6px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 4px 0 6px 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 6px;
}
.sidebar-header a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.sidebar-header img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.sidebar-header h1 {
    color: var(--text-white);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; overflow-y: auto; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    transition: all 0.2s ease;
    font-size: 14px;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { background: var(--bg-hover); color: var(--accent); }
.sidebar-nav a.active { background: var(--accent-subtle); color: var(--accent); }

.nav-section {
    margin: 14px 0 4px;
    padding: 0 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}
.nav-guild { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.nav-guild span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-guild-icon { width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; object-fit: cover; font-size: 9px; }

.sidebar-footer { padding-top: 6px; margin-top: auto; }

/* Onglets du serveur, séparés de « Mes serveurs » */
.nav-tabs { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }

/* Sélecteur de langue du tableau de bord */
.lang-picker { display: flex; gap: 4px; margin-top: 6px; }
.lang-picker a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.lang-picker a:hover { background: var(--bg-hover); color: var(--text-white); }
/* Le trait des icônes (svg { stroke }) ne doit pas s'appliquer aux drapeaux */
.lang-picker .flag { width: 18px; height: 12px; border-radius: 2px; stroke: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15); flex-shrink: 0; }
.lang-picker a:not(.active) .flag { opacity: 0.7; }
.lang-picker a.active { background: var(--accent-subtle); color: var(--accent-light); border-color: transparent; }

.user-info { background: var(--bg-subtle); border-radius: var(--radius); padding: 8px; }
.user-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; }
.user-name { color: var(--text-white); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.user-actions form { flex: 1; display: flex; }
.user-actions a,
.user-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent-light);
    text-decoration: none;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}
.user-actions a:hover,
.user-actions button:hover { background: rgba(var(--accent-rgb), 0.25); color: var(--text-white); }
.user-actions svg { width: 14px; height: 14px; }

/* ─── Contenu ─────────────────────────────────────────────────────────────── */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 30px clamp(20px, 2.5vw, 40px);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.page-header h1 { color: var(--text-white); font-size: 24px; font-weight: 600; letter-spacing: -0.3px; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card,
.panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.panel-intro { color: var(--text-muted); margin-bottom: 18px; }
.panel h3 { color: var(--text-white); font-size: 16px; font-weight: 600; margin: 22px 0 8px; }
.panel h3:first-child { margin-top: 0; }
.panel h4 { color: var(--text-white); font-size: 14px; font-weight: 600; }
.panel hr { border: 0; border-top: 1px solid var(--border-light); margin: 24px 0; }
.muted { color: var(--text-muted); }

.hero { text-align: center; padding: 56px 24px; max-width: 640px; margin: 40px auto; }
.hero-avatar { width: 88px; height: 88px; border-radius: 50%; margin-bottom: 16px; }
.hero h1 { color: var(--text-white); font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.hero p { color: var(--text-secondary); margin-bottom: 24px; }

/* ─── Boutons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent); }
.btn svg { width: 16px; height: 16px; }
.btn--small { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-light); }
.btn--ghost:hover { background: var(--bg-hover); color: var(--text-white); box-shadow: none; }
.btn--danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.btn--danger:hover { background: var(--danger-bg); box-shadow: none; }
.btn--discord { background: var(--discord); }
.btn--discord:hover { background: var(--discord-hover); box-shadow: 0 4px 12px rgba(88, 101, 242, 0.35); }

/* ─── Badges et statuts ───────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.badge-accent { background: var(--accent-subtle); color: var(--accent-light); }
.badge-beta { background: var(--warning-bg); color: var(--warning); font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }

.status { font-size: 13px; font-weight: 500; white-space: nowrap; }
.status--on { color: var(--success); }
.status--on::before { content: "● "; }

.state { margin: 0 0 10px; font-size: 14px; color: var(--text-secondary); }
.state::before { content: "● "; }
.state--on::before { color: var(--success); }
.state--off::before { color: var(--text-muted); }

.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; border-radius: var(--radius-pill); padding: 1px 8px; }
.tag--required { background: var(--danger-bg); color: var(--danger); }
.tag--recommended { background: var(--warning-bg); color: var(--warning); }
.tag--done { background: var(--success-bg); color: var(--success); }

/* ─── Messages (toasts) ───────────────────────────────────────────────────── */

.flash { padding: 12px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.flash--success { background: var(--success-bg); color: var(--success); }
.flash--error { background: var(--danger-bg); color: var(--danger); }

/* ─── Formulaires ─────────────────────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; margin: 12px 0; }
.form--inline { display: inline-flex; margin: 0; }
.form--compact { margin: 4px 0 0; width: 100%; }
/* Dans un formulaire en colonne, les champs gardent leur hauteur naturelle (flex-basis = hauteur en colonne) */
.form > .field, .form > .embed-fields,
.form > .readonly > .field, .form > .readonly > .embed-fields { flex: none; }
.form > .btn, .form > .readonly > .btn { align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: 16px; width: 100%; }
.row--end { align-items: flex-end; }

.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 240px; min-width: 0; width: 100%; }
.field--small { flex: 0 1 170px; }
.field > span,
.field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-muted);
}

input[type="text"], input:not([type]), input[type="search"], input[type="number"], input[type="time"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
select option, select optgroup { background: var(--bg-card); color: var(--text-primary); }
input[type="time"] { color-scheme: dark; }
input[type="color"] {
    width: 100%;
    height: 42px;
    padding: 3px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    cursor: pointer;
}

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }
.hint { font-size: 12px; color: var(--text-muted); }

/* ─── Listes, sous-cartes ─────────────────────────────────────────────────── */

.list { list-style: none; margin: 8px 0 14px; display: flex; flex-direction: column; gap: 8px; }
.item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}
.item:hover { border-left-color: var(--accent); }
.item-main { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }

.subpanel { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; background: var(--bg-subtle); }
.subpanel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
details.subpanel summary { cursor: pointer; color: var(--text-primary); }
details.subpanel[open] summary { margin-bottom: 8px; }

.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; width: 100%; }
.rank { display: flex; align-items: center; gap: 10px; }
.rank-name { flex: 0 0 86px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* ─── Liste des serveurs ──────────────────────────────────────────────────── */

.toolbar { display: flex; gap: 10px; margin-bottom: 24px; }
.search { position: relative; display: flex; align-items: center; flex: 1; max-width: 480px; }
.search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search input { padding-left: 36px; }

.section { margin-bottom: 30px; }
.section h2 { color: var(--text-white); font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.section-hint { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
details.section summary { cursor: pointer; list-style: none; }
details.section summary::-webkit-details-marker { display: none; }
details.section summary::before { content: "▸ "; color: var(--text-muted); }
details[open].section summary::before { content: "▾ "; }

.count { font-size: 12px; font-weight: 600; color: var(--accent-light); background: var(--accent-subtle); border-radius: var(--radius-pill); padding: 1px 9px; }

.grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }

.server {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    border-radius: var(--radius-lg);
    min-width: 0;
    flex-wrap: wrap;
    transition: border-color 0.2s ease, transform 0.15s ease;
}
/* Mise en place sous l'en-tête de la carte, sur toute sa largeur : les libellés ne sont jamais tronqués */
.server-setup { flex: 1 0 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.server-setup .setup-meter { max-width: none; margin-top: 0; }
.server:hover { border-color: var(--border-light); border-left-color: var(--accent); transform: translateY(-1px); }
.server-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.server-title { color: var(--text-white); font-weight: 500; font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.guild-icon { width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; object-fit: cover; }
.guild-icon--text {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-sidebar) 0%, var(--accent-subtle) 100%);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
}

/* Mini barre de mise en place sur les cartes de serveurs */
/* « Mise en place     3/4 » puis la barre sur toute la largeur de la carte */
/* Une ligne par groupe : libellé, barre, score (colonnes alignées entre les deux lignes) */
.setup-meter { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 4px; width: 100%; max-width: 260px; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.setup-meter-row { display: contents; }
.setup-meter-label { white-space: nowrap; }
.setup-meter-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.setup-meter progress {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    overflow: hidden;
}
.setup-meter progress::-webkit-progress-bar { background: var(--bg-input); border-radius: var(--radius-pill); }
.setup-meter progress::-webkit-progress-value { background: var(--meter, var(--accent)); border-radius: var(--radius-pill); }
.setup-meter progress::-moz-progress-bar { background: var(--meter, var(--accent)); border-radius: var(--radius-pill); }
.setup-meter--complete { --meter: var(--success); }
.setup-meter--complete .setup-meter-count { color: var(--success); }
.setup-meter--partial { --meter: var(--accent); }
.setup-meter--partial .setup-meter-count { color: var(--accent-light); }
.setup-meter--todo { --meter: var(--warning); }
.setup-meter--todo .setup-meter-count { color: var(--warning); }

/* ─── Onglet Général : mise en place ──────────────────────────────────────── */

.setup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.setup-count { font-weight: 700; color: var(--accent-light); }
.setup-progress {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    overflow: hidden;
    margin: 10px 0 6px;
}
.setup-progress::-webkit-progress-bar { background: var(--bg-input); border-radius: var(--radius-pill); }
.setup-progress::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-pill); transition: width 0.3s; }
.setup-progress::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-pill); }
.setup-summary { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }
/* Onglet Général : une barre par groupe d'étapes (obligatoires en orange tant qu'incomplètes, recommandées en bleu) */
.setup-group { margin-bottom: 22px; }
.setup-group .setup-head { margin-bottom: 8px; }
.setup-group .setup-head h4 { margin: 0; }
.setup-group .setup-head .tag { font-size: 12px; padding: 2px 10px; }
.setup-group .setup-progress { margin-bottom: 14px; }
.setup-group--required .setup-count { color: var(--warning); }
.setup-group--required .setup-progress::-webkit-progress-value { background: var(--warning); }
.setup-group--required .setup-progress::-moz-progress-bar { background: var(--warning); }
.setup-group--complete .setup-count { color: var(--success); }
.setup-group--complete .setup-progress::-webkit-progress-value { background: var(--success); }
.setup-group--complete .setup-progress::-moz-progress-bar { background: var(--success); }

.steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); }
.step--todo { border-color: rgba(var(--accent-rgb), 0.45); }
.step-icon {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    background: var(--accent-subtle);
    color: var(--accent-light);
}
.step--done .step-icon { background: var(--success-bg); color: var(--success); }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.step-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.step-head strong { color: var(--text-white); }
.step-text { font-size: 13px; color: var(--text-muted); }
.step--done .step-text { color: var(--text-secondary); }

.suggestions { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.suggestion { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-subtle); transition: border-color 0.2s ease; }
.suggestion:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.suggestion-emoji { font-size: 22px; line-height: 1; }
.suggestion-body strong { color: var(--text-white); }
.suggestion-body p { margin: 4px 0 8px; font-size: 13px; color: var(--text-muted); }
.suggestion-body a { font-size: 13px; font-weight: 600; text-decoration: none; }

/* ─── Embed maker ─────────────────────────────────────────────────────────── */

.editing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--accent-subtle);
    color: var(--accent-light);
}
.banner-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.embed-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 560px); gap: 24px; align-items: start; }
.embed-editor .form { margin-top: 0; }
.embed-fields { border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px 14px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.embed-fields legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; color: var(--text-muted); padding: 0 4px; }
.embed-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: start; }
.embed-field-row textarea { min-height: 42px; }

.embed-preview-wrap { position: sticky; top: 20px; }
.embed-preview {
    position: relative;
    background: #2b2d31;
    color: #dbdee1;
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 12px 16px 14px 12px;
    font-size: 14px;
    line-height: 1.375;
    min-height: 60px;
    overflow-wrap: anywhere;
}
.embed-preview a { color: #00a8fc; text-decoration: none; }
.embed-preview code { background: #1e1f22; }
.ep-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; padding-right: 88px; }
.ep-author img { width: 24px; height: 24px; border-radius: 50%; }
.ep-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; padding-right: 88px; color: #f2f3f5; }
.ep-description { margin-bottom: 6px; padding-right: 88px; }
.ep-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0; padding-right: 88px; }
.ep-field { flex: 1 1 100%; }
.ep-field--inline { flex: 1 1 28%; }
.ep-field-name { font-weight: 700; color: #f2f3f5; margin-bottom: 2px; }
.ep-image { display: block; max-width: 100%; max-height: 300px; border-radius: 4px; margin-top: 8px; }
.ep-thumbnail { position: absolute; top: 12px; right: 12px; width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.ep-emoji { width: 22px; height: 22px; object-fit: contain; vertical-align: -5px; }
.ep-title .ep-emoji { width: 20px; height: 20px; }

/* Palette des émojis du serveur */
.emoji-palette { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; background: var(--bg-subtle); }
.emoji-palette summary { cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; max-height: 180px; overflow-y: auto; margin: 10px 0 6px; }
.emoji-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.emoji-btn:hover { background: var(--bg-hover); border-color: var(--border-light); }
.emoji-btn img { width: 26px; height: 26px; object-fit: contain; }
.ep-footer { font-size: 12px; color: #b5bac1; margin-top: 8px; }

/* ─── Back office ────────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; display: flex; flex-direction: column; }
.stat strong { color: var(--text-white); font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--text-muted); font-size: 13px; }

.grid--wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.server-meta { color: var(--text-muted); font-size: 12px; }
.server-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; opacity: 0.8; }
.module-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.module-list .badge { font-size: 11px; padding: 1px 8px; }

/* Configuration d'un serveur en consultation seule */
.readonly-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    background: var(--warning-bg);
    color: var(--warning);
    font-size: 13px;
}
.readonly-banner svg { width: 20px; height: 20px; flex-shrink: 0; }
.readonly-banner span { flex: 1; }
.readonly-banner strong { color: var(--warning); }
fieldset.readonly { border: 0; margin: 0; padding: 0; min-width: 0; display: contents; }
fieldset.readonly:disabled .btn,
fieldset.readonly:disabled input,
fieldset.readonly:disabled select,
fieldset.readonly:disabled textarea { opacity: 0.55; cursor: not-allowed; }
fieldset.readonly:disabled .btn:hover { box-shadow: none; }

/* ─── Page Fonctionnalités ────────────────────────────────────────────────── */

.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn--large { padding: 12px 22px; font-size: 15px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent-light); margin-bottom: 10px; }

.tone-danger { --tone: var(--danger); --tone-bg: var(--danger-bg); }
.tone-violet { --tone: var(--violet); --tone-bg: var(--violet-bg); }
.tone-accent { --tone: var(--accent-light); --tone-bg: var(--accent-subtle); }
.tone-success { --tone: var(--success); --tone-bg: var(--success-bg); }
.tone-warning { --tone: var(--warning); --tone-bg: var(--warning-bg); }

.fx-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
    padding: 40px;
    margin-bottom: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background:
        radial-gradient(ellipse at 85% 10%, rgba(var(--accent-rgb), 0.22), transparent 55%),
        radial-gradient(ellipse at 0% 100%, rgba(139, 92, 246, 0.14), transparent 50%),
        var(--bg-card);
}
.fx-hero h1 { color: var(--text-white); font-size: clamp(26px, 3.2vw, 40px); line-height: 1.15; letter-spacing: -0.6px; font-weight: 700; margin-bottom: 14px; }
.fx-lead { color: var(--text-secondary); font-size: 16px; margin-bottom: 24px; max-width: 60ch; }
.fx-hero .cta { justify-content: flex-start; }
.fx-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 26px; color: var(--text-muted); font-size: 13px; }
.fx-facts strong { color: var(--text-white); font-size: 15px; margin-right: 4px; }

/* Aperçu de messages Discord */
.hero-preview {
    background: #313338;
    border-radius: var(--radius-lg);
    padding: 12px 16px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    color: #dbdee1;
    font-size: 14px;
    line-height: 1.375;
    transform: rotate(0.6deg);
}
.dm-channel { color: #949ba4; font-size: 12px; font-weight: 600; margin: 6px 0 8px; }
.dm-channel ~ .dm-channel { margin-top: 16px; padding-top: 12px; border-top: 1px solid #3f4147; }
.dm { display: flex; gap: 12px; }
.dm-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.dm-body { min-width: 0; flex: 1; }
.dm-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dm-name { color: #f2f3f5; font-weight: 600; }
.dm-tag { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; border-radius: 3px; padding: 0 4px; line-height: 15px; }
.dm-time { color: #949ba4; font-size: 12px; }
.dm-embed { background: #2b2d31; border-left: 4px solid #00a3b5; border-radius: 4px; padding: 10px 14px 12px 12px; }
.dm-embed--twitch { border-left-color: #9146ff; }
.dm-embed--danger { border-left-color: #e74c3c; }
.dm-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #f2f3f5; margin-bottom: 4px; }
.dm-dot { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #f472b6, #8b5cf6); }
.dm-title { color: #00a8fc; font-weight: 700; margin-bottom: 4px; }
.dm-text strong { color: #f2f3f5; }
.dm-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dm-field { margin-top: 6px; font-size: 13px; }
.dm-field span { display: block; color: #f2f3f5; font-weight: 700; }
.dm-stream {
    position: relative;
    height: 110px;
    margin-top: 10px;
    border-radius: 4px;
    background:
        radial-gradient(circle at 30% 40%, rgba(244, 114, 182, 0.55), transparent 45%),
        radial-gradient(circle at 75% 65%, rgba(59, 130, 246, 0.55), transparent 50%),
        linear-gradient(135deg, #1e1b4b, #312e81);
}
.dm-live { position: absolute; top: 8px; left: 8px; background: #e91916; color: #fff; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 6px; letter-spacing: 0.4px; }
.dm-button { display: inline-block; margin-top: 10px; background: #4e5058; color: #fff; font-size: 13px; font-weight: 500; border-radius: 4px; padding: 5px 14px; }

/* Raccourcis vers les familles */
.fx-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.fx-jump a {
    text-decoration: none;
    color: var(--tone);
    background: var(--tone-bg);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    transition: transform 0.2s ease;
}
.fx-jump a:hover { transform: translateY(-1px); }

.fx-group { margin-bottom: 36px; scroll-margin-top: 20px; }
.fx-group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 14px; padding-left: 12px; border-left: 3px solid var(--tone); }
.fx-group-head h2 { color: var(--text-white); font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.fx-group-head p { color: var(--text-muted); }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.feature {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: var(--tone); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.feature-icon { width: 44px; height: 44px; border-radius: var(--radius); background: var(--tone-bg); color: var(--tone); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 { color: var(--text-white); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature p { color: var(--text-secondary); }
.feature-points { list-style: none; margin-top: 12px; display: grid; gap: 4px; color: var(--text-muted); font-size: 13px; }
.feature-points li::before { content: "✓"; color: var(--tone); font-weight: 700; margin-right: 8px; }
.feature-commands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.feature-commands code { color: var(--text-secondary); background: var(--bg-input); }

.fx-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 32px; }
.fx-setup h2, .fx-final h2 { color: var(--text-white); font-size: 22px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 8px; }
.fx-setup p { color: var(--text-secondary); }
.fx-steps { list-style: none; display: grid; gap: 12px; }
.fx-steps li { display: flex; gap: 12px; align-items: flex-start; }
.fx-step-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-subtle); color: var(--accent-light); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.fx-steps strong { color: var(--text-white); margin-right: 4px; }

.fx-final { text-align: center; padding: 44px 24px; }
.fx-final p { color: var(--text-secondary); max-width: 60ch; margin: 0 auto 22px; }
.fx-final .fx-help { color: var(--text-muted); font-size: 13px; margin: 18px auto 0; }

.hero .cta { margin-top: 4px; }

/* ─── Mobile ──────────────────────────────────────────────────────────────── */

.menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 998;
    background: var(--bg-sidebar);
    color: var(--text-white);
    border: none;
    padding: 10px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; }
.overlay.active { display: block; }

@media (max-width: 1100px) {
    .fx-hero { grid-template-columns: 1fr; }
    .hero-preview { max-width: 560px; }
    .embed-editor { grid-template-columns: minmax(0, 1fr); }
    .embed-preview-wrap { position: static; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 64px 14px 24px; }
    .menu-toggle { display: block; }
    .page-header { flex-direction: column; }
    .card, .panel { padding: 18px; }
    .steps { grid-template-columns: 1fr; }
    .embed-field-row { grid-template-columns: 1fr; }
    .search { max-width: none; }
    .grid--wide { grid-template-columns: 1fr; }
    .readonly-banner { flex-wrap: wrap; }
    .fx-hero, .fx-setup { grid-template-columns: 1fr; padding: 22px; gap: 26px; }
    .hero-preview { transform: none; }
}
