/* ═══════════════════════════════════════════════════════════════════════════
   NkuPhone — feuille de style
   Les couleurs de graphique (--series-*) proviennent d'une palette validée
   (séparation daltonisme + contraste) dans les deux thèmes : ne pas les
   retoucher à l'œil. Le reste est libre.
   Toutes les animations passent par transform/opacity (composées par le GPU)
   et sont désactivées sous prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --brand: #2a78d6;
  --brand-600: #1c5cab;
  --brand-glow: rgba(42, 120, 214, .28);
  --brand-wash: rgba(42, 120, 214, .08);
  --brand-ink: #ffffff;

  --page: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;

  --sidebar-a: #101a2e;
  --sidebar-b: #0a1120;

  --ink: #0e1420;
  --ink-2: #4a5568;
  /* 4,76:1 sur blanc — les libellés secondaires sont en 12px, ils doivent
     tenir le seuil AA du petit texte (l'ancien #898781 plafonnait à 3,6:1). */
  --muted: #64748b;
  --line: #e5eaf1;
  --line-soft: #eef2f7;

  /* Statuts : jamais recyclés comme couleurs de série. */
  --ok: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;

  /* Séries de graphique — palette validée */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --sh-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --sh-2: 0 2px 4px rgba(16, 24, 40, .04), 0 8px 16px -4px rgba(16, 24, 40, .08);
  --sh-3: 0 4px 8px rgba(16, 24, 40, .05), 0 20px 32px -8px rgba(16, 24, 40, .14);
  --sh-brand: 0 6px 20px -6px var(--brand-glow);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-bs-theme="dark"] {
  --brand: #3987e5;
  --brand-600: #256abf;
  --brand-glow: rgba(57, 135, 229, .35);
  --brand-wash: rgba(57, 135, 229, .12);

  --page: #0a0e14;
  --surface: #141a23;
  --surface-2: #1a212c;
  --surface-3: #212934;

  --sidebar-a: #0d131d;
  --sidebar-b: #070b11;

  --ink: #e8eef6;
  --ink-2: #b6c2d2;
  --muted: #7d8899;
  --line: #262e3a;
  --line-soft: #1e252f;

  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #2c2c2a;
  --axis: #383835;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 4px 12px rgba(0, 0, 0, .45);
  --sh-3: 0 12px 32px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--page);
  color: var(--ink);
  margin: 0;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand-wash); }

/* Chiffres alignés verticalement dans les colonnes et les axes. */
.tnum, .table-x td, .table-x th, .axis-label { font-variant-numeric: tabular-nums; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Barres de défilement discrètes */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--page); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ═════════════════════════ Écran de connexion ═════════════════════════ */

#loginPage {
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  background: #f8fafc;
}

/* ── Panneau gauche ── */
.login-left {
  flex: 1 1 55%;
  background: linear-gradient(145deg, #0f172a 0%, #1e3a5f 55%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 72px;
  position: relative;
  overflow: hidden;
}

/* Halos décoratifs sur le panneau gauche */
.login-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42,120,214,.35) 0%, transparent 70%);
  top: -180px; right: -120px;
  pointer-events: none;
}
.login-left::after {
  content: '';
  position: absolute;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235,104,52,.2) 0%, transparent 70%);
  bottom: -120px; left: -80px;
  pointer-events: none;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}
.login-brand-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(42,120,214,.45);
  flex-shrink: 0;
}
.login-brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}
.login-brand-sub {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  margin-top: 1px;
}

.login-headline {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.5px;
  margin: 0 0 14px;
}
.login-sub {
  font-size: 16px;
  color: rgba(255,255,255,.6);
  margin: 0 0 48px;
  max-width: 380px;
  line-height: 1.6;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-feature {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.login-feature:hover { background: rgba(255,255,255,.11); }
.login-feature-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(42,120,214,.3);
  display: grid; place-items: center;
  color: #93c5fd;
  font-size: 18px;
  flex-shrink: 0;
}
.login-feature-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
}
.login-feature-desc {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
}

/* ── Panneau droit ── */
.login-right {
  flex: 0 0 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: #fff;
  position: relative;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  animation: cardIn .45s var(--ease-out) backwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.login-logo {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  display: block;
  object-fit: cover;
  margin-bottom: 24px;
  box-shadow: var(--sh-brand);
}

/* Responsive : empile sur mobile */
@media (max-width: 768px) {
  #loginPage { flex-direction: column; }
  .login-left {
    flex: none;
    padding: 36px 28px;
  }
  .login-features { display: none; }
  .login-headline { font-size: 24px; margin-bottom: 6px; }
  .login-sub { font-size: 14px; margin-bottom: 0; }
  .login-right { flex: 1; padding: 32px 24px; }
}

/* ═════════════════════════ Barre latérale ═════════════════════════ */

#sidebar {
  width: 252px;
  position: fixed;
  inset: 0 auto 0 0;
  background: linear-gradient(170deg, var(--sidebar-a), var(--sidebar-b));
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .3s var(--ease-out);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

#sidebar .brand {
  padding: 20px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

#sidebar .brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: block;
  object-fit: cover;
  flex: none;
  box-shadow: 0 4px 14px -3px var(--brand-glow);
  transition: transform .4s var(--spring);
}
#sidebar .brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

#sidebar .brand-name { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; letter-spacing: -.2px; }
#sidebar .brand-sub { color: #7b8ba6; font-size: 11px; margin-top: 1px; }

#sidebar nav {
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
  position: relative;   /* ancre l'indicateur glissant */
}
#sidebar nav::-webkit-scrollbar { width: 0; }

.nav-group-label {
  color: #7b8ba6;   /* 5,03:1 sur le fond du menu */
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px 12px 6px;
}
.nav-group-label:first-child { padding-top: 2px; }

/* Pastille active qui glisse d'un élément à l'autre (position posée en JS). */
.nav-indicator {
  position: absolute;
  /* top:0 est indispensable : sans lui la pastille partirait de sa position
     statique (après le padding du menu) et la translation s'y ajouterait.
     offsetTop se mesure depuis ce même bord intérieur, donc les deux coïncident. */
  top: 0;
  left: 10px; right: 10px;
  height: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  box-shadow: 0 4px 16px -4px var(--brand-glow);
  transition: transform .38s var(--spring), height .28s var(--ease), opacity .2s;
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.nav-indicator.on { opacity: 1; }

#sidebar nav a {
  position: relative;
  z-index: 1;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  color: #97a3b6;
  border-radius: 10px;
  margin-bottom: 3px;
  font-weight: 500;
  transition: color .2s var(--ease), transform .2s var(--ease);
  overflow: hidden;
}

/* Voile de survol qui balaie de la gauche vers la droite. */
#sidebar nav a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .07);
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease-out);
  z-index: -1;
}
#sidebar nav a:hover::before { transform: scaleX(1); }
#sidebar nav a:hover { color: #e8eef6; }
#sidebar nav a:hover .nav-ico { transform: translateX(2px) scale(1.12); }
#sidebar nav a.active { color: #fff; }
#sidebar nav a.active::before { transform: scaleX(0); }
#sidebar nav a.active .nav-ico { transform: scale(1.06); }

.nav-ico {
  width: 20px;
  display: grid; place-items: center;
  font-size: 16px;
  flex: none;
  transition: transform .3s var(--spring);
}

#sidebar nav a .count {
  margin-left: auto;
  background: rgba(255, 255, 255, .1);
  color: #cbd5e1;
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  min-width: 22px;
  text-align: center;
  transition: background .2s;
}
#sidebar nav a .count:empty { display: none; }
#sidebar nav a .count.alert {
  background: var(--crit);
  color: #fff;
  animation: pulseBadge 2.4s var(--ease) infinite;
}
@keyframes pulseBadge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(208, 59, 59, .5); }
  50%      { box-shadow: 0 0 0 5px rgba(208, 59, 59, 0); }
}
#sidebar nav a.active .count { background: rgba(255, 255, 255, .22); color: #fff; }

#sidebar .foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
#sidebar .foot .who { color: #97a3b6; font-size: 12px; display: flex; align-items: center; gap: 8px; }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  position: relative;
  flex: none;
}
.live-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping {
  0%   { transform: scale(1); opacity: .7; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { opacity: 0; }
}
.live-dot.off { background: var(--muted); }
.live-dot.off::after { display: none; }

/* ═════════════════════════ Zone principale ═════════════════════════ */

#main { margin-left: 252px; min-height: 100vh; }

/* Bandeau d'accès éditeur : volontairement voyant et non masquable — on ne doit
   jamais oublier qu'on agit chez un client. */
#impersonateBar, #devBar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  background: linear-gradient(90deg, var(--serious), #d4703f);
  color: #fff; font-size: 13px; font-weight: 500;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
#impersonateBar i, #devBar i { font-size: 15px; }
#impersonateBar strong, #devBar strong { font-weight: 700; }

/* Sécurité affaiblie : rouge, pas orange — la nuance compte. */
#devBar { background: linear-gradient(90deg, var(--crit), #a52a2a); }

#topbar {
  position: sticky; top: 0; z-index: 1020;
  background: var(--surface);   /* repli si color-mix n'est pas géré */
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 11px 22px;
  display: flex; align-items: center; gap: 12px;
}

#topbar .title { font-weight: 650; font-size: 15px; letter-spacing: -.2px; }

.search-global { flex: 1; max-width: 440px; position: relative; }
.search-global i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px;
  transition: color .2s;
}
.search-global input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-global input::placeholder { color: var(--muted); }
.search-global input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-wash);
}
.search-global input:focus + i,
.search-global:focus-within i { color: var(--brand); }
.search-global kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 5px; padding: 2px 6px; color: var(--muted);
  font-family: inherit;
}

.icon-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s, transform .18s var(--ease), border-color .18s;
}
.icon-btn:hover {
  background: var(--surface-3);
  color: var(--ink);
  border-color: var(--muted);
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0) scale(.95); }
.icon-btn.spin i { animation: spin .6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Boutons Bootstrap : on ajoute juste le relief au survol. */
.btn { transition: transform .16s var(--ease), box-shadow .2s var(--ease), background-color .18s, border-color .18s; }
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  border: none;
  box-shadow: 0 2px 8px -2px var(--brand-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-600));
  transform: translateY(-1px);
  box-shadow: var(--sh-brand);
}

.page { padding: 24px; max-width: 1560px; animation: pageIn .34s var(--ease-out) backwards; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.5px; }
.page-head p { color: var(--muted); margin: 0; font-size: 13px; }

/* ═════════════════════════ Cartes ═════════════════════════ */

/* Pas de `contain: layout` ici : il ferait de la carte le bloc conteneur des
   descendants en position:fixed (les menus déroulants de Popper) et créerait un
   contexte d'empilement qui les enfermerait sous les lignes suivantes. Le gain
   de performance ne vaut pas un menu illisible. */
.card-x {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: box-shadow .25s var(--ease), border-color .25s;
}
.card-x:hover { box-shadow: var(--sh-2); }

.card-x-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 11px;
}
.card-x-head h2 {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); margin: 0;
}
.card-x-body { padding: 18px; }

/* ═════════════════════════ Menus déroulants ═════════════════════════ */

/* Fond et empilement posés explicitement : un menu d'actions ne doit jamais
   laisser voir le tableau au travers, ni passer sous une ligne voisine.
   1080 le place au-dessus de la barre latérale (1040) et de l'en-tête (1020). */
.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-link-color: var(--ink);
  --bs-dropdown-link-hover-color: var(--ink);
  --bs-dropdown-link-hover-bg: var(--surface-3);
  --bs-dropdown-divider-bg: var(--line-soft);
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  z-index: 1080;
  padding: 6px;
  font-size: 13.5px;
  min-width: 214px;
}
.dropdown-item {
  border-radius: var(--r-sm);
  padding: 8px 11px;
  transition: background .14s var(--ease);
}
.dropdown-item:active { background: var(--brand); color: #fff; }
.dropdown-item.text-danger:hover { background: rgba(208, 59, 59, .1); }
.dropdown-divider { margin: 5px 4px; }

/* ═════════════════════════ Tuiles KPI ═════════════════════════ */

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }

.tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--sh-1);
  display: flex; align-items: flex-start; gap: 12px;
  color: inherit;
  overflow: hidden;
  isolation: isolate;
  transition: transform .24s var(--ease-out), box-shadow .24s var(--ease), border-color .24s;
  animation: tileIn .4s var(--ease-out) backwards;
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* Décalage en cascade : la rangée se compose au lieu d'apparaître d'un bloc. */
.tiles .tile:nth-child(1) { animation-delay: .02s; }
.tiles .tile:nth-child(2) { animation-delay: .06s; }
.tiles .tile:nth-child(3) { animation-delay: .10s; }
.tiles .tile:nth-child(4) { animation-delay: .14s; }
.tiles .tile:nth-child(5) { animation-delay: .18s; }
.tiles .tile:nth-child(6) { animation-delay: .22s; }

/* Filet coloré en haut, révélé au survol. */
.tile::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--tile-accent, var(--brand));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-out);
}
a.tile:hover::before { transform: scaleX(1); }
a.tile { cursor: pointer; }
a.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-3);
  border-color: var(--tile-accent, var(--brand));   /* repli si color-mix n'est pas géré */
  border-color: color-mix(in srgb, var(--tile-accent, var(--brand)) 45%, var(--line));
}
a.tile:hover .ico { transform: scale(1.1) rotate(-5deg); }

.tile .val {
  font-size: 27px; font-weight: 700; line-height: 1.1; letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
}
.tile .lab { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 500; }
.tile .ico {
  margin-left: auto;
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 17px; flex: none;
  transition: transform .3s var(--spring);
}

/* Le fond coloré double l'icône ; le libellé reste toujours écrit. */
.ico.ok   { background: linear-gradient(135deg, rgba(12,163,12,.16), rgba(12,163,12,.06)); color: #0a8a0a; }
.ico.warn { background: linear-gradient(135deg, rgba(250,178,25,.22), rgba(250,178,25,.08)); color: #9a6b00; }
.ico.ser  { background: linear-gradient(135deg, rgba(236,131,90,.22), rgba(236,131,90,.08)); color: #a24a22; }
.ico.crit { background: linear-gradient(135deg, rgba(208,59,59,.16), rgba(208,59,59,.06)); color: var(--crit); }
.ico.info { background: linear-gradient(135deg, rgba(42,120,214,.16), rgba(42,120,214,.06)); color: var(--brand); }
.ico.mute { background: linear-gradient(135deg, rgba(139,150,168,.18), rgba(139,150,168,.06)); color: var(--muted); }

[data-bs-theme="dark"] .ico.ok   { color: #4ade80; }
[data-bs-theme="dark"] .ico.warn { color: var(--warn); }
[data-bs-theme="dark"] .ico.ser  { color: var(--serious); }
[data-bs-theme="dark"] .ico.crit { color: #f87171; }

/* Variation de tendance, à côté de la valeur. */
.trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
  margin-left: 8px; vertical-align: middle;
}
.trend.up   { background: rgba(12,163,12,.12); color: #0a8a0a; }
.trend.down { background: rgba(208,59,59,.12); color: var(--crit); }
.trend.flat { background: var(--surface-3); color: var(--muted); }
[data-bs-theme="dark"] .trend.up { color: #4ade80; }
[data-bs-theme="dark"] .trend.down { color: #f87171; }

.sparkline { display: block; margin-top: 8px; width: 100%; height: 26px; overflow: visible; }
.sparkline path { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline .area { fill: var(--brand-wash); stroke: none; }

/* ═════════════════════════ Badges ═════════════════════════ */

.badge-x {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-x i { font-size: 11px; }
.badge-x.ok   { background: rgba(12,163,12,.1);  color: #087008; border-color: rgba(12,163,12,.18); }
.badge-x.crit { background: rgba(208,59,59,.1);  color: #a52a2a; border-color: rgba(208,59,59,.18); }
.badge-x.warn { background: rgba(250,178,25,.15); color: #8a5f00; border-color: rgba(250,178,25,.3); }
.badge-x.ser  { background: rgba(236,131,90,.15); color: #9c4520; border-color: rgba(236,131,90,.3); }
.badge-x.mute { background: var(--surface-3); color: var(--ink-2); border-color: var(--line); }
.badge-x.info { background: rgba(42,120,214,.1); color: #1c5cab; border-color: rgba(42,120,214,.18); }

[data-bs-theme="dark"] .badge-x.ok   { color: #4ade80; }
[data-bs-theme="dark"] .badge-x.crit { color: #f87171; }
[data-bs-theme="dark"] .badge-x.warn { color: #fbbf24; }
[data-bs-theme="dark"] .badge-x.ser  { color: #fb923c; }
[data-bs-theme="dark"] .badge-x.info { color: #7cb0f0; }
.badge-x.mm { background: rgba(124,58,237,.1); color: #6d28d9; border-color: rgba(124,58,237,.18); }
[data-bs-theme="dark"] .badge-x.mm { color: #a78bfa; }

/* ═════════════════════════ Tableaux ═════════════════════════ */

.table-x { width: 100%; border-collapse: separate; border-spacing: 0; }

.table-x thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);   /* repli si color-mix n'est pas géré */
  background: color-mix(in srgb, var(--surface-2) 92%, transparent);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left; white-space: nowrap;
}
.table-x thead th.sortable { cursor: pointer; user-select: none; transition: color .18s; }
.table-x thead th.sortable:hover { color: var(--brand); }
.table-x thead th .sort-ind { opacity: .55; margin-left: 3px; font-size: 10px; }

.table-x tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table-x tbody tr {
  position: relative;
  transition: background .16s var(--ease);
  animation: rowIn .3s var(--ease-out) backwards;
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.table-x tbody tr:hover { background: var(--surface-2); }
.table-x tbody tr.selected { background: var(--brand-wash); }

/* Liseré d'accent sur la première cellule, révélé au survol. */
.table-x tbody td:first-child { position: relative; }
.table-x tbody td:first-child::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand);
  transform: scaleY(0);
  transition: transform .22s var(--ease-out);
}
.table-x tbody tr:hover td:first-child::before,
.table-x tbody tr.selected td:first-child::before { transform: scaleY(1); }

.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }

.cell-strong { font-weight: 600; letter-spacing: -.1px; }
.cell-sub { color: var(--muted); font-size: 12px; }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12px; }

/* Pastille d'initiales — la teinte est dérivée du nom, en JS. */
.avatar {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  flex: none;
  letter-spacing: -.3px;
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .12);
  transition: transform .25s var(--spring);
}
tr:hover .avatar { transform: scale(1.07) rotate(-3deg); }
.cell-id { display: flex; align-items: center; gap: 11px; }

/* ═════════════════════════ Progression contrat ═════════════════════════ */

.progress-x {
  height: 7px; border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 96px;
  position: relative;
}
.progress-x > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-600));
  border-radius: 4px;
  transition: width .7s var(--ease-out);
  position: relative;
}
/* Reflet qui balaie la barre, seulement sur les contrats en cours. */
.progress-x > span::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%);
  animation: sheen 2.6s var(--ease) infinite;
}
.progress-x.done > span { background: linear-gradient(90deg, var(--ok), #0a8a0a); }
.progress-x.done > span::after { display: none; }
@keyframes sheen { to { transform: translateX(100%); } }

/* ═════════════════════════ Actions groupées ═════════════════════════ */

.bulkbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(90deg, var(--brand-wash), transparent);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  animation: slideDown .28s var(--ease-out);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ═════════════════════════ États vides ═════════════════════════ */

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty > i {
  font-size: 30px;
  display: grid; place-items: center;
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
  color: var(--muted);
  box-shadow: var(--sh-1);
}
.empty h3 { font-size: 15.5px; font-weight: 650; color: var(--ink); margin: 0 0 6px; }
.empty p { margin: 0 0 18px; font-size: 13px; }

/* Empty state — version riche (appareils, résultats vides) */
.empty-devices {
  text-align: center;
  padding: 64px 24px;
}
.empty-devices-ico {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--brand);
  font-size: 38px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  box-shadow: 0 4px 20px rgba(29,78,216,.12);
}
[data-bs-theme="dark"] .empty-devices-ico {
  background: linear-gradient(135deg, rgba(29,78,216,.18) 0%, rgba(29,78,216,.28) 100%);
}
.empty-devices h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}
.empty-devices p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.empty-devices-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
  color: var(--brand-ink);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29,78,216,.28);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.empty-devices-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(29,78,216,.36);
  color: var(--brand-ink);
}
.empty-devices-btn:active { transform: translateY(0); }
.empty-devices-btn i { font-size: 18px; }

/* ═════════════════════════ Squelettes ═════════════════════════ */

.skel {
  background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 37%, var(--line-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
  height: 12px;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ═════════════════════════ Graphiques ═════════════════════════ */

.chart-svg { width: 100%; display: block; overflow: visible; }
.chart-grid line { stroke: var(--grid); stroke-width: 1; }
.chart-axis line { stroke: var(--axis); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: 11px; }
.chart-value { fill: var(--ink); font-size: 11px; font-weight: 700; }
.chart-bar {
  fill: var(--series-1);
  transition: opacity .15s var(--ease);
  transform-origin: bottom;
  animation: growUp .55s var(--ease-out) backwards;
}
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-hit:hover + .chart-bar, .chart-bar.hl { opacity: .75; }

.chart-tip {
  position: fixed; z-index: 2000;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--sh-3);
  padding: 9px 12px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s var(--ease), transform .14s var(--ease);
  max-width: 230px;
}
.chart-tip.show { opacity: 1; transform: none; }
.chart-tip .t-lab { color: var(--muted); font-size: 11px; }
.chart-tip .t-val { font-weight: 700; font-size: 15px; letter-spacing: -.3px; }

/* Barre empilée du portefeuille : 2px de fond entre segments. */
.stackbar {
  display: flex; height: 34px; border-radius: 10px; overflow: hidden;
  gap: 2px; background: var(--surface);
}
.stackbar > span { display: block; transition: width .8s var(--ease-out); }
.stackbar .seg-1 { background: linear-gradient(135deg, var(--series-1), var(--brand-600)); }
.stackbar .seg-2 { background: linear-gradient(135deg, var(--series-2), #c94f1f); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 13px; font-size: 12px; }
.legend .item { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.legend .swatch { width: 11px; height: 11px; border-radius: 4px; flex: none; }

/* ═════════════════════════ Carte GPS ═════════════════════════ */

#mainMap, #detailMap { border-radius: var(--r); z-index: 1; }
#mainMap { height: calc(100vh - 226px); min-height: 400px; }
#detailMap { height: 300px; }
.leaflet-container { background: var(--surface-2); font: inherit; }
.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: var(--sh-3); }

/* Custom pulsing marker */
.pos-marker { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); position: relative; }
.pos-marker::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid rgba(124,58,237,.45); animation: pos-pulse 2s ease-out infinite; }
@keyframes pos-pulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(2.2); } }

/* Position info cards */
.pos-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-toolbar select { width: auto; }
.pos-toolbar .trail-info { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pos-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.pos-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.pos-card-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pos-card-value { font-size: 13px; font-weight: 500; color: var(--text); font-family: var(--mono, monospace); display: flex; align-items: center; gap: 6px; overflow: hidden; }
.pos-card-value span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-card-value .pos-copy { flex: none; background: none; border: none; padding: 0; cursor: pointer; color: var(--muted); line-height: 1; transition: color .15s; }
.pos-card-value .pos-copy:hover { color: var(--brand); }
.pos-card-sub { font-size: 11px; color: var(--muted); }
@media (max-width: 520px) { .pos-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 360px) { .pos-cards { grid-template-columns: 1fr; } }

/* ═════════════════════════ Fiche détaillée ═════════════════════════ */

.offcanvas.drawer { width: min(640px, 100vw); border-left: 1px solid var(--line); }
.drawer .nav-tabs { border-bottom: 1px solid var(--line); padding: 0 18px; gap: 2px; }
.drawer .nav-tabs .nav-link {
  border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 13px; font-weight: 550; padding: 11px 13px;
  transition: color .18s, border-color .18s;
}
.drawer .nav-tabs .nav-link:hover { color: var(--ink); }
.drawer .nav-tabs .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); background: none; }

.kv { display: grid; grid-template-columns: 138px 1fr; gap: 9px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), transparent);
  opacity: .35;
}
.timeline .ev { position: relative; padding-bottom: 16px; font-size: 13px; }
.timeline .ev::before {
  content: ''; position: absolute; left: -20px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line);
}

/* ═════════════════════════ Formulaires ═════════════════════════ */

.form-label { font-size: 12px; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.form-control, .form-select { font-size: 13px; border-radius: var(--r-sm); border-color: var(--line); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-wash);
}
.section-sep {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .9px;
  color: var(--muted); margin: 24px 0 12px; padding-bottom: 7px;
  border-bottom: 1px solid var(--line-soft);
}

.calc-box {
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 12.5px;
}

.modal-content { border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); }
.modal-header, .modal-footer { border-color: var(--line-soft); }

/* Bootstrap ne rend une modale défilante que si .modal-body est enfant DIRECT
   de .modal-content. Nos formulaires enveloppent le corps ET le pied, ce qui
   rompait la chaîne flex : le corps ne défilait pas, débordait, et le pied —
   avec le bouton d'enregistrement — sortait de la zone visible.
   On réinsère le <form> dans la chaîne : il devient la colonne flex. */
.modal-dialog-scrollable .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;      /* sans cela un élément flex refuse de rétrécir */
  overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* Le pied reste visible et se détache du contenu qui défile dessous. */
.modal-dialog-scrollable .modal-footer {
  flex: none;
  box-shadow: 0 -6px 12px -8px rgba(16, 24, 40, .18);
}
[data-bs-theme="dark"] .modal-dialog-scrollable .modal-footer {
  box-shadow: 0 -6px 12px -8px rgba(0, 0, 0, .5);
}

/* ═════════════════════════ Divers ═════════════════════════ */

.pagination-x { display: flex; align-items: center; gap: 5px; padding: 13px 18px; flex-wrap: wrap; }
.pagination-x button {
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r-sm); font-size: 13px; cursor: pointer;
  transition: background .16s, color .16s, transform .16s var(--ease), border-color .16s;
}
.pagination-x button:hover:not(:disabled) {
  background: var(--surface-3); color: var(--ink);
  transform: translateY(-1px); border-color: var(--muted);
}
.pagination-x button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  border-color: transparent; color: #fff; font-weight: 650;
  box-shadow: 0 2px 8px -2px var(--brand-glow);
}
.pagination-x button:disabled { opacity: .35; cursor: default; }

#backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 10, 18, .55);
  backdrop-filter: blur(3px);
  z-index: 1035; display: none;
}

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 3000; display: flex; flex-direction: column; gap: 9px; }
.toast-wrap .toast { border-radius: var(--r); box-shadow: var(--sh-3); animation: toastIn .3s var(--spring); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ═════════════════════════ Responsive ═════════════════════════ */

@media (max-width: 992px) {
  #sidebar { transform: translateX(-100%); box-shadow: var(--sh-3); }
  #sidebar.open { transform: none; }
  #main { margin-left: 0; }
  #backdrop.show { display: block; animation: fadeIn .22s var(--ease); }
  .page { padding: 16px; }
  .search-global kbd { display: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Sous 768px le tableau devient une pile de cartes : chaque cellule porte son
   libellé via data-label, sinon les colonnes deviennent illisibles. */
@media (max-width: 768px) {
  .table-x thead { display: none; }
  .table-x, .table-x tbody, .table-x tr, .table-x td { display: block; width: 100%; }
  .table-x tbody tr {
    border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 12px; padding: 8px 4px; background: var(--surface);
    box-shadow: var(--sh-1);
  }
  .table-x tbody td { border: 0; padding: 7px 14px; display: flex; gap: 12px; align-items: center; }
  .table-x tbody td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    flex: none; width: 92px;
  }
  .table-x tbody td[data-label=""]::before { display: none; }
  .table-x tbody td:first-child::before { display: none; }
  .tile .val { font-size: 23px; }
  .page-head h1 { font-size: 20px; }
}

/* Conteneur déjà rendu une fois : on coupe les animations d'entrée pour que
   le rafraîchissement automatique ne relance pas la cascade toutes les 60 s.
   Ciblé sur les éléments concernés, pour ne pas figer les squelettes. */
.no-anim > .tile,
.no-anim tr,
.no-anim .card-x { animation: none !important; }

/* ═════════════════════════ Accessibilité ═════════════════════════ */

/* Un utilisateur qui demande moins d'animation ne doit en garder aucune. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═════════════════════════ Guide de déploiement ═════════════════════════ */

/* Barre d'accès rapide */
.guide-infobar {
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 6%, var(--surface)), var(--surface));
}

.guide-field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.guide-field-row label {
  flex: none;
  width: 200px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.guide-field-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.guide-field-controls input {
  flex: 1;
  min-width: 0;
  max-width: 480px;
  font-family: 'Fira Mono', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  background: var(--bg);
  border-color: var(--border);
  color: var(--ink);
  letter-spacing: .03em;
}
.guide-field-controls input:read-only {
  cursor: default;
}

/* Architecture diagram */
.guide-arch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  padding: 12px 0 8px;
}
.guide-arch-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  min-width: 140px;
  text-align: center;
  box-shadow: var(--sh);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.guide-arch-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-brand);
}
.guide-arch-box--server {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.guide-arch-ico {
  font-size: 32px;
  color: var(--brand);
  line-height: 1;
}
.guide-arch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.guide-arch-label small {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
}
.guide-arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 80px;
  flex-shrink: 0;
}
.guide-arch-arrow-line {
  width: 100%;
  height: 2px;
  background: var(--brand);
  position: relative;
}
.guide-arch-arrowhead {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--brand);
  margin-top: -8px;
  align-self: flex-end;
}
.guide-arch-arrow-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
  white-space: nowrap;
}
.guide-arch-return {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px;
}
.guide-arch-return-arrow {
  color: var(--brand);
  font-size: 14px;
}
.guide-arch-return-label {
  font-weight: 500;
}

/* Steps */
.guide-steps { display: flex; flex-direction: column; gap: 0; }

.guide-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
}

/* Featured step — Device Owner */
.guide-step--featured {
  border-left: 4px solid #7c3aed;
  background: color-mix(in srgb, #7c3aed 4%, var(--surface));
}
[data-bs-theme="dark"] .guide-step--featured {
  background: color-mix(in srgb, #7c3aed 9%, var(--surface));
}
.guide-step-num--shield {
  background: #7c3aed !important;
  font-size: 20px !important;
  font-weight: 400 !important;
}

/* DPM capabilities grid */
.guide-dpm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.guide-dpm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, #7c3aed 8%, var(--surface));
  border: 1px solid rgba(124, 58, 237, .25);
  border-radius: var(--r);
  font-size: 13px;
  color: var(--ink);
}
.guide-dpm-item i {
  color: #7c3aed;
  font-size: 16px;
  flex-shrink: 0;
}

.guide-step-num {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 40%, transparent);
  letter-spacing: -.5px;
}
.guide-step-body {
  flex: 1;
  min-width: 0;
}
.guide-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.guide-step-icon {
  font-size: 22px;
  color: var(--brand);
  flex-shrink: 0;
}

/* Callout notes */
.guide-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: var(--r);
  border-left: 4px solid;
  font-size: 13.5px;
  line-height: 1.55;
}
.guide-note.info    { background: color-mix(in srgb, #3b82f6 10%, var(--surface)); border-color: #3b82f6; color: var(--ink); }
.guide-note.warn    { background: color-mix(in srgb, #f59e0b 10%, var(--surface)); border-color: #f59e0b; color: var(--ink); }
.guide-note.danger  { background: color-mix(in srgb, #ef4444 10%, var(--surface)); border-color: #ef4444; color: var(--ink); }
.guide-note.tip     { background: color-mix(in srgb, #22c55e 10%, var(--surface)); border-color: #22c55e; color: var(--ink); }
.guide-note-icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}
.guide-note.info    .guide-note-icon { color: #3b82f6; }
.guide-note.warn    .guide-note-icon { color: #f59e0b; }
.guide-note.danger  .guide-note-icon { color: #ef4444; }
.guide-note.tip     .guide-note-icon { color: #22c55e; }

/* Code blocks */
.guide-code {
  background: #1a1f2e;
  color: #e2e8f0;
  font-family: 'Fira Mono', 'Consolas', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.65;
  padding: 18px 20px;
  border-radius: var(--r);
  position: relative;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #2d3748;
}
.guide-code pre {
  margin: 0;
  font: inherit;
  color: inherit;
  white-space: pre-wrap;
  word-break: break-all;
}
.guide-code-label {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #64748b;
  background: #2d3748;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Checklist */
.guide-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guide-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.guide-checklist li::before {
  content: '\F26B';
  font-family: 'bootstrap-icons';
  font-size: 16px;
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Operations grid */
.guide-ops-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.guide-op-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  transition: box-shadow .15s var(--ease-out);
}
.guide-op-card:hover {
  box-shadow: var(--sh);
}
.guide-op-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--brand);
}
.guide-op-content { flex: 1; min-width: 0; }
.guide-op-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.guide-op-card ol {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
}

/* Troubleshooting */
.guide-trouble { display: flex; flex-direction: column; }
.guide-trouble-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.guide-trouble-item ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}
.guide-trouble-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink);
}
.guide-trouble-badge {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}
.guide-trouble-badge.crit { color: #ef4444; }
.guide-trouble-badge.warn { color: #f59e0b; }

/* ── Download cards ─────────────────────────────────────────────────────────── */
.guide-dl-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  height: 100%;
  transition: box-shadow .15s var(--ease-out);
}
.guide-dl-card:hover { box-shadow: var(--sh); }
.guide-dl-card--featured {
  border-color: rgba(42, 120, 214, .3);
  background: rgba(42, 120, 214, .04);
}
.guide-dl-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.guide-dl-info { flex: 1; }
.guide-dl-name { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.guide-dl-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 4px; }
.guide-dl-meta { font-size: 11px; color: var(--muted); }
.guide-dl-btn  { align-self: flex-start; }

/* ── Provisioner steps ──────────────────────────────────────────────────────── */
.guide-provisioner-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.guide-prov-step {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.guide-prov-step:last-child { border-bottom: none; }
.guide-prov-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.guide-prov-body { flex: 1; min-width: 0; }
.guide-prov-body strong { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 6px; }
.guide-prov-body p  { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.guide-prov-body ol,
.guide-prov-body ul { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; padding-left: 20px; margin-bottom: 0; }

/* ═════════════════════════ Mobile Money multi-prestataires ═════════════════════════ */

.mm-prov-list { display: flex; flex-direction: column; gap: 10px; }
.mm-prov-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r); transition: border-color .18s, box-shadow .18s;
}
.mm-prov-card:hover { border-color: var(--brand); box-shadow: var(--sh-1); }
.mm-prov-avatar {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.mm-prov-body { flex: 1; min-width: 0; }
.mm-prov-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.mm-prov-number { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mm-prov-inst { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: pre-line; line-height: 1.5; }
.mm-prov-actions { flex-shrink: 0; display: flex; gap: 4px; margin-top: -4px; }

/* Payment request approve modal */
.pr-approve-rows { display: flex; flex-direction: column; gap: 8px; }
.pr-approve-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.pr-approve-row-label { color: var(--muted); white-space: nowrap; }
.pr-approve-row-val { font-weight: 500; text-align: right; }
.pr-approve-row-val.amount { font-size: 18px; font-weight: 700; color: var(--green, #15803d); }
.pr-approve-row-val.due { color: var(--brand); }
.pr-approve-sep { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.pr-locked-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 100px; background: rgba(220,38,38,.1); color: #dc2626; }

/* Responsive guide */
@media (max-width: 768px) {
  .guide-arch {
    flex-direction: column;
    align-items: center;
  }
  .guide-arch-connector {
    width: 2px;
    height: 48px;
    flex-direction: column;
    align-items: center;
  }
  .guide-arch-arrow-line {
    width: 2px;
    height: 100%;
    flex: 1;
  }
  .guide-arch-arrowhead {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 11px solid var(--brand);
    border-bottom: none;
    margin-top: 0;
    align-self: center;
  }
  .guide-ops-grid { grid-template-columns: 1fr; }
  .guide-step { flex-direction: column; gap: 12px; padding: 20px 16px; }
  .guide-step-num { align-self: flex-start; }
  .guide-field-row { flex-direction: column; align-items: flex-start; }
  .guide-field-row label { width: auto; }
  .guide-field-controls { width: 100%; }
  .guide-field-controls input { max-width: 100%; }
}

@media print {
  #sidebar, #topbar, .bulkbar, .pagination-x, .no-print { display: none !important; }
  #main { margin-left: 0; }
  .card-x { break-inside: avoid; box-shadow: none; }
  .page { animation: none; }
}

/* ═════════════════ Import Appareils ═════════════════ */
.import-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.import-step-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.import-step-item.active { color: var(--brand); font-weight: 600; }
.import-step-item.done { color: var(--green, #15803d); }
.import-step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.import-step-item.active .import-step-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.import-step-item.done .import-step-num { background: var(--green, #15803d); border-color: var(--green, #15803d); color: #fff; }
.import-step-arrow { color: var(--muted); font-size: 12px; }

.import-tpl-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 16px; }
.import-tpl-icon { font-size: 28px; color: var(--brand); flex-shrink: 0; }

.import-fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; margin-top: 8px; }
.import-field-item { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; padding: 5px 10px; background: var(--surface-2); border-radius: 6px; }
.import-field-key { font-family: var(--mono, monospace); font-size: 11.5px; color: var(--brand); font-weight: 600; }
.import-field-req { color: var(--crit, #dc2626); font-size: 11px; }

.import-drop { border: 2px dashed var(--border); border-radius: var(--r); padding: 32px 20px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; margin-top: 16px; }
.import-drop:hover, .import-drop.over { border-color: var(--brand); background: rgba(124,58,237,.05); }
.import-drop i { font-size: 36px; color: var(--muted); display: block; margin-bottom: 10px; }
.import-drop .drop-label { font-size: 15px; font-weight: 500; color: var(--ink); }
.import-drop .drop-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }

.import-preview-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.import-preview-count { font-size: 13px; font-weight: 600; }
.import-preview-errors { font-size: 12px; color: var(--crit, #dc2626); }

.import-result-summary { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.import-result-card { flex: 1; min-width: 120px; padding: 16px; border-radius: var(--r); border: 1px solid var(--border); text-align: center; }
.import-result-card .irc-val { font-size: 28px; font-weight: 700; }
.import-result-card .irc-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.import-result-card.ok { border-color: rgba(12,163,12,.3); background: rgba(12,163,12,.05); }
.import-result-card.ok .irc-val { color: #087008; }
.import-result-card.err { border-color: rgba(208,59,59,.3); background: rgba(208,59,59,.05); }
.import-result-card.err .irc-val { color: #a52a2a; }

/* ═════════════════════════ KPI Strip – Appareils ═════════════════════════ */

.dev-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.dev-kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 15px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: box-shadow .18s var(--ease), transform .18s var(--ease), border-color .2s;
  -webkit-user-select: none; user-select: none; position: relative; overflow: hidden;
}
.dev-kpi-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.06) 0%, transparent 60%);
  pointer-events: none;
}
.dev-kpi-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--brand); }
.dev-kpi-card.active { border-color: var(--brand); background: var(--brand-wash); box-shadow: 0 0 0 3px var(--brand-glow); }
.dev-kpi-card.no-filter { cursor: default; }
.dev-kpi-card.no-filter:hover { transform: none; border-color: var(--line); box-shadow: none; }

.dev-kpi-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-size: 19px; flex: none;
}
.dev-kpi-ico.blue   { background: rgba(42,120,214,.12);  color: var(--brand); }
.dev-kpi-ico.green  { background: rgba(12,163,12,.12);   color: #0a8f0a; }
.dev-kpi-ico.red    { background: rgba(208,59,59,.12);   color: var(--crit); }
.dev-kpi-ico.orange { background: rgba(236,131,90,.15);  color: var(--serious); }
.dev-kpi-ico.yellow { background: rgba(250,178,25,.18);  color: #8a5f00; }
.dev-kpi-ico.slate  { background: var(--surface-3);      color: transparent; }

[data-bs-theme="dark"] .dev-kpi-ico.green  { color: #4ade80; }
[data-bs-theme="dark"] .dev-kpi-ico.red    { color: #f87171; }
[data-bs-theme="dark"] .dev-kpi-ico.orange { color: #fb923c; }
[data-bs-theme="dark"] .dev-kpi-ico.yellow { color: #fbbf24; }

.dev-kpi-val {
  font-size: 24px; font-weight: 750; line-height: 1;
  color: var(--ink); letter-spacing: -.5px;
}
.dev-kpi-lbl {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); margin-top: 4px;
}

/* Liseré gauche permanent coloré selon l'état de l'appareil */
.table-x tbody tr[data-eff="unlock"]  td:first-child::before { background: var(--ok);      transform: scaleY(1); }
.table-x tbody tr[data-eff="lock"]    td:first-child::before { background: var(--crit);    transform: scaleY(1); }
.table-x tbody tr[data-eff="release"] td:first-child::before { background: var(--muted);   transform: scaleY(1); }

@media (max-width: 1100px) { .dev-kpi-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .dev-kpi-strip { grid-template-columns: repeat(2, 1fr); } }

/* ── Guide : settings grid (Provisioner — step B) ────────────────────────── */
.guide-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.guide-settings-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.guide-settings-item > i {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
@media (max-width: 640px) { .guide-settings-grid { grid-template-columns: 1fr; } }

/* ── Guide : wizard step list (Provisioner — step E) ────────────────────── */
.guide-wizard-steps {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.guide-wizard-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--surface);
}
.guide-wizard-row:last-child { border-bottom: none; }
.guide-wizard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.guide-wizard-badge.ok   { background: #dcfce7; color: #16a34a; }
.guide-wizard-badge.edit { background: #dbeafe; color: #1d4ed8; }
.guide-wizard-badge.run  { background: #ede9fe; color: #6d28d9; }

[data-bs-theme="dark"] .guide-wizard-row { background: var(--surface); }
[data-bs-theme="dark"] .guide-wizard-badge.ok   { background: rgba(22,163,74,.2);  color: #4ade80; }
[data-bs-theme="dark"] .guide-wizard-badge.edit { background: rgba(29,78,216,.2);  color: #60a5fa; }
[data-bs-theme="dark"] .guide-wizard-badge.run  { background: rgba(109,40,217,.2); color: #a78bfa; }
[data-bs-theme="dark"] .guide-settings-item { background: var(--surface-2); border-color: var(--line); }

/* ── Facturation / abonnements ───────────────────────────────────────────── */
.billing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.billing-badge.trial    { background: #f1f5f9; color: #475569; }
.billing-badge.active   { background: #dcfce7; color: #16a34a; }
.billing-badge.overdue  { background: #fff7ed; color: #c2410c; }
.billing-badge.suspended{ background: #fee2e2; color: #b91c1c; }
[data-bs-theme="dark"] .billing-badge.trial    { background: rgba(71,85,105,.25); color: #94a3b8; }
[data-bs-theme="dark"] .billing-badge.active   { background: rgba(22,163,74,.2);  color: #4ade80; }
[data-bs-theme="dark"] .billing-badge.overdue  { background: rgba(194,65,12,.2);  color: #fb923c; }
[data-bs-theme="dark"] .billing-badge.suspended{ background: rgba(185,28,28,.2);  color: #f87171; }

.billing-quota-bar  {
  height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 5px;
}
.billing-quota-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s; }
.billing-quota-fill.warn  { background: var(--warn); }
.billing-quota-fill.crit  { background: var(--crit); }

.quota-alert {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  padding: 1px 6px; border-radius: 10px; margin-top: 4px;
}
.quota-alert.crit { background: #fee2e2; color: #b91c1c; }
.quota-alert.warn { background: #fff7ed; color: #c2410c; }
[data-bs-theme="dark"] .quota-alert.crit { background: rgba(185,28,28,.2); color: #f87171; }
[data-bs-theme="dark"] .quota-alert.warn { background: rgba(194,65,12,.2);  color: #fb923c; }

/* ── Boutiques — stats bar ───────────────────────────────────────────────── */
.shops-stats-bar {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.shops-stat {
  flex: 1; padding: 14px 20px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 3px;
}
.shops-stat:last-child { border-right: none; }
.shops-stat-val   { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1; }
.shops-stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.shops-stat.alert .shops-stat-val { color: var(--crit); }
.shops-stat.alert .shops-stat-label { color: var(--crit); }

/* ── Quota badge — page Appareils ────────────────────────────────────────── */
.dev-quota-badge {
  display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 12px 4px 8px; font-size: 12.5px;
}
.dev-quota-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dev-quota-label { font-weight: 600; color: var(--ink-2); }
.dev-quota-count { font-weight: 700; color: var(--ink); }
.dev-quota-sep { font-weight: 400; color: var(--muted); }
.dev-quota-bar {
  width: 60px; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden;
}
.dev-quota-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s; }
.dev-quota-fill.warn { background: var(--warn); }
.dev-quota-fill.crit { background: var(--crit); }

/* ── Boutiques — liste cartes ────────────────────────────────────────────── */
.shops-list { display: flex; flex-direction: column; gap: 10px; }

.shop-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: box-shadow .15s, border-color .15s;
}
.shop-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.07); border-color: var(--brand-light, var(--line)); }
.shop-card.quota-crit { border-color: rgba(185,28,28,.3); }
.shop-card.quota-warn { border-color: rgba(194,65,12,.25); }
[data-bs-theme="dark"] .shop-card.quota-crit { border-color: rgba(248,113,113,.3); }
[data-bs-theme="dark"] .shop-card.quota-warn { border-color: rgba(251,146,60,.25); }

.shop-card-accent {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.shop-card-body {
  display: grid;
  grid-template-columns: 1fr 150px 170px 145px 90px auto;
  align-items: center;
  padding: 14px 16px 14px 22px;
  gap: 16px;
}
.shop-col-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shop-avatar {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -.5px;
  opacity: .9;
}
.shop-name-wrap { min-width: 0; overflow: hidden; }
.shop-name {
  font-size: 14px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2px;
}
.shop-slug { font-size: 11.5px; color: var(--muted); font-family: monospace; }

.shop-col-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 5px;
}
.shop-plan-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.shop-plan-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.shop-quota-num { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1; }
.shop-quota-num span { font-size: 13px; font-weight: 500; color: var(--muted); }

.shop-sub-date { font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; }
.shop-btn-billing {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 6px; padding: 3px 9px; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.shop-btn-billing:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.shop-col-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.shop-btn-enter { white-space: nowrap; }
.btn-icon-sq {
  width: 30px; height: 30px; padding: 0; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid; cursor: pointer; background: transparent;
  font-size: 13px; transition: background .12s, color .12s;
}
.btn-icon-sq.btn-outline-warning { border-color: var(--warn); color: var(--warn); }
.btn-icon-sq.btn-outline-warning:hover { background: var(--warn); color: #fff; }
.btn-icon-sq.btn-outline-success { border-color: #16a34a; color: #16a34a; }
.btn-icon-sq.btn-outline-success:hover { background: #16a34a; color: #fff; }
.btn-icon-sq.btn-outline-danger { border-color: var(--crit); color: var(--crit); }
.btn-icon-sq.btn-outline-danger:hover { background: var(--crit); color: #fff; }

@media (max-width: 900px) {
  .shop-card-body {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto;
    gap: 10px;
  }
  .shop-col-plan, .shop-col-devices, .shop-col-sub, .shop-col-status {
    display: none;
  }
  .shop-col-actions { grid-column: 2; grid-row: 1; }
}

/* modal header */
.billing-modal-header { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 16px 20px; }
.billing-modal-label  { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 2px; }
.billing-modal-title  { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }

/* KPI strip */
.billing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.billing-kpi {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}
.billing-kpi:last-child { border-right: none; }
.billing-kpi-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.billing-kpi-val   { font-size: 17px; font-weight: 750; color: var(--ink); line-height: 1.2; }

/* sections inside modal body */
.billing-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.billing-section-last { border-bottom: none; }
.billing-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 12px;
}
.billing-label { font-size: 11.5px; color: var(--ink-2); margin-bottom: 3px; display: block; }
.billing-plan-select { max-width: 280px; }

/* ── Plans tarifaires ────────────────────────────────────────────────────── */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-1);
  transition: box-shadow .15s;
}
.plan-card:hover { box-shadow: var(--sh); }
.plan-card-top {
  height: 6px;
}
.plan-card-body {
  padding: 18px 18px 12px;
  flex: 1;
}
.plan-card-name {
  font-size: 17px;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.badge-web-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(42,120,214,.12);
  color: #1c5cab;
  font-size: 11px;
  flex-shrink: 0;
  border: 1px solid rgba(42,120,214,.2);
}
[data-bs-theme="dark"] .badge-web-visible {
  background: rgba(124,184,255,.15);
  color: #7cb0f0;
  border-color: rgba(124,184,255,.25);
}
.plan-card-price {
  font-size: 22px;
  font-weight: 750;
  color: var(--ink);
  line-height: 1.2;
}
.plan-card-price span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.plan-card-quota {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 6px;
}
.plan-card-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}
.plan-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
}
.plan-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
}
.plan-card-inactive { opacity: .55; }

/* Color picker dans le modal plan */
.plan-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.plan-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .1s, transform .1s;
}
.plan-color-swatch.selected, .plan-color-swatch:hover {
  border-color: var(--ink);
  transform: scale(1.15);
}

@media (max-width: 640px) { .plans-grid { grid-template-columns: 1fr; } }

/* ══════════════════════════════════════════════
   Sous-boutiques (vue propriétaire parent)
══════════════════════════════════════════════ */
.subshops-quota-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.subshops-quota-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.subshops-quota-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.subshops-quota-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.subshops-quota-count.warn { color: #b45309; }
.subshops-quota-count.crit { color: #dc2626; }
.subshops-quota-track {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.subshops-quota-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transition: width .4s ease;
}
.subshops-quota-fill.warn { background: #f59e0b; }
.subshops-quota-fill.crit { background: #ef4444; }

.subshops-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.subshop-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: box-shadow .15s;
}
.subshop-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.subshop-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.subshop-info { flex: 1; min-width: 0; }
.subshop-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.subshop-meta {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.subshop-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Hiérarchie dans la liste boutiques (super-admin) */
.shop-col-identity.is-child { padding-left: 8px; }
.shop-child-indent {
  color: var(--ink-3);
  font-size: 13px;
  flex-shrink: 0;
  margin-right: -4px;
}

@media (max-width: 640px) {
  .subshop-card { flex-wrap: wrap; }
  .subshop-actions { width: 100%; justify-content: flex-end; }
}

/* ══════════════════════════════════════════════
   Demandes Mobile Money
══════════════════════════════════════════════ */
.pr-stat-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.pr-stat-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
  overflow: hidden;
}
.pr-stat-tab:hover {
  border-color: var(--tab-color);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.pr-stat-tab.active {
  border-color: var(--tab-color);
  background: var(--tab-bg);
  box-shadow: 0 4px 20px rgba(0,0,0,.10);
}
.pr-stat-tab.active .pr-stat-icon { background: var(--tab-color); color: #fff; }
.pr-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--tab-bg);
  color: var(--tab-color);
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.pr-stat-body { flex: 1; }
.pr-stat-count {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}
.pr-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-top: 4px;
}
/* Indicateur pulse pour "En attente" non vide */
.pr-stat-pulse {
  position: absolute;
  top: 12px; right: 12px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(1.4); }
}

/* Lignes de la table */
.pr-row { transition: background .12s; }
.pr-row.pending { border-left: 3px solid #f59e0b; }
.pr-row.pending td:first-child { padding-left: 13px; }

.pr-client { display: flex; align-items: center; gap: 10px; }
.pr-avatar {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.pr-client-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pr-amount {
  font-size: 15px;
  font-weight: 800;
  color: #7c3aed;
  font-variant-numeric: tabular-nums;
}
.pr-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  color: var(--ink-2);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-action-group { display: flex; gap: 8px; align-items: center; }
.pr-action-approve {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #22c55e;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background .12s, transform .1s;
}
.pr-action-approve:hover { background: #16a34a; transform: translateY(-1px); }
.pr-action-reject {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #ef4444;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.pr-action-reject:hover { background: #fee2e2; }
.pr-done-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}
.pr-done-badge.ok   { background: #dcfce7; color: #15803d; }
.pr-done-badge.crit { background: #fee2e2; color: #dc2626; }

@media (max-width: 640px) {
  .pr-stat-tabs { grid-template-columns: 1fr; }
  .pr-action-group { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════
   Vue Paiements — barre de filtres
══════════════════════════════════════════════ */
.pay-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.pay-filter-search { flex: 1; min-width: 180px; max-width: 280px; }
.pay-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
}
.pay-filter-label {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.pay-filter-date {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  font-size: 13px;
  width: auto;
  min-width: 120px;
}
.pay-filter-date:focus { box-shadow: none !important; outline: none; }
.pay-filter-method {
  font-size: 13px;
  min-width: 150px;
}

/* ══════════════════════════════════════════════
   Vue Paiements — KPI cards
══════════════════════════════════════════════ */
#payTiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.pay-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s;
}
.pay-kpi-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.pay-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
}
.pay-kpi-card.accent-green::before  { background: #22c55e; }
.pay-kpi-card.accent-blue::before   { background: #2a78d6; }
.pay-kpi-card.accent-muted::before  { background: #94a3b8; }

.pay-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.accent-green .pay-kpi-icon  { background: #dcfce7; color: #16a34a; }
.accent-blue  .pay-kpi-icon  { background: #dbeafe; color: #1d4ed8; }
.accent-muted .pay-kpi-icon  { background: #f1f5f9; color: #64748b; }

.pay-kpi-body { flex: 1; min-width: 0; }
.pay-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.pay-kpi-label {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
  font-weight: 500;
}
.pay-kpi-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.pay-kpi-method {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.pay-kpi-method .tnum { color: var(--ink); }

/* Table Paiements — montant + méthode stylisés */
.pay-amount {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pay-amount.ok   { color: #16a34a; }
.pay-amount.mm   { color: #7c3aed; }
.pay-amount.info { color: #1d4ed8; }
.pay-amount.mute { color: var(--ink); }

.pay-method-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pay-method-badge.ok   { background: #dcfce7; color: #15803d; }
.pay-method-badge.mm   { background: #ede9fe; color: #6d28d9; }
.pay-method-badge.info { background: #dbeafe; color: #1d4ed8; }
.pay-method-badge.mute { background: var(--bg); color: var(--ink-2); }

.pay-note {
  font-size: 12px;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 160px;
}

/* ══════════════════════════════════════════════
   Vue Rôles et droits
══════════════════════════════════════════════ */
.role-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow .15s;
}
.role-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.07); }
.role-card-accent {
  width: 4px;
  flex-shrink: 0;
}
.role-card-inner { flex: 1; padding: 20px 22px; min-width: 0; }

.role-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.role-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.role-identity { flex: 1; min-width: 0; }
.role-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.role-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  align-items: center;
}
.role-actions { display: flex; gap: 8px; flex-shrink: 0; }

.role-access-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.role-access-track {
  flex: 1;
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}
.role-access-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.role-access-pct {
  font-size: 12px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}

.role-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px 24px;
}
.role-perm-group {}
.role-perm-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-2);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.role-perm-group-count {
  font-weight: 600;
  color: var(--ink-3);
  font-size: 11px;
}
.role-perm-list { display: flex; flex-direction: column; gap: 4px; }
.role-perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  padding: 2px 0;
}
.role-perm-item.granted { color: var(--ink); }
.role-perm-item.granted i { color: #22c55e; font-size: 13px; }
.role-perm-item.denied  { color: var(--ink-3); }
.role-perm-item.denied  i { color: var(--border); font-size: 13px; }

@media (max-width: 640px) {
  .role-perms-grid { grid-template-columns: 1fr 1fr; }
  .pay-kpi-val { font-size: 18px; }
}

/* ══════════════════════════════════════════════
   FedaPay — section settings + billing button
══════════════════════════════════════════════ */
.feda-pay-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.feda-pay-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.feda-pay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0e2a6e;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background .15s, transform .1s;
}
.feda-pay-btn:hover:not(:disabled) {
  background: #1a3a8e;
  color: #fff;
  transform: translateY(-1px);
}
.feda-pay-btn:disabled { opacity: .65; cursor: not-allowed; }
.feda-btn-logo {
  height: 18px;
  filter: brightness(0) invert(1);
}
.feda-pay-status {
  font-size: 12.5px;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.feda-pay-status.pending {
  background: #fef9c3;
  color: #854d0e;
}
.feda-pay-status.error {
  background: #fee2e2;
  color: #dc2626;
}
.feda-test-result {
  font-size: 12.5px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════════════════════
   KPrimePay — section settings + billing button
══════════════════════════════════════════════ */
.kpp-pay-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.kpp-pay-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.kpp-pay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #e85d04;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background .15s, transform .1s;
}
.kpp-pay-btn:hover:not(:disabled) {
  background: #c44d00;
  color: #fff;
  transform: translateY(-1px);
}
.kpp-pay-btn:disabled { opacity: .65; cursor: not-allowed; }
.kpp-btn-logo {
  height: 20px;
  filter: brightness(0) invert(1);
  object-fit: contain;
}
.kpp-pay-status {
  font-size: 12.5px;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.kpp-pay-status.pending { background: #fff7ed; color: #9a3412; }
.kpp-pay-status.error   { background: #fee2e2; color: #dc2626; }
.kpp-test-result {
  font-size: 12.5px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════════════════════
   Mon abonnement — section dans Mon compte
══════════════════════════════════════════════ */
.sub-current-block {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.sub-current-plan {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.2;
}
.sub-quota-bar-wrap { min-width: 200px; }
.sub-quota-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.quota-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.quota-bar-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s; }
.quota-bar-fill.warn { background: #f59e0b; }
.quota-bar-fill.crit { background: #ef4444; }
.sub-plans-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 10px;
}
.sub-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.sub-plan-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.sub-plan-card:hover { border-color: var(--plan-color); transform: translateY(-2px); }
.sub-plan-card.selected {
  border-color: var(--plan-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--plan-color) 18%, transparent);
}
.sub-plan-name  { font-weight: 700; font-size: 14px; color: var(--plan-color); margin-bottom: 4px; }
.sub-plan-quota { font-size: 12px; color: var(--muted); }
.sub-plan-price { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.sub-plan-current { font-size: 11px; color: #16a34a; margin-top: 6px; }
.sub-pay-section { }
.sub-pay-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); margin-bottom: 10px;
}
