/* Users admin page */

/* Full width like detail_compte.php — pages users et changelog. La page
   des news (qui charge aussi ce fichier) garde la largeur de 900 px
   d'index.php, pour laisser voir son fond animé sur les côtés. */
body:not(.page-news) .main-content .dashboard-container {
    max-width: none !important;
}

/* Scroll horizontal de la table dans son propre conteneur,
   sans faire déborder la page (ce qui cacherait les colonnes de gauche
   derrière la sidebar fixe sur mobile). */
.u-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    align-self: stretch;
}

/* Supprimer les effets de survol/clic sur les blocs (account-box, account-block) */
.account-box:hover,
.account-box:active,
.account-link:hover,
.account-link:active {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none;
}

/* Prevent cell content from wrapping */
.users-table td,
.users-table th {
    white-space: nowrap;
}

/* Email column can shrink gracefully if very long */
.users-table td.u-col-email {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mini-lignes secondaires (email sous pseudo, activité sous inscription) —
   affichées uniquement en mode responsive quand les colonnes correspondantes
   sont masquées. Évite la duplication visuelle en desktop. */
.u-inline {
    display: none;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-text-secondary);
}

@media (max-width: 1100px) {
    .users-table th.u-col-email,
    .users-table td.u-col-email,
    .users-table th.u-col-activity,
    .users-table td.u-col-activity {
        display: none;
    }
    .u-inline { display: block; }
    /* La cellule Pseudo/Inscription contient désormais deux lignes : autoriser wrap */
    .users-table td:first-child,
    .users-table td:nth-child(3) {
        white-space: normal;
    }
}

/* ==================== ACCORDION ROWS ==================== */

.u-user-row {
    cursor: pointer;
    transition: background 0.15s;
}

.u-user-row:hover {
    background: var(--color-surface-hover, rgba(0,0,0,0.04));
}

.u-user-row.u-row-expanded {
    background: var(--color-surface-hover, rgba(0,0,0,0.04));
}

.u-user-row td:first-child {
    text-align: left;
}

.u-user-row td:first-child::before {
    content: '▶';
    display: inline-block;
    margin-right: 6px;
    font-size: 0.6rem;
    opacity: 0.4;
    transition: transform 0.2s;
    vertical-align: middle;
}

.u-user-row.u-row-expanded td:first-child::before {
    transform: rotate(90deg);
    opacity: 0.7;
}

/* Detail row — pas de bordure colorée */
.u-detail-row td {
    padding: 0 !important;
    border-bottom: 1px solid var(--color-border) !important;
}

/* Animation fluide via grid-template-rows (supporte hauteur inconnue) */
.u-detail-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s ease;
}

.u-detail-wrapper.open {
    grid-template-rows: 1fr;
}

.u-detail-inner {
    overflow: hidden;
}

.u-accounts-container {
    padding: 0;
    background: transparent;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Largeur minimale pour que toutes les colonnes restent accessibles */
.u-accounts-table {
    min-width: 600px;
}

/* Première colonne : largeur fixe pour éviter le retour à la ligne sur le label */
.u-accounts-table .u-col-account {
    min-width: 140px;
    max-width: 180px;
}

/* Serveur en ligne secondaire sous le portefeuille */
.u-accounts-table .u-col-server-inline {
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    display: block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 auto;
}

/* Solde : jamais coupé en plein milieu d'un nombre */
.u-accounts-table .u-col-balance {
    white-space: nowrap;
}

.u-accounts-loading,
.u-accounts-empty {
    padding: 10px 12px;
    color: var(--color-text-secondary);
    font-style: italic;
    font-size: 0.85rem;
}

/* Accounts sub-table — même style que open-table / closed-table */
.u-accounts-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    font-size: 0.82rem;
    border: none;
}

.u-accounts-table thead th {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    padding: 5px 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.u-accounts-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    white-space: nowrap;
    word-break: normal;  /* neutralise l'héritage de .metrics-table td { word-break: break-all } */
}

.u-accounts-table tbody tr:nth-child(even) {
    background: var(--color-bg);
}

.u-accounts-table tbody tr:last-child td {
    border-bottom: none;
}

.u-accounts-table tbody tr:hover {
    background: var(--color-bg-hover);
}

/* ==================== SORT INDICATORS ==================== */

.u-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.u-sortable::after {
    content: ' ⇅';
    opacity: 0.3;
    font-size: 0.75em;
}

.u-sort-asc::after {
    content: ' ▲';
    opacity: 0.7;
    color: var(--color-primary);
}

.u-sort-desc::after {
    content: ' ▼';
    opacity: 0.7;
    color: var(--color-primary);
}

/* Activity badges */
.u-badge--yellow {
    background: rgba(234,179,8,0.12);
    color: #a16207;
}

.u-badge--red {
    background: rgba(239,68,68,0.12);
    color: #b91c1c;
}

/* Compte créé depuis un historique importé (pas d'EA) : bleu, ni actif ni en panne */
.u-badge--import {
    background: rgba(31,111,235,0.12);
    color: #1f6feb;
}
.u-import-tag { color: #1f6feb; font-weight: 600; font-style: normal; }
:root[data-theme="dark"] .u-badge--import, :root[data-theme="dark"] .u-import-tag { color: #58a6ff; }

/* ==================== PLEINE LARGEUR + ÉCART ENTRE BLOCS ====================
   Applique aux pages changelog et users la même mise en page que
   metrics.php : conteneurs qui remplissent la largeur (au lieu du max
   --container-max-width = 900 px hérité d'index.css) + petit gap entre
   les .account-header-row d'un même .account-block (news compris).
   La page des news garde, elle, la largeur de 900 px d'index.php : les
   côtés libérés laissent voir son fond animé.
   Duplique la logique de metrics.css volontairement — ces trois pages ne
   chargent pas metrics.css. */
body.page-changelog .main-content .dashboard-container,
body.page-changelog .main-content > *,
body.page-users .main-content .dashboard-container,
body.page-users .main-content > * {
  max-width: none;
}

body.page-news #main-content .account-block,
body.page-changelog #main-content .account-block,
body.page-users #main-content .account-block {
  display: flex;
  flex-direction: column;
  gap: var(--section-gap, 8px);
}

body.page-news #main-content .account-header-row,
body.page-changelog #main-content .account-header-row,
body.page-users #main-content .account-header-row {
  margin-bottom: 0;
}

/* ==================== NEWS ====================
   Une carte par annonce, dépliable en accordéon (voir news.php +
   dashboard.js pour la logique .toggle-block / .accordion-group). Le
   fond, la bordure et le padding viennent maintenant du .account-box
   interne, on ne les duplique plus sur .news-card. */
.news-card {
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}
/* Le bloc .news-card hérite du cadre des .account-block (fond, bordure,
   padding) : combiné à celui du .account-box interne, il dessinait une
   bordure en double autour de chaque news. On ne garde que le cadre
   interne ; seul l'espacement entre deux news est conservé. */
#block-news .news-card.account-block {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  /* Ni rognage ni arrondi : hérités des .account-block, ils coupaient les
     coins de la case interne (et son soulèvement au survol). */
  overflow: visible;
  border-radius: 0;
}
/* Écart entre deux news : un seul espacement de 6 px, au lieu du gap de
   8 px des .account-block de la page (règle « PLEINE LARGEUR » plus haut)
   cumulé à la marge basse de 8 px de chaque bloc. */
body.page-news #main-content #block-news {
  gap: 6px;
}

/* Le header (label) porte le titre + la date. On ne coupe pas la
   marge basse quand replié (accordion collapse), sinon on garde un
   petit espace sous le titre visible. */
.news-card .account-label {
  padding: 0;
  margin: 0;
  font-weight: normal;
  line-height: 1.35;
  /* .account-label impose nowrap + overflow:hidden : le titre était coupé
     au lieu de passer à la ligne, et la bordure du bouton Partager rognée. */
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.news-card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.news-card-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.news-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.35;
}

.news-card-body {
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: left;   /* texte à gauche (il héritait du centrage de .account-box) */
}
/* Intertitres centrés, comme le titre de la news */
.news-card-body h3,
.news-card-body h4 { text-align: center; }
.news-card-body p { margin: 0 0 10px; }
.news-card-body p:last-child { margin-bottom: 0; }
.news-card-body ul,
.news-card-body ol { margin: 0 0 10px; padding-left: 20px; }
.news-card-body li { margin-bottom: 4px; }
.news-card-body em { font-style: italic; }
.news-card-body strong { font-weight: 700; }

/* Groupe d'images (captures) — deux ou plus, côte à côte sur desktop,
   empilées sur mobile. Border + fond thème pour se démarquer du corps.
   margin-bottom > 0 pour ne pas coller au texte qui suit (h3, p…). */
.news-figures {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 20px;
  padding: 0;
}
.news-figures img,
.news-figures .news-video {
  max-width: 600px;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg, 8px);
  background: var(--color-bg-secondary);
  padding: 4px;
  display: block;
}
/* Bouton « Partager » d'une news, à droite du titre ; « Lien copié »
   s'affiche en vert après la copie. Libellé masqué sur petit écran. */
.news-share {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.news-share:hover,
.news-share.copied {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.news-share.copied { background: var(--color-primary-light, transparent); }
@media (max-width: 480px) {
  .news-share-lbl { display: none; }
  .news-share { padding: 4px 7px; }
}
/* Mobile : date et bouton Partager sur la première ligne, titre en dessous
   sur toute la largeur, plus petit et libre de passer sur deux lignes. */
@media (max-width: 600px) {
  .news-card-head { row-gap: 4px; }
  .news-card-date { order: 1; }
  .news-share { order: 2; }
  .news-card-title { order: 3; flex-basis: 100%; font-size: 0.92rem; }
}
/* News ouverte depuis un lien de partage : défile sous la topbar fixe et
   se distingue d'un liseré vert. */
.news-card { scroll-margin-top: 64px; }
.news-card--target > .account-header-row > .account-box {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

/* Captures et vidéos agrandissables (classe posée par news.php) : loupe au
   survol, léger soulèvement — même effet que les captures de landing.php. */
.news-figures .news-zoomable {
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.news-figures .news-zoomable:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border-color: var(--color-primary);
}

/* Lightbox des news (copie de celle de landing.css, ids propres). */
#news-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  /* La lightbox est un enfant direct de <main> : sans ceci, la règle
     « .main-content > * » d'index.css (largeur bornée à 900 px, centrée)
     s'applique aussi à elle — fond noir de 900 px derrière une vidéo plus
     large au lieu d'un voile plein écran. */
  max-width: none !important;
  width: auto;
  margin: 0 !important;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 24px;
}
#news-lightbox.active { display: flex; }
#news-lightbox [hidden] { display: none; }
#news-lightbox__img,
#news-lightbox__video {
  max-width: min(94vw, 1600px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  cursor: default;
  object-fit: contain;
  animation: news-lightbox-in 0.18s ease;
}
@keyframes news-lightbox-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
#news-lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 9001;
}
#news-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }

/* Logo d'un outil en tête de news : centré, sans le cadre des captures.
   Classe news-logo aussi sur l'<img> : les balises Open Graph du lien de
   partage (php/news_share.php) lui préfèrent la première capture. */
.news-logo {
  margin: 4px 0 18px;
  padding: 0;
  text-align: center;
}
.news-logo img {
  display: inline-block;
  max-width: 300px;
  width: 100%;
  height: auto;
}
/* Logo carré (EA Stats Export) : plus petit qu'un logo en longueur. */
.news-logo--square img {
  max-width: 200px;
  border-radius: 12px;
}
/* Vidéo de démo — autoplay muted loop, sert de remplacement au GIF.
   preload=metadata suffit pour afficher le poster instantanément sans
   télécharger le flux tant que la page n'est pas visitée. */
.news-figures .news-video { max-width: 720px; width: 100%; }

/* Bouton d'appel à l'action dans le corps d'une news */
.news-card-body .news-cta-wrap { margin: 14px 0; text-align: center; }
.news-card-body a.news-cta {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius, 6px);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.news-card-body a.news-cta:hover { filter: brightness(1.08); }
@media (max-width: 768px) {
  .news-figures { flex-direction: column; }
  .news-figures img { max-width: 100%; }
}

.news-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-secondary);
  font-style: italic;
}

/* ==================== CHANGELOG ==================== */

.changelog-month {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg, 8px);
  background: var(--color-surface);
  margin-bottom: var(--box-gap, 6px);
  text-align: left;
}
.changelog-month:last-child { margin-bottom: 0; }

/* Le conteneur parent doit prendre toute la largeur */
.account-box.span-6 > .changelog-month { display: block; }

.changelog-month-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 8px;
}

.changelog-month-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.changelog-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.changelog-entries {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.changelog-day-group {
  padding: 4px 16px 10px 28px;
}

.changelog-day-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  margin-left: -12px;
}

.changelog-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.changelog-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.changelog-text {
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}

/* ==================== PLAN BADGE ==================== */
.u-plan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.u-plan-badge--retail {
  background: #22c55e;
  color: #fff;
}
.u-plan-badge--pro {
  background: #3b82f6;
  color: #fff;
}
.u-plan-badge--fund {
  background: #f59e0b;
  color: #fff;
}

/* ==================== ADMIN PANEL ==================== */
.u-admin-panel {
  background: var(--color-surface-alt, rgba(0,0,0,0.03));
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: 8px 12px;
  margin-bottom: 14px;
}

.u-admin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.u-admin-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 80px;
  flex-shrink: 0;
}
.u-admin-field--action {
  width: auto;
}

.u-admin-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.u-admin-label small {
  font-weight: 400;
  opacity: 0.7;
}

.u-admin-panel select,
.u-admin-panel input[type="text"],
.u-admin-panel input[type="date"],
.u-admin-panel input[type="number"] {
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  width: 100%;
  box-sizing: border-box;
}
.u-admin-panel select:focus,
.u-admin-panel input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.u-admin-save {
  padding: 4px 12px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-sm);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}
.u-admin-save:hover { opacity: 0.85; }
.u-admin-save:disabled { opacity: 0.5; cursor: not-allowed; }

.u-admin-status {
  font-size: var(--font-size-xs);
  font-weight: 500;
  align-self: flex-end;
  padding-bottom: 5px;
}

/* ================================================================
   Badges D-W-M par portefeuille et cloche d'alerte par compte
   Ajoutés à la sous-table des comptes de la page admin Utilisateurs.
================================================================ */
.u-pf-freq-group {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
  vertical-align: middle;
}
.u-pf-freq-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  min-width: 14px;
  text-align: center;
  line-height: 1.5;
}

.u-alert-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
}
.u-alert-bell--on  { color: var(--color-success, #22c55e); }
.u-alert-bell--off { color: var(--color-text-secondary); opacity: 0.5; }

/* ==================== REFONTE 2026-10-10 ====================
   Bloc du haut collé (chiffres clés cliquables, filtres), liste enrichie,
   fiche dépliée en sous-onglets. Cartes et barres : admin-stats.css. */
/* overflow visible : sinon le bloc collé se cale sur ce bloc (overflow hidden)
   et non sur la fenêtre, et se décale de 50 px vers le bas */
.page-users .ps-wrap { padding-top: 0; overflow: visible; }
/* Collé à sa position de départ (barre du haut 50 px + marge 16 px) : rien ne
   bouge au début du défilement. Il porte le bord haut et les coins de la carte
   (marges négatives = padding + bordure de la carte), et ::before masque
   l'espace entre la barre du haut et le bloc, où la liste défilerait. */
.u-sticky {
    position: sticky; top: 66px; z-index: 20;
    background: var(--color-surface); padding: var(--spacing-md) 16px 10px;
    margin: -1px -17px 8px;
    border: 1px solid var(--color-border); border-radius: 8px 8px 0 0;
}
.u-sticky::before {
    content: ''; position: absolute; left: -1px; right: -1px; bottom: 100%;
    height: 17px; margin-bottom: 1px; background: var(--color-bg);
}
.u-tabs .u-tab-soon { opacity: .45; cursor: not-allowed; }
.u-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 10px; }
.u-kpi {
    text-align: left; border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 7px 10px; background: var(--color-surface); cursor: pointer; font: inherit; color: var(--color-text);
    transition: border-color .12s, background .12s;
}
.u-kpi span { display: block; font-size: 11px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-kpi b { display: block; font-size: 20px; line-height: 1.2; }
.u-kpi small { font-size: 10.5px; color: var(--color-text-muted); }
.u-kpi:hover { border-color: var(--color-primary); }
.u-kpi.on { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)); }
.u-kpi--warn b { color: #d97706; }
.u-kpi--gold b { color: #b8860b; }
.u-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.u-search-wrap { position: relative; display: inline-flex; align-items: center; }
.u-search-wrap svg { position: absolute; left: 8px; color: var(--color-text-muted); }
.u-search-wrap input { width: 200px; height: 28px; padding: 0 8px 0 26px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-bg); color: var(--color-text); font-size: 12.5px; }
.u-chips { display: contents; }
.u-chip {
    height: 28px; padding: 0 10px; border: 1px solid var(--color-border); border-radius: 999px;
    background: var(--color-surface); color: var(--color-text); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.u-chip small { color: var(--color-text-muted); margin-left: 2px; }
.u-chip:hover { border-color: var(--color-primary); }
.u-chip.on { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.u-chip.on small { color: rgba(255,255,255,.8); }
.u-clear { height: 28px; padding: 0 10px; border: none; background: transparent; color: var(--color-primary); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }

/* Liste */
.users-table td { vertical-align: middle; }
.u-sub-email { display: block; font-size: 11px; color: var(--color-text-muted); font-weight: 400; margin-top: 1px; }
/* Liste : e-mail tronqué (adresse complète au survol), pastilles d'outils sur
   deux lignes — la colonne Statut restait sinon hors du cadre */
.u-email { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
.u-tools { display: flex; flex-wrap: wrap; gap: 3px; width: 200px; white-space: normal; }
.u-tools .u-pill { margin: 0; }
.u-muted { color: var(--color-text-muted); }
.u-badge-admin { background: rgba(99,102,241,0.12); color: #6366f1; }
.u-stage--mt { background: rgba(2,132,199,0.12); color: #0284c7; }
.u-stage--ea { background: rgba(124,58,237,0.12); color: #7c3aed; }
.u-seg { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; vertical-align: middle; }
.u-seg--gold { color: #b8860b; background: rgba(184,134,11,0.12); }
.u-seg--warn { color: #b45309; background: rgba(217,119,6,0.12); }
.u-rhythm { display: inline-flex; align-items: center; gap: 8px; }
.u-spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; width: 62px; }
.u-spark i { flex: 1; background: var(--color-primary); border-radius: 1px; opacity: .8; }
.u-spark i.z { background: var(--color-border); opacity: 1; }
.u-pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; margin: 1px 3px 1px 0; border-radius: 6px; border: 1px solid var(--color-border); color: var(--color-text-muted); }
.u-pill--mt { color: #0284c7; border-color: rgba(2,132,199,.35); }
.u-pill--lab { color: #0e9fb3; border-color: rgba(14,159,179,.4); }
.u-pill--sfe { color: #b03a1a; border-color: rgba(176,58,26,.35); }
.u-pill--tg { color: #229ed9; border-color: rgba(34,158,217,.4); }
.u-pill--dc { color: #5865f2; border-color: rgba(88,101,242,.4); }
.u-pill--scanner { color: #8a6000; border-color: rgba(138,96,0,.4); }
:root[data-theme="dark"] .u-pill--scanner { color: #f0b429; border-color: rgba(240,180,41,.4); }
.u-pill--stats { color: var(--color-primary); border-color: color-mix(in srgb, var(--color-primary) 40%, transparent); }

/* Fiche dépliée */
.u-detail { padding: 10px 12px 14px; background: color-mix(in srgb, var(--color-bg) 60%, transparent); }
.u-dtabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 10px; }
.u-dtabs button { border: none; background: transparent; font: inherit; font-size: 12.5px; padding: 6px 10px; color: var(--color-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.u-dtabs button.on { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.u-dgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1100px) { .u-dgrid { grid-template-columns: 1fr; } }
.u-dtitle { font-size: 12px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.u-kv { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.u-kv th { text-align: left; font-weight: 600; color: var(--color-text-muted); padding: 4px 12px 4px 0; white-space: nowrap; vertical-align: top; width: 1%; }
.u-kv td { padding: 4px 0; white-space: normal; }
.u-pages th { font-weight: 500; color: var(--color-text); }
.u-journal { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--color-border); }
.u-journal li { position: relative; padding: 4px 0 4px 16px; font-size: 12.5px; display: flex; gap: 12px; }
.u-journal li::before { content: ''; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--color-primary); }
.u-j-at { color: var(--color-text-muted); min-width: 120px; }
.u-detail .u-admin-panel { margin-top: 0; }
/* La fiche est dans le tableau de la liste : neutraliser les styles de
   .metrics-table (majuscules, alignement à droite, nowrap) */
.users-table .u-detail .u-kv th, .users-table .u-detail .u-kv td {
    text-align: left !important; text-transform: none; letter-spacing: normal; white-space: normal;
    font-size: 12.5px; background: transparent; border-bottom: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
}
.users-table .u-detail .u-kv th { color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }
.users-table .u-detail .u-pages th { color: var(--color-text); font-weight: 500; }
.users-table .u-detail .u-dtitle { text-align: left; }
.users-table .u-detail { text-align: left; white-space: normal; }
.u-user-row.u-flash > td { animation: u-flash 1.6s ease-out; }
@keyframes u-flash { from { background: color-mix(in srgb, var(--color-primary) 22%, transparent); } }

/* ==================== ONGLET ANALYSE (étape 2) ==================== */
.u-panel { margin-top: 8px; }
.u-sticky [hidden], .u-panel[hidden] { display: none !important; }   /* sinon display:flex de .u-filters l'emporte */
.u-filters > .ps-sub { font-size: 12px; color: var(--color-text-muted); margin-left: 4px; }
.u-funnel td:last-child { white-space: nowrap; }
.u-nowrap > .ps-bar { display: inline-block !important; width: 60px !important; }
.u-mchips, .u-mchips .u-muted { font-size: 12.5px; }
.u-segcard-foot { flex-wrap: wrap; }
.u-segcard-foot .ps-toggle { white-space: nowrap; }
.u-nowrap { white-space: nowrap; }
.u-funnel tr { cursor: pointer; }
.u-funnel tr:hover th, .u-funnel tr:hover td { background: color-mix(in srgb, var(--color-primary) 7%, transparent); }
.u-funnel th { color: var(--color-text) !important; font-weight: 600; }
.u-funnel td, .u-funnel th { vertical-align: middle !important; padding: 7px 6px !important; }
.u-funnel-bar { width: 32%; }
.u-fbar { display: block; height: 14px; background: var(--color-border); border-radius: 4px; overflow: hidden; }
.u-fbar i { display: block; height: 100%; background: var(--color-primary); border-radius: 4px; }
.u-funnel b { font-size: 14px; }
.u-retention th:first-child { white-space: nowrap; }
.u-retention tfoot th, .u-retention tfoot td { font-weight: 700; border-top: 2px solid var(--color-border); }
.u-heat { background: color-mix(in srgb, var(--color-primary) calc(var(--h) * 45%), transparent); }
.u-retention sup { color: var(--color-text-muted); }
.u-segcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }
.u-segcard { display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--color-primary); }
.u-segcard--ambassador { border-top-color: #b8860b; }
.u-segcard--tools_only { border-top-color: #0e9fb3; }
.u-segcard--reengage { border-top-color: #d97706; }
.u-segcard-head { display: flex; align-items: baseline; justify-content: space-between; }
.u-segcard-head h3 { margin: 0 !important; }
.u-segcard-head b { font-size: 22px; }
.u-segcard .ps-note { margin: 0; }
.u-segcard-action { font-size: 12.5px; margin: 0; }
.u-mchips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; flex: 1; align-content: flex-start; min-height: 26px; }
.u-mchip { font-size: 12px; padding: 2px 8px; border: 1px solid var(--color-border); border-radius: 12px; color: var(--color-text); text-decoration: none; }
.u-mchip:hover { border-color: var(--color-primary); }
.u-mchip small { color: var(--color-text-muted); }
.u-segcard-foot { display: flex; gap: 6px; }
.u-segcard-foot .ps-toggle { margin: 0; }

/* ==================== ONGLET ACTIVITÉ (étape 2) ==================== */
.u-feed-day { font-size: 13px; margin: 16px 0 6px; color: var(--color-text); }
.u-feed-day:first-child { margin-top: 4px; }
.u-feed-day small { color: var(--color-text-muted); font-weight: 400; margin-left: 4px; }
.u-feed { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius); }
.u-feed-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 12.5px; border-bottom: 1px solid var(--color-border); }
.u-feed-item:last-child { border-bottom: none; }
.u-feed--visit, .u-feed--login { opacity: .8; }
.u-feed-time { color: var(--color-text-muted); font-variant-numeric: tabular-nums; width: 38px; flex: none; }
.u-feed-type { flex: none; width: 104px; text-align: center; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.u-ft--green  { color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 13%, transparent); }
.u-ft--blue   { color: #0284c7; background: rgba(2,132,199,.12); }
.u-ft--violet { color: #7c3aed; background: rgba(124,58,237,.12); }
.u-ft--cyan   { color: #0e9fb3; background: rgba(14,159,179,.12); }
.u-ft--tg     { color: #229ed9; background: rgba(34,158,217,.12); }
.u-ft--dc     { color: #5865f2; background: rgba(88,101,242,.12); }
.u-ft--gold   { color: #8a6000; background: rgba(240,180,41,.16); }
:root[data-theme="dark"] .u-ft--gold { color: #f0b429; background: rgba(240,180,41,.14); }
.u-ft--grey   { color: var(--color-text-muted); background: color-mix(in srgb, var(--color-border) 60%, transparent); }
.u-feed-who { font-weight: 600; color: var(--color-text); text-decoration: none; }
.u-feed-who:hover { color: var(--color-primary); text-decoration: underline; }
.u-feed-anon { color: var(--color-text-muted); white-space: nowrap; }
.u-feed-txt { color: var(--color-text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-feed-ko { color: var(--color-loss, #ef4444); font-weight: 600; }
.u-feed-more { margin: 12px 0 4px; }
.u-feed-empty { padding: 20px 0; }
/* Petits écrans : bloc du haut non collé (chiffres clés et filtres sur
   plusieurs lignes, il masquerait une grande partie de la liste) */
@media (max-width: 900px) {
    .u-sticky { position: static; }
    .u-sticky::before { display: none; }
    .u-search-wrap input { width: 150px; }
    .u-feed-item { flex-wrap: wrap; gap: 4px 10px; }
    .u-feed-txt { white-space: normal; flex-basis: 100%; padding-left: 48px; }
    .u-funnel-bar { display: none; }
    .u-funnel td:last-child { white-space: normal; }
    #u-retention { overflow-x: auto; }
}
