/* ============================================================
   DAYZ SERVER MANAGER PRO - DESIGN SYSTEM
   Premium Dark Theme v3.0
   Inspired by Vercel, Linear, Arc Browser
   ============================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  /* Core backgrounds - deep layered darks */
  --bg-primary: #09090b;
  --bg-secondary: #0f0f14;
  --bg-tertiary: #16161e;
  --bg-card: #1a1a24;
  --bg-card-hover: #1e1e2a;
  --bg-input: #0c0c12;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  --bg-glass: rgba(18, 18, 28, 0.65);
  --bg-glass-heavy: rgba(14, 14, 22, 0.88);
  --bg-elevated: #1c1c28;

  /* Accent colors */
  --accent: #00ff88;
  --accent-dim: rgba(0, 255, 136, 0.12);
  --accent-glow: rgba(0, 255, 136, 0.25);
  --accent-hover: #00e67a;
  --accent-muted: #00cc6a;
  --accent-secondary: #7c3aed;
  --accent-secondary-dim: rgba(124, 58, 237, 0.12);
  --accent-secondary-glow: rgba(124, 58, 237, 0.25);
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.12);

  /* Compat aliases */
  --accent-bg: rgba(0, 255, 136, 0.08);
  --surface: var(--bg-secondary);
  --card: var(--bg-card);
  --card-hover: var(--bg-card-hover);
  --bg: var(--bg-primary);

  /* Text hierarchy */
  --text-primary: #e8e8ef;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --text-dim: #3d3d52;
  --text-inverse: #09090b;
  --text: var(--text-primary);

  /* Borders */
  --border: #2a2a3e;
  --border-light: #33334a;
  --border-hover: #3d3d56;
  --border-focus: var(--accent);
  --border-subtle: #1f1f30;

  /* Semantic colors */
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.10);
  --danger-bg: rgba(239, 68, 68, 0.10);
  --danger-glow: rgba(239, 68, 68, 0.20);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.10);
  --warning-bg: rgba(245, 158, 11, 0.10);
  --success: #10b981;
  --success-dim: rgba(16, 185, 129, 0.10);
  --info: #3b82f6;
  --info-dim: rgba(59, 130, 246, 0.10);
  --info-bg: rgba(59, 130, 246, 0.10);

  /* Extended palette */
  --purple: #a855f7;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --orange: #f97316;

  /* Spacing scale (4px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows - layered for depth */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-2xl: 0 32px 80px rgba(0, 0, 0, 0.7), 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-accent: 0 0 20px rgba(0, 255, 136, 0.15), 0 0 60px rgba(0, 255, 136, 0.05);
  --shadow-glow-purple: 0 0 20px rgba(124, 58, 237, 0.2), 0 0 60px rgba(124, 58, 237, 0.06);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.2), 0 0 60px rgba(59, 130, 246, 0.06);
  --shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.15), 0 0 60px rgba(239, 68, 68, 0.05);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.03);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', Consolas, monospace;
  --font-size-2xs: 0.625rem;    /* 10px */
  --font-size-xs: 0.6875rem;    /* 11px */
  --font-size-sm: 0.8125rem;    /* 13px */
  --font-size-base: 0.9rem;     /* 14.4px */
  --font-size-md: 0.9375rem;    /* 15px */
  --font-size-lg: 1.1rem;       /* 17.6px */
  --font-size-xl: 1.375rem;     /* 22px */
  --font-size-2xl: 1.75rem;     /* 28px */
  --font-size-3xl: 2.25rem;     /* 36px */
  --font-size-4xl: 2.75rem;     /* 44px */

  /* Layout */
  --nav-height: 56px;
  --sidebar-width: 244px;
  --sidebar-collapsed-width: 56px;
  --content-max-width: 1600px;

  /* Transitions */
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-sidebar: 900;
  --z-nav: 1000;
  --z-modal: 2000;
  --z-notification: 3000;
  --z-context: 4000;
  --z-tooltip: 5000;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(0, 255, 136, 0.03) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body.app-mode {
  overflow: hidden;
  height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: #33ffaa;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: var(--font-sans);
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background: rgba(0, 255, 136, 0.2);
  color: #fff;
}

::-moz-selection {
  background: rgba(0, 255, 136, 0.2);
  color: #fff;
}

/* ============================================================
   TOP NAVIGATION
   ============================================================ */
#top-nav,
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  gap: var(--space-lg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-primary);
}

.nav-brand .brand-icon,
.nav-brand strong,
.nav-brand-text {
  background: linear-gradient(135deg, var(--accent) 0%, #00cc6a 40%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
}

.nav-separator {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* Instance Selector */
.nav-instance-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-instance-selector select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 34px 7px 12px;
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.nav-instance-selector select:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-card);
}

.nav-instance-selector select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Nav center search */
.nav-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-search {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.nav-search input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 16px 7px 36px;
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-family: var(--font-sans);
  transition: all var(--transition-base);
}

.nav-search input::placeholder {
  color: var(--text-muted);
}

.nav-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 20px rgba(0, 255, 136, 0.06);
  background: var(--bg-secondary);
}

.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

/* Nav right actions */
.nav-right,
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Connection Status */
.connection-status,
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all var(--transition-base);
}

.connection-dot,
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  display: inline-block;
  transition: all var(--transition-base);
}

.connection-status.connected .connection-dot,
.status-connected .status-dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-connected .status-text {
  color: var(--accent);
}

.connection-status.disconnected .connection-dot,
.status-disconnected .status-dot {
  background: var(--danger);
}

.status-disconnected .status-text {
  color: var(--text-secondary);
}

.connection-status.connecting .connection-dot,
.status-connecting .status-dot {
  background: var(--warning);
  animation: pulse-dot 1s ease-in-out infinite;
}

.status-connecting .status-text {
  color: var(--warning);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Nav user / avatar */
.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
}

.nav-user:hover {
  background: var(--bg-tertiary);
}

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: #fff;
}

/* Hamburger for mobile */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  transition: background var(--transition-base);
}

.nav-hamburger:hover {
  background: var(--bg-tertiary);
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app-layout {
  display: flex;
  margin-top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar,
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-slow), min-width var(--transition-slow), transform var(--transition-slow);
  z-index: var(--z-sidebar);
  will-change: width, transform;
}

.sidebar--fixed {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
}

.sidebar-section {
  padding: var(--space-xs) 0;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--border-subtle);
}

.sidebar-header,
.sidebar-section-header {
  padding: 12px var(--space-md) 6px;
  font-size: var(--font-size-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  user-select: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px var(--space-md);
  margin: 1px 8px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 450;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  position: relative;
  border-left: 3px solid transparent;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--border-light);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 550;
}

.sidebar-link.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0.6;
}

.sidebar-icon,
.sidebar-link-icon {
  display: flex;
  align-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link:hover .sidebar-link-icon {
  opacity: 0.8;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link.active .sidebar-link-icon {
  opacity: 1;
}

.sidebar-link-badge {
  margin-left: auto;
  font-size: var(--font-size-2xs);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px var(--space-md);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.sidebar-version {
  font-size: var(--font-size-2xs);
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* Sidebar collapsed */
.sidebar.collapsed,
#sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-section-header,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-link-badge,
#sidebar.collapsed .sidebar-header,
#sidebar.collapsed .sidebar-link span {
  display: none;
}

.sidebar.collapsed .sidebar-link,
#sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 10px;
  margin: 1px 4px;
  border-left: none;
}

.sidebar.collapsed .sidebar-link.active::after,
#sidebar.collapsed .sidebar-link.active::after {
  display: none;
}

#sidebar.collapsed .sidebar-footer {
  display: none;
}

#app-layout.sidebar-collapsed #sidebar {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
#content,
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-lg);
  min-height: 100%;
}

.main-content--offset {
  margin-left: var(--sidebar-width);
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  transition: margin-left var(--transition-slow);
}

#page-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  animation: pageEnter 0.25s ease;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}

.page-header-left {
  flex: 1;
  min-width: 0;
}

.page-header h1,
.page-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0 0 4px 0;
}

.page-header p,
.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin: 0;
  line-height: 1.5;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: 550;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-inset);
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

.btn:disabled,
.btn[disabled],
.btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

/* Primary - vibrant green */
.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-inset), 0 1px 2px rgba(0, 255, 136, 0.1);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-glow-accent);
  filter: brightness(1.05);
}

.btn-primary:active {
  filter: brightness(0.95);
}

/* Accent (Lightning/Quick) */
.btn-accent {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-color: #6366f1;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.25);
}
.btn-accent:hover {
  background: linear-gradient(135deg, #5558e6, #7c3aed);
  border-color: #5558e6;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
  filter: brightness(1.05);
}
.btn-accent:active {
  filter: brightness(0.95);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

/* Danger */
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger-dim);
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: var(--shadow-glow-danger);
}

.btn-danger.btn-solid {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger.btn-solid:hover {
  background: #dc2626;
  filter: brightness(1.1);
}

/* Warning */
.btn-warning {
  background: var(--warning);
  color: var(--text-inverse);
  border-color: var(--warning);
}

.btn-warning:hover {
  background: #d97706;
  filter: brightness(1.05);
}

/* Info */
.btn-info {
  background: var(--info);
  color: #fff;
  border-color: var(--info);
}

.btn-info:hover {
  background: #2563eb;
  box-shadow: var(--shadow-glow-blue);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  box-shadow: none;
}

/* Outline accent */
.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: rgba(0, 255, 136, 0.25);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--shadow-glow-accent);
}

/* Purple variant */
.btn-purple {
  background: var(--accent-secondary);
  color: #fff;
  border-color: var(--accent-secondary);
}

.btn-purple:hover {
  background: #6d28d9;
  box-shadow: var(--shadow-glow-purple);
}

/* Sizes */
.btn-xs {
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-xs);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: var(--font-size-md);
  border-radius: var(--radius-md);
}

.btn-xl {
  padding: 16px 36px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-md);
}

/* Icon button */
.btn-icon {
  padding: 6px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  box-shadow: none;
  transform: none;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
  padding: 4px;
}

.btn-icon.btn-lg {
  width: 44px;
  height: 44px;
  padding: 10px;
}

/* Button group */
.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.form-group label,
.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.form-label-required::after {
  content: '*';
  color: var(--danger);
  margin-left: 3px;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  transition: all var(--transition-base);
  line-height: 1.5;
  outline: none;
  box-shadow: var(--shadow-inset);
}

.form-control::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-control:hover,
.form-input:hover {
  border-color: var(--border-hover);
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim), 0 0 20px rgba(0, 255, 136, 0.06);
  background: var(--bg-secondary);
}

.form-control.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

.form-error {
  color: var(--danger);
  font-size: var(--font-size-xs);
  margin-top: 4px;
}

textarea.form-control,
.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Select */
select.form-control,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Toggle / Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 40px;
  height: 22px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-base);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(18px);
  background: var(--text-inverse);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.toggle input:focus-visible + .toggle-track {
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.toggle-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Checkbox */
.form-checkbox,
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
}

.form-checkbox input[type="checkbox"],
.checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Range slider */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.35);
  transition: all var(--transition-base);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.5);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--bg-primary);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th,
.data-table thead th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
  user-select: none;
  transition: color var(--transition-base);
}

.data-table thead th.sortable {
  cursor: pointer;
}

.data-table thead th.sortable:hover,
.data-table thead th.sorted {
  color: var(--accent);
}

.table td,
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(42, 42, 62, 0.4);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr,
.data-table tbody tr {
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.012);
}

.table tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.data-table tr.selected td {
  background: var(--accent-dim);
}

.table-compact td,
.table-compact th {
  padding: 6px 12px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
  position: relative;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-static:hover {
  transform: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  gap: var(--space-md);
}

.card-title {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 18px;
}

.card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* Card variants with accent top border */
.card-accent {
  border-top: 2px solid var(--accent);
}

.card-purple {
  border-top: 2px solid var(--accent-secondary);
}

.card-blue {
  border-top: 2px solid var(--accent-blue);
}

.card-danger {
  border-top: 2px solid var(--danger);
}

.card-warning {
  border-top: 2px solid var(--warning);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1.5;
  white-space: nowrap;
  letter-spacing: 0.02em;
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.badge-success { background: var(--success-dim); color: var(--success); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info    { background: var(--info-dim);    color: var(--info); }
.badge-secondary { background: rgba(136, 136, 160, 0.10); color: var(--text-secondary); }
.badge-accent  { background: var(--accent-dim);  color: var(--accent); }
.badge-purple  { background: var(--accent-secondary-dim); color: var(--accent-secondary); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ============================================================
   MODALS
   ============================================================ */
#modal-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: overlayFadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes overlayFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(12px); }
}

#modal-container,
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.05);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-sm, #modal-container.modal-sm { max-width: 420px; }
.modal-md, #modal-container.modal-md { max-width: 560px; }
.modal-lg, #modal-container.modal-lg { max-width: 760px; }
.modal-xl, #modal-container.modal-xl { max-width: 1000px; }
.modal-full, #modal-container.modal-full { max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  line-height: 1;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   NOTIFICATIONS / TOASTS
   ============================================================ */
#notification-area,
.notification-container {
  position: fixed;
  top: calc(var(--nav-height) + 12px);
  right: 16px;
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 380px;
  width: 100%;
  pointer-events: none;
}

.notification {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: auto;
  animation: notificationSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15);
  font-size: 13px;
  cursor: pointer;
  transition: opacity var(--transition-base), transform var(--transition-base);
  border-left: 3px solid var(--info);
  position: relative;
  overflow: hidden;
}

.notification:hover {
  transform: translateX(-4px);
}

.notification.success,
.notification-success { border-left-color: var(--success); }
.notification.error,
.notification-danger   { border-left-color: var(--danger); }
.notification.warning,
.notification-warning  { border-left-color: var(--warning); }
.notification.info,
.notification-info     { border-left-color: var(--info); }

.notification-dismiss,
.notification.dismissing {
  animation: notificationSlideOut 0.3s ease forwards;
}

.notification-icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.notification-message {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.25;
  animation: shrinkWidth linear forwards;
}

@keyframes shrinkWidth {
  from { width: 100%; }
  to { width: 0%; }
}

@keyframes notificationSlideIn {
  from { opacity: 0; transform: translateX(80px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes notificationSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(80px); }
}

/* ============================================================
   TABS
   ============================================================ */
.tabs,
.tab-group {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
  position: relative;
}

.tab-item,
.tab {
  padding: 10px 18px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  font-family: var(--font-sans);
  position: relative;
  user-select: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab-item:hover,
.tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tab-item.active,
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content {
  padding: var(--space-md) 0;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

/* Pill tabs variant */
.tab-group-pills {
  display: flex;
  gap: var(--space-xs);
  border-bottom: none;
  padding: 3px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  width: fit-content;
}

.tab-group-pills .tab {
  border-bottom: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
}

.tab-group-pills .tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   CODE / PRE / EDITOR BLOCKS
   ============================================================ */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

pre {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--text-primary);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  border: none;
}

.code-editor,
.xml-editor {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  overflow: auto;
  white-space: pre;
  tab-size: 2;
  min-height: 200px;
  resize: vertical;
}

.code-editor:focus,
.xml-editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ============================================================
   STAT CARDS / WIDGETS
   ============================================================ */
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.stat-icon-green  { background: var(--accent-dim); color: var(--accent); }
.stat-icon-purple { background: var(--accent-secondary-dim); color: var(--accent-secondary); }
.stat-icon-blue   { background: var(--accent-blue-dim); color: var(--accent-blue); }
.stat-icon-red    { background: var(--danger-dim); color: var(--danger); }

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.stat-trend,
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-top: 4px;
}

.stat-trend-up,
.stat-change.positive { color: var(--success); }
.stat-trend-down,
.stat-change.negative { color: var(--danger); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-bar,
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill,
.progress-fill,
.progress > .bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--accent-muted));
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.progress-bar-fill::after,
.progress > .bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: shimmer 2s infinite;
}

.progress-bar-danger .progress-bar-fill,
.progress-danger .bar { background: linear-gradient(90deg, var(--danger), #f87171); }
.progress-bar-warning .progress-bar-fill,
.progress-warning .bar { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-info .bar { background: linear-gradient(90deg, var(--info), #60a5fa); }

.progress-lg { height: 10px; }

.progress-labeled {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.progress-labeled .progress,
.progress-labeled .progress-bar {
  flex: 1;
}

.progress-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   FILE TREE (shared)
   ============================================================ */
.file-tree {
  list-style: none;
  padding-left: 0;
  font-size: 13px;
}

.file-tree .file-tree {
  padding-left: 20px;
}

.file-item,
.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-base);
  color: var(--text-secondary);
}

.file-item:hover,
.folder-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.folder-item {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   RCON CONSOLE (shared base)
   ============================================================ */
.rcon-console {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 500px;
}

.rcon-output {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-primary);
}

.rcon-input {
  display: flex;
  border-top: 1px solid var(--border);
}

.rcon-input input {
  flex: 1;
  background: var(--bg-secondary);
  border: none;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  outline: none;
}

.rcon-input input::placeholder {
  color: var(--text-muted);
}

.rcon-input button {
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: all var(--transition-base);
}

.rcon-input button:hover {
  background: var(--accent-hover);
  filter: brightness(1.05);
}

/* ============================================================
   PLAYER LIST (shared base)
   ============================================================ */
.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-base);
  font-size: 13px;
}

.player-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.player-online::before,
.player-offline::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.player-online::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.player-offline::before {
  background: var(--text-muted);
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}

.skeleton,
.loading-placeholder {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
  height: 16px;
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 70%; }
.skeleton-heading { height: 24px; width: 50%; margin-bottom: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; border-radius: var(--radius-md); }

/* ============================================================
   TOOLTIPS
   ============================================================ */
#tooltip,
.tooltip-wrapper .tooltip {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-tooltip);
  pointer-events: none;
  white-space: nowrap;
  animation: tooltipFadeIn 0.12s ease;
}

@keyframes tooltipFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

.tooltip-wrapper .tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tooltip-wrapper .tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-elevated);
}

.tooltip-wrapper:hover .tooltip {
  opacity: 1;
}

/* ============================================================
   CONTEXT MENU
   ============================================================ */
#context-menu,
.context-menu {
  position: fixed;
  z-index: var(--z-context);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 4px;
  min-width: 180px;
  animation: contextMenuIn 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.05);
}

@keyframes contextMenuIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

#context-menu .ctx-item,
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}

#context-menu .ctx-item:hover,
.context-menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

#context-menu .ctx-item.danger,
.context-menu-item-danger:hover {
  color: var(--danger);
  background: var(--danger-dim);
}

#context-menu .ctx-separator,
.context-menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 8px;
}

.context-menu-item-icon {
  width: 16px;
  text-align: center;
  opacity: 0.7;
}

.context-menu-item-shortcut {
  margin-left: auto;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  padding: 1px 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
}

/* ============================================================
   EMPTY / PLACEHOLDER STATES
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.empty-state-text {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  max-width: 400px;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
  border: none;
}

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-accent { color: var(--accent) !important; }
.text-purple { color: var(--accent-secondary) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.text-sm { font-size: var(--font-size-sm) !important; }
.text-xs { font-size: var(--font-size-xs) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-mono { font-family: var(--font-mono) !important; }

.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.gap-xs { gap: var(--space-xs) !important; }
.gap-sm { gap: var(--space-sm) !important; }
.gap-md { gap: var(--space-md) !important; }
.gap-lg { gap: var(--space-lg) !important; }
.flex-1 { flex: 1 !important; }

.mt-xs { margin-top: var(--space-xs) !important; }
.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-lg { margin-top: var(--space-lg) !important; }
.mb-xs { margin-bottom: var(--space-xs) !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.ml-auto { margin-left: auto !important; }

.p-sm { padding: var(--space-sm) !important; }
.p-md { padding: var(--space-md) !important; }
.p-lg { padding: var(--space-lg) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }

.relative { position: relative !important; }
.hidden { display: none !important; }
.cursor-pointer { cursor: pointer !important; }
.select-none { user-select: none !important; }

.border-none { border: none !important; }
.shadow-none { box-shadow: none !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }

/* ============================================================
   ANIMATIONS / KEYFRAMES
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-12px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px var(--accent-dim); }
  50% { box-shadow: 0 0 20px var(--accent-glow); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Utility animation classes */
.animate-fadeIn { animation: fadeIn 0.3s ease forwards; }
.animate-slideIn { animation: slideIn 0.3s ease forwards; }
.animate-slideUp { animation: slideUp 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 1s ease-in-out infinite; }

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  animation: slideUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.09s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.12s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.18s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.21s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.24s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .nav-hamburger {
    display: flex;
  }

  .nav-center {
    display: none;
  }

  .nav-brand .brand-text {
    display: none;
  }

  .status-text {
    display: none;
  }

  #sidebar,
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    width: 260px;
    transform: translateX(-100%);
    z-index: 950;
    box-shadow: var(--shadow-xl);
  }

  #sidebar.open,
  .sidebar.open {
    transform: translateX(0);
  }

  .main-content,
  .main-content--offset {
    margin-left: 0;
  }

  #content {
    margin-left: 0;
    padding: var(--space-md);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  :root {
    --space-lg: 16px;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
  }

  #content {
    padding: 12px;
  }

  .page-title,
  .page-header h1 {
    font-size: var(--font-size-xl);
  }

  .stat-value {
    font-size: var(--font-size-2xl);
  }

  .modal-header { padding: 12px 16px; }
  .modal-body   { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  #modal-container,
  .modal { width: 96%; }

  .notification-container,
  #notification-area {
    left: 8px;
    right: 8px;
    max-width: none;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #top-nav,
  .top-nav,
  #sidebar,
  .sidebar,
  #notification-area,
  .notification-container,
  #modal-overlay,
  .modal-overlay {
    display: none !important;
  }

  .main-content,
  #content {
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    border: 1px solid #ddd;
    box-shadow: none;
    backdrop-filter: none;
  }
}
