/* =====================================================================
   Hyperion — Back-office design system
   Soft-UI. Dual theme (dark / light) driven by [data-theme] on <html>.
   ===================================================================== */

:root {
  /* Theme-agnostic geometry & type */
  --radius: 8px;
  --radius-sm: 8px;
  --sidebar-w: 264px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Accent hues (shared across themes) */
  --accent-2: #21c7b3;
}

/* ---------- Dark theme ---------- */
:root,
[data-theme="dark"] {
  color-scheme: dark;

  --bg-0: #0b0f1a;
  --bg-1: #0e1422;

  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-strong: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.14);
  --glass-blur: 18px;

  --surface-inset: rgba(255, 255, 255, 0.025);
  --map-base: #1a2233;
  --code-bg: rgba(255, 255, 255, 0.05);
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-bg-strong: rgba(255, 255, 255, 0.05);
  --topbar-bg: rgba(11, 15, 26, 0.72);

  --text-0: #f3f6fc;
  --text-1: #aeb7c9;
  --text-2: #6f7a90;
  --on-accent: #0b0f1a;

  --accent: #6c8cff;
  --accent-soft: rgba(108, 140, 255, 0.16);
  --accent-border: rgba(108, 140, 255, 0.28);

  --ok: #36d399;
  --warn: #f5c451;
  --danger: #ff6b81;
  --ok-soft: rgba(54, 211, 153, 0.12);
  --danger-soft: rgba(255, 107, 129, 0.12);
  --danger-border: rgba(255, 107, 129, 0.32);
  --danger-fg: #ffd7dd;

  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.65);

  --aurora-1: rgba(108, 140, 255, 0.22);
  --aurora-2: rgba(56, 224, 200, 0.16);
  --aurora-3: rgba(173, 108, 255, 0.14);
  --aurora-noise: 0.025;
}

/* ---------- Light theme (soft-UI) ---------- */
[data-theme="light"] {
  color-scheme: light;

  --bg-0: #e9edf4;
  --bg-1: #f5f7fb;

  --glass-bg: #ffffff;
  --glass-bg-strong: #f3f6fb;
  --glass-border: rgba(17, 24, 39, 0.06);
  --glass-border-strong: rgba(17, 24, 39, 0.12);
  --glass-blur: 8px;

  --surface-inset: #f4f6fb;
  --map-base: #e2e8f1;
  --code-bg: #eceff6;
  --input-bg: #f4f6fb;
  --input-bg-strong: #eceff6;
  --topbar-bg: rgba(245, 247, 251, 0.8);

  --text-0: #0f172a;
  --text-1: #475569;
  --text-2: #94a3b8;
  --on-accent: #ffffff;

  --accent: #5b7cfa;
  --accent-soft: rgba(91, 124, 250, 0.12);
  --accent-border: rgba(91, 124, 250, 0.28);

  --ok: #16a34a;
  --warn: #d97706;
  --danger: #e11d48;
  --ok-soft: rgba(22, 163, 74, 0.12);
  --danger-soft: rgba(225, 29, 72, 0.1);
  --danger-border: rgba(225, 29, 72, 0.26);
  --danger-fg: #b42318;

  --shadow: 0 18px 40px -22px rgba(17, 24, 39, 0.22);

  --aurora-1: rgba(91, 124, 250, 0.14);
  --aurora-2: rgba(33, 199, 179, 0.1);
  --aurora-3: rgba(173, 108, 255, 0.08);
  --aurora-noise: 0.015;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Aurora background — soft colored blobs behind the frosted glass */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(1100px 700px at 12% -8%, var(--aurora-1), transparent 60%),
    radial-gradient(900px 600px at 92% 0%, var(--aurora-2), transparent 55%),
    radial-gradient(800px 800px at 70% 110%, var(--aurora-3), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }

/* ---------- Glass primitive ---------- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow);
}

/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px;
  margin: 14px 0 14px 14px;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
}
.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px -6px var(--accent);
  font-weight: 800;
  color: var(--on-accent);
}
.brand__name { font-weight: 700; letter-spacing: 0.3px; }
.brand__sub { font-size: 11px; color: var(--text-2); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.nav__group { margin-top: 14px; }
.nav__title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-2);
  padding: 0 12px 6px;
}
.nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.nav__link svg { width: 18px; height: 18px; opacity: 0.85; flex: none; }
.nav__link:hover { background: var(--glass-bg-strong); color: var(--text-0); }
.nav__link.is-active {
  color: var(--text-0);
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.nav__link.is-active svg { opacity: 1; color: var(--accent); }

.sidebar__foot { margin-top: auto; }
.nav__link--btn {
  width: 100%; cursor: pointer;
  background: var(--surface-inset);
  font: inherit; text-align: left;
}

/* ---------- Main ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 24px 36px 18px;
  /* Filet de sécurité : aucun contenu (chart, carte, table large) ne doit
     provoquer un défilement horizontal de la page. `clip` n'ouvre pas de conteneur
     de défilement (contrairement à `hidden`), préservant le `position: sticky` de
     la topbar ; les conteneurs internes (`.tabs`, wrappers de table) gèrent leur
     propre débordement. */
  overflow-x: clip;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  margin-bottom: 20px;
  background: var(--topbar-bg);
}
.topbar__title { min-width: 0; }
.topbar__title h1 { margin: 0; font-size: 16px; font-weight: 650; }
.topbar__title p { margin: 1px 0 0; font-size: 12px; color: var(--text-2); }

/* Command-palette trigger (looks like a search field, opens the Ctrl+K palette) */
.topbar__search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px 7px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  min-width: 230px;
  cursor: pointer;
  font: inherit;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.topbar__search:hover {
  background: var(--glass-bg-strong);
  border-color: var(--glass-border-strong);
  color: var(--text-1);
}
.topbar__search svg { width: 16px; height: 16px; flex: none; }
.topbar__search > span { flex: 1; text-align: left; font-size: 13px; }
.kbd {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; line-height: 1;
  color: var(--text-2);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 3px 6px;
}
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.icon-btn:hover { background: var(--glass-bg-strong); color: var(--text-0); }
.icon-btn svg { width: 17px; height: 17px; }

/* Mobile nav trigger (hamburger) — shown only when the sidebar collapses */
.nav-toggle { display: none; margin-right: 2px; }

/* Off-canvas drawer backdrop — inert until the drawer opens on small screens */
.nav-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 8, 15, 0.5);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.nav-backdrop.is-open { opacity: 1; visibility: visible; }

/* Theme toggle: show only the icon matching the current theme. */
.theme-toggle .theme-toggle__sun { display: none; }
.theme-toggle .theme-toggle__moon { display: block; }
[data-theme="light"] .theme-toggle .theme-toggle__sun { display: block; }
[data-theme="light"] .theme-toggle .theme-toggle__moon { display: none; }
.dot {
  position: absolute; transform: translate(11px, -9px);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-2); box-shadow: 0 0 0 3px var(--bg-0);
}

.avatar {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--surface-inset);
  border: 1px solid var(--glass-border);
}
.avatar__img {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
}
.avatar__meta { line-height: 1.1; }
.avatar__name { font-size: 13px; font-weight: 600; }
.avatar__role { font-size: 11px; color: var(--text-2); text-transform: capitalize; }

/* ---------- Command palette (Ctrl+K) ---------- */
.palette {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  background: rgba(5, 8, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  /* Keep the panel visible through the fade-out, then hide; on open visibility
     flips instantly so the search field is immediately focusable. */
  transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}
.palette.is-open {
  opacity: 1; visibility: visible;
  transition: opacity 0.16s ease, visibility 0s linear 0s;
}
.palette__panel {
  width: min(620px, calc(100vw - 32px));
  max-height: 64vh; display: flex; flex-direction: column;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  box-shadow: var(--shadow);
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.16s ease;
}
.palette.is-open .palette__panel { transform: translateY(0) scale(1); }
.palette__search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
}
.palette__search svg { width: 18px; height: 18px; color: var(--text-2); flex: none; }
.palette__search input {
  flex: 1; border: 0; background: transparent; color: var(--text-0);
  outline: none; font-size: 15px; font-family: inherit;
}
.palette__list { overflow-y: auto; padding: 8px; }
.palette__group-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--text-2); padding: 10px 12px 6px;
}
.palette__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  color: var(--text-1); font: inherit; text-align: left;
  text-decoration: none;
}
.palette__item svg { width: 18px; height: 18px; opacity: 0.85; flex: none; }
.palette__item-label { flex: 1; font-size: 14px; }
.palette__item-group { font-size: 11.5px; color: var(--text-2); }
.palette__item.is-active {
  background: var(--accent-soft);
  border-color: rgba(108, 140, 255, 0.28);
  color: var(--text-0);
}
.palette__item.is-active svg { opacity: 1; color: var(--accent); }
.palette__empty {
  padding: 24px 16px; text-align: center;
  font-size: 13.5px; color: var(--text-2);
}

/* User result rows inside the palette (live search) */
.palette__item--user { text-decoration: none; }
.palette__uavatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 650; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(108, 140, 255, 0.28);
}
.palette__usub {
  font-size: 11.5px; color: var(--text-2);
  max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Generic media detail modal — full-screen stage with a metadata sidebar */
.modal {
  position: fixed; inset: 0; z-index: 110;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 15, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__panel {
  position: relative;
  display: grid;
  grid-template-columns: 360px 1fr;
  width: min(1680px, calc(100vw - 32px));
  height: min(1000px, calc(100vh - 32px));
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.18s ease;
}
.modal.is-open .modal__panel { transform: translateY(0) scale(1); }
.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(5, 8, 15, 0.45); color: #fff;
  transition: background 0.14s ease;
  /* Supprime le délai de double-tap mobile, qui peut avaler le premier tap. */
  touch-action: manipulation;
}
.modal__close:hover { background: rgba(5, 8, 15, 0.7); }
.modal__close svg { width: 18px; height: 18px; }

/* Visionneuse plein écran — agrandit avatar / couverture à leur taille réelle */
.imgview {
  position: fixed; inset: 0; z-index: 130;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.imgview.is-open { opacity: 1; visibility: visible; }
.imgview__img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; cursor: zoom-out;
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transform: scale(0.97); transition: transform 0.18s ease;
}
.imgview.is-open .imgview__img { transform: scale(1); }
.imgview__close {
  position: fixed; top: 18px; right: 18px; z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(5, 8, 15, 0.55); color: #fff;
  transition: background 0.14s ease;
}
.imgview__close:hover { background: rgba(5, 8, 15, 0.8); }
.imgview__close svg { width: 20px; height: 20px; }

/* Médias de profil agrandissables au clic */
[data-user-avatar] img, [data-user-cover] img { cursor: zoom-in; }

/* Sidebar (left) — metadata */
.modal__sidebar {
  display: flex; flex-direction: column;
  padding: 24px; overflow-y: auto;
  background: var(--glass-bg);
  border-right: 1px solid var(--glass-border);
}
.modal__head {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  margin-bottom: 18px;
}
.modal__title {
  margin: 0; font-size: 18px; font-weight: 700;
  color: var(--text-0); line-height: 1.35; word-break: break-word;
}
.modal__meta { margin: 0; display: flex; flex-direction: column; gap: 1px; }
.modal__row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--glass-border);
  font-size: 13.5px;
}
/* `display: flex` above beats the UA `[hidden]` rule, so hidden rows would
   stay visible (keeping the previous media's text) — restore the hide. */
.modal__row[hidden] { display: none; }
.modal__row dt {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-2); font-weight: 600;
}
.modal__row dd { margin: 0; color: var(--text-0); font-weight: 550; }
.modal__country { display: flex; align-items: center; gap: 8px; }
.modal__flag {
  width: 22px; height: 16px; flex: none; border-radius: 2px;
  box-shadow: 0 0 0 1px var(--glass-border);
}
.modal__row code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; color: var(--text-0);
  background: var(--code-bg); padding: 3px 8px; border-radius: 6px;
  word-break: break-all;
}
.modal__id { display: flex; align-items: center; gap: 8px; }
.modal__id code { flex: 1 1 auto; }
.modal__copy {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  color: var(--text-2); background: transparent;
  border: 1px solid var(--glass-border); border-radius: 6px;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.modal__copy:hover { color: var(--text-0); border-color: var(--text-2); }
.modal__copy.is-done { color: var(--accent); border-color: var(--accent); }
.modal__copy svg { width: 15px; height: 15px; }
.mm-geo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 0 0 10px; padding: 0 0 12px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13.5px; color: var(--text-0); font-weight: 550;
}
.mm-geo[hidden] { display: none; }
.mm-geo__item { display: inline-flex; align-items: center; gap: 6px; }
.mm-geo__sep { color: var(--text-2); }
.mm-geo__biome {
  margin-left: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--glass-fill, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
}
/* Actions de l'onglet Localisation : boutons à leur largeur naturelle, côte à
   côte. Le `width: auto` neutralise l'étirement des boutons de formulaire. */
.mm-geo__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mm-geo__actions .btn { width: auto; margin-top: 0; }

.modal__row--map { margin-top: auto; }
.modal__map {
  width: 100%; height: 160px;
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: 0 0 0 1px var(--glass-border);
}
.modal__coords {
  display: block; margin-top: 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px; color: var(--text-2);
}
.modal__map .maplibregl-ctrl-attrib { font-size: 9px; }

/* Enriched sidebar blocks (loaded from /api/media/{hex}) */
.modal__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge--flag { background: rgba(239, 68, 68, 0.16); color: #f87171; }
/* These modal blocks set `display: *`, which beats the UA `[hidden]` rule; the
   client toggles them via the `hidden` attribute, so restore the hide (else an
   empty status/flag pill or author row would linger for media that lack them). */
.modal__badges .badge[hidden],
.modal__author[hidden],
.modal__stats[hidden] { display: none; }
.modal__author {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.modal__avatar {
  width: 28px; height: 28px; flex: none; border-radius: 50%;
  object-fit: cover; box-shadow: 0 0 0 1px var(--glass-border);
}
.modal__author-name { font-size: 13.5px; font-weight: 600; color: var(--text-0); text-decoration: none; cursor: pointer; }
.modal__author-name:hover { text-decoration: underline; }
.modal__verified { width: 16px; height: 16px; flex: none; color: var(--brand, #6366f1); }
.modal__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 4px; padding: 12px 0;
  border-top: 1px solid var(--glass-border);
}
.modal__stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
/* Pictogramme au-dessus du compteur : discret, teinté par métrique. */
.modal__stat-icon { display: block; margin-bottom: 3px; color: var(--text-2); line-height: 0; }
.modal__stat-icon svg { width: 16px; height: 16px; display: block; }
.modal__stat-icon--like { color: var(--ok); }
/* `--danger` (et non `--danger-fg`, pensé pour du texte sur fond teinté) :
   symétrique de `--ok`, lisible en icône autonome sur les deux thèmes. */
.modal__stat-icon--dislike { color: var(--danger); }
.modal__stat-val { font-size: 16px; font-weight: 700; color: var(--text-0); }
.modal__stat-cap { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-2); }
.modal__row--text dd { line-height: 1.5; font-weight: 450; }
.modal__desc-title { display: block; margin-bottom: 4px; color: var(--text-0); }
.modal__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.modal__tag {
  font-size: 12px; font-weight: 550; color: var(--text-1);
  background: var(--code-bg); padding: 3px 9px; border-radius: 999px;
}
/* Thème (référentiel) vs hashtag (saisi par l'auteur) : teinte accent pour
   qu'on distingue les deux d'un coup d'œil dans l'onglet Détails. */
.modal__tag--topic {
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.modal.is-loading .modal__sidebar { cursor: progress; }
@keyframes modalLoad {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Stage (right) — image on top of its decoded blurhash */
.modal__stage {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #0b0e16;
}
.modal__blur {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.1);
  filter: blur(8px) saturate(1.2);
}
.modal__img {
  position: relative; z-index: 1;
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
  opacity: 0; transition: opacity 0.3s ease;
}
.modal__img.is-loaded { opacity: 1; }
.modal__stage-empty {
  position: relative; z-index: 1;
  color: rgba(255, 255, 255, 0.85); font-size: 13.5px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(5, 8, 15, 0.5);
}

@media (max-width: 760px) {
  .modal { padding: 0; }
  .modal__panel {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    width: 100vw; border-radius: 0;
    /* `dvh` suit la barre d'URL mobile, que `vh` ignore. */
    height: 100vh; height: 100dvh;
    /* Ancre le panneau en haut. Centré, le moindre dépassement de hauteur
       remonte le bouton de fermeture au-dessus du viewport, où il devient
       intappable — et en plein écran il ne reste aucun voile pour fermer.
       Ciblé ici plutôt que sur `.modal`, dont les modales de formulaire
       (`.cpnmodal`) doivent rester centrées. */
    align-self: flex-start;
  }
  .modal__sidebar {
    grid-row: 2; border-right: 0; border-top: 1px solid var(--glass-border);
    max-height: 45vh;
  }
  .modal__stage { grid-row: 1; }
  /* Sans voile à taper autour du panneau, ce bouton est la seule sortie au
     doigt : on lui donne la cible tactile minimale (44px) et un fond opaque
     pour qu'il reste lisible par-dessus n'importe quel média. */
  .modal__close {
    width: 44px; height: 44px; top: 10px; right: 10px;
    background: rgba(5, 8, 15, 0.72);
  }
  .modal__close svg { width: 20px; height: 20px; }
}

/* ── Media modal: barre supérieure (onglets) + corps (sidebar / aperçu) ── */
.modal--media .modal__panel {
  display: grid;
  /* `minmax(0, 1fr)` (et non `1fr`) : le min de piste vaut 0 au lieu du
     min-content, sinon la barre d'onglets non-repliable gonfle le panneau
     au-delà de l'écran (mobile). La colonne reste à la largeur du panneau et
     l'`overflow-x: auto` des onglets prend le relais. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
}

/* Barre supérieure : en-tête et onglets sur une même ligne (gain de hauteur). */
.modal__topbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 4px 24px;
  padding: 12px 60px 12px 24px;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}
/* En-tête à plat : nom, badges et auteur alignés horizontalement. */
.modal__topbar .modal__head {
  flex: 0 1 auto; min-width: 0; margin-bottom: 0;
  flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 10px;
}
.modal__topbar .modal__title { font-size: 16px; }
.modal__topbar .modal__author { margin-bottom: 0; }
/* Onglets présentés en contrôle segmenté : des pilules dans un rail discret. */
.modal__tabs {
  /* `flex: 0 1 auto` + `min-width: 0` : la barre peut rétrécir sous la largeur
     de ses onglets pour que `overflow-x: auto` prenne le relais (défilement
     interne) au lieu de forcer la modale plus large que l'écran (mobile). */
  flex: 0 1 auto; min-width: 0; display: inline-flex; gap: 2px; margin: 0;
  padding: 3px; border: 0; overflow-x: auto; scrollbar-width: none;
  background: var(--input-bg); border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--glass-border);
}
.modal__tabs::-webkit-scrollbar { display: none; }
.modal--media .tab {
  padding: 7px 15px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; border: 0; border-radius: 999px; margin: 0;
  color: var(--text-2); transition: color 0.16s ease, background 0.16s ease;
}
.modal--media .tab:hover { color: var(--text-0); background: var(--glass-bg-strong); }
.modal--media .tab.is-active {
  color: #fff; background: var(--accent); border: 0;
  box-shadow: 0 1px 6px rgba(99, 102, 241, 0.35);
}

/* Corps : aperçu (droite) et barre latérale scrollable (gauche). */
.modal__body {
  display: grid;
  grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
  min-height: 0;
}
.modal--media .modal__aside { border: 0; }
.modal--media .modal__stage { min-width: 0; }
/* Onglet sans aperçu : la barre latérale occupe toute la largeur. */
.modal__body.is-solo { grid-template-columns: 1fr; }
.modal__body.is-solo .modal__stage { display: none; }
.modal__panel-body { margin: 0; }

/* Indicateur de chargement : barre indéterminée sous les onglets. */
.modal__progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  overflow: hidden; opacity: 0; transition: opacity 0.2s ease;
}
.modal.is-loading .modal__progress { opacity: 1; }
.modal__progress > span {
  position: absolute; inset: 0; display: block;
  background: linear-gradient(90deg, transparent, var(--accent, #6366f1), transparent);
  transform: translateX(-100%);
  animation: modalLoad 1.1s ease-in-out infinite;
}

/* Indicateur de chargement : spinner centré sur l'aperçu. */
.modal__spinner {
  position: absolute; z-index: 2; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11, 14, 22, 0.35);
}
/* `display: flex` beats the UA `[hidden]` rule, so restore the hide. */
.modal__spinner[hidden] { display: none; }
.modal__spinner > span {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: modalSpin 0.7s linear infinite;
}
@keyframes modalSpin { to { transform: rotate(360deg); } }

/* Détails — allow the 5 counters to wrap gracefully */
.mm-stats { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }

/* Forms (Édition / Localisation) */
.field__hint { color: var(--text-2); font-weight: 400; font-size: 11px; }
.field textarea, .field select {
  width: 100%; padding: 12px 14px; font-size: 14px; font-family: inherit;
  color: var(--text-0); border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  outline: none; resize: vertical; transition: border-color 0.18s, background 0.18s;
}
.field textarea:focus, .field select:focus { border-color: var(--accent); background: var(--input-bg-strong); }
/* Contraste des listes déroulantes natives : sans cette règle, les <option>
   héritent d'un fond blanc système et d'un texte gris illisible sur le thème
   sombre. S'applique à tous les <select> du back-office. */
select option { color: var(--text-0); background: var(--bg-1); }
select option:disabled { color: var(--text-1); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); }
.field__error { display: block; margin-top: 5px; color: var(--danger); font-size: 11.5px; }
.mm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mm-collapse { margin-bottom: 12px; }
.mm-collapse summary { cursor: pointer; font-size: 12.5px; color: var(--text-1); padding: 6px 0; }

/* Blocks (Modération / Maintenance) */
.mm-block { padding: 16px 0; border-top: 1px solid var(--glass-border); }
.modal__panel-body > .mm-block:first-child,
.modal__panel-body > .mm-form:first-child { border-top: 0; padding-top: 0; }
.mm-block__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mm-block__head h3 { margin: 0; font-size: 13.5px; font-weight: 650; color: var(--text-0); }
.mm-hint { margin: 6px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.45; }

/* Onglet Méta — groupes fichier / EXIF. */
.mm-meta__group + .mm-meta__group { margin-top: 18px; }
.mm-meta__title {
  margin: 0 0 2px; font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-2);
}

/* Empreinte perceptuelle — grille 8×8 (SVG `currentColor`) + code hex. */
.mm-fp { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.mm-fp__grid {
  flex: none; width: 76px; height: 76px; color: var(--accent);
  padding: 6px; border-radius: 10px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.mm-fp__grid svg { display: block; width: 100%; height: 100%; }
.mm-fp__info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mm-fp__hash {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px; letter-spacing: .06em; color: var(--text-1); word-break: break-all;
}
.mm-fp__hint { margin: 0; }

/* Comparateur de quasi-doublon (diff d'empreintes). */
.mm-fpc { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.mm-fpc__label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.mm-fpc__row { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-fpc__row input {
  flex: 1 1 220px; min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
}
.mm-fpc__row .btn { flex: none; width: auto; margin: 0; padding: 8px 16px; }
.mm-fpc__err { margin: 8px 0 0; font-size: 12px; color: var(--danger-fg); }
.mm-fpc__result { margin-top: 14px; }
.mm-fpc__grids { display: flex; align-items: flex-start; justify-content: center; gap: 10px; flex-wrap: wrap; }
.mm-fpc__cell { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.mm-fpc__cell figcaption { font-size: 11px; color: var(--text-2); }
.mm-fpc__cell .mm-fp__grid { width: 84px; height: 84px; }
.mm-fpc__cell--diff .mm-fp__grid { color: #d95926; }
.mm-fpc__verdict {
  margin: 14px 0 0; text-align: center; font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
}
.mm-fpc__verdict.is-dup { color: var(--danger-fg); background: var(--danger-soft); }
.mm-fpc__verdict.is-distinct { color: var(--ok); background: var(--ok-soft); }

/* Toggle switch (publication) */
.mm-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.mm-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mm-switch__track {
  width: 40px; height: 22px; border-radius: 999px; padding: 2px; flex: none;
  background: var(--input-bg); border: 1px solid var(--glass-border); transition: background 0.16s, border-color 0.16s;
}
.mm-switch__thumb {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-2); transition: transform 0.16s, background 0.16s;
}
.mm-switch input:checked + .mm-switch__track { background: var(--accent); border-color: var(--accent); }
.mm-switch input:checked + .mm-switch__track .mm-switch__thumb { transform: translateX(18px); background: #fff; }
.mm-switch__label { font-size: 12.5px; font-weight: 600; color: var(--text-1); }

/* Moderation flag checkboxes */
.mm-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-1); cursor: pointer; }
.mm-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.mm-danger .mm-block__head h3 { color: var(--danger); }

/* Localisation — la carte occupe toute la hauteur disponible de la modal. */
.mm-resolved { margin: 4px 0 0; font-size: 12.5px; color: var(--text-1); }
.mm-map--edit { height: 220px; cursor: crosshair; margin-bottom: 12px; }
.modal__panel-body[data-mm-panel="location"] {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
}
.modal__panel-body[data-mm-panel="location"] .mm-map--edit {
  flex: 1 1 auto; height: auto; min-height: 180px;
}

/* Statistiques — le graphe occupe toute la hauteur disponible de la modal. */
.modal__panel-body[data-mm-panel="statistics"] {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 14px;
}
.mm-stats-head { display: flex; align-items: center; justify-content: flex-end; }
.mm-period {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--input-bg); border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--glass-border);
}
.mm-period__btn {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 5px 13px; border: 0; border-radius: 999px; background: none;
  color: var(--text-2); transition: color 0.16s ease, background 0.16s ease;
}
.mm-period__btn:hover { color: var(--text-0); }
.mm-period__btn.is-active { color: #fff; background: var(--accent); }
.mm-stats[data-mm-trend-totals] { margin: 0; }
.mm-stats[data-mm-trend-totals][hidden] { display: none; }

/* Légende cliquable : puces avec pastille de couleur, désactivables. */
.mm-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.mm-legend[hidden] { display: none; }
.mm-legend__chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-1);
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--input-bg); transition: opacity 0.16s ease, border-color 0.16s ease;
}
.mm-legend__chip:not(.is-on) { opacity: 0.4; }
.mm-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.mm-legend__dot[data-color="views"]       { background: #6366f1; }
.mm-legend__dot[data-color="impressions"] { background: #06b6d4; }
.mm-legend__dot[data-color="likes"]       { background: #22c55e; }
.mm-legend__dot[data-color="dislikes"]    { background: #ef4444; }
.mm-legend__dot[data-color="comments"]    { background: #f59e0b; }

/* Zone du graphe : remplit l'espace restant, états centrés. */
.mm-chart {
  position: relative; flex: 1 1 auto; min-height: 220px;
  border-radius: var(--radius-sm); background: var(--surface-inset, rgba(255,255,255,0.02));
  box-shadow: inset 0 0 0 1px var(--glass-border); padding: 12px;
}
.mm-chart canvas { display: block; width: 100% !important; height: 100% !important; }
.mm-chart__state {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 13px;
}
.mm-chart__state[hidden] { display: none; }
.mm-chart__foot { margin: 0; font-size: 11.5px; color: var(--text-2); text-align: right; }

/* Réactions — liste des comptes ayant réagi */
.modal__panel-body[data-mm-panel="reactions"] {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 14px;
}
.mm-rx-head { display: flex; align-items: center; justify-content: flex-end; }
.mm-rx {
  position: relative; flex: 1 1 auto; min-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  border-radius: var(--radius-sm); background: var(--surface-inset, rgba(255,255,255,0.02));
  box-shadow: inset 0 0 0 1px var(--glass-border); padding: 6px;
}
.mm-rx__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mm-rx__row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background 0.16s ease;
}
.mm-rx__row:hover { background: var(--input-bg); }
.mm-rx__avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; object-fit: cover;
  display: grid; place-items: center; overflow: hidden;
  background: var(--input-bg); box-shadow: inset 0 0 0 1px var(--glass-border);
  font-size: 12px; font-weight: 700; color: var(--text-1);
}
.mm-rx__avatar img { width: 100%; height: 100%; object-fit: cover; }
.mm-rx__id { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.mm-rx__name {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600;
  color: var(--text-0); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-rx__name:hover { text-decoration: underline; }
.mm-rx__name.is-off { color: var(--text-2); font-style: italic; }
.mm-rx__verified { width: 13px; height: 13px; flex: none; color: var(--accent); }
.mm-rx__handle { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-rx__meta { display: flex; align-items: center; gap: 10px; flex: none; }
.mm-rx__date { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.mm-rx__badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.mm-rx__badge svg { width: 13px; height: 13px; }
.mm-rx__badge[data-value="like"]    { color: #22c55e; background: rgba(34,197,94,0.12); }
.mm-rx__badge[data-value="dislike"] { color: #ef4444; background: rgba(239,68,68,0.12); }
.mm-rx__state {
  margin: auto; padding: 20px 0; color: var(--text-2); font-size: 13px; text-align: center;
}
.mm-rx__state[hidden] { display: none; }
.mm-rx__more { align-self: center; margin: 6px 0; }
.mm-rx__more[hidden] { display: none; }

/* Commentaires — fil de modération d'un média */
.modal__panel-body[data-mm-panel="comments"] {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 14px;
}
.mm-cm {
  position: relative; flex: 1 1 auto; min-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  border-radius: var(--radius-sm); background: var(--surface-inset, rgba(255,255,255,0.02));
  box-shadow: inset 0 0 0 1px var(--glass-border); padding: 10px;
}
.mm-cm__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mm-cm__row {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--input-bg);
  box-shadow: inset 0 0 0 1px var(--glass-border);
}
.mm-cm__row.is-deleted { opacity: 0.7; }
.mm-cm__head { display: flex; align-items: center; gap: 9px; }
.mm-cm__avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center;
  background: var(--surface-inset, rgba(255,255,255,0.04)); box-shadow: inset 0 0 0 1px var(--glass-border);
  font-size: 11px; font-weight: 700; color: var(--text-1);
}
.mm-cm__avatar img { width: 100%; height: 100%; object-fit: cover; }
.mm-cm__author {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 auto;
  font-size: 13px; font-weight: 600; color: var(--text-0); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mm-cm__author:hover { text-decoration: underline; }
.mm-cm__author.is-off { color: var(--text-2); font-style: italic; }
.mm-cm__verified { width: 13px; height: 13px; flex: none; color: var(--accent); }
.mm-cm__date { flex: none; font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.mm-cm__body { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-1); white-space: pre-wrap; word-break: break-word; }
.mm-cm__body.is-empty { color: var(--text-2); font-style: italic; }
.mm-cm__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mm-cm__tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; }
.mm-cm__tag {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  padding: 2px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--glass-border);
}
.mm-cm__tag.is-deleted { color: #ef4444; box-shadow: inset 0 0 0 1px rgba(239,68,68,0.35); }
.mm-cm__tag.is-edited { color: var(--text-2); }
.mm-cm__btn {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; flex: none;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--glass-border);
  background: var(--surface-inset, rgba(255,255,255,0.04)); color: var(--text-1);
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.mm-cm__btn:hover { color: var(--text-0); }
.mm-cm__btn--danger { color: #ef4444; }
.mm-cm__btn--danger:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.35); }
.mm-cm__state { margin: auto; padding: 20px 0; color: var(--text-2); font-size: 13px; text-align: center; }
.mm-cm__state[hidden] { display: none; }
.mm-cm__more { align-self: center; margin: 6px 0; }
.mm-cm__more[hidden] { display: none; }

/* Maintenance — recompute diff */
.mm-diff { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.mm-diff__row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-1); }
.mm-diff__row--changed { color: var(--accent); font-weight: 600; }

@media (max-width: 760px) {
  .modal__body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .modal__body .modal__stage { grid-row: 1; min-height: 180px; max-height: 32vh; }
  .modal--media .modal__aside { grid-row: 2; border-top: 1px solid var(--glass-border); }
}

/* Clickable recent media rows (open the detail modal) */
.recent__row--clickable {
  cursor: pointer; border-radius: var(--radius-sm);
  margin: -6px -8px; padding: 6px 8px;
  transition: background 0.14s ease;
}
.recent__row--clickable:hover { background: var(--glass-bg-strong); }
.recent__row--clickable:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--kpi { grid-template-columns: repeat(4, 1fr); }
.grid--split { grid-template-columns: 2fr 1fr; margin-top: 18px; }
.grid--even { grid-template-columns: 1fr 1fr; }

.card { padding: 20px; }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card__head h2 { margin: 0; font-size: 14.5px; font-weight: 650; }
.card__head a { font-size: 12.5px; color: var(--accent); }

/* KPI */
.kpi { padding: 20px; }
.kpi__top { display: flex; align-items: center; justify-content: space-between; }
.kpi__icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.22);
}
.kpi__icon svg { width: 20px; height: 20px; }
.kpi__value { font-size: 28px; font-weight: 720; margin: 16px 0 2px; letter-spacing: -0.5px; }
.kpi__label { font-size: 13px; color: var(--text-1); }
.kpi__delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; }
.kpi__delta.up { color: var(--ok); }
.kpi__delta.down { color: var(--danger); }
.kpi__delta.flat { color: var(--text-2); }

/* Health list — état des systèmes */
.health { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.health__row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--glass-border);
  font-size: 13px;
}
.health__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.health__dot--ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(54, 211, 153, 0.16); }
.health__dot--down { background: var(--danger-fg); box-shadow: 0 0 0 4px var(--danger-soft); }
.health__name { color: var(--text-0); font-weight: 600; }
.health__badge {
  font-size: 10.5px; font-weight: 650; padding: 2px 8px; border-radius: 999px;
  color: var(--warn); background: rgba(245, 196, 81, 0.14);
}
.health__meta {
  margin-left: auto; font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.health__meta--err { color: var(--danger-fg); }
.health__meta--warn { color: var(--warn); font-weight: 600; }
.health__row--missing { border-style: dashed; opacity: 0.85; }
.health__row--missing .health__name { color: var(--text-1); }

/* Health status pill (section header) */
.health-pill {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: auto; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 650;
}
.health-pill__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.health-pill--ok { color: var(--ok); background: var(--ok-soft); }
.health-pill--warn { color: var(--warn); background: rgba(245, 196, 81, 0.14); }
.health-pill--down { color: var(--danger-fg); background: var(--danger-soft); }
.health-pill--unknown { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }

/* API ping banner */
.health-api {
  display: flex; align-items: center; gap: 14px;
  margin-top: 18px; padding: 16px 18px;
}
.health-api .health__dot { width: 11px; height: 11px; }
.health__dot--unknown { background: var(--text-2); box-shadow: 0 0 0 4px rgba(111, 122, 144, 0.16); }
.health-api__body { display: flex; flex-direction: column; gap: 2px; }
.health-api__name { font-size: 14px; font-weight: 700; color: var(--text-0); }
.health-api__state { font-size: 12.5px; }
.health-api__state.ok { color: var(--ok); }
.health-api__state.down { color: var(--danger-fg); }
.health-api__version {
  margin-left: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px; font-weight: 650; color: var(--text-1);
  padding: 4px 11px; border-radius: 999px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.health-api__version:empty { display: none; }

/* Audit table */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-2); font-weight: 600;
  padding: 0 12px 12px;
}
.table td {
  padding: 12px; font-size: 13px; color: var(--text-1);
  border-top: 1px solid var(--glass-border);
}
.table td.actor { color: var(--text-0); font-weight: 600; }
.table code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; color: var(--text-0);
  background: var(--code-bg);
  padding: 2px 7px; border-radius: 6px;
}
.badge {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 650;
  padding: 3px 9px; border-radius: 999px;
}
.badge--ok { color: var(--ok); background: var(--ok-soft); }
.badge--muted { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }

/* Skeleton loaders */
.skeleton {
  display: inline-block; border-radius: 10px;
  background: linear-gradient(100deg,
    var(--surface-inset) 30%,
    var(--glass-bg-strong) 50%,
    var(--surface-inset) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton--text { height: 13px; border-radius: 999px; vertical-align: middle; }
.chart__loader { width: 100%; height: 180px; border-radius: var(--radius-sm); }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* Chart — 30-day registrations curve */
.muted { color: var(--text-2); font-size: 13px; }
.legend { display: inline-flex; gap: 16px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-1); }
.legend__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend__dot--reg { background: var(--accent); }
.legend__dot--cnf { background: var(--ok); }

.chart { position: relative; height: 220px; margin-top: 6px; }
.chart canvas { display: block; max-width: 100%; }
.chart__loader { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart__foot { margin: 12px 0 0; }

/* Heatmap — jour de semaine × heure des inscriptions */
.heatmap { position: relative; margin-top: 8px; overflow-x: auto; }
.heatmap__loader { height: 168px; width: 100%; border-radius: var(--radius-sm); }
.heatmap__empty { padding: 40px 0; text-align: center; }
.heatmap__grid {
  display: grid;
  grid-template-columns: 52px repeat(24, minmax(12px, 1fr));
  grid-auto-rows: 15px;
  gap: 3px;
  align-items: stretch;
  min-width: 580px;
}
.heatmap__hour {
  font-size: 10px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: flex-end; justify-content: center;
}
.heatmap__day {
  font-size: 10.5px; color: var(--text-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
}
.heatmap__cell {
  border-radius: 2px;
  background:
    linear-gradient(var(--cell-tint), var(--cell-tint)),
    var(--surface-inset);
  --cell-tint: color-mix(in srgb, var(--accent) calc(var(--i, 0) * 100%), transparent);
}
/* Anneau au survol : `outline`/`box-shadow` ne participent ni à la mise en page
   ni au débordement scrollable, donc aucun décalage ni ascenseur ne surgit. */
.heatmap__cell:hover {
  outline: 1.5px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px var(--accent-soft);
  cursor: default;
}
.card__head-actions { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.heatmap__legend { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; }
.heatmap__scale {
  width: 88px; height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-inset), var(--accent));
  border: 1px solid var(--glass-border);
}

/* Month on month */
.mom { display: flex; flex-direction: column; gap: 14px; }
.mom__row {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--glass-border);
}
.mom__head { display: flex; align-items: center; justify-content: space-between; }
.mom__head .kpi__delta { margin-top: 0; }
.mom__label { font-size: 13.5px; font-weight: 600; color: var(--text-0); }
.mom__values { display: flex; gap: 24px; margin-top: 12px; }
.mom__num { display: block; font-size: 22px; font-weight: 750; color: var(--text-0); line-height: 1.1; }
.mom__cap { font-size: 11px; color: var(--text-2); }
.mom__prev .mom__num { color: var(--text-1); }

/* Section headers (dashboard groups) */
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 2px 14px;
}
.section-head:first-child { margin-top: 4px; }
.section-head h2 { font-size: 15px; font-weight: 700; margin: 0; color: var(--text-0); }
.section-head__icon {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.section-head__icon svg { width: 17px; height: 17px; }

/* Media status badges */
.badge--published { color: var(--ok); background: var(--ok-soft); }
.badge--pending { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }
.badge--processing { color: var(--brand, #6366f1); background: rgba(99, 102, 241, 0.14); }
.badge--rejected { color: var(--danger-fg); background: var(--danger-soft); }
.badge--failed { color: var(--danger-fg); background: var(--danger-soft); }

/* Top countries ranking */
.ranking { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ranking__row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.ranking__pos { width: 18px; color: var(--text-2); font-weight: 700; font-size: 12px; flex: none; }
.ranking__flag {
  width: 26px; height: 19px; flex: none; border-radius: 3px;
  box-shadow: 0 0 0 1px var(--glass-border);
}
.ranking__name { color: var(--text-0); font-weight: 600; flex: none; min-width: 120px; }
.ranking__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.ranking__bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.ranking__count { color: var(--text-1); font-weight: 650; flex: none; min-width: 28px; text-align: right; }

/* Leaderboard (pilotage) */
.lb { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.lb__row { border-bottom: 1px solid var(--glass-border); }
.lb__row:last-child { border-bottom: 0; }
.lb__link {
  display: flex; align-items: center; gap: 14px; padding: 10px 6px;
  color: inherit; text-decoration: none; border-radius: 10px;
  transition: background 0.15s ease;
}
a.lb__link:hover { background: var(--surface-inset); }
.lb__rank {
  flex: none; width: 30px; text-align: center;
  font-weight: 800; font-size: 14px; color: var(--text-2);
}
.lb__rank--gold { color: #f4c552; }
.lb__rank--silver { color: #b8c0d0; }
.lb__rank--bronze { color: #d08c54; }
.lb__identity { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb__name {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 650; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb__verified { width: 15px; height: 15px; flex: none; color: var(--accent); }
.lb__handle {
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb__badge {
  flex: none; font-size: 12px; font-weight: 600; color: var(--text-2);
  padding: 3px 8px; border-radius: 999px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.lb__value {
  flex: none; min-width: 64px; text-align: right;
  font-size: 15px; font-weight: 800; color: var(--accent);
}
.lb__foot { margin-top: 16px; display: flex; justify-content: center; }

@media (max-width: 560px) {
  .lb__badge { display: none; }
}

/* Level progress (user info) */
.ulevel { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.ulevel__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ulevel__pct { color: var(--text-1); font-weight: 650; font-size: 12px; }
.ulevel__bar { height: 6px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.ulevel__bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.4s ease; }

/* Rang (gamification) : image du sous-rang + libellé du titre. */
.urank { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.urank__icon { flex: none; width: 22px; height: 22px; object-fit: contain; }
.urank__label { min-width: 0; overflow-wrap: anywhere; }

/* Recent media list */
.recent { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.recent__row { display: flex; align-items: center; gap: 12px; }
.recent__thumb {
  width: 44px; height: 44px; border-radius: var(--radius-sm); flex: none;
  object-fit: cover; background: var(--surface-inset);
  border: 1px solid var(--glass-border);
}
.recent__thumb--empty { display: inline-block; }
.recent__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.recent__name {
  font-size: 13.5px; font-weight: 600; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recent__meta { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.recent__flag { width: 16px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px var(--glass-border); flex: none; }

/* Page Médias : galerie de vignettes pleine largeur pour les derniers médias. */
/* Media tab filter toolbar (search + status) */
.mfilter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.mfilter__search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 9px;
  padding: 0 13px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  transition: border-color 0.18s, background 0.18s;
}
.mfilter__search:focus-within { border-color: var(--accent); background: var(--input-bg-strong); }
.mfilter__search svg { flex: none; width: 16px; height: 16px; color: var(--text-2); }
.mfilter__search input { flex: 1; padding: 11px 0; font-size: 14px; color: var(--text-0); background: transparent; border: 0; outline: none; }
.mfilter__status { display: flex; flex-wrap: wrap; gap: 6px; }

.gallery {
  list-style: none; margin: 6px 0 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.gallery--empty { display: block; }
.gallery__foot { margin-top: 16px; text-align: center; }
.gallery__foot[hidden] { display: none; }
.gallery__tile {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: var(--surface-inset); cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.gallery__tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.gallery__tile:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.gallery__tile--skeleton { cursor: default; }
.gallery__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__img--empty { background: var(--surface-inset); }
.gallery__badge { position: absolute; top: 8px; right: 8px; }
.gallery__overlay {
  position: absolute; inset: auto 0 0 0;
  padding: 26px 10px 9px;
  display: flex; flex-direction: column; gap: 1px;
  background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.gallery__name {
  color: #fff; font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery__meta {
  color: rgba(255, 255, 255, .82); font-size: 11.5px;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery__flag {
  width: 16px; height: 12px; border-radius: 2px; flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

/* World map */
.worldmap { position: relative; height: 300px; margin-top: 6px; overflow: hidden; }
.worldmap__loader { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-sm); }
.worldmap__el { width: 100%; height: 100%; overflow: hidden; }
/* jsVectorMap fige une largeur px sur son SVG au build : on borne l'élément à la
   largeur du conteneur pour qu'il ne puisse jamais déborder la carte (mobile). */
.worldmap .jvm-container { max-width: 100%; }
.worldmap svg { max-width: 100%; }
.worldmap .jvm-tooltip {
  background: var(--glass-bg-strong); color: var(--text-0);
  border: 1px solid var(--glass-border); border-radius: 6px;
  font-size: 12px; padding: 4px 8px; box-shadow: var(--shadow, 0 8px 24px -8px rgba(0,0,0,0.4));
}

/* ---------- Explorer (media map) ---------- */
.explore__tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.explore__count {
  font-size: 13px; font-weight: 600; color: var(--text-0);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
  border-radius: 999px; padding: 3px 12px; white-space: nowrap;
}
.explore__map {
  position: relative; height: 60vh; min-height: 420px; margin-top: 6px;
  border-radius: var(--radius-sm); overflow: hidden;
}
.explore__loader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.explore__map .maplibregl-ctrl-attrib { display: none; }
.explore__hint { margin-top: 12px; font-size: 12px; }

/* Desktop : la carte occupe toute la hauteur restante sous la topbar. */
@media (min-width: 861px) {
  [data-explore] { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  [data-explore] .explore { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  [data-explore] .explore__map { flex: 1; height: auto; min-height: 0; }
}

.map-pin {
  width: 42px; height: 42px; padding: 0; cursor: pointer;
  background: var(--surface-inset);
  border: 2px solid var(--pin, var(--accent)); border-radius: 8px;
  overflow: hidden; display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.map-pin img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-pin--empty { background: var(--pin, var(--accent)); }
.map-pin:hover { transform: scale(1.18); z-index: 3; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }

.map-cluster {
  position: relative; width: 46px; height: 46px; padding: 0; cursor: pointer;
  border: 2px solid #fff; border-radius: 50%; overflow: hidden;
  background: var(--accent) center / cover no-repeat;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease;
}
.map-cluster:hover { transform: scale(1.12); z-index: 3; }
.map-cluster__count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  background: rgba(17, 24, 39, 0.55);
}

/* ---------- Géographie page ---------- */
.geo__readonly {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; margin-bottom: 18px;
  font-size: 12.5px; line-height: 1.45;
  border-radius: var(--radius-sm);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.geo__readonly svg { flex: none; width: 16px; height: 16px; color: var(--accent); }

.geo__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.geo__tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; font-size: 13px; font-weight: 600;
  color: var(--text-1); cursor: pointer;
  background: transparent; border: 1px solid var(--glass-border);
  border-radius: 999px; transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.geo__tab:hover { color: var(--text-0); border-color: var(--accent); }
.geo__tab.is-active {
  color: var(--on-accent); border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.geo__tab-icon { display: inline-flex; }
.geo__tab-icon svg { width: 15px; height: 15px; }

.geo__toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.geo__search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 9px;
  padding: 0 13px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  transition: border-color 0.18s, background 0.18s;
}
.geo__search:focus-within { border-color: var(--accent); background: var(--input-bg-strong); }
.geo__search svg { flex: none; width: 16px; height: 16px; color: var(--text-2); }
.geo__search input { flex: 1; padding: 11px 0; font-size: 14px; color: var(--text-0); background: transparent; border: 0; outline: none; }
.geo__filter {
  flex: 0 0 150px; padding: 11px 13px; font-size: 14px;
  color: var(--text-0); text-transform: uppercase;
  border-radius: var(--radius-sm); outline: none;
  background: var(--input-bg); border: 1px solid var(--glass-border);
  transition: border-color 0.18s, background 0.18s;
}
.geo__filter:focus { border-color: var(--accent); background: var(--input-bg-strong); }

.geo__list { list-style: none; margin: 0; padding: 0; }
.geo__row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 4px; border-bottom: 1px solid var(--glass-border);
}
.geo__row:last-child { border-bottom: 0; }
.geo__row--skel { gap: 14px; }
.geo__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.geo__flag {
  width: 26px; height: 19px; flex: none; border-radius: 3px;
  box-shadow: 0 0 0 1px var(--glass-border);
}
.geo__code {
  flex: none; min-width: 44px; text-align: center;
  padding: 3px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--accent); background: var(--accent-soft); border-radius: 6px;
}
.geo__name { font-size: 14px; font-weight: 600; color: var(--text-0); }
.geo__sub { font-size: 12.5px; }
.geo__coords { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; }

.geo__empty { padding: 26px 4px; text-align: center; }
.geo__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.geo__foot .btn-ghost { width: auto; margin-top: 0; }

/* Lignes pays cliquables (ouvrent la modale stats + édition) */
.geo__row--clickable {
  cursor: pointer; border-radius: 8px; padding-left: 8px; padding-right: 8px;
  transition: background 0.15s;
}
.geo__row--clickable:hover,
.geo__row--clickable:focus-visible { background: var(--accent-soft); outline: none; }

/* ---------- Country modal (Geography) ---------- */
[data-country-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-country-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }
.cpnmodal.cpnmodal--wide { width: min(1360px, calc(100vw - 32px)); }

/* Onglets de la modale pays */
.cpntabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--glass-border); }
.cpntab {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--text-1);
  background: transparent; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.cpntab:hover { color: var(--text-0); }
.cpntab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.cpntab-panel[hidden] { display: none; }

/* Badge « traduit / non traduit » */
.trans-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  font-size: 11.5px; font-weight: 600; border-radius: 999px;
}
.trans-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.trans-badge--ok { color: var(--ok); background: var(--ok-soft); }
.trans-badge--missing { color: var(--warn); background: rgba(234, 179, 8, 0.14); }
.trans-badge--unknown { color: var(--text-1); background: var(--input-bg); }
/* Dans la barre de l'éditeur, le badge pousse le sélecteur de locale à droite. */
.country-editor__bar .trans-badge { margin-right: auto; }

/* Récapitulatif des traductions (onglet Statistiques). */
.country-trans { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.country-trans__label { font-size: 12px; }
.country-trans__badges { display: flex; flex-wrap: wrap; gap: 8px; }

.country-modal__flag {
  width: 22px; height: 16px; border-radius: 3px;
  box-shadow: 0 0 0 1px var(--glass-border);
}

.country-stats {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 18px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 10px;
}
.country-stats__kpi { display: flex; flex-direction: column; gap: 2px; flex: none; }
.country-stats__value { font-size: 24px; font-weight: 800; color: var(--text-0); font-variant-numeric: tabular-nums; }
.country-stats__label { font-size: 12px; }
.country-spark { flex: 1; min-width: 120px; display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.country-spark__bar { flex: 1; min-width: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: 0.75; }

.country-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 18px; }
.country-facts__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 2px; border-bottom: 1px solid var(--glass-border);
}
.country-facts__row dt { font-size: 12.5px; }
.country-facts__row dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-0); text-align: right; }
@media (max-width: 560px) { .country-facts { grid-template-columns: 1fr; } }

.country-editor { margin: 0; }
.country-editor__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.country-editor__locale {
  flex: none; padding: 5px 10px; font-size: 12.5px; border-radius: 6px;
  color: var(--text-0); background: var(--input-bg); border: 1px solid var(--glass-border);
}
/* Le fond translucide de l'input ne s'applique pas à la liste native déroulée :
   on fixe un fond opaque + texte lisible pour un contraste correct. */
.country-editor__locale option,
select.country-editor__input option { color: var(--text-0); background: var(--bg-1); }
select.country-editor__input option:disabled { color: var(--text-1); }
.country-editor__area {
  width: 100%; resize: vertical; min-height: 120px; padding: 10px 12px;
  font-family: inherit; font-size: 13px; line-height: 1.5; color: var(--text-0);
  background: var(--input-bg); border: 1px solid var(--glass-border); border-radius: 8px;
}
.country-editor__area:focus { border-color: var(--accent); outline: none; }

/* Champs éditoriaux côte à côte (2 colonnes) sur large écran. */
.country-editor__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.country-editor__col { display: flex; flex-direction: column; }
.country-editor__col .field { margin-bottom: 14px; }
@media (max-width: 720px) { .country-editor__grid { grid-template-columns: 1fr; } }

.country-editor__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.country-editor__heading { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-0); }
.country-editor__localewrap { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.country-editor__input {
  width: 100%; padding: 9px 12px; font-family: inherit; font-size: 13px; color: var(--text-0);
  background: var(--input-bg); border: 1px solid var(--glass-border); border-radius: 8px;
}
.country-editor__input:focus { border-color: var(--accent); outline: none; }
.country-editor__group {
  margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--glass-border); border-radius: 10px;
}
.country-editor__group > legend { padding: 0 8px; font-size: 12.5px; font-weight: 600; color: var(--text-1); }

.country-seasons { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.country-season {
  position: relative; padding: 12px 40px 12px 12px; border: 1px solid var(--glass-border);
  border-radius: 10px; background: var(--glass-bg);
}
.country-season__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.country-season__del {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
  color: var(--text-1); background: transparent; border: 1px solid var(--glass-border);
  border-radius: 6px; cursor: pointer;
}
.country-season__del:hover { color: var(--danger); border-color: var(--danger); }
.country-seasons__add {
  width: auto; margin-top: 4px; padding: 6px 12px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
@media (max-width: 560px) { .country-season__grid { grid-template-columns: 1fr; } }

/* ---------- Users page ---------- */
/* Account badges */
.badge--verified { color: var(--accent); background: var(--accent-soft); }
.badge--active { color: var(--ok); background: var(--ok-soft); }
.badge--unconfirmed { color: var(--warn); background: rgba(234, 179, 8, 0.14); }
.badge--banned { color: var(--danger-fg); background: var(--danger-soft); }
.badge--deleted { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }

/* Composition donut */
.donut { position: relative; height: 240px; margin-top: 6px; }
.donut canvas { display: block; }
.donut__loader { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.donut__center {
  position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%); text-align: center;
  pointer-events: none; display: flex; flex-direction: column; gap: 2px;
}
.donut__rate { font-size: 26px; font-weight: 760; color: var(--text-0); line-height: 1; letter-spacing: -0.5px; }
.donut__cap { font-size: 11px; color: var(--text-2); }

/* Indicator meters */
.meters { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.meter { display: flex; flex-direction: column; gap: 8px; }
.meter__head { display: flex; align-items: center; justify-content: space-between; }
.meter__label { font-size: 13px; font-weight: 600; color: var(--text-0); }
.meter__val { font-size: 12px; color: var(--text-2); font-weight: 600; }
.meter__bar { height: 7px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.meter__bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter__bar--accent { background: var(--accent); }
.meter__bar--danger { background: var(--danger); }
.meter__bar--muted { background: var(--text-2); }

/* Recent sign-ups list */
.ulist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.urow { border-bottom: 1px solid var(--glass-border); }
.urow:last-child { border-bottom: 0; }
.urow__link {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 14px; color: inherit; text-decoration: none;
  border-radius: 12px; transition: background 0.16s ease;
}
a.urow__link { cursor: pointer; }
a.urow__link:hover { background: var(--surface-inset); }
.uavatar {
  position: relative; overflow: hidden;
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--glass-border);
}
.uavatar__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.uinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.uname {
  font-size: 14px; font-weight: 650; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.umeta {
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.urow__aside { flex: none; display: flex; align-items: center; gap: 24px; }
.ustats {
  display: flex; align-items: center;
  font-size: 12px; color: var(--text-2);
}
.ustat { position: relative; white-space: nowrap; padding: 0 14px; }
.ustat:first-child { padding-left: 0; }
.ustat:last-child { padding-right: 0; }
.ustat + .ustat::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 11px; background: var(--glass-border);
}
.ustat b { color: var(--text-0); font-weight: 700; }
.ujoined { font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.urow__aside .badge { min-width: 96px; justify-content: center; }
@media (max-width: 860px) {
  .urow__aside { gap: 14px; }
  .ustats, .ujoined { display: none; }
}
.ulist__foot {
  display: flex; align-items: center; justify-content: center;
  margin-top: 16px; min-height: 20px;
}
.btn-ghost {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--text-1); background: var(--surface-inset);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 9px 18px; transition: color 0.16s ease, border-color 0.16s ease;
}
.btn-ghost:hover { color: var(--text-0); border-color: var(--accent); }
.btn-ghost--danger { color: var(--danger); }
.btn-ghost--danger:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Single-user detail page ---------- */
.section-head__back {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: var(--text-1);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
  transition: color 0.16s ease, border-color 0.16s ease;
}
.section-head__back:hover { color: var(--text-0); border-color: var(--accent); }
.section-head__back svg { width: 17px; height: 17px; }

.uhead { position: relative; display: flex; flex-direction: column; gap: 18px; }
.uhead__body { display: flex; align-items: center; gap: 18px; }
.uavatar-wrap { position: relative; flex: none; }

/* Pastille « compte vérifié » accolée à l'avatar */
.uverif {
  position: absolute; top: -3px; right: -3px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: 2px solid var(--bg-1);
  box-shadow: 0 1px 4px rgba(5, 8, 15, 0.35);
}
.uverif[hidden] { display: none; }
.uverif svg { width: 13px; height: 13px; stroke-width: 3; }

/* Avatar / cover edit controls */
.uimg-ctl { display: flex; gap: 6px; }
.uimg-ctl--cover { position: absolute; top: 12px; right: 12px; z-index: 2; }
.uimg-ctl--avatar { position: absolute; right: -6px; bottom: -6px; }
.uimgbtn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 6px 10px; border-radius: 9px;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-0);
  background: var(--glass-bg-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: color 0.16s ease, border-color 0.16s ease;
}
.uimgbtn:hover { border-color: var(--accent); }
.uimgbtn svg { width: 15px; height: 15px; }
.uimgbtn--icon { padding: 6px; border-radius: 50%; }
.uimgbtn--danger:hover { color: var(--danger); border-color: var(--danger); }
.uimg-ctl.is-busy { opacity: 0.55; pointer-events: none; }

/* Overlay de chargement pendant l'upload/retrait d'avatar ou de couverture */
.uavatar-wrap.is-busy::before,
.ucover.is-busy::before {
  content: ""; position: absolute; inset: 0; z-index: 3;
  border-radius: inherit; background: rgba(5, 8, 15, 0.5);
}
.uavatar-wrap.is-busy::after,
.ucover.is-busy::after {
  content: ""; position: absolute; z-index: 4;
  top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  animation: imgUpload 0.7s linear infinite;
}
.uavatar-wrap.is-busy::after { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
@keyframes imgUpload { to { transform: rotate(360deg); } }

.ucover {
  position: relative;
  margin: -4px -4px 0; border-radius: var(--radius-sm); overflow: hidden;
  height: 160px; background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.ucover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uhead__avatar { width: 64px; height: 64px; font-size: 22px; overflow: hidden; }
.uhead__avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.uhead__id { min-width: 0; flex: 1; }
.uhead__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.uhead__name { font-size: 20px; font-weight: 740; margin: 0; color: var(--text-0); letter-spacing: -0.4px; }
.uhead__meta { display: flex; align-items: center; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.uhead__handle { font-size: 13px; color: var(--accent); font-weight: 600; }
.uhead__email { font-size: 13px; color: var(--text-2); }

.ufields { margin: 0; display: flex; flex-direction: column; gap: 0; }
.ufield {
  display: flex; align-items: baseline; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--glass-border);
}
.ufield:last-child { border-bottom: 0; }
.ufield dt { flex: none; width: 110px; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin: 0; }
.ufield dd { margin: 0; font-size: 13.5px; color: var(--text-0); min-width: 0; }

.ustates { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.uqr { margin-top: 16px; display: flex; align-items: center; gap: 12px; }
/* `display: flex` ci-dessus bat la règle UA `[hidden]` : on rétablit le masquage. */
.uqr[hidden] { display: none; }
.uqr__link {
  display: block; flex: none; width: 92px; height: 92px; padding: 6px;
  background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
}
.uqr__img { display: block; width: 100%; height: 100%; }
.uqr__label { font-size: 12px; }
.ustate {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.ustate__dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--text-2); }
.ustate--on { color: var(--text-0); }
.ustate--on .ustate__dot { background: var(--ok); }
.ustate--off { color: var(--text-2); }

.uactions { display: flex; flex-direction: column; gap: 12px; }
.uact {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; text-align: center;
}
.uact[hidden] { display: none; }
.uact svg { width: 16px; height: 16px; flex: none; }
.uact:disabled { opacity: 0.45; cursor: not-allowed; }
.uact:disabled:hover { color: var(--text-1); border-color: var(--glass-border); }
.uact--danger { color: var(--danger-fg); border-color: var(--danger-border); }
.uact--danger:hover:not(:disabled) { color: var(--danger-fg); border-color: var(--danger); }
.uban__until,
.uban__reason {
  font: inherit; font-size: 13px; color: var(--text-0); width: 100%;
  background: var(--input-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 8px 12px; outline: none;
}
.uban__until:focus,
.uban__reason:focus { border-color: var(--accent); }
.uactions__note { margin: 2px 0 0; font-size: 12px; }

/* Bandeau « compte banni » en tête de la carte Administration. */
.uban-notice {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--danger-soft); border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
}
.uban-notice[hidden] { display: none; }
.uban-notice__icon { color: var(--danger); flex: none; line-height: 0; margin-top: 1px; }
.uban-notice__icon svg { width: 18px; height: 18px; }
.uban-notice__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.uban-notice__title { font-size: 13.5px; color: var(--danger-fg); }
.uban-notice__countdown { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.uban-notice__countdown[hidden] { display: none; }
.uban-notice__remaining { font-size: 16px; font-weight: 700; color: var(--danger-fg); }
.uban-notice__until { font-size: 12px; }
.uban-notice__reason {
  margin: 2px 0 0; font-size: 12.5px; color: var(--text-1);
  white-space: pre-wrap; word-break: break-word;
}
.uban-notice__reason[hidden] { display: none; }

/* Modale de bannissement — réutilise le voile `.modal`, panneau compact. */
.modal--form { z-index: 120; }
.banmodal {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.18s ease;
}
.modal--form.is-open .banmodal { transform: translateY(0) scale(1); }
.banmodal__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-right: 32px; }
.banmodal__icon {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--danger);
  background: var(--danger-soft); border: 1px solid var(--danger-border);
}
.banmodal__icon svg { width: 19px; height: 19px; }
.banmodal__title { margin: 0; font-size: 16px; }
.banmodal__sub { margin: 2px 0 0; font-size: 12.5px; }
.banmodal__body { display: flex; flex-direction: column; gap: 8px; }
.banmodal__label { font-size: 12px; color: var(--text-1); margin-top: 6px; }
.banmodal__hint { margin: 2px 0 0; font-size: 12px; }
.banpresets { display: flex; flex-wrap: wrap; gap: 8px; }
.banpreset {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  color: var(--text-1); background: var(--input-bg);
  border: 1px solid var(--glass-border);
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.banpreset:hover { color: var(--text-0); border-color: var(--accent-border); }
.banpreset.is-active {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.banpreset--permanent.is-active {
  color: var(--danger-fg); background: var(--danger-soft); border-color: var(--danger);
}
.banmodal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.banmodal__foot .btn,
.banmodal__foot .btn-ghost { width: auto; }

.utimeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.utl {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-bottom: 1px solid var(--glass-border); font-size: 13px;
}
.utl:last-child { border-bottom: 0; }
.utl__label { color: var(--text-1); font-weight: 600; }
.utl__value { color: var(--text-2); }

/* Profile edit form */
.uform__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.uform__field { margin-bottom: 14px; }
.uform__field--full { grid-column: 1 / -1; }
.uform__field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 14px;
  color: var(--text-0); border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  outline: none; resize: vertical; min-height: 84px;
  transition: border-color 0.18s, background 0.18s;
}
.uform__field textarea:focus { border-color: var(--accent); background: var(--input-bg-strong); }
.uform__field.is-invalid input,
.uform__field.is-invalid textarea { border-color: var(--danger); }
.uform__err { margin: 6px 0 0; font-size: 12px; color: var(--danger); }
.uform__foot { display: flex; justify-content: flex-end; margin-top: 4px; }
.uform__submit { width: auto; margin-top: 0; padding: 11px 20px; }
.uform__submit[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 640px) { .uform__grid { grid-template-columns: 1fr; } }

/* Tabs */
.tabs {
  display: flex; gap: 4px; margin: 18px 0 4px;
  border-bottom: 1px solid var(--glass-border);
  /* Barre d'onglets : défile horizontalement en interne plutôt que d'élargir la
     page quand les onglets ne tiennent pas (mobile). */
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--text-2); background: none; border: 0;
  padding: 11px 16px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 0.16s ease, border-color 0.16s ease;
  flex: 0 0 auto; white-space: nowrap;
}
.tab:hover { color: var(--text-0); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tabpanel { margin-top: 18px; display: flex; flex-direction: column; gap: 18px; }
.tabpanel[hidden] { display: none; }
.tabpanel .grid--split { margin-top: 0; }

/* Audit trail (user history tab) */
.audit { list-style: none; margin: 0; padding: 0; }
.audit__row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.audit__row:last-child { border-bottom: 0; }
.audit__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audit__actor { font-size: 13px; color: var(--text-1); font-weight: 600; }
.audit__actor--system { color: var(--text-2); font-weight: 500; font-style: italic; }
.audit__date { font-size: 12px; color: var(--text-2); margin-left: auto; }
.audit__meta { display: flex; flex-direction: column; gap: 5px; }
.audit__diff {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2);
}
.audit__diff-label { color: var(--text-1); font-weight: 600; }
.audit__from { color: var(--text-2); text-decoration: line-through; opacity: 0.8; }
.audit__arrow { color: var(--text-2); }
.audit__to { color: var(--text-0); font-weight: 600; }
.audit__reason {
  font-size: 12.5px; color: var(--text-1);
  padding: 7px 11px; border-radius: 9px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.audit__reason b { color: var(--text-2); font-weight: 600; }
.audit__ip { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.audit__empty { padding: 40px 0; text-align: center; }
.audit__foot { display: flex; justify-content: center; margin-top: 16px; }

/* Comments (user moderation tab) */
.comments { list-style: none; margin: 0; padding: 0; }
.comment {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.comment:last-child { border-bottom: 0; }
.comment__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.comment__body {
  margin: 0; font-size: 13.5px; color: var(--text-0); line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.comment--deleted .comment__body { color: var(--text-2); text-decoration: line-through; opacity: 0.75; }
.comment__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment__date { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.comment__edited { font-size: 11.5px; color: var(--text-2); font-style: italic; }
.comment__tag {
  font-size: 11px; color: var(--text-2);
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.comment__actions { flex: 0 0 auto; }
.comment__btn { padding: 6px 12px; font-size: 12.5px; }
.comment__btn--danger { color: var(--danger); }
.comments__empty { padding: 40px 0; text-align: center; }
.comments__foot { display: flex; justify-content: center; margin-top: 16px; }

/* Media grid (user gallery tab) */
.umedia__empty { padding: 40px 0; text-align: center; }
.umedia__foot { margin-top: 18px; text-align: center; }
.umedia__foot[hidden] { display: none; }
.mgrid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.mcard {
  display: flex; flex-direction: column; gap: 8px; cursor: pointer;
  padding: 0; background: none; border: 0; font: inherit; text-align: left;
}
.mcard__thumb {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden;
  border-radius: 14px; background: var(--surface-inset);
  border: 1px solid var(--glass-border);
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.mcard:hover .mcard__thumb { border-color: var(--accent); transform: translateY(-2px); }
.mcard__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard__noimg {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 28px; font-weight: 700; color: var(--text-2);
}
.mcard__status {
  position: absolute; left: 8px; top: 8px;
  backdrop-filter: blur(6px);
}
.mcard__name {
  font-size: 12.5px; color: var(--text-1); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mcard__stats {
  display: flex; gap: 10px; font-size: 11.5px; color: var(--text-2);
}

/* ── Onglet « Médias » de la fiche utilisateur ─────────────────────────────
   Indicateurs (agrégats serveur, tout le compte) puis filtres appliqués aux
   médias chargés. La ligne de portée dit toujours sur quoi ils portent. */
.ums-kpi { margin-bottom: 18px; }
.ums-kpi[hidden] { display: none; }
.ums-kpi__split { margin: 6px 0 0; font-size: 11.5px; line-height: 1.4; }

.ums-countries { margin-bottom: 18px; }
.ums-countries[hidden] { display: none; }
.ums-ctry { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ums-ctry__row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ums-ctry__name { flex: 0 0 auto; min-width: 110px; color: var(--text-1); }
.ums-ctry__bar {
  flex: 1 1 auto; height: 6px; border-radius: 999px;
  background: var(--surface-inset); overflow: hidden;
}
.ums-ctry__bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.ums-ctry__count { flex: 0 0 auto; font-weight: 600; color: var(--text-0); }
.ums-ctry__none { margin: 12px 0 0; font-size: 12.5px; }
.ums-ctry__none[hidden] { display: none; }

.ums-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  margin-bottom: 14px;
}
.ums-filters[hidden] { display: none; }
/* Deux classes délibérément : `.field` est déclarée plus bas dans ce fichier et,
   à spécificité égale, réimposerait sa `margin-bottom` — ce qui décalait cette
   barre de filtres d'une quinzaine de pixels. */
.ums-filters .ums-filters__field { margin: 0; min-width: 150px; }
.ums-filters .ums-filters__field--group { min-width: 0; }
.ums-filters__label {
  display: block; margin-bottom: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  line-height: 1.4;
}
/* Aligne la hauteur du groupe de statuts sur celle des listes déroulantes
   voisines (25px de contenu + 2×10px), pour que les quatre contrôles forment
   une ligne franche et que leurs libellés partagent la même ligne de base. */
.ums-filters .mm-period { padding: 10px; }
.ums-scope { margin: 0 0 14px; font-size: 12.5px; }
.ums-scope[hidden] { display: none; }
@media (max-width: 760px) {
  /* Même double classe qu'au-dessus : sans elle, le `min-width: 150px` du bloc
     de base l'emporterait ici et empêcherait les champs de se replier. */
  .ums-filters .ums-filters__field { min-width: 0; flex: 1 1 140px; }
  /* Le groupe de statuts est le plus large : il prend la ligne pour lui. */
  .ums-filters .ums-filters__field--group { flex: 1 1 100%; }
  .ums-ctry__name { min-width: 0; }
}

/* Reactions (user reactions tab) */
.rx-sentiment { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.rx-sentiment__chart {
  position: relative; flex: 0 0 auto;
  width: 150px; height: 150px; display: grid; place-items: center;
}
.rx-sentiment__chart canvas { max-width: 100%; max-height: 100%; }
.rx-sentiment__empty { position: absolute; font-size: 12.5px; text-align: center; }
.rx-sentiment__legend { flex: 1 1 140px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rx-sentiment__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rx-sentiment__row dt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-1); margin: 0; }
.rx-sentiment__row dd { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }
.rx-sentiment__row--ratio { padding-top: 10px; border-top: 1px solid var(--glass-border); }
.rx-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.rx-dot--like { background: #22c55e; }
.rx-dot--dislike { background: #ef4444; }

.rx-list { list-style: none; margin: 0; padding: 0; }
.rx-list__empty { padding: 40px 0; text-align: center; }
.rx-list__foot { display: flex; justify-content: center; margin-top: 16px; }
.rx-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
}
.rx-item:last-child { border-bottom: 0; }
.rx-item__thumb {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px; overflow: hidden;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.rx-item__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rx-item__noimg { display: block; width: 100%; height: 100%; }
.rx-item__body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rx-item__date { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rx-badge--like { color: #16a34a; background: rgba(34, 197, 94, 0.14); }
.rx-badge--dislike { color: #dc2626; background: rgba(239, 68, 68, 0.14); }

/* Sessions (user sessions tab) */
.sx-count { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.sx-list { list-style: none; margin: 0; padding: 0; }
.sx-list__empty { padding: 40px 0; text-align: center; }
.sx-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.sx-item:last-child { border-bottom: 0; }
.sx-item--expired { opacity: 0.62; }
.sx-item__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sx-item__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sx-item__device {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13.5px; font-weight: 600; color: var(--text-0);
}
.sx-item__part { display: inline-flex; align-items: center; gap: 6px; }
.sx-item__icon { width: 16px; height: 16px; flex: none; object-fit: contain; }
.sx-item__sep { color: var(--text-2); font-weight: 400; }
.sx-item__model {
  font-size: 12px; font-weight: 600; color: var(--text-1);
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.sx-badge--mobile { color: var(--accent); background: var(--accent-soft); }
.sx-item__country { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-1); }
.sx-item__flag { width: 18px; height: 13px; flex: none; object-fit: cover; border-radius: 2px; }
.sx-item__flag-emoji { font-size: 14px; line-height: 1; }
.sx-item__ip { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sx-item__meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sx-item__field { display: flex; flex-direction: column; font-size: 12px; color: var(--text-1); }
.sx-item__field b { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-2); }
.sx-item__actions { flex: 0 0 auto; }
.sx-item__btn { padding: 6px 12px; font-size: 12.5px; }
.sx-badge--active { color: var(--ok); background: var(--ok-soft); }
.sx-badge--expired { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }

/* Ledger (user grand-livre tab) — soldes + historique des écritures */
.lg-balances {
  display: grid; gap: 12px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.lg-balances[hidden] { display: none; }
.lg-balances__empty { padding: 8px 0 18px; }
.lg-bal {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.lg-bal__type { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-2); }
.lg-bal__amount { font-size: 22px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }
.lg-bal__cur { font-size: 13px; font-weight: 600; color: var(--text-1); }
.lg-bal__at { font-size: 11px; }

.lg-filter { flex: none; }
.lg-list { list-style: none; margin: 0; padding: 0; }
.lg-list__empty { padding: 40px 0; text-align: center; }
.lg-list__foot { margin-top: 14px; text-align: center; }
.lg-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
}
.lg-item:last-child { border-bottom: 0; }
.lg-item--reversed { opacity: 0.6; }
.lg-item--reversed .lg-item__amount { text-decoration: line-through; }
.lg-item__main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lg-item__event { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--text-0); }
.lg-item__ref {
  font-size: 10.5px; font-weight: 650; padding: 1px 7px; border-radius: 999px;
  color: var(--text-1); background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.lg-item__tag { font-size: 10.5px; }
.lg-item__meta { font-size: 12px; }
.lg-item__ctx { font-size: 12px; color: var(--text-1); overflow-wrap: anywhere; }
.lg-item__amount {
  flex: none; font-size: 14.5px; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.lg-item__amount--credit { color: var(--ok); }
.lg-item__amount--debit { color: var(--danger-fg); }
.lg-item__cur { font-size: 12px; font-weight: 600; color: var(--text-2); }

/* ── Console Ledger (page admin) ──────────────────────────────────────── */
.lgc-intro { flex: 1 1 auto; margin: 0; font-size: 12.5px; }
.lgc-table-wrap { overflow-x: auto; }
.lgc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lgc-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-2);
  border-bottom: 1px solid var(--glass-border); white-space: nowrap;
}
.lgc-table td { padding: 11px 12px; border-bottom: 1px solid var(--glass-border); vertical-align: middle; }
.lgc-row:last-child td { border-bottom: 0; }
.lgc-num { text-align: right; font-variant-numeric: tabular-nums; }
.lgc-code {
  padding: 2px 8px; border-radius: 6px; font-weight: 650; font-size: 12.5px;
  background: var(--accent-soft); color: var(--accent);
}
.lgc-actions { text-align: right; white-space: nowrap; }
.lgc-act { width: auto; margin: 0 0 0 6px; display: inline-flex; padding: 5px 11px; font-size: 12px; }
.lgc-empty { padding: 32px 0; text-align: center; }
.lgc-sys-note { flex: 1 1 auto; font-size: 12px; }

/* ── Page « Jobs & files » : workers et journal des passages ─────────── */
/* Ligne en retard : c'est le signal que l'écran existe pour donner. */
.wk-row--overdue { background: var(--danger-soft); }
.wk-fail { color: var(--danger-fg); font-weight: 600; }
.wk-note { margin: 12px 0 0; font-size: 12px; }

.wk-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-filter__search { flex: 0 1 220px; }

.wk-runs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.wk-run {
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 6px;
}
.wk-run:last-child { border-bottom: 0; }
.wk-run__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-run__worker {
  padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 650;
  background: var(--accent-soft); color: var(--accent);
}
.wk-run__meta { font-size: 12px; }
.wk-run__summary {
  font-size: 12.5px; color: var(--text-1);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere;
}
.wk-run__message {
  margin: 0; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--danger-fg);
  background: var(--danger-soft); overflow-wrap: anywhere;
}

/* Révélation de la modale monnaie : `.modal{display:flex}` bat la règle UA
   `[hidden]`, donc on restaure la coupure puis on pilote opacité/visibilité et
   la translation du panneau via `:not([hidden])` (même schéma que les autres
   modales `.modal--form` du back-office). */
[data-currency-modal][hidden] { display: none; }
[data-currency-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-currency-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

/* ── Page « Topics » (référentiel des thèmes) ─────────────────────────── */
.tpc-table-wrap { overflow-x: auto; }
.tpc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tpc-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-2);
  border-bottom: 1px solid var(--glass-border); white-space: nowrap;
}
.tpc-table td { padding: 10px 12px; border-bottom: 1px solid var(--glass-border); vertical-align: middle; }
.tpc-row { cursor: pointer; transition: background 0.14s ease; }
.tpc-row:hover { background: var(--glass-bg); }
.tpc-row--skeleton { cursor: default; }
.tpc-row--skeleton:hover { background: none; }
.tpc-row:last-child td { border-bottom: 0; }
.tpc-num { text-align: right; font-variant-numeric: tabular-nums; }
.tpc-name { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-weight: 600; color: var(--text-0); }
.tpc-emoji { flex: none; font-size: 16px; line-height: 1; }
.tpc-emoji--none { color: var(--text-2); font-size: 13px; }
.tpc-slug {
  padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--surface-inset); color: var(--text-1);
}
.tpc-actions { text-align: right; white-space: nowrap; }
.tpc-act { width: auto; margin: 0 0 0 6px; display: inline-flex; padding: 5px 11px; font-size: 12px; }
.tpc-empty { padding: 32px 0; text-align: center; }

/* Bloc info (édition) : libellés + usage. */
.tpc-info {
  margin-top: 4px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 8px;
}
.tpc-info__labels { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.tpc-info__title { font-weight: 600; color: var(--text-1); }
.tpc-info__missing { color: var(--warn); }
.tpc-info__ok { color: var(--ok); }
.tpc-info__usage { margin: 0; font-size: 12px; }
.tpc-foot-spacer { flex: 1 1 auto; }
.tpc-del { width: auto; margin: 0; }

/* Récap d'envoi des notifications (page Notifications). */
.ntf-result { display: block; margin-top: 16px; }
.ntf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.ntf-stat {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.ntf-stat__val { font-size: 22px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }
.ntf-stat__cap { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-2); }
.ntf-stat--ok .ntf-stat__val { color: var(--ok); }
.ntf-stat--err .ntf-stat__val { color: var(--danger-fg); }

/* Formulaire de composition d'annonce. */
.ntf-form { margin-top: 4px; display: flex; flex-direction: column; gap: 14px; }
.ntf-form__locales { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ntf-loc__title { margin: 0 0 8px; font-size: 13px; font-weight: 650; color: var(--text-0); }
.ntf-loc__req { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.ntf-target { width: max-content; max-width: 100%; }
.ntf-broadcast-warn { margin: 0; }
[data-ntf-ids] { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.ntf-form__foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.ntf-form__foot .btn { width: auto; margin: 0; flex: none; }
.ntf-progress { flex: 1 1 200px; min-width: 0; margin: 0; }
@media (max-width: 760px) { .ntf-form__locales { grid-template-columns: 1fr; } }

/* Révélation de la modale thème (même schéma que les autres `.modal--form`). */
[data-topic-modal][hidden] { display: none; }
[data-topic-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-topic-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

/* Journal — barre de filtres */
.lgj-filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--glass-border);
}
.lgj-filter { flex: 1 1 160px; margin: 0; min-width: 0; }
.lgj-filter > span { display: block; margin-bottom: 5px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.lgj-filter--date { flex: 0 1 150px; }
.lgj-filter__actions { display: flex; gap: 8px; align-items: center; }
.lgj-filter__actions .btn,
.lgj-filter__actions .btn-ghost { width: auto; margin: 0; padding: 8px 16px; }
.lgj-user {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px;
  color: var(--accent); text-decoration: none;
}
.lgj-user:hover { text-decoration: underline; }
.lgj-list .lg-item__meta { display: inline; }

/* Referrals (user filleuls tab) */
.rf-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.rf-stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.rf-stat__value { font-size: 22px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }
.rf-stat__label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-2); }
.rf-code { margin: 14px 0 0; font-size: 12.5px; }
.rf-code code {
  padding: 2px 8px; border-radius: 6px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}
.rf-chart { position: relative; height: 200px; }
.rf-chart__empty { position: absolute; inset: 0; display: grid; place-items: center; }

.rf-tree { list-style: none; margin: 0; padding: 0; }
.rf-tree__empty { padding: 40px 0; text-align: center; }
.rf-tree__foot { display: flex; justify-content: center; margin-top: 16px; }
.rf-node { list-style: none; }
.rf-node__row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
}
.rf-node__toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-width: 44px; padding: 4px 8px; border-radius: 8px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
  color: var(--text-1); cursor: pointer;
}
.rf-node__toggle--leaf { background: none; border: 0; cursor: default; min-width: 44px; }
.rf-node__chevron {
  width: 0; height: 0; border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
.rf-node.is-open > .rf-node__row .rf-node__chevron { transform: rotate(90deg); }
.rf-node__badge { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rf-node__media { flex: 0 0 auto; }
.rf-node__avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
  object-fit: cover; font-size: 13px; font-weight: 700; color: var(--text-1);
}
.rf-node__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rf-node__name { font-size: 13.5px; font-weight: 600; color: var(--text-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-node__handle { font-size: 12px; color: var(--text-2); }
.rf-node__meta { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.rf-node__date { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rf-node__stat { font-size: 12px; color: var(--text-1); font-variant-numeric: tabular-nums; }
.rf-badge--ok { color: var(--ok); background: var(--ok-soft); }
.rf-badge--pending { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }
.rf-node__children { list-style: none; margin: 0; padding: 0 0 0 32px; border-left: 1px solid var(--glass-border); }
.rf-node__more { display: flex; justify-content: center; padding: 12px 0; }
.rf-node__empty, .rf-node__error { padding: 12px 0; font-size: 12.5px; }

@media (max-width: 680px) {
  .uhead { flex-direction: column; text-align: center; }
  .uhead__top, .uhead__meta { justify-content: center; }
  .rf-stats { grid-template-columns: 1fr; }
  .rf-node__row { flex-wrap: wrap; }
  .rf-node__meta { justify-content: flex-start; width: 100%; }
}

/* Placeholder */
.placeholder {
  margin-top: 8px; padding: 56px 32px; text-align: center;
}
.placeholder__icon {
  width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 16px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.22);
}
.placeholder h2 { margin: 0 0 8px; font-size: 20px; }
.placeholder p { margin: 0 auto; max-width: 460px; color: var(--text-1); font-size: 14px; line-height: 1.6; }

/* ---------- Maintenance / ops ---------- */
.ops { margin-top: 8px; padding: 22px 24px; }
.ops__head { display: flex; align-items: center; gap: 18px; }
.ops__icon {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(108, 140, 255, 0.22);
}
.ops__icon svg { width: 22px; height: 22px; }
.ops__intro { flex: 1; min-width: 0; }
.ops__intro h2 { margin: 0 0 4px; font-size: 16px; color: var(--text-0); }
.ops__intro p { margin: 0; font-size: 13px; line-height: 1.55; }
.ops .btn { width: auto; margin-top: 0; flex: none; display: inline-flex; align-items: center; gap: 8px; }
.ops .btn svg { width: 16px; height: 16px; }
.ops .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.ops__progress { margin-top: 20px; }
.ops__bar { height: 8px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.ops__bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}
.ops__meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 13px; }
.ops__meta [data-reindex-status],
.ops__meta [data-bfgeo-status] { font-weight: 600; color: var(--text-0); }
/* Bouton d'arrêt logé dans la ligne de méta : compact, et `align-self` l'empêche
   de s'étirer sur la hauteur de la ligne (le conteneur est en `stretch`).
   Sélecteur à deux classes délibérément : `.btn` est déclarée plus bas dans ce
   fichier et, à spécificité égale, l'emporterait avec son `width: 100%`. */
.ops__meta .ops__cancel {
  align-self: center; width: auto; margin: 0 0 0 auto;
  padding: 5px 12px; font-size: 12px;
}
.ops__meta .ops__cancel[hidden] { display: none; }
/* Sélecteur de portée d'une opération (ex. backfill géo : lacunes vs tout). */
.ops__modes { margin-top: 14px; }
.ops__modes .mm-hint { margin-top: 8px; }
.ops__modes .mm-period__btn:disabled { cursor: not-allowed; opacity: 0.55; }
.ops .alert { margin: 16px 0 0; }
.ops .alert[hidden] { display: none; }

/* Bascule du mode maintenance */
.mnt--on { border-color: var(--danger-border); }
.mnt__icon.is-on { background: var(--danger-soft); color: var(--danger-fg); border-color: var(--danger-border); }
/* Démographie (onglet « Utilisateurs » des statistiques). */
.dmg__freshness { font-size: 12.5px; font-weight: 600; }
.dmg__freshness[hidden] { display: none; }
.dmg__freshness.is-fresh { color: var(--ok); }
.dmg__freshness.is-stale { color: var(--warn); }
.dmg__note { margin: 10px 0 0; font-size: 12px; }
/* Pyramide des âges : une ligne PAR ANNÉE (~80-100 barres), d'où une hauteur
   généreuse — en dessous, la silhouette s'écrase et devient illisible.
   Hauteur UNIQUE, volontairement : Chart.js redimensionne son canvas sur la
   largeur, pas sur une hauteur changée par media query — un point de rupture
   ici laissait le canvas à son ancienne taille après une rotation d'écran. */
.dmg-pyramid { position: relative; height: 560px; margin-top: 6px; }
.dmg-pyramid canvas { display: block; max-width: 100%; }
/* Pastilles de légende alignées sur les couleurs des sexes (mêmes valeurs que
   SEX_HUES côté JS, déclinées par thème). */
.legend__dot.dmg-dot--male { background: #2a78d6; }
.legend__dot.dmg-dot--female { background: #008300; }
:root[data-theme="dark"] .legend__dot.dmg-dot--male { background: #3987e5; }

/* Camemberts (âge / sexe) : hauteur fixe, la légende Chart.js tient dessous. */
.dmg-pie { position: relative; height: 260px; margin-top: 6px; }
.dmg-pie canvas { display: block; max-width: 100%; }
.dmg-pie__loader { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: var(--radius-sm); }

.mnt__state { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--text-0); }
.mnt__state[hidden] { display: none; }
.mnt--on .mnt__state { color: var(--danger-fg); }
.mnt__toggle[hidden] { display: none; }
.mnt__toggle--danger {
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #d6455c);
  box-shadow: 0 12px 28px -10px var(--danger);
}
.mnt__toggle--danger:hover { box-shadow: 0 16px 34px -10px var(--danger); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login__card { width: 100%; max-width: 400px; padding: 34px 32px; }
.login__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login__card h1 { font-size: 20px; margin: 0 0 4px; }
.login__card .sub { color: var(--text-2); font-size: 13px; margin: 0 0 24px; }
.alert {
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 18px;
}
.alert--error {
  color: var(--danger-fg);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
}
.alert--ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 1px solid var(--glass-border);
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-1); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 12px 14px; font-size: 14px;
  color: var(--text-0); border-radius: var(--radius-sm);
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  outline: none; transition: border-color 0.18s, background 0.18s;
}
.field input:focus { border-color: var(--accent); background: var(--input-bg-strong); }
.btn {
  width: 100%; padding: 12px 16px; font-size: 14px; font-weight: 650;
  color: var(--on-accent); cursor: pointer; border: 0;
  border-radius: var(--radius-sm); margin-top: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px -10px var(--accent);
  transition: transform 0.12s, box-shadow 0.18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -10px var(--accent); }
.btn--danger {
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #d6455c);
  box-shadow: 0 12px 28px -10px var(--danger);
}
.btn--danger:hover { box-shadow: 0 16px 34px -10px var(--danger); }
.btn--soft {
  color: var(--text-0);
  background: var(--glass-fill, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--glass-border-strong);
  box-shadow: none;
}
.btn--soft:hover { box-shadow: none; border-color: var(--accent-border); }
.btn.is-loading { opacity: 0.7; pointer-events: none; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

/* ---------- Assistant IA (onglet Édition) ---------- */
.mm-ai {
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.mm-ai__head h3 { margin: 0; font-size: 13.5px; font-weight: 650; color: var(--text-0); }
.mm-ai__head .mm-hint { color: var(--text-1); }
.mm-ai__controls {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap;
}
.mm-ai__controls .btn { width: auto; flex: none; margin-top: 0; white-space: nowrap; }
.mm-ai__controls .btn svg { width: 15px; height: 15px; flex: none; }
/* Pastille d'état de la file IA (`media_to_describe`). */
.mm-queue-state {
  flex: none; font-size: 11.5px; font-weight: 650; padding: 3px 10px; border-radius: 999px;
  color: var(--text-2); background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.mm-queue-state.is-queued { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.mm-queue-state[hidden] { display: none; }
.mm-ai__busy {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  font-size: 12.5px; font-weight: 550; color: var(--text-1);
}
.mm-ai__busy[hidden] { display: none; }
.mm-ai__spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--glass-border-strong);
  border-top-color: var(--accent);
  animation: modalSpin 0.7s linear infinite;
}
.mm-ai__result {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.mm-ai__result[hidden] { display: none; }
.mm-ai__status { font-size: 12px; font-weight: 600; color: var(--text-1); margin-bottom: 10px; }
.mm-ai__status.is-rejected { color: var(--danger); }
.mm-ai__fields { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.mm-ai__fields dt { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.02em; }
.mm-ai__fields dd { margin: 0; font-size: 13px; color: var(--text-0); line-height: 1.45; }
.mm-ai__actions { display: flex; gap: 10px; margin-top: 14px; }
.mm-ai__actions .btn { width: auto; flex: 1; margin-top: 0; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; z-index: 200;
  right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-left-width: 3px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text-0); font-size: 13px;
  opacity: 0; transform: translateX(16px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.is-in { opacity: 1; transform: translateX(0); }
.toast.is-out { opacity: 0; transform: translateX(16px); }
.toast--success { border-left-color: var(--ok); }
.toast--error { border-left-color: var(--danger); }
.toast--info { border-left-color: var(--accent); }
.toast__icon {
  display: grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
}
.toast__icon svg { width: 14px; height: 14px; }
.toast--success .toast__icon { color: var(--ok); background: var(--ok-soft); }
.toast--error .toast__icon { color: var(--danger-fg); background: var(--danger-soft); }
.toast--info .toast__icon { color: var(--accent); background: var(--accent-soft); }
.toast__msg { flex: 1; line-height: 1.4; }
.toast__close {
  flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-2); font-size: 18px; line-height: 1; padding: 0 2px;
  transition: color 0.16s;
}
.toast__close:hover { color: var(--text-0); }

@media (max-width: 560px) {
  .toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid--kpi { grid-template-columns: repeat(2, 1fr); }
  .grid--split { grid-template-columns: 1fr; }
  .grid--even { grid-template-columns: 1fr; }
}

/* Tablet / mobile: sidebar collapses into an off-canvas drawer */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .main { padding: 14px; }

  .nav-toggle { display: grid; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: min(296px, 86vw);
    height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.26s ease;
  }
  .sidebar.is-open { transform: none; }
}

@media (max-width: 680px) {
  .grid--kpi { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 9px 12px; }
  .topbar__title p { display: none; }
  .topbar__search { min-width: 0; padding: 7px; }
  .topbar__search > span,
  .topbar__search .kbd { display: none; }
  .avatar { padding: 4px; }
  .avatar__meta { display: none; }
}

/* Subtle entrance */
.fade-up { animation: fadeUp 0.5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Coupons ─────────────────────────────────────────────────────────────── */
.alert--danger {
  color: var(--danger-fg);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
}

.cpn-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.cpn-toolbar .mfilter__search { flex: 1 1 220px; }
.cpn-toolbar__new { width: auto; margin-top: 0; padding: 10px 16px; margin-left: auto; }
.cpn-toolbar__new svg { width: 16px; height: 16px; }

.cpn-list { display: flex; flex-direction: column; }
.cpn-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(160px, 1.3fr) minmax(140px, 1.6fr) 100px 110px minmax(150px, 1.4fr) auto;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.cpn-row:last-child { border-bottom: 0; }
.cpn-row--skeleton { grid-template-columns: 1fr; }
.cpn-skel { display: block; width: 100%; height: 20px; border-radius: 6px; }

.cpn-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-0); }
.cpn-cell__k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.cpn-cell__v { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cpn-cell--code { gap: 7px; }
.cpn-cell--rewards { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.cpn-cell--window .cpn-cell__v { font-size: 12.5px; color: var(--text-1); }
.cpn-cell--actions { flex-direction: row; gap: 6px; justify-content: flex-end; }

.cpn-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; font-weight: 650;
  color: var(--text-0); overflow-wrap: anywhere;
}
.cpn-chip {
  display: inline-flex; align-items: center;
  font-size: 11.5px; color: var(--text-1);
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.cpn-inf { font-size: 16px; font-weight: 700; color: var(--text-1); }
.cpn-empty { padding: 34px 0; text-align: center; }
.cpn-more { display: flex; justify-content: center; margin-top: 16px; }
.cpn-more .btn-ghost[hidden] { display: none; }

.icon-btn--danger { color: var(--danger); }
.icon-btn--danger:hover { color: var(--danger); border-color: var(--danger); }

/* Modale création / édition + tiroir rédemptions (voile `.modal--form`) */
[data-coupon-modal][hidden],
[data-coupon-redemptions][hidden] { display: none; }
[data-coupon-modal]:not([hidden]),
[data-coupon-redemptions]:not([hidden]) { opacity: 1; visibility: visible; }
[data-coupon-modal]:not([hidden]) .cpnmodal,
[data-coupon-redemptions]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

.cpnmodal {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.18s ease;
}
.cpnmodal--redemptions { width: min(460px, calc(100vw - 32px)); }
.cpnmodal__head { display: flex; align-items: center; gap: 12px; padding: 22px 22px 0; padding-right: 48px; }
.cpnmodal__icon {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.cpnmodal__icon svg { width: 19px; height: 19px; }
.cpnmodal__title { margin: 0; font-size: 16px; }
.cpnmodal__sub { margin: 2px 0 0; font-size: 12.5px; }
.cpnmodal__body { padding: 18px 22px; overflow-y: auto; }
.cpnmodal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--glass-border);
}
.cpnmodal__foot .btn,
.cpnmodal__foot .btn-ghost { width: auto; margin-top: 0; }

.cpnform__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.cpnform__grid .field { margin-bottom: 14px; }
@media (max-width: 560px) { .cpnform__grid { grid-template-columns: 1fr; } }

.cpnform__rewards { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--glass-border); }
.cpnform__rewards-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cpnform__label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: var(--text-0); }
.cpnform__label svg { width: 16px; height: 16px; color: var(--text-2); }
.cpnform__error { margin: 14px 0 0; font-size: 12.5px; color: var(--danger); }

.cpn-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--text-1); cursor: pointer; }
.cpn-check input { width: 16px; height: 16px; accent-color: var(--accent); }

.cpn-rewards { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cpn-rewards__empty { margin: 12px 0 0; }
.cpn-rewards:empty + .cpn-rewards__empty { display: block; }
.cpn-reward {
  display: grid; align-items: end; gap: 10px;
  grid-template-columns: 1fr 1fr 1fr auto;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.field--tight { margin-bottom: 0; }
.field--tight label { margin-bottom: 5px; font-size: 11.5px; }
.field--tight input { padding: 8px 10px; font-size: 13px; }
.cpn-reward__del { align-self: end; margin-bottom: 1px; }

.btn-ghost--sm { width: auto; padding: 6px 12px; font-size: 12.5px; }
.btn-ghost--sm svg { width: 14px; height: 14px; }

.cpn-redemptions { list-style: none; margin: 0; padding: 0; }
.cpn-rx {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--glass-border);
}
.cpn-rx:last-child { border-bottom: 0; }
.cpn-rx__user {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px;
  color: var(--text-1); overflow-wrap: anywhere; text-decoration: none;
}
a.cpn-rx__user:hover { color: var(--accent); }
.cpn-rx__date { flex: none; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .cpn-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .cpn-cell--code { grid-column: 1 / -1; }
  .cpn-cell--rewards { grid-column: 1 / -1; }
  .cpn-cell--actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ── Page « Staff » ─────────────────────────────────────────────────────
   Administration des opérateurs : liste en lignes (identité, e-mail, rôle,
   statut, actions) réutilisant l'ossature `.cpn-*` de la page Coupons, et
   modale de création/édition partageant le voile `.modal--form` / `.cpnmodal`. */
.alert--warning {
  color: var(--warn);
  background: rgba(245, 196, 81, 0.12);
  border: 1px solid var(--glass-border);
}

.stf-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(200px, 1.6fr) minmax(180px, 1.6fr) 150px 120px auto;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.stf-row:last-child { border-bottom: 0; }

.stf-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-0); }
.stf-cell__k { display: none; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.stf-cell--id { flex-direction: row; align-items: center; gap: 11px; }
.stf-cell--actions { flex-direction: row; gap: 6px; justify-content: flex-end; }

.stf-ava {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 50%; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.stf-idbox { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stf-name { font-weight: 650; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 7px; }
.stf-handle {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  color: var(--text-2); overflow-wrap: anywhere;
}
.stf-you {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px;
}
.stf-mail { color: var(--text-1); text-decoration: none; overflow-wrap: anywhere; }
.stf-mail:hover { color: var(--accent); }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }

/* Voile de la modale staff (toggle via l'attribut `hidden`, cf. Coupons). */
[data-staff-modal][hidden] { display: none; }
[data-staff-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-staff-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

@media (max-width: 760px) {
  .stf-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .stf-cell--id { grid-column: 1 / -1; }
  .stf-cell--actions { grid-column: 1 / -1; justify-content: flex-start; }
  .stf-cell__k { display: block; }
}

/* ── Page « Logs » ──────────────────────────────────────────────────────
   Journal applicatif d'Hydrogen : barre de filtres (niveau, chemin, statut,
   fenêtre de dates) + liste d'entrées avec badge de niveau, pastille de
   statut HTTP et contexte JSON dépliable. */
.log-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px;
}
.log-toolbar .mfilter__search { flex: 1 1 240px; }
.log-toolbar__status {
  width: 130px; padding: 11px 12px; font-size: 14px; color: var(--text-0);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); outline: none; font-variant-numeric: tabular-nums;
  transition: background 0.16s, border-color 0.16s;
}
.log-toolbar__status:focus { border-color: var(--accent); background: var(--input-bg-strong); }
.log-toolbar__date {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; font-size: 12.5px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
}
.log-toolbar__date:focus-within { border-color: var(--accent); }
.log-toolbar__date input {
  font: inherit; font-size: 13px; color: var(--text-0); background: transparent;
  border: 0; outline: none; color-scheme: dark light;
}
.log-toolbar .btn-ghost {
  width: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; font-size: 12.5px;
}
.log-toolbar .btn-ghost svg { flex: none; width: 15px; height: 15px; }

.log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.log-row {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.log-row--skeleton { padding: 0; overflow: hidden; }

.log-row__head { display: flex; align-items: center; gap: 10px; }

.log-badge { text-transform: uppercase; letter-spacing: 0.04em; font-size: 10.5px; }
.log-badge--error   { color: var(--danger-fg); background: var(--danger-soft); }
.log-badge--warning { color: var(--warn); background: rgba(245, 196, 81, 0.14); }
.log-badge--info    { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }

.log-row__status {
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 999px;
}
.log-row__status--error   { color: var(--danger-fg); background: var(--danger-soft); }
.log-row__status--warning { color: var(--warn); background: rgba(245, 196, 81, 0.14); }
.log-row__status--info    { color: var(--text-2); background: rgba(111, 122, 144, 0.14); }

.log-row__date {
  margin-left: auto; flex: none; font-size: 12px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.log-row__body { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.log-row__message { font-size: 13.5px; color: var(--text-0); overflow-wrap: anywhere; }
.log-row__route {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  color: var(--text-2); overflow-wrap: anywhere;
}

.log-row__toggle {
  margin-top: 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 4px 12px; border-radius: 999px; color: var(--text-1);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  transition: color 0.16s ease, border-color 0.16s ease;
}
.log-row__toggle:hover { color: var(--text-0); border-color: var(--accent); }
.log-row__toggle[aria-expanded="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }

.log-row__context {
  margin: 10px 0 0; padding: 12px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  color: var(--text-1); line-height: 1.5; white-space: pre-wrap; overflow-x: auto;
}

.log-empty { margin: 16px 0 0; text-align: center; }
.log-more { display: flex; justify-content: center; margin-top: 14px; }
.log-more .btn-ghost { width: auto; margin-top: 0; }
.log-more .btn-ghost[hidden] { display: none; }

@media (max-width: 700px) {
  .log-toolbar__status { width: 100%; }
  .log-toolbar__date { flex: 1 1 100%; }
  .log-row__date { margin-left: 0; width: 100%; }
  .log-row__head { flex-wrap: wrap; }
}

/* ── Page « Signalements » ──────────────────────────────────────────────
   File de modération : lignes de signalement cliquables (motif, cible,
   rapporteur, date, badge de statut) et modale de verdict réutilisant le
   voile `.modal--form`. */
.rp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.rp-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
  cursor: pointer; text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.rp-row:hover { border-color: var(--accent-border); background: var(--input-bg-strong); }
.rp-row:focus-visible { outline: none; border-color: var(--accent); }
.rp-row--skeleton { padding: 0; overflow: hidden; cursor: default; }
.rp-row--skeleton:hover { border-color: var(--glass-border); background: var(--surface-inset); }

.rp-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rp-row__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rp-row__reason { font-size: 14px; font-weight: 650; color: var(--text-0); }
.rp-row__target-type {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px;
  color: var(--text-2); background: rgba(111, 122, 144, 0.14);
}
.rp-row__meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.rp-row__reporter { color: var(--text-1); overflow-wrap: anywhere; }
.rp-row__date { font-variant-numeric: tabular-nums; }
.rp-row__details {
  margin: 0; font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.rp-row .badge { flex: none; }

.rp-empty { margin: 16px 0 0; text-align: center; }
.rp-empty[hidden] { display: none; }
.rp-more { display: flex; justify-content: center; margin-top: 14px; }
.rp-more .btn-ghost { width: auto; margin-top: 0; }
.rp-more .btn-ghost[hidden] { display: none; }

/* Modale de verdict — voile `.modal--form`, panneau compact type `.banmodal`. */
[data-rp-modal][hidden] { display: none; }
[data-rp-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-rp-modal]:not([hidden]) .rpmodal { transform: translateY(0) scale(1); }

.rpmodal {
  position: relative;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.18s ease;
}
.rpmodal__head { display: flex; align-items: center; gap: 12px; padding: 22px 22px 0; padding-right: 48px; }
.rpmodal__icon {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--danger);
  background: var(--danger-soft); border: 1px solid var(--danger-border);
}
.rpmodal__icon svg { width: 19px; height: 19px; }
.rpmodal__title { margin: 0; font-size: 16px; }
.rpmodal__sub { margin: 2px 0 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rpmodal__head .badge { margin-left: auto; flex: none; }

.rpmodal__body { padding: 18px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.rpmodal__meta { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.rpmodal__meta > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rpmodal__meta dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.rpmodal__meta dd { margin: 0; font-size: 13.5px; color: var(--text-0); overflow-wrap: anywhere; }
.rpmodal__meta dd a { color: var(--accent); text-decoration: none; }
.rpmodal__meta dd a:hover { text-decoration: underline; }
.rpmodal__meta code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  padding: 1px 6px; border-radius: 6px; background: var(--input-bg);
}

.rpmodal__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); display: block; margin-bottom: 6px; }
.rpmodal__details[hidden], .rpmodal__resolved[hidden], .rpmodal__verdict[hidden] { display: none; }
.rpmodal__details-body {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent-border);
  font-size: 13px; color: var(--text-1); line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.rpmodal__resolved-note {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  font-size: 13px; color: var(--text-1); line-height: 1.5;
}

.rpmodal__note {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 13.5px;
  color: var(--text-0); border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  outline: none; resize: vertical; min-height: 60px;
  transition: border-color 0.18s, background 0.18s;
}
.rpmodal__note:focus { border-color: var(--accent); background: var(--input-bg-strong); }
.rpmodal__err { margin: 10px 0 0; font-size: 12.5px; }
.rpmodal__err[hidden] { display: none; }

.rpmodal__foot {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px;
  padding: 16px 22px; border-top: 1px solid var(--glass-border);
}
.rpmodal__foot[hidden] { display: none; }
.rpmodal__foot .btn,
.rpmodal__foot .btn-ghost { width: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 7px; }
.rpmodal__foot svg { flex: none; width: 15px; height: 15px; }

@media (max-width: 620px) {
  .rp-row { flex-wrap: wrap; }
  .rpmodal__meta { grid-template-columns: 1fr; }
}

/* ── Page « Newsletter » ────────────────────────────────────────────────
   Cartes de stats (taux de confirmation, activité récente), barre d'outils
   (filtre de statut, recherche e-mail, export CSV) et liste d'abonnés en
   grille, avec actions de renvoi de confirmation et de désabonnement. */
.nl-rate { display: flex; flex-direction: column; gap: 10px; }
.nl-rate__value { font-size: 30px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }
.nl-rate__bar { height: 8px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.nl-rate__fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  border-radius: 999px; transition: width 0.4s ease;
}
.nl-rate__hint { margin: 0; font-size: 12px; }

.nl-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nl-recent__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
}
.nl-recent__row:last-child { border-bottom: 0; }
.nl-recent__label { font-size: 13.5px; color: var(--text-0); }
.nl-recent__nums { display: flex; gap: 18px; }
.nl-recent__num { font-size: 12.5px; color: var(--text-1); }
.nl-recent__num b { font-size: 15px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }

.nl-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0 16px; }
.nl-toolbar .mfilter__search { flex: 1 1 220px; }
.nl-toolbar__export {
  width: auto; margin-top: 0; margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; font-size: 12.5px; text-decoration: none;
}
.nl-toolbar__export svg { flex: none; width: 15px; height: 15px; }

.nl-list { display: flex; flex-direction: column; }
.nl-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(200px, 1.8fr) 120px 90px minmax(130px, 1fr) 110px auto;
  padding: 13px 0; border-bottom: 1px solid var(--glass-border);
}
.nl-row:last-child { border-bottom: 0; }
.nl-row--skeleton { grid-template-columns: 1fr; }

.nl-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-0); }
.nl-cell__k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.nl-cell__v { overflow-wrap: anywhere; }
.nl-cell--email { gap: 7px; }
.nl-cell--date .nl-cell__v { font-size: 12.5px; color: var(--text-1); font-variant-numeric: tabular-nums; }
.nl-cell--actions { flex-direction: row; gap: 6px; justify-content: flex-end; }

.nl-email {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 600;
  color: var(--text-0); overflow-wrap: anywhere;
}
.nl-row__user { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.nl-row__user:hover { text-decoration: underline; }

.nl-empty { padding: 34px 0; text-align: center; }
.nl-more { display: flex; justify-content: center; margin-top: 16px; }
.nl-more .btn-ghost { width: auto; margin-top: 0; }
.nl-more .btn-ghost[hidden] { display: none; }

@media (max-width: 900px) {
  .nl-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
  .nl-cell--email { grid-column: 1 / -1; }
  .nl-cell--actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ── Page « Commentaires » ──────────────────────────────────────────────
   Tableau de bord de modération (KPIs, taux, top médias/contributeurs,
   mini-graphe des créations) et outil de modération par identifiant
   (recherche → carte du commentaire + actions supprimer/restaurer/censurer). */
.cm-rates { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cm-rate {
  display: grid; align-items: center; gap: 6px 12px;
  grid-template-columns: 130px 1fr auto;
}
.cm-rate__label { font-size: 13px; color: var(--text-1); }
.cm-rate__bar { height: 8px; border-radius: 999px; background: var(--surface-inset); overflow: hidden; }
.cm-rate__fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  border-radius: 999px; transition: width 0.4s ease;
}
.cm-rate__value { font-size: 14px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }

.cm-facts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.cm-fact { flex: 1 1 140px; display: flex; flex-direction: column; gap: 4px; }
.cm-fact__label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.cm-fact__value { font-size: 20px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }

.cm-spark__total { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cm-spark {
  display: flex; align-items: flex-end; gap: 3px;
  height: 120px; margin-top: 6px;
}
.cm-spark__bar {
  flex: 1 1 0; min-width: 2px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(108, 140, 255, 0.35));
  transition: height 0.3s ease;
}

.cm-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cm-top__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--glass-border);
}
.cm-top__row:last-child { border-bottom: 0; }
.cm-top__row--skeleton { padding: 0; overflow: hidden; }
.cm-top__name { min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; color: var(--text-0); }
.cm-top__name a { color: var(--accent); text-decoration: none; }
.cm-top__name a:hover { text-decoration: underline; }
.cm-top__count { flex: none; font-size: 14px; font-weight: 700; color: var(--text-0); font-variant-numeric: tabular-nums; }
.cm-top__empty { padding: 24px 0; text-align: center; }

/* Ligne « média » avec aperçu : miniature cliquable + nom. */
.cm-top__row--media { padding: 8px 0; }
.cm-top__link {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 11px;
  padding: 4px; margin: -4px; border: 0; border-radius: var(--radius-sm);
  background: none; cursor: pointer; text-align: left; color: inherit;
}
button.cm-top__link:hover { background: var(--glass-bg); }
button.cm-top__link:hover .cm-top__name { color: var(--accent); }
.cm-top__thumb {
  flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--input-bg);
}
.cm-top__thumb--ph {
  background: linear-gradient(135deg, var(--surface-inset), var(--input-bg));
}

/* Ligne « contributeur » : carte de profil (avatar, nom + vérifié, @pseudo · niveau). */
.cm-top__row--user { padding: 8px 0; }
.cm-top__avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: var(--input-bg);
}
.cm-top__avatar--ph {
  display: grid; place-items: center;
  font-size: 13px; font-weight: 650; color: var(--text-1);
  background: linear-gradient(135deg, var(--surface-inset), var(--input-bg));
  text-transform: uppercase;
}
.cm-top__ident { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-top__ident .cm-top__name {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cm-top__verified {
  flex: none; display: inline-grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%;
  font-size: 10px; line-height: 1; color: #fff; background: var(--accent);
}
.cm-top__sub {
  font-size: 12px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.cm-top__link:hover { background: var(--glass-bg); }
a.cm-top__link:hover .cm-top__name a { color: var(--accent); }

/* Cartes autonomes de la page (hors grille) : même rythme vertical (18px) que
   les sections `.grid--split`, qui portent leur propre marge. */
[data-comments] > .card { margin-top: 18px; }
[data-index] > .card { margin-top: 18px; }
.cm-tool { margin-top: 18px; }
.cm-lookup { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 4px; }
.cm-lookup__field { flex: 1 1 320px; }
.cm-lookup__field input {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
}
.cm-lookup__btn {
  width: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; font-size: 12.5px;
}
.cm-lookup__btn svg { flex: none; width: 15px; height: 15px; }
.cm-lookup__error { margin: 12px 0 0; }
.cm-lookup__error[hidden] { display: none; }

.cm-card {
  margin-top: 18px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.cm-card[hidden] { display: none; }
.cm-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-card__id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  overflow-wrap: anywhere;
}
.cm-card__body {
  margin: 14px 0; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
  font-size: 14px; line-height: 1.55; color: var(--text-0);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.cm-card__meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px; margin: 0 0 16px;
}
.cm-card__meta div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cm-card__meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.cm-card__meta dd {
  margin: 0; font-size: 13px; color: var(--text-0);
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.cm-card__meta dd a { color: var(--accent); text-decoration: none; }
.cm-card__meta dd a:hover { text-decoration: underline; }

.cm-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-card__actions .btn-ghost {
  width: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; font-size: 12.5px;
}
.cm-card__actions .btn-ghost[hidden] { display: none; }
.cm-card__actions .btn-ghost svg { flex: none; width: 15px; height: 15px; }
.cm-card__censor { color: var(--danger-fg); border-color: var(--danger-soft); }
.cm-card__censor:hover { border-color: var(--danger-fg); }

/* ── Modal de modération ─────────────────────────────────────────────── */
.modal--comment .modal__panel {
  display: block;
  grid-template-columns: none;
  width: min(880px, calc(100vw - 32px));
  height: auto; max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 26px 24px;
}
.cm-modal__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-right: 44px; margin-bottom: 4px;
}
.cm-modal__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-0); }
.cm-modal__head .cm-card__id { margin-left: auto; }
.cm-modal__grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start;
}
.modal--comment .cm-card {
  margin-top: 14px; padding: 0; background: none; border: 0;
}
.cm-modal__aside { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }

.cm-usercard, .cm-mediacard {
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.cm-usercard__head { display: flex; align-items: center; gap: 12px; }
.cm-usercard__avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  background: var(--input-bg);
}
.cm-usercard__avatar--ph {
  display: grid; place-items: center; font-weight: 700; color: var(--text-1);
}
.cm-usercard__ident { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cm-usercard__name {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--text-0); overflow-wrap: anywhere;
}
.cm-usercard__name a { color: inherit; text-decoration: none; }
.cm-usercard__name a:hover { text-decoration: underline; }
.cm-usercard__verified { color: var(--accent); font-weight: 700; }
.cm-usercard__sub { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.cm-usercard__rank-icon { flex: none; width: 15px; height: 15px; object-fit: contain; vertical-align: middle; }
.cm-usercard__badge { margin-left: auto; }

.cm-mediacard { padding: 0; overflow: hidden; }
.cm-mediacard[aria-busy="true"] { display: flex; align-items: center; gap: 12px; padding: 14px; }
.cm-mediacard__link {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px;
  border: 0; background: none; cursor: pointer; text-align: left; color: inherit;
}
.cm-mediacard__link:hover { background: var(--glass-bg); }
.cm-mediacard__thumb {
  flex: none; width: 56px; height: 56px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--input-bg);
}
.cm-mediacard__ident { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cm-mediacard__name { font-size: 14px; font-weight: 600; color: var(--text-0); overflow-wrap: anywhere; }
.cm-mediacard__sub { font-size: 12px; color: var(--text-2); }
.cm-mediacard__cta { font-size: 12px; font-weight: 600; color: var(--accent); }
.cm-lookup__hint { margin: 12px 0 0; font-size: 12.5px; }

.cm-recent { display: flex; flex-direction: column; }
.cm-recent__row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--glass-border);
}
.cm-recent__row:last-child { border-bottom: 0; }
.cm-recent__row--skeleton { padding: 0; overflow: hidden; }
.cm-recent__thumb {
  flex: none; width: 46px; height: 46px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--input-bg);
}
.cm-recent__thumb--ph {
  background: linear-gradient(135deg, var(--surface-inset), var(--input-bg));
}
.cm-recent__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cm-recent__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-recent__meta { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cm-recent__meta a { color: var(--accent); text-decoration: none; }
.cm-recent__meta a:hover { text-decoration: underline; }
.cm-recent__body {
  margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-0);
  overflow-wrap: anywhere;
}
.cm-recent__body s { color: var(--text-2); }
.cm-recent__mod {
  flex: none; width: auto; margin-top: 0; padding: 7px 14px; font-size: 12.5px;
}
.cm-recent__empty { padding: 30px 0; text-align: center; }
.cm-recent__more { display: flex; justify-content: center; margin-top: 14px; }
.cm-recent__more .btn-ghost { width: auto; margin-top: 0; }
.cm-recent__more .btn-ghost[hidden] { display: none; }

@media (max-width: 700px) {
  .cm-rate { grid-template-columns: 1fr auto; }
  .cm-rate__bar { grid-column: 1 / -1; order: 3; }
  .cm-recent__row { flex-wrap: wrap; }
  .cm-recent__mod { width: 100%; }
  .cm-modal__grid { grid-template-columns: 1fr; gap: 16px; }
  .cm-modal__aside { flex-direction: row; flex-wrap: wrap; }
  .cm-modal__aside > * { flex: 1 1 220px; }
}

/* ── Page « Contenu » ───────────────────────────────────────────────────
   Administration des documents éditoriaux : catalogue en lignes (slug, statut,
   version, couverture de traduction), modale d'édition à onglets (méta /
   traduction Markdown / révisions légales) et modale de création. Réutilise les
   primitives .cpn-* / .cpnmodal / .trans-badge du reste du back-office. */
[data-content] .grid--kpi { margin-bottom: 18px; }

.cpn-toolbar__cat {
  flex: 0 1 200px; padding: 9px 12px; font-size: 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
  background: var(--input-bg); color: var(--text-0);
}
.cpn-toolbar__cat option { color: var(--text-0); background: var(--bg-1); }

.cnt-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(200px, 2fr) 130px 120px 140px 130px auto;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.cnt-row:last-child { border-bottom: 0; }
.cnt-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-0); }
.cnt-cell--id { gap: 3px; }
.cnt-cell--actions { flex-direction: row; gap: 6px; justify-content: flex-end; }
.cnt-slug {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 650;
  overflow-wrap: anywhere; color: var(--text-0);
}
.cnt-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.cnt-ver { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--text-1); }
.cnt-cover { display: inline-flex; flex-wrap: wrap; gap: 5px; }

@media (max-width: 860px) {
  .cnt-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .cnt-cell--id { grid-column: 1 / -1; }
  .cnt-cell--actions { grid-column: 1 / -1; justify-content: flex-start; }
  .cnt-cell .stf-cell__k { display: block; }
}

/* Champ occupant toute la largeur de la grille de formulaire. */
.field--wide { grid-column: 1 / -1; }

/* Barre de sélection de locale (panneau Traduction). */
.content-editor__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.content-editor__bar .trans-badge { margin-right: auto; }
.content-editor__locale { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.content-editor__locale select {
  padding: 7px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border); background: var(--input-bg); color: var(--text-0); font-size: 13px;
}
.content-editor__locale option { color: var(--text-0); background: var(--bg-1); }
.content-editor__body {
  min-height: 220px; resize: vertical;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; line-height: 1.6;
}

/* Pied d'action intégré à un panneau (au lieu d'un pied de modale plein). */
.cpnmodal__foot--inline { padding: 16px 0 0; justify-content: space-between; }

/* Historique de révisions. */
.content-rev__intro { margin: 0 0 14px; font-size: 13px; }
.content-rev { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.content-rev__row {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.content-rev__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; }
.content-rev__date { font-size: 12.5px; color: var(--text-1); }
.content-rev__editor { font-size: 12px; font-weight: 650; color: var(--accent); }
.content-rev__title { font-size: 13.5px; color: var(--text-0); overflow-wrap: anywhere; }

/* Voile des modales Contenu (toggle via l'attribut `hidden`, cf. Staff). */
[data-content-modal][hidden],
[data-content-create-modal][hidden] { display: none; }
[data-content-modal]:not([hidden]),
[data-content-create-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-content-modal]:not([hidden]) .cpnmodal,
[data-content-create-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

/* ── Page « Marques » ───────────────────────────────────────────────────
   Administration du catalogue de marques : catalogue en lignes (nom/code,
   statut, types, liens), modale unique création/édition. Réutilise les
   primitives .cpn-* / .cpnmodal / .grid--kpi du reste du back-office. */
[data-brands] .grid--kpi { margin-bottom: 18px; }

.brd-row {
  display: grid; align-items: center; gap: 14px; cursor: pointer;
  grid-template-columns: minmax(180px, 2fr) 110px minmax(140px, 1.4fr) 90px 130px auto;
  padding: 14px 10px; margin: 0 -10px; border-radius: 12px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.16s ease;
}
.brd-row:hover { background: var(--surface-inset); }
.brd-row:last-child { border-bottom: 0; }
.brd-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-0); }
.brd-cell--id { flex-direction: row; align-items: center; gap: 10px; }
.brd-cell--actions { flex-direction: row; gap: 6px; justify-content: flex-end; }
.brd-idtext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brd-name { font-weight: 650; overflow-wrap: anywhere; color: var(--text-0); }
.brd-sub { font-size: 12px; }
.brd-types { display: inline-flex; flex-wrap: wrap; gap: 5px; }

/* Vignette de logo en tête de ligne (première variante disponible). */
.brd-thumb {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; overflow: hidden;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.brd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.brd-thumb--empty { color: var(--text-2); }
.brd-thumb--empty svg { width: 18px; height: 18px; }

.brand-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px; font-size: 11.5px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-1);
}
.brand-chip__pos {
  font-size: 10.5px; font-weight: 650; color: var(--accent);
  background: var(--bg-1); border-radius: 999px; padding: 0 5px;
}

@media (max-width: 860px) {
  .brd-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .brd-cell--id { grid-column: 1 / -1; }
  .brd-cell--actions { grid-column: 1 / -1; justify-content: flex-start; }
  .brd-cell .stf-cell__k { display: block; }
}

/* Pied de modale à extrémités opposées : suppression à gauche, action à droite.
   Conserve le padding et le liseré du pied de base (contrairement à --inline,
   réservé aux pieds intégrés dans un panneau). */
.cpnmodal__foot--split { justify-content: space-between; align-items: center; }

/* Éditeur de types rattachés (modale marque) : lignes select + position,
   alimenté par le référentiel /admin/provider-types. */
.brand-types { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.brand-types__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.brand-types__label { font-size: 12px; }
.brand-types__add { width: auto; margin-top: 0; padding: 5px 10px; font-size: 12.5px; }
.brand-types__add svg { width: 15px; height: 15px; }
.brand-types__rows { display: flex; flex-direction: column; gap: 8px; }
.brand-types__empty, .brand-types__warn { font-size: 12.5px; margin: 4px 0 0; }

.brand-type-row { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; align-items: center; }
.brand-type-row__select, .brand-type-row__pos {
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
}

/* Visuels de la marque (icône / logo × light / dark / monochrome) : une grille
   de tuiles avec aperçu, téléversement et retrait. Édition uniquement. */
.brand-art { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.brand-art__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.brand-art__label { font-size: 12px; }
.brand-art__note { font-size: 11.5px; }
.brand-art__warn { font-size: 12.5px; margin: 6px 0 0; color: var(--warn, var(--text-1)); }
.brand-art__group { margin-top: 12px; }
.brand-art__gtitle { display: block; font-size: 12px; font-weight: 650; color: var(--text-1); margin-bottom: 8px; }
.brand-art__slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.brand-art-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px; border-radius: 12px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.brand-art-slot__preview {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: var(--bg-1); color: var(--text-2);
}
.brand-art-slot--light .brand-art-slot__preview { background: #f5f6f8; color: #9aa2ad; }
.brand-art-slot--dark .brand-art-slot__preview { background: #14161b; color: #5a6270; }
.brand-art-slot__preview img { width: 100%; height: 100%; object-fit: contain; }
.brand-art-slot__preview svg { width: 24px; height: 24px; }
.brand-art-slot__cap { font-size: 11.5px; color: var(--text-2); }
.brand-art-slot__actions { display: flex; gap: 6px; }
.brand-art-slot__up { position: relative; overflow: hidden; cursor: pointer; }
.brand-art-slot__up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.brand-art-slot.is-busy { opacity: 0.55; pointer-events: none; }
.brand-art-slot.is-locked .brand-art-slot__up { opacity: 0.4; pointer-events: none; }

@media (max-width: 560px) {
  .brand-art__slots { grid-template-columns: 1fr; }
}

/* Contenu éditorial localisable (résumé + description) : sélecteur de locale +
   deux zones de texte, enregistré indépendamment du CRUD marque. */
.brand-edito { grid-column: 1 / -1; margin: 4px 0 16px; padding: 14px 0; border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); }
.brand-edito__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.brand-edito__label { font-size: 12px; }
.brand-edito__locales { flex: none; }
.brand-edito__warn { font-size: 12.5px; margin: 4px 0 0; }
.brand-edito__fields { display: flex; flex-direction: column; gap: 12px; }
.brand-edito__fields .field { margin-bottom: 0; }
.brand-edito__fields textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; font: inherit; font-size: 13.5px;
  line-height: 1.5; resize: vertical; color: var(--text-0);
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.brand-edito__fields textarea:focus {
  outline: none; border-color: var(--accent);
}
.brand-edito__foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.brand-edito__status { font-size: 12px; margin-right: auto; }
.brand-edito__foot .btn-ghost { width: auto; margin-top: 0; padding: 8px 14px; }

/* Référentiel des types de prestataire (modale de gestion partagée). */
.cpn-toolbar__type {
  width: auto; margin-top: 0; padding: 9px 12px; font-size: 13px; font-family: inherit;
  color: var(--text-0); background: var(--surface-inset);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm); cursor: pointer;
}
.cpn-toolbar__manage {
  width: auto; margin-top: 0; margin-left: auto; display: inline-flex;
  align-items: center; gap: 8px; padding: 9px 16px; white-space: nowrap;
}
.cpn-toolbar__manage svg { flex: none; width: 16px; height: 16px; }
.ptype-list { display: flex; flex-direction: column; margin-bottom: 14px; }
.ptype-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--glass-border);
}
.ptype-row:last-child { border-bottom: 0; }
.ptype-row.is-dragging { opacity: 0.5; }
.ptype-row__main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
/* Poignée de glisser-déposer : la position se dérive de l'ordre des lignes. */
.ptype-row__grip {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--text-1); cursor: grab;
}
.ptype-row__grip:active { cursor: grabbing; }
.ptype-row__grip svg { width: 18px; height: 18px; }
.ptype-row__name { flex: 1; min-width: 0; }
.ptype-row__name {
  padding: 7px 10px; border-radius: 10px; font-size: 13px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
}
.ptype-row__meta { display: flex; align-items: center; gap: 8px; }
.ptype-row__used { font-size: 11.5px; white-space: nowrap; }

.ptype-create { border-top: 1px solid var(--glass-border); padding-top: 14px; }
.ptype-create__fields { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.ptype-create__fields input {
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
}
.ptype-create__fields .btn {
  width: auto; margin-top: 0; display: inline-flex; align-items: center;
  gap: 8px; padding: 9px 16px; white-space: nowrap;
}
.ptype-create__fields .btn svg { flex: none; width: 16px; height: 16px; }

/* Voile de la modale Marques (toggle via l'attribut `hidden`, cf. Contenu). */
[data-brand-modal][hidden], [data-ptype-modal][hidden], [data-border-modal][hidden] { display: none; }
[data-brand-modal]:not([hidden]), [data-ptype-modal]:not([hidden]), [data-border-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-brand-modal]:not([hidden]) .cpnmodal,
[data-ptype-modal]:not([hidden]) .cpnmodal,
[data-border-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

/* Bouton « Classer par type » de la barre d'outils Marques. */
.cpn-toolbar__order {
  width: auto; margin-top: 0; display: inline-flex; align-items: center;
  gap: 8px; padding: 9px 16px; white-space: nowrap;
}
.cpn-toolbar__order svg { flex: none; width: 16px; height: 16px; }

/* Liste de classement des marques par type (drag & drop, position = ordre des lignes). */
.border-order { display: flex; flex-direction: column; margin: 6px 0 4px; }
.border-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--glass-border);
}
.border-row:last-child { border-bottom: 0; }
.border-row.is-dragging { opacity: 0.5; }
.border-row__grip {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--text-1); cursor: grab;
}
.border-row__grip:active { cursor: grabbing; }
.border-row__grip svg { width: 18px; height: 18px; }
.border-row__name { flex: 1; min-width: 0; font-size: 13px; color: var(--text-0); }
.border-row__sub { flex: none; font-size: 11.5px; white-space: nowrap; }

/* ── Page « Badges » ────────────────────────────────────────────────────
   Catalogue de gamification : liste en lignes (identité, type, paliers,
   statut, actions) réutilisant l'ossature `.cpn-*`, et modale CRUD avec
   éditeur de paliers, partageant le voile `.modal--form` / `.cpnmodal`. */
.bdg-row {
  display: grid; align-items: center; gap: 14px;
  grid-template-columns: minmax(180px, 1.6fr) 116px minmax(150px, 1.3fr) minmax(110px, 1fr) 108px auto;
  padding: 14px 0; border-bottom: 1px solid var(--glass-border);
}
.bdg-cat { align-self: flex-start; overflow-wrap: anywhere; }
.bdg-cat--none { font-size: 13px; }
.bdg-row:last-child { border-bottom: 0; }
.bdg-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; color: var(--text-0); }
.bdg-cell__k { display: none; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.bdg-cell--id { flex-direction: row; align-items: center; gap: 11px; }
.bdg-cell--actions { flex-direction: row; gap: 6px; justify-content: flex-end; }
.bdg-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border-radius: 10px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.bdg-mark svg { width: 20px; height: 20px; }
.bdg-idbox { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bdg-slug { font-weight: 650; overflow-wrap: anywhere; }
.bdg-metric {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  color: var(--text-2); overflow-wrap: anywhere;
}
.bdg-tiers-count { font-size: 12.5px; color: var(--text-1); }

/* Voile de la modale badge (toggle via l'attribut `hidden`, cf. Staff). */
[data-badge-modal][hidden] { display: none; }
[data-badge-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-badge-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

/* Modale badge élargie : plus de respiration pour les métadonnées, le contenu
   localisé et l'éditeur de paliers/icônes. La grille des métadonnées gagne en
   largeur (gouttière élargie) sans casser l'équilibre 2×2. */
.cpnmodal--badge { width: min(820px, calc(100vw - 32px)); }
.cpnmodal--badge .cpnform__grid { gap: 0 24px; }

/* Éditeur de paliers dans la modale badge. */
.badge-tiers { grid-column: 1 / -1; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.badge-tiers__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.badge-tiers__title { font-size: 13px; font-weight: 650; color: var(--text-0); }
.badge-tiers__add {
  width: auto; margin-top: 0; display: inline-flex; align-items: center;
  gap: 6px; padding: 7px 12px; font-size: 12.5px; white-space: nowrap;
}
.badge-tiers__add svg { flex: none; width: 15px; height: 15px; }
.badge-tiers__list { display: flex; flex-direction: column; gap: 8px; }
.badge-tier {
  display: grid; align-items: end; gap: 10px;
  grid-template-columns: 64px 1fr 1fr auto;
  padding: 8px 0;
}
.badge-tier__level {
  align-self: end; font-size: 12px; font-weight: 650; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  border-radius: 8px; padding: 8px; text-align: center; white-space: nowrap;
}
.badge-tier__f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.badge-tier__f input {
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
}
.badge-tier__del { align-self: center; }
.badge-holders { margin-right: auto; font-size: 12.5px; }

/* Gestion des icônes SVG (édition seule) : grille de slots verrou + paliers. */
.badge-icons { grid-column: 1 / -1; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--glass-border); }
.badge-icons[hidden] { display: none; }
.badge-icons__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.badge-icons__title { font-size: 13px; font-weight: 650; color: var(--text-0); }
.badge-icons__grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.bdg-icon { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.bdg-icon__frame {
  position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center;
  padding: 12px; border-radius: 12px;
  background: var(--surface-inset); border: 1px solid var(--glass-border);
}
.bdg-icon__img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bdg-icon.is-empty .bdg-icon__img { display: none; }
.bdg-icon__empty { display: none; font-size: 11.5px; }
.bdg-icon.is-empty .bdg-icon__empty { display: block; }
.bdg-icon.is-empty .bdg-icon__frame { border-style: dashed; }
.bdg-icon.is-empty .bdg-icon__del { display: none; }
.bdg-icon__label { font-size: 12px; font-weight: 600; color: var(--text-1); }
.bdg-icon__actions { display: flex; align-items: center; gap: 6px; }
.bdg-icon__up {
  width: auto; margin-top: 0; display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; font-size: 11.5px;
}
.bdg-icon__up svg { flex: none; width: 13px; height: 13px; }

@media (max-width: 760px) {
  .bdg-row { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .bdg-cell--id { grid-column: 1 / -1; }
  .bdg-cell--actions { grid-column: 1 / -1; justify-content: flex-start; }
  .bdg-cell__k { display: block; }
}

/* Référentiel des catégories de badge (modale gestionnaire). Voile identique à
   la modale badge. Chaque ligne : slug immuable + labels FR/EN + position. */
[data-bcat-modal][hidden] { display: none; }
[data-bcat-modal]:not([hidden]) { opacity: 1; visibility: visible; }
[data-bcat-modal]:not([hidden]) .cpnmodal { transform: translateY(0) scale(1); }

.bcat-list { display: flex; flex-direction: column; margin-bottom: 14px; }
.bcat-row {
  display: grid; align-items: end; gap: 10px;
  grid-template-columns: 24px minmax(120px, 1.2fr) 1fr 1fr auto;
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
}
.bcat-row:last-child { border-bottom: 0; }
.bcat-row.is-dragging { opacity: 0.5; }
/* Poignée de glisser-déposer : la position se dérive de l'ordre des lignes. */
.bcat-row__grip {
  align-self: center; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--text-1); cursor: grab;
}
.bcat-row__grip:active { cursor: grabbing; }
.bcat-row__grip svg { width: 18px; height: 18px; }
.bcat-row__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-bottom: 6px; }
.bcat-row__slug { font-weight: 650; font-size: 13px; color: var(--text-0); overflow-wrap: anywhere; }
.bcat-row__used { font-size: 11.5px; white-space: nowrap; }
.bcat-row__f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 0; }
.bcat-row__f input {
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
}
.bcat-row__actions { display: flex; align-items: center; gap: 6px; padding-bottom: 4px; }

.bcat-create { border-top: 1px solid var(--glass-border); padding-top: 14px; }
.bcat-create__title { display: block; font-size: 12px; margin-bottom: 8px; }
.bcat-create__fields {
  display: grid; gap: 8px; align-items: center;
  grid-template-columns: minmax(120px, 1fr) 1fr 1fr auto;
}
.bcat-create__fields input {
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
}
.bcat-create__fields .btn {
  width: auto; margin-top: 0; display: inline-flex; align-items: center;
  gap: 8px; padding: 9px 16px; white-space: nowrap;
}
.bcat-create__fields .btn svg { flex: none; width: 16px; height: 16px; }

@media (max-width: 640px) {
  .bcat-row { grid-template-columns: 24px 1fr 1fr; }
  .bcat-row__id { grid-column: 2 / -1; flex-direction: row; align-items: baseline; gap: 8px; }
  .bcat-row__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .bcat-create__fields { grid-template-columns: 1fr 1fr; }
}

/* Onglet « Badges » de la fiche utilisateur : badges détenus en liste simple. */
.ubdg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ubdg__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--glass-border);
}
.ubdg__item:last-child { border-bottom: 0; }
.ubdg__mark {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 10px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.ubdg__mark svg { width: 22px; height: 22px; }
.ubdg__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ubdg__slug { font-weight: 650; font-size: 13.5px; color: var(--text-0); overflow-wrap: anywhere; }
.ubdg__meta { font-size: 12px; }
.ubdg__empty { padding: 6px 0; }
.ubdg__revoke { width: auto; margin: 0 0 0 8px; flex: none; padding: 5px 11px; font-size: 12px; }

/* Attribuer un badge (onglet Badges de la fiche). */
.ubdg-grant { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--glass-border); }
.ubdg-grant__title { margin: 0 0 12px; font-size: 13px; font-weight: 650; color: var(--text-0); }
.ubdg-grant__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.ubdg-grant__row .field { margin: 0; }
.ubdg-grant__badge { flex: 1 1 200px; min-width: 0; }
.ubdg-grant__level { flex: 0 0 90px; }
.ubdg-grant__level input { width: 90px; }
.ubdg-grant__reason { flex: 1 1 200px; min-width: 0; }
.ubdg-grant__btn { width: auto; margin: 0; flex: none; }

/* Onglet Blocages : listes des deux directions. */
.blk-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.blk-empty { padding: 24px 0; text-align: center; }
.blk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--glass-border);
}
.blk-item:last-child { border-bottom: 0; }
.blk-item--gone { opacity: 0.6; }
.blk-item__avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 650;
  color: var(--text-1); background: var(--surface-inset); text-transform: uppercase;
}
.blk-item__body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.blk-item__ident { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.blk-item__name {
  font-size: 13.5px; font-weight: 600; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.blk-item__name { color: var(--accent); text-decoration: none; }
a.blk-item__name:hover { text-decoration: underline; }
.blk-verified {
  flex: none; display: inline-grid; place-items: center; width: 15px; height: 15px;
  border-radius: 50%; font-size: 10px; line-height: 1; color: #fff; background: var(--accent);
}
.blk-official { flex: none; }
.blk-item__handle { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.blk-item__date { flex: none; font-size: 12px; }

/* Combobox de sélection de badge (attribution) : icône SVG dérivée du slug + nom
   français, en remplacement du <select> natif (qui ne peut pas afficher d'icône). */
.bpick { position: relative; }
.bpick__trigger {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px; text-align: left; cursor: pointer;
  background: var(--surface-inset); border: 1px solid var(--glass-border); color: var(--text-0);
  transition: border-color 0.16s ease;
}
.bpick__trigger:hover { border-color: var(--accent-border); }
.bpick__current { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.bpick__ph { font-size: 13px; }
.bpick__caret { flex: none; width: 18px; height: 18px; color: var(--text-2); }
.bpick__ico {
  position: relative; flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; overflow: hidden;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent);
}
.bpick__ic { width: 22px; height: 22px; object-fit: contain; }
img.bpick__ic { display: block; }
.bpick__ic--fallback { display: none; }
.bpick__ico.is-empty img.bpick__ic { display: none; }
.bpick__ico.is-empty .bpick__ic--fallback { display: grid; place-items: center; }
.bpick__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bpick__name {
  font-size: 13.5px; font-weight: 600; color: var(--text-0);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bpick__slug {
  font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bpick__menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  display: flex; flex-direction: column; max-height: 320px;
  /* Fond OPAQUE : le voile de verre est posé sur une base pleine (`--glass-bg-strong`
     ne vaut que 7 % de blanc en thème sombre — sans base, le contenu sous-jacent
     transparaît à travers le menu). */
  background: linear-gradient(var(--glass-bg-strong), var(--glass-bg-strong)), var(--bg-1);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
/* `display: flex` ci-dessus l'emporterait sur le `display: none` de l'attribut
   `hidden` (feuille UA) : le menu resterait ouvert. Garde explicite, comme les
   modales du back-office. */
.bpick__menu[hidden] { display: none; }

.bpick__search {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-bottom: 1px solid var(--glass-border);
}
.bpick__search svg { flex: none; width: 16px; height: 16px; color: var(--text-2); }
.bpick__search input {
  flex: 1; min-width: 0; padding: 8px 11px; border-radius: var(--radius-sm);
  background: var(--input-bg); border: 1px solid var(--glass-border); color: var(--text-0);
  font-size: 13px; outline: none;
  transition: border-color 0.18s, background 0.18s;
}
.bpick__search input:focus { border-color: var(--accent); background: var(--input-bg-strong); }
.bpick__list { overflow-y: auto; padding: 4px; }
.bpick__opt {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 8px; text-align: left; cursor: pointer;
  background: transparent; border: 0; color: var(--text-0);
}
.bpick__opt:hover { background: var(--surface-inset); }
.bpick__opt.is-selected { background: var(--accent-soft); }
.bpick__empty { padding: 12px; text-align: center; font-size: 12.5px; }
