/* ═══════════════════════════════════════════════════
   GamePanel v3 — Design System
   Style "tech panel pro" avec theming par jeu
   ═══════════════════════════════════════════════════ */

:root {
  /* ===== Palette base ===== */
  --bg-0: #0a0e14;          /* fond global */
  --bg-1: #0f1419;          /* cards */
  --bg-2: #1a2027;          /* surfaces élevées */
  --bg-3: #242b35;          /* hovers */

  --border: #2a313c;
  --border-strong: #3a4250;
  --border-subtle: #1f252d;

  --text-0: #e6edf3;        /* primary text */
  --text-1: #aab1bc;        /* secondary text */
  --text-2: #6b7280;        /* muted text */
  --text-3: #4b5563;        /* very muted */

  /* ===== Couleurs accent / état ===== */
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --green-dim: rgba(16, 185, 129, 0.3);
  --green-glow: rgba(16, 185, 129, 0.4);

  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.1);
  --amber-dim: rgba(245, 158, 11, 0.3);

  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --red-dim: rgba(239, 68, 68, 0.3);

  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --blue-dim: rgba(59, 130, 246, 0.3);

  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.1);
  --purple-dim: rgba(168, 85, 247, 0.3);

  --orange: #fb923c;
  --orange-bg: rgba(251, 146, 60, 0.1);

  /* ===== Game theme par défaut (gris neutre) ===== */
  --game-color: #6b7280;
  --game-color-dark: #4b5563;
  --game-color-light: #9ca3af;
  --game-glow: rgba(107, 114, 128, 0.3);
  --game-bg: rgba(107, 114, 128, 0.05);
  --game-gradient: linear-gradient(135deg, rgba(107, 114, 128, 0.05) 0%, rgba(107, 114, 128, 0.0) 100%);

  /* ===== Spacing & sizes ===== */
  --sidebar-w: 240px;
  --topbar-h: 52px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-sm: 4px;

  /* ===== Fonts ===== */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, monospace;
}

/* ===== Game theme overrides — applied via [data-game="..."] ===== */
[data-game="minecraft"] {
  --game-color: #10b981;
  --game-color-dark: #059669;
  --game-color-light: #34d399;
  --game-glow: rgba(16, 185, 129, 0.4);
  --game-bg: rgba(16, 185, 129, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.0) 70%);
}
[data-game="conan"] {
  --game-color: #c47a3d;
  --game-color-dark: #92400e;
  --game-color-light: #fbbf24;
  --game-glow: rgba(196, 122, 61, 0.4);
  --game-bg: rgba(196, 122, 61, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(196, 122, 61, 0.12) 0%, rgba(196, 122, 61, 0.0) 70%);
}
[data-game="satisfactory"] {
  --game-color: #fb923c;
  --game-color-dark: #ea580c;
  --game-color-light: #fdba74;
  --game-glow: rgba(251, 146, 60, 0.4);
  --game-bg: rgba(251, 146, 60, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(251, 146, 60, 0.12) 0%, rgba(251, 146, 60, 0.0) 70%);
}
[data-game="valheim"] {
  --game-color: #3b82f6;
  --game-color-dark: #1e40af;
  --game-color-light: #60a5fa;
  --game-glow: rgba(59, 130, 246, 0.4);
  --game-bg: rgba(59, 130, 246, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0.0) 70%);
}
[data-game="palworld"] {
  --game-color: #06b6d4;
  --game-color-dark: #0e7490;
  --game-color-light: #22d3ee;
  --game-glow: rgba(6, 182, 212, 0.4);
  --game-bg: rgba(6, 182, 212, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(6, 182, 212, 0.12) 0%, rgba(6, 182, 212, 0.0) 70%);
}
[data-game="rust"] {
  --game-color: #dc2626;
  --game-color-dark: #991b1b;
  --game-color-light: #f87171;
  --game-glow: rgba(220, 38, 38, 0.4);
  --game-bg: rgba(220, 38, 38, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(220, 38, 38, 0.12) 0%, rgba(220, 38, 38, 0.0) 70%);
}
[data-game="ark"] {
  --game-color: #9333ea;
  --game-color-dark: #6b21a8;
  --game-color-light: #a855f7;
  --game-glow: rgba(147, 51, 234, 0.4);
  --game-bg: rgba(147, 51, 234, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(147, 51, 234, 0.12) 0%, rgba(147, 51, 234, 0.0) 70%);
}
[data-game="7dtd"] {
  --game-color: #a16207;
  --game-color-dark: #713f12;
  --game-color-light: #ca8a04;
  --game-glow: rgba(161, 98, 7, 0.4);
  --game-bg: rgba(161, 98, 7, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(161, 98, 7, 0.12) 0%, rgba(161, 98, 7, 0.0) 70%);
}
[data-game="factorio"] {
  --game-color: #fbbf24;
  --game-color-dark: #b45309;
  --game-color-light: #fde047;
  --game-glow: rgba(251, 191, 36, 0.4);
  --game-bg: rgba(251, 191, 36, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(251, 191, 36, 0.0) 70%);
}
[data-game="terraria"] {
  --game-color: #84cc16;
  --game-color-dark: #3f6212;
  --game-color-light: #a3e635;
  --game-glow: rgba(132, 204, 22, 0.4);
  --game-bg: rgba(132, 204, 22, 0.06);
  --game-gradient: linear-gradient(135deg, rgba(132, 204, 22, 0.12) 0%, rgba(132, 204, 22, 0.0) 70%);
}

/* ═══════════════════════════════════════════════════
   Reset & base
   ═══════════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-0);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--game-color); text-decoration: none; cursor: pointer; }
a:hover { color: var(--game-color-light); }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
code, pre { font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════
   Login
   ═══════════════════════════════════════════════════ */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
              var(--bg-0);
}
.login-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-mark {
  font-size: 52px;
  margin-bottom: 12px;
  display: block;
  animation: login-float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(99,102,241,0.7));
}
@keyframes login-float {
  0%, 100% { transform: translateY(0px); filter: drop-shadow(0 0 20px rgba(99,102,241,0.6)); }
  50% { transform: translateY(-6px); filter: drop-shadow(0 0 32px rgba(139,92,246,0.9)); }
}
.login-logo-title {
  font-family: var(--font-mono);
  font-size: 24px;
  letter-spacing: 0.1em;
  font-weight: 700;
  background: linear-gradient(135deg, #e2e8f0 20%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo-title span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-login {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.btn-login:hover {
  background: linear-gradient(135deg, #4f8df3 0%, #2563eb 100%);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}
.btn-login:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════
   App layout
   ═══════════════════════════════════════════════════ */
#app {
  display: flex;
  min-height: 100vh;
}
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  /* Scrollbar discrète : invisible par défaut, apparaît au hover de la sidebar */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s;
}
#sidebar:hover { scrollbar-color: var(--border-strong) transparent; }
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s;
}
#sidebar:hover::-webkit-scrollbar-thumb { background: var(--border-strong); }
#sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ═══════════════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════════════ */
.sidebar-logo {
  padding: 20px 20px 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-section, .sidebar-footer { flex-shrink: 0; }
.sidebar-logo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.06), transparent);
  pointer-events: none;
}
.sidebar-logo-mark {
  font-size: 28px;
  filter: drop-shadow(0 0 12px rgba(99,102,241,0.7));
  animation: logo-pulse 3s ease-in-out infinite;
  position: relative;
}
@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(99,102,241,0.5)); }
  50% { filter: drop-shadow(0 0 18px rgba(139,92,246,0.9)); }
}
.sidebar-logo-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
  background: linear-gradient(135deg, #e2e8f0 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}
.sidebar-logo-text span {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo-version {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  background: rgba(96,165,250,0.10);
  color: #a78bfa;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(167,139,250,0.25);
  white-space: nowrap;
  margin-top: 8px;
  width: fit-content;
  text-transform: lowercase;
}

.sidebar-section {
  padding: 8px 12px 4px 12px;
}
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 4px 8px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.sidebar-section-label:hover { color: var(--text-2); }
.sidebar-section-label[data-collapsible]::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform 0.15s;
}
.sidebar-section.collapsed .sidebar-section-label[data-collapsible]::before { transform: rotate(0deg); }
.sidebar-section:not(.collapsed) .sidebar-section-label[data-collapsible]::before { transform: rotate(90deg); }
.sidebar-section.collapsed > .nav-item { display: none; }

/* Section Serveurs : max-height + scroll interne pour éviter que la liste
   ne pousse les sections Administration / footer hors de l'écran quand
   l'utilisateur a beaucoup de serveurs. Pattern Discord/Slack. */
.sidebar-section[data-section="servers"] {
  max-height: 40vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.sidebar-section[data-section="servers"]:hover {
  scrollbar-color: var(--border-strong) transparent;
}
.sidebar-section[data-section="servers"]::-webkit-scrollbar { width: 5px; }
.sidebar-section[data-section="servers"]::-webkit-scrollbar-track { background: transparent; }
.sidebar-section[data-section="servers"]::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.2s;
}
.sidebar-section[data-section="servers"]:hover::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
.sidebar-section[data-section="servers"].collapsed {
  max-height: none;
  overflow: visible;
}
/* Rendu uniforme des labels collapsibles (background visible identique
   sur SERVEURS et ADMINISTRATION). */
.sidebar-section-label[data-collapsible] {
  background: var(--bg-1);
}
/* Sur la section servers, le label reste sticky en haut pendant le scroll. */
.sidebar-section[data-section="servers"] > .sidebar-section-label {
  position: sticky;
  top: 0;
  z-index: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-1);
  transition: all 0.12s ease;
  position: relative;
}
.nav-item-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-item:hover {
  background: var(--bg-2);
  color: var(--text-0);
}
.nav-item.active {
  background: linear-gradient(90deg, var(--game-bg) 0%, transparent 100%);
  color: var(--text-0);
  border-left: 2px solid var(--game-color);
  padding-left: 8px;
}
.nav-item.active .nav-item-icon { color: var(--game-color); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 8px;
  flex-shrink: 0;
  transition: box-shadow 0.3s;
}
.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
  animation: pulse-glow 2s ease-in-out infinite;
}
.status-dot.offline { background: var(--text-3); }

/* v1.6.7 : badge "X/Y" sur le nav-item Docker — nb de containers gérés actifs */
.docker-running-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--green, #22c55e);
  border: 1px solid rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.docker-running-badge.partial {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber, #f59e0b);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
}
.docker-running-badge.zero {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-2, #64748b);
  border-color: rgba(100, 116, 139, 0.3);
  box-shadow: none;
}
.status-dot.loading {
  background: var(--amber);
  animation: pulse-amber 1s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--green-glow); }
  50% { box-shadow: 0 0 14px rgba(16, 185, 129, 0.6); }
}
@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════
   Topbar
   ═══════════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}

.bell-button {
  position: relative;
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.bell-button:hover {
  background: var(--bg-2);
  color: var(--text-0);
  border-color: var(--border-strong);
}
.bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-1);
}

/* ═══════════════════════════════════════════════════
   Pages
   ═══════════════════════════════════════════════════ */
.page {
  flex: 1;
  padding: 28px 32px 32px 32px;
  display: none;
  overflow-y: auto;
}
.page.active { display: block; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.page-title {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.page-title span { color: var(--game-color); }

/* ═══════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════ */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-strong); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title-icon { color: var(--game-color); font-size: 16px; }

/* ═══════════════════════════════════════════════════
   Server Cards (DASHBOARD - le grand redesign)
   ═══════════════════════════════════════════════════ */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 48px;
}

.server-card {
  /* margin-bottom retiré (redondant avec grid gap) */
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: default;
  /* min-width:0 : sans cette prop, un item grid n'accepte pas de descendre
   * sous son min-content même si la colonne grid est contrainte. La carte
   * peut déborder à droite de sa cellule. Complément de min-width:0 sur
   * .server-card-inner (déjà présent). */
  min-width: 0;
}
.server-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--game-color) 0%, var(--game-color-dark) 100%);
  opacity: 0.7;
  transition: opacity 0.25s;
}
.server-card:hover {
  border-color: var(--game-color);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4),
              0 0 0 1px var(--game-color),
              0 0 24px var(--game-glow);
}
.server-card:hover::before { opacity: 1; }
.server-card.online::before { opacity: 1; }

.server-card-bg {
  position: absolute;
  inset: 0;
  background: var(--game-gradient);
  pointer-events: none;
  opacity: 0.25;
  z-index: 0;
}

.server-card-inner {
  position: relative;
  z-index: 1;
  padding: 28px 36px 32px 36px;
  flex: 1;
  display: flex;
  flex-direction: column;
  /* min-width:0 indispensable : server-card-inner est enfant d'une colonne
   * grid (auto-fill) ; sans cette prop le navigateur ne peut pas rétrécir
   * l'élément en dessous de son min-content, ce qui fait déborder la carte
   * vers la droite sur viewport < 1400px avec 2 cartes côte à côte. */
  min-width: 0;
}
.server-card-inner > .server-actions {
  margin-top: auto !important;
}

.server-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  /* min-width:0 : le header est un enfant flex de .server-card-inner
   * (lui-même déjà min-width:0). Sans cette prop, le header peut
   * forcer la carte à s'élargir via son min-content (badges + icône). */
  min-width: 0;
}
/* Div des badges (EN LIGNE + DOCKER/FABRIC/…) injecté via innerHTML :
 * flex-shrink:0 garantit que les badges ne se compressent pas et restent
 * lisibles. white-space sur les badges individuels suffit, mais sans
 * flex-shrink:0 sur leur container parent, le browser peut tenter de
 * réduire le container lui-même en dessous de son min-content. */
.server-card-header > div:last-child {
  flex-shrink: 0;
}
.server-card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--game-bg);
  border: 1px solid var(--game-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.server-card-icon-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--game-color) 0%, transparent 60%);
  opacity: 0.15;
}
.server-card-icon {
  width: 32px; height: 32px;
  z-index: 1;
  filter: drop-shadow(0 0 4px var(--game-glow));
}
.server-card-icon-emoji {
  font-size: 28px;
  z-index: 1;
}

.server-card-info { flex: 1; min-width: 0; }
.server-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.server-card-game {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}
.status-badge.online {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-dim);
}
.status-badge.online::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-glow 2s ease-in-out infinite;
}
.status-badge.offline {
  color: var(--text-2);
  background: var(--bg-3);
  border-color: var(--border);
}
.status-badge.loading {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-dim);
}
.status-badge.error {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-dim);
}

/* Stats grid in server card */
.stats-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
/* minmax(0, 1fr) force les colonnes à accepter une largeur < min-content,
 * ce qui leur permet de rétrécir quand la carte est contrainte par la grille. */
.stats-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  min-width: 0;
}
.stat-value svg {
  display: inline-block;
  vertical-align: middle;
  margin-top: 0;
  margin-left: 10px;
  width: 42px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .stat-value svg { width: 32px; margin-left: 8px; }
}
.stat-value-sub { font-size: 12px; color: var(--text-2); font-weight: 400; }

.player-bar-wrap {
  margin-top: 6px;
  height: 4px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
}
.player-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--game-color) 0%, var(--game-color-light) 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.player-bar-fill.warn { background: var(--amber); }
.player-bar-fill.crit { background: var(--red); }

/* Server actions */
.server-actions {
  display: flex;
  /* flex-wrap:wrap : les boutons passent à la ligne si l'espace est
   * insuffisant (évite le débordement horizontal sur desktop ~1300-1500px
   * avec 2 cartes côte à côte). */
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.server-meta {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* "Add server" tile */
.server-card.add-server {
  border-style: dashed;
  border-color: var(--border-strong);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.server-card.add-server::before { display: none; }
.server-card.add-server:hover {
  border-style: dashed;
  border-color: var(--blue);
  background: rgba(59, 130, 246, 0.03);
  transform: translateY(-2px);
}
.add-server-content {
  text-align: center;
  color: var(--text-2);
  transition: color 0.2s;
}
.server-card.add-server:hover .add-server-content { color: var(--blue); }
.add-server-icon {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
}
.add-server-title {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.add-server-subtitle {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-2);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-3);
  border-color: var(--border-strong);
}
.btn-sm { padding: 4px 9px; font-size: 11px; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, #2563eb 100%);
  color: white;
  border-color: transparent;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f8df3 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-game {
  background: linear-gradient(135deg, var(--game-color) 0%, var(--game-color-dark) 100%);
  color: white;
  border-color: transparent;
}
.btn-game:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 12px var(--game-glow);
}

.btn-start {
  background: linear-gradient(135deg, var(--green) 0%, #059669 100%);
  color: white;
  border-color: transparent;
}
.btn-start:hover { box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); filter: brightness(1.1); }

.btn-stop {
  background: linear-gradient(135deg, var(--red) 0%, #b91c1c 100%);
  color: white;
  border-color: transparent;
}
.btn-stop:hover { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); filter: brightness(1.1); }

.btn-restart {
  background: linear-gradient(135deg, var(--amber) 0%, #d97706 100%);
  color: white;
  border-color: transparent;
}
.btn-restart:hover { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); filter: brightness(1.1); }

.btn-purple {
  background: linear-gradient(135deg, var(--purple) 0%, #7c3aed 100%);
  color: white;
  border-color: transparent;
}

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════
   Tables, lists, forms
   ═══════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-1);
}
.data-table tr:hover td { background: var(--bg-2); }

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 5px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 11px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--game-color);
  box-shadow: 0 0 0 3px var(--game-bg);
}
.form-help { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-error {
  background: var(--red-bg);
  color: var(--red);
  padding: 8px 12px;
  border: 1px solid var(--red-dim);
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-top: 8px;
  display: none;
}
.form-error:not(:empty) { display: block; }

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

/* ═══════════════════════════════════════════════════
   Console / logs
   ═══════════════════════════════════════════════════ */
.console-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.console-header {
  background: var(--bg-2);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.console-title-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.console-body {
  background: #06090d;
  padding: 14px;
  height: 50vh;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-1);
}
.log-line { padding: 1px 0; word-break: break-word; }
.log-line.error { color: var(--red); }
.log-line.warn { color: var(--amber); }
.log-line.info { color: var(--text-1); }
.log-line.cmd { color: var(--game-color); font-weight: 600; }

.console-input-row {
  background: var(--bg-2);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.console-prompt { font-family: var(--font-mono); color: var(--game-color); }
.console-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 12px;
}
.quick-cmds {
  background: var(--bg-2);
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════
   Tabs
   ═══════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text-0); }
.tab.active {
  color: var(--game-color);
  border-bottom-color: var(--game-color);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ═══════════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  /* z-index 1200 > 1100 (.mc-feat-backdrop) — les confirmModal/promptModal
     doivent passer AU-DESSUS des modales feature ouvertes en arriere-plan
     (sinon le confirm de suppression d'un world passait derriere la
     modale Mondes, signale 2026-05-18). */
  z-index: 1200;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 540px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.modal-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  color: var(--text-0);
}
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}
.editor {
  width: 100%;
  height: 60vh;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-0);
  resize: none;
}

/* ═══════════════════════════════════════════════════
   Toasts
   ═══════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px 14px 16px;
  color: var(--text-0);
  font-size: 13px;
  min-width: 240px;
  max-width: 380px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
  position: relative;
  overflow: hidden;
}
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
  animation: toast-progress linear forwards;
  transform-origin: left;
}
@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   Wizard (Add server)
   ═══════════════════════════════════════════════════ */
.wizard-modal { width: 760px; max-width: 100%; }

.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}
.wizard-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
  margin-left: 10px;
  margin-right: 10px;
}
.wizard-step.done:not(:last-child)::after { background: var(--green); }
.wizard-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
  transition: all 0.2s;
}
.wizard-step.active .wizard-step-num {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-bg);
}
.wizard-step.done .wizard-step-num {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}
.wizard-step-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}
.wizard-step.active .wizard-step-label { color: var(--text-0); }

/* Game picker grid */
.game-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
  /* Padding tout autour pour ne pas faire clipper le glow hover/selected
     des tiles par overflow:auto, surtout en haut sous le stepper du wizard. */
  padding: 16px 12px;
}
.game-tile {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.game-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--game-gradient);
  opacity: 0.4;
  pointer-events: none;
}
.game-tile:hover {
  border-color: var(--game-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--game-glow);
}
.game-tile.selected {
  border-color: var(--game-color);
  background: var(--game-bg);
  box-shadow: 0 0 0 1px var(--game-color);
}

/* État "Bientôt disponible" — tile désactivée mais visible */
.game-tile.coming-soon {
  cursor: not-allowed;
  opacity: 0.55;
}
.game-tile.coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}
.coming-soon-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--game-bg);
  color: var(--game-color);
  border: 1px solid var(--game-color);
  z-index: 2;
}

.game-tile-icon {
  font-size: 38px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 10px var(--game-glow));
}
.game-tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}
.game-tile-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════
   File manager
   ═══════════════════════════════════════════════════ */
.fm-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.fm-breadcrumb {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}
.fm-breadcrumb a { color: var(--text-1); margin: 0 2px; }
.fm-breadcrumb a:hover { color: var(--game-color); }
.fm-list {
  max-height: 60vh;
  overflow-y: auto;
}
.fm-item {
  display: grid;
  grid-template-columns: 28px 1fr 90px 120px auto;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
}
.fm-item:hover { background: var(--bg-2); }
.fm-item-icon { font-size: 14px; }
.fm-item-name { color: var(--text-0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-item-size { font-family: var(--font-mono); color: var(--text-2); font-size: 11px; text-align: right; }
.fm-item-mtime { font-family: var(--font-mono); color: var(--text-3); font-size: 11px; }
.fm-item-actions { display: flex; gap: 4px; }

/* ═══════════════════════════════════════════════════
   Misc / utilities
   ═══════════════════════════════════════════════════ */
.text-mono { font-family: var(--font-mono); }
.text-small { font-size: 11px; }
.text-muted { color: var(--text-2); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.mb-12 { margin-bottom: 12px; }
.ml-auto { margin-left: 8px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.player-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--game-bg);
  color: var(--game-color);
  border: 1px solid var(--game-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.player-name { font-size: 13px; flex: 1; }

.container-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.container-row:last-child { border-bottom: none; }
.container-name { font-weight: 600; font-size: 13px; }

/* Alerts panel */
.alerts-panel {
  position: fixed;
  top: 60px;
  right: 24px;
  width: 380px;
  max-height: 70vh;
  background: var(--bg-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  z-index: 100;
}
.alerts-panel.open { display: flex; }
.alerts-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alerts-list {
  flex: 1;
  overflow-y: auto;
  max-height: 50vh;
}
.alert-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}
.alert-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.alert-severity {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
}
.alert-severity.critical, .alert-severity.crit { background: var(--red-bg); color: var(--red); }
.alert-severity.warning, .alert-severity.warn { background: var(--amber-bg); color: var(--amber); }
.alert-severity.info { background: var(--blue-bg); color: var(--blue); }
.alert-time { margin-left: 8px; color: var(--text-3); font-family: var(--font-mono); font-size: 10px; }
.alert-message { color: var(--text-0); }

/* Mini graphs (Chart.js) */
.mini-graph {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  height: 140px;
}

/* Responsive */
@media (max-width: 800px) {
  #sidebar { position: fixed; left: -240px; transition: left 0.3s; z-index: 50; }
  #sidebar.open { left: 0; }
  .servers-grid { grid-template-columns: 1fr; }
  .stats-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
/* GamePanel v3.3 + v3.4 — CSS complémentaires
 * À appender à style.css ou inclure comme fichier séparé
 */

/* ===== Diff viewer ===== */
.diff-line-added {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}
.diff-line-removed {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}
.diff-line-unchanged {
  color: var(--text-2);
}
.diff-line-prefix {
  user-select: none;
  opacity: 0.6;
  width: 12px;
  flex-shrink: 0;
}
.diff-line-no {
  user-select: none;
  opacity: 0.4;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ===== Maintenance banner ===== */
#maintenance-banner {
  animation: maint-banner-slide-in 0.3s ease-out;
}
@keyframes maint-banner-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Pulsation pour maintenance active (rouge) */
#maintenance-banner.active-pulse {
  animation: maint-banner-pulse 3s ease-in-out infinite;
}
@keyframes maint-banner-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 2px 24px rgba(239, 68, 68, 0.6); }
}

/* === v3.3.1 — Badges loader serveur === */
.loader-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  white-space: nowrap;
}
.loader-badge.badge-neoforge { background: rgba(255,140,0,0.15); color: #ff8c00; border-color: rgba(255,140,0,0.4); }
.loader-badge.badge-forge { background: rgba(220,80,40,0.15); color: #dc5028; border-color: rgba(220,80,40,0.4); }
.loader-badge.badge-fabric { background: rgba(180,150,100,0.15); color: #b49664; border-color: rgba(180,150,100,0.4); }
.loader-badge.badge-paper { background: rgba(220,180,200,0.15); color: #dcb4c8; border-color: rgba(220,180,200,0.4); }
.loader-badge.badge-vanilla { background: rgba(140,200,140,0.15); color: #8cc88c; border-color: rgba(140,200,140,0.4); }
.loader-badge.badge-wine { background: rgba(180,80,200,0.15); color: #b450c8; border-color: rgba(180,80,200,0.4); }
.loader-badge.badge-docker { background: rgba(13,150,210,0.15); color: #0d96d2; border-color: rgba(13,150,210,0.4); }

/* ===================================================
   v3.3.1 — Responsive mobile (max 640px)
   =================================================== */
@media (max-width: 640px) {

  /* === Layout global === */
  #main {
    margin-left: 0 !important;
    padding: 12px !important;
  }

  /* === Sidebar === */
  #sidebar {
    position: fixed !important;
    left: -260px;
    width: 260px;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: left 0.25s ease;
    /* Force l'opacité — sans !important le bg pouvait être surchargé par
       d'autres règles cascade et laisser apparaître le dashboard derrière. */
    background: var(--bg-1) !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  #sidebar.open {
    left: 0;
  }
  /* Empêche le scroll du main quand la sidebar est ouverte */
  body:has(#sidebar.open) {
    overflow: hidden;
  }
  /* Backdrop plus opaque pour cacher proprement le dashboard derrière */
  #sidebar-overlay {
    background: rgba(0,0,0,0.7) !important;
    backdrop-filter: blur(2px);
  }

  /* === Burger button === */
  #mobile-burger {
    display: flex !important;
  }

  /* === Topbar mobile === */
  .topbar {
    padding: 0 12px;
    height: 52px;
  }

  /* Bug-fix v1.8.2 : le burger (≈46px) est position:fixed à left:10px.
     Sans padding-left compensatoire, #topbar-system se superpose au burger.
     56px = 10px marge burger + 36px bouton + 10px gap visuel. */
  #topbar {
    padding-left: 56px;
  }

  /* === Overlay sidebar === */
  #sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
  }
  #sidebar-overlay.open {
    display: block;
  }

  /* === Page header === */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
  }
  .page-header .btn {
    width: 100%;
    justify-content: center;
  }

  /* === Cards === */
  .server-card-inner {
    padding: 16px !important;
  }
  .server-card {
    margin-bottom: 16px;
  }

  /* === Stats grid === */
  .stats-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stat-box {
    padding: 10px 12px;
  }

  /* === Server actions buttons === */
  .server-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .server-actions .btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }

  /* === Tabs (Minecraft) === */
  .tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
  }

  /* === Modales === */
  .modal {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh;
    overflow-y: auto;
    margin: 0 auto;
  }
  .modal-backdrop {
    align-items: flex-end;
    padding-bottom: 0;
  }

  /* === Tables === */
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }

  /* === Form inputs === */
  .form-input, .form-select, .editor {
    font-size: 16px !important; /* évite le zoom iOS sur focus */
  }

  /* === Buttons général === */
  .btn {
    min-height: 36px;
  }

  /* === Container rows (mods, mondes, etc.) === */
  .container-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .container-row .btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* === Page title === */
  .page-title {
    font-size: 20px;
  }

  /* === Grids de mondes/configs === */
  div[style*="grid-template-columns: 280px"] {
    display: block !important;
  }
  div[style*="grid-template-columns: 280px"] > div {
    margin-bottom: 16px;
  }
}

/* === Fix padding-top mobile pour le burger === */
@media (max-width: 640px) {
  #main {
    padding-top: 60px !important;
  }
}

/* === Fix port + tabs mobile === */
@media (max-width: 640px) {
  .server-meta {
    display: none;
  }
  .tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    flex-shrink: 0;
  }
}

/* === Login background animé === */
.login-page-wrap {
  position: relative;
  overflow: hidden;
}
.login-page-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(59,130,246,0.08) 0%, transparent 50%);
  animation: login-bg-shift 12s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
.login-page-wrap > * { position: relative; z-index: 1; }
@keyframes login-bg-shift {
  0%   { opacity: 1; transform: scale(1) rotate(0deg); }
  50%  { opacity: 0.8; transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* === Toast out animation === */
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* === Spin animation === */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* === Masque scrollbar sur les pages serveur === */
#page-minecraft, #page-conan, #page-satisfactory, #page-system, #page-logs, #page-docker {
  overflow-x: hidden;
  max-width: 100%;
}

/* === Docker page — onglets segmentés === */
.docker-tab {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.docker-tab:hover { color: var(--text-1); }
.docker-tab.active {
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border);
}
/* === Masque scrollbar horizontale des tabs === */
.tabs {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

/* v1.1.0 — Force 1 colonne sur mobile (sinon cards trop serrées) */
@media (max-width: 768px) {
  .servers-grid { grid-template-columns: 1fr !important; }
}

/* Viewport intermédiaire 641-959px : sidebar 240px + contenu ~700-720px.
 * Le .server-card-inner a 72px de padding H total (36px×2) — sur une carte
 * ~700px ça laisse ~628px de contenu. Le header (icône 52px + gap 14px +
 * info + gap 14px + badges ~80px) tient à peine. Pour éviter le débordement
 * des badges "EN LIGNE"/"DOCKER" on réduit le padding à 20px×2 = 40px total,
 * ce qui libère ~692px de contenu (confort suffisant pour header + stats). */
@media (min-width: 641px) and (max-width: 959px) {
  .server-card-inner {
    padding: 20px !important;
  }
}

/* v1.1.0 — Fix overlap burger + logo sidebar sur mobile.
   Breakpoint aligné sur 640px (= breakpoint du burger) pour ne pas
   réserver d'espace inutile entre 641-768px où le burger n'est pas visible. */
@media (max-width: 640px) {
  .sidebar-logo {
    padding-left: 56px !important; /* laisse la place au burger 44px + marge */
  }
}

/* ====================================================================
 * v1.7.0 — Instances Minecraft (Palier 2)
 * ==================================================================== */

/* --- Header dropdown sélecteur d'instance --- */
.mc-inst-header-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.mc-inst-badge-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-1);
  user-select: none;
  transition: border-color 0.15s;
}
.mc-inst-badge-toggle:hover { border-color: var(--accent); }
.mc-inst-icon { font-size: 14px; }
.mc-inst-active-name { font-weight: 600; }
.mc-inst-arrow { font-size: 10px; opacity: 0.6; }

.mc-inst-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 260px;
  max-width: 360px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  overflow: hidden;
}
.mc-inst-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-1);
  transition: background 0.1s;
}
.mc-inst-option:hover { background: var(--bg-3); }
.mc-inst-option.mc-inst-active { background: var(--accent-dim, rgba(0,200,200,0.1)); }
.mc-inst-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-active   { background: var(--success, #4caf50); }
.dot-inactive { background: var(--border); }
.mc-inst-label { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-inst-type  { font-size: 10px; color: var(--text-2); background: var(--bg-3); padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
.mc-inst-dropdown-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  text-align: right;
}

/* --- Cards d'instances dans la vue liste --- */
.mc-inst-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--bg-2);
  transition: border-color 0.15s;
}
.mc-inst-card:hover { border-color: var(--accent); }
.mc-inst-card-active {
  border-color: var(--success, #4caf50);
  background: var(--accent-dim, rgba(0,200,200,0.06));
}
.mc-inst-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.mc-inst-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mc-inst-active-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success, #4caf50);
  display: inline-block;
  flex-shrink: 0;
}
.mc-inst-type-badge {
  font-size: 10px;
  background: var(--accent-dim, rgba(0,200,200,0.15));
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}
.mc-inst-version {
  font-size: 11px;
  color: var(--text-2);
}
.mc-inst-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-2);
  flex-shrink: 0;
}
.mc-inst-notes {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-style: italic;
}
.mc-inst-source {
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.mc-inst-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}
.mc-inst-active-label {
  font-size: 12px;
  color: var(--success, #4caf50);
  font-weight: 600;
  padding: 4px 8px;
}

/* ====================================================================
 * v1.8.0 — Navigation MC refonte (Palier 3)
 * ==================================================================== */

/* --- Badge header fusionné instance + modpack --- */
.mc-hbadge-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 6px;
  min-height: 30px;
}
.mc-hbadge-sep {
  color: var(--text-2);
  padding: 0 4px;
  font-size: 13px;
  user-select: none;
}
.mc-hbadge-item {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}
.mc-hbadge-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}
.mc-hbadge-modpack-on {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.30);
  color: #22c55e;
  cursor: pointer;
}
.mc-hbadge-modpack-on:hover { background: rgba(34, 197, 94, 0.18); }
.mc-hbadge-modpack-off {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  cursor: pointer;
}
.mc-hbadge-modpack-off:hover { background: rgba(245, 158, 11, 0.15); }
/* Le sélecteur d'instance dans le badge fusionné hérite des styles mc-inst-badge-toggle */
.mc-hbadge-instance {
  /* padding légèrement réduit pour rester compact dans la barre */
  padding: 3px 10px;
}

/* --- Segmented controls intra-panneau (Contenu / Admin) --- */
.mc-seg-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mc-seg-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.mc-seg-btn:hover {
  background: var(--bg-3);
  color: var(--text-1);
}
.mc-seg-btn.active {
  background: var(--accent-dim, rgba(0, 200, 200, 0.15));
  border-color: var(--accent, #00c8c8);
  color: var(--accent, #00c8c8);
  font-weight: 600;
}

/* --- Sous-panneaux des groupes Contenu / Admin --- */
.mc-sub-panel {
  display: none;
}
.mc-sub-panel.active {
  display: block;
}

/* --- Section avancée "Profils legacy" dans Configuration --- */
.mc-config-advanced {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  overflow: hidden;
}
.mc-config-advanced-summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.mc-config-advanced-summary::-webkit-details-marker { display: none; }
.mc-config-advanced-summary::before {
  content: '▶';
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}
.mc-config-advanced[open] .mc-config-advanced-summary::before {
  transform: rotate(90deg);
}
.mc-config-advanced-summary:hover {
  color: var(--text-1);
  background: var(--bg-3);
}
.mc-config-advanced > div {
  padding: 0 14px 14px;
}

/* ====================================================================
 * Option A — Dashboard multi-instances Minecraft (PR-B 2026-05-18)
 * Compatible avec les 6 themes : v1, classic, winter, spring, summer, autumn
 * ==================================================================== */

/* --- Résumé global au-dessus de la grille --- */
.mc-summary-card {
  margin-bottom: 14px;
}
.mc-summary-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.mc-summary-sep   { color: var(--text-2); opacity: 0.5; }
.mc-summary-total { font-weight: 600; color: var(--text-1); }
.mc-summary-up    { color: var(--success, #4caf50); font-weight: 600; }
.mc-summary-down  { color: var(--text-2); }
.mc-summary-ram   { color: var(--text-2); font-size: 12px; }
.mc-summary-warn  {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
}

/* --- Grille des cards --- */
.mc-instances-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 768px) {
  .mc-instances-grid { grid-template-columns: 1fr; }
}

/* --- Bandeau d'alerte fantomes (residus de creation/cleanup partiel) --- */
.mc-orphans-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--amber, #f59e0b) 35%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber, #f59e0b) 8%, transparent);
}
.mc-orphans-icon {
  font-size: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--amber, #f59e0b) 40%, transparent));
}
.mc-orphans-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--amber, #f59e0b) 75%, var(--text-0) 25%);
}
.mc-orphans-text strong {
  display: block;
  color: var(--amber, #f59e0b);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 2px;
}
.mc-orphans-ids {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-left: 4px;
}
.mc-orphans-ids code {
  background: rgba(0,0,0,0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  color: var(--text-2);
}

/* --- Card d'instance --- */
.mc-instance-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
  animation: mc-card-fadein 0.2s ease;
}
.mc-instance-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.mc-card-transitioning {
  opacity: 0.65;
  pointer-events: none;
}

@keyframes mc-card-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Header de card : titre + bouton principal --- */
.mc-card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mc-card-title-block {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.mc-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}
.mc-card-version-badge {
  font-size: 10px;
  background: var(--accent-dim, rgba(0, 200, 200, 0.15));
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.mc-card-ctrl-block {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  align-items: center;
}

/* --- LED statut --- */
.mc-instance-status-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.mc-led-online {
  background: var(--success, #4caf50);
  box-shadow: 0 0 5px var(--success, #4caf50);
  animation: mc-led-pulse 2s ease-in-out infinite;
}
.mc-led-offline {
  background: var(--border);
}
.mc-led-transitioning {
  background: #f59e0b;
  animation: mc-led-pulse-fast 0.8s ease-in-out infinite;
}
@keyframes mc-led-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
@keyframes mc-led-pulse-fast {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* --- Ligne ports --- */
.mc-card-ports-row {
  font-size: 11px;
  color: var(--text-2);
}

/* --- Ligne statut + uptime --- */
.mc-card-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mc-card-status-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.mc-card-uptime {
  font-size: 11px;
  color: var(--text-2);
  opacity: 0.7;
}

/* --- Ligne métriques (CPU / RAM / Joueurs / Disque) --- */
.mc-card-metrics-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
}
.mc-card-sep { opacity: 0.4; }

/* --- Ligne boutons d'actions secondaires --- */
.mc-instance-action-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}
.mc-instance-action-row .btn-sm {
  font-size: 11px;
  padding: 3px 9px;
}
.mc-instance-action-row .btn-sm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* --- Pied de card (dates) --- */
.mc-card-footer-row {
  font-size: 10px;
  color: var(--text-2);
  opacity: 0.6;
  margin-top: 2px;
}

/* --- État vide --- */
.mc-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-2);
}
.mc-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.35;
  font-family: monospace;
}
.mc-empty-state p { margin-bottom: 16px; }

/* --- Placeholder chargement --- */
.mc-loading-placeholder {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}

/* --- Formulaire inline renommage --- */
.mc-inline-rename {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.mc-rename-input { flex: 1; min-width: 120px; }

/* --- Menu "..." (more actions) --- */
.mc-more-menu {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 7px;
}

/* --- Modal création instance --- */
/* .modal-backdrop et .modal déjà définis globalement — on étend pour MC */
.mc-create-modal-box {
  width: 580px;
  max-width: 100%;
}
.mc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.mc-modal-header .modal-title { margin-bottom: 0; }
.mc-create-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .mc-create-form-grid { grid-template-columns: 1fr; }
}
.mc-form-label-full { grid-column: 1 / -1; }
.form-hint {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
  display: block;
}
.required-star { color: var(--error, #ef4444); }
.mc-version-input:invalid { border-color: var(--warn, #f59e0b); }

/* ═══════════════════════════════════════════════════
   Features secondaires instances MC (Console / Mondes / Mods / Fichiers / Config)
   ═══════════════════════════════════════════════════ */

/* Backdrop commun aux features secondaires */
.mc-feat-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 24px;
}

/* Modale feature — base */
.mc-feat-modal {
  width: 700px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Console — grande taille */
.mc-console-modal {
  width: 82vw;
  max-width: 1100px;
  min-height: 60vh;
}

/* Fichiers — layout 2 colonnes */
.mc-files-modal {
  width: 90vw;
  max-width: 1200px;
  min-height: 65vh;
}

/* Zone output console (terminal-like) */
.mc-console-output {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: #c8ffc8;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  min-height: 300px;
  max-height: 55vh;
  margin-bottom: 8px;
}

/* Ligne d'input RCON */
.mc-console-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mc-console-cmd-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Liste générique features (mondes / mods) */
.mc-feat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 0;
}
.mc-feat-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-3, var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 7px;
}
.mc-feat-list-name {
  flex: 1;
  font-size: 13px;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-1);
}
.mc-feat-list-meta {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Hint texte bas de modale */
.mc-feat-hint {
  font-size: 11px;
  color: var(--text-2);
  opacity: 0.7;
  margin-top: 8px;
}

/* Browser fichiers — layout 2 colonnes */
.mc-files-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 700px) {
  .mc-files-layout { grid-template-columns: 1fr; }
}
.mc-files-tree {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  overflow-y: auto;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--bg-3, var(--bg-2));
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mc-files-content {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  overflow: auto;
  background: var(--bg-3, var(--bg-2));
}
.mc-files-entry {
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-files-entry-dir {
  color: var(--accent);
}
.mc-files-entry-dir:hover {
  background: var(--accent-dim, rgba(0,200,200,0.1));
}
.mc-files-entry-text {
  color: var(--text-1);
}
.mc-files-entry-text:hover {
  background: rgba(255,255,255,0.06);
}
.mc-files-entry-binary {
  color: var(--text-2);
  opacity: 0.6;
  cursor: default;
}
.mc-files-meta {
  margin-left: 6px;
  color: var(--text-2);
  font-size: 10px;
}
.mc-files-breadcrumb {
  font-size: 11px;
  color: var(--text-2);
  font-family: var(--font-mono);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-files-viewer {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

/* Config — textarea editor */
.mc-config-modal {
  width: 700px;
  max-width: 96vw;
}
.mc-config-editor {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  background: #0d0d0d;
  color: #c8ffc8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  box-sizing: border-box;
  max-height: 55vh;
  overflow-y: auto;
}
.mc-config-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.mc-config-restart-hint {
  color: var(--warn, #f59e0b);
  opacity: 0.9;
}

/* Wave 2 — bouton extra-small */
.btn-xs {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  line-height: 1.4;
}

/* Wave 2 — suppression inline dans le tree */
.mc-files-del-btn {
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.mc-files-entry:hover .mc-files-del-btn {
  opacity: 1;
}

/* Wave 2 — modale modpack search (dans contexte instance) */
.mc-modpack-modal {
  max-width: 760px;
  width: 90vw;
}
/* Le body de la modale modpack doit prendre toute la hauteur restante et scroller
   verticalement, sinon les resultats sont tronques par overflow:hidden de
   .mc-feat-modal et le user ne peut pas voir > 5-6 modpacks (signale 2026-05-18 :
   "Je ne peux pas parcourir les modpacks"). */
.mc-modpack-body-scrollable {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

/* ============================================================
   Gestionnaire de fichiers v2 — tableau plein écran + éditeur
   ============================================================ */
.mc-files-v2-modal {
  width: 92vw;
  max-width: 1100px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Barre du haut : titre + breadcrumb + toolbar */
.mc-files-v2-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.mc-files-v2-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1);
  white-space: nowrap;
}
.mc-files-v2-breadcrumb-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.mc-files-v2-breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.mc-files-v2-crumb-seg {
  color: var(--accent);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.mc-files-v2-crumb-seg:hover { background: var(--accent-dim, rgba(99,102,241,0.12)); }
.mc-files-v2-crumb-root { color: var(--text-2); }
.mc-files-v2-crumb-active { color: var(--text-1); cursor: default; font-weight: 600; }
.mc-files-v2-crumb-active:hover { background: none; }
.mc-files-v2-crumb-sep { color: var(--text-3); padding: 0 1px; font-size: 11px; }
.mc-files-v2-toolbar {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.mc-files-v2-upload-btn { cursor: pointer; }

/* Corps : table + panneau éditeur côte à côte */
.mc-files-v2-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.mc-files-v2-table-wrap {
  flex: 1;
  overflow-y: auto;
  transition: opacity 0.15s ease;
}
.mc-files-v2-fade-in { animation: mcFilesV2FadeIn 0.15s ease; }
@keyframes mcFilesV2FadeIn {
  from { opacity: 0.4; transform: translateY(4px); }
  to   { opacity: 1;   transform: translateY(0); }
}

/* Table */
.mc-files-v2-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}
.mc-files-v2-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  color: var(--text-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
  z-index: 1;
}
.mc-files-v2-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.1s;
}
.mc-files-v2-row:hover { background: rgba(255,255,255,0.04); }
.mc-files-v2-row-dir { cursor: pointer; }
.mc-files-v2-row-dir:hover { background: rgba(99,102,241,0.08); }
.mc-files-v2-cell-name {
  padding: 8px 12px;
  color: var(--text-1);
  cursor: pointer;
  max-width: 320px;
  overflow: hidden;
}
.mc-files-v2-row-dir .mc-files-v2-cell-name { color: var(--accent); }
.mc-files-v2-icon { margin-right: 7px; font-style: normal; }
.mc-files-v2-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  max-width: calc(100% - 24px);
  vertical-align: middle;
}
.mc-files-v2-cell-size {
  padding: 8px 12px;
  color: var(--text-2);
  white-space: nowrap;
  font-size: 11px;
  min-width: 70px;
}
.mc-files-v2-cell-date {
  padding: 8px 12px;
  color: var(--text-2);
  white-space: nowrap;
  font-size: 11px;
  min-width: 110px;
}
.mc-files-v2-cell-actions {
  padding: 6px 10px;
  text-align: right;
  white-space: nowrap;
  min-width: 110px;
  opacity: 0;
  transition: opacity 0.1s;
}
.mc-files-v2-row:hover .mc-files-v2-cell-actions { opacity: 1; }

.mc-files-v2-loading, .mc-files-v2-empty, .mc-files-v2-error {
  padding: 32px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.mc-files-v2-error { color: var(--error, #ef4444); }

/* Panneau éditeur slide-in depuis la droite */
.mc-files-v2-editor-panel {
  width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-1);
  transition: width 0.25s ease;
  flex-shrink: 0;
}
.mc-files-v2-editor-panel.open {
  width: 45%;
  min-width: 300px;
}
/* v1.10.x : panneau editeur permanent (45%) avec placeholder par defaut.
   Evite le grand vide a droite de la table quand aucun fichier n'est ouvert.
   Demande user 2026-05-18 : "espace a droite vide trop grand, ca fait bizarre". */
.mc-files-v2-editor-persistent {
  width: 45%;
  min-width: 320px;
  transition: none;
}
.mc-files-v2-editor-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 10px;
  color: var(--text-3);
}
.mc-files-v2-editor-placeholder-icon {
  font-size: 48px;
  opacity: 0.45;
  margin-bottom: 4px;
}
.mc-files-v2-editor-placeholder-title {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}
.mc-files-v2-editor-placeholder-hint {
  font-size: 12px;
  color: var(--text-3);
  max-width: 280px;
  line-height: 1.4;
}
.mc-files-v2-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.mc-files-v2-editor-filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-1);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.mc-files-v2-editor-loading {
  padding: 24px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.mc-files-v2-editor-textarea {
  flex: 1;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  background: #0d0d0d;
  color: #c8ffc8;
  border: none;
  border-radius: 0;
  padding: 14px 16px;
  resize: none;
  outline: none;
  box-sizing: border-box;
  overflow-y: auto;
}
.mc-files-v2-editor-textarea:focus { outline: none; }

/* Zone 4 — suppression min-height console sur sys-procs */
#sys-procs { min-height: unset !important; height: auto; }

/* Wave 2 — section dashboard MC instances */
.mc-dash-section {
  margin-top: 24px;
}
.mc-dash-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 10px;
  padding: 0 2px;
}
.mc-dash-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.mc-dash-card {
  background: var(--bg-2, #1e1e2e);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s;
}
.mc-dash-card:hover {
  border-color: var(--accent, #6366f1);
}
.mc-dash-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.mc-dash-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mc-dash-led-online  { background: var(--green, #22c55e); box-shadow: 0 0 6px var(--green, #22c55e); }
.mc-dash-led-offline { background: var(--text-3, #555); }
.mc-dash-name {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-dash-badge {
  font-size: 11px;
  background: rgba(99,102,241,0.15);
  color: var(--accent, #6366f1);
  padding: 1px 7px;
  border-radius: 9px;
  white-space: nowrap;
}
.mc-dash-status {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-2);
}
.mc-dash-connect {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.mc-dash-connect-addr {
  flex: 1;
  color: var(--text-1);
  user-select: all;
}
.mc-dash-connect-offline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  flex-wrap: wrap;
}

