/* ==========================================================================
   RESET & VARIABLES
   ========================================================================== */

* {
  box-sizing: border-box;
}

:root {
  --bg: #080c11;
  --panel: #10161e;
  --panel2: #151c25;
  --border: #232d39;
  --text: #eef3f8;
  --muted: #8995a5;
  --accent: #57d66d;
  --danger: #ff5d68;
  --blue: #5da9ff;
  --shadow: 0 16px 45px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   BASE / TYPOGRAPHY
   ========================================================================== */

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow-x: hidden;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.mini-info {
  font-size: 12px;
  color: var(--muted);
  padding-top: 8px;
}

/* ==========================================================================
   PAGE DE LOGIN - STYLES AVEC FOND MINECRAFT
   ========================================================================== */

.section#login {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden; /* Pour contenir le flou du background */
}

.section#login:not(.active) {
  display: none;
}

/* Fond animé : dégradé façon "monde Minecraft" + blocs pixel-art qui tombent */
.login-background {
  position: absolute;
  inset: -20px;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #1a2a3d 0%, #0f1a26 45%, #0b0f14 100%);
}

.login-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(87, 214, 109, 0.08), transparent 60%);
}

.mc-block {
  position: absolute;
  top: -10%;
  display: block;
  image-rendering: pixelated;
  opacity: 0.55;
  animation-name: mc-fall, mc-spin;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

/* Paysage statique (immobile) façon collines blocky, posé derrière les blocs qui tombent */
.login-landscape {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 0;
}

.login-landscape .hill-back,
.login-landscape .hill-front {
  position: absolute;
  inset: 0;
}

.login-landscape .hill-back {
  background: #16222f;
  clip-path: polygon(0% 100%, 0% 62%, 8% 55%, 16% 66%, 24% 50%, 32% 60%, 40% 46%, 48% 58%, 56% 48%, 64% 60%, 72% 52%, 80% 62%, 88% 50%, 96% 58%, 100% 52%, 100% 100%);
}

.login-landscape .hill-front {
  top: 14%;
  background: #0d1520;
  clip-path: polygon(0% 100%, 0% 76%, 10% 68%, 20% 78%, 30% 64%, 40% 76%, 50% 62%, 60% 74%, 70% 65%, 80% 78%, 90% 68%, 100% 76%, 100% 100%);
}

.login-moon {
  position: absolute;
  top: 9%;
  right: 13%;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: #dfe8ee;
  box-shadow: 0 0 50px rgba(223, 232, 238, 0.3);
  z-index: 0;
}

/* Textures pixel-art simplifiées via dégradés en damier */
.block-grass {
  background:
    linear-gradient(180deg, #5c9e3f 0 30%, #7a5232 30% 100%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15), inset 3px 3px 0 rgba(255,255,255,0.12);
}
.block-dirt {
  background: #7a5232;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.2), inset -3px -3px 0 rgba(0,0,0,0.15);
}
.block-stone {
  background: #7c7c7c;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25), inset 3px 3px 0 rgba(255,255,255,0.08);
}
.block-oak {
  background:
    repeating-linear-gradient(90deg, #6b4a2c 0 4px, #5a3d24 4px 8px);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.25);
}

@keyframes mc-fall {
  from { top: -10%; }
  to { top: 110%; }
}

@keyframes mc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(calc(360deg * var(--spin, 1))); }
}

.login-card {
  width: 100%;
  max-width: 380px;
  /* Fond légèrement transparent pour laisser deviner le background */
  background: rgba(16, 22, 30, 0.85); 
  backdrop-filter: blur(10px); /* Flou supplémentaire sous la carte pour l'effet verre */
  border: 1px solid rgba(35, 45, 57, 0.5);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative; /* Pour le z-index */
  z-index: 1;
}

.login-card .brand-mark {
  margin: 0 auto 16px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--text);
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
  text-align: left;
}

.login-card form div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-card input {
  width: 100%;
  background: rgba(11, 17, 23, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s, background-color 0.2s;
}

.login-card input:focus {
  border-color: var(--accent);
  background: rgba(11, 17, 23, 0.9);
}

.login-card .btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
}

/* ==========================================================================
   LAYOUT SHELL & SIDEBAR
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 255px;
  background: #0b1016;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 30px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #071008;
  font-weight: 900;
  font-size: 18px;
}

.brand strong { display: block; }
.brand span { font-size: 12px; color: var(--muted); margin-top: 3px; display: block;}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #9aa5b4;
  text-align: left;
  padding: 12px 13px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  transition: background 0.2s, color 0.2s;
}

.nav-item span {
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  background: #171f29;
  color: #fff;
}

.nav-item.active {
  background: #171f29;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #10161d;
}

.sidebar-user-info {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.sidebar-user-info strong { display: block; }
.sidebar-user-info span { color: var(--muted); }

.btn-logout {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.05);
  color: var(--danger);
}

/* ==========================================================================
   MAIN CONTENT & TOPBAR
   ========================================================================== */

.main {
  margin-left: 255px;
  width: calc(100% - 255px);
  min-width: 0;
}

.topbar {
  height: 88px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  top: 0;
  background: rgba(8, 12, 17, 0.9);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 22px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-btn,
.server-pill {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  height: 38px;
  border-radius: 10px;
  transition: border-color 0.2s;
}

.icon-btn {
  width: 38px;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

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

.server-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 13px;
}

.content {
  padding: 30px 34px 50px;
  max-width: 1500px;
  margin: auto;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.mobile-menu {
  display: none;
}

/* ==========================================================================
   UI COMPONENTS (BUTTONS, CARDS, BADGES)
   ========================================================================== */

.btn {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 14px;
  color: #fff;
  background: #18212b;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: filter 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn.primary {
  background: var(--accent);
  color: #071008;
  border-color: var(--accent);
}

.btn.danger {
  background: #32171b;
  color: #ff9097;
  border-color: #5b252c;
}

.btn.secondary {
  background: #1c2631;
}

.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.text-btn {
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.text-btn:hover { text-decoration: underline; }

.badge {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
  background: #1b2730;
  color: #b9c5d0;
}

.badge.good {
  background: #122a19;
  color: #71df85;
}

.connection-dot,
.status-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 10px rgba(87, 214, 109, 0.5);
}

/* Voyant du statut serveur (topbar + carte principale) : agrandi et pulsant
   pour être visible au premier coup d'œil. */
.hero-status .status-dot,
.server-pill .status-dot {
  width: 13px;
  height: 13px;
  box-shadow: 0 0 0 4px rgba(87, 214, 109, 0.18), 0 0 14px rgba(87, 214, 109, 0.65);
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* ==========================================================================
   HERO CARD & SERVER DETAILS
   ========================================================================== */

.hero-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background-image: linear-gradient(115deg, rgba(8, 12, 12, 0.88) 0%, rgba(8, 12, 12, 0.55) 55%, rgba(8, 12, 12, 0.35) 100%), url('assets/dashboard-bg.jpg');
  background-size: cover;
  background-position: center 30%;
  padding: 27px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
}

.hero-status {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-card h2 {
  font-size: 27px;
  margin: 10px 0 5px;
}

.server-address {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.server-address span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #090d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}

.copy-btn {
  border: 0;
  background: #1c2631;
  color: #dce6ef;
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
  font-size: 12px;
}

.copy-btn:hover { background: #253241; }

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 140px;
}

.hero-actions .btn { width: 100%; }

/* ==========================================================================
   GRIDS & PANELS
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.stat-card,
.panel-card,
.page-card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 14px;
}

.stat-card {
  padding: 18px;
}

.stat-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  margin: 13px 0 10px;
  font-size: 24px;
  font-weight: 700;
}

.stat-value span {
  font-size: 14px;
  color: var(--muted);
  margin-left: 4px;
  font-weight: 400;
}

.progress {
  height: 6px;
  background: #202a35;
  border-radius: 10px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.panel-card {
  padding: 20px;
}

.card-title,
.page-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.card-title h3,
.page-card-head h2 {
  margin: 0;
  font-size: 16px;
}

.card-title span { color: var(--muted); font-size: 13px; }

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.metric-row:last-child { border: 0; padding-bottom: 0; }
.metric-row span { color: var(--muted); }

/* ==========================================================================
   NETWORK & CHARTS
   ========================================================================== */

.network {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.network div {
  background: #0c1218;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.network span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.network strong { font-size: 15px; }

.network-chart {
  height: 76px;
  margin-top: 13px;
  background: #0c1218;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
}

.bars {
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.bars i {
  flex: 1;
  background: #2b8f43;
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
  transition: height 0.2s ease;
}

/* ==========================================================================
   LISTS & TABLES (PLAYERS, ACTIVITY)
   ========================================================================== */

.player-list,
.activity {
  margin-top: -5px;
}

.player-row,
.activity-row,
.backup-row,
.table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.player-row:last-child,
.activity-row:last-child,
.backup-row:last-child { border: 0; }

.player-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1d2935;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  border: 1px solid var(--border);
}

.player-main strong { display: block; }
.player-main span,
.activity-row span,
.backup-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.players-table {
  margin-top: 5px;
}

.players-table .table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.players-table .table-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 14px 10px;
}

/* ==========================================================================
   CONSOLE
   ========================================================================== */

.page-card {
  padding: 22px;
}

.page-card-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.page-card-head h2 { font-size: 20px; }
.page-card-head span { color: var(--muted); font-size: 14px; margin-top: 4px; display: block;}

.console-window {
  height: 480px;
  margin-top: 16px;
  background: #06090d;
  border: 1px solid #1c2530;
  border-radius: 10px;
  padding: 15px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #b8c5d2;
  scrollbar-width: thin;
  scrollbar-color: #232d39 #06090d;
}

.log-time { color: #6f7d8d; }
.log-info { color: #b9d7bd; }
.log-warn { color: #e5c37a; font-weight: 600;}
.log-error { color: #ff6b6b; font-weight: 600; }
.log-join { color: #7fd3ff; }

.command-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  background: #0c1218;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
}

.command-form input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  padding: 4px;
}

.prompt {
  padding-left: 8px;
  color: var(--accent);
  font-family: monospace;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ==========================================================================
   AUTRES SECTIONS (SETTINGS, FILES, BACKUPS)
   ========================================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 25px;
}

.settings-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-grid input {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: #0b1117;
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  outline: 0;
  font-size: 14px;
}
.settings-grid input:focus { border-color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 15px;
  color: #3b4754;
}

.empty-state h3 { color: #fff; margin: 0 0 8px; font-size: 18px;}

.backup-list { margin-top: 10px; }
.backup-row strong { display: block; font-size: 14px; }

.machine-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.dot-cpu { background: #57d66d; }
.dot-ram { background: #5da9ff; }
.dot-tps { background: #f5a623; }

.history-chart {
  width: 100%;
  height: 200px;
  margin-top: 10px;
  display: block;
}

.chart-legend {
  display: flex;
  gap: 20px;
  margin: 18px 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.chart-legend .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot-cpu { background: #57d66d; }
.dot-ram { background: #5da9ff; }
.dot-tps { background: #e5a53a; }

.history-chart {
  width: 100%;
  height: 220px;
  display: block;
  background: #0b1117;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.machine-info div {
  background: #0c1218;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.machine-info span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.machine-info strong { font-size: 14px; }

.users-head,
.users-row {
  grid-template-columns: 2fr 1fr 1fr auto !important;
  align-items: center;
}

.users-row .btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.notice code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #0b1117;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: auto;
}

.checkbox-label.compact {
  padding: 8px 12px;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.log-reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.log-reset-row strong { display: block; font-size: 14px; }
.log-reset-row span { font-size: 12px; }

.console-access-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(93, 169, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(93, 169, 255, 0.25);
  white-space: nowrap;
}

.role-select-inline {
  background: #0b1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.chat-unread-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: 6px;
}

.chat-window {
  height: 420px;
  overflow-y: auto;
  background: #0b1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 80%;
  background: #131c25;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}

.chat-message.own {
  align-self: flex-end;
  background: rgba(87, 214, 109, 0.12);
  border-color: rgba(87, 214, 109, 0.3);
}

.chat-message .chat-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  display: flex;
  gap: 8px;
}

.chat-message .chat-meta strong { color: var(--text); }

.players-mod-row {
  grid-template-columns: 2fr 1fr auto !important;
  align-items: center;
}

.player-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.config-editor {
  width: 100%;
  min-height: 380px;
  background: #0b1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.map-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 200px);
}

#mapContainer {
  flex: 1;
  margin-top: 14px;
}

.map-frame {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0b1117;
}

.notice {
  margin-top: 25px;
  padding: 15px;
  border-radius: 9px;
  background: rgba(87, 214, 109, 0.05);
  border: 1px solid rgba(87, 214, 109, 0.15);
  color: #a7e9b3;
  font-size: 13px;
  line-height: 1.5;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #eef3f8;
  color: #071008;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================================== */

/* Laptop / Desktop Intermédiaire (<= 1000px) */
@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-columns { grid-template-columns: 1fr; }
  .sidebar { width: 230px; }
  .main { margin-left: 230px; width: calc(100% - 230px); }
}

/* Tablette (<= 768px) */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 260px;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; width: 100%; }

  .topbar { height: 72px; padding: 0 16px; }

  .mobile-menu {
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--panel);
    color: #fff;
    border-radius: 9px;
    width: 38px;
    height: 38px;
    margin-right: 12px;
    cursor: pointer;
  }

  .topbar h1 { font-size: 18px; }
  .topbar .eyebrow { display: none; }

  .server-pill span:last-child { display: none; }
  .server-pill { padding: 0 10px; }

  .content { padding: 20px 16px 40px; }

  .hero-card {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .hero-card h2 { font-size: 22px; }

  .hero-actions {
    margin-top: 15px;
    width: 100%;
    flex-direction: row;
  }

  .server-address { max-width: 100%; overflow: hidden;}
  .server-address span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
  }

  .stats-grid { gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 20px; }

  .players-table { overflow-x: auto; }
  .players-table .table-head,
  .players-table .table-row { min-width: 550px; }

  .console-window { height: 400px; }

  .machine-info { grid-template-columns: 1fr 1fr; }
}

/* Mobile Étroit (<= 480px) */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .server-address .copy-btn { display: none; }
  .settings-grid { grid-template-columns: 1fr; gap: 15px;}
  .login-card { padding: 25px 20px; }
  .network strong { font-size: 13px; }
  .machine-info { grid-template-columns: 1fr; }
}