/* =============================================
   AKARIBOT DASHBOARD - ESTILO NEKOTINA
   Diseño moderno oscuro con acentos púrpura
   Versión 2.0 - Mejorado 2026
   ============================================= */

/* =============================================
   VARIABLES Y RESET
   ============================================= */
:root {
  /* Colores principales - Tema claro */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;

  /* Esquema de color del navegador (inputs, scrollbars, etc.) */
  --color-scheme: light;
  
  /* Alias de colores para compatibilidad */
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --hover-bg: #f1f5f9;
  
  /* Acentos */
  --accent-primary: #8b5cf6;
  --accent-secondary: #a78bfa;
  --accent-tertiary: #c4b5fd;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
  --accent-glow: rgba(139, 92, 246, 0.3);
  
  /* Colores de estado */
  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --warning: #eab308;
  --warning-light: rgba(234, 179, 8, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.15);
  
  /* Texto */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Iconos (FontAwesome) */
  --icon-muted: #64748b;

  /* Hover sutil (listas/rows) */
  --row-hover-bg: rgba(15, 23, 42, 0.03);

  /* Tiles de emojis (inventario/equipo) */
  --emoji-tile-bg: rgba(15, 23, 42, 0.04);

  /* Bordes */
  --border-color: rgba(15, 23, 42, 0.10);
  --border-color-light: rgba(15, 23, 42, 0.14);
  --border-focus: var(--accent-primary);
  
  /* Sombras */
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 10px 28px rgba(15, 23, 42, 0.14);
  --shadow-xl: 0 16px 56px rgba(15, 23, 42, 0.16);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* Bordes redondeados */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
  --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Sidebar */
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  
  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
}

/* Tema oscuro (gris, no negro puro) */
html[data-theme="dark"] {
  --bg-primary: #1f2937;
  --bg-secondary: #273449;
  --bg-tertiary: #334155;
  --bg-card: #111827;
  --bg-card-hover: #1f2a3a;

  --card-bg: var(--bg-card);
  --input-bg: var(--bg-tertiary);
  --hover-bg: var(--bg-card-hover);

  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --border-color: rgba(255, 255, 255, 0.10);
  --border-color-light: rgba(255, 255, 255, 0.14);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.42);
  --shadow-xl: 0 16px 56px rgba(0, 0, 0, 0.48);

  --color-scheme: dark;
  --icon-muted: rgba(255, 255, 255, 0.85);
  --row-hover-bg: rgba(255, 255, 255, 0.04);
  --emoji-tile-bg: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Focus visible mejorado para accesibilidad */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Selección de texto */
::selection {
  background: var(--accent-primary);
  color: white;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* =============================================
   LAYOUT PRINCIPAL CON SIDEBAR
   ============================================= */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  /* En móviles, 100vh puede incluir la barra del navegador y cortar el footer.
     Usamos unidades dinámicas cuando están disponibles. */
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100svh;
  max-height: 100dvh;
  z-index: 1000;
  transition: width var(--transition-normal);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow);
}

.sidebar-title {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  padding-bottom: calc(1rem + 80px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-section {
  margin-bottom: 1.5rem;
}

.nav-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  margin: 0.2rem 0;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-left-color: var(--accent-primary);
}

.nav-item.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--icon-muted);
}

.nav-item:hover i,
.nav-item.active i {
  color: var(--accent-primary);
}

.nav-item-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  visibility: visible;
}

.nav-item.active .nav-item-badge {
  color: white;
  opacity: 1;
  visibility: visible;
}

/* Sidebar User Footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-status {
  font-size: 0.75rem;
  color: var(--success);
}

.sidebar-logout {
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.sidebar-logout:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.theme-dropdown {
  position: relative;
}

.theme-toggle-btn {
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.theme-toggle-btn:hover {
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.12);
}

.theme-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.theme-dropdown.active .theme-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  text-align: left;
}

.theme-option:hover {
  background: var(--bg-tertiary);
}

.theme-option.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--accent-primary);
}

.theme-option i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================
   TOP NAVBAR
   ============================================= */
.top-navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(10px);
}

.navbar-search {
  position: relative;
  max-width: 400px;
  flex: 1;
}

.navbar-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.navbar-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.navbar-search input::placeholder {
  color: var(--text-muted);
}

.navbar-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Navbar (header) */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 900;
  backdrop-filter: blur(10px);
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}

.navbar-brand:hover {
  color: var(--accent-primary);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.user-dropdown {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.user-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 1001;
}

.user-dropdown:hover .dropdown-menu,
.user-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  border: none;
  margin: 0.5rem 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* =============================================
   PAGE CONTENT
   ============================================= */
.page-content {
  flex: 1;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title i {
  color: var(--accent-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.breadcrumb span {
  color: var(--text-secondary);
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-color-light);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title i {
  color: var(--accent-primary);
}

.card-body {
  color: var(--text-secondary);
}

/* =============================================
   STATS CARDS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-primary); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-icon.yellow { background: rgba(234, 179, 8, 0.15); color: var(--warning); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-icon.pink { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.stat-icon.orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat-change {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.stat-change.positive {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.stat-change.negative {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* =============================================
   SERVER SELECTOR CARDS
   ============================================= */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.server-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent-primary);
}

.server-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.server-icon img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.server-info {
  flex: 1;
  min-width: 0;
}

.server-name {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.server-members {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.server-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.server-status.inactive {
  background: var(--text-muted);
  box-shadow: none;
}

/* =============================================
   CONFIGURATION SECTIONS
   ============================================= */
.config-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.config-section-header {
  padding: 1.25rem 1.5rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-section-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-section-title i {
  color: var(--accent-primary);
}

.config-section-body {
  padding: 1.5rem;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-label-hint {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-select {
  color-scheme: var(--color-scheme);
}

select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  color-scheme: var(--color-scheme);
}

select option,
select optgroup,
.form-select option,
.form-select optgroup {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.toggle-info {
  flex: 1;
}

.toggle-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.toggle-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toggle {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle input:checked + .toggle-slider::before {
  background: white;
  transform: translateX(24px);
}

/* Color Picker */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-preview {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  cursor: pointer;
}

.color-input {
  flex: 1;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #16a34a;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* =============================================
   PREVIEW CARD (Para mensajes)
   ============================================= */
.preview-card {
  background: #36393f;
  border-radius: var(--radius-md);
  padding: 1rem;
  border-left: 4px solid var(--accent-primary);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-gradient);
}

.preview-bot-name {
  font-weight: 600;
  color: var(--accent-primary);
}

.preview-bot-tag {
  background: #5865f2;
  color: white;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.5rem;
}

.preview-timestamp {
  font-size: 0.75rem;
  color: #72767d;
  margin-left: 0.5rem;
}

.preview-content {
  color: #dcddde;
  font-size: 0.95rem;
  line-height: 1.5;
}

.preview-embed {
  background: #2f3136;
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.5rem;
  border-left: 4px solid var(--accent-primary);
}

.preview-embed-title {
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.preview-embed-desc {
  color: #dcddde;
  font-size: 0.9rem;
}

.preview-embed-footer {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #72767d;
}

/* =============================================
   VARIABLES INFO
   ============================================= */
.variables-info {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
}

.variables-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.variables-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variable-tag {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--accent-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variable-tag:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* =============================================
   TABS
   ============================================= */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.3);
  color: var(--warning);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--info);
}

/* =============================================
   TABLES
   ============================================= */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tr:hover td {
  background: var(--bg-tertiary);
}

/* =============================================
   LOADING
   ============================================= */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-desc {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

/* =============================================
   HERO LANDING
   ============================================= */
.hero-landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: 
    radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15), transparent 50%),
    radial-gradient(ellipse at bottom, rgba(59, 130, 246, 0.1), transparent 50%),
    var(--bg-primary);
}

.hero-logo {
  width: 120px;
  height: 120px;
  background: var(--accent-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-glow);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* =============================================
   QUICK LINKS (Dashboard)
   ============================================= */
.quick-links {
  margin: 2rem 0;
}

.quick-links h2 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.link-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.link-card i {
  font-size: 2rem;
  color: var(--accent-primary);
}

.link-card span {
  font-weight: 500;
}

.admin-link {
  border-color: rgba(239, 68, 68, 0.3);
}

.admin-link i {
  color: var(--danger);
}

.admin-link:hover {
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

/* =============================================
   LEADERBOARD
   ============================================= */
.leaderboard-section {
  margin: 2rem 0;
}

.leaderboard-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leaderboard-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-item:hover {
  background: var(--bg-tertiary);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.leaderboard-rank.gold {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #000;
}

.leaderboard-rank.silver {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #000;
}

.leaderboard-rank.bronze {
  background: linear-gradient(135deg, #cd7f32, #a0522d);
  color: #fff;
}

.leaderboard-user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.leaderboard-name {
  font-weight: 500;
}

.leaderboard-value {
  font-weight: 700;
  color: var(--accent-primary);
}

.leaderboard-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.leaderboard-rank.rank-1 {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #000;
  font-size: 1.1rem;
}

.leaderboard-rank.rank-2 {
  background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
  color: #000;
}

.leaderboard-rank.rank-3 {
  background: linear-gradient(135deg, #cd7f32, #a0522d);
  color: #fff;
}

.leaderboard-item.rank-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
}

.leaderboard-item.rank-2 {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.1), transparent);
}

.leaderboard-item.rank-3 {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.1), transparent);
}

.level-badge {
  background: var(--accent-gradient);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.xp-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.coins-value {
  font-weight: 700;
  color: #ffd700;
  font-size: 1rem;
}

.coin-icon {
  color: #ffd700;
  margin-left: 0.25rem;
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.loading-spinner i {
  margin-right: 0.5rem;
}

.no-data, .error {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.error {
  color: var(--danger);
}

/* =============================================
   WELCOME BANNER
   ============================================= */
.welcome-banner {
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.welcome-banner h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.welcome-banner p {
  opacity: 0.9;
  position: relative;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-menu-btn {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .server-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .page-content {
    padding: 1rem;
  }
  
  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* =============================================
   TOAST NOTIFICATIONS (Mejorado)
   ============================================= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.success i:first-child {
  color: var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.error i:first-child {
  color: var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.warning i:first-child {
  color: var(--warning);
}

.toast.info {
  border-left: 4px solid var(--info);
}

.toast.info i:first-child {
  color: var(--info);
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* =============================================
   MODAL PERSONALIZADO
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.closing {
  animation: fadeOut 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 450px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.closing .modal-content {
  animation: modalSlideOut 0.2s ease forwards;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.modal-message {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* =============================================
   ADMIN USERS (admin-users.ejs)
   ============================================= */
/* Alias para modales legacy usados en admin-users */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  overflow-y: auto;
}

/* En páginas con modales grandes (mochila), el scroll debe ser del modal */
.modal .modal-content {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-wide {
  max-width: 900px;
}

.close {
  margin-left: auto;
  font-size: 28px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.close:hover {
  color: var(--text-primary);
}

.skill-levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.skill-icon {
  font-size: 1.75rem;
  width: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-info { flex: 1; }

.skill-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.skill-bar {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow);
}

.skill-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upgrades-bars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.upgrades-meta {
  margin: -0.25rem 0 0.75rem;
  color: var(--text-secondary);
  font-weight: 800;
}

.upgrade-bar-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
}

.upgrade-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.upgrade-bar-title {
  font-weight: 700;
  color: var(--text-primary);
}

.upgrade-bar-level {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.upgrade-bar {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.upgrade-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
}

/* Mochila (admin-users) - diseño legible */
.inventory-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.inventory-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
}

.inventory-search {
  flex: 1;
}

.inventory-sections {
  display: grid;
  gap: 0.75rem;
}

.inventory-section {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.inventory-section-title {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  font-weight: 800;
  cursor: pointer;
}

.inventory-section-title:hover {
  background: var(--bg-card-hover);
}

.inventory-section-count {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
}

.inventory-list {
  display: grid;
}

.inventory-list.collapsed {
  display: none;
}

.inventory-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
}

.inventory-row:hover {
  background: var(--row-hover-bg);
}

.inv-emoji {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--emoji-tile-bg);
  border: 1px solid var(--border-color);
  font-size: 1.25rem;
}

.inv-emoji img.discord-emoji {
  width: 26px;
  height: 26px;
}

.inv-name {
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.inv-sub {
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inv-qty {
  font-weight: 900;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-rarity {
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rarity-common { background: rgba(148, 163, 184, 0.18); color: #94a3b8; }
.rarity-uncommon { background: rgba(34, 197, 94, 0.18); color: #22c55e; }
.rarity-rare { background: rgba(59, 130, 246, 0.18); color: #3b82f6; }
.rarity-epic { background: rgba(168, 85, 247, 0.18); color: #a855f7; }
.rarity-legendary { background: rgba(251, 146, 60, 0.18); color: #fb923c; }
.rarity-mythic { background: rgba(239, 68, 68, 0.18); color: #ef4444; }

/* Equipo compacto (admin-users) */
.equipment-compact {
  display: grid;
  gap: 0.5rem;
}

.equipment-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.equipment-slot {
  color: var(--text-secondary);
  font-weight: 800;
}

.equipment-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.equipment-item img.discord-emoji {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .inventory-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .inventory-summary {
    white-space: normal;
  }
  .equipment-row {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-accent { color: var(--accent-primary); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.align-start { align-items: flex-start; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }
.min-h-screen { min-height: 100vh; }

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 100px;
  border-radius: var(--radius-md);
}

/* Animaciones */
.fade-in {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Print styles */
@media print {
  .sidebar,
  .top-navbar,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* =============================================
   PAGINATION STYLES
   ============================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pagination-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.pagination-btn i {
  font-size: 0.9rem;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 1rem;
}

/* Mobile pagination */
@media (max-width: 640px) {
  .pagination {
    gap: 0.25rem;
    margin: 1.5rem 0;
  }
  
  .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
  
  .pagination-info {
    margin: 0 0.5rem;
    font-size: 0.8rem;
  }
  
  /* Hide page numbers on very small screens, show only prev/next */
  .pagination .page-number {
    display: none;
  }
  
  .pagination .page-number:first-child,
  .pagination .page-number:last-child {
    display: inline-flex;
  }
}
