/**
 * style.css — DSF Panel Pro · Premium Dashboard Theme
 * Finition portfolio : scrollbar custom, pulse live, états disabled, harmonisation header.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base:        #09090b;
  --bg-surface:     #111113;
  --bg-raised:      #18181b;
  --bg-overlay:     #1f1f23;
  --bg-hover:       #27272a;
  --bg-disabled:    #141416;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary:  #64748b;
  --text-disabled:  #4b5563;

  --accent-green:       #10b981;
  --accent-green-dim:   rgba(16, 185, 129, 0.12);
  --accent-green-ring:  rgba(16, 185, 129, 0.3);
  --accent-green-glow:  rgba(16, 185, 129, 0.45);
  --accent-red:         #f43f5e;
  --accent-red-dim:     rgba(244, 63, 94, 0.12);
  --accent-red-ring:    rgba(244, 63, 94, 0.3);
  --accent-blue:        #3b82f6;
  --accent-blue-dim:    rgba(59, 130, 246, 0.12);
  --accent-blue-ring:   rgba(59, 130, 246, 0.35);
  --accent-cyan:        #06b6d4;
  --accent-purple:      #8b5cf6;

  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.09);
  --border-strong:  rgba(255, 255, 255, 0.14);

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:      0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg:      0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-inset:   inset 0 1px 0 rgba(255, 255, 255, 0.04);

  --console-bg:     #05070f;
  --console-header: #0c1018;
  --scrollbar-track:#05070f;
  --scrollbar-thumb:#222f4c;

  --sidebar-width:  360px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;

  --font-ui:   'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 180ms;

  --header-chip-bg:     var(--bg-raised);
  --header-chip-border: var(--border-subtle);
  --header-chip-radius: var(--radius-md);
  --header-chip-padding: 8px 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  background-color: #09090b;
}

body {
  min-height: 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: transparent;
  position: relative;
  isolation: isolate;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 90% 70% at 50% -15%, rgba(99, 102, 241, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 50%, rgba(139, 92, 246, 0.04), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(16, 185, 129, 0.03), transparent 45%),
    linear-gradient(180deg, #0c0c0e 0%, #09090b 45%, #070708 100%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

@keyframes pulseGreen {
  0%, 100% {
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.15), 0 0 14px rgba(16, 185, 129, 0.08);
  }
  50% {
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35), 0 0 28px rgba(16, 185, 129, 0.2), 0 0 42px rgba(16, 185, 129, 0.08);
  }
}

@keyframes dotGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(0.88); }
}

.app {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 22px;
  background: rgba(17, 17, 19, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.header__brand { display: flex; align-items: center; gap: 14px; }

.header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.header h1 { font-size: 1.05rem; font-weight: 700; }
.header__subtitle { font-size: 0.78rem; color: var(--text-tertiary); }

.header__controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 200px;
  max-width: 280px;
}

.server-select-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
}

.server-select {
  appearance: none;
  width: 100%;
  padding: var(--header-chip-padding);
  padding-right: 36px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-primary);
  background: var(--header-chip-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--header-chip-border);
  border-radius: var(--header-chip-radius);
  cursor: pointer;
}

.header__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--header-chip-padding);
  background: var(--header-chip-bg);
  border: 1px solid var(--header-chip-border);
  border-radius: var(--header-chip-radius);
}

.header__daemon-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.header__daemon-url {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
}

.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 22px;
  flex: 1;
  align-items: start;
}

.control-panel { display: flex; flex-direction: column; gap: 14px; }

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.card {
  background: rgba(17, 17, 19, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}

.card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.card__title::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent-blue);
  opacity: 0.8;
}

/* ─── Status badge ──────────────────────────────────────────────── */

.status-indicator { display: flex; justify-content: center; margin-bottom: 12px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  border: 1px solid transparent;
  transition:
    background var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out),
    color var(--duration) var(--ease-out);
}

.status-badge--online {
  color: var(--accent-green);
  background: var(--accent-green-dim);
  border-color: var(--accent-green-ring);
  animation: pulseGreen 2s ease-in-out infinite;
}

.status-badge--offline {
  color: var(--accent-red);
  background: var(--accent-red-dim);
  border-color: var(--accent-red-ring);
  box-shadow: none;
  animation: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-badge--online .status-dot {
  box-shadow: 0 0 8px var(--accent-green-glow);
  animation: dotGlow 2s ease-in-out infinite;
}

.status-badge--offline .status-dot {
  box-shadow: 0 0 0 3px var(--accent-red-ring);
  animation: none;
}

.status-detail {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.server-label {
  text-align: center;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

/* ─── Buttons ───────────────────────────────────────────────────── */

.actions { display: flex; flex-direction: column; gap: 8px; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--text-primary);
  transition:
    background var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out),
    opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    filter var(--duration) var(--ease-out);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.btn--start {
  width: 100%;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn--start:disabled {
  background: var(--bg-disabled);
  border-color: var(--border-subtle);
  color: var(--text-disabled);
  opacity: 0.55;
}

.btn--stop {
  width: 100%;
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.btn--stop:disabled,
.btn--restart:disabled {
  background: var(--bg-disabled);
  border-color: var(--border-subtle);
  color: var(--text-disabled);
  opacity: 0.5;
}

.btn--restart {
  width: 100%;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.btn--ghost {
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border-color: var(--border-default);
}

.btn--primary {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25);
  white-space: nowrap;
  border-radius: var(--radius-md);
}

.btn--primary:disabled {
  background: var(--bg-disabled);
  border-color: var(--border-subtle);
  color: var(--text-disabled);
  opacity: 0.5;
  box-shadow: none;
}

.btn--primary:disabled {
  background: var(--bg-disabled);
  border-color: var(--border-subtle);
  color: var(--text-disabled);
  opacity: 0.5;
  box-shadow: none;
}

/* Bouton Sauvegarder — violet par défaut, orange pulsant si modifications non enregistrées */
@keyframes pulseOrange {
  0%, 100% {
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.25);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.55), 0 0 32px rgba(249, 115, 22, 0.2);
    filter: brightness(1.08);
  }
}

.btn--save {
  padding: 10px 18px;
  background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
  border-color: rgba(139, 92, 246, 0.5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
  white-space: nowrap;
}

.btn--save:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn--save.btn--dirty {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: rgba(249, 115, 22, 0.55);
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
  animation: pulseOrange 1.5s ease-in-out infinite;
}

.btn--save:disabled {
  background: var(--bg-disabled);
  border-color: var(--border-subtle);
  color: var(--text-disabled);
  opacity: 0.5;
  box-shadow: none;
  animation: none;
}

/* ─── Info list ─────────────────────────────────────────────────── */

.info-list { list-style: none; }

.info-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
}

.info-list li + li { border-top: 1px solid var(--border-subtle); }

.info-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
}

/* Alerte critique sidebar — CPU / RAM > 80% */
@keyframes alertBlink {
  0%, 100% {
    background: rgba(244, 63, 94, 0.08);
    color: var(--accent-red);
  }
  50% {
    background: rgba(244, 63, 94, 0.18);
    color: #ff6b81;
  }
}

.info-list__row--alert {
  animation: alertBlink 1s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.info-list__row--alert span,
.info-list__row--alert .info-value {
  color: var(--accent-red) !important;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(24, 24, 27, 0.9);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-x: auto;
}

.tab {
  flex: 1;
  min-width: max-content;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}

.tab:hover { color: var(--text-secondary); background: rgba(255, 255, 255, 0.03); }

.tab--active {
  color: var(--text-primary);
  background: rgba(17, 17, 19, 0.95);
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
}

.tab-panel {
  display: none;
  background: rgba(17, 17, 19, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
}

.tab-panel--active { display: block; }

.console-section {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--console-header);
  border-bottom: 1px solid var(--border-default);
  position: relative;
}

.console-header::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 18px 0 0 #f59e0b, 36px 0 0 #22c55e;
  opacity: 0.5;
}

.console-header .card__title {
  margin-bottom: 0;
  padding-left: 58px;
}

.console,
#terminal {
  height: 400px;
  background: var(--console-bg);
  padding: 14px 16px 14px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Scrollbar terminal — WebKit */
#terminal::-webkit-scrollbar,
.console::-webkit-scrollbar {
  width: 6px;
}

#terminal::-webkit-scrollbar-track,
.console::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

#terminal::-webkit-scrollbar-thumb,
.console::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 99px;
  transition: background var(--duration) var(--ease-out);
}

#terminal::-webkit-scrollbar-thumb:hover,
.console::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

#terminal::-webkit-scrollbar-corner,
.console::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

.console-line {
  padding: 2px 0 2px 12px;
  border-left: 2px solid transparent;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-line--stdout { color: #86efac; border-left-color: rgba(16, 185, 129, 0.4); }
.console-line--stderr { color: #fca5a5; border-left-color: rgba(244, 63, 94, 0.4); }
.console-line--system { color: #93c5fd; border-left-color: rgba(59, 130, 246, 0.4); }

/* ─── RCON bar ──────────────────────────────────────────────────── */

.rcon-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-default);
  transition: opacity var(--duration) var(--ease-out);
}

.rcon-bar--disabled { opacity: 0.72; }

.rcon-prompt {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-green);
}

.rcon-bar--disabled .rcon-prompt { color: var(--text-disabled); }

.rcon-input {
  flex: 1;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
  background: var(--console-bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.rcon-input:focus:not(:disabled) {
  outline: none;
  border-color: var(--accent-green-ring);
  box-shadow: 0 0 0 3px var(--accent-green-dim);
}

.rcon-input:disabled {
  background: var(--bg-disabled);
  border-color: var(--border-subtle);
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.65;
}

.rcon-input:disabled::placeholder {
  color: var(--text-disabled);
}

.rcon-input::placeholder { color: var(--text-tertiary); }

/* ─── File manager ──────────────────────────────────────────────── */

.files-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  min-height: 460px;
}

.file-tree-panel { padding: 16px; overflow: hidden; }

.file-tree {
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.file-tree::-webkit-scrollbar { width: 6px; }
.file-tree::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.file-tree::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 99px; }
.file-tree::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

.file-tree__empty {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  padding: 8px;
}

.file-tree__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration) var(--ease-out);
  word-break: break-all;
}

.file-tree__item:hover { background: var(--bg-hover); color: var(--text-primary); }

.file-tree__item--active {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue-ring);
}

.file-tree__item--dir {
  color: var(--text-tertiary);
  cursor: default;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.file-tree__icon { flex-shrink: 0; opacity: 0.7; }

.file-editor-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.file-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.file-editor-header .card__title { margin-bottom: 0; }

.file-editor {
  flex: 1;
  min-height: 400px;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #cbd5e1;
  background: var(--console-bg);
  border: none;
  resize: vertical;
}

.file-editor:focus { outline: none; }

/* ─── Charts ────────────────────────────────────────────────────── */

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-card { padding: 18px 20px 12px; }

.chart-wrap {
  position: relative;
  height: 280px;
}

/* ─── Players ───────────────────────────────────────────────────── */

.players-card { min-height: 460px; }

.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.players-header .card__title { margin-bottom: 0; }

.players-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.players-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.player-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 14px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease-out);
  animation: fadeIn 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.player-badge:hover {
  border-color: var(--accent-green-ring);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}

.player-badge__actions {
  display: flex;
  gap: 5px;
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-badge:hover .player-badge__actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.player-action {
  appearance: none;
  flex: 1;
  max-width: 52px;
  padding: 5px 4px;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out),
    color var(--duration) var(--ease-out);
}

.player-action:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.player-action--kick:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

.player-action--ban:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.player-action--op:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.player-badge__avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.player-badge__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  word-break: break-word;
}

.player-badge__status {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-green);
}

/* ─── Responsive ────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr; }
  .files-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app { padding: 16px; }
  .dashboard { grid-template-columns: 1fr; }
  .header { flex-direction: column; align-items: stretch; }
  .header__controls { max-width: none; }
  .tabs { flex-wrap: nowrap; }
  .console, #terminal { height: 320px; }
}

@media (max-width: 480px) {
  .rcon-bar { flex-wrap: wrap; }
  .rcon-input { width: 100%; order: 2; }
  .btn--primary { width: 100%; order: 3; }
  .console-header::before { display: none; }
  .console-header .card__title { padding-left: 0; }
}

/* ─── Toasts in-app ─────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.28s var(--ease-out);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast--leaving {
  animation: toastOut 0.22s var(--ease-out) forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px); }
}

.toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.toast__body { flex: 1; min-width: 0; }

.toast__title {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast__message {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.toast--success { border-color: rgba(16, 185, 129, 0.35); }
.toast--success .toast__icon { background: var(--accent-green-dim); color: var(--accent-green); }

.toast--error { border-color: rgba(244, 63, 94, 0.35); }
.toast--error .toast__icon { background: var(--accent-red-dim); color: var(--accent-red); }

.toast--warning { border-color: rgba(249, 115, 22, 0.35); }
.toast--warning .toast__icon { background: rgba(249, 115, 22, 0.12); color: #f97316; }

.toast--info { border-color: rgba(59, 130, 246, 0.35); }
.toast--info .toast__icon { background: var(--accent-blue-dim); color: var(--accent-blue); }

/* ─── Modal de confirmation in-app ──────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(4px);
  animation: fadeOverlay 0.2s ease;
}

.modal-overlay[hidden] { display: none; }

@keyframes fadeOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 420px;
  padding: 24px 22px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease-out);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  font-size: 1.1rem;
}

.modal__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal__message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-line;
  margin-bottom: 20px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal__btn { min-width: 100px; }

/* ─── Login ─────────────────────────────────────────────────────── */

.app--locked {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 7, 15, 0.82);
  backdrop-filter: blur(8px);
}

.login-overlay[hidden] {
  display: none;
}

.login-card {
  width: min(100%, 380px);
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: linear-gradient(180deg, var(--bg-raised) 0%, var(--bg-surface) 100%);
  box-shadow: var(--shadow-lg);
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.login-card__brand h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.login-card__brand p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.login-card__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-card__input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 0.92rem;
}

.login-card__input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-ring);
}

.login-card__error {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--accent-red);
}

.login-card__submit {
  width: 100%;
  margin-top: 18px;
}

.btn--logout {
  margin-left: 12px;
  padding: 6px 12px;
  font-size: 0.75rem;
}
