:root { color-scheme: dark; }
html, body { height: 100%; }
body { font-family: 'Montserrat', system-ui, sans-serif; background: #161b24; }

/* Custom thin scrollbars */
.scroll-thin::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.07);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.scroll-thin::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); background-clip: padding-box; border: 2px solid transparent; }

/* Mobione gradient utilities */
.mob-gradient { background: linear-gradient(135deg, #00B589 0%, #C5D92D 100%); }
.mob-gradient-text {
  background: linear-gradient(110deg, #00B589 0%, #C5D92D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mob-gradient-soft {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(0,181,137,0.18) 0%, transparent 55%),
    radial-gradient(120% 100% at 100% 100%, rgba(197,217,45,0.12) 0%, transparent 55%);
}
.mob-gradient-border {
  position: relative;
}
.mob-gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,181,137,0.55), rgba(197,217,45,0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* View transitions */
.view { animation: fadein 220ms ease both; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Sidebar item base */
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: rgba(255,255,255,0.62);
  font-size: 13.5px; font-weight: 500;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
  position: relative;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.04); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0,181,137,0.16) 0%, rgba(197,217,45,0.05) 100%);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, #00B589, #C5D92D);
}
.nav-item.disabled {
  color: rgba(255,255,255,0.22);
  cursor: not-allowed;
}
.nav-item.disabled:hover { background: transparent; color: rgba(255,255,255,0.32); }
.nav-item .nav-icon { flex-shrink: 0; }

/* Tooltip "Bientôt" */
.tip { position: relative; }
.tip[data-tip]::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #2a3242; color: #f5f7fa; font-size: 11px;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 140ms ease;
  border: 1px solid rgba(255,255,255,0.08);
  z-index: 50;
}
.tip:hover[data-tip]::after { opacity: 1; }

/* Suggestion chips */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.75);
  font-size: 12.5px; font-weight: 500;
  transition: all 160ms ease;
  cursor: pointer;
}
.chip:hover {
  background: rgba(0,181,137,0.10);
  border-color: rgba(0,181,137,0.35);
  color: #fff;
}

/* Source chip (under Mob'IA message) */
.src-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(0,181,137,0.10);
  border: 1px solid rgba(0,181,137,0.28);
  color: #5ddbac;
  font-size: 11.5px; font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  transition: all 140ms ease;
  cursor: pointer;
}
.src-chip:hover {
  background: rgba(0,181,137,0.22);
  color: #fff;
}
.src-chip.active {
  background: linear-gradient(90deg, rgba(0,181,137,0.32), rgba(197,217,45,0.16));
  border-color: rgba(0,181,137,0.7);
  color: #fff;
}

/* Wikilink (Wikipedia-style internal link) */
.wikilink {
  color: #7ec1ff;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dotted rgba(126,193,255,0.4);
  transition: color 120ms ease, border-color 120ms ease;
}
.wikilink:hover {
  color: #a5d6ff;
  border-bottom-color: rgba(126,193,255,0.8);
}

/* Reference superscript (Wikipedia-style) */
.refnum {
  color: #7ec1ff;
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
  padding: 0 1px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
}
.refnum:hover { color: #a5d6ff; }

/* Activity timeline marker */
.timeline-dot::before {
  content: '';
  position: absolute;
  left: 19px; top: 30px;
  width: 1px; bottom: -16px;
  background: rgba(255,255,255,0.08);
}
.timeline-row:last-child .timeline-dot::before { display: none; }

/* Subtle hover lift for cards */
.lift { transition: transform 180ms ease, border-color 180ms ease; }
.lift:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.14); }

/* Wiki tree caret */
.tree-toggle { transition: transform 160ms ease; }
.tree-toggle.open { transform: rotate(90deg); }

/* Selection */
::selection { background: rgba(197,217,45,0.32); color: #fff; }

/* Pulse dot */
.pulse-dot { position: relative; }
.pulse-dot::after {
  content: ''; position: absolute; inset: -3px; border-radius: 999px;
  background: rgba(0,181,137,0.5);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

/* Hide native scrollbar on horizontal chip rows but keep functionality */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

/* Curseur clignotant pour l'effet typewriter des Tips MobiOS (bandeau en haut) */
.tip-caret {
  display: inline-block;
  margin-left: 1px;
  font-weight: 700;
  animation: blink-caret 1s steps(2, end) infinite;
}
@keyframes blink-caret {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Boutons natifs désactivés : pas de hover, curseur "interdit", légère opacité.
   Marche pour les <button disabled> qu'on a ajoutés (cloche, roue, "Nouveau fil"). */
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
button:disabled:hover {
  background: transparent !important;
}

/* ==========================================================================
   CHAT Mob'IA — look 2026
   ==========================================================================
   Les anciennes bulles utilisaient un mix de classes Tailwind inline. Ici on
   pose les vrais styles sur des classes nommées (.mobios-...) pour avoir un
   chat propre, aéré, soigné. Identité visuelle conservée : sombre + accents
   teal/lime de MobiOS.
   ========================================================================== */

/* Apparition douce des nouveaux messages */
@keyframes mobios-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.mobios-fade-in { animation: mobios-fade-in 240ms cubic-bezier(.2,.7,.3,1) both; }

/* Rangée de message (la flexbox extérieure) */
.mobios-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 28px;
}
.mobios-row-user  { justify-content: flex-end; }
.mobios-row-mobia { justify-content: flex-start; }

/* Avatar Mob'IA (carré gradient avec étoile) */
.mobios-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00B589 0%, #C5D92D 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px -6px rgba(0,181,137,0.55), inset 0 1px 0 rgba(255,255,255,0.12);
}

/* Avatar utilisateur (initiales) */
.mobios-user-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3C4555 0%, #2a3242 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Colonne (avatar + bulle + statut) côté Mob'IA */
.mobios-bubble-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 760px;
}

/* Ligne meta (nom + heure) au-dessus de la bulle Mob'IA */
.mobios-meta {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.mobios-name {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800; font-style: italic; color: #fff;
}
.mobios-time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: rgba(255,255,255,0.4);
}

/* Bulle de base */
.mobios-bubble {
  border-radius: 16px;
  padding: 14px 18px;
  line-height: 1.65;
  font-size: 14px;
  color: rgba(255,255,255,0.92);
  transition: border-color 200ms ease;
}

/* Bulle utilisateur (à droite) */
.mobios-bubble-user {
  background: linear-gradient(180deg, rgba(60,69,85,0.55) 0%, rgba(42,50,66,0.55) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-top-right-radius: 6px;
  max-width: 640px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 18px -8px rgba(0,0,0,0.45);
}
.mobios-bubble-user p { margin: 0; color: #fff; }

/* Bulle Mob'IA (à gauche), avec un liseré gradient subtil */
.mobios-bubble-mobia {
  position: relative;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(0,181,137,0.08) 0%, transparent 55%),
    rgba(31,37,50,0.62);
  border: 1px solid rgba(255,255,255,0.07);
  border-top-left-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 6px 22px -10px rgba(0,0,0,0.5);
}
.mobios-bubble-mobia::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,181,137,0.45), rgba(197,217,45,0.32) 60%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* Erreur backend → liseré chaud + texte ambre */
.mobios-bubble-error {
  background: rgba(240,179,65,0.06) !important;
  border-color: rgba(240,179,65,0.32) !important;
}
.mobios-bubble-error::before { display: none; }
.mobios-bubble-error .mobios-content p { color: #f0b341 !important; }

/* ---------------- Indicateur de chargement (spinner CLI + verbe) ---------- */
.mobios-loading {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.72);
  font-size: 13.5px;
}
.mobios-spinner {
  display: inline-block;
  width: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 16px;
  color: #00B589;
  text-align: center;
  line-height: 1;
}
.mobios-loading-verb {
  font-style: italic;
  color: rgba(255,255,255,0.7);
}
@keyframes mobios-verb-fade {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}
.mobios-loading-verb.verb-fade { animation: mobios-verb-fade 220ms ease both; }

/* ---------------- Contenu rendu (markdown) ---------------- */
.mobios-content { min-width: 0; }
.mobios-content p { margin: 0 0 10px; }
.mobios-content p:last-child { margin-bottom: 0; }
.mobios-content h1,
.mobios-content h2,
.mobios-content h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800; color: #fff;
  margin: 14px 0 8px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.mobios-content h1 { font-size: 19px; }
.mobios-content h2 { font-size: 16.5px; }
.mobios-content h3 { font-size: 14.5px; color: rgba(255,255,255,0.92); }
.mobios-content h1:first-child,
.mobios-content h2:first-child,
.mobios-content h3:first-child { margin-top: 0; }
.mobios-content strong { color: #fff; font-weight: 700; }
.mobios-content em     { color: rgba(255,255,255,0.85); }
.mobios-content ul,
.mobios-content ol {
  margin: 6px 0 12px;
  padding-left: 22px;
}
.mobios-content li { margin: 4px 0; }
.mobios-content ul li::marker { color: #5ddbac; }
.mobios-content ol li::marker { color: rgba(255,255,255,0.55); font-family: 'JetBrains Mono', monospace; }
.mobios-content code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 5px;
  color: #e3ecf5;
}
.mobios-content pre {
  margin: 10px 0;
  padding: 12px 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow-x: auto;
}
.mobios-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  color: #e3ecf5;
}
.mobios-content blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 2px solid rgba(0,181,137,0.45);
  color: rgba(255,255,255,0.75);
  background: rgba(0,181,137,0.05);
  border-radius: 0 6px 6px 0;
}
.mobios-content a {
  color: #7ec1ff;
  text-decoration: underline;
  text-decoration-color: rgba(126,193,255,0.4);
  text-underline-offset: 2px;
}

/* ---------------- Chip de citation ---------------- */
.cite-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 1px;
  padding: 1px 8px 1px 7px;
  border-radius: 6px;
  background: rgba(0,181,137,0.12);
  border: 1px solid rgba(0,181,137,0.32);
  color: #5ddbac;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.7;
  vertical-align: baseline;
  white-space: nowrap;
  user-select: text;
}
.cite-chip svg { flex-shrink: 0; opacity: 0.85; }

/* ---------------- Footer de statut sous la bulle Mob'IA ---------------- */
.mobios-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.42);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  flex-wrap: wrap;
}
.mobios-status-left {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.55);
}
.mobios-status-left svg { color: #5ddbac; }
.mobios-status-right {
  margin-left: auto;
  color: rgba(255,255,255,0.32);
  display: inline-flex; align-items: center; gap: 6px;
}
.mobios-status-right code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
}
.mobios-bientot {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.45);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
}
.mobios-sep { color: rgba(255,255,255,0.22); }

/* ==========================================================================
   === RENVOIS === Formulaire de saisie du module Renvois Fournisseurs
   ==========================================================================
   Styles isolés au formulaire de la vue #view-renvois. Réutilise les tokens
   MobiOS (surface, border, emerald, mob-gradient) pour rester cohérent.
   ========================================================================== */
.renvois-form { display: flex; flex-direction: column; gap: 22px; }

.renvois-section { display: flex; flex-direction: column; gap: 10px; }
.renvois-section + .renvois-section {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.renvois-section-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.renvois-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
@media (max-width: 640px) {
  .renvois-grid { grid-template-columns: 1fr; }
}
.renvois-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.renvois-field-wide { grid-column: 1 / -1; }

.renvois-label {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.02em;
}
.renvois-hint {
  font-weight: 400;
  font-size: 10.5px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  margin-left: 4px;
}

.renvois-form input[type="text"],
.renvois-form input[type="number"],
.renvois-form input[type="date"],
.renvois-form select,
.renvois-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f5f7fa;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 8px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.renvois-form textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.renvois-form select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-opacity='0.55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.renvois-form select option { background: #1f2532; color: #f5f7fa; }
.renvois-form input::placeholder,
.renvois-form textarea::placeholder { color: rgba(255,255,255,0.32); }
.renvois-form input:focus,
.renvois-form select:focus,
.renvois-form textarea:focus {
  border-color: rgba(0,181,137,0.55);
  background: rgba(0,181,137,0.05);
  box-shadow: 0 0 0 3px rgba(0,181,137,0.14);
}
.renvois-form input:invalid:not(:placeholder-shown) {
  border-color: rgba(240,179,65,0.45);
}

/* Toggle oui/non (radios stylés) */
.renvois-toggle-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.renvois-toggle-group legend { padding: 0; margin: 0 0 6px; }
.renvois-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
  width: fit-content;
}
.renvois-toggle label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  user-select: none;
}
.renvois-toggle input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.35);
  display: inline-block;
  position: relative;
  margin: 0;
}
.renvois-toggle input[type="radio"]:checked {
  border-color: #00B589;
  background: radial-gradient(circle, #00B589 0 40%, transparent 45%);
}
.renvois-toggle label:has(input:checked) {
  background: rgba(0,181,137,0.14);
  color: #fff;
}

/* Actions (boutons en bas) */
.renvois-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.renvois-btn-secondary {
  font-size: 12px; font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.renvois-btn-secondary:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.22);
}
.renvois-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  color: #161b24;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease;
  box-shadow: 0 8px 24px -12px rgba(0,181,137,0.45);
}
.renvois-btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.renvois-btn-primary:disabled { opacity: 0.55; cursor: progress; transform: none; }

/* Feedback (succès / erreur) — sticky en haut de la vue, donc toujours
   visible même après un scroll en bas du formulaire. */
.renvois-feedback {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  margin-bottom: 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: renvois-feedback-in 220ms ease both;
}
@keyframes renvois-feedback-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.renvois-feedback-msg { flex: 1; min-width: 0; }
.renvois-feedback-close {
  background: transparent; border: 0; color: inherit;
  font-size: 18px; line-height: 1; padding: 0 4px;
  cursor: pointer; opacity: 0.6;
}
.renvois-feedback-close:hover { opacity: 1; }
.renvois-feedback-success {
  background: rgba(0,181,137,0.16);
  border-color: rgba(0,181,137,0.45);
  color: #5ddbac;
}
.renvois-feedback-error {
  background: rgba(240,179,65,0.14);
  border-color: rgba(240,179,65,0.45);
  color: #f0b341;
}

/* ==========================================================================
   === RENVOIS === Suivi : pipeline + cartes + urgence + frise détail
   ========================================================================== */

/* ---------- Lien "← Retour au suivi" ---------- */
.renvois-back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0;
  color: rgba(255,255,255,0.55);
  font-size: 12px; font-weight: 500;
  padding: 4px 8px; border-radius: 6px;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}
.renvois-back-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.04);
}

/* ---------- Pipeline ---------- */
.renvois-pipeline {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}
.renvois-pipe-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.65);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}
.renvois-pipe-chip:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.renvois-pipe-chip.is-active {
  background: rgba(0,181,137,0.16);
  border-color: rgba(0,181,137,0.4);
  color: #fff;
}
.renvois-pipe-chip.renvois-pipe-all { font-weight: 700; }
.renvois-pipe-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
}
.renvois-pipe-chip.is-active .renvois-pipe-count {
  background: rgba(0,181,137,0.36);
  color: #fff;
}
.renvois-pipe-sep {
  display: inline-block;
  width: 1px; height: 18px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
}

/* ---------- Liste de cartes ---------- */
.renvois-cards { display: flex; flex-direction: column; gap: 10px; }
.renvois-cards-loading,
.renvois-cards-error,
.renvois-empty {
  padding: 28px;
  text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 12px;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
}
.renvois-cards-error { color: #f0b341; border-color: rgba(240,179,65,0.45); }

.renvois-card {
  position: relative;
  display: flex; align-items: stretch; gap: 0;
  padding: 0;
  background: rgba(31,37,50,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-left-width: 4px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}
.renvois-card:hover {
  background: rgba(31,37,50,0.75);
}
.renvois-card-body { flex: 1; min-width: 0; padding: 14px 18px; }
.renvois-card-actions {
  display: flex; align-items: center;
  padding: 0 16px;
  background: rgba(0,0,0,0.10);
  border-left: 1px solid rgba(255,255,255,0.05);
}
.renvois-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  margin-bottom: 4px;
}
.renvois-card-title {
  display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  min-width: 0;
}
.renvois-card-modele {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 800; color: #fff; font-size: 15px;
}
.renvois-card-sep { color: rgba(255,255,255,0.25); }
.renvois-card-marque { color: rgba(255,255,255,0.55); font-size: 13px; }
.renvois-card-panne {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255,255,255,0.65);
}
.renvois-card-meta {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.renvois-meta-pill {
  font-size: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.07);
}
.renvois-meta-fournisseur {
  background: rgba(126,193,255,0.10);
  color: #a5d6ff;
  border-color: rgba(126,193,255,0.25);
}
.renvois-meta-jours {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.renvois-card-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  border-radius: 7px;
  background: rgba(0,181,137,0.10);
  border: 1px solid rgba(0,181,137,0.35);
  color: #5ddbac;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}
.renvois-card-action:hover {
  background: rgba(0,181,137,0.22);
  color: #fff;
}

/* ---------- Badges de statut ---------- */
.renvois-statut {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.10);
}
.renvois-statut-entree_boite       { background: rgba(126,193,255,0.10); color: #a5d6ff; border-color: rgba(126,193,255,0.30); }
.renvois-statut-a_verifier_atelier { background: rgba(240,179,65,0.12);  color: #f0b341; border-color: rgba(240,179,65,0.34); }
.renvois-statut-valide_envoi       { background: rgba(197,217,45,0.10);  color: #d4ec46; border-color: rgba(197,217,45,0.30); }
.renvois-statut-attente_rma        { background: rgba(240,179,65,0.10);  color: #f0b341; border-color: rgba(240,179,65,0.30); }
.renvois-statut-envoye             { background: rgba(0,181,137,0.14);   color: #5ddbac; border-color: rgba(0,181,137,0.34); }
.renvois-statut-attente_retour     { background: rgba(0,181,137,0.08);   color: #5ddbac; border-color: rgba(0,181,137,0.25); }
.renvois-statut-solde              { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.10); }
.renvois-statut-refuse             { background: rgba(239,68,68,0.10);   color: #fca5a5; border-color: rgba(239,68,68,0.34); }

/* ---------- Codage couleur de l'urgence (liseré gauche + texte des jours) ---------- */
.renvois-urg-green  { border-left-color: #00B589; }
.renvois-urg-orange { border-left-color: #f0b341; }
.renvois-urg-red    { border-left-color: #ef4444; }
.renvois-urg-gray   { border-left-color: rgba(255,255,255,0.18); }

.renvois-urg-green-fg  { color: #5ddbac; }
.renvois-urg-orange-fg { color: #f0b341; }
.renvois-urg-red-fg    { color: #fca5a5; }
.renvois-urg-gray-fg   { color: rgba(255,255,255,0.45); }

/* ---------- Fiche détail ---------- */
.renvois-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .renvois-detail-grid { grid-template-columns: 1fr; }
}
.renvois-detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.renvois-detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.renvois-detail-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 18px 20px;
  background: rgba(31,37,50,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
}
.renvois-detail-statutbox {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.renvois-detail-jours {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
}

.renvois-detail-card {
  background: rgba(31,37,50,0.45);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 16px 18px;
}
.renvois-detail-card .renvois-section-title { margin-bottom: 12px; }

.renvois-detail-list {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}
.renvois-detail-row { display: contents; }
.renvois-detail-row dt {
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}
.renvois-detail-row dd {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  word-break: break-word;
}
.renvois-detail-row dd code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.07);
}
.renvois-empty-val { color: rgba(255,255,255,0.32); font-style: italic; }

/* Frise verticale des statuts */
.renvois-frise { list-style: none; margin: 0; padding: 0; position: relative; }
.renvois-frise::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 1px;
  background: rgba(255,255,255,0.10);
}
.renvois-frise-item {
  position: relative;
  padding: 6px 0 14px 22px;
  display: flex; align-items: flex-start; gap: 8px;
}
.renvois-frise-item:last-child { padding-bottom: 0; }
.renvois-frise-dot {
  position: absolute;
  left: 0; top: 8px;
  width: 13px; height: 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.20);
  border: 2px solid #1f2532;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10);
}
.renvois-frise-item.is-current .renvois-frise-dot {
  background: #00B589;
  box-shadow: 0 0 0 1px rgba(0,181,137,0.45), 0 0 12px rgba(0,181,137,0.45);
}
.renvois-frise-body { flex: 1; min-width: 0; }
.renvois-frise-statut {
  font-size: 13px; font-weight: 600; color: #fff;
}
.renvois-frise-item.is-current .renvois-frise-statut { color: #5ddbac; }
.renvois-frise-date {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

/* Boutons d'action de la fiche détail */
.renvois-detail-actions { display: flex; flex-direction: column; gap: 8px; }
.renvois-detail-next { width: 100%; justify-content: center; }
.renvois-btn-warn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fca5a5;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.34);
  border-radius: 8px;
  cursor: pointer;
  transition: all 140ms ease;
}
.renvois-btn-warn:hover {
  background: rgba(239,68,68,0.16);
  color: #fff;
}

/* Placeholder "Documents — bientôt" */
.renvois-detail-docs { opacity: 0.85; }
.renvois-docs-placeholder {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 8px;
}
.renvois-docs-placeholder p { margin: 0; }

/* ==========================================================================
   === RENVOIS === Envois groupés
   ========================================================================== */

/* Bascule Dossiers / Envois groupés (segment control) */
.renvois-tabs {
  display: inline-flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.renvois-tab {
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.renvois-tab:hover { color: #fff; }
.renvois-tab.is-active {
  background: rgba(0,181,137,0.18);
  color: #fff;
}

/* Pill d'alerte sur la liste des envois ("pas de modèle facture") */
.renvois-meta-warn {
  background: rgba(240,179,65,0.10) !important;
  color: #f0b341 !important;
  border-color: rgba(240,179,65,0.34) !important;
}

/* Créateur d'envoi (panneau replié) */
.renvois-envoi-creator {
  padding: 18px;
  background: rgba(31,37,50,0.55);
  border: 1px solid rgba(0,181,137,0.34);
  border-radius: 12px;
  display: flex; flex-direction: column; gap: 14px;
}
.renvois-creator-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 700px) { .renvois-creator-grid { grid-template-columns: 1fr; } }
.renvois-creator-info { display: flex; flex-direction: column; gap: 6px; }
.renvois-creator-warn {
  font-size: 12px;
  color: #f0b341;
  background: rgba(240,179,65,0.08);
  border: 1px solid rgba(240,179,65,0.34);
  border-radius: 8px;
  padding: 8px 10px;
}
.renvois-creator-empty {
  text-align: center; padding: 20px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  color: rgba(255,255,255,0.55);
}
.renvois-creator-empty-small {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-style: italic;
  padding: 10px 0;
}

.renvois-creator-list {
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}
.renvois-creator-list-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
}
.renvois-creator-bulk { display: inline-flex; gap: 4px; }
.renvois-creator-bulk button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 140ms ease;
}
.renvois-creator-bulk button:hover { color: #fff; background: rgba(255,255,255,0.05); }

.renvois-creator-rows {
  list-style: none;
  margin: 0; padding: 0;
  max-height: 320px;
  overflow-y: auto;
}
.renvois-creator-rows li { border-bottom: 1px solid rgba(255,255,255,0.04); }
.renvois-creator-rows li:last-child { border-bottom: 0; }
.renvois-creator-rows label {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 140ms ease;
}
.renvois-creator-rows label:hover { background: rgba(255,255,255,0.03); }
.renvois-creator-check {
  width: 14px; height: 14px;
  accent-color: #00B589;
  flex-shrink: 0;
}
.renvois-creator-row-main {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 200px;
}
.renvois-creator-row-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.07);
}
.renvois-creator-row-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.renvois-creator-row-meta {
  margin-left: auto;
  display: inline-flex; gap: 6px; align-items: center;
  flex-wrap: wrap;
}

.renvois-creator-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 4px;
}

/* Fiche envoi : liste des dossiers rattachés */
.renvois-envoi-dossiers { list-style: none; margin: 0; padding: 0; }
.renvois-envoi-dossier {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12.5px;
}
.renvois-envoi-dossier:last-child { border-bottom: 0; }
.renvois-envoi-imei {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

/* Champs éditables de la fiche envoi */
.renvois-envoi-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f5f7fa;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 11px;
  border-radius: 7px;
  outline: none;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.renvois-envoi-input:focus {
  border-color: rgba(0,181,137,0.55);
  background: rgba(0,181,137,0.05);
  box-shadow: 0 0 0 3px rgba(0,181,137,0.14);
}
textarea.renvois-envoi-input { min-height: 48px; resize: vertical; line-height: 1.5; }
select.renvois-envoi-input { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-opacity='0.55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
select.renvois-envoi-input option { background: #1f2532; color: #f5f7fa; }

.renvois-envoi-row {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 12px;
}
.renvois-envoi-actions {
  display: flex; justify-content: flex-end;
  margin-top: 12px;
}

/* Résultat de la génération de facture (liens de download) */
.renvois-envoi-result {
  margin-top: 14px;
  padding: 12px;
  background: rgba(0,181,137,0.06);
  border: 1px solid rgba(0,181,137,0.25);
  border-radius: 8px;
}
.renvois-envoi-result-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #5ddbac;
}
.renvois-envoi-result-links {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.renvois-envoi-result-links .renvois-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.renvois-envoi-pdf-warn {
  font-size: 11.5px;
  color: rgba(255,255,255,0.55);
  font-style: italic;
}

/* ==========================================================================
   WIKI — vue navigable façon Wikipédia (3 colonnes)
   ==========================================================================
   Identité MobiOS conservée : teal/lime, anthracite, accent emerald.
   La colonne centrale (.wiki-article) est l'équivalent de l'article ; la
   colonne droite (.wiki-infobox) est la fiche d'identité (frontmatter) ;
   la colonne gauche (.wiki-tree) est l'arbre de navigation issu du scan
   du dossier wiki/.
   ========================================================================== */

/* ---------- Arbre (gauche) ---------- */
.wiki-tree-msg {
  padding: 12px 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.wiki-tree-msg-err { color: #f0b341; }

.wiki-tree-cat { margin-bottom: 6px; }
.wiki-tree-cat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  cursor: pointer; user-select: none;
  list-style: none;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); font-weight: 600;
}
.wiki-tree-cat-head::-webkit-details-marker { display: none; }
.wiki-tree-cat-head::before {
  content: '▸';
  font-size: 9px; line-height: 1;
  color: rgba(255,255,255,0.35);
  transition: transform 140ms ease;
  width: 8px; flex-shrink: 0;
}
.wiki-tree-cat[open] > .wiki-tree-cat-head::before { transform: rotate(90deg); }
.wiki-tree-cat-head:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.03); }
.wiki-tree-cat-name { flex: 1; min-width: 0; }
.wiki-tree-cat-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; color: rgba(255,255,255,0.3);
  letter-spacing: 0;
}

.wiki-tree-files { padding-left: 8px; margin: 2px 0 6px; }
.wiki-tree-file {
  display: block; width: 100%; text-align: left;
  padding: 5px 10px 5px 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.62);
  font-size: 12.5px; line-height: 1.35;
  background: transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.wiki-tree-file:hover { background: rgba(255,255,255,0.04); color: #fff; }
.wiki-tree-file.is-active {
  color: #fff;
  background: rgba(0,181,137,0.14);
  border-color: rgba(0,181,137,0.34);
}
.wiki-tree-file-label {
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Article (centre) ---------- */
.wiki-article {
  color: rgba(255,255,255,0.85);
  font-size: 14.5px; line-height: 1.65;
}
.wiki-article h1 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 26px; font-weight: 800; font-style: italic;
  color: #fff;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: -0.01em;
}
.wiki-article h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 17px; font-weight: 700;
  color: #fff;
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.wiki-article h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px; font-weight: 700;
  color: rgba(255,255,255,0.9);
  margin: 18px 0 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.wiki-article p { margin: 0 0 12px; }
.wiki-article ul, .wiki-article ol { margin: 0 0 12px; padding-left: 22px; }
.wiki-article li { margin: 2px 0; }
.wiki-article ul li::marker { color: rgba(0,181,137,0.6); }
.wiki-article strong { color: #fff; }
.wiki-article hr { border: 0; border-top: 1px solid rgba(255,255,255,0.08); margin: 22px 0; }
.wiki-article code {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 1px 5px; border-radius: 4px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12.5px;
  color: #e5edd7;
}
.wiki-article a:not(.wikilink):not(.wiki-fn-back) {
  color: #7ec1ff; text-decoration: underline; text-underline-offset: 2px;
}

/* Wikilink cassé : style distinct (rouge atténué, soulignement pointillé) */
.wikilink-broken {
  color: #e88a8a !important;
  border-bottom: 1px dashed rgba(232,138,138,0.5) !important;
  cursor: help !important;
}
.wikilink-broken:hover { color: #f0a8a8 !important; }
.wikilink-demo {
  color: #7ec1ff;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9em;
  padding: 0 4px; border-radius: 3px;
  background: rgba(126,193,255,0.08);
}

/* Refnum dans le corps + ancre pour scroll en douceur */
.wiki-refnum {
  color: #7ec1ff;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.7em;
  vertical-align: super; line-height: 0;
  padding: 0 1px;
}
.wiki-refnum a { color: inherit; text-decoration: none; }
.wiki-refnum a:hover { color: #a5d6ff; }

/* Callouts */
.wiki-callout {
  margin: 14px 0;
  border-radius: 10px;
  border: 1px solid;
  padding: 10px 14px 11px;
  font-size: 13.5px; line-height: 1.55;
}
.wiki-callout-head {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  margin-bottom: 4px;
}
.wiki-callout-body { color: rgba(255,255,255,0.85); }
.wiki-callout-derive {
  background: rgba(0,181,137,0.06);
  border-color: rgba(0,181,137,0.32);
}
.wiki-callout-derive .wiki-callout-head { color: #5ddbac; }
.wiki-callout-contradiction {
  background: rgba(240,179,65,0.10);
  border-color: rgba(240,179,65,0.45);
}
.wiki-callout-contradiction .wiki-callout-head { color: #f0b341; }
.wiki-callout-note,
.wiki-callout-warning {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
.wiki-callout-note .wiki-callout-head,
.wiki-callout-warning .wiki-callout-head { color: rgba(255,255,255,0.7); }

/* Section "Sources" en bas (footnotes) */
.wiki-footnotes {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12.5px;
  color: rgba(255,255,255,0.7);
}
.wiki-footnotes h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
  margin: 0 0 10px;
  border: none;
}
.wiki-footnotes ol {
  list-style: none; padding: 0; margin: 0;
  counter-reset: wiki-fn;
}
.wiki-fn-item {
  padding: 6px 8px; border-radius: 6px;
  display: flex; gap: 8px; align-items: baseline;
}
.wiki-fn-item:target { background: rgba(0,181,137,0.12); }
.wiki-fn-id {
  color: #7ec1ff;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; flex-shrink: 0;
}
.wiki-fn-text {
  flex: 1; word-break: break-word;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  color: rgba(255,255,255,0.75);
}
.wiki-fn-back {
  color: rgba(0,181,137,0.7);
  text-decoration: none; font-size: 14px;
  flex-shrink: 0;
}
.wiki-fn-back:hover { color: #C5D92D; }

/* États (loading / erreur / empty) */
.wiki-loading {
  padding: 36px 0; text-align: center;
  color: rgba(255,255,255,0.45); font-size: 13px;
}
.wiki-error {
  margin-top: 8px;
  padding: 14px 16px; border-radius: 10px;
  background: rgba(240,179,65,0.10);
  border: 1px solid rgba(240,179,65,0.45);
  color: #f0b341; font-size: 13px;
}
.wiki-error-detail {
  display: block; margin-top: 4px;
  color: rgba(255,255,255,0.55); font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.wiki-empty {
  padding: 60px 0 40px;
  text-align: center;
}
.wiki-empty-eyebrow {
  display: inline-block;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(0,181,137,0.85); font-weight: 600;
  margin-bottom: 12px;
}
.wiki-empty-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 24px; font-weight: 800; font-style: italic;
  color: #fff;
  margin: 0 0 12px;
}
.wiki-empty-text {
  color: rgba(255,255,255,0.55);
  font-size: 14px; line-height: 1.6;
  max-width: 480px; margin: 0 auto;
}

/* ---------- Infobox (droite) ---------- */
.wiki-infobox-empty {
  padding: 24px 6px;
  color: rgba(255,255,255,0.35);
  font-size: 12px; line-height: 1.5;
  font-style: italic;
}
.wiki-infobox-card {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  padding: 14px 16px 16px;
  font-size: 12.5px;
}
.wiki-infobox-title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 15px; font-weight: 700;
  color: #fff;
  word-break: break-word;
}
.wiki-infobox-subtitle {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(0,181,137,0.85); font-weight: 600;
  margin-top: 2px;
}
.wiki-infobox-list {
  margin: 12px 0 0; padding: 0;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.wiki-infobox-row {
  display: flex; gap: 10px; padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.wiki-infobox-row dt {
  color: rgba(255,255,255,0.45);
  flex: 0 0 90px;
}
.wiki-infobox-row dd {
  color: rgba(255,255,255,0.85);
  margin: 0; flex: 1; min-width: 0;
  word-break: break-word;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
}
.wiki-infobox-section {
  margin-top: 14px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5); font-weight: 600;
}
.wiki-infobox-sources {
  list-style: none; padding: 0; margin: 6px 0 0;
}
.wiki-infobox-sources li {
  padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wiki-infobox-sources li:last-child { border-bottom: 0; }
.wiki-source-file {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: rgba(255,255,255,0.8);
  word-break: break-all;
}
.wiki-source-sha {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px; color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
