:root {
  --blue: #1976d2;
  --blue-light: #e3f0fb;
  --blue-dark: #0d47a1;
  --dark: #1a1a2e;
  --accent: #f5a623;
  --green: #2e7d32;
  --green-light: #e8f5e9;
  --red: #c62828;
  --red-light: #ffebee;
  --purple: #6a1b9a;
  --purple-light: #f3e5f5;
  --gray: #f5f5f5;
  --gray2: #eeeeee;
  --border: #e0e0e0;
  --text: #212121;
  --muted: #666;
  --max: 900px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: #fff; line-height: 1.65; font-size: 15px; }

/* ── NAV ── */
.wiki-nav {
  background: var(--dark);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.wiki-nav-logo { font-weight: 700; font-size: 1rem; color: #fff; text-decoration: none; }
.wiki-nav-logo span { color: var(--accent); }
.wiki-nav-sep { flex: 1; }
.wiki-nav-links { display: flex; gap: 8px; align-items: center; }
.wiki-nav-links a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .85rem; padding: 4px 10px; border-radius: 4px; transition: background .15s; }
.wiki-nav-links a:hover, .wiki-nav-links a.active { background: rgba(255,255,255,.12); color: #fff; }
.wiki-nav-app { background: var(--blue) !important; color: #fff !important; font-weight: 600 !important; }

/* ── HEADER PAGE ── */
.wiki-header {
  background: linear-gradient(135deg, var(--dark) 0%, #16213e 100%);
  color: #fff;
  padding: 48px 24px 40px;
  text-align: center;
}
.wiki-header .badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.wiki-header h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: 10px; }
.wiki-header p { font-size: 1rem; opacity: .8; max-width: 620px; margin: 0 auto; }

/* ── LAYOUT ── */
.wiki-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  gap: 32px;
}
.wiki-sidebar {
  width: 220px;
  flex-shrink: 0;
}
.wiki-sidebar-sticky {
  position: sticky;
  top: 72px;
}
.wiki-main { flex: 1; min-width: 0; }

/* ── SIDEBAR TOC ── */
.wiki-toc { background: var(--gray); border-radius: 8px; padding: 18px; }
.wiki-toc h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--blue); margin-bottom: 12px; font-weight: 700; }
.wiki-toc ul { list-style: none; padding: 0; }
.wiki-toc li { margin: 2px 0; }
.wiki-toc a { color: var(--muted); text-decoration: none; font-size: .85rem; display: block; padding: 4px 8px; border-radius: 4px; transition: all .15s; }
.wiki-toc a:hover { background: var(--blue-light); color: var(--blue); }
.wiki-toc a.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }

/* ── SECTIONS ── */
.wiki-section { margin-bottom: 56px; scroll-margin-top: 72px; }
.wiki-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  border-bottom: 2px solid var(--blue);
  padding-bottom: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wiki-section h2 .num {
  background: var(--blue);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
}
.wiki-section h3 { font-size: .95rem; font-weight: 600; margin: 20px 0 10px; color: var(--dark); }
p { margin-bottom: 12px; }

/* ── CALLOUTS ── */
.tip, .warn, .info, .note {
  padding: 13px 16px;
  border-radius: 6px;
  margin: 14px 0;
  font-size: .88rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tip  { background: var(--green-light); border-left: 4px solid var(--green); }
.warn { background: #fff8e1; border-left: 4px solid #f9a825; }
.info { background: var(--blue-light); border-left: 4px solid var(--blue); }
.note { background: var(--purple-light); border-left: 4px solid var(--purple); }
.tip::before  { content: '✓'; font-weight: 700; color: var(--green); flex-shrink: 0; }
.warn::before { content: '⚠'; flex-shrink: 0; color: #f9a825; }
.info::before { content: 'ℹ'; flex-shrink: 0; color: var(--blue); }
.note::before { content: '✦'; flex-shrink: 0; color: var(--purple); }

/* ── STEPS ── */
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  padding: 12px 14px 12px 52px;
  position: relative;
  margin-bottom: 8px;
  background: var(--gray);
  border-radius: 6px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 12px;
  width: 24px; height: 24px;
  background: var(--blue); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
}

/* ── TABLE ── */
table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 14px 0; }
th { background: var(--dark); color: #fff; text-align: left; padding: 9px 12px; font-weight: 600; }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: var(--gray); }
td strong { color: var(--blue); }

/* ── CARDS GRILLE ── */
.wiki-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.wiki-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wiki-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); }
.wiki-card .card-icon { font-size: 1.6rem; }
.wiki-card .card-title { font-weight: 700; font-size: .95rem; color: var(--dark); }
.wiki-card .card-desc { font-size: .82rem; color: var(--muted); }
.wiki-card .card-arrow { margin-top: auto; font-size: .8rem; color: var(--blue); font-weight: 600; }

/* ── FICHE DOWNLOAD ── */
.fiche-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.fiche-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--gray);
}
.fiche-item .fiche-icon { font-size: 1.4rem; flex-shrink: 0; }
.fiche-item .fiche-info { flex: 1; }
.fiche-item .fiche-title { font-weight: 600; font-size: .9rem; }
.fiche-item .fiche-desc { font-size: .8rem; color: var(--muted); }
.fiche-item .fiche-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-fiche {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 6px; font-size: .78rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: opacity .15s;
}
.btn-fiche:hover { opacity: .85; }
.btn-view { background: var(--blue-light); color: var(--blue); }
.btn-copy { background: var(--green-light); color: var(--green); }

/* ── WORKFLOW ── */
.workflow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 16px 0; font-size: .82rem; }
.wf-step { background: var(--blue); color: #fff; border-radius: 20px; padding: 4px 14px; font-weight: 600; white-space: nowrap; }
.wf-arrow { color: var(--muted); }

/* ── LANG TOGGLE ── */
.lang-toggle { display: flex; gap: 4px; margin-left: auto; }
.lang-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.6); padding: 2px 10px; border-radius: 4px;
  font-size: .78rem; cursor: pointer; font-weight: 600; transition: all .15s;
}
.lang-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── FICHE PAGE ── */
.fiche-content {
  max-width: var(--max);
  margin: 32px auto;
  padding: 0 24px 80px;
}
.fiche-toolbar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.fiche-toolbar h1 { font-size: 1.2rem; flex: 1; }
.btn-primary { background: var(--blue); color: #fff; padding: 8px 18px; border-radius: 6px; font-weight: 600; font-size: .88rem; border: none; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--gray); color: var(--text); padding: 8px 18px; border-radius: 6px; font-weight: 600; font-size: .88rem; border: 1px solid var(--border); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

.fiche-body { background: var(--gray); border-radius: 10px; padding: 28px 32px; }
.fiche-body h1 { font-size: 1.3rem; margin-bottom: 20px; color: var(--dark); }
.fiche-body h2 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 10px; color: var(--dark); border-left: 3px solid var(--blue); padding-left: 10px; }
.fiche-body h3 { font-size: .9rem; font-weight: 600; margin: 16px 0 8px; }
.fiche-body p { margin-bottom: 10px; }
.fiche-body table { background: #fff; }
.fiche-body ul, .fiche-body ol { padding-left: 20px; margin-bottom: 10px; }
.fiche-body li { margin: 4px 0; }
.fiche-body blockquote { border-left: 3px solid var(--accent); padding: 8px 14px; background: #fff; margin: 12px 0; font-style: italic; color: var(--muted); }
.fiche-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.fiche-body code { background: #e8e8e8; padding: 1px 5px; border-radius: 3px; font-size: .85em; }

.copy-success { background: var(--green-light); color: var(--green); padding: 8px 14px; border-radius: 6px; font-size: .85rem; font-weight: 600; display: none; }
.copy-success.show { display: inline-flex; align-items: center; gap: 6px; }

/* ── FOOTER ── */
footer { text-align: center; padding: 24px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .wiki-layout { flex-direction: column; padding: 20px 16px 60px; }
  .wiki-sidebar { width: 100%; }
  .wiki-sidebar-sticky { position: static; }
  .wiki-cards { grid-template-columns: 1fr 1fr; }
  .fiche-actions { flex-direction: column; }
}
