:root {
  --bg: #0b0c0e;
  --panel: #131417;
  --panel-2: #17191d;
  --elevated: #1b1e24;
  --border: #23262d;
  --border-strong: #333845;
  --text: #e8eaed;
  --muted: #8b9199;
  --faint: #5b616b;
  --accent: #5865F2;
  --accent-weak: rgba(88, 101, 242, .15);
  --green: #3fb950;
  --amber: #d6a419;
  --radius: 12px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.006em;
}
a { color: inherit; text-decoration: none; }
.icon { display: block; flex-shrink: 0; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--panel);
  border-right: 1px solid var(--border); padding: 1rem .75rem;
  display: flex; flex-direction: column; gap: .15rem;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem 1rem; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent-weak);
  color: var(--accent); display: grid; place-items: center; font-weight: 700;
  font-size: .78rem; letter-spacing: .02em; border: 1px solid rgba(90,140,255,.25);
}
.brand-name { font-weight: 650; font-size: .95rem; }
.nav-link {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem;
  border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .9rem;
  transition: background .14s ease, color .14s ease;
}
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.active { background: var(--accent-weak); color: var(--text); }
.nav-link.active .icon { color: var(--accent); }
.sidebar .spacer { flex: 1; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: .9rem .6rem .35rem; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1.5rem; border-bottom: 1px solid var(--border);
  background: rgba(11,12,14,.75); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: .95rem; font-weight: 600; margin: 0; }
.user { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.user img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); }
.badge {
  font-size: .64rem; padding: .12rem .45rem; border-radius: 5px;
  background: var(--accent-weak); color: #a9c2ff; font-weight: 700; letter-spacing: .04em;
  border: 1px solid rgba(90,140,255,.25);
}
main { padding: 1.75rem 1.5rem; max-width: 1080px; width: 100%; margin: 0 auto; animation: fadeIn .35s ease both; }
.lead { color: var(--muted); margin: 0 0 .25rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; background: var(--accent);
  color: #fff; padding: .5rem .85rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: .88rem; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: filter .14s ease, transform .14s ease, background .14s, border-color .14s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn .icon { width: 16px; height: 16px; }
.btn.secondary { background: var(--elevated); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { filter: none; border-color: var(--border-strong); background: var(--panel-2); }
.btn.small { padding: .35rem .6rem; font-size: .82rem; }

/* ---------- Cards grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: .85rem; margin-top: 1.1rem; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; display: block; position: relative;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
  animation: fadeIn .4s ease both;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); background: var(--panel-2); }
.card .ic {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent-weak);
  color: var(--accent); display: grid; place-items: center; margin-bottom: .85rem;
}
.card h3 { margin: 0 0 .3rem; font-size: .95rem; font-weight: 650; }
.card p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }
.card.soon { opacity: .5; }
.card.soon:hover { transform: none; border-color: var(--border); background: var(--panel); }
.card .tag {
  position: absolute; top: .9rem; right: .9rem; font-size: .62rem; color: var(--faint);
  border: 1px solid var(--border); padding: .08rem .4rem; border-radius: 5px; text-transform: uppercase; letter-spacing: .05em;
}
.card:nth-child(1) { animation-delay: .02s; }
.card:nth-child(2) { animation-delay: .07s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .17s; }
.card:nth-child(5) { animation-delay: .22s; }
.card:nth-child(6) { animation-delay: .27s; }

/* ---------- Panels & tables ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem 1.25rem; margin-top: 1.1rem; animation: fadeIn .35s ease both;
}
.panel h2 { margin: 0 0 .9rem; font-size: 1rem; font-weight: 650; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .55rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
th { color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
tbody tr { transition: background .14s; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }

/* ---------- Forms ---------- */
form .section { margin-bottom: 1.4rem; }
form .section h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 0 0 .8rem; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .2rem .9rem; }
.field { margin-bottom: .85rem; display: flex; flex-direction: column; gap: .3rem; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: .82rem; color: var(--muted); font-weight: 500; }
.field input, .field textarea, .field select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: .55rem .65rem; font: inherit; font-size: .9rem;
  transition: border-color .14s, box-shadow .14s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak);
}
.form-actions { display: flex; gap: .5rem; margin-top: .4rem; }

/* ---------- Divers ---------- */
.muted { color: var(--muted); }
.statut-validee { color: var(--green); font-weight: 600; }
.statut-attente { color: var(--amber); font-weight: 600; }
.breadcrumb { color: var(--faint); font-size: .82rem; margin-bottom: 1rem; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { margin: 0 .35rem; opacity: .6; }
.empty { color: var(--faint); text-align: center; padding: 2rem; font-size: .9rem; }
.toast {
  background: rgba(63,185,80,.1); border: 1px solid rgba(63,185,80,.35); color: #8be09a;
  padding: .6rem .9rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .88rem;
  animation: fadeIn .3s ease both;
}
.toast.warn { background: rgba(214,164,25,.1); border-color: rgba(214,164,25,.4); color: #e7c877; }
.note { color: var(--faint); font-size: .84rem; margin-top: 1rem; }
.doc h2 { font-size: .95rem; margin: 1.4rem 0 .6rem; }
.doc h2:first-child { margin-top: 0; }
.doc ul, .doc ol { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.doc li { margin: .3rem 0; }
.doc code, code.inline { background: var(--elevated); border: 1px solid var(--border); padding: .08rem .35rem; border-radius: 5px; font-size: .85em; }
.row-actions { display: flex; gap: .4rem; justify-content: flex-end; }
.btn-slot { padding: .55rem 0; border-top: 1px solid var(--border); }
.btn-slot:first-child { border-top: none; padding-top: 0; }
.btn.danger { background: #da373c; color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }

/* ---------- Constructeur de panneau + apercu ---------- */
.builder { display: grid; grid-template-columns: 1fr 360px; gap: 1.4rem; align-items: start; }
.builder-form { margin-top: 0; }
.preview-col { position: sticky; top: 5rem; }
.preview-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 0 0 .6rem; }
.ep-embed {
  position: relative; background: #2b2d31; border-left: 4px solid #5865F2; border-radius: 4px;
  padding: .75rem .9rem; max-width: 100%;
}
.ep-author { display: none; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; color: #f2f3f5; margin-bottom: .3rem; }
.ep-author img, .ep-footer img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.ep-title { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: .3rem; padding-right: 4.5rem; }
.ep-desc { font-size: .86rem; color: #dbdee1; white-space: pre-wrap; line-height: 1.45; }
.ep-image { display: none; max-width: 100%; border-radius: 6px; margin-top: .55rem; }
.ep-thumb { display: none; position: absolute; top: .75rem; right: .9rem; width: 68px; height: 68px; object-fit: cover; border-radius: 6px; }
.ep-footer { display: none; align-items: center; gap: .4rem; font-size: .74rem; color: #b5bac1; margin-top: .55rem; }
.ep-buttons { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.ep-btn { background: #5865F2; color: #fff; font-size: .82rem; font-weight: 600; padding: .45rem .75rem; border-radius: 6px; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } .preview-col { position: static; } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 2.5rem 2.25rem; max-width: 400px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.4); animation: fadeIn .4s ease both;
}
.login-card .logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--accent-weak);
  color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 1.1rem;
  margin: 0 auto 1.1rem; border: 1px solid rgba(90,140,255,.25);
}
.login-card h1 { margin: .2rem 0 .5rem; font-size: 1.3rem; font-weight: 650; }
.login-card p { color: var(--muted); margin: 0; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: .25rem; align-items: center; }
  .sidebar .brand { width: 100%; padding-bottom: .5rem; }
  .sidebar .spacer, .sidebar .nav-section { display: none; }
  .nav-link { flex: 1; justify-content: center; }
  .nav-link span:not(.icon) { display: none; }
}
/* ---------- Accueil : hero plein ecran ---------- */
.hero {
  position: relative; min-height: 100vh; width: 100%;
  background: #0b1020 url('/FondDecranSite.jpg') center / cover no-repeat;
  display: flex; align-items: center; color: #fff; overflow: hidden;
}
.hero-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8,12,30,.80) 0%, rgba(8,12,30,.45) 38%, rgba(8,12,30,0) 68%),
    linear-gradient(180deg, rgba(8,12,30,0) 55%, rgba(8,12,30,.45) 100%);
}
.hero-top { position: absolute; top: 1.5rem; right: 1.75rem; z-index: 3; }
.hero-badge, .hero-avatar {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  color: #fff; backdrop-filter: blur(6px);
}
.hero-badge .d-logo { width: 26px; height: 26px; }
.hero-avatar { overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.35); transition: transform .16s ease, box-shadow .16s ease; }
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-avatar:hover { transform: scale(1.06); box-shadow: 0 6px 22px rgba(0,0,0,.5); }
.hero-avatar-fallback { font-weight: 700; font-size: 1.25rem; }
.hero-content { position: relative; z-index: 2; max-width: 560px; padding: 2rem clamp(1.5rem, 7vw, 6rem); animation: fadeIn .6s ease both; }
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; line-height: 1.05; margin: 0 0 1.3rem;
  display: inline-block; border-bottom: 4px solid #fff; padding-bottom: .3rem;
  text-shadow: 0 2px 20px rgba(0,0,0,.45);
}
.hero-text {
  font-size: clamp(1rem, 1.3vw, 1.18rem); line-height: 1.65; margin: 0 0 2rem; max-width: 460px;
  color: #eef1f8; text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.btn-discord {
  display: inline-flex; align-items: center; gap: .7rem; background: #5865F2; color: #fff;
  padding: .95rem 1.7rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .04em; border: none; cursor: pointer;
  box-shadow: 0 10px 30px rgba(88,101,242,.45);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn-discord .d-logo { width: 22px; height: 22px; }
.btn-discord:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 14px 36px rgba(88,101,242,.6); }
.btn-discord.muted { background: rgba(255,255,255,.16); box-shadow: none; backdrop-filter: blur(6px); }
.btn-discord.muted:hover { background: rgba(255,255,255,.24); }
.hero-eyebrow {
  margin: 0 0 .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #cdd6ff; text-shadow: 0 2px 10px rgba(0,0,0,.55);
}
.hero-logo { position: absolute; bottom: 1.3rem; left: 50%; transform: translateX(-50%); z-index: 2; text-align: center; }
.hero-logo img { height: 82px; width: auto; max-width: 230px; object-fit: contain; display: block; margin: 0 auto; filter: drop-shadow(0 4px 16px rgba(0,0,0,.5)); }
.hero-logo-name { margin: .4rem 0 0; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #cdd6ff; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
@media (max-width: 760px) { .hero-logo img { height: 62px; } }
@media (max-width: 760px) {
  .hero-scrim { background: linear-gradient(180deg, rgba(8,12,30,.3) 0%, rgba(8,12,30,.72) 100%); }
  .hero-content { max-width: 100%; }
}

/* ---------- Banniere de bienvenue (tableau de bord) ---------- */
.welcome-banner {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 1.4rem;
  min-height: 150px; display: flex; align-items: flex-end; border: 1px solid var(--border);
  background: #0b1020 url('/FondDecranSite.jpg') center 30% / cover no-repeat;
}
.welcome-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,13,22,.25) 0%, rgba(10,13,22,.84) 100%); }
.welcome-inner { position: relative; z-index: 1; padding: 1.2rem 1.4rem; color: #fff; }
.welcome-inner h2 { margin: 0 0 .25rem; font-size: 1.35rem; font-weight: 700; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.welcome-inner p { margin: 0; color: #d7dbe6; font-size: .88rem; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
