/* ═══════════════════════════════════════════════════════════════
   NexusHub — Base Styles
   Themes are loaded from /css/themes/*.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Shared design tokens (same across all themes) ── */
:root {
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
  --font-display: 'Exo 2', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Aliases for backward compatibility */
:root[data-theme] {
  --bg-dark: var(--bg-primary);
  --bg-card: var(--surface);
  --bg-card-hover: var(--surface-hover);
  --bg-surface: var(--surface-2);
  --neon-glow-color: var(--glow-color);
  --neon-glow: var(--glow-soft);
  --neon-glow-intense: var(--glow-strong);
}


/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Theme color transitions — only active during theme switch, not on every DOM change */
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.35s ease,
              border-color 0.35s ease,
              box-shadow 0.45s ease !important;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  letter-spacing: -0.006em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

::selection {
  background: var(--primary);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Focus ring */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}


/* ═══════════════════════════════════════════════════════════════
   SHARED KEYFRAMES
   ═══════════════════════════════════════════════════════════════ */

@keyframes scanlineScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glow-breathe {
  0%, 100% { box-shadow: 0 2px 8px -2px var(--glow-color); }
  50% { box-shadow: var(--glow-soft); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--success); }
  50% { opacity: 0.6; box-shadow: 0 0 4px var(--success); }
}

@keyframes heroBgDrift {
  0% { transform: scale(1) translate(0, 0); }
  33% { transform: scale(1.02) translate(-8px, 4px); }
  66% { transform: scale(0.99) translate(5px, -3px); }
  100% { transform: scale(1.01) translate(-3px, 6px); }
}


/* ═══════════════════════════════════════════════════════════════
   LUCIDE ICONS
   ═══════════════════════════════════════════════════════════════ */

[data-lucide], svg.lucide {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  stroke-width: 1.75;
  flex-shrink: 0;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--accent);
}

.stat-icon svg { width: 1.25rem; height: 1.25rem; }
.stat-icon.status-online { color: var(--success); }
.stat-icon.status-offline { color: var(--danger); }

.logo-icon {
  display: inline-flex;
  align-items: center;
}

.logo-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  color: var(--accent);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 40%, transparent));
}

.btn svg { width: 1em; height: 1em; vertical-align: -0.1em; }
.page-title svg, .section-title svg { vertical-align: -0.1em; }
legend svg { width: 1em; height: 1em; vertical-align: -0.12em; color: var(--accent); }
.pin-badge svg { width: 0.8em; height: 0.8em; vertical-align: -0.08em; }
.back-link svg { width: 0.85em; height: 0.85em; vertical-align: -0.1em; }

.status-dot-inline {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.status-dot-inline.online {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-dot-inline.offline { background: var(--danger); }

.language-flag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.05em;
}


/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 3.5rem 0; }

.section-dark {
  background: var(--surface-2);
  padding: 3rem 1.5rem;
  margin: 2rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.main-content { min-height: calc(100vh - 180px); }


/* ═══════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════ */

.navbar {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 var(--border);
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.84rem;
  transition: all var(--transition);
  letter-spacing: -0.005em;
  min-width: 90px;
  text-align: center;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.nav-admin {
  color: var(--warning) !important;
  font-weight: 600;
}

.btn-nav-outline {
  border: 1px solid var(--border);
  color: var(--text-secondary) !important;
  font-size: 0.82rem;
  padding: 0.35rem 0.9rem;
  min-width: 72px;
  text-align: center;
  white-space: nowrap;
}

.btn-nav-outline:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary) !important;
}
.btn-nav-logout {
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger) !important;
  font-size: 0.82rem;
  padding: 0.35rem 0.9rem;
  min-width: 72px;
  text-align: center;
  white-space: nowrap;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.btn-nav-logout:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 18%, transparent);
  color: var(--danger) !important;
}

.btn-nav-filled {
  background: var(--primary);
  color: var(--text-on-primary) !important;
  border: 1px solid transparent;
}

.btn-nav-filled:hover { background: var(--primary-hover); }

/* Theme & Language selectors */
.language-selector,
.theme-selector {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  transition: all var(--transition);
  min-width: 62px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--font-body);
}

.language-selector:hover,
.theme-selector:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.language-selector:focus,
.theme-selector:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--glow-color);
}

.language-selector option,
.theme-selector option {
  background: var(--surface);
  color: var(--text-primary);
}

/* ── Effect speed slider ── */
.effect-speed-container {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.effect-speed-label {
  font-size: 0.75rem;
  line-height: 1;
  cursor: default;
  user-select: none;
}

.effect-speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.effect-speed-slider:hover {
  border-color: var(--primary);
}

.effect-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 4px var(--glow-color);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.effect-speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 8px var(--glow-color);
}

.effect-speed-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 4px var(--glow-color);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  position: relative;
  z-index: 1001;
}

.nav-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition);
}


/* ═══════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════ */

.flash {
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.88rem;
  animation: slideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.flash-success {
  background: color-mix(in srgb, var(--success) 10%, var(--bg-primary));
  color: var(--success);
  border-bottom: 1.5px solid var(--success);
}

.flash-error {
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-primary));
  color: var(--danger);
  border-bottom: 1.5px solid var(--danger);
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  box-shadow: 0 2px 8px -2px var(--glow-color), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--glow-soft);
  color: var(--text-on-primary);
}

.btn-primary:active {
  transform: translateY(0);
  background: var(--primary-active);
}

.btn-glow { animation: glow-breathe 3s ease-in-out infinite; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.btn-accent {
  background: var(--accent);
  color: var(--text-on-primary);
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: var(--text-on-primary);
  transform: translateY(-1px);
}

.btn-danger {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
}

.btn-danger:hover {
  background: var(--danger);
  color: var(--text-on-primary);
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.42rem 0.85rem; font-size: 0.82rem; }
.btn-xs { padding: 0.28rem 0.6rem; font-size: 0.76rem; }


/* ═══════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  padding: 5.5rem 0 4rem;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 45%, color-mix(in srgb, var(--primary) 14%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 75% 55%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent) 0%, transparent 50%);
  z-index: 0;
  animation: heroBgDrift 20s ease-in-out infinite alternate;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--accent) 50%, transparent 95%);
  opacity: 0.4;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--text-primary) 20%, var(--primary) 50%, var(--accent) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
  text-shadow: none;
  line-height: 1.1;
}

/* Hero title style variants */
.hero-title.hero-style-glitch {
  background: linear-gradient(135deg, var(--text-primary) 20%, var(--primary) 50%, var(--accent) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title.hero-style-gradient {
  background: linear-gradient(90deg, #5b8af5, #7c6cf0, #e879f9, #5b8af5);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-gradient-flow 5s ease infinite;
}

@keyframes hero-gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-title.hero-style-neon-pulse {
  color: #fff;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 0 12px var(--primary), 0 0 28px var(--primary), 0 0 56px color-mix(in srgb, var(--primary) 60%, transparent);
  animation: hero-neon-pulse 2.5s ease-in-out infinite;
}

@keyframes hero-neon-pulse {
  0%, 100% { text-shadow: 0 0 12px var(--primary), 0 0 28px var(--primary), 0 0 56px color-mix(in srgb, var(--primary) 60%, transparent); }
  50% { text-shadow: 0 0 6px var(--primary), 0 0 14px var(--primary), 0 0 28px color-mix(in srgb, var(--primary) 30%, transparent); }
}

.hero-title.hero-style-typewriter {
  color: #fff;
  -webkit-text-fill-color: #fff;
  border-right: 2px solid var(--accent);
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  animation: hero-typewriter-cursor 0.8s step-end infinite;
}

@keyframes hero-typewriter-cursor {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: transparent; }
}

.hero-title.hero-style-chrome {
  background: linear-gradient(180deg, #fff 0%, #aaa 30%, #fff 50%, #888 70%, #ddd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.hero-title.hero-style-retro {
  color: #FFD740;
  -webkit-text-fill-color: #FFD740;
  text-shadow: 2px 2px 0 #FF5252, -1px -1px 0 #00E676;
  letter-spacing: 0.08em;
}

.hero-title.hero-style-hologram {
  color: #00E5FF;
  -webkit-text-fill-color: #00E5FF;
  text-shadow: 0 0 8px #00E5FF, 0 0 18px #00B8D4, 0 0 36px #006064;
  animation: hero-hologram-flicker 4s ease-in-out infinite;
}

@keyframes hero-hologram-flicker {
  0%, 100% { opacity: 1; text-shadow: 0 0 8px #00E5FF, 0 0 18px #00B8D4, 0 0 36px #006064; }
  25% { opacity: 0.96; }
  50% { opacity: 0.9; transform: translateX(0.5px); }
  75% { opacity: 1; transform: translateX(-0.5px); }
}

/* Glitch */
.glitch { position: relative; }

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--danger);
  clip-path: inset(0 0 85% 0);
  animation: glitch-1 3s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: 2px 0 var(--accent);
  clip-path: inset(85% 0 0 0);
  animation: glitch-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-1 {
  0%, 100% { clip-path: inset(0 0 85% 0); }
  20% { clip-path: inset(15% 0 65% 0); }
  40% { clip-path: inset(45% 0 40% 0); }
  60% { clip-path: inset(70% 0 10% 0); }
  80% { clip-path: inset(5% 0 80% 0); }
}

@keyframes glitch-2 {
  0%, 100% { clip-path: inset(85% 0 0 0); }
  20% { clip-path: inset(65% 0 15% 0); }
  40% { clip-path: inset(40% 0 45% 0); }
  60% { clip-path: inset(10% 0 70% 0); }
  80% { clip-path: inset(80% 0 5% 0); }
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  font-weight: 400;
  letter-spacing: -0.005em;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-box {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.8rem;
  text-align: center;
  min-width: 130px;
  backdrop-filter: blur(8px);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-actions .btn {
  min-width: 160px;
  text-align: center;
}


/* ═══════════════════════════════════════════════════════════════
   SECTION TITLES & PAGE HEADERS
   ═══════════════════════════════════════════════════════════════ */

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.accent { color: var(--accent); }

.page-header {
  background: var(--surface);
  padding: 2.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-desc {
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-size: 0.92rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  transition: color var(--transition);
  white-space: nowrap;
}

.back-link:hover { color: var(--accent); }


/* ═══════════════════════════════════════════════════════════════
   NEWS CARDS
   ═══════════════════════════════════════════════════════════════ */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  animation: cardEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.news-card:hover { transform: translateY(-3px) rotate(-0.2deg); border-color: var(--border-hover); box-shadow: var(--glow-soft); }
.news-card:nth-child(even):hover { transform: translateY(-3px) rotate(0.2deg); }
.news-card:nth-child(2) { animation-delay: 0.04s; }
.news-card:nth-child(3) { animation-delay: 0.08s; }
.news-card:nth-child(4) { animation-delay: 0.12s; }
.news-card:nth-child(5) { animation-delay: 0.16s; }

.news-card.pinned { border-color: color-mix(in srgb, var(--primary) 40%, transparent); }

.pin-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 2;
  letter-spacing: 0.02em;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
}

.news-image {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}

.news-image-default {
  background: linear-gradient(145deg, var(--surface-2) 0%, color-mix(in srgb, var(--primary) 15%, var(--surface)) 100%);
}

.news-body {
  padding: 1.15rem;
  transition: opacity 0.25s ease, transform 0.25s ease;
  will-change: opacity, transform;
}

.news-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.news-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.news-excerpt {
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════════════════
   SERVER CARDS
   ═══════════════════════════════════════════════════════════════ */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.15rem;
}

.server-card-banner { margin: -1.15rem -1.15rem 0.75rem -1.15rem; height: 100px; overflow: hidden; position: relative; }
.server-card-banner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.server-card:hover .server-card-banner img { transform: scale(1.05); }
.server-card-banner.no-image { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 25%, transparent), color-mix(in srgb, var(--accent) 15%, transparent)); display: flex; align-items: center; justify-content: center; }
.server-card-banner.no-image .banner-icon { color: color-mix(in srgb, var(--primary) 50%, transparent); width: 40px; height: 40px; opacity: 0.6; }
.server-card:hover .server-card-banner.no-image .banner-icon { opacity: 0.9; }
.detail-card-image { margin: -1.5rem -1.5rem 1.5rem -1.5rem; height: 180px; overflow: hidden; }
.detail-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cardEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.server-card:hover { border-color: var(--border-hover); box-shadow: var(--glow-soft); transform: translateY(-2px) rotate(0.15deg); }
.server-card:nth-child(even):hover { transform: translateY(-2px) rotate(-0.15deg); }
.server-card:nth-child(2) { animation-delay: 0.04s; }
.server-card:nth-child(3) { animation-delay: 0.08s; }
.server-card:nth-child(4) { animation-delay: 0.12s; }
.server-card:nth-child(5) { animation-delay: 0.16s; }

.server-status-indicator {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.status-online { background: linear-gradient(90deg, var(--success) 0%, color-mix(in srgb, var(--success) 20%, transparent) 100%); }
.status-offline { background: linear-gradient(90deg, var(--danger) 0%, color-mix(in srgb, var(--danger) 20%, transparent) 100%); }

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  margin-top: 0.35rem;
  min-height: 32px;
}

.server-name {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.status-badge {
  padding: 0.18rem 0.6rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  min-width: 72px;
  text-align: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-online { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 20%, transparent); }
.badge-offline { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 18%, transparent); }
.badge-success { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }

.server-info { margin-bottom: 0.85rem; }

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.86rem;
}

.info-row + .info-row { border-top: 1px solid var(--border); }

.info-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  min-width: 70px;
  flex-shrink: 0;
  white-space: nowrap;
}

.info-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  letter-spacing: -0.02em;
}

.server-desc {
  color: var(--text-secondary);
  font-size: 0.84rem;
  margin-top: 0.65rem;
  line-height: 1.5;
}

.server-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  min-height: 36px;
  flex-wrap: nowrap;
}

.server-card-footer .btn {
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  flex-shrink: 0;
}

.last-checked {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}


/* ═══════════════════════════════════════════════════════════════
   SERVER DETAIL
   ═══════════════════════════════════════════════════════════════ */

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.detail-header { margin-bottom: 1.35rem; }

.detail-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot-online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

.status-dot-offline { background: var(--danger); }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.detail-item {
  background: var(--surface-2);
  padding: 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.detail-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
  font-weight: 500;
  white-space: nowrap;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-description {
  margin: 1.35rem 0;
  padding: 1.15rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--accent);
}

.detail-description h3 {
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
  font-weight: 600;
}

.detail-description p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9rem;
}

.detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.35rem;
  flex-wrap: wrap;
}

.detail-actions .btn {
  min-width: 140px;
  text-align: center;
  white-space: nowrap;
}


/* ═══════════════════════════════════════════════════════════════
   GAMES SHOWCASE
   ═══════════════════════════════════════════════════════════════ */

.games-showcase {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.game-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.75rem;
  text-align: center;
  min-width: 150px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cardEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.game-badge:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--glow-soft);
}

.game-icon { font-size: 2.25rem; margin-bottom: 0.4rem; }
.game-badge span { display: block; font-weight: 600; font-size: 0.87rem; }

.game-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color var(--transition), box-shadow var(--transition) !important;
}

.game-card:hover {
  transform: translateY(-4px) rotate(-0.3deg) !important;
  border-color: var(--accent) !important;
  box-shadow: var(--glow-soft) !important;
}


/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════ */

.auth-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem 1.5rem;
  min-height: 60vh;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#turnstile-container {
  margin-bottom: 1rem;
}

#turnstile-container iframe {
  width: 100% !important;
  max-width: 100% !important;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.87rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.87rem;
}


/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 1.15rem; }

.form-group label,
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow-color);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-input-sm {
  padding: 0.3rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 0.8rem;
}

.form-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  margin-bottom: 1.35rem;
}

.form-fieldset legend {
  font-weight: 600;
  color: var(--accent);
  padding: 0 0.4rem;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.form-actions .btn {
  white-space: nowrap;
  min-width: 100px;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font-weight: 400 !important;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 700px;
}


/* ═══════════════════════════════════════════════════════════════
   COMMUNITY CHAT
   ═══════════════════════════════════════════════════════════════ */

.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 800px;
  box-shadow: var(--card-shadow);
}

.chat-messages {
  height: 480px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-chat, var(--font-body));
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.chat-msg,
.chat-message {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  border-left: 2px solid var(--accent);
  transition: background var(--transition);
}

.chat-msg:hover,
.chat-message:hover { background: var(--surface-hover); }

.chat-message { border-left-color: var(--primary); }
.chat-message.system { color: var(--warning); font-style: italic; border-left: none; background: transparent; }

.chat-user { font-weight: 700; color: var(--accent); font-size: 0.82rem; margin-right: 0.4rem; }
.chat-time { font-size: 0.7rem; color: var(--text-muted); }

.chat-text {
  margin-top: 0.2rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  word-break: break-word;
  line-height: 1.5;
}

.chat-typing {
  padding: 0 1rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  min-height: 1.35rem;
}

.chat-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.chat-input {
  flex: 1;
  padding: 0.5rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--glow-color);
}

.chat-nickname-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.nickname-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 110px;
  flex-shrink: 0;
}

.chat-nickname-bar .chat-input { max-width: 200px; }


/* ═══════════════════════════════════════════════════════════════
   ADMIN PANEL
   ═══════════════════════════════════════════════════════════════ */

.admin-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 1.5rem 0;
}

.admin-nav {
  display: flex;
  gap: 0;
  margin-top: 1.25rem;
  overflow-x: auto;
}

.admin-tab {
  padding: 0.65rem 1.1rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}

.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-section-header .btn { white-space: nowrap; flex-shrink: 0; }

/* Stats Grid (consolidated .stat-info and .stat-content) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.stats-grid-7 {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stats-grid-4x2 {
  grid-template-columns: repeat(4, 1fr);
}


/* ═══════════════════════════════════════════════════════════════
   ANALYTICS CHARTS
   ═══════════════════════════════════════════════════════════════ */

.analytics-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.analytics-period-select {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

.analytics-period-select:focus {
  border-color: var(--accent);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: cardEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-header {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.chart-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.chart-body {
  padding: 1rem;
  height: 260px;
  position: relative;
}

.chart-body-doughnut {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}


.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: cardEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.stat-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.stat-card:nth-child(2) { animation-delay: 0.04s; }
.stat-card:nth-child(3) { animation-delay: 0.08s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }
.stat-card-online { border-color: color-mix(in srgb, var(--success) 25%, transparent); }

.stat-info,
.stat-content {
  min-width: 0;
  flex: 1;
}

.stat-info .stat-number,
.stat-content .stat-number {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.2;
}

.stat-info .stat-label,
.stat-content .stat-label {
  font-size: 0.78rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 180px;
  font-weight: 500;
}

.stat-icon {
  font-size: 1.5rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.stat-card-analytics-link {
  cursor: pointer;
  border-style: dashed;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.stat-card-analytics-link:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════════════════════════════ */

.admin-table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.admin-table-wrapper .admin-section-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 0;
}

.admin-table-wrapper .data-table {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.admin-table-wrapper .data-table thead { background: var(--surface-2); }
.admin-table-wrapper .data-table th { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.admin-table-wrapper .data-table td { padding: 0.65rem 1rem; }
.admin-table-wrapper .data-table tbody tr { box-shadow: inset 0 -1px 0 0 var(--border); }
.admin-table-wrapper .data-table tbody tr:last-child { box-shadow: none; }
.admin-table-wrapper .data-table tbody tr:hover { background: var(--surface-hover); }

.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  table-layout: fixed;
}

.data-table thead { background: var(--surface-2); }

.data-table th {
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table tbody tr { box-shadow: inset 0 -1px 0 0 var(--border); }
.data-table tbody tr:last-child { box-shadow: none; }
.data-table tbody tr:hover { background: var(--surface-hover); }

.data-table td {
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  vertical-align: middle;
  min-height: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions-cell {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  min-height: 28px;
  white-space: nowrap;
  flex-wrap: nowrap;
  overflow: visible;
}

.actions-cell .btn { white-space: nowrap; min-width: 55px; text-align: center; flex-shrink: 0; }

td.actions-cell {
  overflow: visible;
}

/* Table column widths */
.data-table.table-dashboard th:nth-child(1), .data-table.table-dashboard td:nth-child(1) { width: 25%; }
.data-table.table-dashboard th:nth-child(2), .data-table.table-dashboard td:nth-child(2) { width: 15%; }
.data-table.table-dashboard th:nth-child(3), .data-table.table-dashboard td:nth-child(3) { width: 25%; }
.data-table.table-dashboard th:nth-child(4), .data-table.table-dashboard td:nth-child(4) { width: 15%; }
.data-table.table-dashboard th:nth-child(5), .data-table.table-dashboard td:nth-child(5) { width: 20%; }

.data-table.table-servers th:nth-child(1), .data-table.table-servers td:nth-child(1) { width: 18%; }
.data-table.table-servers th:nth-child(2), .data-table.table-servers td:nth-child(2) { width: 12%; }
.data-table.table-servers th:nth-child(3), .data-table.table-servers td:nth-child(3) { width: 20%; }
.data-table.table-servers th:nth-child(4), .data-table.table-servers td:nth-child(4) { width: 10%; }
.data-table.table-servers th:nth-child(5), .data-table.table-servers td:nth-child(5) { width: 10%; }
.data-table.table-servers th:nth-child(6), .data-table.table-servers td:nth-child(6) { width: 30%; }

.data-table.table-users th:nth-child(1), .data-table.table-users td:nth-child(1) { width: 40px; }
.data-table.table-users th:nth-child(2), .data-table.table-users td:nth-child(2) { width: 11%; }
.data-table.table-users th:nth-child(3), .data-table.table-users td:nth-child(3) { width: 17%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table.table-users th:nth-child(4), .data-table.table-users td:nth-child(4) { width: 9%; text-align: center; overflow: visible !important; text-overflow: clip !important; }
.data-table.table-users th:nth-child(5), .data-table.table-users td:nth-child(5) { width: 17%; white-space: nowrap; }
.data-table.table-users th:nth-child(6), .data-table.table-users td:nth-child(6) { width: 14%; white-space: nowrap; }
.data-table.table-users th:nth-child(7), .data-table.table-users td:nth-child(7) { width: 12%; }
.data-table.table-users th:nth-child(8), .data-table.table-users td:nth-child(8) { width: 14%; }

.data-table.table-news th:nth-child(1), .data-table.table-news td:nth-child(1) { width: 28%; }
.data-table.table-news th:nth-child(2), .data-table.table-news td:nth-child(2) { width: 12%; }
.data-table.table-news th:nth-child(3), .data-table.table-news td:nth-child(3) { width: 10%; }
.data-table.table-news th:nth-child(4), .data-table.table-news td:nth-child(4) { width: 18%; }
.data-table.table-news th:nth-child(5), .data-table.table-news td:nth-child(5) { width: 32%; }


/* ═══════════════════════════════════════════════════════════════
   TAGS & BADGES
   ═══════════════════════════════════════════════════════════════ */

.tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 40px;
  text-align: center;
}

.tag-active { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.tag-inactive { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); }

.role-badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin { background: color-mix(in srgb, var(--warning) 12%, transparent); color: var(--warning); }
.role-user { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }


/* ═══════════════════════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════════════════════ */

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-card h2 {
  font-size: 1.05rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════════════════
   STATES
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
}

.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  text-align: center;
  padding: 2rem;
}

.error-content { max-width: 460px; }

.error-code {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.error-message {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.25rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-section p { color: var(--text-muted); font-size: 0.87rem; line-height: 1.6; }

.footer-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
  white-space: nowrap;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.35rem; }
.footer-section ul li a { color: var(--text-muted); font-size: 0.87rem; transition: color var(--transition); }
.footer-section ul li a:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
}


/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 720px;
  width: 90%;
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 2rem; height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
}

.modal-close:hover { background: var(--surface-hover); color: var(--text-primary); }

.modal-body {
  padding: 1.35rem 1.5rem;
  max-height: calc(88vh - 100px);
  overflow-y: auto;
}

.modal-meta {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.modal-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.modal-content-text {
  line-height: 1.65;
  color: var(--text-primary);
  font-size: 0.92rem;
}


/* ═══════════════════════════════════════════════════════════════
   MONITORING / RESOURCES
   ═══════════════════════════════════════════════════════════════ */

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.15rem;
}

.resource-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color var(--transition);
}

.resource-card:hover { border-color: var(--border-hover); }
.resource-card.status-online { border-top: 2px solid var(--success); }
.resource-card.status-offline { border-top: 2px solid var(--danger); opacity: 0.7; }

.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.resource-title { font-weight: 700; font-size: 0.95rem; }

.resource-status {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.resource-status.status-online { color: var(--success); }
.resource-status.status-offline { color: var(--danger); }

.resource-metric { margin-bottom: 0.75rem; }

.resource-metric-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.resource-bar {
  height: 5px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.resource-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  background: var(--primary);
}

.resource-bar-fill.high { background: var(--danger); }
.resource-bar-fill.medium { background: var(--warning); }
.resource-bar-fill.low { background: var(--success); }

.server-group { margin-bottom: 2rem; }

.group-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.mon-status-badge { white-space: nowrap; min-width: 75px; text-align: center; }


/* ═══════════════════════════════════════════════════════════════
   ONLINE USERS (Community)
   ═══════════════════════════════════════════════════════════════ */

.online-user-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  transition: background var(--transition);
}

.online-user-item:hover { background: var(--surface-hover); }

.online-user-item::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════
   STATUS HELPERS
   ═══════════════════════════════════════════════════════════════ */

.status-online:not(.server-status-indicator):not(.resource-card):not(.stat-icon) {
  color: var(--success);
}

.status-offline:not(.server-status-indicator):not(.resource-card):not(.stat-icon) {
  color: var(--danger);
  opacity: 0.8;
}


/* ═══════════════════════════════════════════════════════════════
   I18N STABILITY
   ═══════════════════════════════════════════════════════════════ */

.btn[data-i18n] { white-space: nowrap; min-width: 80px; text-align: center; }
.btn-sm[data-i18n] { min-width: 70px; }
.btn-xs[data-i18n] { min-width: 55px; }
.btn-block[data-i18n] { min-width: 100%; }
.checkbox-label span[data-i18n] { white-space: normal; word-break: normal; }


