:root {
  /* --- Gris "nardo" + noir --- */
  --bg: #0b0c0e;
  --bg-card: #15171a;
  --bg-card-hover: #1c1f23;
  --bg-elevated: #1a1c20;
  --border: #26292e;
  --border-soft: #1e2024;
  --text: #f2f3f5;
  --text-dim: #8b9098;
  --text-faint: #5c6168;

  /* --- Accent néon (personnalisable depuis Compte > Apparence) ---
     --neon / --neon-soft restent des couleurs hex classiques (utilisées
     directement dans de nombreuses règles). --neon-r/g/b et
     --neon-soft-r/g/b sont les mêmes couleurs décomposées en composantes
     RGB, nécessaires pour construire des rgba(...) avec une opacité
     variable. Le sélecteur de thème (app.js) met à jour ces 8 variables
     ensemble via setThemeColor(). --- */
  --neon: #0BBBBB;
  --neon-soft: #3DD8D3;
  --neon-r: 11;
  --neon-g: 187;
  --neon-b: 187;
  --neon-soft-r: 61;
  --neon-soft-g: 216;
  --neon-soft-b: 211;
  --neon-dim: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
  --neon-glow: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.55);

  /* --- Rétro-compat : certains styles historiques utilisent var(--text)
     comme couleur d'accent neutre (boutons, bordures au focus...).
     On la garde en blanc cassé pour rester sobre, le néon est réservé
     aux moments clés (navbar, focus, statuts). --- */
  --accent: var(--neon);
  --accent-hover: var(--neon-soft);

  --green: #3ddc84;
  --red: #ff4d5e;
  --amber: #ffb84d;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

/* ================================================================== */
/*  Liquid glass réactif à la souris                                   */
/*  Un halo lumineux suit le curseur au survol de tout élément liquid  */
/*  glass, via un pseudo-élément positionné par --mx/--my (en %,       */
/*  mises à jour en JS par un seul listener mousemove délégué, voir    */
/*  initMouseGlass() dans app.js). Le halo n'est visible qu'au survol. */
/* ================================================================== */
.tab-btn,
.btn-primary,
.btn-ghost,
.act,
.filter-btn,
.sysctl-btn,
.feature-card,
.card,
.modal-card,
.profile-bar,
.appearance-toggle-track {
  isolation: isolate;
}
.tab-btn::after,
.btn-primary::after,
.btn-ghost::after,
.act::after,
.filter-btn::after,
.sysctl-btn::after,
.feature-card::after,
.card::after,
.modal-card::after,
.profile-bar::after,
.appearance-toggle-track::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.12) 0%,
    rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.09) 32%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  /* Négatif : reste toujours SOUS le contenu réel de la card (texte,
     boutons, icônes...), même ceux en position:relative z-index:auto —
     seule la box elle-même (isolation:isolate) et son fond en profitent. */
  z-index: -1;
}
.tab-btn:hover::after,
.btn-primary:hover::after,
.btn-ghost:hover::after,
.act:hover::after,
.filter-btn:hover::after,
.sysctl-btn:hover::after,
.feature-card:hover::after,
.card:hover::after,
.win:hover::after,
.modal-card:hover::after,
.profile-bar:hover::after,
.appearance-toggle-track:hover::after {
  opacity: 1;
}

@keyframes cardFloat {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
  }
  50% {
    box-shadow: 0 12px 48px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.18);
  }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: var(--border);
  }
  50% {
    border-color: var(--neon-dim);
  }
}

html {
  background: #000000;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: transparent;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: 0.3px;
  position: relative;
}

/* --- Fond personnalisé (PNG utilisateur) --- */
/* Toujours sous le GIF (z-index -2 vs -1) : reste visible que le GIF soit
   activé ou pas — désactiver le GIF ne touche jamais à cette couche. */
#bg-custom {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-color: #000000;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
/* Vidéo MP4 (admin uniquement) : remplit le même rôle que le background-image
   ci-dessus, affichée par-dessus quand une vidéo est active. */
#bg-custom-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Fond GIF animé (remplace Three.js) --- */
#bg-3d {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  background-color: transparent;
  background-image: url('background.gif');
  background-size: 45% auto;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 0.4s ease;
}
/* Désactivé depuis Compte > Apparence : coupe juste le GIF, le fond
   personnalisé (#bg-custom) ou noir uni reste visible en dessous. */
#bg-3d.bg-gif-disabled {
  background-image: none;
}
/* Overlay sombre pour garder la lisibilité du panel */
#bg-3d::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.06), transparent 60%),
    rgba(11, 12, 14, 0.72);
}
#bg-3d canvas {
  display: none; /* cache le canvas Three.js si toujours chargé */
}

/* --- Login --- */
.login-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: transparent;
}
.login-card {
  background: rgba(21, 23, 26, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow), 0 0 60px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.05);
  backdrop-filter: blur(18px) saturate(140%);
}
.login-card h1 { 
  font-size: 24px; 
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}
.subtitle { 
  color: var(--text-dim); 
  font-size: 13px; 
  margin-top: -8px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.login-card label { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  font-size: 12px; 
  color: var(--text-dim); 
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.login-card input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.2px;
  transition: all 0.3s ease;
}
.login-card input:focus { 
  outline: none; 
  border-color: var(--neon-dim);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
.login-panel button {
  background: var(--neon);
  color: #06131a;
  border: 1px solid var(--neon);
  border-radius: 8px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}
.login-panel button:hover { 
  background: var(--neon-soft);
  border-color: var(--neon-soft);
  box-shadow: 0 0 20px var(--neon-dim);
}
.login-panel button:active { 
  background: var(--neon);
  box-shadow: none;
}
.error { 
  color: var(--red); 
  font-size: 12px; 
  padding: 10px;
  background: rgba(255, 77, 94, 0.06);
  border: 1px solid rgba(255, 77, 94, 0.3);
  letter-spacing: 0.2px;
}

/* ================================================================== */
/*  Navbar bulle flottante                                            */
/*  - Tout en haut (scroll = 0) : navbar transparente, fond dans     */
/*    le contenu, pas de bulle visible.                               */
/*  - Dès qu'on scrolle : la navbar devient une bulle centrée,        */
/*    flottante, détachée du bord supérieur, avec liquid glass.       */
/*  - Ne se cache jamais quand on scrolle vers le bas.                */
/*  - Piloté par la classe .topbar--bubble ajoutée en JS.             */
/* ================================================================== */

/* Keyframes liquid glass shimmer (2 calques : halo souris fixe + shimmer animé) */
@keyframes liquidShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes topbarShimmer {
  0%   { background-position: 0 0, -200% center; }
  100% { background-position: 0 0,  200% center; }
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0px) scale(1);
  }
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid transparent;
  position: fixed;
  top: 0;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  z-index: 100;
  /* Toujours centré via left:50% + transform, jamais via "right" —
     transitionner "right" vers/depuis "auto" ne s'anime pas et fait
     sauter la largeur (donc les boutons du centre) en plein milieu
     de l'animation. */
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    top 0.4s cubic-bezier(0.34, 1.3, 0.64, 1),
    border-radius 0.4s ease,
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.4s ease;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

/* État "top" = transparent, fondu dans le background */
.topbar:not(.topbar--bubble) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* État "bulle" = flottante, liquid glass */
.topbar.topbar--bubble {
  top: 14px;
  width: min(92vw, 1200px);
  border-radius: 18px;
  padding: 10px 20px;

  /* Liquid glass base */
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.18) 0%,
      rgba(255, 255, 255, 0.06) 40%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10) 70%,
      rgba(255, 255, 255, 0.04) 100%
    );
  backdrop-filter: blur(24px) saturate(180%) brightness(1.08);
  -webkit-backdrop-filter: blur(24px) saturate(180%) brightness(1.08);

  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.15);
}

/* Reflet liquid glass en haut de la bulle */
.topbar.topbar--bubble::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.10) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 0;
}

/* Shimmer animé discret (toujours visible) + halo qui suit la souris
   (n'apparaît qu'au survol, via --glow-a togglé par :hover ci-dessous). */
.topbar.topbar--bubble {
  --glow-a: 0;
}
.topbar.topbar--bubble:hover {
  --glow-a: 1;
}
.topbar.topbar--bubble::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      circle at var(--mx, 50%) var(--my, 50%),
      rgba(255, 255, 255, calc(0.20 * var(--glow-a))) 0%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), calc(0.14 * var(--glow-a))) 32%,
      transparent 65%
    ),
    linear-gradient(
      105deg,
      transparent 30%,
      rgba(255, 255, 255, 0.06) 50%,
      transparent 70%
    );
  background-size: 100% 100%, 200% 100%;
  /* Position fixe pour le calque radial (halo souris), seul le 2e calque
     (shimmer) est animé — voir @keyframes topbarShimmer. */
  background-position: 0 0, -200% center;
  animation: topbarShimmer 6s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Tous les enfants au-dessus des pseudo-éléments */
.topbar > * {
  position: relative;
  z-index: 1;
}

/* Empêche le contenu de sauter quand la bulle apparaît */
body {
  padding-top: 0;
}
/* Espace pour que le contenu ne soit pas sous la navbar */
.topbar + * {
  margin-top: 0;
}
/* Espace pour que le contenu ne soit pas sous la navbar fixed — géré dans .content */

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text);
}
@keyframes brandShine {
  0% {
    background-position: 0% center;
  }
  100% {
    /* Décalage d'exactement une largeur de motif (= background-size)
       pour que la boucle soit parfaitement fluide et sans saut. */
    background-position: -60% center;
  }
}
.brand .brand-name {
  font-weight: 800;
  background-image: linear-gradient(
    100deg,
    var(--neon-soft) 0%,
    var(--neon-soft) 10%,
    #ffffff 15%,
    var(--neon-soft) 20%,
    var(--neon-soft) 43%,
    #ffffff 48%,
    var(--neon-soft) 53%,
    var(--neon-soft) 76%,
    #ffffff 81%,
    var(--neon-soft) 86%,
    var(--neon-soft) 100%
  );
  /* Motif plus étroit que l'élément -> plusieurs répétitions du motif
     (donc plusieurs reflets) sont visibles simultanément, tous animés
     à la même vitesse puisqu'ils partagent la même image de fond. */
  background-size: 60% 100%;
  background-repeat: repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 16px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.4);
  animation: brandShine 2.8s linear infinite;
}
.brand .brand-suffix {
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 4px;
}
.brand-login {
  justify-content: center;
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: 4px;
}
.brand-login .brand-suffix {
  letter-spacing: 6px;
}

.tabs { 
  display: flex; 
  gap: 4px;
  margin-left: 40px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid var(--border-soft);
}
.tab-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tab-btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.tab-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}
.tab-btn:hover { 
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.25);
}
/* .tab-btn.active défini dans le bloc liquid glass */
/* Bouton hamburger : caché sur desktop, affiché en mobile via media query */
.topbar-mobile-menu {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--text-dim);
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.topbar-mobile-menu:hover { color: var(--text); }
.topbar-mobile-menu i, .topbar-mobile-menu svg { width: 16px; height: 16px; }

/* Menu déroulant mobile (liquid glass) */
.mobile-menu {
  position: fixed;
  top: var(--topbar-h, 60px);
  left: 12px;
  right: 12px;
  z-index: 99;
  background:
    linear-gradient(135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.15) 0%,
      rgba(21, 23, 26, 0.92) 100%
    );
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.10);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.mobile-menu-item i, .mobile-menu-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.mobile-menu-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.mobile-menu-item.active {
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12);
  color: var(--neon-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
}
.topbar-bell {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%;
  color: var(--text-dim);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.topbar-bell i, .topbar-bell svg { width: 15px; height: 15px; }
.topbar-bell:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.topbar-bell.notif-on {
  border-color: var(--neon-dim);
  color: var(--neon-soft);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
.summary { 
  color: var(--text-dim); 
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.current-user { 
  font-size: 12px; 
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.2px;
}
.conn-indicator {
  width: 8px; 
  height: 8px; 
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: none;
  box-shadow: 0 0 8px rgba(255, 77, 94, 0.6);
}
.conn-indicator.connected { 
  background: var(--green);
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.6);
}

/* ================================================================== */
/*  Liquid Glass — boutons du panel                                   */
/*  Appliqué sur .btn-primary, .btn-ghost, .act, .filter-btn,        */
/*  .tab-btn.active, .sysctl-btn, .feature-card, .modal-card         */
/* ================================================================== */

/* Mixin liquid glass réutilisable via une classe utilitaire */
.liquid-glass {
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.20) 0%,
      rgba(255, 255, 255, 0.07) 50%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12) 100%
    ) !important;
  backdrop-filter: blur(16px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.2),
    0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* --- btn-primary : liquid glass burple --- */
.btn-primary {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.85) 0%,
      rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.70) 50%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.90) 100%
    );
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.4),
    0 4px 20px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
  color: #fff;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}
.btn-primary:hover {
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.90) 0%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.80) 50%,
      rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.95) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.5),
    0 6px 28px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.5);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.30);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.3),
    0 2px 8px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.2);
}

/* --- btn-ghost : liquid glass subtil --- */
.btn-ghost {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 2px 8px rgba(0,0,0,0.2);
}
.btn-ghost::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}
.btn-ghost:hover {
  color: var(--neon-soft);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12);
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 4px 16px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.18);
  transform: translateY(-1px);
}

/* --- .act (boutons d'action sur les cards machine) --- */
.act {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 80px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  padding: 10px 12px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.2px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.act::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}
.act:hover:not(:disabled) {
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.45);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10);
  backdrop-filter: blur(12px);
  color: var(--neon-soft);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 4px 14px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.15);
}
.act:disabled { opacity: 0.3; cursor: not-allowed; }
.act.danger:hover:not(:disabled) {
  border-color: rgba(255, 77, 94, 0.5);
  color: var(--red);
  background: rgba(255, 77, 94, 0.08);
}

/* --- .filter-btn : liquid glass --- */
.filter-btn {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-dim);
  padding: 9px 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.filter-btn:hover {
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.40);
  color: var(--neon-soft);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.09);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 4px 14px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.15);
}
.filter-btn.active {
  background:
    linear-gradient(135deg, rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.80) 0%, rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.65) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 4px 18px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
}

/* --- .sysctl-btn : liquid glass --- */
.sysctl-btn {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text);
  padding: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  letter-spacing: 0.2px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.sysctl-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}
.sysctl-btn:hover {
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.45);
  color: var(--neon-soft);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 6px 20px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.18);
}
.sysctl-btn.danger:hover {
  border-color: rgba(255, 77, 94, 0.5);
  color: var(--red);
  background: rgba(255, 77, 94, 0.08);
}

/* --- .feature-card : liquid glass --- */
.feature-card {
  position: relative;
  overflow: hidden;
  background: rgba(21, 23, 26, 0.55);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: none;
  padding: 26px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.feature-card > * { position: relative; z-index: 1; }
.feature-card:hover:not(:disabled) {
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35), 0 8px 24px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12);
}
.feature-card:disabled { opacity: 0.3; cursor: not-allowed; }

/* --- .tab-btn active : liquid glass --- */
.tab-btn.active {
  color: #fff;
  border-color: transparent;
  background: transparent;
}

/* --- Slider qui glisse derrière l'onglet actif --- */
.tabs {
  position: relative;
}
.tab-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.85) 0%, rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.70) 100%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 4px 16px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1), width 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  pointer-events: none;
  z-index: 0;
}
.tab-btn {
  z-index: 1;
}

/* ================================================================== */

/* --- Content --- */
/* --topbar-h est mesurée dynamiquement en JS (voir initDynamicNavbar dans
   app.js) car la hauteur réelle de la topbar varie selon l'écran (colonne
   sur mobile, tabs qui wrappent, etc.) : un padding-top fixe en CSS ne
   suffit pas et laisse le contenu passer sous la navbar. */
.content { 
  padding: 32px; 
  padding-top: var(--topbar-h, 80px);
  max-width: 1400px; 
  margin: 0 auto; 
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.toolbar .summary {
  flex-shrink: 0;
  white-space: nowrap;
}
#search {
  background: rgba(21, 23, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  min-width: 240px;
  flex: 1;
  max-width: 360px;
  transition: all 0.3s ease;
  letter-spacing: 0.2px;
}
#search:focus { 
  outline: none; 
  border-color: var(--neon-dim);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
#search::placeholder {
  color: var(--text-dim);
}
.filters { display: flex; gap: 10px; }
/* filter-btn défini dans le bloc liquid glass */

/* --- Grille des machines --- */
.machines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background: rgba(21, 23, 26, 0.72);
  border: 1px solid var(--neon-dim);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow), 0 0 16px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10);
  backdrop-filter: blur(10px);
}
.card.is-off { 
  opacity: 0.55;
}
.card-clickable { 
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-clickable:hover { 
  border-color: var(--neon-dim);
  background: rgba(28, 31, 35, 0.85);
  box-shadow: var(--shadow), 0 0 40px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
}
.card-clickable:active { 
  transform: scale(0.98);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}
.card-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 12px;
  flex-shrink: 0;
}
.card-name-beside-icon {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.3;
  max-width: 200px;
}
.card-icon span {
  display: block;
  background: var(--neon);
  border-radius: 1px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-transform: uppercase;
}
.badge .dot {
  width: 4px;
  height: 4px;
  background: currentColor;
}
.badge.on { 
  color: var(--green);
  border-color: var(--green);
}
.badge.off { 
  color: var(--text-dim);
}
.badge.locked { 
  color: var(--amber);
  border-color: var(--amber);
}

.card-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  word-break: break-word;
  letter-spacing: 0.3px;
}
.card-ip {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 22px;
  word-break: break-all;
  letter-spacing: 0.3px;
}

.card-block { margin-bottom: 18px; }
.card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.card-value { 
  font-size: 13px; 
  color: var(--text); 
  line-height: 1.6;
  font-weight: 500;
}
.card-value.muted { color: var(--text-dim); }

.card-hw {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 10px;
  color: #555;
  margin-bottom: 8px;
  word-break: break-all;
  letter-spacing: 0.2px;
}
.card-seen { 
  font-size: 12px; 
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
/* .act défini dans le bloc liquid glass */

.empty-state { 
  text-align: center; 
  color: var(--text-dim); 
  padding: 100px 20px; 
  font-size: 14px;
  letter-spacing: 0.2px;
}

/* --- Vue détail d'un poste --- */
.back-link {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 16px;
  margin-bottom: 24px;
  font-weight: 500;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.back-link:hover { 
  color: var(--neon-soft);
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.35);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}

.detail-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.detail-name { 
  font-size: 32px; 
  font-weight: 600;
  letter-spacing: 0.3px;
}
.detail-hwid-wrap { 
  margin-left: auto; 
  text-align: right; 
}
.detail-hwid-wrap .card-label { 
  text-align: right; 
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  padding: 10px 16px;
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.2s ease;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}
.btn-danger-outline:hover { 
  background: rgba(255, 51, 51, 0.1);
}

.detail-meta-box {
  background: rgba(21, 23, 26, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}
.detail-meta-box:hover {
  border-color: var(--neon-dim);
  box-shadow: 0 10px 36px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.1);
}
.detail-meta-line { 
  font-size: 13px; 
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.offline-notice {
  background: rgba(255, 170, 0, 0.05);
  border: 1px solid rgba(255, 170, 0, 0.3);
  color: var(--amber);
  padding: 16px;
  font-size: 12px;
  margin-bottom: 28px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.features-title { 
  font-size: 13px; 
  font-weight: 600; 
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 720px) {
  .features-grid { grid-template-columns: 1fr; }
}
/* .feature-card défini dans le bloc liquid glass */

.feature-icon {
  color: var(--neon-soft);
  margin-bottom: auto;
}
.feature-icon i, .feature-icon svg { 
  width: 26px; 
  height: 26px;
}

.feature-corner {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--text-dim);
  transition: all 0.2s ease;
}
.feature-corner i, .feature-corner svg { 
  width: 16px; 
  height: 16px;
}

.feature-title {
  font-weight: 600;
  font-size: 15px;
  margin-top: 22px;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: 0.2px;
}
.feature-card.danger .feature-icon { color: var(--red); }
.feature-card:hover:not(:disabled) .feature-corner { color: var(--neon-soft); }
.feature-desc { 
  font-size: 12px; 
  color: var(--text-dim);
  line-height: 1.5;
  letter-spacing: 0.2px;
}

/* --- Modale --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  position: relative;
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12) 0%,
      rgba(21, 23, 26, 0.88) 35%,
      rgba(21, 23, 26, 0.92) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.modal-card h2 { 
  font-size: 16px; 
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.modal-target { 
  color: var(--text-dim); 
  font-size: 12px; 
  margin-bottom: 18px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.modal-card textarea {
  width: 100%;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  font-family: 'Monaco', monospace;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.modal-card textarea:focus {
  outline: none;
  border-color: var(--neon-dim);
}
.modal-actions { 
  display: flex; 
  justify-content: flex-end; 
  gap: 12px; 
  margin-top: 22px;
}
/* .btn-primary défini dans le bloc liquid glass */

/* --- Visionneuse d'écran --- */
.screen-modal {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 150;
  display: flex;
  flex-direction: column;
}
.screen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  gap: 18px;
  flex-wrap: wrap;
}
.screen-title { 
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
}
.screen-controls { 
  display: flex; 
  align-items: center; 
  gap: 20px; 
}
.screen-status { 
  color: var(--text-dim); 
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.screen-rate { 
  color: var(--text-dim); 
  font-size: 12px; 
  display: flex; 
  align-items: center; 
  gap: 8px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.screen-rate select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.screen-rate select:focus {
  outline: none;
  border-color: var(--neon-dim);
}
.screen-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
}
.screen-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid var(--border);
}
.screen-error {
  color: var(--red);
  font-size: 14px;
  text-align: center;
  max-width: 600px;
  padding: 20px;
  letter-spacing: 0.2px;
}

/* --- Task List --- */
.task-card { 
  max-width: 720px; 
  width: 100%; 
}
.task-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.task-head h2 { 
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.task-controls { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}
.task-controls input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 12px;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.task-controls input:focus { 
  outline: none; 
  border-color: var(--neon-dim);
}

.task-body { 
  max-height: 60vh; 
  overflow-y: auto; 
}
.task-loading { 
  color: var(--text-dim); 
  padding: 32px; 
  text-align: center; 
  font-size: 13px;
  letter-spacing: 0.2px;
}

.task-table { 
  width: 100%; 
  border-collapse: collapse; 
  font-size: 12px; 
}
.task-table thead th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  text-transform: uppercase;
  letter-spacing: 0.2px;
  font-size: 11px;
}
.task-table td { 
  padding: 11px 12px; 
  border-bottom: 1px solid rgba(26, 26, 26, 0.5); 
}
.task-table .task-name { 
  font-weight: 600; 
  color: var(--text);
}
.task-table .task-user { 
  color: var(--text-dim); 
}
.task-kill {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  font-weight: 600;
}
.task-kill:hover { 
  border-color: var(--red); 
  color: var(--red);
}

/* --- Onglet Application --- */
/* Grosse card englobant tout l'onglet, même schéma que .account-content/.account-card */
.app-content {
  max-width: 780px;
  margin: 0 auto;
}
.app-card {
  background: rgba(21, 23, 26, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  backdrop-filter: blur(10px);
}
.app-title { 
  font-size: 24px; 
  font-weight: 600; 
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}
.app-sub { 
  color: var(--text-dim); 
  font-size: 13px; 
  margin-bottom: 28px; 
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.app-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.3s ease;
}
.app-form:hover {
  border-color: var(--neon-dim);
  box-shadow: 0 10px 36px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.1);
}
.app-form .url-label { margin-top: 0; }
.app-form .btn-primary { 
  padding: 13px;
}
.app-form textarea {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.app-form textarea:focus {
  outline: none;
  border-color: var(--neon-dim);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
.build-section-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text);
  margin: 0;
}
.build-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.build-grid .url-label { margin-top: 0; }
.build-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.build-actions .btn-primary { flex: 1; }
@media (max-width: 640px) {
  .build-grid { grid-template-columns: 1fr; }
}

.build-status {
  margin: 24px 0 0;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.build-status:hover {
  border-color: var(--neon-dim);
  box-shadow: 0 10px 36px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.1);
}
.build-status.ok { 
  border-color: var(--green);
  color: var(--green);
}
.build-status.err { 
  border-color: var(--red);
  color: var(--red);
}

.build-result {
  margin: 18px 0 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.build-result:hover {
  border-color: var(--neon-dim);
  box-shadow: 0 12px 40px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.1);
}
.build-result-label { 
  font-size: 11px; 
  color: var(--text-dim); 
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.build-link { 
  color: var(--text); 
  font-size: 13px; 
  word-break: break-all;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* --- Open URL --- */
.url-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.url-label input, .url-label select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 13px;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.url-label input:focus, .url-label select:focus { 
  outline: none; 
  border-color: var(--neon-dim);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}

/* --- System Control --- */
.sysctl-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}
/* .sysctl-btn défini dans le bloc liquid glass */

/* --- Fenêtres flottantes --- */
#windows { 
  position: fixed; 
  inset: 0; 
  pointer-events: none; 
  z-index: 500; 
}
/* Même traitement liquid glass que la navbar bulle (.topbar--bubble) :
   fond en dégradé, reflet ::before, shimmer + halo souris ::after. */
.win {
  position: absolute;
  pointer-events: auto;
  isolation: isolate;
  --glow-a: 0;
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.18) 0%,
      rgba(21, 23, 26, 0.88) 40%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10) 70%,
      rgba(21, 23, 26, 0.92) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  min-width: 300px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.06);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.win:hover {
  --glow-a: 1;
}
/* Reflet du haut, comme la navbar */
.win::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: -1;
}
/* Shimmer discret + halo souris (n'affecte que le fond, pas le contenu :
   z-index négatif place le pseudo-élément derrière .win-bar/.win-body). */
.win::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      circle at var(--mx, 50%) var(--my, 50%),
      rgba(255, 255, 255, calc(0.14 * var(--glow-a))) 0%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), calc(0.10 * var(--glow-a))) 32%,
      transparent 65%
    ),
    linear-gradient(
      105deg,
      transparent 30%,
      rgba(255, 255, 255, 0.05) 50%,
      transparent 70%
    );
  background-size: 100% 100%, 200% 100%;
  background-position: 0 0, -200% center;
  animation: topbarShimmer 6s linear infinite;
  pointer-events: none;
  z-index: -1;
}
/* Plein écran */
.win.win-maximized {
  left: 12px !important;
  top: 12px !important;
  width: calc(100vw - 24px) !important;
  height: calc(100vh - 24px) !important;
  max-height: calc(100vh - 24px) !important;
}
/* Minimisée : masquée mais gardée en mémoire (le state JS reste intact) */
.win.win-minimized-hidden {
  display: none;
}
.win-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(11, 12, 14, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}
.win-title { 
  font-size: 13px; 
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.win-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.win-ctrl {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.win-ctrl:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.win-ctrl.win-close:hover {
  background: rgba(255, 77, 94, 0.15);
  color: var(--red);
}
.win-body { 
  padding: 20px; 
  overflow: auto; 
  flex: 1;
}
/* Poignée de redimensionnement (coin bas-droite) */
.win-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.18) 50%);
  border-radius: 0 0 var(--radius) 0;
}
.win.win-maximized .win-resize-handle {
  display: none;
}

/* ================================================================== */
/*  Barre des fenêtres minimisées — style onglets navigateur          */
/*  Flotte en bas, au-dessus du contenu mais sous la mini navbar      */
/*  profil (bas-gauche) et n'empiète pas sur elle.                    */
/* ================================================================== */
.win-taskbar {
  position: fixed;
  bottom: 20px;
  left: 250px;
  right: 20px;
  z-index: 89;
  display: flex;
  gap: 8px;
  flex-wrap: wrap-reverse;
  justify-content: flex-start;
  pointer-events: none;
}
.win-tab {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 220px;
  padding: 9px 10px 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.16) 0%,
      rgba(255, 255, 255, 0.05) 45%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08) 100%
    );
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}
.win-tab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.win-tab-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.win-tab-close {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.win-tab-close:hover {
  color: var(--red);
  background: rgba(255, 77, 94, 0.15);
}

@media (max-width: 768px) {
  .win-taskbar {
    left: 12px;
    right: 12px;
    bottom: 78px; /* au-dessus de la mini navbar profil sur mobile */
  }
  .win-tab {
    max-width: 160px;
  }
}

.win-hint { 
  color: var(--text-dim); 
  font-size: 12px; 
  margin-bottom: 14px;
  font-weight: 400;
  letter-spacing: 0.2px;
}
.win-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  font-family: 'Monaco', monospace;
  font-size: 13px;
  resize: vertical;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.win-textarea:focus {
  outline: none;
  border-color: var(--neon-dim);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
.win-actions { 
  display: flex; 
  justify-content: flex-end; 
  margin-top: 16px;
  gap: 10px;
}
.win-toolbar { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  margin-bottom: 16px; 
  flex-wrap: wrap; 
  font-size: 12px; 
  color: var(--text-dim);
}
.win-toolbar input, .win-toolbar select {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}
.win-toolbar input:focus, .win-toolbar select:focus {
  outline: none;
  border-color: var(--neon-dim);
}
.win-search { 
  flex: 1; 
  min-width: 120px;
}
.win-tasks { 
  max-height: 55vh; 
  overflow: auto;
}
.win-screen-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  min-height: 200px;
  max-height: 60vh;
  overflow: auto;
}
.win-screen-img { 
  max-width: 100%; 
  max-height: 60vh; 
  object-fit: contain;
  border: 1px solid var(--border);
}
.win-screen-error { 
  color: var(--red); 
  font-size: 13px; 
  padding: 20px; 
  text-align: center;
  letter-spacing: 0.2px;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(21, 23, 26, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 22px;
  font-size: 13px;
  z-index: 200;
  font-weight: 500;
  letter-spacing: 0.2px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px) saturate(140%);
}

.toast.success { 
  border-color: var(--green);
  color: var(--green);
}
.toast.error { 
  border-color: var(--red); 
  color: var(--red);
}


/* --- Terminal distant --- */
.term-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  color: var(--text-dim);
  font-size: 12px;
}
.term-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}
.term-toolbar select {
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.term-toolbar .btn-ghost {
  margin-left: auto;
}
.term-output {
  background: rgba(0, 0, 0, 0.4);
  color: #d0d4de;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  height: 320px;
  overflow-y: auto;
  font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.term-output .term-cmd { color: var(--neon-soft); font-weight: 600; }
.term-output .term-stdout { color: #d0d4de; }
.term-output .term-stderr { color: #ff8a8a; }
.term-output .term-info { color: #6a7186; font-style: italic; }
.term-inputrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.term-prompt {
  color: var(--neon-soft);
  font-family: "Cascadia Code", "Consolas", monospace;
  font-weight: 700;
  min-width: 28px;
  text-align: right;
}
.term-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
}
.term-input:focus {
  outline: none;
  border-color: var(--neon-dim);
}


/* --- System Control : onglets + formulaire de verrouillage --- */
.sysctl-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.sysctl-tab {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.sysctl-tab:hover { color: var(--text); }
.sysctl-tab.active {
  color: var(--neon-soft);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.06);
  border-color: var(--neon-dim);
}
.sysctl-panel { display: block; }

.lock-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(255, 184, 77, 0.08);
  border: 1px solid rgba(255, 184, 77, 0.25);
  border-radius: 6px;
}
.lock-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.lock-locked-view textarea,
.lock-unlocked-view textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.lock-locked-view input[type="text"],
.lock-unlocked-view input[type="text"] {
  width: 100%;
  background: #000;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}

.lock-colors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 10px 0;
}
.lock-colors label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.lock-colors input[type="color"] {
  width: 100%;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #000;
  cursor: pointer;
}

.lock-btnrow {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.lock-btnrow .sysctl-btn { flex: 1; }
.lock-btnrow .btn-primary { flex: 2; }


/* ================================================================== */
/*  MOBILE — < 768 px                                                 */
/*  Objectif : tout est utilisable au doigt. Les fenêtres flottantes  */
/*  deviennent des modales plein écran. Le topbar se réorganise.      */
/* ================================================================== */

@media (max-width: 768px) {

  /* --- Topbar mobile : 1 ligne compacte brand | conn + cloche + ☰ --- */
  .topbar {
    display: flex;
    grid-template-columns: unset;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 0;
  }
  /* Cache les onglets desktop sur mobile (remplacés par le menu hamburger) */
  .tabs { display: none; }
  /* Affiche le bouton hamburger */
  .topbar-mobile-menu { display: flex; }
  .brand { font-size: 13px; white-space: nowrap; }
  .topbar-right { gap: 8px; }
  .topbar-bell { width: 30px; height: 30px; }
  .topbar-bell i, .topbar-bell svg { width: 14px; height: 14px; }
  .conn-indicator { width: 7px; height: 7px; }

  /* --- Contenu principal --- */
  .content {
    padding: 12px !important;
    padding-top: var(--topbar-h, 140px) !important; /* mesurée en JS, voir app.js */
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* --- Grille des machines : une colonne --- */
  .machines-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  /* --- Vue détail : marges plus fines --- */
  .detail-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .detail-name {
    font-size: 20px;
    word-break: break-all;
  }
  .detail-hwid-wrap {
    flex-basis: 100%;
  }
  .card-hw {
    font-size: 11px;
    word-break: break-all;
  }
  .features-grid {
    grid-template-columns: 1fr !important;
  }

  /* --- Fenêtres flottantes -> modales plein écran --- */
  #windows {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
  }
  .win {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-width: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
  }
  .win-bar {
    cursor: default !important;   /* pas de drag sur mobile */
    padding: 12px 14px;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .win-close {
    font-size: 22px;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .win-body {
    flex: 1;
    padding: 14px;
    -webkit-overflow-scrolling: touch;
  }
  .win-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .win-actions button {
    width: 100%;
  }
  .win-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .win-toolbar input,
  .win-toolbar select {
    min-height: 40px;
    font-size: 14px;
  }

  /* --- Terminal : output plus court, input plus grand --- */
  .term-output {
    height: 40dvh;
    font-size: 12px;
  }
  .term-input {
    font-size: 14px;
    min-height: 40px;
  }
  .term-inputrow {
    flex-wrap: wrap;
  }
  .term-inputrow .term-input {
    flex: 1 1 100%;
  }
  .term-inputrow .btn-primary {
    width: 100%;
  }
  .term-toolbar {
    flex-wrap: wrap;
  }

  /* --- Task list : table scrollable --- */
  .win-tasks {
    overflow-x: auto;
  }
  .task-table {
    font-size: 12px;
    min-width: 480px;
  }
  .task-table th, .task-table td {
    padding: 6px 8px;
  }

  /* --- File Explorer : toolbar et table scrollables, ne débordent pas --- */
  .files-toolbar {
    flex-wrap: wrap;
  }
  .files-toolbar input.files-path {
    flex: 1 1 100%;
    order: -1;
    margin-bottom: 6px;
  }
  .files-list {
    overflow-x: auto;
  }
  .files-table {
    min-width: 480px;
  }
  .files-row .files-name {
    max-width: 160px;
  }

  /* --- Visionneuse d'écran (fenêtre flottante) --- */
  .win-screen-stage {
    max-height: 60dvh;
  }
  .win-screen-img {
    max-width: 100%;
    height: auto;
  }
  .win-screen-status {
    font-size: 11px;
  }

  /* --- Modale plein écran ancienne (task-modal, sysctl-modal, etc.) --- */
  .modal .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  /* --- Visionneuse d'écran fullscreen dédiée --- */
  .screen-modal {
    position: fixed;
    inset: 0;
  }
  .screen-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  .screen-controls {
    flex-wrap: wrap;
    gap: 6px;
  }
  .screen-title {
    font-size: 13px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #screen-img {
    max-width: 100vw;
    height: auto;
  }

  /* --- System Control : onglets et pastilles couleur --- */
  .sysctl-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .lock-colors {
    grid-template-columns: repeat(2, 1fr);
  }

  /* --- App tab (Générer l'exécutable) : formulaire lisible --- */
  .app-form input {
    min-height: 44px;
    font-size: 14px;
  }
  .app-form button {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
  }

  /* --- Éléments cliquables : taille tactile minimum --- */
  button,
  .btn-primary,
  .btn-ghost,
  .sysctl-btn,
  .filter-btn {
    min-height: 40px;
  }
  input, select, textarea {
    font-size: 16px;  /* iOS n'auto-zoom pas si >= 16px */
  }

  /* --- Compte : bouton déconnexion pleine largeur --- */
  .account-head-actions {
    justify-content: stretch;
  }
  .account-head-actions .btn-ghost {
    width: 100%;
    text-align: center;
  }

  /* --- Apparence : pastilles et toggle plus grands au doigt --- */
  .theme-swatch,
  .appearance-custom-label input[type="color"] {
    width: 40px;
    height: 40px;
  }
  .appearance-toggle {
    min-height: 40px;
  }

  /* --- Mini navbar profil : ne doit jamais dépasser la largeur écran --- */
  .profile-bar-name {
    max-width: 38vw;
  }
}

/* --- Très petits écrans (< 380 px) : compact supplémentaire --- */
@media (max-width: 380px) {
  .brand { font-size: 12px; }
  .tab-btn { font-size: 11px; padding: 8px 4px; }
  .content { padding: 8px !important; padding-top: var(--topbar-h, 140px) !important; }
  .win-body { padding: 10px; }
  .term-output { height: 35dvh; }
}


/* --- Historique des builds --- */
.build-history {
  margin: 32px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.build-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.build-history-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.build-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.build-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.build-row-main {
  flex: 1;
  min-width: 0;
}
.build-row-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}
.build-row-title strong {
  font-size: 13px;
  color: var(--text);
}
.build-row-date {
  font-size: 11px;
  color: var(--text-dim);
}
.build-row-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}
.build-row-meta em {
  font-style: normal;
  color: var(--text-dim);
  opacity: 0.6;
  margin-right: 4px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.build-row-meta code {
  background: #000;
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 11px;
}
.build-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.build-row-actions .btn-ghost {
  padding: 6px 10px;
  font-size: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.build-row-actions .build-del {
  color: var(--red);
}

@media (max-width: 768px) {
  .build-row {
    flex-direction: column;
    align-items: stretch;
  }
  .build-row-actions {
    justify-content: space-between;
  }
  .build-row-actions .btn-ghost {
    flex: 1;
    justify-content: center;
  }
}


/* ================================================================== */
/*  Login page : onglets Connexion / Nouvelle clé                     */
/* ================================================================== */
.login-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  padding: 4px;
  border-radius: 10px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
}
.login-tab {
  flex: 1;
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.login-tab:hover { color: var(--text); }
.login-tab.active {
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.1);
  color: var(--neon-soft);
}
.login-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ================================================================== */
/*  Onglet Compte                                                     */
/* ================================================================== */
/* ================================================================== */
/*  Onglet Action Shop                                                */
/*  3 colonnes liquid glass : actions installées / boutique / demande */
/* ================================================================== */
.shop-content {
  max-width: 1400px;
  margin: 0 auto;
}
.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 20px;
  align-items: start;
}
.shop-card {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10) 0%,
      rgba(21, 23, 26, 0.80) 40%,
      rgba(21, 23, 26, 0.85) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.shop-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.10) 0%,
    rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08) 32%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: -1;
}
.shop-card:hover::after {
  opacity: 1;
}
.shop-card-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* --- Colonne gauche : actions installées --- */
.shop-installed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.shop-installed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.shop-item-icon {
  color: var(--neon-soft);
  flex-shrink: 0;
  display: flex;
}
.shop-item-icon i, .shop-item-icon svg { width: 16px; height: 16px; }
.shop-installed-item .shop-item-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-item-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: all 0.2s ease;
}
.shop-item-remove i, .shop-item-remove svg { width: 14px; height: 14px; }
.shop-item-remove:hover {
  color: var(--red);
  background: rgba(255, 77, 94, 0.12);
}

/* --- Colonne centrale : boutique --- */
.shop-store-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.shop-store-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.2s ease;
}
.shop-store-item.is-installed {
  border-color: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.30);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.06);
}
.shop-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shop-store-item .shop-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.shop-item-desc {
  font-size: 11px;
  color: var(--text-dim);
}
.shop-item-price {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--green);
  flex-shrink: 0;
}
.shop-item-toggle {
  flex-shrink: 0;
  font-size: 11px;
  padding: 7px 14px;
}

/* --- Colonne droite : demande + config webhook admin --- */
.shop-request .account-form {
  margin-top: 14px;
}
.shop-request textarea {
  background: rgba(0,0,0,0.4);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.shop-request textarea:focus {
  outline: none;
  border-color: var(--neon-dim);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
.shop-webhook-admin {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 1100px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
}

.account-content {
  max-width: 780px;
  margin: 0 auto;
}
.account-card {
  background: rgba(21, 23, 26, 0.72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  backdrop-filter: blur(10px);
}
.account-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
}
.account-subtitle {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  margin: 6px 0 24px;
  line-height: 1.5;
}

.account-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin: 0 0 22px;
  overflow-x: auto;
}
.account-tab {
  background: transparent;
  color: var(--text-dim);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.account-tab:hover { color: var(--text); }
.account-tab.active {
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.1);
  color: var(--neon-soft);
}

.account-panel {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.account-panel-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}
.account-hint {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

/* ================================================================== */
/*  Onglet Compte > Apparence — thème + toggle fond animé            */
/*  Liquid glass cohérent avec le reste du panel.                     */
/* ================================================================== */
.appearance-block {
  margin-bottom: 26px;
}
.appearance-block:last-child {
  margin-bottom: 0;
}
.appearance-block-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-dim);
}

/* --- Pastilles de couleur prédéfinies --- */
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.theme-swatch {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  flex-shrink: 0;
  background: var(--swatch-color, #0BBBBB);
  backdrop-filter: blur(6px) saturate(160%);
  -webkit-backdrop-filter: blur(6px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 3px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.theme-swatch:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 6px 18px var(--swatch-color, rgba(11, 187, 187, 0.5));
}
.theme-swatch.active {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 0 3px rgba(255, 255, 255, 0.12),
    0 6px 18px var(--swatch-color, rgba(11, 187, 187, 0.5));
}
.theme-swatch.active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.appearance-custom-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.appearance-custom-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}
.appearance-custom-label input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  overflow: hidden;
}
.appearance-custom-label input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.appearance-custom-label input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

/* --- Toggle liquid glass (fond GIF on/off) --- */
.appearance-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.appearance-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.appearance-toggle-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.appearance-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff 0%, #e2e2e2 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.appearance-toggle input:checked ~ .appearance-toggle-track {
  background:
    linear-gradient(135deg, rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.85) 0%, rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.70) 100%);
  border-color: rgba(255, 255, 255, 0.20);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 12px var(--neon-dim);
}
.appearance-toggle input:checked ~ .appearance-toggle-track .appearance-toggle-thumb {
  transform: translateX(20px);
}
.appearance-toggle-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* --- Image de fond personnalisée (PNG utilisateur) --- */
.bg-custom-admin-note {
  color: var(--neon-soft);
  opacity: 0.85;
  margin-top: -4px;
}
.bg-custom-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.bg-custom-preview {
  width: 90px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background-color: rgba(255, 255, 255, 0.04);
  background-size: cover;
  background-position: center center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bg-custom-preview-empty {
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
  padding: 0 6px;
}
.bg-custom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bg-custom-actions .error {
  flex-basis: 100%;
  margin: 4px 0 0;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.account-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.account-form input,
.account-form select {
  background: rgba(0,0,0,0.4);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 0.15s;
}
.account-form input:focus,
.account-form select:focus {
  outline: none;
  border-color: var(--neon-dim);
  box-shadow: 0 0 0 3px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
}
.account-form .btn-primary {
  align-self: flex-start;
  margin-top: 6px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.profile-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.profile-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}
.profile-value {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

/* Bloc "clés fraîchement générées" */
.keys-generated {
  margin: 18px 0;
  padding: 14px;
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.05);
  border: 1px solid rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.2);
  border-radius: 8px;
}
.keys-generated-list, #keys-generated-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.key-fresh {
  display: block;
  background: rgba(0, 0, 0, 0.4);
  color: var(--neon-soft);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
  letter-spacing: 1px;
  user-select: all;
}

.keys-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
}
.keys-list-head h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.key-row, .user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}
.key-row.used { opacity: 0.6; }
.key-row-main, .user-row-main { flex: 1; min-width: 0; }
.key-row-line1, .user-row-line1 {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 4px;
}
.key-row-line2, .user-row-line2 {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-dim);
}
.key-code {
  background: #000;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: var(--text);
  letter-spacing: 1px;
  user-select: all;
}
.key-duration {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  color: var(--text-dim);
}
.key-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
}
.key-status.unused { background: rgba(46, 204, 113, 0.12); color: #4ade80; }
.key-status.used { background: rgba(255,255,255,0.05); color: var(--text-dim); }
.key-note { color: var(--text); }
.key-user-exp { color: var(--text-dim); }
.key-created { color: var(--text-dim); font-style: italic; }

.key-row-actions, .user-row-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.key-row-actions .btn-ghost, .user-row-actions .btn-ghost {
  padding: 6px 10px;
  font-size: 12px;
}
.key-del, .user-del { color: var(--red); }

.user-role {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
}
.user-expired-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
}
.user-row.expired { border-color: rgba(220, 53, 69, 0.3); }

@media (max-width: 768px) {
  .account-card { padding: 18px; }
  .app-card { padding: 18px; }
  .account-tabs { flex-wrap: nowrap; }
  .profile-grid { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .key-row, .user-row { flex-direction: column; align-items: stretch; }
  .key-row-actions, .user-row-actions { justify-content: flex-end; }
}


/* --- Profil : clé agent personnelle --- */
.profile-agentkey {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.agentkey-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.agentkey-code {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: var(--neon-soft);
  letter-spacing: 0.5px;
  word-break: break-all;
  user-select: all;
}
.agentkey-row .btn-ghost {
  font-size: 12px;
  padding: 8px 12px;
}


/* --- Intercom --- */
.intercom-ui2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}
.intercom-status2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.intercom-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.intercom-dot.intercom-dot-active {
  background: var(--green);
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.7);
  animation: intercomPulse 1.5s ease-in-out infinite;
}
@keyframes intercomPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(61, 220, 132, 0.5); }
  50%       { box-shadow: 0 0 16px rgba(61, 220, 132, 0.9); }
}
.intercom-btns {
  display: flex;
  align-items: center;
  gap: 16px;
}
.intercom-icon-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.intercom-icon-btn i, .intercom-icon-btn svg { width: 20px; height: 20px; }
.intercom-icon-btn.active {
  border-color: var(--neon-dim);
  color: var(--neon-soft);
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12);
}
.intercom-icon-btn:hover { transform: scale(1.08); }
/* Bouton appel — plus grand, au centre */
.intercom-call-btn {
  width: 68px; height: 68px;
  border-color: rgba(61, 220, 132, 0.5);
  background: rgba(61, 220, 132, 0.12);
  color: var(--green);
}
.intercom-call-btn.intercom-call-active {
  border-color: rgba(255,77,94,0.5);
  background: rgba(255,77,94,0.12);
  color: var(--red);
  animation: intercomPulse 1.5s ease-in-out infinite;
}
.intercom-sliders {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.intercom-gain-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.intercom-gain-label i, .intercom-gain-label svg { width: 14px; height: 14px; color: var(--neon-soft); flex-shrink:0; }
.intercom-gain-label input[type="range"] {
  flex: 1;
  accent-color: var(--neon);
  height: 4px;
  cursor: pointer;
}
.intercom-gain-label span { font-size: 11px; min-width: 44px; text-align: right; color: var(--text); }

/* --- Webcam --- */
.webcam-status {
  color: var(--text-dim);
  font-size: 12px;
  min-width: 130px;
}
.webcam-stage {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 10px;
}
.webcam-img {
  max-width: 100%;
  max-height: 60vh;
  height: auto;
  display: none;
  border-radius: 6px;
}
.webcam-error {
  color: #ff8a8a;
  font-size: 13px;
  text-align: center;
  margin: 0;
  padding: 20px;
}
.webcam-shot {
  margin-left: auto;
}


/* --- File Explorer --- */
.files-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.files-toolbar input.files-path {
  flex: 1;
  background: #000;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
}
.files-toolbar .btn-ghost {
  padding: 6px 10px;
  font-size: 13px;
  min-width: 34px;
}
.files-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.files-shortcut {
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}
.files-shortcut:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.files-list {
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.files-table thead th {
  background: rgb(18, 20, 23);
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-align: left;
  padding: 8px 10px;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 var(--border);
}
.files-table td {
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  color: var(--text);
}
.files-row .files-name {
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-row.is-dir .files-name {
  cursor: pointer;
  color: var(--neon-soft);
}
.files-row.is-dir .files-name:hover { text-decoration: underline; }
.files-icon { font-size: 14px; }
.files-size, .files-mtime {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}
.files-actions {
  text-align: right;
  white-space: nowrap;
}
.files-actions .btn-ghost {
  padding: 3px 8px;
  font-size: 11px;
  margin-left: 3px;
}

/* --- Upload & Run --- */
.upload-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: rgba(0,0,0,0.15);
}
.upload-pick {
  padding: 8px 16px;
}
.upload-picked-info {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text);
}
.upload-options {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.upload-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--neon);
}
.upload-progress {
  margin-top: 14px;
}
.upload-progress-bar {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.upload-progress-bar span {
  display: block;
  height: 100%;
  background: var(--neon);
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--neon-dim);
}
.upload-progress-text {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
}


/* ================================================================== */
/*  Features modulables - Mode édition                                */
/* ================================================================== */

.features-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.features-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.features-edit-btn:hover {
  border-color: var(--neon-dim);
  color: var(--neon-soft);
}
.features-edit-btn.active {
  background: var(--neon);
  color: #06131a;
  border-color: var(--neon);
  box-shadow: 0 0 14px var(--neon-dim);
}
.features-edit-btn i, .features-edit-btn svg {
  width: 14px;
  height: 14px;
}

/* Feature card en mode édition */
.feature-card.edit-mode {
  cursor: grab;
  position: relative;
}
.feature-card.edit-mode:active {
  cursor: grabbing;
}
.feature-card.edit-mode:hover {
  transform: none;
  background: var(--bg-card-hover);
}

/* Indicateurs de drag */
.feature-card.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}
.feature-card.drag-over {
  border: 2px dashed var(--neon) !important;
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.06);
}

/* Handle de drag */
.feature-drag-handle {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--text-dim);
  opacity: 0.5;
  cursor: grab;
  padding: 4px;
  transition: opacity 0.2s;
}
.feature-drag-handle:hover {
  opacity: 1;
}
.feature-drag-handle i, .feature-drag-handle svg {
  width: 18px;
  height: 18px;
}
.feature-card.edit-mode:active .feature-drag-handle {
  cursor: grabbing;
}

/* Bouton masquer */
.feature-hide-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}
.feature-hide-btn:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(255, 51, 51, 0.1);
}
.feature-hide-btn i, .feature-hide-btn svg {
  width: 16px;
  height: 16px;
}

/* Card "Ajouter une feature" */
.add-feature-card {
  border: 2px dashed var(--border) !important;
  background: transparent !important;
  justify-content: center;
  align-items: center;
  min-height: 160px;
}
.add-feature-card:hover {
  border-color: var(--neon-dim) !important;
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.03) !important;
}
.add-feature-card .feature-icon.add-icon {
  color: var(--text-dim);
  margin-bottom: 8px;
}
.add-feature-card .feature-icon.add-icon i,
.add-feature-card .feature-icon.add-icon svg {
  width: 32px;
  height: 32px;
}
.add-feature-card .feature-title {
  margin-top: 0;
  color: var(--text-dim);
}
.add-feature-card .feature-desc {
  text-align: center;
}

/* Modal ajouter feature */
.add-feature-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.add-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.add-feature-item:hover {
  border-color: var(--neon-dim);
}
.add-feature-icon {
  color: var(--text);
  flex-shrink: 0;
}
.add-feature-icon i, .add-feature-icon svg {
  width: 20px;
  height: 20px;
}
.add-feature-info {
  flex: 1;
  min-width: 0;
}
.add-feature-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.add-feature-desc {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
}
.add-feature-restore {
  flex-shrink: 0;
}

/* Mobile : ajustements mode édition */
@media (max-width: 768px) {
  .features-title {
    flex-wrap: wrap;
    gap: 8px;
  }
  .features-edit-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
  .feature-drag-handle {
    top: 8px;
    left: 8px;
  }
  .feature-hide-btn {
    top: 8px;
    right: 8px;
    padding: 8px 10px;
  }
  .add-feature-list {
    max-height: 60vh;
  }
}


/* ================================================================== */
/*  Alert Window                                                      */
/* ================================================================== */
.alert-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.alert-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.alert-tab:hover { color: var(--text); }
.alert-tab.active { background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08); color: var(--neon-soft); }
.alert-tab[data-type="info"].active { color: #60a5fa; }
.alert-tab[data-type="warning"].active { color: var(--amber); }
.alert-tab[data-type="error"].active { color: var(--red); }
.alert-tab[data-type="success"].active { color: var(--green); }

.alert-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin-top: 10px;
}
.alert-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--neon);
}

/* ================================================================== */
/*  Chat Window                                                       */
/* ================================================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 400px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.chat-msg-admin {
  align-self: flex-end;
  background: var(--neon);
  color: #06131a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.chat-msg-user {
  align-self: flex-start;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg-system {
  align-self: center;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
}
.chat-inputrow {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
}
.chat-input:focus {
  outline: none;
  border-color: var(--neon-dim);
}
.chat-send {
  padding: 10px 20px;
}

/* Browser info */
.browser-info {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border: 1px solid var(--border);
}


/* ================================================================== */
/*  Popup nouvelle connexion                                          */
/* ================================================================== */
.new-device-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, rgba(26, 28, 32, 0.95) 0%, rgba(11, 12, 14, 0.95) 100%);
  border: 1px solid var(--neon-dim);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.2), 0 0 0 1px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
  animation: popupSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 340px;
  backdrop-filter: blur(14px);
}
@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
.new-device-popup.fade-out {
  animation: popupFadeOut 0.3s ease forwards;
}
@keyframes popupFadeOut {
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}
.new-device-icon {
  width: 44px;
  height: 44px;
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.12);
  border: 1px solid var(--neon-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-soft);
  flex-shrink: 0;
}
.new-device-icon i, .new-device-icon svg {
  width: 22px;
  height: 22px;
}
.new-device-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.new-device-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--neon-soft);
}
.new-device-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.new-device-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  margin: -8px -8px -8px 0;
  transition: color 0.2s;
}
.new-device-close:hover {
  color: #fff;
}

@media (max-width: 480px) {
  .new-device-popup {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}


/* ================================================================== */
/*  Mini navbar profil — bulle flottante en bas à gauche              */
/*  Affiche : avatar (initiale), nom d'utilisateur, jours restants.   */
/* ================================================================== */
.profile-bar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.18) 0%,
      rgba(255, 255, 255, 0.06) 40%,
      rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.10) 70%,
      rgba(255, 255, 255, 0.04) 100%
    );
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);

  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.profile-bar:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 4px 14px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.profile-bar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.95) 0%, rgba(var(--neon-soft-r), var(--neon-soft-g), var(--neon-soft-b), 0.85) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 12px rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.4);
}
.profile-bar-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.profile-bar-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.profile-bar-days {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .profile-bar {
    bottom: 12px;
    left: 12px;
    padding: 6px 14px 6px 6px;
  }
  .profile-bar-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .profile-bar-name {
    max-width: 110px;
  }
}

/* ================================================================== */
/*  Onglet Compte — bloc d'actions (déconnexion, etc.)                */
/* ================================================================== */
.account-head-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}


/* ================================================================== */
/*  Clavier virtuel                                                   */
/* ================================================================== */
.kb-mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.kb-mode-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.kb-mode-tab:hover { color: var(--text); }
.kb-mode-tab.active { background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08); color: var(--neon-soft); }

.kb-panel { margin-top: 10px; }

.kb-options {
  margin: 10px 0;
}

.kb-special-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.kb-key {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 12px;
  font-family: "Cascadia Code", monospace;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 50px;
  text-align: center;
}
.kb-key:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--neon-dim);
  transform: translateY(-1px);
}
.kb-key:active {
  transform: translateY(0);
  background: rgba(255,255,255,0.15);
}

.kb-combos {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.kb-combo-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.kb-combo {
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.08);
  border: 1px solid var(--neon-dim);
  border-radius: 6px;
  color: var(--neon-soft);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin: 0 4px 6px 0;
}
.kb-combo:hover {
  background: rgba(var(--neon-r), var(--neon-g), var(--neon-b), 0.16);
  border-color: var(--neon);
}


/* --- Keyboard Live Mode --- */
.kb-live-status {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.kb-live-input {
  width: 100%;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  font-size: 16px;
  font-family: "Cascadia Code", monospace;
  text-align: center;
  letter-spacing: 2px;
  transition: border-color 0.2s;
}
.kb-live-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(102, 204, 51, 0.2);
}
.kb-live-input:disabled {
  opacity: 0.3;
}
